|
|
!(function(){var ql=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[9716],{70557:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return b}});var N=S(72308),B=S(59301),V={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},I=V,A=S(7657),d=function(E,f){return B.createElement(A.Z,(0,N.Z)({},E,{ref:f,icon:I}))},U=B.forwardRef(d),b=U},84105:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return b}});var N=S(72308),B=S(59301),V={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},I=V,A=S(7657),d=function(E,f){return B.createElement(A.Z,(0,N.Z)({},E,{ref:f,icon:I}))},U=B.forwardRef(d),b=U},73331:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return b}});var N=S(72308),B=S(59301),V={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},I=V,A=S(7657),d=function(E,f){return B.createElement(A.Z,(0,N.Z)({},E,{ref:f,icon:I}))},U=B.forwardRef(d),b=U},15277:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return b}});var N=S(72308),B=S(59301),V={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},I=V,A=S(7657),d=function(E,f){return B.createElement(A.Z,(0,N.Z)({},E,{ref:f,icon:I}))},U=B.forwardRef(d),b=U},47472:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return b}});var N=S(72308),B=S(59301),V={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},I=V,A=S(7657),d=function(E,f){return B.createElement(A.Z,(0,N.Z)({},E,{ref:f,icon:I}))},U=B.forwardRef(d),b=U},87395:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return b}});var N=S(72308),B=S(59301),V={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},I=V,A=S(7657),d=function(E,f){return B.createElement(A.Z,(0,N.Z)({},E,{ref:f,icon:I}))},U=B.forwardRef(d),b=U},35593:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return $t}});var N=S(77321),B=S(52487),V=S(74416),I=S(43403),A=S(92310),d=S.n(A),U=S(29301),b=S(76846),n=S(96452),E=S(6089),f=S(80402),c=S(34280),l=S(49658),u=S(59301),m=S(72308),x=S(77900),F=S(8654);function k(Me){var ze=Me.prefixCls,Ue=Me.align,ot=Me.arrow,ut=Me.arrowPos,ue=ot||{},be=ue.className,De=ue.content,Ae=ut.x,Ne=Ae===void 0?0:Ae,je=ut.y,Qe=je===void 0?0:je,at=u.useRef();if(!Ue||!Ue.points)return null;var Je={position:"absolute"};if(Ue.autoArrow!==!1){var We=Ue.points[0],vt=Ue.points[1],gt=We[0],mt=We[1],xt=vt[0],Lt=vt[1];gt===xt||!["t","b"].includes(gt)?Je.top=Qe:gt==="t"?Je.top=0:Je.bottom=0,mt===Lt||!["l","r"].includes(mt)?Je.left=Ne:mt==="l"?Je.left=0:Je.right=0}return u.createElement("div",{ref:at,className:d()("".concat(ze,"-arrow"),be),style:Je},De)}function T(Me){var ze=Me.prefixCls,Ue=Me.open,ot=Me.zIndex,ut=Me.mask,ue=Me.motion;return ut?u.createElement(x.default,(0,m.Z)({},ue,{motionAppear:!0,visible:Ue,removeOnLeave:!0}),function(be){var De=be.className;return u.createElement("div",{style:{zIndex:ot},className:d()("".concat(ze,"-mask"),De)})}):null}var L=u.memo(function(Me){var ze=Me.children;return ze},function(Me,ze){return ze.cache}),W=L,P=u.forwardRef(function(Me,ze){var Ue=Me.popup,ot=Me.className,ut=Me.prefixCls,ue=Me.style,be=Me.target,De=Me.onVisibleChanged,Ae=Me.open,Ne=Me.keepDom,je=Me.fresh,Qe=Me.onClick,at=Me.mask,Je=Me.arrow,We=Me.arrowPos,vt=Me.align,gt=Me.motion,mt=Me.maskMotion,xt=Me.forceRender,Lt=Me.getPopupContainer,yt=Me.autoDestroy,Mt=Me.portal,Nt=Me.zIndex,j=Me.onMouseEnter,Z=Me.onMouseLeave,tt=Me.onPointerEnter,oe=Me.ready,xe=Me.offsetX,Kt=Me.offsetY,ke=Me.offsetR,Pe=Me.offsetB,He=Me.onAlign,he=Me.onPrepare,ge=Me.stretch,ye=Me.targetWidth,Ie=Me.targetHeight,ae=typeof Ue=="function"?Ue():Ue,_t=Ae||Ne,we=(Lt==null?void 0:Lt.length)>0,kt=u.useState(!Lt||!we),Ft=(0,B.Z)(kt,2),er=Ft[0],Vt=Ft[1];if((0,c.Z)(function(){!er&&we&&be&&Vt(!0)},[er,we,be]),!er)return null;var It="auto",Tt={left:"-1000vw",top:"-1000vh",right:It,bottom:It};if(oe||!Ae){var fr,$r=vt.points,zr=vt.dynamicInset||((fr=vt._experimental)===null||fr===void 0?void 0:fr.dynamicInset),Qr=zr&&$r[0][1]==="r",Ot=zr&&$r[0][0]==="b";Qr?(Tt.right=ke,Tt.left=It):(Tt.left=xe,Tt.right=It),Ot?(Tt.bottom=Pe,Tt.top=It):(Tt.top=Kt,Tt.bottom=It)}var Yt={};return ge&&(ge.includes("height")&&Ie?Yt.height=Ie:ge.includes("minHeight")&&Ie&&(Yt.minHeight=Ie),ge.includes("width")&&ye?Yt.width=ye:ge.includes("minWidth")&&ye&&(Yt.minWidth=ye)),Ae||(Yt.pointerEvents="none"),u.createElement(Mt,{open:xt||_t,getContainer:Lt&&function(){return Lt(be)},autoDestroy:yt},u.createElement(T,{prefixCls:ut,open:Ae,zIndex:Nt,mask:at,motion:mt}),u.createElement(U.Z,{onResize:He,disabled:!Ae},function(wr){return u.createElement(x.default,(0,m.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:xt,leavedClassName:"".concat(ut,"-hidden")},gt,{onAppearPrepare:he,onEnterPrepare:he,visible:Ae,onVisibleChanged:function(Rr){var di;gt==null||(di=gt.onVisibleChanged)===null||di===void 0||di.call(gt,Rr),De(Rr)}}),function(Hr,Rr){var di=Hr.className,Er=Hr.style,wi=d()(ut,di,ot);return u.createElement("div",{ref:(0,F.sQ)(wr,ze,Rr),className:wi,style:(0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)({"--arrow-x":"".concat(We.x||0,"px"),"--arrow-y":"".concat(We.y||0,"px")},Tt),Yt),Er),{},{boxSizing:"border-box",zIndex:Nt},ue),onMouseEnter:j,onMouseLeave:Z,onPointerEnter:tt,onClick:Qe},Je&&u.createElement(k,{prefixCls:ut,arrow:Je,arrowPos:We,align:vt}),u.createElement(W,{cache:!Ae&&!je},ae))})}))}),O=P,$=u.forwardRef(function(Me,ze){var Ue=Me.children,ot=Me.getTriggerDOMNode,ut=(0,F.Yr)(Ue),ue=u.useCallback(function(De){(0,F.mH)(ze,ot?ot(De):De)},[ot]),be=(0,F.x1)(ue,Ue.ref);return ut?u.cloneElement(Ue,{ref:be}):Ue}),z=$,ie=u.createContext(null),te=ie;function me(Me){return Me?Array.isArray(Me)?Me:[Me]:[]}function _e(Me,ze,Ue,ot){return u.useMemo(function(){var ut=me(Ue!=null?Ue:ze),ue=me(ot!=null?ot:ze),be=new Set(ut),De=new Set(ue);return Me&&(be.has("hover")&&(be.delete("hover"),be.add("click")),De.has("hover")&&(De.delete("hover"),De.add("click"))),[be,De]},[Me,ze,Ue,ot])}var le=S(29194);function Q(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ue=arguments.length>2?arguments[2]:void 0;return Ue?Me[0]===ze[0]:Me[0]===ze[0]&&Me[1]===ze[1]}function se(Me,ze,Ue,ot){for(var ut=Ue.points,ue=Object.keys(Me),be=0;be<ue.length;be+=1){var De,Ae=ue[be];if(Q((De=Me[Ae])===null||De===void 0?void 0:De.points,ut,ot))return"".concat(ze,"-placement-").concat(Ae)}return""}function H(Me,ze,Ue,ot){return ze||(Ue?{motionName:"".concat(Me,"-").concat(Ue)}:ot?{motionName:ot}:null)}function J(Me){return Me.ownerDocument.defaultView}function K(Me){for(var ze=[],Ue=Me==null?void 0:Me.parentElement,ot=["hidden","scroll","clip","auto"];Ue;){var ut=J(Ue).getComputedStyle(Ue),ue=ut.overflowX,be=ut.overflowY,De=ut.overflow;[ue,be,De].some(function(Ae){return ot.includes(Ae)})&&ze.push(Ue),Ue=Ue.parentElement}return ze}function M(Me){var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Me)?ze:Me}function D(Me){return M(parseFloat(Me),0)}function ne(Me,ze){var Ue=(0,N.Z)({},Me);return(ze||[]).forEach(function(ot){if(!(ot instanceof HTMLBodyElement||ot instanceof HTMLHtmlElement)){var ut=J(ot).getComputedStyle(ot),ue=ut.overflow,be=ut.overflowClipMargin,De=ut.borderTopWidth,Ae=ut.borderBottomWidth,Ne=ut.borderLeftWidth,je=ut.borderRightWidth,Qe=ot.getBoundingClientRect(),at=ot.offsetHeight,Je=ot.clientHeight,We=ot.offsetWidth,vt=ot.clientWidth,gt=D(De),mt=D(Ae),xt=D(Ne),Lt=D(je),yt=M(Math.round(Qe.width/We*1e3)/1e3),Mt=M(Math.round(Qe.height/at*1e3)/1e3),Nt=(We-vt-xt-Lt)*yt,j=(at-Je-gt-mt)*Mt,Z=gt*Mt,tt=mt*Mt,oe=xt*yt,xe=Lt*yt,Kt=0,ke=0;if(ue==="clip"){var Pe=D(be);Kt=Pe*yt,ke=Pe*Mt}var He=Qe.x+oe-Kt,he=Qe.y+Z-ke,ge=He+Qe.width+2*Kt-oe-xe-Nt,ye=he+Qe.height+2*ke-Z-tt-j;Ue.left=Math.max(Ue.left,He),Ue.top=Math.max(Ue.top,he),Ue.right=Math.min(Ue.right,ge),Ue.bottom=Math.min(Ue.bottom,ye)}}),Ue}function de(Me){var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Ue="".concat(ze),ot=Ue.match(/^(.*)\%$/);return ot?Me*(parseFloat(ot[1])/100):parseFloat(Ue)}function Oe(Me,ze){var Ue=ze||[],ot=(0,B.Z)(Ue,2),ut=ot[0],ue=ot[1];return[de(Me.width,ut),de(Me.height,ue)]}function Ve(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Me[0],Me[1]]}function nt(Me,ze){var Ue=ze[0],ot=ze[1],ut,ue;return Ue==="t"?ue=Me.y:Ue==="b"?ue=Me.y+Me.height:ue=Me.y+Me.height/2,ot==="l"?ut=Me.x:ot==="r"?ut=Me.x+Me.width:ut=Me.x+Me.width/2,{x:ut,y:ue}}function Fe(Me,ze){var Ue={t:"b",b:"t",l:"r",r:"l"};return Me.map(function(ot,ut){return ut===ze?Ue[ot]||"c":ot}).join("")}function rt(Me,ze,Ue,ot,ut,ue,be){var De=u.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:ut[ot]||{}}),Ae=(0,B.Z)(De,2),Ne=Ae[0],je=Ae[1],Qe=u.useRef(0),at=u.useMemo(function(){return ze?K(ze):[]},[ze]),Je=u.useRef({}),We=function(){Je.current={}};Me||We();var vt=(0,E.Z)(function(){if(ze&&Ue&&Me){let ei=function(Ti,Ji){var hn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wi,fn=ae.x+Ti,en=ae.y+Ji,xr=fn+fr,fi=en+Tt,Fn=Math.max(fn,hn.left),Cn=Math.max(en,hn.top),Bn=Math.min(xr,hn.right),Nn=Math.min(fi,hn.bottom);return Math.max(0,(Bn-Fn)*(Nn-Cn))},Dr=function(){rr=ae.y+Ar,Mr=rr+Tt,Fr=ae.x+hr,En=Fr+fr};var xt,Lt,yt=ze,Mt=yt.ownerDocument,Nt=J(yt),j=Nt.getComputedStyle(yt),Z=j.width,tt=j.height,oe=j.position,xe=yt.style.left,Kt=yt.style.top,ke=yt.style.right,Pe=yt.style.bottom,He=yt.style.overflow,he=(0,N.Z)((0,N.Z)({},ut[ot]),ue),ge=Mt.createElement("div");(xt=yt.parentElement)===null||xt===void 0||xt.appendChild(ge),ge.style.left="".concat(yt.offsetLeft,"px"),ge.style.top="".concat(yt.offsetTop,"px"),ge.style.position=oe,ge.style.height="".concat(yt.offsetHeight,"px"),ge.style.width="".concat(yt.offsetWidth,"px"),yt.style.left="0",yt.style.top="0",yt.style.right="auto",yt.style.bottom="auto",yt.style.overflow="hidden";var ye;if(Array.isArray(Ue))ye={x:Ue[0],y:Ue[1],width:0,height:0};else{var Ie=Ue.getBoundingClientRect();ye={x:Ie.x,y:Ie.y,width:Ie.width,height:Ie.height}}var ae=yt.getBoundingClientRect(),_t=Mt.documentElement,we=_t.clientWidth,kt=_t.clientHeight,Ft=_t.scrollWidth,er=_t.scrollHeight,Vt=_t.scrollTop,It=_t.scrollLeft,Tt=ae.height,fr=ae.width,$r=ye.height,zr=ye.width,Qr={left:0,top:0,right:we,bottom:kt},Ot={left:-It,top:-Vt,right:Ft-It,bottom:er-Vt},Yt=he.htmlRegion,wr="visible",Hr="visibleFirst";Yt!=="scroll"&&Yt!==Hr&&(Yt=wr);var Rr=Yt===Hr,di=ne(Ot,at),Er=ne(Qr,at),wi=Yt===wr?Er:di,si=Rr?Er:wi;yt.style.left="auto",yt.style.top="auto",yt.style.right="0",yt.style.bottom="0";var Ri=yt.getBoundingClientRect();yt.style.left=xe,yt.style.top=Kt,yt.style.right=ke,yt.style.bottom=Pe,yt.style.overflow=He,(Lt=yt.parentElement)===null||Lt===void 0||Lt.removeChild(ge);var Ht=M(Math.round(fr/parseFloat(Z)*1e3)/1e3),Ut=M(Math.round(Tt/parseFloat(tt)*1e3)/1e3);if(Ht===0||Ut===0||(0,b.Sh)(Ue)&&!(0,le.Z)(Ue))return;var ur=he.offset,pr=he.targetOffset,sr=Oe(ae,ur),gi=(0,B.Z)(sr,2),kr=gi[0],ui=gi[1],Br=Oe(ye,pr),mr=(0,B.Z)(Br,2),jr=mr[0],ai=mr[1];ye.x-=jr,ye.y-=ai;var Gr=he.points||[],pi=(0,B.Z)(Gr,2),cr=pi[0],Cr=pi[1],yr=Ve(Cr),Tr=Ve(cr),ci=nt(ye,yr),oi=nt(ae,Tr),Mi=(0,N.Z)({},he),hr=ci.x-oi.x+kr,Ar=ci.y-oi.y+ui,ki=ei(hr,Ar),Fi=ei(hr,Ar,Er),ji=nt(ye,["t","l"]),In=nt(ae,["t","l"]),Zi=nt(ye,["b","r"]),Sn=nt(ae,["b","r"]),mi=he.overflow||{},on=mi.adjustX,Xi=mi.adjustY,ln=mi.shiftX,Xr=mi.shiftY,et=function(Ji){return typeof Ji=="boolean"?Ji:Ji>=0},rr,Mr,Fr,En;Dr();var Wi=et(Xi),Ai=Tr[0]===yr[0];if(Wi&&Tr[0]==="t"&&(Mr>si.bottom||Je.current.bt)){var gr=Ar;Ai?gr-=Tt-$r:gr=ji.y-Sn.y-ui;var Ci=ei(hr,gr),Ii=ei(hr,gr,Er);Ci>ki||Ci===ki&&(!Rr||Ii>=Fi)?(Je.current.bt=!0,Ar=gr,ui=-ui,Mi.points=[Fe(Tr,0),Fe(yr,0)]):Je.current.bt=!1}if(Wi&&Tr[0]==="b"&&(rr<si.top||Je.current.tb)){var hi=Ar;Ai?hi+=Tt-$r:hi=Zi.y-In.y-ui;var Wn=ei(hr,hi),Gn=ei(hr,hi,Er);Wn>ki||Wn===ki&&(!Rr||Gn>=Fi)?(Je.current.tb=!0,Ar=hi,ui=-ui,Mi.points=[Fe(Tr,0),Fe(yr,0)]):Je.current.tb=!1}var un=et(on),Gi=Tr[1]===yr[1];if(un&&Tr[1]==="l"&&(En>si.right||Je.current.rl)){var jt=hr;Gi?jt-=fr-zr:jt=ji.x-Sn.x-kr;var Bi=ei(jt,Ar),Jr=ei(jt,Ar,Er);Bi>ki||Bi===ki&&(!Rr||Jr>=Fi)?(Je.current.rl=!0,hr=jt,kr=-kr,Mi.points=[Fe(Tr,1),Fe(yr,1)]):Je.current.rl=!1}if(un&&Tr[1]==="r"&&(Fr<si.left||Je.current.lr)){var _i=hr;Gi?_i+=fr-zr:_i=Zi.x-In.x-kr;var Kn=ei(_i,Ar),bi=ei(_i,Ar,Er);Kn>ki||Kn===ki&&(!Rr||bi>=Fi)?(Je.current.lr=!0,hr=_i,kr=-kr,Mi.points=[Fe(Tr,1),Fe(yr,1)]):Je.current.lr=!1}Dr();var Ni=ln===!0?0:ln;typeof Ni=="number"&&(Fr<Er.left&&(hr-=Fr-Er.left-kr,ye.x+zr<Er.left+Ni&&(hr+=ye.x-Er.left+zr-Ni)),En>Er.right&&(hr-=En-Er.right-kr,ye.x>Er.right-Ni&&(hr+=ye.x-Er.right+Ni)));var Ki=Xr===!0?0:Xr;typeof Ki=="number"&&(rr<Er.top&&(Ar-=rr-Er.top-ui,ye.y+$r<Er.top+Ki&&(Ar+=ye.y-Er.top+$r-Ki)),Mr>Er.bottom&&(Ar-=Mr-Er.bottom-ui,ye.y>Er.bottom-Ki&&(Ar+=ye.y-Er.bottom+Ki)));var Kr=ae.x+hr,Qi=Kr+fr,tr=ae.y+Ar,On=tr+Tt,Ui=ye.x,Si=Ui+zr,br=ye.y,xn=br+$r,Pn=Math.max(Kr,Ui),wn=Math.min(Qi,Si),_r=(Pn+wn)/2,cn=_r-Kr,ts=Math.max(tr,br),wt=Math.min(On,xn),vi=(ts+wt)/2,Mn=vi-tr;be==null||be(ze,Mi);var An=Ri.right-ae.x-(hr+ae.width),li=Ri.bottom-ae.y-(Ar+ae.height);je({ready:!0,offsetX:hr/Ht,offsetY:Ar/Ut,offsetR:An/Ht,offsetB:li/Ut,arrowX:cn/Ht,arrowY:Mn/Ut,scaleX:Ht,scaleY:Ut,align:Mi})}}),gt=function(){Qe.current+=1;var Lt=Qe.current;Promise.resolve().then(function(){Qe.current===Lt&&vt()})},mt=function(){je(function(Lt){return(0,N.Z)((0,N.Z)({},Lt),{},{ready:!1})})};return(0,c.Z)(mt,[ot]),(0,c.Z)(function(){Me||mt()},[Me]),[Ne.ready,Ne.offsetX,Ne.offsetY,Ne.offsetR,Ne.offsetB,Ne.arrowX,Ne.arrowY,Ne.scaleX,Ne.scaleY,Ne.align,gt]}var Ze=S(80702);function st(Me,ze,Ue,ot,ut){(0,c.Z)(function(){if(Me&&ze&&Ue){let Qe=function(){ot(),ut()};var ue=ze,be=Ue,De=K(ue),Ae=K(be),Ne=J(be),je=new Set([Ne].concat((0,Ze.Z)(De),(0,Ze.Z)(Ae)));return je.forEach(function(at){at.addEventListener("scroll",Qe,{passive:!0})}),Ne.addEventListener("resize",Qe,{passive:!0}),ot(),function(){je.forEach(function(at){at.removeEventListener("scroll",Qe),Ne.removeEventListener("resize",Qe)})}}},[Me,ze,Ue])}var At=S(48736),Jt=S(16089);function pt(Me,ze,Ue,ot,ut,ue,be,De){var Ae=u.useRef(Me),Ne=u.useRef(!1);Ae.current!==Me&&(Ne.current=!0,Ae.current=Me),u.useEffect(function(){var je=(0,Jt.Z)(function(){Ne.current=!1});return function(){Jt.Z.cancel(je)}},[Me]),u.useEffect(function(){if(ze&&ot&&(!ut||ue)){var je=function(){var oe=!1,xe=function(Pe){var He=Pe.target;oe=be(He)},Kt=function(Pe){var He=Pe.target;!Ne.current&&Ae.current&&!oe&&!be(He)&&De(!1)};return[xe,Kt]},Qe=je(),at=(0,B.Z)(Qe,2),Je=at[0],We=at[1],vt=je(),gt=(0,B.Z)(vt,2),mt=gt[0],xt=gt[1],Lt=J(ot);Lt.addEventListener("mousedown",Je,!0),Lt.addEventListener("click",We,!0),Lt.addEventListener("contextmenu",We,!0);var yt=(0,n.A)(Ue);if(yt&&(yt.addEventListener("mousedown",mt,!0),yt.addEventListener("click",xt,!0),yt.addEventListener("contextmenu",xt,!0)),0)var Mt,Nt,j,Z;return function(){Lt.removeEventListener("mousedown",Je,!0),Lt.removeEventListener("click",We,!0),Lt.removeEventListener("contextmenu",We,!0),yt&&(yt.removeEventListener("mousedown",mt,!0),yt.removeEventListener("click",xt,!0),yt.removeEventListener("contextmenu",xt,!0))}}},[ze,Ue,ot,ut,ue])}var Bt=["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 zt(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I.Z,ze=u.forwardRef(function(Ue,ot){var ut=Ue.prefixCls,ue=ut===void 0?"rc-trigger-popup":ut,be=Ue.children,De=Ue.action,Ae=De===void 0?"hover":De,Ne=Ue.showAction,je=Ue.hideAction,Qe=Ue.popupVisible,at=Ue.defaultPopupVisible,Je=Ue.onPopupVisibleChange,We=Ue.afterPopupVisibleChange,vt=Ue.mouseEnterDelay,gt=Ue.mouseLeaveDelay,mt=gt===void 0?.1:gt,xt=Ue.focusDelay,Lt=Ue.blurDelay,yt=Ue.mask,Mt=Ue.maskClosable,Nt=Mt===void 0?!0:Mt,j=Ue.getPopupContainer,Z=Ue.forceRender,tt=Ue.autoDestroy,oe=Ue.destroyPopupOnHide,xe=Ue.popup,Kt=Ue.popupClassName,ke=Ue.popupStyle,Pe=Ue.popupPlacement,He=Ue.builtinPlacements,he=He===void 0?{}:He,ge=Ue.popupAlign,ye=Ue.zIndex,Ie=Ue.stretch,ae=Ue.getPopupClassNameFromAlign,_t=Ue.fresh,we=Ue.alignPoint,kt=Ue.onPopupClick,Ft=Ue.onPopupAlign,er=Ue.arrow,Vt=Ue.popupMotion,It=Ue.maskMotion,Tt=Ue.popupTransitionName,fr=Ue.popupAnimation,$r=Ue.maskTransitionName,zr=Ue.maskAnimation,Qr=Ue.className,Ot=Ue.getTriggerDOMNode,Yt=(0,V.Z)(Ue,Bt),wr=tt||oe||!1,Hr=u.useState(!1),Rr=(0,B.Z)(Hr,2),di=Rr[0],Er=Rr[1];(0,c.Z)(function(){Er((0,l.Z)())},[]);var wi=u.useRef({}),si=u.useContext(te),Ri=u.useMemo(function(){return{registerSubPopup:function(Zt,Wr){wi.current[Zt]=Wr,si==null||si.registerSubPopup(Zt,Wr)}}},[si]),Ht=(0,f.Z)(),Ut=u.useState(null),ur=(0,B.Z)(Ut,2),pr=ur[0],sr=ur[1],gi=(0,E.Z)(function(Wt){(0,b.Sh)(Wt)&&pr!==Wt&&sr(Wt),si==null||si.registerSubPopup(Ht,Wt)}),kr=u.useState(null),ui=(0,B.Z)(kr,2),Br=ui[0],mr=ui[1],jr=u.useRef(null),ai=(0,E.Z)(function(Wt){(0,b.Sh)(Wt)&&Br!==Wt&&(mr(Wt),jr.current=Wt)}),Gr=u.Children.only(be),pi=(Gr==null?void 0:Gr.props)||{},cr={},Cr=(0,E.Z)(function(Wt){var Zt,Wr,ti=Br;return(ti==null?void 0:ti.contains(Wt))||((Zt=(0,n.A)(ti))===null||Zt===void 0?void 0:Zt.host)===Wt||Wt===ti||(pr==null?void 0:pr.contains(Wt))||((Wr=(0,n.A)(pr))===null||Wr===void 0?void 0:Wr.host)===Wt||Wt===pr||Object.values(wi.current).some(function(qr){return(qr==null?void 0:qr.contains(Wt))||Wt===qr})}),yr=H(ue,Vt,fr,Tt),Tr=H(ue,It,zr,$r),ci=u.useState(at||!1),oi=(0,B.Z)(ci,2),Mi=oi[0],hr=oi[1],Ar=Qe!=null?Qe:Mi,ki=(0,E.Z)(function(Wt){Qe===void 0&&hr(Wt)});(0,c.Z)(function(){hr(Qe||!1)},[Qe]);var Fi=u.useRef(Ar);Fi.current=Ar;var ji=u.useRef([]);ji.current=[];var In=(0,E.Z)(function(Wt){var Zt;ki(Wt),((Zt=ji.current[ji.current.length-1])!==null&&Zt!==void 0?Zt:Ar)!==Wt&&(ji.current.push(Wt),Je==null||Je(Wt))}),Zi=u.useRef(),Sn=function(){clearTimeout(Zi.current)},mi=function(Zt){var Wr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Sn(),Wr===0?In(Zt):Zi.current=setTimeout(function(){In(Zt)},Wr*1e3)};u.useEffect(function(){return Sn},[]);var on=u.useState(!1),Xi=(0,B.Z)(on,2),ln=Xi[0],Xr=Xi[1];(0,c.Z)(function(Wt){(!Wt||Ar)&&Xr(!0)},[Ar]);var et=u.useState(null),rr=(0,B.Z)(et,2),Mr=rr[0],Fr=rr[1],En=u.useState([0,0]),Wi=(0,B.Z)(En,2),Ai=Wi[0],gr=Wi[1],Ci=function(Zt){gr([Zt.clientX,Zt.clientY])},Ii=rt(Ar,pr,we?Ai:Br,Pe,he,ge,Ft),hi=(0,B.Z)(Ii,11),Wn=hi[0],Gn=hi[1],un=hi[2],Gi=hi[3],jt=hi[4],Bi=hi[5],Jr=hi[6],_i=hi[7],Kn=hi[8],bi=hi[9],Ni=hi[10],Ki=_e(di,Ae,Ne,je),Kr=(0,B.Z)(Ki,2),Qi=Kr[0],tr=Kr[1],On=Qi.has("click"),Ui=tr.has("click")||tr.has("contextMenu"),Si=(0,E.Z)(function(){ln||Ni()}),br=function(){Fi.current&&we&&Ui&&mi(!1)};st(Ar,Br,pr,Si,br),(0,c.Z)(function(){Si()},[Ai,Pe]),(0,c.Z)(function(){Ar&&!(he!=null&&he[Pe])&&Si()},[JSON.stringify(ge)]);var xn=u.useMemo(function(){var Wt=se(he,ue,bi,we);return d()(Wt,ae==null?void 0:ae(bi))},[bi,ae,he,ue,we]);u.useImperativeHandle(ot,function(){return{nativeElement:jr.current,forceAlign:Si}});var Pn=u.useState(0),wn=(0,B.Z)(Pn,2),_r=wn[0],cn=wn[1],ts=u.useState(0),wt=(0,B.Z)(ts,2),vi=wt[0],Mn=wt[1],An=function(){if(Ie&&Br){var Zt=Br.getBoundingClientRect();cn(Zt.width),Mn(Zt.height)}},li=function(){An(),Si()},ei=function(Zt){Xr(!1),Ni(),We==null||We(Zt)},Dr=function(){return new Promise(function(Zt){An(),Fr(function(){return Zt})})};(0,c.Z)(function(){Mr&&(Ni(),Mr(),Fr(null))},[Mr]);function Ti(Wt,Zt,Wr,ti){cr[Wt]=function(qr){var tn;ti==null||ti(qr),mi(Zt,Wr);for(var dn=arguments.length,pn=new Array(dn>1?dn-1:0),rn=1;rn<dn;rn++)pn[rn-1]=arguments[rn];(tn=pi[Wt])===null||tn===void 0||tn.call.apply(tn,[pi,qr].concat(pn))}}(On||Ui)&&(cr.onClick=function(Wt){var Zt;Fi.current&&Ui?mi(!1):!Fi.current&&On&&(Ci(Wt),mi(!0));for(var Wr=arguments.length,ti=new Array(Wr>1?Wr-1:0),qr=1;qr<Wr;qr++)ti[qr-1]=arguments[qr];(Zt=pi.onClick)===null||Zt===void 0||Zt.call.apply(Zt,[pi,Wt].concat(ti))}),pt(Ar,Ui,Br,pr,yt,Nt,Cr,mi);var Ji=Qi.has("hover"),hn=tr.has("hover"),fn,en;Ji&&(Ti("onMouseEnter",!0,vt,function(Wt){Ci(Wt)}),Ti("onPointerEnter",!0,vt,function(Wt){Ci(Wt)}),fn=function(Zt){(Ar||ln)&&pr!==null&&pr!==void 0&&pr.contains(Zt.target)&&mi(!0,vt)},we&&(cr.onMouseMove=function(Wt){var Zt;(Zt=pi.onMouseMove)===null||Zt===void 0||Zt.call(pi,Wt)})),hn&&(Ti("onMouseLeave",!1,mt),Ti("onPointerLeave",!1,mt),en=function(){mi(!1,mt)}),Qi.has("focus")&&Ti("onFocus",!0,xt),tr.has("focus")&&Ti("onBlur",!1,Lt),Qi.has("contextMenu")&&(cr.onContextMenu=function(Wt){var Zt;Fi.current&&tr.has("contextMenu")?mi(!1):(Ci(Wt),mi(!0)),Wt.preventDefault();for(var Wr=arguments.length,ti=new Array(Wr>1?Wr-1:0),qr=1;qr<Wr;qr++)ti[qr-1]=arguments[qr];(Zt=pi.onContextMenu)===null||Zt===void 0||Zt.call.apply(Zt,[pi,Wt].concat(ti))}),Qr&&(cr.className=d()(pi.className,Qr));var xr=(0,N.Z)((0,N.Z)({},pi),cr),fi={},Fn=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Fn.forEach(function(Wt){Yt[Wt]&&(fi[Wt]=function(){for(var Zt,Wr=arguments.length,ti=new Array(Wr),qr=0;qr<Wr;qr++)ti[qr]=arguments[qr];(Zt=xr[Wt])===null||Zt===void 0||Zt.call.apply(Zt,[xr].concat(ti)),Yt[Wt].apply(Yt,ti)})});var Cn=u.cloneElement(Gr,(0,N.Z)((0,N.Z)({},xr),fi)),Bn={x:Bi,y:Jr},Nn=er?(0,N.Z)({},er!==!0?er:{}):null;return u.createElement(u.Fragment,null,u.createElement(U.Z,{disabled:!Ar,ref:ai,onResize:li},u.createElement(z,{getTriggerDOMNode:Ot},Cn)),u.createElement(te.Provider,{value:Ri},u.createElement(O,{portal:Me,ref:gi,prefixCls:ue,popup:xe,className:d()(Kt,xn),style:ke,target:Br,onMouseEnter:fn,onMouseLeave:en,onPointerEnter:fn,zIndex:ye,open:Ar,keepDom:ln,fresh:_t,onClick:kt,mask:yt,motion:yr,maskMotion:Tr,onVisibleChanged:ei,onPrepare:Dr,forceRender:Z,autoDestroy:wr,getPopupContainer:j,align:bi,arrow:Nn,arrowPos:Bn,ready:Wn,offsetX:Gn,offsetY:un,offsetR:Gi,offsetB:jt,onAlign:Si,stretch:Ie,targetWidth:_r/_i,targetHeight:vi/Kn})))});return ze}var $t=zt(I.Z)},50304:function(){"use strict"},23257:function(Ct,Le){"use strict";Le.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"}},8797:function(Ct,Le,S){"use strict";var N=S(59301),B=S(93314),V=S(3113),I=Object.defineProperty,A=Object.defineProperties,d=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,E=(u,m,x)=>m in u?I(u,m,{enumerable:!0,configurable:!0,writable:!0,value:x}):u[m]=x,f=(u,m)=>{for(var x in m||(m={}))b.call(m,x)&&E(u,x,m[x]);if(U)for(var x of U(m))n.call(m,x)&&E(u,x,m[x]);return u},c=(u,m)=>A(u,d(m));const l=({img:u,buttonProps:m={},styles:x={},customText:F,ButtonText:k,ButtonClick:T,Buttonclass:L,ButtonTwo:W,imgStyles:P,loading:O=!1,className:$=""})=>N.createElement("section",{className:`tc animated fadeIn ${$}`,style:f({color:"#999",margin:"100px auto",visibility:O?"hidden":"visible"},x)},N.createElement("img",{src:u||B,style:c(f({},P),{pointerEvents:"none",userSelect:"none"})}),N.createElement("p",{className:"mt20 font14"},F||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),k&&N.createElement(V.ZP,f({className:L,onClick:T},m),k),W&&W);Le.Z=l},23210:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return L}});var N=S(59301),B={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},V=S(3113),I=S(70557),A=S(23954),d=S(6848),U=S(955),b=S(94941),n=S(8797),E=S(3294),f=S(19381),c=S(59301),l=Object.defineProperty,u=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,F=(W,P,O)=>P in W?l(W,P,{enumerable:!0,configurable:!0,writable:!0,value:O}):W[P]=O,k=(W,P)=>{for(var O in P||(P={}))m.call(P,O)&&F(W,O,P[O]);if(u)for(var O of u(P))x.call(P,O)&&F(W,O,P[O]);return W},T=(W,P,O)=>new Promise(($,z)=>{var ie=_e=>{try{me(O.next(_e))}catch(le){z(le)}},te=_e=>{try{me(O.throw(_e))}catch(le){z(le)}},me=_e=>_e.done?$(_e.value):Promise.resolve(_e.value).then(ie,te);me((O=O.apply(W,P)).next())}),L=({editOffice:W="view",data:P,theme:O,type:$,filename:z,monacoEditor:ie,className:te,style:me,close:_e,onClose:le,hasMask:Q,disabledDownload:se,onImgDimensions:H,showNodata:J,recordInfo:K})=>{const[M,D]=(0,N.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[ne,de]=(0,N.useState)(""),[Oe,Ve]=(0,N.useState)(),nt=window.ENV==="build"?"/react/build":"",Fe=location.host.startsWith("localhost")?E.Z.PROXY_SERVER:E.Z.API_SERVER,Ze=10*(1024*1024),st=(0,N.useRef)();P!=null&&P.startsWith("/api")&&$!=="txt"&&(P=E.Z.API_SERVER+P);const At=zt=>zt.substring(zt.lastIndexOf("/")+1).split(".").pop();z&&ie&&(ie.filename=z),(0,N.useEffect)(()=>{var zt,$t;const Me=($t=(zt=document.cookie)==null?void 0:zt.replace(/\s/g,""))==null?void 0:$t.split(";");Me==null||Me.map(ze=>{let Ue=ze.split("=");Ue[0]==="_educoder_session"&&de(Ue[1])})},[]),(0,N.useEffect)(()=>{$==="office"&&(P.indexOf("bigfilescdn.")>-1||P.indexOf("bigfiles1")>-1?Ve({url:P,fileType:At(P),model:P.indexOf("model=edit")?"edit":"view"}):Jt())},[$,P]);const Jt=()=>T(void 0,null,function*(){console.log("data:",P);let zt=P;P.startsWith("http")||(zt=location.origin+zt);let $t=new URL(zt).pathname.split("/").pop();const Me=yield(0,b.gJ)({attachment_id:$t});Me.url=Fe+Me.url,Ve(Me)}),pt=()=>{if(P.startsWith("http")||P.startsWith("blob:")){Bt();return}(0,U.Sv)(z||"educoder",P,z)},Bt=()=>{K&&(0,f.fc)({id:K==null?void 0:K.id,watch_type:1,course_id:K==null?void 0:K.course_id}),(0,U.Nd)(z||"educoder",decodeURIComponent(P))};return c.createElement("div",{style:k({},me||{}),className:`${Q&&B.bgBlack} ${$?B.wrp:"hide"}`},_e&&c.createElement("div",{className:B.close,ref:st},!!H&&c.createElement(d.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>st.current},c.createElement("span",{onClick:()=>{le(),H()}},c.createElement("i",{className:"icon-yulanpizhu"}))),!se&&c.createElement(d.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>st.current},c.createElement("span",{onClick:Bt},c.createElement("i",{className:"icon-quxiaozhiding"}))),c.createElement(d.Z,{title:"\u5173\u95ED",getPopupContainer:()=>st.current},c.createElement("span",{className:"",onClick:le},c.createElement("i",{className:"icon-guanbi1"})))),c.createElement("div",{className:`${B[te]} ${te} ${B.monaco} ${$==="txt"?"show":"hide"}`},$==="txt"&&c.createElement(c.Fragment,null,c.createElement(A.ZP,k({},ie)))),$==="audio"&&c.createElement("audio",{src:`${(P==null?void 0:P.indexOf("http://"))>-1||(P==null?void 0:P.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${P}`,autoPlay:!0}),$==="video"&&c.createElement(c.Fragment,null,(P==null?void 0:P.indexOf("http"))>-1?c.createElement("video",{controls:!0,src:`${P}`,autoPlay:!0}):c.createElement("video",{controls:!0,src:`data:video/mp4;base64,${P}`,autoPlay:!0})),$==="office"&&Oe&&c.createElement("iframe",{src:`${nt}/office.html?key=${Oe.key}&url=${btoa(Oe.url)}&callbackUrl=${Fe+(Oe.callbackUrl||"")}&fileType=${Oe.fileType}&title=${Oe.title||""}&model=${W}&officeServer=${E.Z.ONLYOFFICE}&disabledDownload=${!!se}`}),$==="html"&&c.createElement("iframe",{src:P+"&disposition=inline"}),$==="pdf"&&c.createElement("iframe",{src:`${nt}/js/pdfview/index.html?filename=${z||"educoder.pdf"}&url=${encodeURIComponent(P)}&disabledDownload=${!!se}`}),$==="image"&&c.createElement("img",{src:`${(P==null?void 0:P.indexOf("http://"))>-1||(P==null?void 0:P.indexOf("https://"))>-1?"":"data:image/png;base64,"}${P}`}),($==="other"||$==="download")&&c.createElement(c.Fragment,null,J?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(V.ZP,{icon:c.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:pt,disabled:se},"\u4E0B\u8F7D")}):c.createElement(V.ZP,{type:"primary",size:"middle",onClick:pt,disabled:se},c.createElement(I.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},85149:function(Ct,Le,S){"use strict";S.d(Le,{z:function(){return $},Z:function(){return z}});var N=S(59301),B=S(50304),V=S(24768),I=S(64018),A=S(46284),d=S(3294),U=S(955),b=S(15342),n=S(1012),E=S(23210),f=S(59301),l=({html:ie})=>{const te=(0,N.useRef)(null),me=(0,N.useRef)(null),_e=`.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 36px !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,N.useEffect)(()=>{const le=te.current.attachShadow({mode:"open"});me.current=document.createElement("div"),me.current.className="markdown-body",me.current.innerHTML=ie,le.appendChild(me.current);const Q=document.createElement("style");return Q.textContent=_e,le.appendChild(Q),()=>{le.innerHTML=""}},[]),(0,N.useEffect)(()=>{me.current&&(me.current.innerHTML=ie)},[ie]),f.createElement("div",{ref:te})},u=Object.defineProperty,m=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable,k=(ie,te,me)=>te in ie?u(ie,te,{enumerable:!0,configurable:!0,writable:!0,value:me}):ie[te]=me,T=(ie,te)=>{for(var me in te||(te={}))x.call(te,me)&&k(ie,me,te[me]);if(m)for(var me of m(te))F.call(te,me)&&k(ie,me,te[me]);return ie};const L="@\u2581\u2581@",W="@\u2581@",P=/<pre[^>]*>/g;function O(ie){let te=document.createElement("div");return te.innerHTML=ie,te.childNodes.length===0?"":te.childNodes[0].nodeValue}const $=(ie,te)=>{ie=ie||"";const me=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,_e=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,le=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Q=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return te?ie.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(me,(se,H,J,K,M,D,ne)=>{const de=H||K||D,Oe=J||M||ne||"?";return d.Z.API_SERVER+"/api/attachments/"+de+Oe+"&t="+(0,U.Jn)(de,Date.now())+(se.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(ie=ie.replace(Q,(se,H,J,K,M,D,ne)=>{const de=H||K||D,Oe=J||M||ne||"?";return d.Z.API_SERVER+"/attachments/download/"+de+Oe+"&t="+(0,U.Jn)(de,Date.now())+(se.indexOf(")")>-1?")":"&")}).replace(me,(se,H,J,K,M,D,ne)=>{const de=H||K||D,Oe=J||M||ne||"?";return d.Z.API_SERVER+"/api/attachments/"+de+Oe+"&t="+(0,U.Jn)(de,Date.now())+(se.indexOf(")")>-1?")":"&")}).replace(_e,(se,H,J,K,M)=>{const D=H||K,ne=J||M||"";return'"'+d.Z.API_SERVER+"/api/attachments/"+D+ne+D+ne+"&t="+(0,U.Jn)(D,Date.now())}).replace(le,(se,H,J,K,M)=>{const D=H||K,ne=J||M||"";return"("+d.Z.API_SERVER+"/files/uploads/"+D+ne+D+ne+"&t="+(0,U.Jn)(D,Date.now())}).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
|
`),ie)};var z=({value:ie="",className:te,showTextOnly:me,showLines:_e,style:le={},stylesPrev:Q={},highlightKeywords:se,showProgramFill:H,isProgramFill:J,disabledFill:K=!1,programFillValue:M,onFillChange:D=Oe=>{},onFillBlur:ne=()=>{},onFillFocus:de=()=>{}})=>{let Oe=String(ie);const[Ve,nt]=(0,N.useState)(""),[Fe,rt]=(0,N.useState)("office"),[Ze,st]=(0,N.useState)([]),At=(0,N.useRef)("a"+(0,n.Z)()),Jt={},pt=(Ae,Ne,je)=>{const Qe=document.createElement(Ae===W?"input":"textarea");Qe.style.width="100%",Qe.style.height=Ae===W?"40px":"151px",Qe.rows=5,Qe.spellcheck=!1,Qe.name="edu-program-fill",Qe.placeholder="\u8BF7\u8F93\u5165",Qe.dataset.id=Ne;const at=Object.keys(Jt).length;return Jt[at]=Qe,`<span class="edu-program-fill-wrap ${Ae===W?"":"show"}" style="width:${Ae===W?"400px":"100%"}" title=${je||""}><span>${Qe.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Bt(Ae){return Ae=Ae.replace(/!\[.*?\]\(.*?\)/g,""),Ae=Ae.replace(/\[.*?\]\(.*?\)/g,""),Ae=Ae.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),Ae=Ae.replace(/<embed.*?>/g,""),Ae=Ae.replace(/<img.*?>/g,""),Ae=Ae.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),Ae=Ae.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),Ae=Ae.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),Ae=Ae.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),Ae}const zt=Ae=>Ae.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(Ne,je){let Qe=je.replace(/(\n|\r)/g,"").split("}"),at=[];return Qe.map(Je=>{Je!=""&&at.push(`.${At.current} ${Je}`)}),`<style>${at.join("}")}</style>`}),$t=(0,N.useMemo)(()=>{try{const Qe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,at=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Je=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,We=/\(\/attachments\/download\//g;Oe=Oe.replace(We,"("+d.Z.API_SERVER+"/attachments/download/").replace(Qe,"("+d.Z.API_SERVER+"/api/attachments/").replace(at,'"'+d.Z.API_SERVER+"/api/attachments/").replace(Je,'"'+d.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(Qe){}if(H){let Qe=-1;return Oe=Oe.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(at,Je,We){var vt;return++Qe,pt(at,Qe,(vt=M==null?void 0:M[Qe])==null?void 0:vt.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${zt(Oe||"")}</pre>`}let Ae=zt(Oe);Ae=(0,V.ZP)(Ae);const Ne=(0,V.ez)();Oe.match(/\[TOC\]/)&&(Ae=Ae.replace("<p>[TOC]</p>",(0,V.Qv)()),(0,V.Iy)()),Ae=Ae.replace(/(__special_katext_id_\d+__)/g,(Qe,at)=>{const{type:Je,expression:We}=Ne[at];return(0,b.renderToString)(O(We)||"",{displayMode:Je==="block",throwOnError:!1,output:"html"})}),Ae=Ae.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,V.AL)();const je=document.createElement("div");if(je.innerHTML=Ae,me)return je.innerText;if(se){const Qe=se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return ot(je,Qe),je.innerHTML}return setTimeout(()=>be(),500),je.innerHTML},[Oe,se]);(0,N.useEffect)(()=>{ut.current&&ut.current.querySelectorAll(["input","textarea"]).forEach(Ne=>{Ne.oninput=Me,Ne.onblur=ze,Ne.onfocus=Ue})},[Ze]),(0,N.useEffect)(()=>{var Ae,Ne,je,Qe,at;if(M!=null&&M.length)try{const Je=ut.current.querySelectorAll(".edu-program-fill-score"),We=ut.current.querySelectorAll('[name="edu-program-fill"]');for(const[vt,gt]of We.entries())gt.value=((Ae=M==null?void 0:M[vt])==null?void 0:Ae.value)||"",((Ne=M==null?void 0:M[vt])==null?void 0:Ne.type)==="warning"?gt.className="program-fill-warning":((je=M==null?void 0:M[vt])==null?void 0:je.type)==="success"?gt.className="program-fill-success":gt.className="";for(const[vt,gt]of Je.entries())gt.innerHTML=(Qe=M==null?void 0:M[vt])!=null&&Qe.score?`${(at=M==null?void 0:M[vt])==null?void 0:at.score}\u5206`:"";st(M)}catch(Je){console.log(Je,"error")}},[M]);const Me=Ae=>{Ze[Ae.target.dataset.id]=Ze[Ae.target.dataset.id]||{},Ze[Ae.target.dataset.id].value=Ae.target.value,st([...Ze]),D(Ze,Ae.target.dataset.id)},ze=Ae=>{Ze[Ae.target.dataset.id]=Ze[Ae.target.dataset.id]||{},Ze[Ae.target.dataset.id].value=Ae.target.value,st([...Ze]),ne(Ze,Ae.target.dataset.id)},Ue=Ae=>{Ze[Ae.target.dataset.id]=Ze[Ae.target.dataset.id]||{},Ze[Ae.target.dataset.id].value=Ae.target.value,st([...Ze]),de(Ze,Ae.target.dataset.id)};function ot(Ae,Ne){return Ae.childNodes.forEach(je=>{var Qe;if(je.childNodes.length>0)ot(je,Ne);else if(je.nodeName!=="IMG")if(je.innerHTML)je.innerHTML=(Qe=je.innerHTML)==null?void 0:Qe.replace(new RegExp(Ne,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const at=document.createElement("span");at.innerHTML=je.textContent.replace(new RegExp(Ne,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),je.replaceWith(at)}})}const ut=(0,N.useRef)();V.jb.WebkitLineClamp=_e,_e&&(le=T(T({},le),V.jb));function ue(Ae){let Ne=Ae.target;if(Ne.tagName.toUpperCase()==="A"){let je=Ne.getAttribute("href");if(je.indexOf("office")>-1)Ae.preventDefault(),nt(je),rt("office");else if(je.indexOf("application/pdf")>-1)Ae.preventDefault(),nt(je),rt("pdf");else if(je.indexOf("text/html")>-1)Ae.preventDefault(),nt(je),rt("html");else if(je.startsWith("#")){Ae.preventDefault();let Qe=document.getElementById(je.replace("#",""));Qe&&Qe.scrollIntoView(!0)}}}const be=()=>{var Ae;const Ne=(Ae=ut.current)==null?void 0:Ae.querySelectorAll("video");Ne==null||Ne.forEach(je=>{if(je.oncontextmenu=()=>!1,je.src.indexOf(".m3u8")>-1&&!je.canPlayType("application/vnd.apple.mpegurl")){if(A.ZP.isSupported()){var Qe=new A.ZP;Qe.loadSource(je.src),Qe.attachMedia(je)}}})};(0,N.useEffect)(()=>{if(ut.current&&$t&&$t.match(P)&&window.PR.prettyPrint(),ut.current)return ut.current.addEventListener("click",ue),()=>{var Ae;(Ae=ut.current)==null||Ae.removeEventListener("click",ue),(0,V.AL)(),(0,V.Iy)()}},[$t,ut.current,ue]),(0,N.useEffect)(()=>{var Ae;const Ne=je=>{je.preventDefault(),je.clipboardData.setData("text",window.getSelection().toString())};return(Ae=ut.current)==null||Ae.addEventListener("copy",Ne),()=>{var je;(je=ut.current)==null||je.removeEventListener("copy",Ne)}},[ut.current]);const De=Ae=>/<style[\s\S]*?>/i.test(Ae||"");return N.createElement(N.Fragment,null,me&&N.createElement("div",{ref:ut},$t),!me&&!De($t)&&N.createElement("div",{ref:ut,style:T({},le),className:`${te||""} ${K?"disabled-fill":""} markdown-body ${At.current}`,dangerouslySetInnerHTML:{__html:$t}}),!me&&De($t)&&N.createElement(l,{html:$t}),N.createElement(E.Z,{close:!0,data:Ve,type:Ve!=null&&Ve.length?Fe:"",style:T({},Q),onClose:()=>nt("")}))}},33538:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return I}});var N=S(89070),B={ldsRing:"ldsRing___mpBZC",idsRingWrapper:"idsRingWrapper___Of9_n",ldsring:"ldsring___o0w2t"},V=S(59301),I=({message:A,className:d,children:U,style:b={}})=>V.createElement("div",{className:`custom-spinner ${B.idsRingWrapper} ${d}`},V.createElement("div",{className:B.ldsRing},V.createElement("div",null),V.createElement("div",null),V.createElement("div",null),V.createElement("div",null)),A?V.createElement("p",{style:b},A):null,U,V.createElement(N.Outlet,null))},13787:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return d}});var N=S(59301),B={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_"},V=S(92310),I=S.n(V),d=({className:U,style:b={},leftNode:n,leftTitle:E="\u81EA\u6D4B\u8F93\u5165",rightNode:f,rightTitle:c="\u8FD0\u884C\u7ED3\u679C"})=>N.createElement("div",{className:I()(B.result,U),style:b},N.createElement("div",{className:B.left},N.createElement("div",{className:B.title},N.createElement("i",{style:{color:"#08CF76"},className:"iconfont iconfont icon-zidingyiceshiyongli font14 mr5"}),N.createElement("span",null,E)),N.createElement("div",{className:B.leftNode},n)),N.createElement("div",{className:B.right},N.createElement("div",{className:B.title},N.createElement("i",{style:{color:"#00DFFF"},className:"iconfont iconfont icon-daimazhihangjieguo font14 mr5"}),N.createElement("span",null,c)),N.createElement("div",{className:B.rightNode},f)))},23954:function(Ct,Le,S){"use strict";S.d(Le,{SV:function(){return ut},ZP:function(){return ot}});var N=S(59301),B=S(76374);const V={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"]},I={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"]},A={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(`
|
|
|
`)}]},d={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(`
|
|
|
`)}]},U={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 b=S(53184),n=S.n(b),E=Object.defineProperty,f=Object.defineProperties,c=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,x=(ue,be,De)=>be in ue?E(ue,be,{enumerable:!0,configurable:!0,writable:!0,value:De}):ue[be]=De,F=(ue,be)=>{for(var De in be||(be={}))u.call(be,De)&&x(ue,De,be[De]);if(l)for(var De of l(be))m.call(be,De)&&x(ue,De,be[De]);return ue},k=(ue,be)=>f(ue,c(be)),T=(ue,be,De)=>new Promise((Ae,Ne)=>{var je=Je=>{try{at(De.next(Je))}catch(We){Ne(We)}},Qe=Je=>{try{at(De.throw(Je))}catch(We){Ne(We)}},at=Je=>Je.done?Ae(Je.value):Promise.resolve(Je.value).then(je,Qe);at((De=De.apply(ue,be)).next())});const L={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"]}},W=(ue,be)=>be.map(De=>({label:De,kind:ue.languages.CompletionItemKind.Keyword,insertText:De})),P=ue=>Object.keys(L.tables).map(be=>({label:be,kind:ue.languages.CompletionItemKind.Variable,insertText:be})),O=(ue,be)=>{const De=L.tables[ue];return De?De.map(Ae=>({label:Ae,kind:be.languages.CompletionItemKind.Field,insertText:Ae})):[]};function $(ue,be,De,Ae,Ne){let je=be.getWordUntilPosition(De),Qe={startLineNumber:De.lineNumber,endLineNumber:De.lineNumber,startColumn:je.startColumn,endColumn:je.endColumn},at=Ae.map(Je=>({label:Je,kind:ue.languages.CompletionItemKind.Keyword,insertText:Je,insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Qe}));return Ne.map(Je=>{at.push(k(F({},Je),{range:Qe}))}),at}var z=ue=>{L.languages.map(Ne=>(ue.languages.registerDocumentFormattingEditProvider(Ne,{provideDocumentFormattingEdits(je,Qe,at){return T(this,null,function*(){const Je=n()(je.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:je.getFullModelRange(),text:Je}]})}}),Ne));const be=A.quickKey.map(Ne=>({label:Ne.label,kind:ue.languages.CompletionItemKind.Method,insertText:Ne.content,insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet})),De=d.quickKey.map(Ne=>({label:Ne.label,kind:ue.languages.CompletionItemKind.Method,insertText:Ne.content,insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet})),Ae=I.quickKey.map(Ne=>({label:Ne.label,kind:ue.languages.CompletionItemKind.Method,insertText:Ne.content,insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet}));ue.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Ne,je){var Qe=Ne.getWordUntilPosition(je),at={startLineNumber:je.lineNumber,endLineNumber:je.lineNumber,startColumn:Qe.startColumn,endColumn:Qe.endColumn},Je=Ne.getLineContent(je.lineNumber).substring(Qe.startColumn-2,Qe.endColumn);return{suggestions:[...A.keywords.map(We=>({label:We,kind:ue.languages.CompletionItemKind.Function,documentation:We,insertText:We,insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:at})),...A.quickKey.map(We=>({label:We.label,kind:ue.languages.CompletionItemKind.Function,documentation:We.content,insertText:Je.startsWith("#")?We.content.replace(/#/,""):We.content,insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:at}))]}}}),ue.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Ne,je){var Qe=Ne.getWordUntilPosition(je),at={startLineNumber:je.lineNumber,endLineNumber:je.lineNumber,startColumn:Qe.startColumn,endColumn:Qe.endColumn};return{suggestions:[...V.keywords.map(Je=>({label:Je,kind:ue.languages.CompletionItemKind.Function,documentation:Je,insertText:Je,insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:at}))]}}}),ue.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Ne,je){var Qe=Ne.getWordUntilPosition(je),at={startLineNumber:je.lineNumber,endLineNumber:je.lineNumber,startColumn:Qe.startColumn,endColumn:Qe.endColumn},Je=Ne.getLineContent(je.lineNumber).substring(Qe.startColumn-2,Qe.endColumn);return{suggestions:[...I.keywords.map(We=>({label:We,kind:ue.languages.CompletionItemKind.Function,documentation:We,insertText:We,insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:at})),...I.quickKey.map(We=>({label:We.label,kind:ue.languages.CompletionItemKind.Function,documentation:We.content,insertText:Je.startsWith("#")?We.content.replace(/#/,""):We.content,insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:at}))]}}}),ue.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(Ne,je){var Qe=Ne.getWordUntilPosition(je),at={startLineNumber:je.lineNumber,endLineNumber:je.lineNumber,startColumn:Qe.startColumn,endColumn:Qe.endColumn},Je=Ne.getLineContent(je.lineNumber).substring(Qe.startColumn-2,Qe.endColumn);return{suggestions:[...U.keywords.map(We=>({label:We,kind:ue.languages.CompletionItemKind.Function,documentation:We,insertText:We,insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:at})),...U.quickKey.map(We=>({label:We.label,kind:ue.languages.CompletionItemKind.Function,documentation:We.content,insertText:Je.startsWith("#")?We.content.replace(/#/,""):We.content,insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:at}))]}}}),ue.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Ne,je){var Qe=Ne.getWordUntilPosition(je),at={startLineNumber:je.lineNumber,endLineNumber:je.lineNumber,startColumn:Qe.startColumn,endColumn:Qe.endColumn},Je=Ne.getLineContent(je.lineNumber).substring(Qe.startColumn-2,Qe.endColumn);return{suggestions:[...d.keywords.map(We=>({label:We,kind:ue.languages.CompletionItemKind.Function,documentation:We,insertText:We,insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:at})),...d.quickKey.map(We=>({label:We.label,kind:ue.languages.CompletionItemKind.Function,documentation:We.content,insertText:Je.startsWith("#")?We.content.replace(/#/,""):We.content,insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:at}))]}}})};const ie="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var te=Object.defineProperty,me=(ue,be,De)=>be in ue?te(ue,be,{enumerable:!0,configurable:!0,writable:!0,value:De}):ue[be]=De,_e=(ue,be,De)=>me(ue,typeof be!="symbol"?be+"":be,De);const le=class Yl{constructor(be,De,Ae){this.placeholder=be,this.editor=De,this.monaco=Ae,De.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Yl.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)}};_e(le,"ID","editor.widget.placeholderHint");var se=le,H=S(96236),J=S(8591),K=S(6848),M=S(89392),D=S(34604),ne=S(56102),de=Object.defineProperty,Oe=Object.defineProperties,Ve=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable,Ze=(ue,be,De)=>be in ue?de(ue,be,{enumerable:!0,configurable:!0,writable:!0,value:De}):ue[be]=De,st=(ue,be)=>{for(var De in be||(be={}))Fe.call(be,De)&&Ze(ue,De,be[De]);if(nt)for(var De of nt(be))rt.call(be,De)&&Ze(ue,De,be[De]);return ue},At=(ue,be)=>Oe(ue,Ve(be)),Jt=(ue,be)=>{var De={};for(var Ae in ue)Fe.call(ue,Ae)&&be.indexOf(Ae)<0&&(De[Ae]=ue[Ae]);if(ue!=null&&nt)for(var Ae of nt(ue))be.indexOf(Ae)<0&&rt.call(ue,Ae)&&(De[Ae]=ue[Ae]);return De},pt=(ue,be,De)=>new Promise((Ae,Ne)=>{var je=Je=>{try{at(De.next(Je))}catch(We){Ne(We)}},Qe=Je=>{try{at(De.throw(Je))}catch(We){Ne(We)}},at=Je=>Je.done?Ae(Je.value):Promise.resolve(Je.value).then(je,Qe);at((De=De.apply(ue,be)).next())});function Bt(ue){return/^\d+$/.test(ue)?`${ue}px`:ue}function zt(){}let $t=!1;const Me={"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 ze(ue=[]){let be=ue;if(Array.isArray(ue)){for(let De=0;De<ue.length;De++){let Ae=Me[ue[De]];if(Ae)return Ae}return be[0]}return Me[be]||be}let Ue=null;var ot=ue=>{var be=ue,{width:De="100%",height:Ae="100%",value:Ne,language:je="javascript",style:Qe={},options:at={},overrideServices:Je={},theme:We="vs-dark",onEditBlur:vt,isCopy:gt=!1,onSave:mt,autoHeight:xt=!1,forbidCopy:Lt=!1,onChange:yt=zt,editorDidMount:Mt=zt,onFocus:Nt=zt,onBreakPoint:j=zt,breakPointValue:Z=[],filename:tt="educoder.txt",errorLine:oe,errorContent:xe="",highlightLine:Kt,openBreakPoint:ke=!1,placeholder:Pe="",showMiniMap:He=!0}=be,he=Jt(be,["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 ge=(0,N.useRef)(),ye=(0,N.useRef)({}),Ie=(0,N.useRef)(),ae=(0,N.useRef)(),_t=(0,N.useRef)([]),we=(0,N.useRef)(!1),kt=(0,N.useRef)(),Ft=(0,N.useRef)(),er=(0,N.useRef)(!1),[Vt,It]=(0,N.useState)(!1);function Tt(){let Ht;return ge.current&&(Ht=new B.Z(Ut=>{for(let ur of Ut)(ur.target.offsetHeight>0||ur.target.offsetWidth>0)&&ye.current.instance.layout()}),Ht.observe(ge.current)),Ht}function fr(){J.ZP.warning({content:decodeURIComponent(ie),key:"monaco-editor-tip"})}const $r=()=>{let Ht=ye.current.instance;if(Ne!=null&&Ht&&Vt){const Ut=Ht.getModel();Ut&&Ne!==Ut.getValue()&&($t=!0,Ut.setValue(Ne),Ht.layout(),$t=!1)}};(0,N.useEffect)(()=>{const Ht=D.Z.subscribe("formatDocument",Ut=>{var ur;let pr=ye.current.instance;(ur=pr==null?void 0:pr.getAction)==null||ur.call(pr,"editor.action.formatDocument").run()});return window.updateMonacoValue=Ut=>{yt(Ut)},Ht},[]),(0,N.useEffect)(()=>{var Ht;let Ut=ye.current.instance;ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{$r()},500),Ne&&(Ne!=null&&Ne.length)&&((Ht=Ut==null?void 0:Ut.updateOptions)==null||Ht.call(Ut,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Ne.split(/\r\n|\r|\n/g).length))+3,5)}))},[Ne,Vt,ye.current]),(0,N.useEffect)(()=>{if(oe&&ye.current&&ye.current.instance){let Ut=ye.current.instance;Ut.changeViewZones(function(ur){var pr=document.createElement("div");pr.style.padding="10px 20px",pr.style.width="calc(100% - 20px)",pr.className="my-error-line-wrp",pr.innerHTML=xe,ur.addZone({afterLineNumber:oe||11,heightInLines:3,domNode:pr})});var Ht={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}};Ut.addOverlayWidget(Ht),Ut.revealPositionInCenter({lineNumber:20,column:1})}},[oe,ye.current,Vt]);const zr=(Ht="",Ut)=>{if(!Ht||Ht.trim()==="")return!0;const pr=ye.current.instance.getModel().getLineTokens(Ut);let sr=!1;for(let gi=0;gi<2;gi++)pr.getStandardTokenType(gi)===1&&(sr=!0);return sr};(0,N.useEffect)(()=>{var Ht;const Ut=(Ht=ye.current)==null?void 0:Ht.instance;if(Ut&&Vt&&Lt){const ur=Ut.onDidBlurEditorWidget(()=>{er.current=!1}),pr=Ut.onDidFocusEditorText(()=>{er.current=!0});return()=>{ur.dispose(),pr.dispose()}}},[ye.current,Vt,Lt]),(0,N.useEffect)(()=>{var Ht;if((Ht=ye.current)!=null&&Ht.instance&&Vt&&ke){let Ut=ye.current.instance,ur=Ut.getModel();if(!ur)return;(()=>{var cr;let Cr=[],yr=[];const Tr=ur.getAllDecorations();for(let oi of Tr)oi.options.className==="highlighted-line"&&(Cr.push((cr=oi==null?void 0:oi.range)==null?void 0:cr.startLineNumber),yr.push(oi==null?void 0:oi.id));if(Kt===Cr[0])return;ur.deltaDecorations(yr,[]);const ci=ur.getLineCount();Kt&&Kt<=ci&&(Ut.deltaDecorations([],[{range:new Ue.Range(Kt,1,Kt,ur.getLineMaxColumn(Kt)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Ut.revealLineInCenter(Kt))})();const sr=(cr=!1)=>{var Cr;let yr=[],Tr=[];const ci=ur.getAllDecorations();for(let oi of ci)oi.options.linesDecorationsClassName==="breakpoints-select"&&(yr.push((Cr=oi==null?void 0:oi.range)==null?void 0:Cr.startLineNumber),Tr.push(oi==null?void 0:oi.id));if(cr)return{lines:yr,ids:Tr};j(yr)},gi=cr=>pt(void 0,null,function*(){let Cr={range:new Ue.Range(cr,1,cr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield ur.deltaDecorations([],[Cr]),sr()}),kr=cr=>pt(void 0,null,function*(){let Cr=[];const yr=Ut.getLineDecorations(cr);for(let Tr of yr)Tr.options.linesDecorationsClassName==="breakpoints-select"&&Cr.push(Tr.id);yield ur.deltaDecorations(Cr,[]),sr()}),ui=cr=>{let Cr=Ut.getLineDecorations(cr);for(let yr of Cr)if(yr.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,M.isEqual)(Z,sr(!0).lines)){ur.deltaDecorations(sr(!0).ids,[]);const cr=Z.map(Cr=>({range:new Ue.Range(Cr,1,Cr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));ur.deltaDecorations([],cr)}const Br=Ut.onDidChangeModelContent(cr=>{let Cr=Ut.getPosition();if(Cr){let yr=Cr.lineNumber;clearTimeout(Ft.current),Ft.current=setTimeout(()=>{zr(ur.getLineContent(yr),yr)?kr(yr):ui(yr)?(kr(yr),gi(yr)):sr()},100)}}),mr=Ut.onMouseDown(cr=>{var Cr,yr,Tr;if(cr.target.detail&&((Tr=(yr=(Cr=cr.target)==null?void 0:Cr.element)==null?void 0:yr.className)!=null&&Tr.includes("line-numbers"))){let ci=cr.target.position.lineNumber;if(zr(ur.getLineContent(ci),ci))return;ui(ci)?kr(ci):gi(ci)}}),jr=cr=>{let Cr={range:new Ue.Range(cr,1,cr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};_t.current=Ut.deltaDecorations(_t.current,[Cr])},ai=()=>{_t.current=Ut.deltaDecorations(_t.current,[])},Gr=Ut.onMouseMove(cr=>{var Cr,yr,Tr;if(ai(),cr.target.detail&&((Tr=(yr=(Cr=cr.target)==null?void 0:Cr.element)==null?void 0:yr.className)!=null&&Tr.includes("line-numbers"))){let ci=cr.target.position.lineNumber;if(zr(ur.getLineContent(ci),ci))return;jr(ci)}}),pi=Ut.onMouseLeave(()=>{ai()});return()=>{Br.dispose(),mr.dispose(),Gr.dispose(),pi.dispose()}}},[ye.current,Vt,Z,Kt,ke,je]),(0,N.useEffect)(()=>{var Ht;(Ht=ye.current)!=null&&Ht.instance&&ke&&ye.current.instance.setPosition({lineNumber:0,column:0})},[Kt]);function Qr(){let Ht=ye.current.instance;if(Ht){const Ut=Ht.getSelection(),ur=ye.current.pastePos||{},pr=new Ue.Range(ur.startLineNumber||Ut.endLineNumber,ur.startColumn||Ut.endColumn,ur.endLineNumber||Ut.endLineNumber,ur.endColumn||Ut.endColumn);setTimeout(()=>{Ht.executeEdits("",[{range:pr,text:""}])},300)}}function Ot(Ht){(window.navigator.platform.match("Mac")?Ht.metaKey:Ht.ctrlKey)&&Ht.keyCode==83&&(Ht.preventDefault(),mt())}const Yt=()=>{if(xt&&ye.current.instance){const Ht=ye.current.instance.getContentHeight();si(Ht<Ae?Ae:Ht)}else si(Ae)};function wr(Ht){var Ut=document.createEvent("MouseEvents");Ut.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ht.dispatchEvent(Ut)}const Hr=Ht=>{if(!er.current)return;const{keyCode:Ut,ctrlKey:ur,metaKey:pr,target:sr,type:gi}=Ht;return(gi==="paste"||(Ut===67||Ut===86)&&(pr||ur))&&sr.nodeName==="TEXTAREA"&&(fr(),Ht.preventDefault()),!1};function Rr(Ht,Ut){var ur=window.URL||window.webkitURL||window,pr=new Blob([Ut]),sr=document.createElementNS("http://www.w3.org/1999/xhtml","a");sr.href=ur.createObjectURL(pr),sr.download=Ht,wr(sr)}(0,N.useEffect)(()=>{Yt()},[Yt]),(0,N.useEffect)(()=>{ge.current&&!Vt&&Promise.all([S.e(8909),S.e(3267)]).then(S.bind(S,71448)).then(Ht=>{try{Ue=Ht,ye.current.instance=Ue.editor.create(ge.current,{value:Ne,language:ze(je),theme:We,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:He||!1}},Je);const Ut=ye.current.instance;let sr=[...H.BH._menuItems].find(Br=>Br[0]._debugName=="EditorContext")[1],gi=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],kr=(Br,mr)=>{var jr,ai;let Gr=Br._first;do mr.includes((ai=(jr=Gr.element)==null?void 0:jr.command)==null?void 0:ai.id)&&Br._remove(Gr);while(Gr=Gr.next)};if(Mt(Ut,Ue),setTimeout(()=>{Yt(),ye.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Rr(tt||"educoder.txt",Ut.getValue())}})},500),ye.current.subscription=Ut.onDidChangeModelContent(Br=>{we.current?clearTimeout(kt.current):(Yt(),yt(Ut.getValue(),Br)),kt.current=setTimeout(()=>{we.current=!1},500)}),window.Monaco||z(Ue,ze(je)),Lt&&(kr(sr,gi),ge.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Hr),window.removeEventListener("paste",Hr),window.addEventListener("keydown",Hr),window.addEventListener("paste",Hr)),window.Monaco=Ue,vt&&Ut.onDidBlurEditorWidget(()=>{vt(Ut.getValue())}),Nt&&Ut.onDidFocusEditorText(()=>{Nt(Ut.getValue())}),Lt)try{Ut.onDidPaste(Br=>{const mr=Ut.getSelection(),jr=ye.current.pastePos||{},ai=new Ue.Range(jr.startLineNumber||mr.endLineNumber,jr.startColumn||mr.endColumn,jr.endLineNumber||mr.endLineNumber,jr.endColumn||mr.endColumn);Ut.executeEdits("",[{range:Br.range,text:""}])})}catch(Br){}let ui=Tt();return Pe&&typeof Pe=="string"&&new se(Pe,Ut,Ue),It(!0),()=>{const Br=ye.current.instance;Br.dispose();const mr=Br.getModel();mr&&mr.dispose(),ye.current.subscription&&ye.current.subscription.dispose(),ui.unobserve(ge.current)}}catch(Ut){}})},[]),(0,N.useEffect)(()=>{if(ye.current.instance&&Vt)return document.addEventListener("keydown",Ot,!1),()=>{document.removeEventListener("keydown",Ot)}},[mt,Vt]),(0,N.useEffect)(()=>{let Ht=ye.current.instance;if(Ht&&Vt){let Ut=ze(je);Ue.editor.setModelLanguage(Ht.getModel(),Ut)}},[je,Vt]),(0,N.useEffect)(()=>{ye.current.instance&&Vt&&Ue.editor.setTheme(We)},[We,Vt]),(0,N.useEffect)(()=>{let Ht=ye.current.instance;Ie.current=at,Ht&&Vt&&(Ht.updateOptions(st({},at)),setTimeout(()=>{Ht.getModel().updateOptions(st({},at))},200))},[JSON.stringify(at),Vt]),(0,N.useEffect)(()=>{let Ht=ye.current.instance;Ht&&Vt&&Ht.layout()},[De,Ae,Vt]);const[di,Er]=(0,N.useState)(Bt(De)),[wi,si]=(0,N.useState)(Bt(Ae)),Ri=At(st({},Qe),{width:di,height:wi,position:"relative"});return N.createElement("div",{className:"my-monaco-editor",ref:ge,style:Ri},gt&&N.createElement(ne.CopyToClipboard,{text:Ne,onCopy:()=>J.ZP.success("\u590D\u5236\u6210\u529F")},N.createElement(K.Z,{title:"\u590D\u5236\u4EE3\u7801"},N.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},N.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function ut({width:ue="100%",height:be="100%",original:De,modified:Ae,language:Ne,options:je={}}){const Qe=(0,N.useRef)(),[at,Je]=(0,N.useState)(null);function We(xt){let Lt;return Qe.current&&(Lt=new B.Z(yt=>{for(let Mt of yt)(Mt.target.offsetHeight>0||Mt.target.offsetWidth>0)&&xt.layout()}),Lt.observe(Qe.current)),Lt}(0,N.useEffect)(()=>(Qe.current&&Promise.all([S.e(8909),S.e(9404)]).then(S.bind(S,2550)).then(xt=>{Ue=xt;const Lt=Ue.editor.createDiffEditor(Qe.current,At(st({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},je),{wordWrap:!0}));Je(Lt);let yt=We(Lt);return()=>{Lt.dispose();const Mt=Lt.getModel();Mt&&Mt.dispose(),yt.unobserve(Qe.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,N.useEffect)(()=>{at&&at.setModel({original:Ue.editor.createModel(De,Ne),modified:Ue.editor.createModel(Ae,Ne)})},[De,Ae,Ne,at]);const vt=Bt(ue),gt=Bt(be),mt={width:vt,height:gt};return N.createElement("div",{className:"my-diff-editor",ref:Qe,style:mt})}},45710:function(Ct,Le,S){"use strict";S.r(Le),S.d(Le,{default:function(){return l}});var N=S(59301),B=S(23257),V=S(3294),I=S(89070),A=S(71418),d=S(49802),U=S(25555),b=S(23954),n=S(24334),E=S(61186),f=S.n(E),c=(u,m,x)=>new Promise((F,k)=>{var T=P=>{try{W(x.next(P))}catch(O){k(O)}},L=P=>{try{W(x.throw(P))}catch(O){k(O)}},W=P=>P.done?F(P.value):Promise.resolve(P.value).then(T,L);W((x=x.apply(u,m)).next())}),l=()=>{const{submitId:u,id:m}=(0,I.useParams)(),[x,F]=(0,N.useState)(void 0);console.log((0,I.useLocation)(),33);const k=(0,I.useLocation)();function T(){var ne;I.history.push(`/problems/${m}/oj/${(ne=k==null?void 0:k.query)==null?void 0:ne.backId}?tab=1`)}(0,N.useEffect)(()=>((0,I.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),(0,I.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),()=>{(0,I.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),(0,I.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}),[]),(0,N.useEffect)(()=>{document.title="\u5728\u7EBF\u5237\u9898"}),(0,N.useEffect)(()=>{u&&function(){return c(this,null,function*(){const de=yield(0,d.X6)(u);F(de.data)})}()},[u]);const{status:L,created_at:W,code:P,name:O,language:$,pass_sets_count:z,set_count:ie,error_msg:te,output:me,input:_e,expected_output:le,execute_memory:Q,user:se,execute_time:H,input_file_url:J,output_file_url:K,is_file:M,expected_output_file_url:D}=x||{};return N.createElement(A.Z,{spinning:!x,delay:500},N.createElement("div",{className:"record-detail-info"},x?N.createElement(N.Fragment,null,N.createElement("header",{className:B.Z.header},N.createElement("div",null,N.createElement("img",{src:`${V.Z.IMG_SERVER}/images/${se.image_url}`,alt:"user",width:30}),N.createElement("span",null,se.name)),N.createElement("h2",null," ",O," "),N.createElement("button",{className:"ant-btn",onClick:T,style:{border:"1px solid #bacffe",color:"#3061d0"}},"\u8FD4\u56DE\u8BE5\u9898")),N.createElement("div",{className:"record-detail-body"},N.createElement("h2",null," \u63D0\u4EA4\u8BB0\u5F55 "),N.createElement("ul",{className:"record-info"},N.createElement("li",null," \u72B6\u6001\uFF1A",N.createElement("span",{className:L===0?"c-green":"c-red"},U.Im[L])," "),N.createElement("li",null," \u63D0\u4EA4\u65F6\u95F4\uFF1A",N.createElement("span",null,f()(W).format("YYYY-MM-DD HH:mm:ss"))," "),N.createElement("li",null," \u8BED\u8A00\uFF1A",N.createElement("span",null,$)," "),N.createElement("li",null," \u6267\u884C\u7528\u65F6\uFF1A",N.createElement("span",null,H*1e3,"ms")," "),N.createElement("li",null," ",`${z} / ${ie} \u4E2A\u901A\u8FC7\u7684\u6D4B\u8BD5\u7528\u4F8B`," ")),(0,U.gZ)({status:L,error_msg:te,execute_time:H,output:me,input:_e,expected_output:le,input_file_url:J,output_file_url:K,is_file:M,expected_output_file_url:D}),N.createElement("h2",null," \u63D0\u4EA4\u7684\u5185\u5BB9 "),N.createElement(b.ZP,{height:"200px",width:"100%",language:$==null?void 0:$.toLocaleLowerCase(),value:n.Base64.decode(P),options:{readOnly:!0}}))):null))}},25555:function(Ct,Le,S){"use strict";S.d(Le,{Im:function(){return te},ZP:function(){return H},gZ:function(){return Q}});var N=S(59301),B=S(92832),V=S(3113),I=S(84105),A=S(87395),d=S(35106),U=S(24334),b=S(33538),n=S(85149),E=S(955),f=S(13787),c=S(34376),l=S(92310),u=S.n(l),m=S(59301),x=Object.defineProperty,F=Object.defineProperties,k=Object.getOwnPropertyDescriptors,T=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,P=(J,K,M)=>K in J?x(J,K,{enumerable:!0,configurable:!0,writable:!0,value:M}):J[K]=M,O=(J,K)=>{for(var M in K||(K={}))L.call(K,M)&&P(J,M,K[M]);if(T)for(var M of T(K))W.call(K,M)&&P(J,M,K[M]);return J},$=(J,K)=>F(J,k(K));const{TextArea:z}=B.default,ie={visible:!1,tabIndex:"0"},te={[d.h.HIDE_COMPILE_STATUS]:"\u6682\u4E0D\u652F\u6301\u67E5\u770B",[d.h.NOMATCH]:"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D",[d.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 me=(J=>(J[J.SET_VISIBLE=0]="SET_VISIBLE",J[J.SET_TABINDEX=1]="SET_TABINDEX",J))(me||{});function _e(J,K){switch(K.type){case 0:return $(O({},J),{visible:K.payload});case 1:return $(O({},J),{tabIndex:K.payload});default:throw new Error}}function le({value:J,className:K}){const[M,D]=(0,N.useState)(!1),ne=(0,N.useRef)(),de=(0,N.useRef)();return(0,N.useEffect)(()=>{M&&(de.current.reset(),de.current.write((0,E.pp)(J||"")))},[J,M]),(0,N.useEffect)(()=>{var Oe,Ve,nt,Fe;if(ne.current){de.current=new c.Terminal({fontSize:14,disableStdin:!0}),de.current.open(ne.current);const rt=ne.current.offsetWidth-14,Ze=((Fe=(nt=(Ve=(Oe=de.current)==null?void 0:Oe._core)==null?void 0:Ve._renderService)==null?void 0:nt.dimensions)==null?void 0:Fe.actualCellWidth)||9.5,st=Math.ceil(rt/Ze);de.current.resize(st,8),D(!0)}},[]),m.createElement("div",{ref:ne,className:u()("XtermText-valueRef",K)})}function Q(J){const{status:K,error_msg:M,output:D,input:ne,expected_output:de,is_file:Oe,input_file_url:Ve,output_file_url:nt,expected_output_file_url:Fe}=J;let rt=null;const Ze={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(K){case d.h.NOMATCH:rt=m.createElement(m.Fragment,null,m.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!Oe&&m.createElement(le,{className:"mb10",value:ne}),Oe&&m.createElement("div",{style:Ze},m.createElement("a",{onClick:()=>(0,E.LR)(Ve,ne)},ne)),m.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!Oe&&m.createElement(le,{className:"mb10",value:D&&U.Base64.decode(D)||""}),Oe&&m.createElement("div",{style:Ze},m.createElement("a",{onClick:()=>(0,E.LR)(nt,D)},D)),m.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!Oe&&m.createElement(le,{className:"mb10",value:de&&U.Base64.decode(de)||""}),Oe&&m.createElement("div",{style:Ze},m.createElement("a",{onClick:()=>(0,E.LR)(Fe,de)},de)));break;case d.h.EXECUTEFAILURE:rt=m.createElement(m.Fragment,null,m.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!Oe&&m.createElement(n.Z,{value:ne,style:Ze}),Oe&&m.createElement("div",{style:Ze},m.createElement("a",{onClick:()=>(0,E.LR)(Ve,ne)},ne)),m.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),m.createElement("pre",{className:"error"},U.Base64.decode(M)));break;case d.h.COMPILEFAILURE:rt=m.createElement(m.Fragment,null,m.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!Oe&&m.createElement(n.Z,{value:ne,style:Ze}),Oe&&m.createElement("div",{style:Ze},m.createElement("a",{onClick:()=>(0,E.LR)(Ve,ne)},ne)),m.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),m.createElement("pre",{className:"error"},U.Base64.decode(M)));break;case d.h.PODFAILURE:rt=m.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case d.h.TIMEOUT:rt=m.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return m.createElement(m.Fragment,null," ",rt," ")}function se(J){const{status:K,error_msg:M,execute_time:D,output:ne,input:de,expected_output:Oe,is_file:Ve,input_file_url:nt,output_file_url:Fe,expected_output_file_url:rt}=J;let Ze=null;switch(K){case d.h.OK:Ze=m.createElement(m.Fragment,null,m.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",D,"\u79D2"),m.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),m.createElement("pre",null,U.Base64.decode(ne)));break;case d.h.NOMATCH:Ze=m.createElement(m.Fragment,null,m.createElement("p",null,"\u8F93\u5165\uFF1A",m.createElement("pre",null,de)),m.createElement("p",null,"\u8F93\u51FA\uFF1A",ne&&U.Base64.decode(ne)),m.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",Oe&&U.Base64.decode(Oe)));break;case d.h.EXECUTEFAILURE:Ze=m.createElement(m.Fragment,null,m.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",m.createElement("pre",null,de)),m.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),m.createElement("pre",{className:"error"},U.Base64.decode(M)));break;case d.h.COMPILEFAILURE:Ze=m.createElement(m.Fragment,null,m.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",m.createElement("pre",null,de)),m.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),m.createElement("pre",{className:"error"},U.Base64.decode(M)));break;case d.h.PODFAILURE:Ze=m.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case d.h.TIMEOUT:Ze=m.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return m.createElement(m.Fragment,null," ",Ze," ")}var H=({id:J,is_file:K,input:M,debuging:D,submitting:ne,executingMessage:de,debugResult:Oe,onChangeInput:Ve,onDebugCode:nt,onSubmitCode:Fe})=>{const[rt,Ze]=(0,N.useReducer)(_e,ie),{visible:st,tabIndex:At}=rt;(0,N.useEffect)(()=>{Ze({type:0,payload:!1})},[J]);function Jt($t){let Me=$t.target.id;Ze({type:1,payload:Me})}function pt(){Ze({type:0,payload:!st})}const Bt=(0,N.useMemo)(()=>{if(Oe){const{status:$t}=Oe;return m.createElement(m.Fragment,null,se(Oe))}return null},[Oe]);function zt(){Ze({type:0,payload:!0}),Ze({type:1,payload:"1"}),nt()}return m.createElement("div",{className:"test-case-panel"},m.createElement("div",{className:`test-case-panel-body ${st?"active":""}`},m.createElement("ul",{className:"s-navs"},m.createElement("li",null,m.createElement("a",{className:"active"},"\u8C03\u8BD5\u4EE3\u7801\u7ED3\u679C"))),m.createElement(f.Z,{leftTitle:"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B",rightTitle:"\u4EE3\u7801\u6267\u884C\u7ED3\u679C",style:{height:240},leftNode:m.createElement(z,{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:K?"":M,onChange:Ve}),rightNode:D?m.createElement(b.Z,{message:"\u4EE3\u7801\u6267\u884C\u4E2D..."}):Oe?Bt:m.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")})),m.createElement("a",{className:`btn-collapse ${st?"up":""}`,onClick:pt},st?m.createElement(I.Z,null):m.createElement(A.Z,null)),m.createElement("footer",{className:"footer"},m.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),m.createElement("div",{className:"flex-container"},m.createElement(V.ZP,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),m.createElement(V.ZP,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),m.createElement(V.ZP,{className:"btn-green",type:"ghost",loading:D,onClick:zt},"\u8C03\u8BD5\u4EE3\u7801"),m.createElement(V.ZP,{type:"primary",className:"custom-ant-disabled",loading:ne,disabled:ne,onClick:()=>{Ze({type:0,payload:!1}),Fe()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},35106:function(Ct,Le,S){"use strict";S.d(Le,{h:function(){return N}});var N=(B=>(B[B.NOMATCH=-1]="NOMATCH",B[B.OK=0]="OK",B[B.TIMEOUT=2]="TIMEOUT",B[B.PODFAILURE=3]="PODFAILURE",B[B.COMPILEFAILURE=4]="COMPILEFAILURE",B[B.EXECUTEFAILURE=5]="EXECUTEFAILURE",B[B.HIDE_COMPILE_STATUS=11]="HIDE_COMPILE_STATUS",B))(N||{})},49802:function(Ct,Le,S){"use strict";S.d(Le,{H7:function(){return n},KC:function(){return u},M3:function(){return k},MK:function(){return b},MU:function(){return I},Rg:function(){return W},WH:function(){return m},X6:function(){return d},bM:function(){return V},bx:function(){return x},dd:function(){return c},de:function(){return O},fi:function(){return E},fu:function(){return B},gu:function(){return F},n4:function(){return f},qe:function(){return L},rL:function(){return P},rX:function(){return U},uc:function(){return $},vl:function(){return l},wO:function(){return T},zO:function(){return A}});var N=S(99064);function B(z){return(0,N.U2)(`mypractices/${z}.json`,{hidePopLogin:!0})}function V(z,ie){return(0,N.v_)(`mypractices/${z}/code_submit.json`,ie)}function I(z,ie){return(0,N.v_)(`mypractices/${z}/code_debug.json`,ie)}function A(z,ie){return ie.language&&(ie.language=encodeURIComponent(ie.language)),(0,N.U2)(`mypractices/${z}/submit_records.json`,ie)}function d(z){return(0,N.U2)("mypractices/record_detail.json",{id:z})}function U(z,ie){return(0,N.U2)(`mypractices/${z}/result.json`,{mode:ie})}function b(z,ie){return(0,N.v_)(`mypractices/${z}/add_notes.json`,ie)}function n(z,ie){return(0,N.v_)(`mypractices/${z}/restore_initial_code.json`,ie)}function E(z,ie){return(0,N.v_)(`mypractices/${z}/sync_code.json`,ie)}function f(z,ie){return(0,N.v_)(`mypractices/${z}/update_code.json`,ie)}function c(z){return(0,N.v_)(`mypractices/${z}/initial_codes.json`)}function l(z,ie){return(0,N.v_)(`discusses/${z}/plus.json`,ie)}function u(z){return(0,N.U2)("practices/practices_list.json",z)}function m(z,ie){return(0,N.U2)(`practices/${z}/question_solution_articles`,ie)}function x(z,ie){return(0,N.v_)(`practices/${z}/question_solution_articles`,ie)}function F(z,ie){return(0,N.gz)(`practices/${z}/question_solution_articles/${ie==null?void 0:ie.active}`,ie)}function k(z,ie){return(0,N.U2)(`practices/${z}/question_solution_articles/${ie==null?void 0:ie.active}/edit`,ie)}function T(z,ie){return(0,N.U2)(`practices/${z}/question_solution_articles/${ie==null?void 0:ie.active}`,ie)}function L(z,ie){return(0,N.v_)(`practices/${z}/question_solution_articles/${ie==null?void 0:ie.active}/set_authority_or_excellent`,ie)}function W(z,ie){return(0,N.v_)(`practices/${z}/question_solution_articles/${ie==null?void 0:ie.active}/praise_or_treads`,ie)}function P(z,ie){return(0,N.v_)(`practices/${z}/question_solution_articles/${ie==null?void 0:ie.active}/hide`)}function O(z,ie){return(0,N.IV)(`practices/${z}/question_solution_articles/${ie==null?void 0:ie.active}`,ie)}function $(z,ie){return(0,N.v_)(`mypractices/${z}/update_practice_time_sum`,ie)}},24768:function(Ct,Le,S){"use strict";S.d(Le,{AL:function(){return W},Iy:function(){return f},Qv:function(){return u},ez:function(){return L},jb:function(){return c}});var N=S(32834),B=S.n(N),V=S(11690),I=S.n(V);let A=1;function d(ie,te){const me=ie.match(/^(\s+)(?:```)/);if(me===null)return te;const _e=me[1];return te.split(`
|
|
|
`).map(le=>{const Q=le.match(/^\s+/);if(Q===null)return le;const[se]=Q;return se.length>=_e.length?le.slice(_e.length):le}).join(`
|
|
|
`)}let U=[],b=["<ul>"];const n=new(B()).Renderer,E=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function f(){U.length=0,b=["<ul>"]}const c={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function l(ie,te,me,_e){if(te>=ie.length||ie[te].level<=me)return te;var le=ie[te];_e.push("<li><a href='#"+A+le.anchor+"'>"+le.text+"</a>"),te++;var Q=[];return te=l(ie,te,le.level,Q),Q.length>0&&(_e.push("<ul>"),Q.forEach(function(se){_e.push(se)}),_e.push("</ul>")),_e.push("</li>"),te=l(ie,te,me,_e),te}function u(){return l(U,0,0,b),b.push("</ul>"),b.join("")}const m={heading(ie){const te=E.exec(ie);if(A+=1,te)return{type:"heading",raw:te[0],depth:te[1].length,text:te[2]}},fences(ie){const te=this.rules.block.fences.exec(ie);if(te){const me=te[0];let _e=d(me,te[3]||"");const le=te[2]?te[2].trim():te[2];if(["latex","katex","math"].indexOf(le)>=0){const Q=k(),se=_e;_e=Q,T[Q]={type:"block",expression:se}}return{type:"code",raw:me,lang:le,text:_e}}}},x=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let F=0;const k=()=>`__special_katext_id_${F++}__`;let T={};function L(){return T}function W(){F=0,T={}}function P(ie){return ie=ie.replace(x,(te,me)=>{const _e=k();return T[_e]={type:"inline",expression:me},_e}),ie}const O=n.listitem;n.listitem=function(ie){return O(P(ie))};const $=n.paragraph;n.paragraph=function(ie){return $(P(ie))};const z=n.tablecell;n.tablecell=function(ie,te){return z(P(ie),te)},n.code=function(ie,te,me){const _e=(te||"").match(/\S*/)[0];return _e?["latex","katex","math"].indexOf(_e)>=0?`<p class='editormd-tex'>${ie}</p>`:`<pre class="prettyprint linenums"><code class="language-${te}">${me?ie:(0,V.escape)(ie,!0)}</code></pre>
|
|
|
`:'<pre class="prettyprint linenums"><code>'+(me?ie:(0,V.escape)(ie,!0))+"</code></pre>"},n.heading=function(ie,te,me){let _e=this.options.headerPrefix+me.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return U.push({anchor:_e,level:te,text:ie}),"<h"+te+' id="'+A+_e+'">'+ie+"</h"+te+">"},B().setOptions({silent:!0,gfm:!0,pedantic:!1}),B().use({tokenizer:m,renderer:n}),Le.ZP=B()},36785:function(Ct,Le,S){"use strict";S.d(Le,{o2:function(){return A},yT:function(){return d}});var N=S(80702),B=S(33166);const V=B.i.map(U=>`${U}-inverse`),I=["success","processing","error","default","warning"];function A(U){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,N.Z)(V),(0,N.Z)(B.i)).includes(U):B.i.includes(U)}function d(U){return I.includes(U)}},79676:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return d}});var N=S(19447);function B(U,b,n,E){if(E===!1)return{adjustX:!1,adjustY:!1};const f=E&&typeof E=="object"?E:{},c={};switch(U){case"top":case"bottom":c.shiftX=b.dropdownArrowOffset*2+n;break;case"left":case"right":c.shiftY=b.dropdownArrowOffsetVertical*2+n;break}const l=Object.assign(Object.assign({},c),f);return l.shiftX||(l.adjustX=!0),l.shiftY||(l.adjustY=!0),l}const V={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},I={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},A=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function d(U){const{arrowWidth:b,autoAdjustOverflow:n,arrowPointAtCenter:E,offset:f,borderRadius:c,visibleFirst:l}=U,u=b/2,m={};return Object.keys(V).forEach(x=>{const F=E&&I[x]||V[x],k=Object.assign(Object.assign({},F),{offset:[0,0]});switch(m[x]=k,A.has(x)&&(k.autoArrow=!1),x){case"top":case"topLeft":case"topRight":k.offset[1]=-u-f;break;case"bottom":case"bottomLeft":case"bottomRight":k.offset[1]=u+f;break;case"left":case"leftTop":case"leftBottom":k.offset[0]=-u-f;break;case"right":case"rightTop":case"rightBottom":k.offset[0]=u+f;break}const T=(0,N.fS)({contentRadius:c,limitVerticalRadius:!0});if(E)switch(x){case"topLeft":case"bottomLeft":k.offset[0]=-T.dropdownArrowOffset-u;break;case"topRight":case"bottomRight":k.offset[0]=T.dropdownArrowOffset+u;break;case"leftTop":case"rightTop":k.offset[1]=-T.dropdownArrowOffset-u;break;case"leftBottom":case"rightBottom":k.offset[1]=T.dropdownArrowOffset+u;break}k.overflow=B(x,T,b,n),l&&(k.htmlRegion="visibleFirst")}),m}},19080:function(Ct,Le,S){"use strict";S.d(Le,{F:function(){return A},Z:function(){return I}});var N=S(92310),B=S.n(N);const V=null;function I(d,U,b){return B()({[`${d}-status-success`]:U==="success",[`${d}-status-warning`]:U==="warning",[`${d}-status-error`]:U==="error",[`${d}-status-validating`]:U==="validating",[`${d}-has-feedback`]:b})}const A=(d,U)=>U||d},9432:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return T},n:function(){return F}});var N=S(19248),B=S(92310),V=S.n(B),I=S(93681),A=S(8654),d=S(59301),U=S(19080),b=S(36355),n=S(1684),E=S(19716),f=S(32441),c=S(33234),l=S(59412),u=S(9937);function m(L){return!!(L.prefix||L.suffix||L.allowClear)}var x=function(L,W){var P={};for(var O in L)Object.prototype.hasOwnProperty.call(L,O)&&W.indexOf(O)<0&&(P[O]=L[O]);if(L!=null&&typeof Object.getOwnPropertySymbols=="function")for(var $=0,O=Object.getOwnPropertySymbols(L);$<O.length;$++)W.indexOf(O[$])<0&&Object.prototype.propertyIsEnumerable.call(L,O[$])&&(P[O[$]]=L[O[$]]);return P};function F(L,W){if(!L)return;L.focus(W);const{cursor:P}=W||{};if(P){const O=L.value.length;switch(P){case"start":L.setSelectionRange(0,0);break;case"end":L.setSelectionRange(O,O);break;default:L.setSelectionRange(0,O);break}}}var T=(0,d.forwardRef)((L,W)=>{var P;const{prefixCls:O,bordered:$=!0,status:z,size:ie,disabled:te,onBlur:me,onFocus:_e,suffix:le,allowClear:Q,addonAfter:se,addonBefore:H,className:J,style:K,styles:M,rootClassName:D,onChange:ne,classNames:de}=L,Oe=x(L,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames"]),{getPrefixCls:Ve,direction:nt,input:Fe}=d.useContext(b.E_),rt=Ve("input",O),Ze=(0,d.useRef)(null),[st,At]=(0,u.ZP)(rt),{compactSize:Jt,compactItemClassnames:pt}=(0,c.ri)(rt,nt),Bt=(0,E.Z)(at=>{var Je;return(Je=ie!=null?ie:Jt)!==null&&Je!==void 0?Je:at}),zt=d.useContext(n.Z),$t=te!=null?te:zt,{status:Me,hasFeedback:ze,feedbackIcon:Ue}=(0,d.useContext)(f.aM),ot=(0,U.F)(Me,z),ut=m(L)||!!ze,ue=(0,d.useRef)(ut);(0,d.useEffect)(()=>{var at;ut&&ue.current,ue.current=ut},[ut]);const be=(0,l.Z)(Ze,!0),De=at=>{be(),me==null||me(at)},Ae=at=>{be(),_e==null||_e(at)},Ne=at=>{be(),ne==null||ne(at)},je=(ze||le)&&d.createElement(d.Fragment,null,le,ze&&Ue);let Qe;return typeof Q=="object"&&(Q!=null&&Q.clearIcon)?Qe=Q:Q&&(Qe={clearIcon:d.createElement(N.Z,null)}),st(d.createElement(I.default,Object.assign({ref:(0,A.sQ)(W,Ze),prefixCls:rt,autoComplete:Fe==null?void 0:Fe.autoComplete},Oe,{disabled:$t,onBlur:De,onFocus:Ae,style:Object.assign(Object.assign({},Fe==null?void 0:Fe.style),K),styles:Object.assign(Object.assign({},Fe==null?void 0:Fe.styles),M),suffix:je,allowClear:Qe,className:V()(J,D,pt,Fe==null?void 0:Fe.className),onChange:Ne,addonAfter:se&&d.createElement(c.BR,null,d.createElement(f.Ux,{override:!0,status:!0},se)),addonBefore:H&&d.createElement(c.BR,null,d.createElement(f.Ux,{override:!0,status:!0},H)),classNames:Object.assign(Object.assign(Object.assign({},de),Fe==null?void 0:Fe.classNames),{input:V()({[`${rt}-sm`]:Bt==="small",[`${rt}-lg`]:Bt==="large",[`${rt}-rtl`]:nt==="rtl",[`${rt}-borderless`]:!$},!ut&&(0,U.Z)(rt,ot),de==null?void 0:de.input,(P=Fe==null?void 0:Fe.classNames)===null||P===void 0?void 0:P.input,At)}),classes:{affixWrapper:V()({[`${rt}-affix-wrapper-sm`]:Bt==="small",[`${rt}-affix-wrapper-lg`]:Bt==="large",[`${rt}-affix-wrapper-rtl`]:nt==="rtl",[`${rt}-affix-wrapper-borderless`]:!$},(0,U.Z)(`${rt}-affix-wrapper`,ot,ze),At),wrapper:V()({[`${rt}-group-rtl`]:nt==="rtl"},At),group:V()({[`${rt}-group-wrapper-sm`]:Bt==="small",[`${rt}-group-wrapper-lg`]:Bt==="large",[`${rt}-group-wrapper-rtl`]:nt==="rtl",[`${rt}-group-wrapper-disabled`]:$t},(0,U.Z)(`${rt}-group-wrapper`,ot,ze),At)}})))})},1643:function(Ct,Le,S){"use strict";var N=S(19248),B=S(92310),V=S.n(B),I=S(9296),A=S(59301),d=S(19080),U=S(36355),b=S(1684),n=S(19716),E=S(32441),f=S(9432),c=S(9937),l=function(m,x){var F={};for(var k in m)Object.prototype.hasOwnProperty.call(m,k)&&x.indexOf(k)<0&&(F[k]=m[k]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function")for(var T=0,k=Object.getOwnPropertySymbols(m);T<k.length;T++)x.indexOf(k[T])<0&&Object.prototype.propertyIsEnumerable.call(m,k[T])&&(F[k[T]]=m[k[T]]);return F};const u=(0,A.forwardRef)((m,x)=>{const{prefixCls:F,bordered:k=!0,size:T,disabled:L,status:W,allowClear:P,showCount:O,classNames:$,rootClassName:z,className:ie}=m,te=l(m,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames","rootClassName","className"]),{getPrefixCls:me,direction:_e}=A.useContext(U.E_),le=(0,n.Z)(T),Q=A.useContext(b.Z),se=L!=null?L:Q,{status:H,hasFeedback:J,feedbackIcon:K}=A.useContext(E.aM),M=(0,d.F)(H,W),D=A.useRef(null);A.useImperativeHandle(x,()=>{var nt;return{resizableTextArea:(nt=D.current)===null||nt===void 0?void 0:nt.resizableTextArea,focus:Fe=>{var rt,Ze;(0,f.n)((Ze=(rt=D.current)===null||rt===void 0?void 0:rt.resizableTextArea)===null||Ze===void 0?void 0:Ze.textArea,Fe)},blur:()=>{var Fe;return(Fe=D.current)===null||Fe===void 0?void 0:Fe.blur()}}});const ne=me("input",F);let de;typeof P=="object"&&(P!=null&&P.clearIcon)?de=P:P&&(de={clearIcon:A.createElement(N.Z,null)});const[Oe,Ve]=(0,c.ZP)(ne);return Oe(A.createElement(I.default,Object.assign({},te,{disabled:se,allowClear:de,className:V()(ie,z),classes:{affixWrapper:V()(`${ne}-textarea-affix-wrapper`,{[`${ne}-affix-wrapper-rtl`]:_e==="rtl",[`${ne}-affix-wrapper-borderless`]:!k,[`${ne}-affix-wrapper-sm`]:le==="small",[`${ne}-affix-wrapper-lg`]:le==="large",[`${ne}-textarea-show-count`]:O},(0,d.Z)(`${ne}-affix-wrapper`,M),Ve)},classNames:Object.assign(Object.assign({},$),{textarea:V()({[`${ne}-borderless`]:!k,[`${ne}-sm`]:le==="small",[`${ne}-lg`]:le==="large"},(0,d.Z)(ne,M),Ve,$==null?void 0:$.textarea)}),prefixCls:ne,suffix:J&&A.createElement("span",{className:`${ne}-textarea-suffix`},K),showCount:O,ref:D})))});Le.Z=u},59412:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return B}});var N=S(59301);function B(V,I){const A=(0,N.useRef)([]),d=()=>{A.current.push(setTimeout(()=>{var U,b,n,E;!((U=V.current)===null||U===void 0)&&U.input&&((b=V.current)===null||b===void 0?void 0:b.input.getAttribute("type"))==="password"&&(!((n=V.current)===null||n===void 0)&&n.input.hasAttribute("value"))&&((E=V.current)===null||E===void 0||E.input.removeAttribute("value"))}))};return(0,N.useEffect)(()=>(I&&d(),()=>A.current.forEach(U=>{U&&clearTimeout(U)})),[]),d}},92832:function(Ct,Le,S){"use strict";S.d(Le,{default:function(){return le}});var N=S(92310),B=S.n(N),V=S(59301),I=S(36355),A=S(32441),d=S(9937),b=Q=>{const{getPrefixCls:se,direction:H}=(0,V.useContext)(I.E_),{prefixCls:J,className:K}=Q,M=se("input-group",J),D=se("input"),[ne,de]=(0,d.ZP)(D),Oe=B()(M,{[`${M}-lg`]:Q.size==="large",[`${M}-sm`]:Q.size==="small",[`${M}-compact`]:Q.compact,[`${M}-rtl`]:H==="rtl"},de,K),Ve=(0,V.useContext)(A.aM),nt=(0,V.useMemo)(()=>Object.assign(Object.assign({},Ve),{isFormItemInput:!1}),[Ve]);return ne(V.createElement("span",{className:Oe,style:Q.style,onMouseEnter:Q.onMouseEnter,onMouseLeave:Q.onMouseLeave,onFocus:Q.onFocus,onBlur:Q.onBlur},V.createElement(A.aM.Provider,{value:nt},Q.children)))},n=S(9432),E=S(73331),f=S(15277),c=S(2738),l=S(8654),u=S(59412),m=function(Q,se){var H={};for(var J in Q)Object.prototype.hasOwnProperty.call(Q,J)&&se.indexOf(J)<0&&(H[J]=Q[J]);if(Q!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,J=Object.getOwnPropertySymbols(Q);K<J.length;K++)se.indexOf(J[K])<0&&Object.prototype.propertyIsEnumerable.call(Q,J[K])&&(H[J[K]]=Q[J[K]]);return H};const x=Q=>Q?V.createElement(f.Z,null):V.createElement(E.Z,null),F={click:"onClick",hover:"onMouseOver"};var T=V.forwardRef((Q,se)=>{const{visibilityToggle:H=!0}=Q,J=typeof H=="object"&&H.visible!==void 0,[K,M]=(0,V.useState)(()=>J?H.visible:!1),D=(0,V.useRef)(null);V.useEffect(()=>{J&&M(H.visible)},[J,H]);const ne=(0,u.Z)(D),de=()=>{const{disabled:$t}=Q;$t||(K&&ne(),M(Me=>{var ze;const Ue=!Me;return typeof H=="object"&&((ze=H.onVisibleChange)===null||ze===void 0||ze.call(H,Ue)),Ue}))},Oe=$t=>{const{action:Me="click",iconRender:ze=x}=Q,Ue=F[Me]||"",ot=ze(K),ut={[Ue]:de,className:`${$t}-icon`,key:"passwordIcon",onMouseDown:ue=>{ue.preventDefault()},onMouseUp:ue=>{ue.preventDefault()}};return V.cloneElement(V.isValidElement(ot)?ot:V.createElement("span",null,ot),ut)},{className:Ve,prefixCls:nt,inputPrefixCls:Fe,size:rt}=Q,Ze=m(Q,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:st}=V.useContext(I.E_),At=st("input",Fe),Jt=st("input-password",nt),pt=H&&Oe(Jt),Bt=B()(Jt,Ve,{[`${Jt}-${rt}`]:!!rt}),zt=Object.assign(Object.assign({},(0,c.Z)(Ze,["suffix","iconRender","visibilityToggle"])),{type:K?"text":"password",className:Bt,prefixCls:At,suffix:pt});return rt&&(zt.size=rt),V.createElement(n.Z,Object.assign({ref:(0,l.sQ)(se,D)},zt))}),L=S(47472),W=S(92343),P=S(3113),O=S(19716),$=S(33234),z=function(Q,se){var H={};for(var J in Q)Object.prototype.hasOwnProperty.call(Q,J)&&se.indexOf(J)<0&&(H[J]=Q[J]);if(Q!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,J=Object.getOwnPropertySymbols(Q);K<J.length;K++)se.indexOf(J[K])<0&&Object.prototype.propertyIsEnumerable.call(Q,J[K])&&(H[J[K]]=Q[J[K]]);return H},te=V.forwardRef((Q,se)=>{const{prefixCls:H,inputPrefixCls:J,className:K,size:M,suffix:D,enterButton:ne=!1,addonAfter:de,loading:Oe,disabled:Ve,onSearch:nt,onChange:Fe,onCompositionStart:rt,onCompositionEnd:Ze}=Q,st=z(Q,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:At,direction:Jt}=V.useContext(I.E_),pt=V.useRef(!1),Bt=At("input-search",H),zt=At("input",J),{compactSize:$t}=(0,$.ri)(Bt,Jt),Me=(0,O.Z)(We=>{var vt;return(vt=M!=null?M:$t)!==null&&vt!==void 0?vt:We}),ze=V.useRef(null),Ue=We=>{We&&We.target&&We.type==="click"&&nt&&nt(We.target.value,We,{source:"clear"}),Fe&&Fe(We)},ot=We=>{var vt;document.activeElement===((vt=ze.current)===null||vt===void 0?void 0:vt.input)&&We.preventDefault()},ut=We=>{var vt,gt;nt&&nt((gt=(vt=ze.current)===null||vt===void 0?void 0:vt.input)===null||gt===void 0?void 0:gt.value,We,{source:"input"})},ue=We=>{pt.current||Oe||ut(We)},be=typeof ne=="boolean"?V.createElement(L.Z,null):null,De=`${Bt}-button`;let Ae;const Ne=ne||{},je=Ne.type&&Ne.type.__ANT_BUTTON===!0;je||Ne.type==="button"?Ae=(0,W.Tm)(Ne,Object.assign({onMouseDown:ot,onClick:We=>{var vt,gt;(gt=(vt=Ne==null?void 0:Ne.props)===null||vt===void 0?void 0:vt.onClick)===null||gt===void 0||gt.call(vt,We),ut(We)},key:"enterButton"},je?{className:De,size:Me}:{})):Ae=V.createElement(P.ZP,{className:De,type:ne?"primary":void 0,size:Me,disabled:Ve,key:"enterButton",onMouseDown:ot,onClick:ut,loading:Oe,icon:be},ne),de&&(Ae=[Ae,(0,W.Tm)(de,{key:"addonAfter"})]);const Qe=B()(Bt,{[`${Bt}-rtl`]:Jt==="rtl",[`${Bt}-${Me}`]:!!Me,[`${Bt}-with-button`]:!!ne},K),at=We=>{pt.current=!0,rt==null||rt(We)},Je=We=>{pt.current=!1,Ze==null||Ze(We)};return V.createElement(n.Z,Object.assign({ref:(0,l.sQ)(ze,se),onPressEnter:ue},st,{size:Me,onCompositionStart:at,onCompositionEnd:Je,prefixCls:zt,addonAfter:Ae,suffix:D,onChange:Ue,className:Qe,disabled:Ve}))}),me=S(1643);const _e=n.Z;_e.Group=b,_e.Search=te,_e.TextArea=me.Z,_e.Password=T;var le=_e},9937:function(Ct,Le,S){"use strict";S.d(Le,{M1:function(){return U},TM:function(){return W},Xy:function(){return b},bi:function(){return f},e5:function(){return L},ik:function(){return c},nz:function(){return A},pU:function(){return d},s7:function(){return l},x0:function(){return E}});var N=S(17313),B=S(74207),V=S(37613),I=S(83116);const A=P=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:P,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),d=P=>({borderColor:P.hoverBorderColor}),U=P=>({borderColor:P.activeBorderColor,boxShadow:P.activeShadow,outline:0}),b=P=>({color:P.colorTextDisabled,backgroundColor:P.colorBgContainerDisabled,borderColor:P.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},d((0,V.TS)(P,{hoverBorderColor:P.colorBorder})))}),n=P=>{const{paddingBlockLG:O,fontSizeLG:$,lineHeightLG:z,borderRadiusLG:ie,paddingInlineLG:te}=P;return{padding:`${O}px ${te}px`,fontSize:$,lineHeight:z,borderRadius:ie}},E=P=>({padding:`${P.paddingBlockSM}px ${P.paddingInlineSM}px`,borderRadius:P.borderRadiusSM}),f=(P,O)=>{const{componentCls:$,colorError:z,colorWarning:ie,errorActiveShadow:te,warningActiveShadow:me,colorErrorBorderHover:_e,colorWarningBorderHover:le}=P;return{[`&-status-error:not(${O}-disabled):not(${O}-borderless)${O}`]:{borderColor:z,"&:hover":{borderColor:_e},"&:focus, &-focused":Object.assign({},U((0,V.TS)(P,{activeBorderColor:z,activeShadow:te}))),[`${$}-prefix, ${$}-suffix`]:{color:z}},[`&-status-warning:not(${O}-disabled):not(${O}-borderless)${O}`]:{borderColor:ie,"&:hover":{borderColor:le},"&:focus, &-focused":Object.assign({},U((0,V.TS)(P,{activeBorderColor:ie,activeShadow:me}))),[`${$}-prefix, ${$}-suffix`]:{color:ie}}}},c=P=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${P.paddingBlock}px ${P.paddingInline}px`,color:P.colorText,fontSize:P.fontSize,lineHeight:P.lineHeight,backgroundColor:P.colorBgContainer,backgroundImage:"none",borderWidth:P.lineWidth,borderStyle:P.lineType,borderColor:P.colorBorder,borderRadius:P.borderRadius,transition:`all ${P.motionDurationMid}`},A(P.colorTextPlaceholder)),{"&:hover":Object.assign({},d(P)),"&:focus, &-focused":Object.assign({},U(P)),"&-disabled, &[disabled]":Object.assign({},b(P)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:P.controlHeight,lineHeight:P.lineHeight,verticalAlign:"bottom",transition:`all ${P.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},n(P)),"&-sm":Object.assign({},E(P)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),l=P=>{const{componentCls:O,antCls:$}=P;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:P.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${O}, &-lg > ${O}-group-addon`]:Object.assign({},n(P)),[`&-sm ${O}, &-sm > ${O}-group-addon`]:Object.assign({},E(P)),[`&-lg ${$}-select-single ${$}-select-selector`]:{height:P.controlHeightLG},[`&-sm ${$}-select-single ${$}-select-selector`]:{height:P.controlHeightSM},[`> ${O}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${O}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${P.paddingInline}px`,color:P.colorText,fontWeight:"normal",fontSize:P.fontSize,textAlign:"center",backgroundColor:P.colorFillAlter,border:`${P.lineWidth}px ${P.lineType} ${P.colorBorder}`,borderRadius:P.borderRadius,transition:`all ${P.motionDurationSlow}`,lineHeight:1,[`${$}-select`]:{margin:`-${P.paddingBlock+1}px -${P.paddingInline}px`,[`&${$}-select-single:not(${$}-select-customize-input)`]:{[`${$}-select-selector`]:{backgroundColor:"inherit",border:`${P.lineWidth}px ${P.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${$}-select-selector`]:{color:P.colorPrimary}}},[`${$}-cascader-picker`]:{margin:`-9px -${P.paddingInline}px`,backgroundColor:"transparent",[`${$}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${O}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${O}-search-with-button &`]:{zIndex:0}}},[`> ${O}:first-child, ${O}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${$}-select ${$}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${O}-affix-wrapper`]:{[`&:not(:first-child) ${O}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${O}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${O}:last-child, ${O}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${$}-select ${$}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${O}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${O}-search &`]:{borderStartStartRadius:P.borderRadius,borderEndStartRadius:P.borderRadius}},[`&:not(:first-child), ${O}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${O}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,N.dF)()),{[`${O}-group-addon, ${O}-group-wrap, > ${O}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:P.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
|
|
|
& > ${O}-affix-wrapper,
|
|
|
& > ${O}-number-affix-wrapper,
|
|
|
& > ${$}-picker-range
|
|
|
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-P.lineWidth,borderInlineEndWidth:P.lineWidth},[`${O}`]:{float:"none"},[`& > ${$}-select > ${$}-select-selector,
|
|
|
& > ${$}-select-auto-complete ${O},
|
|
|
& > ${$}-cascader-picker ${O},
|
|
|
& > ${O}-group-wrapper ${O}`]:{borderInlineEndWidth:P.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${$}-select-focused`]:{zIndex:1},[`& > ${$}-select > ${$}-select-arrow`]:{zIndex:1},[`& > *:first-child,
|
|
|
& > ${$}-select:first-child > ${$}-select-selector,
|
|
|
& > ${$}-select-auto-complete:first-child ${O},
|
|
|
& > ${$}-cascader-picker:first-child ${O}`]:{borderStartStartRadius:P.borderRadius,borderEndStartRadius:P.borderRadius},[`& > *:last-child,
|
|
|
& > ${$}-select:last-child > ${$}-select-selector,
|
|
|
& > ${$}-cascader-picker:last-child ${O},
|
|
|
& > ${$}-cascader-picker-focused:last-child ${O}`]:{borderInlineEndWidth:P.lineWidth,borderStartEndRadius:P.borderRadius,borderEndEndRadius:P.borderRadius},[`& > ${$}-select-auto-complete ${O}`]:{verticalAlign:"top"},[`${O}-group-wrapper + ${O}-group-wrapper`]:{marginInlineStart:-P.lineWidth,[`${O}-affix-wrapper`]:{borderRadius:0}},[`${O}-group-wrapper:not(:last-child)`]:{[`&${O}-search > ${O}-group`]:{[`& > ${O}-group-addon > ${O}-search-button`]:{borderRadius:0},[`& > ${O}`]:{borderStartStartRadius:P.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:P.borderRadius}}}})}},u=P=>{const{componentCls:O,controlHeightSM:$,lineWidth:z}=P,te=($-z*2-16)/2;return{[O]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,N.Wf)(P)),c(P)),f(P,O)),{'&[type="color"]':{height:P.controlHeight,[`&${O}-lg`]:{height:P.controlHeightLG},[`&${O}-sm`]:{height:$,paddingTop:te,paddingBottom:te}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},m=P=>{const{componentCls:O}=P;return{[`${O}-clear-icon`]:{margin:0,color:P.colorTextQuaternary,fontSize:P.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${P.motionDurationSlow}`,"&:hover":{color:P.colorTextTertiary},"&:active":{color:P.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${P.inputAffixPadding}px`}}}},x=P=>{const{componentCls:O,inputAffixPadding:$,colorTextDescription:z,motionDurationSlow:ie,colorIcon:te,colorIconHover:me,iconCls:_e}=P;return{[`${O}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},c(P)),{display:"inline-flex",[`&:not(${O}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},d(P)),{zIndex:1,[`${O}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${O}[disabled]`]:{background:"transparent"}},[`> input${O}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${O}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:P.paddingXS}},"&-show-count-suffix":{color:z},"&-show-count-has-suffix":{marginInlineEnd:P.paddingXXS},"&-prefix":{marginInlineEnd:$},"&-suffix":{marginInlineStart:$}}}),m(P)),{[`${_e}${O}-password-icon`]:{color:te,cursor:"pointer",transition:`all ${ie}`,"&:hover":{color:me}}}),f(P,`${O}-affix-wrapper`))}},F=P=>{const{componentCls:O,colorError:$,colorWarning:z,borderRadiusLG:ie,borderRadiusSM:te}=P;return{[`${O}-group`]:Object.assign(Object.assign(Object.assign({},(0,N.Wf)(P)),l(P)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${O}-group-addon`]:{borderRadius:ie,fontSize:P.fontSizeLG}},"&-sm":{[`${O}-group-addon`]:{borderRadius:te}},"&-status-error":{[`${O}-group-addon`]:{color:$,borderColor:$}},"&-status-warning":{[`${O}-group-addon`]:{color:z,borderColor:z}},"&-disabled":{[`${O}-group-addon`]:Object.assign({},b(P))},[`&:not(${O}-compact-first-item):not(${O}-compact-last-item)${O}-compact-item`]:{[`${O}, ${O}-group-addon`]:{borderRadius:0}},[`&:not(${O}-compact-last-item)${O}-compact-first-item`]:{[`${O}, ${O}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${O}-compact-first-item)${O}-compact-last-item`]:{[`${O}, ${O}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},k=P=>{const{componentCls:O,antCls:$}=P,z=`${O}-search`;return{[z]:{[`${O}`]:{"&:hover, &:focus":{borderColor:P.colorPrimaryHover,[`+ ${O}-group-addon ${z}-button:not(${$}-btn-primary)`]:{borderInlineStartColor:P.colorPrimaryHover}}},[`${O}-affix-wrapper`]:{borderRadius:0},[`${O}-lg`]:{lineHeight:P.lineHeightLG-2e-4},[`> ${O}-group`]:{[`> ${O}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${z}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:P.borderRadius,borderEndEndRadius:P.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${z}-button:not(${$}-btn-primary)`]:{color:P.colorTextDescription,"&:hover":{color:P.colorPrimaryHover},"&:active":{color:P.colorPrimaryActive},[`&${$}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${z}-button`]:{height:P.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${z}-button`]:{height:P.controlHeightLG},[`&-small ${z}-button`]:{height:P.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${O}-compact-item`]:{[`&:not(${O}-compact-last-item)`]:{[`${O}-group-addon`]:{[`${O}-search-button`]:{marginInlineEnd:-P.lineWidth,borderRadius:0}}},[`&:not(${O}-compact-first-item)`]:{[`${O},${O}-affix-wrapper`]:{borderRadius:0}},[`> ${O}-group-addon ${O}-search-button,
|
|
|
> ${O},
|
|
|
${O}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${O}-affix-wrapper-focused`]:{zIndex:2}}}}},T=P=>{const{componentCls:O,paddingLG:$}=P,z=`${O}-textarea`;return{[z]:{position:"relative","&-show-count":{[`> ${O}`]:{height:"100%"},[`${O}-data-count`]:{position:"absolute",bottom:-P.fontSize*P.lineHeight,insetInlineEnd:0,color:P.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${O}`]:{paddingInlineEnd:$}},[`&-affix-wrapper${z}-has-feedback`]:{[`${O}`]:{paddingInlineEnd:$}},[`&-affix-wrapper${O}-affix-wrapper`]:{padding:0,[`> textarea${O}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${O}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${O}-clear-icon`]:{position:"absolute",insetInlineEnd:P.paddingXS,insetBlockStart:P.paddingXS},[`${z}-suffix`]:{position:"absolute",top:0,insetInlineEnd:P.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function L(P){return(0,V.TS)(P,{inputAffixPadding:P.paddingXXS})}const W=P=>{const{controlHeight:O,fontSize:$,lineHeight:z,lineWidth:ie,controlHeightSM:te,controlHeightLG:me,fontSizeLG:_e,lineHeightLG:le,paddingSM:Q,controlPaddingHorizontalSM:se,controlPaddingHorizontal:H,colorFillAlter:J,colorPrimaryHover:K,controlOutlineWidth:M,controlOutline:D,colorErrorOutline:ne,colorWarningOutline:de}=P;return{paddingBlock:Math.max(Math.round((O-$*z)/2*10)/10-ie,3),paddingBlockSM:Math.max(Math.round((te-$*z)/2*10)/10-ie,0),paddingBlockLG:Math.ceil((me-_e*le)/2*10)/10-ie,paddingInline:Q-ie,paddingInlineSM:se-ie,paddingInlineLG:H-ie,addonBg:J,activeBorderColor:K,hoverBorderColor:K,activeShadow:`0 0 0 ${M}px ${D}`,errorActiveShadow:`0 0 0 ${M}px ${ne}`,warningActiveShadow:`0 0 0 ${M}px ${de}`}};Le.ZP=(0,I.Z)("Input",P=>{const O=(0,V.TS)(P,L(P));return[u(O),T(O),x(O),F(O),k(O),(0,B.c)(O)]},W)},19447:function(Ct,Le,S){"use strict";S.d(Le,{ZP:function(){return A},fS:function(){return V},qN:function(){return B}});var N=S(47585);const B=8;function V(d){const U=B,{contentRadius:b,limitVerticalRadius:n}=d,E=b>12?b+2:12;return{dropdownArrowOffset:E,dropdownArrowOffsetVertical:n?U:E}}function I(d,U){return d?U:{}}function A(d,U){const{componentCls:b,sizePopupArrow:n,borderRadiusXS:E,borderRadiusOuter:f,boxShadowPopoverArrow:c}=d,{colorBg:l,contentRadius:u=d.borderRadiusLG,limitVerticalRadius:m,arrowDistance:x=0,arrowPlacement:F={left:!0,right:!0,top:!0,bottom:!0}}=U,{dropdownArrowOffsetVertical:k,dropdownArrowOffset:T}=V({contentRadius:u,limitVerticalRadius:m});return{[b]:Object.assign(Object.assign(Object.assign(Object.assign({[`${b}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,N.r)(n,E,f,l,c)),{"&:before":{background:l}})]},I(!!F.top,{[[`&-placement-top ${b}-arrow`,`&-placement-topLeft ${b}-arrow`,`&-placement-topRight ${b}-arrow`].join(",")]:{bottom:x,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${b}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${b}-arrow`]:{left:{_skip_check_:!0,value:T}},[`&-placement-topRight ${b}-arrow`]:{right:{_skip_check_:!0,value:T}}})),I(!!F.bottom,{[[`&-placement-bottom ${b}-arrow`,`&-placement-bottomLeft ${b}-arrow`,`&-placement-bottomRight ${b}-arrow`].join(",")]:{top:x,transform:"translateY(-100%)"},[`&-placement-bottom ${b}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${b}-arrow`]:{left:{_skip_check_:!0,value:T}},[`&-placement-bottomRight ${b}-arrow`]:{right:{_skip_check_:!0,value:T}}})),I(!!F.left,{[[`&-placement-left ${b}-arrow`,`&-placement-leftTop ${b}-arrow`,`&-placement-leftBottom ${b}-arrow`].join(",")]:{right:{_skip_check_:!0,value:x},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${b}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${b}-arrow`]:{top:k},[`&-placement-leftBottom ${b}-arrow`]:{bottom:k}})),I(!!F.right,{[[`&-placement-right ${b}-arrow`,`&-placement-rightTop ${b}-arrow`,`&-placement-rightBottom ${b}-arrow`].join(",")]:{left:{_skip_check_:!0,value:x},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${b}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${b}-arrow`]:{top:k},[`&-placement-rightBottom ${b}-arrow`]:{bottom:k}}))}}},47585:function(Ct,Le,S){"use strict";S.d(Le,{r:function(){return N}});const N=(B,V,I,A,d)=>{const U=B/2,b=0,n=U,E=I*1/Math.sqrt(2),f=U-I*(1-1/Math.sqrt(2)),c=U-V*(1/Math.sqrt(2)),l=I*(Math.sqrt(2)-1)+V*(1/Math.sqrt(2)),u=2*U-c,m=l,x=2*U-E,F=f,k=2*U-b,T=n,L=U*Math.sqrt(2)+I*(Math.sqrt(2)-2),W=I*(Math.sqrt(2)-1);return{pointerEvents:"none",width:B,height:B,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:B,height:B/2,background:A,clipPath:{_multi_value_:!0,value:[`polygon(${W}px 100%, 50% ${W}px, ${2*U-W}px 100%, ${W}px 100%)`,`path('M ${b} ${n} A ${I} ${I} 0 0 0 ${E} ${f} L ${c} ${l} A ${V} ${V} 0 0 1 ${u} ${m} L ${x} ${F} A ${I} ${I} 0 0 0 ${k} ${T} Z')`]},content:'""'},"&::after":{content:'""',position:"absolute",width:L,height:L,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${V}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:d,zIndex:0,background:"transparent"}}}},33166:function(Ct,Le,S){"use strict";S.d(Le,{i:function(){return N}});const N=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"]},45157:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return B}});var N=S(33166);function B(V,I){return N.i.reduce((A,d)=>{const U=V[`${d}1`],b=V[`${d}3`],n=V[`${d}6`],E=V[`${d}7`];return Object.assign(Object.assign({},A),I(d,{lightColor:U,lightBorderColor:b,darkColor:n,textColor:E}))},{})}},6848:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return me}});var N=S(59301),B=S(92310),V=S.n(B),I=S(55477),A=S(18929),d=S(62892),U=S(79676),b=S(92343),n=S(36355),E=S(33234),f=S(88088),c=S(17313),l=S(29878),u=S(19447),m=S(45157),x=S(37613),F=S(83116);const k=_e=>{const{componentCls:le,tooltipMaxWidth:Q,tooltipColor:se,tooltipBg:H,tooltipBorderRadius:J,zIndexPopup:K,controlHeight:M,boxShadowSecondary:D,paddingSM:ne,paddingXS:de,tooltipRadiusOuter:Oe}=_e;return[{[le]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,c.Wf)(_e)),{position:"absolute",zIndex:K,display:"block",width:"max-content",maxWidth:Q,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":H,[`${le}-inner`]:{minWidth:M,minHeight:M,padding:`${ne/2}px ${de}px`,color:se,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:H,borderRadius:J,boxShadow:D,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${le}-inner`]:{borderRadius:Math.min(J,u.qN)}},[`${le}-content`]:{position:"relative"}}),(0,m.Z)(_e,(Ve,nt)=>{let{darkColor:Fe}=nt;return{[`&${le}-${Ve}`]:{[`${le}-inner`]:{backgroundColor:Fe},[`${le}-arrow`]:{"--antd-arrow-background-color":Fe}}}})),{"&-rtl":{direction:"rtl"}})},(0,u.ZP)((0,x.TS)(_e,{borderRadiusOuter:Oe}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:J,limitVerticalRadius:!0}),{[`${le}-pure`]:{position:"relative",maxWidth:"none",margin:_e.sizePopupArrow}}]};var T=(_e,le)=>(0,F.Z)("Tooltip",se=>{if(le===!1)return[];const{borderRadius:H,colorTextLightSolid:J,colorBgDefault:K,borderRadiusOuter:M}=se,D=(0,x.TS)(se,{tooltipMaxWidth:250,tooltipColor:J,tooltipBorderRadius:H,tooltipBg:K,tooltipRadiusOuter:M>4?4:M});return[k(D),(0,l._y)(se,"zoom-big-fast")]},se=>{let{zIndexPopupBase:H,colorBgSpotlight:J}=se;return{zIndexPopup:H+70,colorBgDefault:J}},{resetStyle:!1})(_e),L=S(36785);function W(_e,le){const Q=(0,L.o2)(le),se=V()({[`${_e}-${le}`]:le&&Q}),H={},J={};return le&&!Q&&(H.background=le,J["--antd-arrow-background-color"]=le),{className:se,overlayStyle:H,arrowStyle:J}}var O=_e=>{const{prefixCls:le,className:Q,placement:se="top",title:H,color:J,overlayInnerStyle:K}=_e,{getPrefixCls:M}=N.useContext(n.E_),D=M("tooltip",le),[ne,de]=T(D,!0),Oe=W(D,J),Ve=Oe.arrowStyle,nt=Object.assign(Object.assign({},K),Oe.overlayStyle),Fe=V()(de,D,`${D}-pure`,`${D}-placement-${se}`,Q,Oe.className);return ne(N.createElement("div",{className:Fe,style:Ve},N.createElement("div",{className:`${D}-arrow`}),N.createElement(I.G,Object.assign({},_e,{className:de,prefixCls:D,overlayInnerStyle:nt}),H)))},$=function(_e,le){var Q={};for(var se in _e)Object.prototype.hasOwnProperty.call(_e,se)&&le.indexOf(se)<0&&(Q[se]=_e[se]);if(_e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var H=0,se=Object.getOwnPropertySymbols(_e);H<se.length;H++)le.indexOf(se[H])<0&&Object.prototype.propertyIsEnumerable.call(_e,se[H])&&(Q[se[H]]=_e[se[H]]);return Q};const z=(_e,le)=>{const Q={},se=Object.assign({},_e);return le.forEach(H=>{_e&&H in _e&&(Q[H]=_e[H],delete se[H])}),{picked:Q,omitted:se}};function ie(_e,le){const Q=_e.type;if((Q.__ANT_BUTTON===!0||_e.type==="button")&&_e.props.disabled||Q.__ANT_SWITCH===!0&&(_e.props.disabled||_e.props.loading)||Q.__ANT_RADIO===!0&&_e.props.disabled){const{picked:se,omitted:H}=z(_e.props.style,["position","left","right","top","bottom","float","display","zIndex"]),J=Object.assign(Object.assign({display:"inline-block"},se),{cursor:"not-allowed",width:_e.props.block?"100%":void 0}),K=Object.assign(Object.assign({},H),{pointerEvents:"none"}),M=(0,b.Tm)(_e,{style:K,className:null});return N.createElement("span",{style:J,className:V()(_e.props.className,`${le}-disabled-compatible-wrapper`)},M)}return _e}const te=N.forwardRef((_e,le)=>{var Q,se;const{prefixCls:H,openClassName:J,getTooltipContainer:K,overlayClassName:M,color:D,overlayInnerStyle:ne,children:de,afterOpenChange:Oe,afterVisibleChange:Ve,destroyTooltipOnHide:nt,arrow:Fe=!0,title:rt,overlay:Ze,builtinPlacements:st,arrowPointAtCenter:At=!1,autoAdjustOverflow:Jt=!0}=_e,pt=!!Fe,[,Bt]=(0,f.Z)(),{getPopupContainer:zt,getPrefixCls:$t,direction:Me}=N.useContext(n.E_),ze=N.useRef(null),Ue=()=>{var Pe;(Pe=ze.current)===null||Pe===void 0||Pe.forceAlign()};N.useImperativeHandle(le,()=>({forceAlign:Ue,forcePopupAlign:()=>{Ue()}}));const[ot,ut]=(0,A.Z)(!1,{value:(Q=_e.open)!==null&&Q!==void 0?Q:_e.visible,defaultValue:(se=_e.defaultOpen)!==null&&se!==void 0?se:_e.defaultVisible}),ue=!rt&&!Ze&&rt!==0,be=Pe=>{var He,he;ut(ue?!1:Pe),ue||((He=_e.onOpenChange)===null||He===void 0||He.call(_e,Pe),(he=_e.onVisibleChange)===null||he===void 0||he.call(_e,Pe))},De=N.useMemo(()=>{var Pe,He;let he=At;return typeof Fe=="object"&&(he=(He=(Pe=Fe.pointAtCenter)!==null&&Pe!==void 0?Pe:Fe.arrowPointAtCenter)!==null&&He!==void 0?He:At),st||(0,U.Z)({arrowPointAtCenter:he,autoAdjustOverflow:Jt,arrowWidth:pt?Bt.sizePopupArrow:0,borderRadius:Bt.borderRadius,offset:Bt.marginXXS,visibleFirst:!0})},[At,Fe,st,Bt]),Ae=N.useMemo(()=>rt===0?rt:Ze||rt||"",[Ze,rt]),Ne=N.createElement(E.BR,null,typeof Ae=="function"?Ae():Ae),{getPopupContainer:je,placement:Qe="top",mouseEnterDelay:at=.1,mouseLeaveDelay:Je=.1,overlayStyle:We,rootClassName:vt}=_e,gt=$(_e,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),mt=$t("tooltip",H),xt=$t(),Lt=_e["data-popover-inject"];let yt=ot;!("open"in _e)&&!("visible"in _e)&&ue&&(yt=!1);const Mt=ie((0,b.l$)(de)&&!(0,b.M2)(de)?de:N.createElement("span",null,de),mt),Nt=Mt.props,j=!Nt.className||typeof Nt.className=="string"?V()(Nt.className,J||`${mt}-open`):Nt.className,[Z,tt]=T(mt,!Lt),oe=W(mt,D),xe=oe.arrowStyle,Kt=Object.assign(Object.assign({},ne),oe.overlayStyle),ke=V()(M,{[`${mt}-rtl`]:Me==="rtl"},oe.className,vt,tt);return Z(N.createElement(I.Z,Object.assign({},gt,{showArrow:pt,placement:Qe,mouseEnterDelay:at,mouseLeaveDelay:Je,prefixCls:mt,overlayClassName:ke,overlayStyle:Object.assign(Object.assign({},xe),We),getTooltipContainer:je||K||zt,ref:ze,builtinPlacements:De,overlay:Ne,visible:yt,onVisibleChange:be,afterVisibleChange:Oe!=null?Oe:Ve,overlayInnerStyle:Kt,arrowContent:N.createElement("span",{className:`${mt}-arrow-content`}),motion:{motionName:(0,d.m)(xt,"zoom-big-fast",_e.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!nt}),yt?(0,b.Tm)(Mt,{className:j}):Mt))});te._InternalPanelDoNotUseOrYouWillBeFired=O;var me=te},64018:function(){var Ct,Le,S,N=!1,B,V;window.PR_SHOULD_USE_CONTINUATION=!0;var I,A;(function(){var d=window,U=["break,continue,do,else,for,if,return,while"],b=[U,"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=[b,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],E=[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"],m="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",x=[U,"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"],F=[U,"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"],k=[U,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[E,c,f,u,m,x,F,k],L=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,W="str",P="kwd",O="com",$="typ",z="lit",ie="pun",te="pln",me="tag",_e="dec",le="src",Q="atn",se="atv",H="nocode",J="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function K(Me){for(var ze=0,Ue=!1,ot=!1,ut=0,ue=Me.length;ut<ue;++ut){var be=Me[ut];if(be.ignoreCase)ot=!0;else if(/[a-z]/i.test(be.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ue=!0,ot=!1;break}}var De={b:8,t:9,n:10,v:11,f:12,r:13};function Ae(Je){var We=Je.charCodeAt(0);if(We!==92)return We;var vt=Je.charAt(1);return We=De[vt],We||("0"<=vt&&vt<="7"?parseInt(Je.substring(1),8):vt==="u"||vt==="x"?parseInt(Je.substring(2),16):Je.charCodeAt(1))}function Ne(Je){if(Je<32)return(Je<16?"\\x0":"\\x")+Je.toString(16);var We=String.fromCharCode(Je);return We==="\\"||We==="-"||We==="]"||We==="^"?"\\"+We:We}function je(Je){var We=Je.substring(1,Je.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")),vt=[],gt=We[0]==="^",mt=["["];gt&&mt.push("^");for(var xt=gt?1:0,Lt=We.length;xt<Lt;++xt){var yt=We[xt];if(/\\[bdsw]/i.test(yt))mt.push(yt);else{var Mt=Ae(yt),Nt;xt+2<Lt&&We[xt+1]==="-"?(Nt=Ae(We[xt+2]),xt+=2):Nt=Mt,vt.push([Mt,Nt]),Nt<65||Mt>122||(Nt<65||Mt>90||vt.push([Math.max(65,Mt)|32,Math.min(Nt,90)|32]),Nt<97||Mt>122||vt.push([Math.max(97,Mt)&-33,Math.min(Nt,122)&-33]))}}vt.sort(function(oe,xe){return oe[0]-xe[0]||xe[1]-oe[1]});for(var j=[],Z=[],xt=0;xt<vt.length;++xt){var tt=vt[xt];tt[0]<=Z[1]+1?Z[1]=Math.max(Z[1],tt[1]):j.push(Z=tt)}for(var xt=0;xt<j.length;++xt){var tt=j[xt];mt.push(Ne(tt[0])),tt[1]>tt[0]&&(tt[1]+1>tt[0]&&mt.push("-"),mt.push(Ne(tt[1])))}return mt.push("]"),mt.join("")}function Qe(Je){for(var We=Je.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")),vt=We.length,gt=[],mt=0,xt=0;mt<vt;++mt){var Lt=We[mt];if(Lt==="(")++xt;else if(Lt.charAt(0)==="\\"){var yt=+Lt.substring(1);yt&&(yt<=xt?gt[yt]=-1:We[mt]=Ne(yt))}}for(var mt=1;mt<gt.length;++mt)gt[mt]===-1&&(gt[mt]=++ze);for(var mt=0,xt=0;mt<vt;++mt){var Lt=We[mt];if(Lt==="(")++xt,gt[xt]||(We[mt]="(?:");else if(Lt.charAt(0)==="\\"){var yt=+Lt.substring(1);yt&&yt<=xt&&(We[mt]="\\"+gt[yt])}}for(var mt=0;mt<vt;++mt)We[mt]==="^"&&We[mt+1]!=="^"&&(We[mt]="");if(Je.ignoreCase&&Ue)for(var mt=0;mt<vt;++mt){var Lt=We[mt],Mt=Lt.charAt(0);Lt.length>=2&&Mt==="["?We[mt]=je(Lt):Mt!=="\\"&&(We[mt]=Lt.replace(/[a-zA-Z]/g,function(Z){var tt=Z.charCodeAt(0);return"["+String.fromCharCode(tt&-33,tt|32)+"]"}))}return We.join("")}for(var at=[],ut=0,ue=Me.length;ut<ue;++ut){var be=Me[ut];if(be.global||be.multiline)throw new Error(""+be);at.push("(?:"+Qe(be)+")")}return new RegExp(at.join("|"),ot?"gi":"g")}function M(Me,ze){var Ue=/(?:^|\s)nocode(?:\s|$)/,ot=[],ut=0,ue=[],be=0;function De(Ae){var Ne=Ae.nodeType;if(Ne==1){if(Ue.test(Ae.className))return;for(var je=Ae.firstChild;je;je=je.nextSibling)De(je);var Qe=Ae.nodeName.toLowerCase();(Qe==="br"||Qe==="li")&&(ot[be]=`
|
|
|
`,ue[be<<1]=ut++,ue[be++<<1|1]=Ae)}else if(Ne==3||Ne==4){var at=Ae.nodeValue;at.length&&(ze?at=at.replace(/\r\n?/g,`
|
|
|
`):at=at.replace(/[ \t\r\n]+/g," "),ot[be]=at,ue[be<<1]=ut,ut+=at.length,ue[be++<<1|1]=Ae)}}return De(Me),{sourceCode:ot.join("").replace(/\n$/,""),spans:ue}}function D(Me,ze,Ue,ot,ut){if(Ue){var ue={sourceNode:Me,pre:1,langExtension:null,numberLines:null,sourceCode:Ue,spans:null,basePos:ze,decorations:null};ot(ue),ut.push.apply(ut,ue.decorations)}}var ne=/\S/;function de(Me){for(var ze=void 0,Ue=Me.firstChild;Ue;Ue=Ue.nextSibling){var ot=Ue.nodeType;ze=ot===1?ze?Me:Ue:ot===3&&ne.test(Ue.nodeValue)?Me:ze}return ze===Me?void 0:ze}function Oe(Me,ze){var Ue={},ot;(function(){for(var be=Me.concat(ze),De=[],Ae={},Ne=0,je=be.length;Ne<je;++Ne){var Qe=be[Ne],at=Qe[3];if(at)for(var Je=at.length;--Je>=0;)Ue[at.charAt(Je)]=Qe;var We=Qe[1],vt=""+We;Ae.hasOwnProperty(vt)||(De.push(We),Ae[vt]=null)}De.push(/[\0-\uffff]/),ot=K(De)})();var ut=ze.length,ue=function(be){for(var De=be.sourceCode,Ae=be.basePos,Ne=be.sourceNode,je=[Ae,te],Qe=0,at=De.match(ot)||[],Je={},We=0,vt=at.length;We<vt;++We){var gt=at[We],mt=Je[gt],xt=void 0,Lt;if(typeof mt=="string")Lt=!1;else{var yt=Ue[gt.charAt(0)];if(yt)xt=gt.match(yt[1]),mt=yt[0];else{for(var Mt=0;Mt<ut;++Mt)if(yt=ze[Mt],xt=gt.match(yt[1]),xt){mt=yt[0];break}xt||(mt=te)}Lt=mt.length>=5&&mt.substring(0,5)==="lang-",Lt&&!(xt&&typeof xt[1]=="string")&&(Lt=!1,mt=le),Lt||(Je[gt]=mt)}var Nt=Qe;if(Qe+=gt.length,!Lt)je.push(Ae+Nt,mt);else{var j=xt[1],Z=gt.indexOf(j),tt=Z+j.length;xt[2]&&(tt=gt.length-xt[2].length,Z=tt-j.length);var oe=mt.substring(5);D(Ne,Ae+Nt,gt.substring(0,Z),ue,je),D(Ne,Ae+Nt+Z,j,At(oe,j),je),D(Ne,Ae+Nt+tt,gt.substring(tt),ue,je)}}be.decorations=je};return ue}function Ve(Me){var ze=[],Ue=[];Me.tripleQuotedStrings?ze.push([W,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Me.multiLineStrings?ze.push([W,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ze.push([W,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Me.verbatimStrings&&Ue.push([W,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ot=Me.hashComments;ot&&(Me.cStyleComments?(ot>1?ze.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ze.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ue.push([W,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ze.push([O,/^#[^\r\n]*/,null,"#"])),Me.cStyleComments&&(Ue.push([O,/^\/\/[^\r\n]*/,null]),Ue.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ut=Me.regexLiterals;if(ut){var ue=ut>1?"":`
|
|
|
\r`,be=ue?".":"[\\S\\s]",De="/(?=[^/*"+ue+"])(?:[^/\\x5B\\x5C"+ue+"]|\\x5C"+be+"|\\x5B(?:[^\\x5C\\x5D"+ue+"]|\\x5C"+be+")*(?:\\x5D|$))+/";Ue.push(["lang-regex",RegExp("^"+J+"("+De+")")])}var Ae=Me.types;Ae&&Ue.push([$,Ae]);var Ne=(""+Me.keywords).replace(/^ | $/g,"");Ne.length&&Ue.push([P,new RegExp("^(?:"+Ne.replace(/[\s,]+/g,"|")+")\\b"),null]),ze.push([te,/^\s+/,null,` \r
|
|
|
\xA0`]);var je="^.[^\\s\\w.$@'\"`/\\\\]*";return Me.regexLiterals&&(je+="(?!s*/)"),Ue.push([z,/^@[a-z_$][a-z_$@0-9]*/i,null],[$,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[te,/^[a-z_$][a-z_$@0-9]*/i,null],[z,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[te,/^\\[\s\S]?/,null],[ie,new RegExp(je),null]),Oe(ze,Ue)}var nt=Ve({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Fe(Me,ze,Ue){for(var ot=/(?:^|\s)nocode(?:\s|$)/,ut=/\r\n?|\n/,ue=Me.ownerDocument,be=ue.createElement("li");Me.firstChild;)be.appendChild(Me.firstChild);var De=[be];function Ae(We){var vt=We.nodeType;if(vt==1&&!ot.test(We.className))if(We.nodeName==="br")Ne(We),We.parentNode&&We.parentNode.removeChild(We);else for(var gt=We.firstChild;gt;gt=gt.nextSibling)Ae(gt);else if((vt==3||vt==4)&&Ue){var mt=We.nodeValue,xt=mt.match(ut);if(xt){var Lt=mt.substring(0,xt.index);We.nodeValue=Lt;var yt=mt.substring(xt.index+xt[0].length);if(yt){var Mt=We.parentNode;Mt.insertBefore(ue.createTextNode(yt),We.nextSibling)}Ne(We),Lt||We.parentNode.removeChild(We)}}}function Ne(We){for(;!We.nextSibling;)if(We=We.parentNode,!We)return;function vt(xt,Lt){var yt=Lt?xt.cloneNode(!1):xt,Mt=xt.parentNode;if(Mt){var Nt=vt(Mt,1),j=xt.nextSibling;Nt.appendChild(yt);for(var Z=j;Z;Z=j)j=Z.nextSibling,Nt.appendChild(Z)}return yt}for(var gt=vt(We.nextSibling,0),mt;(mt=gt.parentNode)&&mt.nodeType===1;)gt=mt;De.push(gt)}for(var je=0;je<De.length;++je)Ae(De[je]);ze===(ze|0)&&De[0].setAttribute("value",ze);var Qe=ue.createElement("ol");Qe.className="linenums";for(var at=Math.max(0,ze-1|0)||0,je=0,Je=De.length;je<Je;++je)be=De[je],be.className="L"+(je+at)%10,be.firstChild||be.appendChild(ue.createTextNode("\xA0")),Qe.appendChild(be);Me.appendChild(Qe)}function rt(Me){var ze=/\bMSIE\s(\d+)/.exec(navigator.userAgent);ze=ze&&+ze[1]<=8;var Ue=/\n/g,ot=Me.sourceCode,ut=ot.length,ue=0,be=Me.spans,De=be.length,Ae=0,Ne=Me.decorations,je=Ne.length,Qe=0;Ne[je]=ut;var at,Je;for(Je=at=0;Je<je;)Ne[Je]!==Ne[Je+2]?(Ne[at++]=Ne[Je++],Ne[at++]=Ne[Je++]):Je+=2;for(je=at,Je=at=0;Je<je;){for(var We=Ne[Je],vt=Ne[Je+1],gt=Je+2;gt+2<=je&&Ne[gt+1]===vt;)gt+=2;Ne[at++]=We,Ne[at++]=vt,Je=gt}je=Ne.length=at;var mt=Me.sourceNode,xt="";mt&&(xt=mt.style.display,mt.style.display="none");try{for(var Lt=null;Ae<De;){var yt=be[Ae],Mt=be[Ae+2]||ut,Nt=Ne[Qe+2]||ut,gt=Math.min(Mt,Nt),j=be[Ae+1],Z;if(j.nodeType!==1&&(Z=ot.substring(ue,gt))){ze&&(Z=Z.replace(Ue,"\r")),j.nodeValue=Z;var tt=j.ownerDocument,oe=tt.createElement("span");oe.className=Ne[Qe+1];var xe=j.parentNode;xe.replaceChild(oe,j),oe.appendChild(j),ue<Mt&&(be[Ae+1]=j=tt.createTextNode(ot.substring(gt,Mt)),xe.insertBefore(j,oe.nextSibling))}ue=gt,ue>=Mt&&(Ae+=2),ue>=Nt&&(Qe+=2)}}finally{mt&&(mt.style.display=xt)}}var Ze={};function st(Me,ze){for(var Ue=ze.length;--Ue>=0;){var ot=ze[Ue];Ze.hasOwnProperty(ot)?d.console&&console.warn("cannot override language handler %s",ot):Ze[ot]=Me}}function At(Me,ze){return Me&&Ze.hasOwnProperty(Me)||(Me=/^\s*</.test(ze)?"default-markup":"default-code"),Ze[Me]}st(nt,["default-code"]),st(Oe([],[[te,/^[^<?]+/],[_e,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[ie,/^(?:<[%?]|[%?]>)/],["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"]),st(Oe([[te,/^[\s]+/,null,` \r
|
|
|
`],[se,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[me,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[Q,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[ie,/^[=<>\/]+/],["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"]),st(Oe([],[[se,/^[\s\S]+/]]),["uq.val"]),st(Ve({keywords:E,hashComments:!0,cStyleComments:!0,types:L}),["c","cc","cpp","cxx","cyc","m"]),st(Ve({keywords:"null,true,false"}),["json"]),st(Ve({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:L}),["cs"]),st(Ve({keywords:f,cStyleComments:!0}),["java"]),st(Ve({keywords:k,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),st(Ve({keywords:x,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),st(Ve({keywords:m,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),st(Ve({keywords:F,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),st(Ve({keywords:u,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),st(Ve({keywords:l,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),st(Oe([],[[W,/^[\s\S]+/]]),["regex"]);function Jt(Me){var ze=Me.langExtension;try{var Ue=M(Me.sourceNode,Me.pre),ot=Ue.sourceCode;Me.sourceCode=ot,Me.spans=Ue.spans,Me.basePos=0,At(ze,ot)(Me),rt(Me)}catch(ut){d.console&&console.log(ut&&ut.stack||ut)}}function pt(Me,ze,Ue){var ot=Ue||!1,ut=ze||null,ue=document.createElement("div");ue.innerHTML="<pre>"+Me+"</pre>",ue=ue.firstChild,ot&&Fe(ue,ot,!0);var be={langExtension:ut,numberLines:ot,sourceNode:ue,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Jt(be),ue.innerHTML}function Bt(Me,ze){var Ue=ze||document.body,ot=Ue.ownerDocument||document;function ut(yt){return Ue.getElementsByTagName(yt)}for(var ue=[ut("pre"),ut("code"),ut("xmp")],be=[],De=0;De<ue.length;++De)for(var Ae=0,Ne=ue[De].length;Ae<Ne;++Ae)be.push(ue[De][Ae]);ue=null;var je=Date;je.now||(je={now:function(){return+new Date}});var Qe=0,at=/\blang(?:uage)?-([\w.]+)(?!\S)/,Je=/\bprettyprint\b/,We=/\bprettyprinted\b/,vt=/pre|xmp/i,gt=/^code$/i,mt=/^(?:pre|code|xmp)$/i,xt={};function Lt(){for(var yt=d.PR_SHOULD_USE_CONTINUATION?je.now()+250:1/0;Qe<be.length&&je.now()<yt;Qe++){for(var Mt=be[Qe],Nt=xt,j=Mt;j=j.previousSibling;){var Z=j.nodeType,tt=(Z===7||Z===8)&&j.nodeValue;if(tt?!/^\??prettify\b/.test(tt):Z!==3||/\S/.test(j.nodeValue))break;if(tt){Nt={},tt.replace(/\b(\w+)=([\w:.%+-]+)/g,function(we,kt,Ft){Nt[kt]=Ft});break}}var oe=Mt.className;if((Nt!==xt||Je.test(oe))&&!We.test(oe)){for(var xe=!1,Kt=Mt.parentNode;Kt;Kt=Kt.parentNode){var ke=Kt.tagName;if(mt.test(ke)&&Kt.className&&Je.test(Kt.className)){xe=!0;break}}if(!xe){Mt.className+=" prettyprinted";var Pe=Nt.lang;if(!Pe){Pe=oe.match(at);var He;!Pe&&(He=de(Mt))&>.test(He.tagName)&&(Pe=He.className.match(at)),Pe&&(Pe=Pe[1])}var he;if(vt.test(Mt.tagName))he=1;else{var ge=Mt.currentStyle,ye=ot.defaultView,Ie=ge?ge.whiteSpace:ye&&ye.getComputedStyle?ye.getComputedStyle(Mt,null).getPropertyValue("white-space"):0;he=Ie&&Ie.substring(0,3)==="pre"}var ae=Nt.linenums;(ae=ae==="true"||+ae)||(ae=oe.match(/\blinenums\b(?::(\d+))?/),ae=ae?ae[1]&&ae[1].length?+ae[1]:!0:!1),ae&&Fe(Mt,ae,he);var _t={langExtension:Pe,sourceNode:Mt,numberLines:ae,pre:he,sourceCode:null,basePos:null,spans:null,decorations:null};Jt(_t)}}}Qe<be.length?d.setTimeout(Lt,250):typeof Me=="function"&&Me()}Lt()}var zt=d.PR={createSimpleLexer:Oe,registerLangHandler:st,sourceDecorator:Ve,PR_ATTRIB_NAME:Q,PR_ATTRIB_VALUE:se,PR_COMMENT:O,PR_DECLARATION:_e,PR_KEYWORD:P,PR_LITERAL:z,PR_NOCODE:H,PR_PLAIN:te,PR_PUNCTUATION:ie,PR_SOURCE:le,PR_STRING:W,PR_TAG:me,PR_TYPE:$,prettyPrintOne:N?d.prettyPrintOne=pt:I=pt,prettyPrint:A=N?d.prettyPrint=Bt:A=Bt},$t=d.define;typeof $t=="function"&&$t.amd&&$t("google-code-prettify",[],function(){return zt})})()},25769:function(Ct,Le,S){"use strict";var N=S(98040),B={"text/plain":"Text","text/html":"Url",default:"Text"},V="Copy to clipboard: #{key}, Enter";function I(d){var U=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return d.replace(/#{\s*key\s*}/g,U)}function A(d,U){var b,n,E,f,c,l,u=!1;U||(U={}),b=U.debug||!1;try{E=N(),f=document.createRange(),c=document.getSelection(),l=document.createElement("span"),l.textContent=d,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(x){if(x.stopPropagation(),U.format)if(x.preventDefault(),typeof x.clipboardData=="undefined"){b&&console.warn("unable to use e.clipboardData"),b&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var F=B[U.format]||B.default;window.clipboardData.setData(F,d)}else x.clipboardData.clearData(),x.clipboardData.setData(U.format,d);U.onCopy&&(x.preventDefault(),U.onCopy(x.clipboardData))}),document.body.appendChild(l),f.selectNodeContents(l),c.addRange(f);var m=document.execCommand("copy");if(!m)throw new Error("copy command was unsuccessful");u=!0}catch(x){b&&console.error("unable to copy using execCommand: ",x),b&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(U.format||"text",d),U.onCopy&&U.onCopy(window.clipboardData),u=!0}catch(F){b&&console.error("unable to copy using clipboardData: ",F),b&&console.error("falling back to prompt"),n=I("message"in U?U.message:V),window.prompt(n,d)}}finally{c&&(typeof c.removeRange=="function"?c.removeRange(f):c.removeAllRanges()),l&&document.body.removeChild(l),E()}return u}Ct.exports=A},24334:function(Ct,Le,S){var N,B;(function(V,I){Ct.exports=I(V)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof S.g!="undefined"?S.g:this,function(V){"use strict";V=V||{};var I=V.Base64,A="2.6.4",d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",U=function(Q){for(var se={},H=0,J=Q.length;H<J;H++)se[Q.charAt(H)]=H;return se}(d),b=String.fromCharCode,n=function(Q){if(Q.length<2){var se=Q.charCodeAt(0);return se<128?Q:se<2048?b(192|se>>>6)+b(128|se&63):b(224|se>>>12&15)+b(128|se>>>6&63)+b(128|se&63)}else{var se=65536+(Q.charCodeAt(0)-55296)*1024+(Q.charCodeAt(1)-56320);return b(240|se>>>18&7)+b(128|se>>>12&63)+b(128|se>>>6&63)+b(128|se&63)}},E=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,f=function(Q){return Q.replace(E,n)},c=function(Q){var se=[0,2,1][Q.length%3],H=Q.charCodeAt(0)<<16|(Q.length>1?Q.charCodeAt(1):0)<<8|(Q.length>2?Q.charCodeAt(2):0),J=[d.charAt(H>>>18),d.charAt(H>>>12&63),se>=2?"=":d.charAt(H>>>6&63),se>=1?"=":d.charAt(H&63)];return J.join("")},l=V.btoa&&typeof V.btoa=="function"?function(Q){return V.btoa(Q)}:function(Q){if(Q.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return Q.replace(/[\s\S]{1,3}/g,c)},u=function(Q){return l(f(String(Q)))},m=function(Q){return Q.replace(/[+\/]/g,function(se){return se=="+"?"-":"_"}).replace(/=/g,"")},x=function(Q,se){return se?m(u(Q)):u(Q)},F=function(Q){return x(Q,!0)},k;V.Uint8Array&&(k=function(Q,se){for(var H="",J=0,K=Q.length;J<K;J+=3){var M=Q[J],D=Q[J+1],ne=Q[J+2],de=M<<16|D<<8|ne;H+=d.charAt(de>>>18)+d.charAt(de>>>12&63)+(typeof D!="undefined"?d.charAt(de>>>6&63):"=")+(typeof ne!="undefined"?d.charAt(de&63):"=")}return se?m(H):H});var T=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=function(Q){switch(Q.length){case 4:var se=(7&Q.charCodeAt(0))<<18|(63&Q.charCodeAt(1))<<12|(63&Q.charCodeAt(2))<<6|63&Q.charCodeAt(3),H=se-65536;return b((H>>>10)+55296)+b((H&1023)+56320);case 3:return b((15&Q.charCodeAt(0))<<12|(63&Q.charCodeAt(1))<<6|63&Q.charCodeAt(2));default:return b((31&Q.charCodeAt(0))<<6|63&Q.charCodeAt(1))}},W=function(Q){return Q.replace(T,L)},P=function(Q){var se=Q.length,H=se%4,J=(se>0?U[Q.charAt(0)]<<18:0)|(se>1?U[Q.charAt(1)]<<12:0)|(se>2?U[Q.charAt(2)]<<6:0)|(se>3?U[Q.charAt(3)]:0),K=[b(J>>>16),b(J>>>8&255),b(J&255)];return K.length-=[0,0,2,1][H],K.join("")},O=V.atob&&typeof V.atob=="function"?function(Q){return V.atob(Q)}:function(Q){return Q.replace(/\S{1,4}/g,P)},$=function(Q){return O(String(Q).replace(/[^A-Za-z0-9\+\/]/g,""))},z=function(Q){return W(O(Q))},ie=function(Q){return String(Q).replace(/[-_]/g,function(se){return se=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},te=function(Q){return z(ie(Q))},me;V.Uint8Array&&(me=function(Q){return Uint8Array.from($(ie(Q)),function(se){return se.charCodeAt(0)})});var _e=function(){var Q=V.Base64;return V.Base64=I,Q};if(V.Base64={VERSION:A,atob:$,btoa:l,fromBase64:te,toBase64:x,utob:f,encode:x,encodeURI:F,btou:W,decode:te,noConflict:_e,fromUint8Array:k,toUint8Array:me},typeof Object.defineProperty=="function"){var le=function(Q){return{value:Q,enumerable:!1,writable:!0,configurable:!0}};V.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",le(function(){return te(this)})),Object.defineProperty(String.prototype,"toBase64",le(function(Q){return x(this,Q)})),Object.defineProperty(String.prototype,"toBase64URI",le(function(){return x(this,!0)}))}}return V.Meteor&&(Base64=V.Base64),Ct.exports?Ct.exports.Base64=V.Base64:(N=[],B=function(){return V.Base64}.apply(Le,N),B!==void 0&&(Ct.exports=B)),{Base64:V.Base64}})},53184:function(Ct,Le,S){"use strict";var N,B;function V(I,A,d){var U=function(b,n){return I.js_beautify(b,n)};return U.js=I.js_beautify,U.css=A.css_beautify,U.html=d.html_beautify,U.js_beautify=I.js_beautify,U.css_beautify=A.css_beautify,U.html_beautify=d.html_beautify,U}N=[S(58553),S(87804),S(40998)],B=function(I,A,d){return V(I,A,d)}.apply(Le,N),B!==void 0&&(Ct.exports=B)},87804:function(Ct,Le){var S,N;(function(){var B;(function(){"use strict";var I=[,,function(b){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 E(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}E.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},E.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},E.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},E.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 E(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 m=this.__lines[u];if(m.is_empty())break;if(m.item(0).indexOf(c)!==0&&m.item(-1)!==l){this.__lines.splice(u+1,0,new n(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},b.exports.Output=f},,,,function(b){function n(c,l){this.raw_options=E(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],m=l||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(m=u.concat()):typeof u=="string"&&(m=u.split(/[^a-zA-Z0-9_\/\-]+/)),m},n.prototype._get_boolean=function(c,l){var u=this.raw_options[c],m=u===void 0?!!l:!!u;return m},n.prototype._get_characters=function(c,l){var u=this.raw_options[c],m=l||"";return typeof u=="string"&&(m=u.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),m},n.prototype._get_number=function(c,l){var u=this.raw_options[c];l=parseInt(l,10),isNaN(l)&&(l=0);var m=parseInt(u,10);return isNaN(m)&&(m=l),m},n.prototype._get_selection=function(c,l,u){var m=this._get_selection_list(c,l,u);if(m.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 m[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 m=this._get_array(c,u);if(!this._is_valid_selection(m,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 m},n.prototype._is_valid_selection=function(c,l){return c.length&&l.length&&!c.some(function(u){return l.indexOf(u)===-1})};function E(c,l){var u={};c=f(c);var m;for(m in c)m!==l&&(u[m]=c[m]);if(l&&c[l])for(m in c[l])u[m]=c[l][m];return u}function f(c){var l={},u;for(u in c){var m=u.replace(/-/g,"_");l[m]=c[u]}return l}b.exports.Options=n,b.exports.normalizeOpts=f,b.exports.mergeOpts=E},,function(b){var n=RegExp.prototype.hasOwnProperty("sticky");function E(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}E.prototype.restart=function(){this.__position=0},E.prototype.back=function(){this.__position>0&&(this.__position-=1)},E.prototype.hasNext=function(){return this.__position<this.__input_length},E.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},E.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},E.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},E.prototype.test=function(f,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(f,c):!1},E.prototype.testChar=function(f,c){var l=this.peek(c);return f.lastIndex=0,l!==null&&f.test(l)},E.prototype.match=function(f){var c=this.__match(f,this.__position);return c?this.__position+=c[0].length:c=null,c},E.prototype.read=function(f,c,l){var u="",m;return f&&(m=this.match(f),m&&(u+=m[0])),c&&(m||!f)&&(u+=this.readUntil(c,l)),u},E.prototype.readUntil=function(f,c){var l="",u=this.__position;f.lastIndex=this.__position;var m=f.exec(this.__input);return m?(u=m.index,c&&(u+=m[0].length)):u=this.__input_length,l=this.__input.substring(this.__position,u),this.__position=u,l},E.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},E.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},E.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},E.prototype.peekUntilAfter=function(f){var c=this.__position,l=this.readUntilAfter(f);return this.__position=c,l},E.prototype.lookBack=function(f){var c=this.__position-1;return c>=f.length&&this.__input.substring(c-f.length,c).toLowerCase()===f},b.exports.InputScanner=E},,,,,function(b){function n(E,f){E=typeof E=="string"?E:E.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(E+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(E+/\sbeautify\signore:end\s/.source+f,"g")}n.prototype.get_directives=function(E){if(!E.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(E);c;)f[c[1]]=c[2],c=this.__directive_pattern.exec(E);return f},n.prototype.readIgnored=function(E){return E.readUntilAfter(this.__directives_end_ignore_pattern)},b.exports.Directives=n},,function(b,n,E){var f=E(16).Beautifier,c=E(17).Options;function l(u,m){var x=new f(u,m);return x.beautify()}b.exports=l,b.exports.defaultOptions=function(){return new c}},function(b,n,E){var f=E(17).Options,c=E(2).Output,l=E(8).InputScanner,u=E(13).Directives,m=new u(/\/\*/,/\*\//),x=/\r\n|[\r\n]/,F=/\r\n|[\r\n]/g,k=/\s/,T=/(?:\s|\n)+/g,L=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,W=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function P(O,$){this._source_text=O||"",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"]}P.prototype.eatString=function(O){var $="";for(this._ch=this._input.next();this._ch;){if($+=this._ch,this._ch==="\\")$+=this._input.next();else if(O.indexOf(this._ch)!==-1||this._ch===`
|
|
|
`)break;this._ch=this._input.next()}return $},P.prototype.eatWhitespace=function(O){for(var $=k.test(this._input.peek()),z=0;k.test(this._input.peek());)this._ch=this._input.next(),O&&this._ch===`
|
|
|
`&&(z===0||z<this._options.max_preserve_newlines)&&(z++,this._output.add_new_line(!0));return $},P.prototype.foundNestedPseudoClass=function(){for(var O=0,$=1,z=this._input.peek($);z;){if(z==="{")return!0;if(z==="(")O+=1;else if(z===")"){if(O===0)return!1;O-=1}else if(z===";"||z==="}")return!1;$++,z=this._input.peek($)}return!1},P.prototype.print_string=function(O){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(O)},P.prototype.preserveSingleSpace=function(O){O&&(this._output.space_before_token=!0)},P.prototype.indent=function(){this._indentLevel++},P.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},P.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O=this._source_text,$=this._options.eol;$==="auto"&&($=`
|
|
|
`,O&&x.test(O||"")&&($=O.match(x)[0])),O=O.replace(F,`
|
|
|
`);var z=O.match(/^[\t ]*/)[0];this._output=new c(this._options,z),this._input=new l(O),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var ie=0,te=!1,me=!1,_e=!1,le=!1,Q=!1,se=this._ch,H=!1,J,K,M;J=this._input.read(T),K=J!=="",M=se,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),se=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var D=this._input.read(L),ne=m.get_directives(D);ne&&ne.ignore==="start"&&(D+=m.readIgnored(this._input)),this.print_string(D),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(W)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(K),this.print_string(this._ch);var de=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);de.match(/[ :]$/)&&(de=this.eatString(": ").replace(/\s+$/,""),this.print_string(de),this._output.space_before_token=!0),ie===0&&de.indexOf(":")!==-1&&(me=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(K),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var Oe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Oe.match(/[ :]$/)&&(Oe=this.eatString(": ").replace(/\s+$/,""),this.print_string(Oe),this._output.space_before_token=!0),ie===0&&Oe.indexOf(":")!==-1?(me=!0,this.indent()):Oe in this.NESTED_AT_RULE?(this._nestedLevel+=1,Oe in this.CONDITIONAL_GROUP_RULE&&(_e=!0)):ie===0&&!me&&(le=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(K),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")me&&(me=!1,this.outdent()),le=!1,_e?(_e=!1,te=this._indentLevel>=this._nestedLevel):te=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&te&&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)):(M==="("?this._output.space_before_token=!1:M!==","&&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(),M==="{"&&this._output.trim(!0),me&&(this.outdent(),me=!1),this.print_string(this._ch),te=!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 Ve=0;Ve<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Ve++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Ve])){H=!0;break}(te||_e)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!le&&ie===0?(this.print_string(":"),me||(me=!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 nt=M==='"'||M==="'";this.preserveSingleSpace(nt||K),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")H=!1,ie===0?(me&&(this.outdent(),me=!1),le=!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(),ie++,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(")")),ie&&(ie--,this.outdent()));else{var Fe=!1;this._input.lookBack("with")&&(Fe=!0),this.preserveSingleSpace(K||Fe),this.print_string(this._ch),me&&M==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),Q=!0):(this.eatWhitespace(),ie++,this.indent())}else if(this._ch===")")ie&&(ie--,this.outdent()),Q&&this._input.peek()===";"&&this._options.selector_separator_newline&&(Q=!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&&(!me||Q)&&ie===0&&!le?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!me&&ie===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&&k.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(K),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),k.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 rt=M==='"'||M==="'";this.preserveSingleSpace(rt||K),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
|
`&&H&&this._output.add_new_line()}var Ze=this._output.get_code($);return Ze},b.exports.Beautifier=P},function(b,n,E){var f=E(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 m=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var x=0;x<m.length;x++)m[x]!=="expand"?this.brace_style="collapse":this.brace_style=m[x]}c.prototype=new f,b.exports.Options=c}],A={};function d(b){var n=A[b];if(n!==void 0)return n.exports;var E=A[b]={exports:{}};return I[b](E,E.exports,d),E.exports}var U=d(15);B=U})();var V=B;S=[],N=function(){return{css_beautify:V}}.apply(Le,S),N!==void 0&&(Ct.exports=N)})()},40998:function(Ct,Le,S){var N,B;(function(){var V;(function(){"use strict";var U=[,,function(f){function c(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}c.prototype.clone_empty=function(){var m=new c(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},c.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},c.prototype.has_match=function(m){for(var x=this.__items.length-1;x>=0;x--)if(this.__items[x].match(m))return!0;return!1},c.prototype.set_indent=function(m,x){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=x||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 m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},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(m){this.__items.push(m);var x=m.lastIndexOf(`
|
|
|
`);x!==-1?this.__character_count=m.length-x:this.__character_count+=m.length},c.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},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 m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function l(m,x){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),x=x||"",m.indent_level>0&&(x=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=x,this.__base_string_length=x.length}l.prototype.get_indent_size=function(m,x){var F=this.__base_string_length;return x=x||0,m<0&&(F=0),F+=m*this.__indent_size,F+=x,F},l.prototype.get_indent_string=function(m,x){var F=this.__base_string;return x=x||0,m<0&&(m=0,F=""),x+=m*this.__indent_size,this.__ensure_cache(x),F+=this.__cache[x],F},l.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},l.prototype.__add_column=function(){var m=this.__cache.length,x=0,F="";this.__indent_size&&m>=this.__indent_size&&(x=Math.floor(m/this.__indent_size),m-=x*this.__indent_size,F=new Array(x+1).join(this.__indent_string)),m&&(F+=new Array(m+1).join(" ")),this.__cache.push(F)};function u(m,x){this.__indent_cache=new l(m,x),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new 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(m,x){return this.__indent_cache.get_indent_string(m,x)},u.prototype.get_indent_size=function(m,x){return this.__indent_cache.get_indent_size(m,x)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(m){this.trim(!0);var x=this.current_line.pop();x&&(x[x.length-1]===`
|
|
|
`&&(x=x.replace(/\n+$/g,"")),this.current_line.push(x)),this._end_with_newline&&this.__add_outputline();var F=this.__lines.join(`
|
|
|
`);return m!==`
|
|
|
`&&(F=F.replace(/[\n]/g,m)),F},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(m,x){return m=m||0,x=x||0,this.next_line.set_indent(m,x),this.__lines.length>1?(this.current_line.set_indent(m,x),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(m){for(var x=0;x<m.newlines;x++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},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(m){for(var x=this.__lines.length;m<x;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},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(m,x){for(var F=this.__lines.length-2;F>=0;){var k=this.__lines[F];if(k.is_empty())break;if(k.item(0).indexOf(m)!==0&&k.item(-1)!==x){this.__lines.splice(F+1,0,new c(this)),this.previous_line=this.__lines[this.__lines.length-2];break}F--}},f.exports.Output=u},function(f){function c(l,u,m,x){this.type=l,this.text=u,this.comments_before=null,this.newlines=m||0,this.whitespace_before=x||"",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(m,x){this.raw_options=l(m,x),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(m,x){var F=this.raw_options[m],k=x||[];return typeof F=="object"?F!==null&&typeof F.concat=="function"&&(k=F.concat()):typeof F=="string"&&(k=F.split(/[^a-zA-Z0-9_\/\-]+/)),k},c.prototype._get_boolean=function(m,x){var F=this.raw_options[m],k=F===void 0?!!x:!!F;return k},c.prototype._get_characters=function(m,x){var F=this.raw_options[m],k=x||"";return typeof F=="string"&&(k=F.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),k},c.prototype._get_number=function(m,x){var F=this.raw_options[m];x=parseInt(x,10),isNaN(x)&&(x=0);var k=parseInt(F,10);return isNaN(k)&&(k=x),k},c.prototype._get_selection=function(m,x,F){var k=this._get_selection_list(m,x,F);if(k.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
|
`+x+`
|
|
|
You passed in: '`+this.raw_options[m]+"'");return k[0]},c.prototype._get_selection_list=function(m,x,F){if(!x||x.length===0)throw new Error("Selection list cannot be empty.");if(F=F||[x[0]],!this._is_valid_selection(F,x))throw new Error("Invalid Default Value!");var k=this._get_array(m,F);if(!this._is_valid_selection(k,x))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
|
`+x+`
|
|
|
You passed in: '`+this.raw_options[m]+"'");return k},c.prototype._is_valid_selection=function(m,x){return m.length&&x.length&&!m.some(function(F){return x.indexOf(F)===-1})};function l(m,x){var F={};m=u(m);var k;for(k in m)k!==x&&(F[k]=m[k]);if(x&&m[x])for(k in m[x])F[k]=m[x][k];return F}function u(m){var x={},F;for(F in m){var k=F.replace(/-/g,"_");x[k]=m[F]}return x}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 m=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(m=this.__input.charAt(u)),m},l.prototype.__match=function(u,m){u.lastIndex=m;var x=u.exec(this.__input);return x&&!(c&&u.sticky)&&x.index!==m&&(x=null),x},l.prototype.test=function(u,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(u,m):!1},l.prototype.testChar=function(u,m){var x=this.peek(m);return u.lastIndex=0,x!==null&&u.test(x)},l.prototype.match=function(u){var m=this.__match(u,this.__position);return m?this.__position+=m[0].length:m=null,m},l.prototype.read=function(u,m,x){var F="",k;return u&&(k=this.match(u),k&&(F+=k[0])),m&&(k||!u)&&(F+=this.readUntil(m,x)),F},l.prototype.readUntil=function(u,m){var x="",F=this.__position;u.lastIndex=this.__position;var k=u.exec(this.__input);return k?(F=k.index,m&&(F+=k[0].length)):F=this.__input_length,x=this.__input.substring(this.__position,F),this.__position=F,x},l.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},l.prototype.get_regexp=function(u,m){var x=null,F="g";return m&&c&&(F="y"),typeof u=="string"&&u!==""?x=new RegExp(u,F):u&&(x=new RegExp(u.source,F)),x},l.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},l.prototype.peekUntilAfter=function(u){var m=this.__position,x=this.readUntilAfter(u);return this.__position=m,x},l.prototype.lookBack=function(u){var m=this.__position-1;return m>=u.length&&this.__input.substring(m-u.length,m).toLowerCase()===u},f.exports.InputScanner=l},function(f,c,l){var u=l(8).InputScanner,m=l(3).Token,x=l(10).TokenStream,F=l(11).WhitespacePattern,k={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},T=function(L,W){this._input=new u(L),this._options=W||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new F(this._input)};T.prototype.tokenize=function(){this._input.restart(),this.__tokens=new x,this._reset();for(var L,W=new m(k.START,""),P=null,O=[],$=new x;W.type!==k.EOF;){for(L=this._get_next_token(W,P);this._is_comment(L);)$.add(L),L=this._get_next_token(W,P);$.isEmpty()||(L.comments_before=$,$=new x),L.parent=P,this._is_opening(L)?(O.push(P),P=L):P&&this._is_closing(L,P)&&(L.opened=P,P.closed=L,P=O.pop(),L.parent=P),L.previous=W,W.next=L,this.__tokens.add(L),W=L}return this.__tokens},T.prototype._is_first_token=function(){return this.__tokens.isEmpty()},T.prototype._reset=function(){},T.prototype._get_next_token=function(L,W){this._readWhitespace();var P=this._input.read(/.+/g);return P?this._create_token(k.RAW,P):this._create_token(k.EOF,"")},T.prototype._is_comment=function(L){return!1},T.prototype._is_opening=function(L){return!1},T.prototype._is_closing=function(L,W){return!1},T.prototype._create_token=function(L,W){var P=new m(L,W,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return P},T.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},f.exports.Tokenizer=T,f.exports.TOKEN=k},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 m(x,F){u.call(this,x,F),F?this._line_regexp=this._input.get_regexp(F._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new u,m.prototype.__set_whitespace_patterns=function(x,F){x+="\\t ",F+="\\n\\r",this._match_pattern=this._input.get_regexp("["+x+F+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+F+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var x=this._input.read(this._match_pattern);if(x===" ")this.whitespace_before_token=" ";else if(x){var F=this.__split(this._newline_regexp,x);this.newline_count=F.length-1,this.whitespace_before_token=F[this.newline_count]}return x},m.prototype.matching=function(x,F){var k=this._create();return k.__set_whitespace_patterns(x,F),k._update(),k},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(x,F){x.lastIndex=0;for(var k=0,T=[],L=x.exec(F);L;)T.push(F.substring(k,L.index)),k=L.index+L[0].length,L=x.exec(F);return k<F.length?T.push(F.substring(k,F.length)):T.push(""),T},f.exports.WhitespacePattern=m},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 m=this.__directive_pattern.exec(l);m;)u[m[1]]=m[2],m=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,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function x(F,k){u.call(this,F,k),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),k&&(this.__template_pattern=this._input.get_regexp(k.__template_pattern),this._excluded=Object.assign(this._excluded,k._excluded),this._disabled=Object.assign(this._disabled,k._disabled));var T=new u(F);this.__patterns={handlebars_comment:T.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:T.starting_with(/{{{/).until_after(/}}}/),handlebars:T.starting_with(/{{/).until_after(/}}/),php:T.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:T.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:T.starting_with(/{%/).until_after(/%}/),django_value:T.starting_with(/{{/).until_after(/}}/),django_comment:T.starting_with(/{#/).until_after(/#}/),smarty:T.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:T.starting_with(/{\*/).until_after(/\*}/),smarty_literal:T.starting_with(/{literal}/).until_after(/{\/literal}/)}}x.prototype=new u,x.prototype._create=function(){return new x(this._input,this)},x.prototype._update=function(){this.__set_templated_pattern()},x.prototype.disable=function(F){var k=this._create();return k._disabled[F]=!0,k._update(),k},x.prototype.read_options=function(F){var k=this._create();for(var T in m)k._disabled[T]=F.templating.indexOf(T)===-1;return k._update(),k},x.prototype.exclude=function(F){var k=this._create();return k._excluded[F]=!0,k._update(),k},x.prototype.read=function(){var F="";this._match_pattern?F=this._input.read(this._starting_pattern):F=this._input.read(this._starting_pattern,this.__template_pattern);for(var k=this._read_template();k;)this._match_pattern?k+=this._input.read(this._match_pattern):k+=this._input.readUntil(this.__template_pattern),F+=k,k=this._read_template();return this._until_after&&(F+=this._input.readUntilAfter(this._until_pattern)),F},x.prototype.__set_templated_pattern=function(){var F=[];this._disabled.php||F.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||F.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||F.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||F.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(F.push(this.__patterns.django._starting_pattern.source),F.push(this.__patterns.django_value._starting_pattern.source),F.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||F.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&F.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+F.join("|")+")")},x.prototype._read_template=function(){var F="",k=this._input.peek();if(k==="<"){var T=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&T==="?"&&(F=F||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&T==="%"&&(F=F||this.__patterns.erb.read())}else k==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(F=F||this.__patterns.handlebars_comment.read(),F=F||this.__patterns.handlebars_unescaped.read(),F=F||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(F=F||this.__patterns.django_value.read()),this._excluded.django||(F=F||this.__patterns.django_comment.read(),F=F||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(F=F||this.__patterns.smarty_comment.read(),F=F||this.__patterns.smarty_literal.read(),F=F||this.__patterns.smarty.read()));return F},f.exports.TemplatablePattern=x},,,,function(f,c,l){var u=l(19).Beautifier,m=l(20).Options;function x(F,k,T,L){var W=new u(F,k,T,L);return W.beautify()}f.exports=x,f.exports.defaultOptions=function(){return new m}},function(f,c,l){var u=l(20).Options,m=l(2).Output,x=l(21).Tokenizer,F=l(21).TOKEN,k=/\r\n|[\r\n]/,T=/\r\n|[\r\n]/g,L=function(le,Q){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=le.max_preserve_newlines,this.preserve_newlines=le.preserve_newlines,this._output=new m(le,Q)};L.prototype.current_line_has_match=function(le){return this._output.current_line.has_match(le)},L.prototype.set_space_before_token=function(le,Q){this._output.space_before_token=le,this._output.non_breaking_space=Q},L.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},L.prototype.add_raw_token=function(le){this._output.add_raw_token(le)},L.prototype.print_preserved_newlines=function(le){var Q=0;le.type!==F.TEXT&&le.previous.type!==F.TEXT&&(Q=le.newlines?1:0),this.preserve_newlines&&(Q=le.newlines<this.max_preserve_newlines+1?le.newlines:this.max_preserve_newlines+1);for(var se=0;se<Q;se++)this.print_newline(se>0);return Q!==0},L.prototype.traverse_whitespace=function(le){return le.whitespace_before||le.newlines?(this.print_preserved_newlines(le)||(this._output.space_before_token=!0),!0):!1},L.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},L.prototype.print_newline=function(le){this._output.add_new_line(le)},L.prototype.print_token=function(le){le.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(le.text))},L.prototype.indent=function(){this.indent_level++},L.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},L.prototype.get_full_indent=function(le){return le=this.indent_level+(le||0),le<1?"":this._output.get_indent_string(le)};var W=function(le){for(var Q=null,se=le.next;se.type!==F.EOF&&le.closed!==se;){if(se.type===F.ATTRIBUTE&&se.text==="type"){se.next&&se.next.type===F.EQUALS&&se.next.next&&se.next.next.type===F.VALUE&&(Q=se.next.next.text);break}se=se.next}return Q},P=function(le,Q){var se=null,H=null;return Q.closed?(le==="script"?se="text/javascript":le==="style"&&(se="text/css"),se=W(Q)||se,se.search("text/css")>-1?H="css":se.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?H="javascript":se.search(/(text|application|dojo)\/(x-)?(html)/)>-1?H="html":se.search(/test\/null/)>-1&&(H="null"),H):null};function O(le,Q){return Q.indexOf(le)!==-1}function $(le,Q,se){this.parent=le||null,this.tag=Q?Q.tag_name:"",this.indent_level=se||0,this.parser_token=Q||null}function z(le){this._printer=le,this._current_frame=null}z.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},z.prototype.record_tag=function(le){var Q=new $(this._current_frame,le,this._printer.indent_level);this._current_frame=Q},z.prototype._try_pop_frame=function(le){var Q=null;return le&&(Q=le.parser_token,this._printer.indent_level=le.indent_level,this._current_frame=le.parent),Q},z.prototype._get_frame=function(le,Q){for(var se=this._current_frame;se&&le.indexOf(se.tag)===-1;){if(Q&&Q.indexOf(se.tag)!==-1){se=null;break}se=se.parent}return se},z.prototype.try_pop=function(le,Q){var se=this._get_frame([le],Q);return this._try_pop_frame(se)},z.prototype.indent_to_tag=function(le){var Q=this._get_frame(le);Q&&(this._printer.indent_level=Q.indent_level)};function ie(le,Q,se,H){this._source_text=le||"",Q=Q||{},this._js_beautify=se,this._css_beautify=H,this._tag_stack=null;var J=new u(Q,"html");this._options=J,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"}ie.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var le=this._source_text,Q=this._options.eol;this._options.eol==="auto"&&(Q=`
|
|
|
`,le&&k.test(le)&&(Q=le.match(k)[0])),le=le.replace(T,`
|
|
|
`);var se=le.match(/^[\t ]*/)[0],H={text:"",type:""},J=new te(this._options),K=new L(this._options,se),M=new x(le,this._options).tokenize();this._tag_stack=new z(K);for(var D=null,ne=M.next();ne.type!==F.EOF;)ne.type===F.TAG_OPEN||ne.type===F.COMMENT?(D=this._handle_tag_open(K,ne,J,H,M),J=D):ne.type===F.ATTRIBUTE||ne.type===F.EQUALS||ne.type===F.VALUE||ne.type===F.TEXT&&!J.tag_complete?D=this._handle_inside_tag(K,ne,J,H):ne.type===F.TAG_CLOSE?D=this._handle_tag_close(K,ne,J):ne.type===F.TEXT?D=this._handle_text(K,ne,J):ne.type===F.CONTROL_FLOW_OPEN?D=this._handle_control_flow_open(K,ne):ne.type===F.CONTROL_FLOW_CLOSE?D=this._handle_control_flow_close(K,ne):K.add_raw_token(ne),H=D,ne=M.next();var de=K._output.get_code(Q);return de},ie.prototype._handle_control_flow_open=function(le,Q){var se={text:Q.text,type:Q.type};return le.set_space_before_token(Q.newlines||Q.whitespace_before!=="",!0),Q.newlines?le.print_preserved_newlines(Q):le.set_space_before_token(Q.newlines||Q.whitespace_before!=="",!0),le.print_token(Q),le.indent(),se},ie.prototype._handle_control_flow_close=function(le,Q){var se={text:Q.text,type:Q.type};return le.deindent(),Q.newlines?le.print_preserved_newlines(Q):le.set_space_before_token(Q.newlines||Q.whitespace_before!=="",!0),le.print_token(Q),se},ie.prototype._handle_tag_close=function(le,Q,se){var H={text:Q.text,type:Q.type};return le.alignment_size=0,se.tag_complete=!0,le.set_space_before_token(Q.newlines||Q.whitespace_before!=="",!0),se.is_unformatted?le.add_raw_token(Q):(se.tag_start_char==="<"&&(le.set_space_before_token(Q.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&se.has_wrapped_attrs&&le.print_newline(!1)),le.print_token(Q)),se.indent_content&&!(se.is_unformatted||se.is_content_unformatted)&&(le.indent(),se.indent_content=!1),!se.is_inline_element&&!(se.is_unformatted||se.is_content_unformatted)&&le.set_wrap_point(),H},ie.prototype._handle_inside_tag=function(le,Q,se,H){var J=se.has_wrapped_attrs,K={text:Q.text,type:Q.type};return le.set_space_before_token(Q.newlines||Q.whitespace_before!=="",!0),se.is_unformatted?le.add_raw_token(Q):se.tag_start_char==="{"&&Q.type===F.TEXT?le.print_preserved_newlines(Q)?(Q.newlines=0,le.add_raw_token(Q)):le.print_token(Q):(Q.type===F.ATTRIBUTE?le.set_space_before_token(!0):(Q.type===F.EQUALS||Q.type===F.VALUE&&Q.previous.type===F.EQUALS)&&le.set_space_before_token(!1),Q.type===F.ATTRIBUTE&&se.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(le.traverse_whitespace(Q),J=J||Q.newlines!==0),this._is_wrap_attributes_force&&se.attr_count>=this._options.wrap_attributes_min_attrs&&(H.type!==F.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(le.print_newline(!1),J=!0)),le.print_token(Q),J=J||le.previous_token_wrapped(),se.has_wrapped_attrs=J),K},ie.prototype._handle_text=function(le,Q,se){var H={text:Q.text,type:"TK_CONTENT"};return se.custom_beautifier_name?this._print_custom_beatifier_text(le,Q,se):se.is_unformatted||se.is_content_unformatted?le.add_raw_token(Q):(le.traverse_whitespace(Q),le.print_token(Q)),H},ie.prototype._print_custom_beatifier_text=function(le,Q,se){var H=this;if(Q.text!==""){var J=Q.text,K,M=1,D="",ne="";se.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?K=this._js_beautify:se.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?K=this._css_beautify:se.custom_beautifier_name==="html"&&(K=function(rt,Ze){var st=new ie(rt,Ze,H._js_beautify,H._css_beautify);return st.beautify()}),this._options.indent_scripts==="keep"?M=0:this._options.indent_scripts==="separate"&&(M=-le.indent_level);var de=le.get_full_indent(M);if(J=J.replace(/\n[ \t]*$/,""),se.custom_beautifier_name!=="html"&&J[0]==="<"&&J.match(/^(<!--|<!\[CDATA\[)/)){var Oe=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(J);if(!Oe){le.add_raw_token(Q);return}D=de+Oe[1]+`
|
|
|
`,J=Oe[4],Oe[5]&&(ne=de+Oe[5]),J=J.replace(/\n[ \t]*$/,""),(Oe[2]||Oe[3].indexOf(`
|
|
|
`)!==-1)&&(Oe=Oe[3].match(/[ \t]+$/),Oe&&(Q.whitespace_before=Oe[0]))}if(J)if(K){var Ve=function(){this.eol=`
|
|
|
`};Ve.prototype=this._options.raw_options;var nt=new Ve;J=K(de+J,nt)}else{var Fe=Q.whitespace_before;Fe&&(J=J.replace(new RegExp(`
|
|
|
(`+Fe+")?","g"),`
|
|
|
`)),J=de+J.replace(/\n/g,`
|
|
|
`+de)}D&&(J?J=D+J+`
|
|
|
`+ne:J=D+ne),le.print_newline(!1),J&&(Q.text=J,Q.whitespace_before="",Q.newlines=0,le.add_raw_token(Q),le.print_newline(!0))}},ie.prototype._handle_tag_open=function(le,Q,se,H,J){var K=this._get_tag_open_token(Q);if((se.is_unformatted||se.is_content_unformatted)&&!se.is_empty_element&&Q.type===F.TAG_OPEN&&!K.is_start_tag?(le.add_raw_token(Q),K.start_tag_token=this._tag_stack.try_pop(K.tag_name)):(le.traverse_whitespace(Q),this._set_tag_position(le,Q,K,se,H),K.is_inline_element||le.set_wrap_point(),le.print_token(Q)),K.is_start_tag&&this._is_wrap_attributes_force){var M=0,D;do D=J.peek(M),D.type===F.ATTRIBUTE&&(K.attr_count+=1),M+=1;while(D.type!==F.EOF&&D.type!==F.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(K.alignment_size=Q.text.length+1),!K.tag_complete&&!K.is_unformatted&&(le.alignment_size=K.alignment_size),K};var te=function(le,Q,se){if(this.parent=Q||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="",!se)this.tag_complete=!0;else{var H;this.tag_start_char=se.text[0],this.text=se.text,this.tag_start_char==="<"?(H=se.text.match(/^<([^\s>]*)/),this.tag_check=H?H[1]:""):(H=se.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=H?H[1]:"",(se.text.startsWith("{{#>")||se.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&se.next!==null?this.tag_check=se.next.text.split(" ")[0]:this.tag_check=se.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),se.type===F.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||se.closed&&se.closed.text==="/>";var J=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(J=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!le.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(J)))}};ie.prototype._get_tag_open_token=function(le){var Q=new te(this._options,this._tag_stack.get_parser_token(),le);return Q.alignment_size=this._options.wrap_attributes_indent_size,Q.is_end_tag=Q.is_end_tag||O(Q.tag_check,this._options.void_elements),Q.is_empty_element=Q.tag_complete||Q.is_start_tag&&Q.is_end_tag,Q.is_unformatted=!Q.tag_complete&&O(Q.tag_check,this._options.unformatted),Q.is_content_unformatted=!Q.is_empty_element&&O(Q.tag_check,this._options.content_unformatted),Q.is_inline_element=O(Q.tag_name,this._options.inline)||this._options.inline_custom_elements&&Q.tag_name.includes("-")||Q.tag_start_char==="{",Q},ie.prototype._set_tag_position=function(le,Q,se,H,J){if(se.is_empty_element||(se.is_end_tag?se.start_tag_token=this._tag_stack.try_pop(se.tag_name):(this._do_optional_end_element(se)&&(se.is_inline_element||le.print_newline(!1)),this._tag_stack.record_tag(se),(se.tag_name==="script"||se.tag_name==="style")&&!(se.is_unformatted||se.is_content_unformatted)&&(se.custom_beautifier_name=P(se.tag_check,Q)))),O(se.tag_check,this._options.extra_liners)&&(le.print_newline(!1),le._output.just_added_blankline()||le.print_newline(!0)),se.is_empty_element){if(se.tag_start_char==="{"&&se.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),se.indent_content=!0;var K=le.current_line_has_match(/{{#if/);K||le.print_newline(!1)}se.tag_name==="!--"&&J.type===F.TAG_CLOSE&&H.is_end_tag&&se.text.indexOf(`
|
|
|
`)===-1||(se.is_inline_element||se.is_unformatted||le.print_newline(!1),this._calcluate_parent_multiline(le,se))}else if(se.is_end_tag){var M=!1;M=se.start_tag_token&&se.start_tag_token.multiline_content,M=M||!se.is_inline_element&&!(H.is_inline_element||H.is_unformatted)&&!(J.type===F.TAG_CLOSE&&se.start_tag_token===H)&&J.type!=="TK_CONTENT",(se.is_content_unformatted||se.is_unformatted)&&(M=!1),M&&le.print_newline(!1)}else se.indent_content=!se.custom_beautifier_name,se.tag_start_char==="<"&&(se.tag_name==="html"?se.indent_content=this._options.indent_inner_html:se.tag_name==="head"?se.indent_content=this._options.indent_head_inner_html:se.tag_name==="body"&&(se.indent_content=this._options.indent_body_inner_html)),!(se.is_inline_element||se.is_unformatted)&&(J.type!=="TK_CONTENT"||se.is_content_unformatted)&&le.print_newline(!1),this._calcluate_parent_multiline(le,se)},ie.prototype._calcluate_parent_multiline=function(le,Q){Q.parent&&le._output.just_added_newline()&&!((Q.is_inline_element||Q.is_unformatted)&&Q.parent.is_inline_element)&&(Q.parent.multiline_content=!0)};var me=["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"],_e=["a","audio","del","ins","map","noscript","video"];ie.prototype._do_optional_end_element=function(le){var Q=null;if(!(le.is_empty_element||!le.is_start_tag||!le.parent)){if(le.tag_name==="body")Q=Q||this._tag_stack.try_pop("head");else if(le.tag_name==="li")Q=Q||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(le.tag_name==="dd"||le.tag_name==="dt")Q=Q||this._tag_stack.try_pop("dt",["dl"]),Q=Q||this._tag_stack.try_pop("dd",["dl"]);else if(le.parent.tag_name==="p"&&me.indexOf(le.tag_name)!==-1){var se=le.parent.parent;(!se||_e.indexOf(se.tag_name)===-1)&&(Q=Q||this._tag_stack.try_pop("p"))}else le.tag_name==="rp"||le.tag_name==="rt"?(Q=Q||this._tag_stack.try_pop("rt",["ruby","rtc"]),Q=Q||this._tag_stack.try_pop("rp",["ruby","rtc"])):le.tag_name==="optgroup"?Q=Q||this._tag_stack.try_pop("optgroup",["select"]):le.tag_name==="option"?Q=Q||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):le.tag_name==="colgroup"?Q=Q||this._tag_stack.try_pop("caption",["table"]):le.tag_name==="thead"?(Q=Q||this._tag_stack.try_pop("caption",["table"]),Q=Q||this._tag_stack.try_pop("colgroup",["table"])):le.tag_name==="tbody"||le.tag_name==="tfoot"?(Q=Q||this._tag_stack.try_pop("caption",["table"]),Q=Q||this._tag_stack.try_pop("colgroup",["table"]),Q=Q||this._tag_stack.try_pop("thead",["table"]),Q=Q||this._tag_stack.try_pop("tbody",["table"])):le.tag_name==="tr"?(Q=Q||this._tag_stack.try_pop("caption",["table"]),Q=Q||this._tag_stack.try_pop("colgroup",["table"]),Q=Q||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(le.tag_name==="th"||le.tag_name==="td")&&(Q=Q||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),Q=Q||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return le.parent=this._tag_stack.get_parser_token(),Q}},f.exports.Beautifier=ie},function(f,c,l){var u=l(6).Options;function m(x){u.call(this,x,"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"])}m.prototype=new u,f.exports.Options=m},function(f,c,l){var u=l(9).Tokenizer,m=l(9).TOKEN,x=l(13).Directives,F=l(14).TemplatablePattern,k=l(12).Pattern,T={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:m.START,RAW:m.RAW,EOF:m.EOF},L=new x(/<\!--/,/-->/),W=function(P,O){u.call(this,P,O),this._current_tag_name="";var $=new F(this._input).read_options(this._options),z=new k(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:z.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:z.starting_with(/{{!--/).until_after(/--}}/),handlebars:z.starting_with(/{{/).until_after(/}}/),handlebars_open:z.until(/[\n\r\t }]/),handlebars_raw_close:z.until(/}}/),comment:z.starting_with(/<!--/).until_after(/-->/),cdata:z.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:z.starting_with(/<!\[/).until_after(/]>/),processing:z.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var ie=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=z.matching(ie).until_after(ie)}};W.prototype=new u,W.prototype._is_comment=function(P){return!1},W.prototype._is_opening=function(P){return P.type===T.TAG_OPEN||P.type===T.CONTROL_FLOW_OPEN},W.prototype._is_closing=function(P,O){return P.type===T.TAG_CLOSE&&O&&((P.text===">"||P.text==="/>")&&O.text[0]==="<"||P.text==="}}"&&O.text[0]==="{"&&O.text[1]==="{")||P.type===T.CONTROL_FLOW_CLOSE&&P.text==="}"&&O.text.endsWith("{")},W.prototype._reset=function(){this._current_tag_name=""},W.prototype._get_next_token=function(P,O){var $=null;this._readWhitespace();var z=this._input.peek();return z===null?this._create_token(T.EOF,""):($=$||this._read_open_handlebars(z,O),$=$||this._read_attribute(z,P,O),$=$||this._read_close(z,O),$=$||this._read_script_and_style(z,P),$=$||this._read_control_flows(z,O),$=$||this._read_raw_content(z,P,O),$=$||this._read_content_word(z,O),$=$||this._read_comment_or_cdata(z),$=$||this._read_processing(z),$=$||this._read_open(z,O),$=$||this._create_token(T.UNKNOWN,this._input.next()),$)},W.prototype._read_comment_or_cdata=function(P){var O=null,$=null,z=null;if(P==="<"){var ie=this._input.peek(1);ie==="!"&&($=this.__patterns.comment.read(),$?(z=L.get_directives($),z&&z.ignore==="start"&&($+=L.readIgnored(this._input))):$=this.__patterns.cdata.read()),$&&(O=this._create_token(T.COMMENT,$),O.directives=z)}return O},W.prototype._read_processing=function(P){var O=null,$=null,z=null;if(P==="<"){var ie=this._input.peek(1);(ie==="!"||ie==="?")&&($=this.__patterns.conditional_comment.read(),$=$||this.__patterns.processing.read()),$&&(O=this._create_token(T.COMMENT,$),O.directives=z)}return O},W.prototype._read_open=function(P,O){var $=null,z=null;return(!O||O.type===T.CONTROL_FLOW_OPEN)&&P==="<"&&($=this._input.next(),this._input.peek()==="/"&&($+=this._input.next()),$+=this.__patterns.element_name.read(),z=this._create_token(T.TAG_OPEN,$)),z},W.prototype._read_open_handlebars=function(P,O){var $=null,z=null;return(!O||O.type===T.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&P==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?($=this.__patterns.handlebars_comment.read(),$=$||this.__patterns.handlebars.read(),z=this._create_token(T.COMMENT,$)):($=this.__patterns.handlebars_open.read(),z=this._create_token(T.TAG_OPEN,$))),z},W.prototype._read_control_flows=function(P,O){var $="",z=null;if(!this._options.templating.includes("angular"))return z;if(P==="@"){if($=this.__patterns.angular_control_flow_start.read(),$==="")return z;for(var ie=$.endsWith("(")?1:0,te=0;!($.endsWith("{")&&ie===te);){var me=this._input.next();if(me===null)break;me==="("?ie++:me===")"&&te++,$+=me}z=this._create_token(T.CONTROL_FLOW_OPEN,$)}else P==="}"&&O&&O.type===T.CONTROL_FLOW_OPEN&&($=this._input.next(),z=this._create_token(T.CONTROL_FLOW_CLOSE,$));return z},W.prototype._read_close=function(P,O){var $=null,z=null;return O&&O.type===T.TAG_OPEN&&(O.text[0]==="<"&&(P===">"||P==="/"&&this._input.peek(1)===">")?($=this._input.next(),P==="/"&&($+=this._input.next()),z=this._create_token(T.TAG_CLOSE,$)):O.text[0]==="{"&&P==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),z=this._create_token(T.TAG_CLOSE,"}}"))),z},W.prototype._read_attribute=function(P,O,$){var z=null,ie="";if($&&$.text[0]==="<")if(P==="=")z=this._create_token(T.EQUALS,this._input.next());else if(P==='"'||P==="'"){var te=this._input.next();P==='"'?te+=this.__patterns.double_quote.read():te+=this.__patterns.single_quote.read(),z=this._create_token(T.VALUE,te)}else ie=this.__patterns.attribute.read(),ie&&(O.type===T.EQUALS?z=this._create_token(T.VALUE,ie):z=this._create_token(T.ATTRIBUTE,ie));return z},W.prototype._is_content_unformatted=function(P){return this._options.void_elements.indexOf(P)===-1&&(this._options.content_unformatted.indexOf(P)!==-1||this._options.unformatted.indexOf(P)!==-1)},W.prototype._read_raw_content=function(P,O,$){var z="";if($&&$.text[0]==="{")z=this.__patterns.handlebars_raw_close.read();else if(O.type===T.TAG_CLOSE&&O.opened.text[0]==="<"&&O.text[0]!=="/"){var ie=O.opened.text.substr(1).toLowerCase();this._is_content_unformatted(ie)&&(z=this._input.readUntil(new RegExp("</"+ie+"[\\n\\r\\t ]*?>","ig")))}return z?this._create_token(T.TEXT,z):null},W.prototype._read_script_and_style=function(P,O){if(O.type===T.TAG_CLOSE&&O.opened.text[0]==="<"&&O.text[0]!=="/"){var $=O.opened.text.substr(1).toLowerCase();if($==="script"||$==="style"){var z=this._read_comment_or_cdata(P);if(z)return z.type=T.TEXT,z;var ie=this._input.readUntil(new RegExp("</"+$+"[\\n\\r\\t ]*?>","ig"));if(ie)return this._create_token(T.TEXT,ie)}}return null},W.prototype._read_content_word=function(P,O){var $="";return this._options.unformatted_content_delimiter&&P===this._options.unformatted_content_delimiter[0]&&($=this.__patterns.unformatted_content_delimiter.read()),$||($=O&&O.type===T.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),$?this._create_token(T.TEXT,$):null},f.exports.Tokenizer=W,f.exports.TOKEN=T}],b={};function n(f){var c=b[f];if(c!==void 0)return c.exports;var l=b[f]={exports:{}};return U[f](l,l.exports,n),l.exports}var E=n(18);V=E})();var I=V;if(1)N=[S,S(58553),S(87804)],B=function(U){var b=S(58553),n=S(87804);return{html_beautify:function(E,f){return I(E,f,b.js_beautify,n.css_beautify)}}}.apply(Le,N),B!==void 0&&(Ct.exports=B);else var A,d})()},58553:function(Ct,Le){var S,N;(function(){var B;(function(){"use strict";var I=[function(b,n,E){var f=E(1).Beautifier,c=E(5).Options;function l(u,m){var x=new f(u,m);return x.beautify()}b.exports=l,b.exports.defaultOptions=function(){return new c}},function(b,n,E){var f=E(2).Output,c=E(3).Token,l=E(4),u=E(5).Options,m=E(7).Tokenizer,x=E(7).line_starters,F=E(7).positionable_operators,k=E(7).TOKEN;function T(D,ne){return ne.indexOf(D)!==-1}function L(D){return D.replace(/^\s+/g,"")}function W(D){for(var ne={},de=0;de<D.length;de++)ne[D[de].replace(/-/g,"_")]=D[de];return ne}function P(D,ne){return D&&D.type===k.RESERVED&&D.text===ne}function O(D,ne){return D&&D.type===k.RESERVED&&T(D.text,ne)}var $=["case","return","do","if","throw","else","await","break","continue","async"],z=["before-newline","after-newline","preserve-newline"],ie=W(z),te=[ie.before_newline,ie.preserve_newline],me={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function _e(D,ne){ne.multiline_frame||ne.mode===me.ForInitializer||ne.mode===me.Conditional||D.remove_indent(ne.start_line_index)}function le(D){D=D.replace(l.allLineBreaks,`
|
|
|
`);for(var ne=[],de=D.indexOf(`
|
|
|
`);de!==-1;)ne.push(D.substring(0,de)),D=D.substring(de+1),de=D.indexOf(`
|
|
|
`);return D.length&&ne.push(D),ne}function Q(D){return D===me.ArrayLiteral}function se(D){return T(D,[me.Expression,me.ForInitializer,me.Conditional])}function H(D,ne){for(var de=0;de<D.length;de++){var Oe=D[de].trim();if(Oe.charAt(0)!==ne)return!1}return!0}function J(D,ne){for(var de=0,Oe=D.length,Ve;de<Oe;de++)if(Ve=D[de],Ve&&Ve.indexOf(ne)!==0)return!1;return!0}function K(D,ne){ne=ne||{},this._source_text=D||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new u(ne)}K.prototype.create_flags=function(D,ne){var de=0;D&&(de=D.indentation_level,!this._output.just_added_newline()&&D.line_indent_level>de&&(de=D.line_indent_level));var Oe={mode:ne,parent:D,last_token:D?D.last_token:new c(k.START_BLOCK,""),last_word:D?D.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:de,alignment:0,line_indent_level:D?D.line_indent_level:de,start_line_index:this._output.get_line_number(),ternary_depth:0};return Oe},K.prototype._reset=function(D){var ne=D.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,ne),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(me.BlockStatement);var de=new m(D,this._options);return this._tokens=de.tokenize(),D},K.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var D,ne=this._reset(this._source_text),de=this._options.eol;this._options.eol==="auto"&&(de=`
|
|
|
`,ne&&l.lineBreak.test(ne||"")&&(de=ne.match(l.lineBreak)[0]));for(var Oe=this._tokens.next();Oe;)this.handle_token(Oe),this._last_last_text=this._flags.last_token.text,this._flags.last_token=Oe,Oe=this._tokens.next();return D=this._output.get_code(de),D},K.prototype.handle_token=function(D,ne){D.type===k.START_EXPR?this.handle_start_expr(D):D.type===k.END_EXPR?this.handle_end_expr(D):D.type===k.START_BLOCK?this.handle_start_block(D):D.type===k.END_BLOCK?this.handle_end_block(D):D.type===k.WORD?this.handle_word(D):D.type===k.RESERVED?this.handle_word(D):D.type===k.SEMICOLON?this.handle_semicolon(D):D.type===k.STRING?this.handle_string(D):D.type===k.EQUALS?this.handle_equals(D):D.type===k.OPERATOR?this.handle_operator(D):D.type===k.COMMA?this.handle_comma(D):D.type===k.BLOCK_COMMENT?this.handle_block_comment(D,ne):D.type===k.COMMENT?this.handle_comment(D,ne):D.type===k.DOT?this.handle_dot(D):D.type===k.EOF?this.handle_eof(D):D.type===k.UNKNOWN?this.handle_unknown(D,ne):this.handle_unknown(D,ne)},K.prototype.handle_whitespace_and_comments=function(D,ne){var de=D.newlines,Oe=this._options.keep_array_indentation&&Q(this._flags.mode);if(D.comments_before)for(var Ve=D.comments_before.next();Ve;)this.handle_whitespace_and_comments(Ve,ne),this.handle_token(Ve,ne),Ve=D.comments_before.next();if(Oe)for(var nt=0;nt<de;nt+=1)this.print_newline(nt>0,ne);else if(this._options.max_preserve_newlines&&de>this._options.max_preserve_newlines&&(de=this._options.max_preserve_newlines),this._options.preserve_newlines&&de>1){this.print_newline(!1,ne);for(var Fe=1;Fe<de;Fe+=1)this.print_newline(!0,ne)}};var M=["async","break","continue","return","throw","yield"];K.prototype.allow_wrap_or_preserved_newline=function(D,ne){if(ne=ne===void 0?!1:ne,!this._output.just_added_newline()){var de=this._options.preserve_newlines&&D.newlines||ne,Oe=T(this._flags.last_token.text,F)||T(D.text,F);if(Oe){var Ve=T(this._flags.last_token.text,F)&&T(this._options.operator_position,te)||T(D.text,F);de=de&&Ve}if(de)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(O(this._flags.last_token,M))return;this._output.set_wrap_point()}}},K.prototype.print_newline=function(D,ne){if(!ne&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==k.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var de=this._tokens.peek();this._flags.mode===me.Statement&&!(this._flags.if_block&&P(de,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(D)&&(this._flags.multiline_frame=!0)},K.prototype.print_token_line_indentation=function(D){this._output.just_added_newline()&&(this._options.keep_array_indentation&&D.newlines&&(D.text==="["||Q(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(D.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},K.prototype.print_token=function(D){if(this._output.raw){this._output.add_raw_token(D);return}if(this._options.comma_first&&D.previous&&D.previous.type===k.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var ne=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(ne),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(D),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(D),this._output.non_breaking_space=!0,this._output.add_token(D.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},K.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},K.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))},K.prototype.set_mode=function(D){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,D),this._flags=this.create_flags(this._previous_flags,D),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},K.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===me.Statement&&_e(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},K.prototype.start_of_object_property=function(){return this._flags.parent.mode===me.ObjectLiteral&&this._flags.mode===me.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"]))},K.prototype.start_of_statement=function(D){var ne=!1;return ne=ne||O(this._flags.last_token,["var","let","const"])&&D.type===k.WORD,ne=ne||P(this._flags.last_token,"do"),ne=ne||!(this._flags.parent.mode===me.ObjectLiteral&&this._flags.mode===me.Statement)&&O(this._flags.last_token,M)&&!D.newlines,ne=ne||P(this._flags.last_token,"else")&&!(P(D,"if")&&!D.comments_before),ne=ne||this._flags.last_token.type===k.END_EXPR&&(this._previous_flags.mode===me.ForInitializer||this._previous_flags.mode===me.Conditional),ne=ne||this._flags.last_token.type===k.WORD&&this._flags.mode===me.BlockStatement&&!this._flags.in_case&&!(D.text==="--"||D.text==="++")&&this._last_last_text!=="function"&&D.type!==k.WORD&&D.type!==k.RESERVED,ne=ne||this._flags.mode===me.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),ne?(this.set_mode(me.Statement),this.indent(),this.handle_whitespace_and_comments(D,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(D,O(D,["do","for","if","while"])),!0):!1},K.prototype.handle_start_expr=function(D){this.start_of_statement(D)||this.handle_whitespace_and_comments(D);var ne=me.Expression;if(D.text==="["){if(this._flags.last_token.type===k.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,x)&&(this._output.space_before_token=!0),this.print_token(D),this.set_mode(ne),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}ne=me.ArrayLiteral,Q(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()),T(this._flags.last_token.type,[k.START_EXPR,k.END_EXPR,k.WORD,k.OPERATOR,k.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===k.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,ne=me.ForInitializer):T(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,ne=me.Conditional):T(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&D.whitespace_before===""?this._output.space_before_token=!1:(T(this._flags.last_token.text,x)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===k.EQUALS||this._flags.last_token.type===k.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(D);else if(this._flags.last_token.type===k.WORD){this._output.space_before_token=!1;var de=this._tokens.peek(-3);if(this._options.space_after_named_function&&de){var Oe=this._tokens.peek(-4);O(de,["async","function"])||de.text==="*"&&O(Oe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===me.ObjectLiteral?(de.text==="{"||de.text===","||de.text==="*"&&(Oe.text==="{"||Oe.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(D);(this._flags.last_token.type===k.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(T(this._last_last_text,["function","yield"])||this._flags.mode===me.ObjectLiteral&&T(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===k.START_BLOCK?this.print_newline():(this._flags.last_token.type===k.END_EXPR||this._flags.last_token.type===k.START_EXPR||this._flags.last_token.type===k.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===k.COMMA)&&this.allow_wrap_or_preserved_newline(D,D.newlines),this.print_token(D),this.set_mode(ne),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},K.prototype.handle_end_expr=function(D){for(;this._flags.mode===me.Statement;)this.restore_mode();this.handle_whitespace_and_comments(D),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(D,D.text==="]"&&Q(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===k.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(D),this.restore_mode(),_e(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===me.Conditional&&(this._previous_flags.mode=me.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},K.prototype.handle_start_block=function(D){this.handle_whitespace_and_comments(D);var ne=this._tokens.peek(),de=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===k.END_EXPR?(this.set_mode(me.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(me.BlockStatement):de&&(T(de.text,[":",","])&&T(ne.type,[k.STRING,k.WORD,k.RESERVED])||T(ne.text,["get","set","..."])&&T(de.type,[k.WORD,k.RESERVED]))?T(this._last_last_text,["class","interface"])&&!T(de.text,[":",","])?this.set_mode(me.BlockStatement):this.set_mode(me.ObjectLiteral):this._flags.last_token.type===k.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(me.BlockStatement):T(this._flags.last_token.type,[k.EQUALS,k.START_EXPR,k.COMMA,k.OPERATOR])||O(this._flags.last_token,["return","throw","import","default"])?this.set_mode(me.ObjectLiteral):this.set_mode(me.BlockStatement),this._flags.last_token&&O(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var Oe=!ne.comments_before&&ne.text==="}",Ve=Oe&&this._flags.last_word==="function"&&this._flags.last_token.type===k.END_EXPR;if(this._options.brace_preserve_inline){var nt=0,Fe=null;this._flags.inline_frame=!0;do if(nt+=1,Fe=this._tokens.peek(nt-1),Fe.newlines){this._flags.inline_frame=!1;break}while(Fe.type!==k.EOF&&!(Fe.type===k.END_BLOCK&&Fe.opened===D))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&D.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==k.OPERATOR&&(Ve||this._flags.last_token.type===k.EQUALS||O(this._flags.last_token,$)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(Q(this._previous_flags.mode)&&(this._flags.last_token.type===k.START_EXPR||this._flags.last_token.type===k.COMMA)&&((this._flags.last_token.type===k.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===k.COMMA||this._flags.last_token.type===k.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(D),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==k.OPERATOR&&this._flags.last_token.type!==k.START_EXPR&&(T(this._flags.last_token.type,[k.START_BLOCK,k.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(D),this.indent(),!Oe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},K.prototype.handle_end_block=function(D){for(this.handle_whitespace_and_comments(D);this._flags.mode===me.Statement;)this.restore_mode();var ne=this._flags.last_token.type===k.START_BLOCK;this._flags.inline_frame&&!ne?this._output.space_before_token=!0:this._options.brace_style==="expand"?ne||this.print_newline():ne||(Q(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(D)},K.prototype.handle_word=function(D){if(D.type===k.RESERVED){if(T(D.text,["set","get"])&&this._flags.mode!==me.ObjectLiteral)D.type=k.WORD;else if(D.text==="import"&&T(this._tokens.peek().text,["(","."]))D.type=k.WORD;else if(T(D.text,["as","from"])&&!this._flags.import_block)D.type=k.WORD;else if(this._flags.mode===me.ObjectLiteral){var ne=this._tokens.peek();ne.text===":"&&(D.type=k.WORD)}}if(this.start_of_statement(D)?O(this._flags.last_token,["var","let","const"])&&D.type===k.WORD&&(this._flags.declaration_statement=!0):D.newlines&&!se(this._flags.mode)&&(this._flags.last_token.type!==k.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==k.EQUALS&&(this._options.preserve_newlines||!O(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(D),this.print_newline()):this.handle_whitespace_and_comments(D),this._flags.do_block&&!this._flags.do_while)if(P(D,"while")){this._output.space_before_token=!0,this.print_token(D),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&P(D,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===me.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&O(D,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(D),this._flags.in_case=!0;return}if((this._flags.last_token.type===k.COMMA||this._flags.last_token.type===k.START_EXPR||this._flags.last_token.type===k.EQUALS||this._flags.last_token.type===k.OPERATOR)&&!this.start_of_object_property()&&!(T(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===me.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(D),P(D,"function")){(T(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(T(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===k.OPERATOR))&&!this._output.just_added_blankline()&&!D.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===k.RESERVED||this._flags.last_token.type===k.WORD?O(this._flags.last_token,["get","set","new","export"])||O(this._flags.last_token,M)?this._output.space_before_token=!0:P(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===k.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(se(this._flags.mode)||Q(this._flags.mode))||this.print_newline(),this.print_token(D),this._flags.last_word=D.text;return}var de="NONE";if(this._flags.last_token.type===k.END_BLOCK?this._previous_flags.inline_frame?de="SPACE":O(D,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&D.newlines?de="NEWLINE":(de="SPACE",this._output.space_before_token=!0):de="NEWLINE":this._flags.last_token.type===k.SEMICOLON&&this._flags.mode===me.BlockStatement?de="NEWLINE":this._flags.last_token.type===k.SEMICOLON&&se(this._flags.mode)?de="SPACE":this._flags.last_token.type===k.STRING?de="NEWLINE":this._flags.last_token.type===k.RESERVED||this._flags.last_token.type===k.WORD||this._flags.last_token.text==="*"&&(T(this._last_last_text,["function","yield"])||this._flags.mode===me.ObjectLiteral&&T(this._last_last_text,["{",","]))?de="SPACE":this._flags.last_token.type===k.START_BLOCK?this._flags.inline_frame?de="SPACE":de="NEWLINE":this._flags.last_token.type===k.END_EXPR&&(this._output.space_before_token=!0,de="NEWLINE"),O(D,x)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?de="SPACE":de="NEWLINE"),O(D,["else","catch","finally"]))if((!(this._flags.last_token.type===k.END_BLOCK&&this._previous_flags.mode===me.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&D.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var Oe=this._output.current_line;Oe.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else de==="NEWLINE"?O(this._flags.last_token,$)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&O(D,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==k.END_EXPR?(this._flags.last_token.type!==k.START_EXPR||!O(D,["var","let","const"]))&&this._flags.last_token.text!==":"&&(P(D,"if")&&P(D.previous,"else")?this._output.space_before_token=!0:this.print_newline()):O(D,x)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&Q(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():de==="SPACE"&&(this._output.space_before_token=!0);D.previous&&(D.previous.type===k.WORD||D.previous.type===k.RESERVED)&&(this._output.space_before_token=!0),this.print_token(D),this._flags.last_word=D.text,D.type===k.RESERVED&&(D.text==="do"?this._flags.do_block=!0:D.text==="if"?this._flags.if_block=!0:D.text==="import"?this._flags.import_block=!0:this._flags.import_block&&P(D,"from")&&(this._flags.import_block=!1))},K.prototype.handle_semicolon=function(D){this.start_of_statement(D)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(D);for(var ne=this._tokens.peek();this._flags.mode===me.Statement&&!(this._flags.if_block&&P(ne,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(D)},K.prototype.handle_string=function(D){D.text.startsWith("`")&&D.newlines===0&&D.whitespace_before===""&&(D.previous.text===")"||this._flags.last_token.type===k.WORD)||(this.start_of_statement(D)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(D),this._flags.last_token.type===k.RESERVED||this._flags.last_token.type===k.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===k.COMMA||this._flags.last_token.type===k.START_EXPR||this._flags.last_token.type===k.EQUALS||this._flags.last_token.type===k.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(D):D.text.startsWith("`")&&this._flags.last_token.type===k.END_EXPR&&(D.previous.text==="]"||D.previous.text===")")&&D.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(D)},K.prototype.handle_equals=function(D){this.start_of_statement(D)||this.handle_whitespace_and_comments(D),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(D),this._output.space_before_token=!0},K.prototype.handle_comma=function(D){this.handle_whitespace_and_comments(D,!0),this.print_token(D),this._output.space_before_token=!0,this._flags.declaration_statement?(se(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(D)):this._flags.mode===me.ObjectLiteral||this._flags.mode===me.Statement&&this._flags.parent.mode===me.ObjectLiteral?(this._flags.mode===me.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(D)},K.prototype.handle_operator=function(D){var ne=D.text==="*"&&(O(this._flags.last_token,["function","yield"])||T(this._flags.last_token.type,[k.START_BLOCK,k.COMMA,k.END_BLOCK,k.SEMICOLON])),de=T(D.text,["-","+"])&&(T(this._flags.last_token.type,[k.START_BLOCK,k.START_EXPR,k.EQUALS,k.OPERATOR])||T(this._flags.last_token.text,x)||this._flags.last_token.text===",");if(!this.start_of_statement(D)){var Oe=!ne;this.handle_whitespace_and_comments(D,Oe)}if(D.text==="*"&&this._flags.last_token.type===k.DOT){this.print_token(D);return}if(D.text==="::"){this.print_token(D);return}if(T(D.text,["-","+"])&&this.start_of_object_property()){this.print_token(D);return}if(this._flags.last_token.type===k.OPERATOR&&T(this._options.operator_position,te)&&this.allow_wrap_or_preserved_newline(D),D.text===":"&&this._flags.in_case){this.print_token(D),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==k.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 Ve=!0,nt=!0,Fe=!1;if(D.text===":"?this._flags.ternary_depth===0?Ve=!1:(this._flags.ternary_depth-=1,Fe=!0):D.text==="?"&&(this._flags.ternary_depth+=1),!de&&!ne&&this._options.preserve_newlines&&T(D.text,F)){var rt=D.text===":",Ze=rt&&Fe,st=rt&&!Fe;switch(this._options.operator_position){case ie.before_newline:this._output.space_before_token=!st,this.print_token(D),(!rt||Ze)&&this.allow_wrap_or_preserved_newline(D),this._output.space_before_token=!0;return;case ie.after_newline:this._output.space_before_token=!0,!rt||Ze?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(D):this._output.space_before_token=!1,this.print_token(D),this._output.space_before_token=!0;return;case ie.preserve_newline:st||this.allow_wrap_or_preserved_newline(D),Ve=!(this._output.just_added_newline()||st),this._output.space_before_token=Ve,this.print_token(D),this._output.space_before_token=!0;return}}if(ne){this.allow_wrap_or_preserved_newline(D),Ve=!1;var At=this._tokens.peek();nt=At&&T(At.type,[k.WORD,k.RESERVED])}else if(D.text==="...")this.allow_wrap_or_preserved_newline(D),Ve=this._flags.last_token.type===k.START_BLOCK,nt=!1;else if(T(D.text,["--","++","!","~"])||de){if((this._flags.last_token.type===k.COMMA||this._flags.last_token.type===k.START_EXPR)&&this.allow_wrap_or_preserved_newline(D),Ve=!1,nt=!1,D.newlines&&(D.text==="--"||D.text==="++"||D.text==="~")){var Jt=O(this._flags.last_token,$)&&D.newlines;Jt&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Jt,!0)}this._flags.last_token.text===";"&&se(this._flags.mode)&&(Ve=!0),this._flags.last_token.type===k.RESERVED?Ve=!0:this._flags.last_token.type===k.END_EXPR?Ve=!(this._flags.last_token.text==="]"&&(D.text==="--"||D.text==="++")):this._flags.last_token.type===k.OPERATOR&&(Ve=T(D.text,["--","-","++","+"])&&T(this._flags.last_token.text,["--","-","++","+"]),T(D.text,["+","-"])&&T(this._flags.last_token.text,["--","++"])&&(nt=!0)),(this._flags.mode===me.BlockStatement&&!this._flags.inline_frame||this._flags.mode===me.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Ve,this.print_token(D),this._output.space_before_token=nt},K.prototype.handle_block_comment=function(D,ne){if(this._output.raw){this._output.add_raw_token(D),D.directives&&D.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(D.directives){this.print_newline(!1,ne),this.print_token(D),D.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!l.newline.test(D.text)&&!D.newlines){this._output.space_before_token=!0,this.print_token(D),this._output.space_before_token=!0;return}else this.print_block_commment(D,ne)},K.prototype.print_block_commment=function(D,ne){var de=le(D.text),Oe,Ve=!1,nt=!1,Fe=D.whitespace_before,rt=Fe.length;if(this.print_newline(!1,ne),this.print_token_line_indentation(D),this._output.add_token(de[0]),this.print_newline(!1,ne),de.length>1){for(de=de.slice(1),Ve=H(de,"*"),nt=J(de,Fe),Ve&&(this._flags.alignment=1),Oe=0;Oe<de.length;Oe++)Ve?(this.print_token_line_indentation(D),this._output.add_token(L(de[Oe]))):nt&&de[Oe]?(this.print_token_line_indentation(D),this._output.add_token(de[Oe].substring(rt))):(this._output.current_line.set_indent(-1),this._output.add_token(de[Oe])),this.print_newline(!1,ne);this._flags.alignment=0}},K.prototype.handle_comment=function(D,ne){D.newlines?this.print_newline(!1,ne):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(D),this.print_newline(!1,ne)},K.prototype.handle_dot=function(D){this.start_of_statement(D)||this.handle_whitespace_and_comments(D,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),O(this._flags.last_token,$)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(D,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(D)},K.prototype.handle_unknown=function(D,ne){this.print_token(D),D.text[D.text.length-1]===`
|
|
|
`&&this.print_newline(!1,ne)},K.prototype.handle_eof=function(D){for(;this._flags.mode===me.Statement;)this.restore_mode();this.handle_whitespace_and_comments(D)},b.exports.Beautifier=K},function(b){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 E(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}E.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},E.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},E.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},E.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 E(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 m=this.__lines[u];if(m.is_empty())break;if(m.item(0).indexOf(c)!==0&&m.item(-1)!==l){this.__lines.splice(u+1,0,new n(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},b.exports.Output=f},function(b){function n(E,f,c,l){this.type=E,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}b.exports.Token=n},function(b,n){var E="\\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]+\\}",m="(?:"+u+"|["+E+c+"])",x="(?:"+u+"|["+f+c+l+"])*";n.identifier=new RegExp(m+x,"g"),n.identifierStart=new RegExp(m),n.identifierMatch=new RegExp("(?:"+u+"|["+f+c+l+"])+");var F=/[\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(b,n,E){var f=E(6).Options,c=["before-newline","after-newline","preserve-newline"];function l(u){f.call(this,u,"js");var m=this.raw_options.brace_style||null;m==="expand-strict"?this.raw_options.brace_style="expand":m==="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 x=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var F=0;F<x.length;F++)x[F]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=x[F];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,b.exports.Options=l},function(b){function n(c,l){this.raw_options=E(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],m=l||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(m=u.concat()):typeof u=="string"&&(m=u.split(/[^a-zA-Z0-9_\/\-]+/)),m},n.prototype._get_boolean=function(c,l){var u=this.raw_options[c],m=u===void 0?!!l:!!u;return m},n.prototype._get_characters=function(c,l){var u=this.raw_options[c],m=l||"";return typeof u=="string"&&(m=u.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),m},n.prototype._get_number=function(c,l){var u=this.raw_options[c];l=parseInt(l,10),isNaN(l)&&(l=0);var m=parseInt(u,10);return isNaN(m)&&(m=l),m},n.prototype._get_selection=function(c,l,u){var m=this._get_selection_list(c,l,u);if(m.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 m[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 m=this._get_array(c,u);if(!this._is_valid_selection(m,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 m},n.prototype._is_valid_selection=function(c,l){return c.length&&l.length&&!c.some(function(u){return l.indexOf(u)===-1})};function E(c,l){var u={};c=f(c);var m;for(m in c)m!==l&&(u[m]=c[m]);if(l&&c[l])for(m in c[l])u[m]=c[l][m];return u}function f(c){var l={},u;for(u in c){var m=u.replace(/-/g,"_");l[m]=c[u]}return l}b.exports.Options=n,b.exports.normalizeOpts=f,b.exports.mergeOpts=E},function(b,n,E){var f=E(8).InputScanner,c=E(9).Tokenizer,l=E(9).TOKEN,u=E(13).Directives,m=E(4),x=E(12).Pattern,F=E(14).TemplatablePattern;function k(H,J){return J.indexOf(H)!==-1}var T={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},L=new u(/\/\*/,/\*\//),W=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,P=/[0-9]/,O=/[^\d\.]/,$=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),z=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";z=z.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),z="\\?\\.(?!\\d) "+z,z=z.replace(/ /g,"|");var ie=new RegExp(z),te="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),me=te.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),_e=new RegExp("^(?:"+me.join("|")+")$"),le,Q=function(H,J){c.call(this,H,J),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var K=new x(this._input),M=new F(this._input).read_options(this._options);this.__patterns={template:M,identifier:M.starting_with(m.identifier).matching(m.identifierMatch),number:K.matching(W),punct:K.matching(ie),comment:K.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:K.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:K.matching(/<!--/),html_comment_end:K.matching(/-->/),include:K.starting_with(/#include/).until_after(m.lineBreak),shebang:K.starting_with(/#!/).until_after(m.lineBreak),xml:K.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:M.until(/['\\\n\r\u2028\u2029]/),double_quote:M.until(/["\\\n\r\u2028\u2029]/),template_text:M.until(/[`\\$]/),template_expression:M.until(/[`}\\]/)}};Q.prototype=new c,Q.prototype._is_comment=function(H){return H.type===T.COMMENT||H.type===T.BLOCK_COMMENT||H.type===T.UNKNOWN},Q.prototype._is_opening=function(H){return H.type===T.START_BLOCK||H.type===T.START_EXPR},Q.prototype._is_closing=function(H,J){return(H.type===T.END_BLOCK||H.type===T.END_EXPR)&&J&&(H.text==="]"&&J.text==="["||H.text===")"&&J.text==="("||H.text==="}"&&J.text==="{")},Q.prototype._reset=function(){le=!1},Q.prototype._get_next_token=function(H,J){var K=null;this._readWhitespace();var M=this._input.peek();return M===null?this._create_token(T.EOF,""):(K=K||this._read_non_javascript(M),K=K||this._read_string(M),K=K||this._read_pair(M,this._input.peek(1)),K=K||this._read_word(H),K=K||this._read_singles(M),K=K||this._read_comment(M),K=K||this._read_regexp(M,H),K=K||this._read_xml(M,H),K=K||this._read_punctuation(),K=K||this._create_token(T.UNKNOWN,this._input.next()),K)},Q.prototype._read_word=function(H){var J;if(J=this.__patterns.identifier.read(),J!=="")return J=J.replace(m.allLineBreaks,`
|
|
|
`),!(H.type===T.DOT||H.type===T.RESERVED&&(H.text==="set"||H.text==="get"))&&_e.test(J)?(J==="in"||J==="of")&&(H.type===T.WORD||H.type===T.STRING)?this._create_token(T.OPERATOR,J):this._create_token(T.RESERVED,J):this._create_token(T.WORD,J);if(J=this.__patterns.number.read(),J!=="")return this._create_token(T.WORD,J)},Q.prototype._read_singles=function(H){var J=null;return H==="("||H==="["?J=this._create_token(T.START_EXPR,H):H===")"||H==="]"?J=this._create_token(T.END_EXPR,H):H==="{"?J=this._create_token(T.START_BLOCK,H):H==="}"?J=this._create_token(T.END_BLOCK,H):H===";"?J=this._create_token(T.SEMICOLON,H):H==="."&&O.test(this._input.peek(1))?J=this._create_token(T.DOT,H):H===","&&(J=this._create_token(T.COMMA,H)),J&&this._input.next(),J},Q.prototype._read_pair=function(H,J){var K=null;return H==="#"&&J==="{"&&(K=this._create_token(T.START_BLOCK,H+J)),K&&(this._input.next(),this._input.next()),K},Q.prototype._read_punctuation=function(){var H=this.__patterns.punct.read();if(H!=="")return H==="="?this._create_token(T.EQUALS,H):H==="?."?this._create_token(T.DOT,H):this._create_token(T.OPERATOR,H)},Q.prototype._read_non_javascript=function(H){var J="";if(H==="#"){if(this._is_first_token()&&(J=this.__patterns.shebang.read(),J))return this._create_token(T.UNKNOWN,J.trim()+`
|
|
|
`);if(J=this.__patterns.include.read(),J)return this._create_token(T.UNKNOWN,J.trim()+`
|
|
|
`);H=this._input.next();var K="#";if(this._input.hasNext()&&this._input.testChar(P)){do H=this._input.next(),K+=H;while(this._input.hasNext()&&H!=="#"&&H!=="=");return H==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(K+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(K+="{}",this._input.next(),this._input.next())),this._create_token(T.WORD,K)}this._input.back()}else if(H==="<"&&this._is_first_token()){if(J=this.__patterns.html_comment_start.read(),J){for(;this._input.hasNext()&&!this._input.testChar(m.newline);)J+=this._input.next();return le=!0,this._create_token(T.COMMENT,J)}}else if(le&&H==="-"&&(J=this.__patterns.html_comment_end.read(),J))return le=!1,this._create_token(T.COMMENT,J);return null},Q.prototype._read_comment=function(H){var J=null;if(H==="/"){var K="";if(this._input.peek(1)==="*"){K=this.__patterns.block_comment.read();var M=L.get_directives(K);M&&M.ignore==="start"&&(K+=L.readIgnored(this._input)),K=K.replace(m.allLineBreaks,`
|
|
|
`),J=this._create_token(T.BLOCK_COMMENT,K),J.directives=M}else this._input.peek(1)==="/"&&(K=this.__patterns.comment.read(),J=this._create_token(T.COMMENT,K))}return J},Q.prototype._read_string=function(H){if(H==="`"||H==="'"||H==='"'){var J=this._input.next();return this.has_char_escapes=!1,H==="`"?J+=this._read_string_recursive("`",!0,"${"):J+=this._read_string_recursive(H),this.has_char_escapes&&this._options.unescape_strings&&(J=se(J)),this._input.peek()===H&&(J+=this._input.next()),J=J.replace(m.allLineBreaks,`
|
|
|
`),this._create_token(T.STRING,J)}return null},Q.prototype._allow_regexp_or_xml=function(H){return H.type===T.RESERVED&&k(H.text,["return","case","throw","else","do","typeof","yield"])||H.type===T.END_EXPR&&H.text===")"&&H.opened.previous.type===T.RESERVED&&k(H.opened.previous.text,["if","while","for"])||k(H.type,[T.COMMENT,T.START_EXPR,T.START_BLOCK,T.START,T.END_BLOCK,T.OPERATOR,T.EQUALS,T.EOF,T.SEMICOLON,T.COMMA])},Q.prototype._read_regexp=function(H,J){if(H==="/"&&this._allow_regexp_or_xml(J)){for(var K=this._input.next(),M=!1,D=!1;this._input.hasNext()&&(M||D||this._input.peek()!==H)&&!this._input.testChar(m.newline);)K+=this._input.peek(),M?M=!1:(M=this._input.peek()==="\\",this._input.peek()==="["?D=!0:this._input.peek()==="]"&&(D=!1)),this._input.next();return this._input.peek()===H&&(K+=this._input.next(),K+=this._input.read(m.identifier)),this._create_token(T.STRING,K)}return null},Q.prototype._read_xml=function(H,J){if(this._options.e4x&&H==="<"&&this._allow_regexp_or_xml(J)){var K="",M=this.__patterns.xml.read_match();if(M){for(var D=M[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),ne=D.indexOf("{")===0,de=0;M;){var Oe=!!M[1],Ve=M[2],nt=!!M[M.length-1]||Ve.slice(0,8)==="![CDATA[";if(!nt&&(Ve===D||ne&&Ve.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Oe?--de:++de),K+=M[0],de<=0)break;M=this.__patterns.xml.read_match()}return M||(K+=this._input.match(/[\s\S]*/g)[0]),K=K.replace(m.allLineBreaks,`
|
|
|
`),this._create_token(T.STRING,K)}}return null};function se(H){for(var J="",K=0,M=new f(H),D=null;M.hasNext();)if(D=M.match(/([\s]|[^\\]|\\\\)+/g),D&&(J+=D[0]),M.peek()==="\\"){if(M.next(),M.peek()==="x")D=M.match(/x([0-9A-Fa-f]{2})/g);else if(M.peek()==="u")D=M.match(/u([0-9A-Fa-f]{4})/g),D||(D=M.match(/u\{([0-9A-Fa-f]+)\}/g));else{J+="\\",M.hasNext()&&(J+=M.next());continue}if(!D||(K=parseInt(D[1],16),K>126&&K<=255&&D[0].indexOf("x")===0))return H;K>=0&&K<32||K>1114111?J+="\\"+D[0]:K===34||K===39||K===92?J+="\\"+String.fromCharCode(K):J+=String.fromCharCode(K)}return J}Q.prototype._read_string_recursive=function(H,J,K){var M,D;H==="'"?D=this.__patterns.single_quote:H==='"'?D=this.__patterns.double_quote:H==="`"?D=this.__patterns.template_text:H==="}"&&(D=this.__patterns.template_expression);for(var ne=D.read(),de="";this._input.hasNext();){if(de=this._input.next(),de===H||!J&&m.newline.test(de)){this._input.back();break}else de==="\\"&&this._input.hasNext()?(M=this._input.peek(),M==="x"||M==="u"?this.has_char_escapes=!0:M==="\r"&&this._input.peek(1)===`
|
|
|
`&&this._input.next(),de+=this._input.next()):K&&(K==="${"&&de==="$"&&this._input.peek()==="{"&&(de+=this._input.next()),K===de&&(H==="`"?de+=this._read_string_recursive("}",J,"`"):de+=this._read_string_recursive("`",J,"${"),this._input.hasNext()&&(de+=this._input.next())));de+=D.read(),ne+=de}return ne},b.exports.Tokenizer=Q,b.exports.TOKEN=T,b.exports.positionable_operators=$.slice(),b.exports.line_starters=te.slice()},function(b){var n=RegExp.prototype.hasOwnProperty("sticky");function E(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}E.prototype.restart=function(){this.__position=0},E.prototype.back=function(){this.__position>0&&(this.__position-=1)},E.prototype.hasNext=function(){return this.__position<this.__input_length},E.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},E.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},E.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},E.prototype.test=function(f,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(f,c):!1},E.prototype.testChar=function(f,c){var l=this.peek(c);return f.lastIndex=0,l!==null&&f.test(l)},E.prototype.match=function(f){var c=this.__match(f,this.__position);return c?this.__position+=c[0].length:c=null,c},E.prototype.read=function(f,c,l){var u="",m;return f&&(m=this.match(f),m&&(u+=m[0])),c&&(m||!f)&&(u+=this.readUntil(c,l)),u},E.prototype.readUntil=function(f,c){var l="",u=this.__position;f.lastIndex=this.__position;var m=f.exec(this.__input);return m?(u=m.index,c&&(u+=m[0].length)):u=this.__input_length,l=this.__input.substring(this.__position,u),this.__position=u,l},E.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},E.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},E.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},E.prototype.peekUntilAfter=function(f){var c=this.__position,l=this.readUntilAfter(f);return this.__position=c,l},E.prototype.lookBack=function(f){var c=this.__position-1;return c>=f.length&&this.__input.substring(c-f.length,c).toLowerCase()===f},b.exports.InputScanner=E},function(b,n,E){var f=E(8).InputScanner,c=E(3).Token,l=E(10).TokenStream,u=E(11).WhitespacePattern,m={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},x=function(F,k){this._input=new f(F),this._options=k||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new u(this._input)};x.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var F,k=new c(m.START,""),T=null,L=[],W=new l;k.type!==m.EOF;){for(F=this._get_next_token(k,T);this._is_comment(F);)W.add(F),F=this._get_next_token(k,T);W.isEmpty()||(F.comments_before=W,W=new l),F.parent=T,this._is_opening(F)?(L.push(T),T=F):T&&this._is_closing(F,T)&&(F.opened=T,T.closed=F,T=L.pop(),F.parent=T),F.previous=k,k.next=F,this.__tokens.add(F),k=F}return this.__tokens},x.prototype._is_first_token=function(){return this.__tokens.isEmpty()},x.prototype._reset=function(){},x.prototype._get_next_token=function(F,k){this._readWhitespace();var T=this._input.read(/.+/g);return T?this._create_token(m.RAW,T):this._create_token(m.EOF,"")},x.prototype._is_comment=function(F){return!1},x.prototype._is_opening=function(F){return!1},x.prototype._is_closing=function(F,k){return!1},x.prototype._create_token=function(F,k){var T=new c(F,k,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return T},x.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},b.exports.Tokenizer=x,b.exports.TOKEN=m},function(b){function n(E){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=E}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 E=null;return this.hasNext()&&(E=this.__tokens[this.__position],this.__position+=1),E},n.prototype.peek=function(E){var f=null;return E=E||0,E+=this.__position,E>=0&&E<this.__tokens_length&&(f=this.__tokens[E]),f},n.prototype.add=function(E){this.__parent_token&&(E.parent=this.__parent_token),this.__tokens.push(E),this.__tokens_length+=1},b.exports.TokenStream=n},function(b,n,E){var f=E(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 m=this._create();return m.__set_whitespace_patterns(l,u),m._update(),m},c.prototype._create=function(){return new c(this._input,this)},c.prototype.__split=function(l,u){l.lastIndex=0;for(var m=0,x=[],F=l.exec(u);F;)x.push(u.substring(m,F.index)),m=F.index+F[0].length,F=l.exec(u);return m<u.length?x.push(u.substring(m,u.length)):x.push(""),x},b.exports.WhitespacePattern=c},function(b){function n(E,f){this._input=E,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 E=this._input.read(this._starting_pattern);return(!this._starting_pattern||E)&&(E+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),E},n.prototype.read_match=function(){return this._input.match(this._match_pattern)},n.prototype.until_after=function(E){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(E),f._update(),f},n.prototype.until=function(E){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(E),f._update(),f},n.prototype.starting_with=function(E){var f=this._create();return f._starting_pattern=this._input.get_regexp(E,!0),f._update(),f},n.prototype.matching=function(E){var f=this._create();return f._match_pattern=this._input.get_regexp(E,!0),f._update(),f},n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){},b.exports.Pattern=n},function(b){function n(E,f){E=typeof E=="string"?E:E.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(E+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(E+/\sbeautify\signore:end\s/.source+f,"g")}n.prototype.get_directives=function(E){if(!E.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(E);c;)f[c[1]]=c[2],c=this.__directive_pattern.exec(E);return f},n.prototype.readIgnored=function(E){return E.readUntilAfter(this.__directives_end_ignore_pattern)},b.exports.Directives=n},function(b,n,E){var f=E(12).Pattern,c={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function l(u,m){f.call(this,u,m),this.__template_pattern=null,this._disabled=Object.assign({},c),this._excluded=Object.assign({},c),m&&(this.__template_pattern=this._input.get_regexp(m.__template_pattern),this._excluded=Object.assign(this._excluded,m._excluded),this._disabled=Object.assign(this._disabled,m._disabled));var x=new f(u);this.__patterns={handlebars_comment:x.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:x.starting_with(/{{{/).until_after(/}}}/),handlebars:x.starting_with(/{{/).until_after(/}}/),php:x.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:x.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:x.starting_with(/{%/).until_after(/%}/),django_value:x.starting_with(/{{/).until_after(/}}/),django_comment:x.starting_with(/{#/).until_after(/#}/),smarty:x.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:x.starting_with(/{\*/).until_after(/\*}/),smarty_literal:x.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 m=this._create();return m._disabled[u]=!0,m._update(),m},l.prototype.read_options=function(u){var m=this._create();for(var x in c)m._disabled[x]=u.templating.indexOf(x)===-1;return m._update(),m},l.prototype.exclude=function(u){var m=this._create();return m._excluded[u]=!0,m._update(),m},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 m=this._read_template();m;)this._match_pattern?m+=this._input.read(this._match_pattern):m+=this._input.readUntil(this.__template_pattern),u+=m,m=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="",m=this._input.peek();if(m==="<"){var x=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&x==="?"&&(u=u||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&x==="%"&&(u=u||this.__patterns.erb.read())}else m==="{"&&(!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},b.exports.TemplatablePattern=l}],A={};function d(b){var n=A[b];if(n!==void 0)return n.exports;var E=A[b]={exports:{}};return I[b](E,E.exports,d),E.exports}var U=d(0);B=U})();var V=B;S=[],N=function(){return{js_beautify:V}}.apply(Le,S),N!==void 0&&(Ct.exports=N)})()},15342:function(Ct){(function(S,N){Ct.exports=N()})(typeof self!="undefined"?self:this,function(){return function(Le){var S={};function N(B){if(S[B])return S[B].exports;var V=S[B]={i:B,l:!1,exports:{}};return Le[B].call(V.exports,V,V.exports,N),V.l=!0,V.exports}return N.m=Le,N.c=S,N.d=function(B,V,I){N.o(B,V)||Object.defineProperty(B,V,{enumerable:!0,get:I})},N.r=function(B){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(B,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(B,"__esModule",{value:!0})},N.t=function(B,V){if(V&1&&(B=N(B)),V&8||V&4&&typeof B=="object"&&B&&B.__esModule)return B;var I=Object.create(null);if(N.r(I),Object.defineProperty(I,"default",{enumerable:!0,value:B}),V&2&&typeof B!="string")for(var A in B)N.d(I,A,function(d){return B[d]}.bind(null,A));return I},N.n=function(B){var V=B&&B.__esModule?function(){return B.default}:function(){return B};return N.d(V,"a",V),V},N.o=function(B,V){return Object.prototype.hasOwnProperty.call(B,V)},N.p="",N(N.s=1)}([function(Le,S,N){},function(Le,S,N){"use strict";N.r(S);var B=N(0),V=function(){function re(p,v,y){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=p,this.start=v,this.end=y}return re.range=function(v,y){return y?!v||!v.loc||!y.loc||v.loc.lexer!==y.loc.lexer?null:new re(v.loc.lexer,v.loc.start,y.loc.end):v&&v.loc},re}(),I=function(){function re(v,y){this.text=void 0,this.loc=void 0,this.text=v,this.loc=y}var p=re.prototype;return p.range=function(y,C){return new re(C,V.range(this,y))},re}(),A=function re(p,v){this.position=void 0;var y="KaTeX parse error: "+p,C,q=v&&v.loc;if(q&&q.start<=q.end){var ee=q.lexer.input;C=q.start;var pe=q.end;C===ee.length?y+=" at end of input: ":y+=" at position "+(C+1)+": ";var ve=ee.slice(C,pe).replace(/[^]/g,"$&\u0332"),Ce;C>15?Ce="\u2026"+ee.slice(C-15,C):Ce=ee.slice(0,C);var $e;pe+15<ee.length?$e=ee.slice(pe,pe+15)+"\u2026":$e=ee.slice(pe),y+=Ce+ve+$e}var Ye=new Error(y);return Ye.name="ParseError",Ye.__proto__=re.prototype,Ye.position=C,Ye};A.prototype.__proto__=Error.prototype;var d=A,U=function(p,v){return p.indexOf(v)!==-1},b=function(p,v){return p===void 0?v:p},n=/([A-Z])/g,E=function(p){return p.replace(n,"-$1").toLowerCase()},f={"&":"&",">":">","<":"<",'"':""","'":"'"},c=/[&><"']/g;function l(re){return String(re).replace(c,function(p){return f[p]})}var u=function re(p){return p.type==="ordgroup"||p.type==="color"?p.body.length===1?re(p.body[0]):p:p.type==="font"?re(p.body):p},m=function(p){var v=u(p);return v.type==="mathord"||v.type==="textord"||v.type==="atom"},x=function(p){if(!p)throw new Error("Expected non-null, but got "+String(p));return p},F=function(p){var v=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(p);return v!=null?v[1]:"_relative"},k={contains:U,deflt:b,escape:l,hyphenate:E,getBaseElem:u,isCharacterBox:m,protocolFromUrl:F},T=function(){function re(v){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,v=v||{},this.displayMode=k.deflt(v.displayMode,!1),this.output=k.deflt(v.output,"htmlAndMathml"),this.leqno=k.deflt(v.leqno,!1),this.fleqn=k.deflt(v.fleqn,!1),this.throwOnError=k.deflt(v.throwOnError,!0),this.errorColor=k.deflt(v.errorColor,"#cc0000"),this.macros=v.macros||{},this.minRuleThickness=Math.max(0,k.deflt(v.minRuleThickness,0)),this.colorIsTextColor=k.deflt(v.colorIsTextColor,!1),this.strict=k.deflt(v.strict,"warn"),this.trust=k.deflt(v.trust,!1),this.maxSize=Math.max(0,k.deflt(v.maxSize,1/0)),this.maxExpand=Math.max(0,k.deflt(v.maxExpand,1e3))}var p=re.prototype;return p.reportNonstrict=function(y,C,q){var ee=this.strict;if(typeof ee=="function"&&(ee=ee(y,C,q)),!(!ee||ee==="ignore")){if(ee===!0||ee==="error")throw new d("LaTeX-incompatible input and strict mode is set to 'error': "+(C+" ["+y+"]"),q);ee==="warn"?typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(C+" ["+y+"]")):typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+ee+"': "+C+" ["+y+"]"))}},p.useStrictBehavior=function(y,C,q){var ee=this.strict;if(typeof ee=="function")try{ee=ee(y,C,q)}catch(pe){ee="error"}return!ee||ee==="ignore"?!1:ee===!0||ee==="error"?!0:ee==="warn"?(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(C+" ["+y+"]")),!1):(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+ee+"': "+C+" ["+y+"]")),!1)},p.isTrusted=function(y){y.url&&!y.protocol&&(y.protocol=k.protocolFromUrl(y.url));var C=typeof this.trust=="function"?this.trust(y):this.trust;return!!C},re}(),L=function(){function re(v,y,C){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=v,this.size=y,this.cramped=C}var p=re.prototype;return p.sup=function(){return _e[le[this.id]]},p.sub=function(){return _e[Q[this.id]]},p.fracNum=function(){return _e[se[this.id]]},p.fracDen=function(){return _e[H[this.id]]},p.cramp=function(){return _e[J[this.id]]},p.text=function(){return _e[K[this.id]]},p.isTight=function(){return this.size>=2},re}(),W=0,P=1,O=2,$=3,z=4,ie=5,te=6,me=7,_e=[new L(W,0,!1),new L(P,0,!0),new L(O,1,!1),new L($,1,!0),new L(z,2,!1),new L(ie,2,!0),new L(te,3,!1),new L(me,3,!0)],le=[z,ie,z,ie,te,me,te,me],Q=[ie,ie,ie,ie,me,me,me,me],se=[O,$,z,ie,te,me,te,me],H=[$,$,ie,ie,me,me,me,me],J=[P,P,$,$,ie,ie,me,me],K=[W,P,O,$,O,$,O,$],M={DISPLAY:_e[W],TEXT:_e[O],SCRIPT:_e[z],SCRIPTSCRIPT:_e[te]},D=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function ne(re){for(var p=0;p<D.length;p++)for(var v=D[p],y=0;y<v.blocks.length;y++){var C=v.blocks[y];if(re>=C[0]&&re<=C[1])return v.name}return null}var de=[];D.forEach(function(re){return re.blocks.forEach(function(p){return de.push.apply(de,p)})});function Oe(re){for(var p=0;p<de.length;p+=2)if(re>=de[p]&&re<=de[p+1])return!0;return!1}var Ve=80,nt=function(p,v){return"M95,"+(622+p+v)+`
|
|
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
|
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
|
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|
|
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|
|
c69,-144,104.5,-217.7,106.5,-221
|
|
|
l`+p/2.075+" -"+p+`
|
|
|
c5.3,-9.3,12,-14,20,-14
|
|
|
H400000v`+(40+p)+`H845.2724
|
|
|
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
|
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
|
M`+(834+p)+" "+v+"h400000v"+(40+p)+"h-400000z"},Fe=function(p,v){return"M263,"+(601+p+v)+`c0.7,0,18,39.7,52,119
|
|
|
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
|
c340,-704.7,510.7,-1060.3,512,-1067
|
|
|
l`+p/2.084+" -"+p+`
|
|
|
c4.7,-7.3,11,-11,19,-11
|
|
|
H40000v`+(40+p)+`H1012.3
|
|
|
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|
|
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|
|
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
|
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
|
M`+(1001+p)+" "+v+"h400000v"+(40+p)+"h-400000z"},rt=function(p,v){return"M983 "+(10+p+v)+`
|
|
|
l`+p/3.13+" -"+p+`
|
|
|
c4,-6.7,10,-10,18,-10 H400000v`+(40+p)+`
|
|
|
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|
|
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
|
|
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
|
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
|
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
|
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
|
M`+(1001+p)+" "+v+"h400000v"+(40+p)+"h-400000z"},Ze=function(p,v){return"M424,"+(2398+p+v)+`
|
|
|
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
|
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|
|
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
|
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|
|
l`+p/4.223+" -"+p+`c4,-6.7,10,-10,18,-10 H400000
|
|
|
v`+(40+p)+`H1014.6
|
|
|
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
|
c-2,6,-10,9,-24,9
|
|
|
c-8,0,-12,-0.7,-12,-2z M`+(1001+p)+" "+v+`
|
|
|
h400000v`+(40+p)+"h-400000z"},st=function(p,v){return"M473,"+(2713+p+v)+`
|
|
|
c339.3,-1799.3,509.3,-2700,510,-2702 l`+p/5.298+" -"+p+`
|
|
|
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+p)+`H1017.7
|
|
|
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
|
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|
|
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|
|
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
|
606zM`+(1001+p)+" "+v+"h400000v"+(40+p)+"H1017.7z"},At=function(p,v,y){var C=y-54-v-p;return"M702 "+(p+v)+"H400000"+(40+p)+`
|
|
|
H742v`+C+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|
|
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
|
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
|
219 661 l218 661zM702 `+v+"H400000v"+(40+p)+"H742z"},Jt=function(p,v,y){v=1e3*v;var C="";switch(p){case"sqrtMain":C=nt(v,Ve);break;case"sqrtSize1":C=Fe(v,Ve);break;case"sqrtSize2":C=rt(v,Ve);break;case"sqrtSize3":C=Ze(v,Ve);break;case"sqrtSize4":C=st(v,Ve);break;case"sqrtTall":C=At(v,Ve,y)}return C},pt={doubleleftarrow:`M262 157
|
|
|
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
|
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
|
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
|
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|
|
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|
|
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
|
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
|
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
|
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|
|
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|
|
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|
|
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|
|
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
|
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|
|
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
|
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|
|
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|
|
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|
|
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|
|
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|
|
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
|
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
|
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|
|
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|
|
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
|
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|
|
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|
|
435 0h399565z`,leftgroupunder:`M400000 262
|
|
|
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|
|
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
|
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|
|
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|
|
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|
|
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|
|
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|
|
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
|
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
|
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
|
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|
|
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|
|
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|
|
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
|
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|
|
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|
|
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|
|
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
|
|
|
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
|
|
|
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
|
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
|
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|
|
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
|
|
|
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
|
|
|
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|
|
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
|
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|
|
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
|
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|
|
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
|
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|
|
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|
|
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
|
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|
|
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|
|
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
|
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
|
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|
|
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
|
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|
|
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|
|
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
|
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
|
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|
|
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|
|
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|
|
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|
|
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
|
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
|
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|
|
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|
|
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|
|
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
|
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|
|
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|
|
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|
|
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|
|
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|
|
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|
|
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|
|
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|
|
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|
|
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|
|
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|
|
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|
|
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|
|
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|
|
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
|
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|
|
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|
|
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|
|
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
|
|
|
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
|
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
|
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|
|
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
|
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|
|
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
|
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
|
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
|
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|
|
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|
|
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|
|
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
|
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
|
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|
|
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|
|
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|
|
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
|
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
|
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|
|
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
|
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|
|
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|
|
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
|
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
|
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
|
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
|
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
|
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
|
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
|
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|
|
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
|
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|
|
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|
|
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
|
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
|
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|
|
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
|
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
|
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
|
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|
|
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
|
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
|
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
|
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|
|
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
|
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|
|
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|
|
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|
|
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|
|
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
|
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
|
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|
|
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|
|
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|
|
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
|
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
|
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|
|
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
|
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
|
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
|
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|
|
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|
|
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
|
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
|
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Bt=function(){function re(v){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=v,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}var p=re.prototype;return p.hasClass=function(y){return k.contains(this.classes,y)},p.toNode=function(){for(var y=document.createDocumentFragment(),C=0;C<this.children.length;C++)y.appendChild(this.children[C].toNode());return y},p.toMarkup=function(){for(var y="",C=0;C<this.children.length;C++)y+=this.children[C].toMarkup();return y},p.toText=function(){var y=function(q){return q.toText()};return this.children.map(y).join("")},re}(),zt=function(p){return p.filter(function(v){return v}).join(" ")},$t=function(p,v,y){if(this.classes=p||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=y||{},v){v.style.isTight()&&this.classes.push("mtight");var C=v.getColor();C&&(this.style.color=C)}},Me=function(p){var v=document.createElement(p);v.className=zt(this.classes);for(var y in this.style)this.style.hasOwnProperty(y)&&(v.style[y]=this.style[y]);for(var C in this.attributes)this.attributes.hasOwnProperty(C)&&v.setAttribute(C,this.attributes[C]);for(var q=0;q<this.children.length;q++)v.appendChild(this.children[q].toNode());return v},ze=function(p){var v="<"+p;this.classes.length&&(v+=' class="'+k.escape(zt(this.classes))+'"');var y="";for(var C in this.style)this.style.hasOwnProperty(C)&&(y+=k.hyphenate(C)+":"+this.style[C]+";");y&&(v+=' style="'+k.escape(y)+'"');for(var q in this.attributes)this.attributes.hasOwnProperty(q)&&(v+=" "+q+'="'+k.escape(this.attributes[q])+'"');v+=">";for(var ee=0;ee<this.children.length;ee++)v+=this.children[ee].toMarkup();return v+="</"+p+">",v},Ue=function(){function re(v,y,C,q){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,$t.call(this,v,C,q),this.children=y||[]}var p=re.prototype;return p.setAttribute=function(y,C){this.attributes[y]=C},p.hasClass=function(y){return k.contains(this.classes,y)},p.toNode=function(){return Me.call(this,"span")},p.toMarkup=function(){return ze.call(this,"span")},re}(),ot=function(){function re(v,y,C,q){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,$t.call(this,y,q),this.children=C||[],this.setAttribute("href",v)}var p=re.prototype;return p.setAttribute=function(y,C){this.attributes[y]=C},p.hasClass=function(y){return k.contains(this.classes,y)},p.toNode=function(){return Me.call(this,"a")},p.toMarkup=function(){return ze.call(this,"a")},re}(),ut=function(){function re(v,y,C){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=y,this.src=v,this.classes=["mord"],this.style=C}var p=re.prototype;return p.hasClass=function(y){return k.contains(this.classes,y)},p.toNode=function(){var y=document.createElement("img");y.src=this.src,y.alt=this.alt,y.className="mord";for(var C in this.style)this.style.hasOwnProperty(C)&&(y.style[C]=this.style[C]);return y},p.toMarkup=function(){var y="<img src='"+this.src+" 'alt='"+this.alt+"' ",C="";for(var q in this.style)this.style.hasOwnProperty(q)&&(C+=k.hyphenate(q)+":"+this.style[q]+";");return C&&(y+=' style="'+k.escape(C)+'"'),y+="'/>",y},re}(),ue={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"},be=function(){function re(v,y,C,q,ee,pe,ve,Ce){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=v,this.height=y||0,this.depth=C||0,this.italic=q||0,this.skew=ee||0,this.width=pe||0,this.classes=ve||[],this.style=Ce||{},this.maxFontSize=0;var $e=ne(this.text.charCodeAt(0));$e&&this.classes.push($e+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=ue[this.text])}var p=re.prototype;return p.hasClass=function(y){return k.contains(this.classes,y)},p.toNode=function(){var y=document.createTextNode(this.text),C=null;this.italic>0&&(C=document.createElement("span"),C.style.marginRight=this.italic+"em"),this.classes.length>0&&(C=C||document.createElement("span"),C.className=zt(this.classes));for(var q in this.style)this.style.hasOwnProperty(q)&&(C=C||document.createElement("span"),C.style[q]=this.style[q]);return C?(C.appendChild(y),C):y},p.toMarkup=function(){var y=!1,C="<span";this.classes.length&&(y=!0,C+=' class="',C+=k.escape(zt(this.classes)),C+='"');var q="";this.italic>0&&(q+="margin-right:"+this.italic+"em;");for(var ee in this.style)this.style.hasOwnProperty(ee)&&(q+=k.hyphenate(ee)+":"+this.style[ee]+";");q&&(y=!0,C+=' style="'+k.escape(q)+'"');var pe=k.escape(this.text);return y?(C+=">",C+=pe,C+="</span>",C):pe},re}(),De=function(){function re(v,y){this.children=void 0,this.attributes=void 0,this.children=v||[],this.attributes=y||{}}var p=re.prototype;return p.toNode=function(){var y="http://www.w3.org/2000/svg",C=document.createElementNS(y,"svg");for(var q in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,q)&&C.setAttribute(q,this.attributes[q]);for(var ee=0;ee<this.children.length;ee++)C.appendChild(this.children[ee].toNode());return C},p.toMarkup=function(){var y="<svg";for(var C in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,C)&&(y+=" "+C+"='"+this.attributes[C]+"'");y+=">";for(var q=0;q<this.children.length;q++)y+=this.children[q].toMarkup();return y+="</svg>",y},re}(),Ae=function(){function re(v,y){this.pathName=void 0,this.alternate=void 0,this.pathName=v,this.alternate=y}var p=re.prototype;return p.toNode=function(){var y="http://www.w3.org/2000/svg",C=document.createElementNS(y,"path");return this.alternate?C.setAttribute("d",this.alternate):C.setAttribute("d",pt[this.pathName]),C},p.toMarkup=function(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+pt[this.pathName]+"'/>"},re}(),Ne=function(){function re(v){this.attributes=void 0,this.attributes=v||{}}var p=re.prototype;return p.toNode=function(){var y="http://www.w3.org/2000/svg",C=document.createElementNS(y,"line");for(var q in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,q)&&C.setAttribute(q,this.attributes[q]);return C},p.toMarkup=function(){var y="<line";for(var C in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,C)&&(y+=" "+C+"='"+this.attributes[C]+"'");return y+="/>",y},re}();function je(re){if(re instanceof be)return re;throw new Error("Expected symbolNode but got "+String(re)+".")}function Qe(re){if(re instanceof Ue)return re;throw new Error("Expected span<HtmlDomNode> but got "+String(re)+".")}var at={"AMS-Regular":{65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473]},"Fraktur-Regular":{33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],163:[0,.69444,0,0,.86853],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],163:[0,.69444,0,0,.76909],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],305:[0,.43056,0,.02778,.32246],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],567:[.19444,.43056,0,.08334,.38403],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,1],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.67,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.744,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.744,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333]},"Math-Italic":{65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059]},"Math-Regular":{65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059]},"SansSerif-Bold":{33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212]},"Size1-Regular":{40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Je={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},We={\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function vt(re,p){at[re]=p}function gt(re,p,v){if(!at[p])throw new Error("Font metrics not found for font: "+p+".");var y=re.charCodeAt(0),C=at[p][y];if(!C&&re[0]in We&&(y=We[re[0]].charCodeAt(0),C=at[p][y]),!C&&v==="text"&&Oe(y)&&(C=at[p][77]),C)return{depth:C[0],height:C[1],italic:C[2],skew:C[3],width:C[4]}}var mt={};function xt(re){var p;if(re>=5?p=0:re>=3?p=1:p=2,!mt[p]){var v=mt[p]={cssEmPerMu:Je.quad[p]/18};for(var y in Je)Je.hasOwnProperty(y)&&(v[y]=Je[y][p])}return mt[p]}var Lt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},yt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Mt={math:{},text:{}},Nt=Mt;function j(re,p,v,y,C,q){Mt[re][C]={font:p,group:v,replace:y},q&&y&&(Mt[re][y]=Mt[re][C])}var Z="math",tt="text",oe="main",xe="ams",Kt="accent-token",ke="bin",Pe="close",He="inner",he="mathord",ge="op-token",ye="open",Ie="punct",ae="rel",_t="spacing",we="textord";j(Z,oe,ae,"\u2261","\\equiv",!0),j(Z,oe,ae,"\u227A","\\prec",!0),j(Z,oe,ae,"\u227B","\\succ",!0),j(Z,oe,ae,"\u223C","\\sim",!0),j(Z,oe,ae,"\u22A5","\\perp"),j(Z,oe,ae,"\u2AAF","\\preceq",!0),j(Z,oe,ae,"\u2AB0","\\succeq",!0),j(Z,oe,ae,"\u2243","\\simeq",!0),j(Z,oe,ae,"\u2223","\\mid",!0),j(Z,oe,ae,"\u226A","\\ll",!0),j(Z,oe,ae,"\u226B","\\gg",!0),j(Z,oe,ae,"\u224D","\\asymp",!0),j(Z,oe,ae,"\u2225","\\parallel"),j(Z,oe,ae,"\u22C8","\\bowtie",!0),j(Z,oe,ae,"\u2323","\\smile",!0),j(Z,oe,ae,"\u2291","\\sqsubseteq",!0),j(Z,oe,ae,"\u2292","\\sqsupseteq",!0),j(Z,oe,ae,"\u2250","\\doteq",!0),j(Z,oe,ae,"\u2322","\\frown",!0),j(Z,oe,ae,"\u220B","\\ni",!0),j(Z,oe,ae,"\u221D","\\propto",!0),j(Z,oe,ae,"\u22A2","\\vdash",!0),j(Z,oe,ae,"\u22A3","\\dashv",!0),j(Z,oe,ae,"\u220B","\\owns"),j(Z,oe,Ie,".","\\ldotp"),j(Z,oe,Ie,"\u22C5","\\cdotp"),j(Z,oe,we,"#","\\#"),j(tt,oe,we,"#","\\#"),j(Z,oe,we,"&","\\&"),j(tt,oe,we,"&","\\&"),j(Z,oe,we,"\u2135","\\aleph",!0),j(Z,oe,we,"\u2200","\\forall",!0),j(Z,oe,we,"\u210F","\\hbar",!0),j(Z,oe,we,"\u2203","\\exists",!0),j(Z,oe,we,"\u2207","\\nabla",!0),j(Z,oe,we,"\u266D","\\flat",!0),j(Z,oe,we,"\u2113","\\ell",!0),j(Z,oe,we,"\u266E","\\natural",!0),j(Z,oe,we,"\u2663","\\clubsuit",!0),j(Z,oe,we,"\u2118","\\wp",!0),j(Z,oe,we,"\u266F","\\sharp",!0),j(Z,oe,we,"\u2662","\\diamondsuit",!0),j(Z,oe,we,"\u211C","\\Re",!0),j(Z,oe,we,"\u2661","\\heartsuit",!0),j(Z,oe,we,"\u2111","\\Im",!0),j(Z,oe,we,"\u2660","\\spadesuit",!0),j(tt,oe,we,"\xA7","\\S",!0),j(tt,oe,we,"\xB6","\\P",!0),j(Z,oe,we,"\u2020","\\dag"),j(tt,oe,we,"\u2020","\\dag"),j(tt,oe,we,"\u2020","\\textdagger"),j(Z,oe,we,"\u2021","\\ddag"),j(tt,oe,we,"\u2021","\\ddag"),j(tt,oe,we,"\u2021","\\textdaggerdbl"),j(Z,oe,Pe,"\u23B1","\\rmoustache",!0),j(Z,oe,ye,"\u23B0","\\lmoustache",!0),j(Z,oe,Pe,"\u27EF","\\rgroup",!0),j(Z,oe,ye,"\u27EE","\\lgroup",!0),j(Z,oe,ke,"\u2213","\\mp",!0),j(Z,oe,ke,"\u2296","\\ominus",!0),j(Z,oe,ke,"\u228E","\\uplus",!0),j(Z,oe,ke,"\u2293","\\sqcap",!0),j(Z,oe,ke,"\u2217","\\ast"),j(Z,oe,ke,"\u2294","\\sqcup",!0),j(Z,oe,ke,"\u25EF","\\bigcirc"),j(Z,oe,ke,"\u2219","\\bullet"),j(Z,oe,ke,"\u2021","\\ddagger"),j(Z,oe,ke,"\u2240","\\wr",!0),j(Z,oe,ke,"\u2A3F","\\amalg"),j(Z,oe,ke,"&","\\And"),j(Z,oe,ae,"\u27F5","\\longleftarrow",!0),j(Z,oe,ae,"\u21D0","\\Leftarrow",!0),j(Z,oe,ae,"\u27F8","\\Longleftarrow",!0),j(Z,oe,ae,"\u27F6","\\longrightarrow",!0),j(Z,oe,ae,"\u21D2","\\Rightarrow",!0),j(Z,oe,ae,"\u27F9","\\Longrightarrow",!0),j(Z,oe,ae,"\u2194","\\leftrightarrow",!0),j(Z,oe,ae,"\u27F7","\\longleftrightarrow",!0),j(Z,oe,ae,"\u21D4","\\Leftrightarrow",!0),j(Z,oe,ae,"\u27FA","\\Longleftrightarrow",!0),j(Z,oe,ae,"\u21A6","\\mapsto",!0),j(Z,oe,ae,"\u27FC","\\longmapsto",!0),j(Z,oe,ae,"\u2197","\\nearrow",!0),j(Z,oe,ae,"\u21A9","\\hookleftarrow",!0),j(Z,oe,ae,"\u21AA","\\hookrightarrow",!0),j(Z,oe,ae,"\u2198","\\searrow",!0),j(Z,oe,ae,"\u21BC","\\leftharpoonup",!0),j(Z,oe,ae,"\u21C0","\\rightharpoonup",!0),j(Z,oe,ae,"\u2199","\\swarrow",!0),j(Z,oe,ae,"\u21BD","\\leftharpoondown",!0),j(Z,oe,ae,"\u21C1","\\rightharpoondown",!0),j(Z,oe,ae,"\u2196","\\nwarrow",!0),j(Z,oe,ae,"\u21CC","\\rightleftharpoons",!0),j(Z,xe,ae,"\u226E","\\nless",!0),j(Z,xe,ae,"\uE010","\\@nleqslant"),j(Z,xe,ae,"\uE011","\\@nleqq"),j(Z,xe,ae,"\u2A87","\\lneq",!0),j(Z,xe,ae,"\u2268","\\lneqq",!0),j(Z,xe,ae,"\uE00C","\\@lvertneqq"),j(Z,xe,ae,"\u22E6","\\lnsim",!0),j(Z,xe,ae,"\u2A89","\\lnapprox",!0),j(Z,xe,ae,"\u2280","\\nprec",!0),j(Z,xe,ae,"\u22E0","\\npreceq",!0),j(Z,xe,ae,"\u22E8","\\precnsim",!0),j(Z,xe,ae,"\u2AB9","\\precnapprox",!0),j(Z,xe,ae,"\u2241","\\nsim",!0),j(Z,xe,ae,"\uE006","\\@nshortmid"),j(Z,xe,ae,"\u2224","\\nmid",!0),j(Z,xe,ae,"\u22AC","\\nvdash",!0),j(Z,xe,ae,"\u22AD","\\nvDash",!0),j(Z,xe,ae,"\u22EA","\\ntriangleleft"),j(Z,xe,ae,"\u22EC","\\ntrianglelefteq",!0),j(Z,xe,ae,"\u228A","\\subsetneq",!0),j(Z,xe,ae,"\uE01A","\\@varsubsetneq"),j(Z,xe,ae,"\u2ACB","\\subsetneqq",!0),j(Z,xe,ae,"\uE017","\\@varsubsetneqq"),j(Z,xe,ae,"\u226F","\\ngtr",!0),j(Z,xe,ae,"\uE00F","\\@ngeqslant"),j(Z,xe,ae,"\uE00E","\\@ngeqq"),j(Z,xe,ae,"\u2A88","\\gneq",!0),j(Z,xe,ae,"\u2269","\\gneqq",!0),j(Z,xe,ae,"\uE00D","\\@gvertneqq"),j(Z,xe,ae,"\u22E7","\\gnsim",!0),j(Z,xe,ae,"\u2A8A","\\gnapprox",!0),j(Z,xe,ae,"\u2281","\\nsucc",!0),j(Z,xe,ae,"\u22E1","\\nsucceq",!0),j(Z,xe,ae,"\u22E9","\\succnsim",!0),j(Z,xe,ae,"\u2ABA","\\succnapprox",!0),j(Z,xe,ae,"\u2246","\\ncong",!0),j(Z,xe,ae,"\uE007","\\@nshortparallel"),j(Z,xe,ae,"\u2226","\\nparallel",!0),j(Z,xe,ae,"\u22AF","\\nVDash",!0),j(Z,xe,ae,"\u22EB","\\ntriangleright"),j(Z,xe,ae,"\u22ED","\\ntrianglerighteq",!0),j(Z,xe,ae,"\uE018","\\@nsupseteqq"),j(Z,xe,ae,"\u228B","\\supsetneq",!0),j(Z,xe,ae,"\uE01B","\\@varsupsetneq"),j(Z,xe,ae,"\u2ACC","\\supsetneqq",!0),j(Z,xe,ae,"\uE019","\\@varsupsetneqq"),j(Z,xe,ae,"\u22AE","\\nVdash",!0),j(Z,xe,ae,"\u2AB5","\\precneqq",!0),j(Z,xe,ae,"\u2AB6","\\succneqq",!0),j(Z,xe,ae,"\uE016","\\@nsubseteqq"),j(Z,xe,ke,"\u22B4","\\unlhd"),j(Z,xe,ke,"\u22B5","\\unrhd"),j(Z,xe,ae,"\u219A","\\nleftarrow",!0),j(Z,xe,ae,"\u219B","\\nrightarrow",!0),j(Z,xe,ae,"\u21CD","\\nLeftarrow",!0),j(Z,xe,ae,"\u21CF","\\nRightarrow",!0),j(Z,xe,ae,"\u21AE","\\nleftrightarrow",!0),j(Z,xe,ae,"\u21CE","\\nLeftrightarrow",!0),j(Z,xe,ae,"\u25B3","\\vartriangle"),j(Z,xe,we,"\u210F","\\hslash"),j(Z,xe,we,"\u25BD","\\triangledown"),j(Z,xe,we,"\u25CA","\\lozenge"),j(Z,xe,we,"\u24C8","\\circledS"),j(Z,xe,we,"\xAE","\\circledR"),j(tt,xe,we,"\xAE","\\circledR"),j(Z,xe,we,"\u2221","\\measuredangle",!0),j(Z,xe,we,"\u2204","\\nexists"),j(Z,xe,we,"\u2127","\\mho"),j(Z,xe,we,"\u2132","\\Finv",!0),j(Z,xe,we,"\u2141","\\Game",!0),j(Z,xe,we,"\u2035","\\backprime"),j(Z,xe,we,"\u25B2","\\blacktriangle"),j(Z,xe,we,"\u25BC","\\blacktriangledown"),j(Z,xe,we,"\u25A0","\\blacksquare"),j(Z,xe,we,"\u29EB","\\blacklozenge"),j(Z,xe,we,"\u2605","\\bigstar"),j(Z,xe,we,"\u2222","\\sphericalangle",!0),j(Z,xe,we,"\u2201","\\complement",!0),j(Z,xe,we,"\xF0","\\eth",!0),j(Z,xe,we,"\u2571","\\diagup"),j(Z,xe,we,"\u2572","\\diagdown"),j(Z,xe,we,"\u25A1","\\square"),j(Z,xe,we,"\u25A1","\\Box"),j(Z,xe,we,"\u25CA","\\Diamond"),j(Z,xe,we,"\xA5","\\yen",!0),j(tt,xe,we,"\xA5","\\yen",!0),j(Z,xe,we,"\u2713","\\checkmark",!0),j(tt,xe,we,"\u2713","\\checkmark"),j(Z,xe,we,"\u2136","\\beth",!0),j(Z,xe,we,"\u2138","\\daleth",!0),j(Z,xe,we,"\u2137","\\gimel",!0),j(Z,xe,we,"\u03DD","\\digamma",!0),j(Z,xe,we,"\u03F0","\\varkappa"),j(Z,xe,ye,"\u250C","\\ulcorner",!0),j(Z,xe,Pe,"\u2510","\\urcorner",!0),j(Z,xe,ye,"\u2514","\\llcorner",!0),j(Z,xe,Pe,"\u2518","\\lrcorner",!0),j(Z,xe,ae,"\u2266","\\leqq",!0),j(Z,xe,ae,"\u2A7D","\\leqslant",!0),j(Z,xe,ae,"\u2A95","\\eqslantless",!0),j(Z,xe,ae,"\u2272","\\lesssim",!0),j(Z,xe,ae,"\u2A85","\\lessapprox",!0),j(Z,xe,ae,"\u224A","\\approxeq",!0),j(Z,xe,ke,"\u22D6","\\lessdot"),j(Z,xe,ae,"\u22D8","\\lll",!0),j(Z,xe,ae,"\u2276","\\lessgtr",!0),j(Z,xe,ae,"\u22DA","\\lesseqgtr",!0),j(Z,xe,ae,"\u2A8B","\\lesseqqgtr",!0),j(Z,xe,ae,"\u2251","\\doteqdot"),j(Z,xe,ae,"\u2253","\\risingdotseq",!0),j(Z,xe,ae,"\u2252","\\fallingdotseq",!0),j(Z,xe,ae,"\u223D","\\backsim",!0),j(Z,xe,ae,"\u22CD","\\backsimeq",!0),j(Z,xe,ae,"\u2AC5","\\subseteqq",!0),j(Z,xe,ae,"\u22D0","\\Subset",!0),j(Z,xe,ae,"\u228F","\\sqsubset",!0),j(Z,xe,ae,"\u227C","\\preccurlyeq",!0),j(Z,xe,ae,"\u22DE","\\curlyeqprec",!0),j(Z,xe,ae,"\u227E","\\precsim",!0),j(Z,xe,ae,"\u2AB7","\\precapprox",!0),j(Z,xe,ae,"\u22B2","\\vartriangleleft"),j(Z,xe,ae,"\u22B4","\\trianglelefteq"),j(Z,xe,ae,"\u22A8","\\vDash",!0),j(Z,xe,ae,"\u22AA","\\Vvdash",!0),j(Z,xe,ae,"\u2323","\\smallsmile"),j(Z,xe,ae,"\u2322","\\smallfrown"),j(Z,xe,ae,"\u224F","\\bumpeq",!0),j(Z,xe,ae,"\u224E","\\Bumpeq",!0),j(Z,xe,ae,"\u2267","\\geqq",!0),j(Z,xe,ae,"\u2A7E","\\geqslant",!0),j(Z,xe,ae,"\u2A96","\\eqslantgtr",!0),j(Z,xe,ae,"\u2273","\\gtrsim",!0),j(Z,xe,ae,"\u2A86","\\gtrapprox",!0),j(Z,xe,ke,"\u22D7","\\gtrdot"),j(Z,xe,ae,"\u22D9","\\ggg",!0),j(Z,xe,ae,"\u2277","\\gtrless",!0),j(Z,xe,ae,"\u22DB","\\gtreqless",!0),j(Z,xe,ae,"\u2A8C","\\gtreqqless",!0),j(Z,xe,ae,"\u2256","\\eqcirc",!0),j(Z,xe,ae,"\u2257","\\circeq",!0),j(Z,xe,ae,"\u225C","\\triangleq",!0),j(Z,xe,ae,"\u223C","\\thicksim"),j(Z,xe,ae,"\u2248","\\thickapprox"),j(Z,xe,ae,"\u2AC6","\\supseteqq",!0),j(Z,xe,ae,"\u22D1","\\Supset",!0),j(Z,xe,ae,"\u2290","\\sqsupset",!0),j(Z,xe,ae,"\u227D","\\succcurlyeq",!0),j(Z,xe,ae,"\u22DF","\\curlyeqsucc",!0),j(Z,xe,ae,"\u227F","\\succsim",!0),j(Z,xe,ae,"\u2AB8","\\succapprox",!0),j(Z,xe,ae,"\u22B3","\\vartriangleright"),j(Z,xe,ae,"\u22B5","\\trianglerighteq"),j(Z,xe,ae,"\u22A9","\\Vdash",!0),j(Z,xe,ae,"\u2223","\\shortmid"),j(Z,xe,ae,"\u2225","\\shortparallel"),j(Z,xe,ae,"\u226C","\\between",!0),j(Z,xe,ae,"\u22D4","\\pitchfork",!0),j(Z,xe,ae,"\u221D","\\varpropto"),j(Z,xe,ae,"\u25C0","\\blacktriangleleft"),j(Z,xe,ae,"\u2234","\\therefore",!0),j(Z,xe,ae,"\u220D","\\backepsilon"),j(Z,xe,ae,"\u25B6","\\blacktriangleright"),j(Z,xe,ae,"\u2235","\\because",!0),j(Z,xe,ae,"\u22D8","\\llless"),j(Z,xe,ae,"\u22D9","\\gggtr"),j(Z,xe,ke,"\u22B2","\\lhd"),j(Z,xe,ke,"\u22B3","\\rhd"),j(Z,xe,ae,"\u2242","\\eqsim",!0),j(Z,oe,ae,"\u22C8","\\Join"),j(Z,xe,ae,"\u2251","\\Doteq",!0),j(Z,xe,ke,"\u2214","\\dotplus",!0),j(Z,xe,ke,"\u2216","\\smallsetminus"),j(Z,xe,ke,"\u22D2","\\Cap",!0),j(Z,xe,ke,"\u22D3","\\Cup",!0),j(Z,xe,ke,"\u2A5E","\\doublebarwedge",!0),j(Z,xe,ke,"\u229F","\\boxminus",!0),j(Z,xe,ke,"\u229E","\\boxplus",!0),j(Z,xe,ke,"\u22C7","\\divideontimes",!0),j(Z,xe,ke,"\u22C9","\\ltimes",!0),j(Z,xe,ke,"\u22CA","\\rtimes",!0),j(Z,xe,ke,"\u22CB","\\leftthreetimes",!0),j(Z,xe,ke,"\u22CC","\\rightthreetimes",!0),j(Z,xe,ke,"\u22CF","\\curlywedge",!0),j(Z,xe,ke,"\u22CE","\\curlyvee",!0),j(Z,xe,ke,"\u229D","\\circleddash",!0),j(Z,xe,ke,"\u229B","\\circledast",!0),j(Z,xe,ke,"\u22C5","\\centerdot"),j(Z,xe,ke,"\u22BA","\\intercal",!0),j(Z,xe,ke,"\u22D2","\\doublecap"),j(Z,xe,ke,"\u22D3","\\doublecup"),j(Z,xe,ke,"\u22A0","\\boxtimes",!0),j(Z,xe,ae,"\u21E2","\\dashrightarrow",!0),j(Z,xe,ae,"\u21E0","\\dashleftarrow",!0),j(Z,xe,ae,"\u21C7","\\leftleftarrows",!0),j(Z,xe,ae,"\u21C6","\\leftrightarrows",!0),j(Z,xe,ae,"\u21DA","\\Lleftarrow",!0),j(Z,xe,ae,"\u219E","\\twoheadleftarrow",!0),j(Z,xe,ae,"\u21A2","\\leftarrowtail",!0),j(Z,xe,ae,"\u21AB","\\looparrowleft",!0),j(Z,xe,ae,"\u21CB","\\leftrightharpoons",!0),j(Z,xe,ae,"\u21B6","\\curvearrowleft",!0),j(Z,xe,ae,"\u21BA","\\circlearrowleft",!0),j(Z,xe,ae,"\u21B0","\\Lsh",!0),j(Z,xe,ae,"\u21C8","\\upuparrows",!0),j(Z,xe,ae,"\u21BF","\\upharpoonleft",!0),j(Z,xe,ae,"\u21C3","\\downharpoonleft",!0),j(Z,xe,ae,"\u22B8","\\multimap",!0),j(Z,xe,ae,"\u21AD","\\leftrightsquigarrow",!0),j(Z,xe,ae,"\u21C9","\\rightrightarrows",!0),j(Z,xe,ae,"\u21C4","\\rightleftarrows",!0),j(Z,xe,ae,"\u21A0","\\twoheadrightarrow",!0),j(Z,xe,ae,"\u21A3","\\rightarrowtail",!0),j(Z,xe,ae,"\u21AC","\\looparrowright",!0),j(Z,xe,ae,"\u21B7","\\curvearrowright",!0),j(Z,xe,ae,"\u21BB","\\circlearrowright",!0),j(Z,xe,ae,"\u21B1","\\Rsh",!0),j(Z,xe,ae,"\u21CA","\\downdownarrows",!0),j(Z,xe,ae,"\u21BE","\\upharpoonright",!0),j(Z,xe,ae,"\u21C2","\\downharpoonright",!0),j(Z,xe,ae,"\u21DD","\\rightsquigarrow",!0),j(Z,xe,ae,"\u21DD","\\leadsto"),j(Z,xe,ae,"\u21DB","\\Rrightarrow",!0),j(Z,xe,ae,"\u21BE","\\restriction"),j(Z,oe,we,"\u2018","`"),j(Z,oe,we,"$","\\$"),j(tt,oe,we,"$","\\$"),j(tt,oe,we,"$","\\textdollar"),j(Z,oe,we,"%","\\%"),j(tt,oe,we,"%","\\%"),j(Z,oe,we,"_","\\_"),j(tt,oe,we,"_","\\_"),j(tt,oe,we,"_","\\textunderscore"),j(Z,oe,we,"\u2220","\\angle",!0),j(Z,oe,we,"\u221E","\\infty",!0),j(Z,oe,we,"\u2032","\\prime"),j(Z,oe,we,"\u25B3","\\triangle"),j(Z,oe,we,"\u0393","\\Gamma",!0),j(Z,oe,we,"\u0394","\\Delta",!0),j(Z,oe,we,"\u0398","\\Theta",!0),j(Z,oe,we,"\u039B","\\Lambda",!0),j(Z,oe,we,"\u039E","\\Xi",!0),j(Z,oe,we,"\u03A0","\\Pi",!0),j(Z,oe,we,"\u03A3","\\Sigma",!0),j(Z,oe,we,"\u03A5","\\Upsilon",!0),j(Z,oe,we,"\u03A6","\\Phi",!0),j(Z,oe,we,"\u03A8","\\Psi",!0),j(Z,oe,we,"\u03A9","\\Omega",!0),j(Z,oe,we,"A","\u0391"),j(Z,oe,we,"B","\u0392"),j(Z,oe,we,"E","\u0395"),j(Z,oe,we,"Z","\u0396"),j(Z,oe,we,"H","\u0397"),j(Z,oe,we,"I","\u0399"),j(Z,oe,we,"K","\u039A"),j(Z,oe,we,"M","\u039C"),j(Z,oe,we,"N","\u039D"),j(Z,oe,we,"O","\u039F"),j(Z,oe,we,"P","\u03A1"),j(Z,oe,we,"T","\u03A4"),j(Z,oe,we,"X","\u03A7"),j(Z,oe,we,"\xAC","\\neg",!0),j(Z,oe,we,"\xAC","\\lnot"),j(Z,oe,we,"\u22A4","\\top"),j(Z,oe,we,"\u22A5","\\bot"),j(Z,oe,we,"\u2205","\\emptyset"),j(Z,xe,we,"\u2205","\\varnothing"),j(Z,oe,he,"\u03B1","\\alpha",!0),j(Z,oe,he,"\u03B2","\\beta",!0),j(Z,oe,he,"\u03B3","\\gamma",!0),j(Z,oe,he,"\u03B4","\\delta",!0),j(Z,oe,he,"\u03F5","\\epsilon",!0),j(Z,oe,he,"\u03B6","\\zeta",!0),j(Z,oe,he,"\u03B7","\\eta",!0),j(Z,oe,he,"\u03B8","\\theta",!0),j(Z,oe,he,"\u03B9","\\iota",!0),j(Z,oe,he,"\u03BA","\\kappa",!0),j(Z,oe,he,"\u03BB","\\lambda",!0),j(Z,oe,he,"\u03BC","\\mu",!0),j(Z,oe,he,"\u03BD","\\nu",!0),j(Z,oe,he,"\u03BE","\\xi",!0),j(Z,oe,he,"\u03BF","\\omicron",!0),j(Z,oe,he,"\u03C0","\\pi",!0),j(Z,oe,he,"\u03C1","\\rho",!0),j(Z,oe,he,"\u03C3","\\sigma",!0),j(Z,oe,he,"\u03C4","\\tau",!0),j(Z,oe,he,"\u03C5","\\upsilon",!0),j(Z,oe,he,"\u03D5","\\phi",!0),j(Z,oe,he,"\u03C7","\\chi",!0),j(Z,oe,he,"\u03C8","\\psi",!0),j(Z,oe,he,"\u03C9","\\omega",!0),j(Z,oe,he,"\u03B5","\\varepsilon",!0),j(Z,oe,he,"\u03D1","\\vartheta",!0),j(Z,oe,he,"\u03D6","\\varpi",!0),j(Z,oe,he,"\u03F1","\\varrho",!0),j(Z,oe,he,"\u03C2","\\varsigma",!0),j(Z,oe,he,"\u03C6","\\varphi",!0),j(Z,oe,ke,"\u2217","*"),j(Z,oe,ke,"+","+"),j(Z,oe,ke,"\u2212","-"),j(Z,oe,ke,"\u22C5","\\cdot",!0),j(Z,oe,ke,"\u2218","\\circ"),j(Z,oe,ke,"\xF7","\\div",!0),j(Z,oe,ke,"\xB1","\\pm",!0),j(Z,oe,ke,"\xD7","\\times",!0),j(Z,oe,ke,"\u2229","\\cap",!0),j(Z,oe,ke,"\u222A","\\cup",!0),j(Z,oe,ke,"\u2216","\\setminus"),j(Z,oe,ke,"\u2227","\\land"),j(Z,oe,ke,"\u2228","\\lor"),j(Z,oe,ke,"\u2227","\\wedge",!0),j(Z,oe,ke,"\u2228","\\vee",!0),j(Z,oe,we,"\u221A","\\surd"),j(Z,oe,ye,"(","("),j(Z,oe,ye,"[","["),j(Z,oe,ye,"\u27E8","\\langle",!0),j(Z,oe,ye,"\u2223","\\lvert"),j(Z,oe,ye,"\u2225","\\lVert"),j(Z,oe,Pe,")",")"),j(Z,oe,Pe,"]","]"),j(Z,oe,Pe,"?","?"),j(Z,oe,Pe,"!","!"),j(Z,oe,Pe,"\u27E9","\\rangle",!0),j(Z,oe,Pe,"\u2223","\\rvert"),j(Z,oe,Pe,"\u2225","\\rVert"),j(Z,oe,ae,"=","="),j(Z,oe,ae,"<","<"),j(Z,oe,ae,">",">"),j(Z,oe,ae,":",":"),j(Z,oe,ae,"\u2248","\\approx",!0),j(Z,oe,ae,"\u2245","\\cong",!0),j(Z,oe,ae,"\u2265","\\ge"),j(Z,oe,ae,"\u2265","\\geq",!0),j(Z,oe,ae,"\u2190","\\gets"),j(Z,oe,ae,">","\\gt"),j(Z,oe,ae,"\u2208","\\in",!0),j(Z,oe,ae,"\uE020","\\@not"),j(Z,oe,ae,"\u2282","\\subset",!0),j(Z,oe,ae,"\u2283","\\supset",!0),j(Z,oe,ae,"\u2286","\\subseteq",!0),j(Z,oe,ae,"\u2287","\\supseteq",!0),j(Z,xe,ae,"\u2288","\\nsubseteq",!0),j(Z,xe,ae,"\u2289","\\nsupseteq",!0),j(Z,oe,ae,"\u22A8","\\models"),j(Z,oe,ae,"\u2190","\\leftarrow",!0),j(Z,oe,ae,"\u2264","\\le"),j(Z,oe,ae,"\u2264","\\leq",!0),j(Z,oe,ae,"<","\\lt"),j(Z,oe,ae,"\u2192","\\rightarrow",!0),j(Z,oe,ae,"\u2192","\\to"),j(Z,xe,ae,"\u2271","\\ngeq",!0),j(Z,xe,ae,"\u2270","\\nleq",!0),j(Z,oe,_t,"\xA0","\\ "),j(Z,oe,_t,"\xA0","~"),j(Z,oe,_t,"\xA0","\\space"),j(Z,oe,_t,"\xA0","\\nobreakspace"),j(tt,oe,_t,"\xA0","\\ "),j(tt,oe,_t,"\xA0","~"),j(tt,oe,_t,"\xA0","\\space"),j(tt,oe,_t,"\xA0","\\nobreakspace"),j(Z,oe,_t,null,"\\nobreak"),j(Z,oe,_t,null,"\\allowbreak"),j(Z,oe,Ie,",",","),j(Z,oe,Ie,";",";"),j(Z,xe,ke,"\u22BC","\\barwedge",!0),j(Z,xe,ke,"\u22BB","\\veebar",!0),j(Z,oe,ke,"\u2299","\\odot",!0),j(Z,oe,ke,"\u2295","\\oplus",!0),j(Z,oe,ke,"\u2297","\\otimes",!0),j(Z,oe,we,"\u2202","\\partial",!0),j(Z,oe,ke,"\u2298","\\oslash",!0),j(Z,xe,ke,"\u229A","\\circledcirc",!0),j(Z,xe,ke,"\u22A1","\\boxdot",!0),j(Z,oe,ke,"\u25B3","\\bigtriangleup"),j(Z,oe,ke,"\u25BD","\\bigtriangledown"),j(Z,oe,ke,"\u2020","\\dagger"),j(Z,oe,ke,"\u22C4","\\diamond"),j(Z,oe,ke,"\u22C6","\\star"),j(Z,oe,ke,"\u25C3","\\triangleleft"),j(Z,oe,ke,"\u25B9","\\triangleright"),j(Z,oe,ye,"{","\\{"),j(tt,oe,we,"{","\\{"),j(tt,oe,we,"{","\\textbraceleft"),j(Z,oe,Pe,"}","\\}"),j(tt,oe,we,"}","\\}"),j(tt,oe,we,"}","\\textbraceright"),j(Z,oe,ye,"{","\\lbrace"),j(Z,oe,Pe,"}","\\rbrace"),j(Z,oe,ye,"[","\\lbrack"),j(tt,oe,we,"[","\\lbrack"),j(Z,oe,Pe,"]","\\rbrack"),j(tt,oe,we,"]","\\rbrack"),j(Z,oe,ye,"(","\\lparen"),j(Z,oe,Pe,")","\\rparen"),j(tt,oe,we,"<","\\textless"),j(tt,oe,we,">","\\textgreater"),j(Z,oe,ye,"\u230A","\\lfloor",!0),j(Z,oe,Pe,"\u230B","\\rfloor",!0),j(Z,oe,ye,"\u2308","\\lceil",!0),j(Z,oe,Pe,"\u2309","\\rceil",!0),j(Z,oe,we,"\\","\\backslash"),j(Z,oe,we,"\u2223","|"),j(Z,oe,we,"\u2223","\\vert"),j(tt,oe,we,"|","\\textbar"),j(Z,oe,we,"\u2225","\\|"),j(Z,oe,we,"\u2225","\\Vert"),j(tt,oe,we,"\u2225","\\textbardbl"),j(tt,oe,we,"~","\\textasciitilde"),j(tt,oe,we,"\\","\\textbackslash"),j(tt,oe,we,"^","\\textasciicircum"),j(Z,oe,ae,"\u2191","\\uparrow",!0),j(Z,oe,ae,"\u21D1","\\Uparrow",!0),j(Z,oe,ae,"\u2193","\\downarrow",!0),j(Z,oe,ae,"\u21D3","\\Downarrow",!0),j(Z,oe,ae,"\u2195","\\updownarrow",!0),j(Z,oe,ae,"\u21D5","\\Updownarrow",!0),j(Z,oe,ge,"\u2210","\\coprod"),j(Z,oe,ge,"\u22C1","\\bigvee"),j(Z,oe,ge,"\u22C0","\\bigwedge"),j(Z,oe,ge,"\u2A04","\\biguplus"),j(Z,oe,ge,"\u22C2","\\bigcap"),j(Z,oe,ge,"\u22C3","\\bigcup"),j(Z,oe,ge,"\u222B","\\int"),j(Z,oe,ge,"\u222B","\\intop"),j(Z,oe,ge,"\u222C","\\iint"),j(Z,oe,ge,"\u222D","\\iiint"),j(Z,oe,ge,"\u220F","\\prod"),j(Z,oe,ge,"\u2211","\\sum"),j(Z,oe,ge,"\u2A02","\\bigotimes"),j(Z,oe,ge,"\u2A01","\\bigoplus"),j(Z,oe,ge,"\u2A00","\\bigodot"),j(Z,oe,ge,"\u222E","\\oint"),j(Z,oe,ge,"\u222F","\\oiint"),j(Z,oe,ge,"\u2230","\\oiiint"),j(Z,oe,ge,"\u2A06","\\bigsqcup"),j(Z,oe,ge,"\u222B","\\smallint"),j(tt,oe,He,"\u2026","\\textellipsis"),j(Z,oe,He,"\u2026","\\mathellipsis"),j(tt,oe,He,"\u2026","\\ldots",!0),j(Z,oe,He,"\u2026","\\ldots",!0),j(Z,oe,He,"\u22EF","\\@cdots",!0),j(Z,oe,He,"\u22F1","\\ddots",!0),j(Z,oe,we,"\u22EE","\\varvdots"),j(Z,oe,Kt,"\u02CA","\\acute"),j(Z,oe,Kt,"\u02CB","\\grave"),j(Z,oe,Kt,"\xA8","\\ddot"),j(Z,oe,Kt,"~","\\tilde"),j(Z,oe,Kt,"\u02C9","\\bar"),j(Z,oe,Kt,"\u02D8","\\breve"),j(Z,oe,Kt,"\u02C7","\\check"),j(Z,oe,Kt,"^","\\hat"),j(Z,oe,Kt,"\u20D7","\\vec"),j(Z,oe,Kt,"\u02D9","\\dot"),j(Z,oe,Kt,"\u02DA","\\mathring"),j(Z,oe,he,"\u0131","\\imath",!0),j(Z,oe,he,"\u0237","\\jmath",!0),j(tt,oe,we,"\u0131","\\i",!0),j(tt,oe,we,"\u0237","\\j",!0),j(tt,oe,we,"\xDF","\\ss",!0),j(tt,oe,we,"\xE6","\\ae",!0),j(tt,oe,we,"\xE6","\\ae",!0),j(tt,oe,we,"\u0153","\\oe",!0),j(tt,oe,we,"\xF8","\\o",!0),j(tt,oe,we,"\xC6","\\AE",!0),j(tt,oe,we,"\u0152","\\OE",!0),j(tt,oe,we,"\xD8","\\O",!0),j(tt,oe,Kt,"\u02CA","\\'"),j(tt,oe,Kt,"\u02CB","\\`"),j(tt,oe,Kt,"\u02C6","\\^"),j(tt,oe,Kt,"\u02DC","\\~"),j(tt,oe,Kt,"\u02C9","\\="),j(tt,oe,Kt,"\u02D8","\\u"),j(tt,oe,Kt,"\u02D9","\\."),j(tt,oe,Kt,"\u02DA","\\r"),j(tt,oe,Kt,"\u02C7","\\v"),j(tt,oe,Kt,"\xA8",'\\"'),j(tt,oe,Kt,"\u02DD","\\H"),j(tt,oe,Kt,"\u25EF","\\textcircled");var kt={"--":!0,"---":!0,"``":!0,"''":!0};j(tt,oe,we,"\u2013","--"),j(tt,oe,we,"\u2013","\\textendash"),j(tt,oe,we,"\u2014","---"),j(tt,oe,we,"\u2014","\\textemdash"),j(tt,oe,we,"\u2018","`"),j(tt,oe,we,"\u2018","\\textquoteleft"),j(tt,oe,we,"\u2019","'"),j(tt,oe,we,"\u2019","\\textquoteright"),j(tt,oe,we,"\u201C","``"),j(tt,oe,we,"\u201C","\\textquotedblleft"),j(tt,oe,we,"\u201D","''"),j(tt,oe,we,"\u201D","\\textquotedblright"),j(Z,oe,we,"\xB0","\\degree",!0),j(tt,oe,we,"\xB0","\\degree"),j(tt,oe,we,"\xB0","\\textdegree",!0),j(Z,oe,he,"\xA3","\\pounds"),j(Z,oe,he,"\xA3","\\mathsterling",!0),j(tt,oe,he,"\xA3","\\pounds"),j(tt,oe,he,"\xA3","\\textsterling",!0),j(Z,xe,we,"\u2720","\\maltese"),j(tt,xe,we,"\u2720","\\maltese"),j(tt,oe,_t,"\xA0","\\ "),j(tt,oe,_t,"\xA0"," "),j(tt,oe,_t,"\xA0","~");for(var Ft='0123456789/@."',er=0;er<Ft.length;er++){var Vt=Ft.charAt(er);j(Z,oe,we,Vt,Vt)}for(var It='0123456789!@*()-=+[]<>|";:?/.,',Tt=0;Tt<It.length;Tt++){var fr=It.charAt(Tt);j(tt,oe,we,fr,fr)}for(var $r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",zr=0;zr<$r.length;zr++){var Qr=$r.charAt(zr);j(Z,oe,he,Qr,Qr),j(tt,oe,we,Qr,Qr)}j(Z,xe,we,"C","\u2102"),j(tt,xe,we,"C","\u2102"),j(Z,xe,we,"H","\u210D"),j(tt,xe,we,"H","\u210D"),j(Z,xe,we,"N","\u2115"),j(tt,xe,we,"N","\u2115"),j(Z,xe,we,"P","\u2119"),j(tt,xe,we,"P","\u2119"),j(Z,xe,we,"Q","\u211A"),j(tt,xe,we,"Q","\u211A"),j(Z,xe,we,"R","\u211D"),j(tt,xe,we,"R","\u211D"),j(Z,xe,we,"Z","\u2124"),j(tt,xe,we,"Z","\u2124"),j(Z,oe,he,"h","\u210E"),j(tt,oe,he,"h","\u210E");for(var Ot="",Yt=0;Yt<$r.length;Yt++){var wr=$r.charAt(Yt);Ot=String.fromCharCode(55349,56320+Yt),j(Z,oe,he,wr,Ot),j(tt,oe,we,wr,Ot),Ot=String.fromCharCode(55349,56372+Yt),j(Z,oe,he,wr,Ot),j(tt,oe,we,wr,Ot),Ot=String.fromCharCode(55349,56424+Yt),j(Z,oe,he,wr,Ot),j(tt,oe,we,wr,Ot),Ot=String.fromCharCode(55349,56580+Yt),j(Z,oe,he,wr,Ot),j(tt,oe,we,wr,Ot),Ot=String.fromCharCode(55349,56736+Yt),j(Z,oe,he,wr,Ot),j(tt,oe,we,wr,Ot),Ot=String.fromCharCode(55349,56788+Yt),j(Z,oe,he,wr,Ot),j(tt,oe,we,wr,Ot),Ot=String.fromCharCode(55349,56840+Yt),j(Z,oe,he,wr,Ot),j(tt,oe,we,wr,Ot),Ot=String.fromCharCode(55349,56944+Yt),j(Z,oe,he,wr,Ot),j(tt,oe,we,wr,Ot),Yt<26&&(Ot=String.fromCharCode(55349,56632+Yt),j(Z,oe,he,wr,Ot),j(tt,oe,we,wr,Ot),Ot=String.fromCharCode(55349,56476+Yt),j(Z,oe,he,wr,Ot),j(tt,oe,we,wr,Ot))}Ot="\u{1D55C}",j(Z,oe,he,"k",Ot),j(tt,oe,we,"k",Ot);for(var Hr=0;Hr<10;Hr++){var Rr=Hr.toString();Ot=String.fromCharCode(55349,57294+Hr),j(Z,oe,he,Rr,Ot),j(tt,oe,we,Rr,Ot),Ot=String.fromCharCode(55349,57314+Hr),j(Z,oe,he,Rr,Ot),j(tt,oe,we,Rr,Ot),Ot=String.fromCharCode(55349,57324+Hr),j(Z,oe,he,Rr,Ot),j(tt,oe,we,Rr,Ot),Ot=String.fromCharCode(55349,57334+Hr),j(Z,oe,he,Rr,Ot),j(tt,oe,we,Rr,Ot)}for(var di="\xC7\xD0\xDE\xE7\xFE",Er=0;Er<di.length;Er++){var wi=di.charAt(Er);j(Z,oe,he,wi,wi),j(tt,oe,we,wi,wi)}j(tt,oe,we,"\xF0","\xF0"),j(tt,oe,we,"\u2013","\u2013"),j(tt,oe,we,"\u2014","\u2014"),j(tt,oe,we,"\u2018","\u2018"),j(tt,oe,we,"\u2019","\u2019"),j(tt,oe,we,"\u201C","\u201C"),j(tt,oe,we,"\u201D","\u201D");var si=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathdefault","textit","Math-Italic"],["mathdefault","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["","",""],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Ri=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Ht=function(p,v){var y=p.charCodeAt(0),C=p.charCodeAt(1),q=(y-55296)*1024+(C-56320)+65536,ee=v==="math"?0:1;if(119808<=q&&q<120484){var pe=Math.floor((q-119808)/26);return[si[pe][2],si[pe][ee]]}else if(120782<=q&&q<=120831){var ve=Math.floor((q-120782)/10);return[Ri[ve][2],Ri[ve][ee]]}else{if(q===120485||q===120486)return[si[0][2],si[0][ee]];if(120486<q&&q<120782)return["",""];throw new d("Unsupported character: "+p)}},Ut=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],ur=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],pr=function(p,v){return v.size<2?p:Ut[p-1][v.size-1]},sr=function(){function re(v){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=v.style,this.color=v.color,this.size=v.size||re.BASESIZE,this.textSize=v.textSize||this.size,this.phantom=!!v.phantom,this.font=v.font||"",this.fontFamily=v.fontFamily||"",this.fontWeight=v.fontWeight||"",this.fontShape=v.fontShape||"",this.sizeMultiplier=ur[this.size-1],this.maxSize=v.maxSize,this.minRuleThickness=v.minRuleThickness,this._fontMetrics=void 0}var p=re.prototype;return p.extend=function(y){var C={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var q in y)y.hasOwnProperty(q)&&(C[q]=y[q]);return new re(C)},p.havingStyle=function(y){return this.style===y?this:this.extend({style:y,size:pr(this.textSize,y)})},p.havingCrampedStyle=function(){return this.havingStyle(this.style.cramp())},p.havingSize=function(y){return this.size===y&&this.textSize===y?this:this.extend({style:this.style.text(),size:y,textSize:y,sizeMultiplier:ur[y-1]})},p.havingBaseStyle=function(y){y=y||this.style.text();var C=pr(re.BASESIZE,y);return this.size===C&&this.textSize===re.BASESIZE&&this.style===y?this:this.extend({style:y,size:C})},p.havingBaseSizing=function(){var y;switch(this.style.id){case 4:case 5:y=3;break;case 6:case 7:y=1;break;default:y=6}return this.extend({style:this.style.text(),size:y})},p.withColor=function(y){return this.extend({color:y})},p.withPhantom=function(){return this.extend({phantom:!0})},p.withFont=function(y){return this.extend({font:y})},p.withTextFontFamily=function(y){return this.extend({fontFamily:y,font:""})},p.withTextFontWeight=function(y){return this.extend({fontWeight:y,font:""})},p.withTextFontShape=function(y){return this.extend({fontShape:y,font:""})},p.sizingClasses=function(y){return y.size!==this.size?["sizing","reset-size"+y.size,"size"+this.size]:[]},p.baseSizingClasses=function(){return this.size!==re.BASESIZE?["sizing","reset-size"+this.size,"size"+re.BASESIZE]:[]},p.fontMetrics=function(){return this._fontMetrics||(this._fontMetrics=xt(this.size)),this._fontMetrics},p.getColor=function(){return this.phantom?"transparent":this.color},re}();sr.BASESIZE=6;var gi=sr,kr={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},ui={ex:!0,em:!0,mu:!0},Br=function(p){return typeof p!="string"&&(p=p.unit),p in kr||p in ui||p==="ex"},mr=function(p,v){var y;if(p.unit in kr)y=kr[p.unit]/v.fontMetrics().ptPerEm/v.sizeMultiplier;else if(p.unit==="mu")y=v.fontMetrics().cssEmPerMu;else{var C;if(v.style.isTight()?C=v.havingStyle(v.style.text()):C=v,p.unit==="ex")y=C.fontMetrics().xHeight;else if(p.unit==="em")y=C.fontMetrics().quad;else throw new d("Invalid unit: '"+p.unit+"'");C!==v&&(y*=C.sizeMultiplier/v.sizeMultiplier)}return Math.min(p.number*y,v.maxSize)},jr=["\\imath","\u0131","\\jmath","\u0237","\\pounds","\\mathsterling","\\textsterling","\xA3"],ai=function(p,v,y){return Nt[y][p]&&Nt[y][p].replace&&(p=Nt[y][p].replace),{value:p,metrics:gt(p,v,y)}},Gr=function(p,v,y,C,q){var ee=ai(p,v,y),pe=ee.metrics;p=ee.value;var ve;if(pe){var Ce=pe.italic;(y==="text"||C&&C.font==="mathit")&&(Ce=0),ve=new be(p,pe.height,pe.depth,Ce,pe.skew,pe.width,q)}else typeof console!="undefined"&&console.warn("No character metrics "+("for '"+p+"' in style '"+v+"' and mode '"+y+"'")),ve=new be(p,0,0,0,0,0,q);if(C){ve.maxFontSize=C.sizeMultiplier,C.style.isTight()&&ve.classes.push("mtight");var $e=C.getColor();$e&&(ve.style.color=$e)}return ve},pi=function(p,v,y,C){return C===void 0&&(C=[]),y.font==="boldsymbol"&&ai(p,"Main-Bold",v).metrics?Gr(p,"Main-Bold",v,y,C.concat(["mathbf"])):p==="\\"||Nt[v][p].font==="main"?Gr(p,"Main-Regular",v,y,C):Gr(p,"AMS-Regular",v,y,C.concat(["amsrm"]))},cr=function(p,v,y,C){return/[0-9]/.test(p.charAt(0))||k.contains(jr,p)?{fontName:"Main-Italic",fontClass:"mathit"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},Cr=function(p,v,y,C){return k.contains(jr,p)?{fontName:"Main-Italic",fontClass:"mathit"}:/[0-9]/.test(p.charAt(0))?{fontName:"Caligraphic-Regular",fontClass:"mathcal"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},yr=function(p,v,y,C){return ai(p,"Math-BoldItalic",v).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},Tr=function(p,v,y){var C=p.mode,q=p.text,ee=["mord"],pe=C==="math"||C==="text"&&v.font,ve=pe?v.font:v.fontFamily;if(q.charCodeAt(0)===55349){var Ce=Ht(q,C),$e=Ce[0],Ye=Ce[1];return Gr(q,$e,C,v,ee.concat(Ye))}else if(ve){var lt,dt;if(ve==="boldsymbol"||ve==="mathnormal"){var bt=ve==="boldsymbol"?yr(q,C,v,ee):Cr(q,C,v,ee);lt=bt.fontName,dt=[bt.fontClass]}else k.contains(jr,q)?(lt="Main-Italic",dt=["mathit"]):pe?(lt=Xi[ve].fontName,dt=[ve]):(lt=on(ve,v.fontWeight,v.fontShape),dt=[ve,v.fontWeight,v.fontShape]);if(ai(q,lt,C).metrics)return Gr(q,lt,C,v,ee.concat(dt));if(kt.hasOwnProperty(q)&<.substr(0,10)==="Typewriter"){for(var Rt=[],Be=0;Be<q.length;Be++)Rt.push(Gr(q[Be],lt,C,v,ee.concat(dt)));return ji(Rt)}}if(y==="mathord"){var ar=cr(q,C,v,ee);return Gr(q,ar.fontName,C,v,ee.concat([ar.fontClass]))}else if(y==="textord"){var or=Nt[C][q]&&Nt[C][q].font;if(or==="ams"){var dr=on("amsrm",v.fontWeight,v.fontShape);return Gr(q,dr,C,v,ee.concat("amsrm",v.fontWeight,v.fontShape))}else if(or==="main"||!or){var Ir=on("textrm",v.fontWeight,v.fontShape);return Gr(q,Ir,C,v,ee.concat(v.fontWeight,v.fontShape))}else{var Nr=on(or,v.fontWeight,v.fontShape);return Gr(q,Nr,C,v,ee.concat(Nr,v.fontWeight,v.fontShape))}}else throw new Error("unexpected type: "+y+" in makeOrd")},ci=function(p,v){if(zt(p.classes)!==zt(v.classes)||p.skew!==v.skew||p.maxFontSize!==v.maxFontSize)return!1;for(var y in p.style)if(p.style.hasOwnProperty(y)&&p.style[y]!==v.style[y])return!1;for(var C in v.style)if(v.style.hasOwnProperty(C)&&p.style[C]!==v.style[C])return!1;return!0},oi=function(p){for(var v=0;v<p.length-1;v++){var y=p[v],C=p[v+1];y instanceof be&&C instanceof be&&ci(y,C)&&(y.text+=C.text,y.height=Math.max(y.height,C.height),y.depth=Math.max(y.depth,C.depth),y.italic=C.italic,p.splice(v+1,1),v--)}return p},Mi=function(p){for(var v=0,y=0,C=0,q=0;q<p.children.length;q++){var ee=p.children[q];ee.height>v&&(v=ee.height),ee.depth>y&&(y=ee.depth),ee.maxFontSize>C&&(C=ee.maxFontSize)}p.height=v,p.depth=y,p.maxFontSize=C},hr=function(p,v,y,C){var q=new Ue(p,v,y,C);return Mi(q),q},Ar=function(p,v,y,C){return new Ue(p,v,y,C)},ki=function(p,v,y){var C=hr([p],[],v);return C.height=Math.max(y||v.fontMetrics().defaultRuleThickness,v.minRuleThickness),C.style.borderBottomWidth=C.height+"em",C.maxFontSize=1,C},Fi=function(p,v,y,C){var q=new ot(p,v,y,C);return Mi(q),q},ji=function(p){var v=new Bt(p);return Mi(v),v},In=function(p,v){return p instanceof Bt?hr([],[p],v):p},Zi=function(p){if(p.positionType==="individualShift"){for(var v=p.children,y=[v[0]],C=-v[0].shift-v[0].elem.depth,q=C,ee=1;ee<v.length;ee++){var pe=-v[ee].shift-q-v[ee].elem.depth,ve=pe-(v[ee-1].elem.height+v[ee-1].elem.depth);q=q+pe,y.push({type:"kern",size:ve}),y.push(v[ee])}return{children:y,depth:C}}var Ce;if(p.positionType==="top"){for(var $e=p.positionData,Ye=0;Ye<p.children.length;Ye++){var lt=p.children[Ye];$e-=lt.type==="kern"?lt.size:lt.elem.height+lt.elem.depth}Ce=$e}else if(p.positionType==="bottom")Ce=-p.positionData;else{var dt=p.children[0];if(dt.type!=="elem")throw new Error('First child must have type "elem".');if(p.positionType==="shift")Ce=-dt.elem.depth-p.positionData;else if(p.positionType==="firstBaseline")Ce=-dt.elem.depth;else throw new Error("Invalid positionType "+p.positionType+".")}return{children:p.children,depth:Ce}},Sn=function(p,v){for(var y=Zi(p),C=y.children,q=y.depth,ee=0,pe=0;pe<C.length;pe++){var ve=C[pe];if(ve.type==="elem"){var Ce=ve.elem;ee=Math.max(ee,Ce.maxFontSize,Ce.height)}}ee+=2;var $e=hr(["pstrut"],[]);$e.style.height=ee+"em";for(var Ye=[],lt=q,dt=q,bt=q,Rt=0;Rt<C.length;Rt++){var Be=C[Rt];if(Be.type==="kern")bt+=Be.size;else{var ar=Be.elem,or=Be.wrapperClasses||[],dr=Be.wrapperStyle||{},Ir=hr(or,[$e,ar],void 0,dr);Ir.style.top=-ee-bt-ar.depth+"em",Be.marginLeft&&(Ir.style.marginLeft=Be.marginLeft),Be.marginRight&&(Ir.style.marginRight=Be.marginRight),Ye.push(Ir),bt+=ar.height+ar.depth}lt=Math.min(lt,bt),dt=Math.max(dt,bt)}var Nr=hr(["vlist"],Ye);Nr.style.height=dt+"em";var Yr;if(lt<0){var Zr=hr([],[]),ri=hr(["vlist"],[Zr]);ri.style.height=-lt+"em";var Ei=hr(["vlist-s"],[new be("\u200B")]);Yr=[hr(["vlist-r"],[Nr,Ei]),hr(["vlist-r"],[ri])]}else Yr=[hr(["vlist-r"],[Nr])];var ii=hr(["vlist-t"],Yr);return Yr.length===2&&ii.classes.push("vlist-t2"),ii.height=dt,ii.depth=-lt,ii},mi=function(p,v){var y=hr(["mspace"],[],v),C=mr(p,v);return y.style.marginRight=C+"em",y},on=function(p,v,y){var C="";switch(p){case"amsrm":C="AMS";break;case"textrm":C="Main";break;case"textsf":C="SansSerif";break;case"texttt":C="Typewriter";break;default:C=p}var q;return v==="textbf"&&y==="textit"?q="BoldItalic":v==="textbf"?q="Bold":v==="textit"?q="Italic":q="Regular",C+"-"+q},Xi={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},ln={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Xr=function(p,v){var y=ln[p],C=y[0],q=y[1],ee=y[2],pe=new Ae(C),ve=new De([pe],{width:q+"em",height:ee+"em",style:"width:"+q+"em",viewBox:"0 0 "+1e3*q+" "+1e3*ee,preserveAspectRatio:"xMinYMin"}),Ce=Ar(["overlay"],[ve],v);return Ce.height=ee,Ce.style.height=ee+"em",Ce.style.width=q+"em",Ce},et={fontMap:Xi,makeSymbol:Gr,mathsym:pi,makeSpan:hr,makeSvgSpan:Ar,makeLineSpan:ki,makeAnchor:Fi,makeFragment:ji,wrapFragment:In,makeVList:Sn,makeOrd:Tr,makeGlue:mi,staticSvg:Xr,svgData:ln,tryCombineChars:oi};function rr(re,p){var v=Mr(re,p);if(!v)throw new Error("Expected node of type "+p+", but got "+(re?"node of type "+re.type:String(re)));return v}function Mr(re,p){return re&&re.type===p?re:null}function Fr(re,p){var v=En(re,p);if(!v)throw new Error('Expected node of type "atom" and family "'+p+'", but got '+(re?re.type==="atom"?"atom of family "+re.family:"node of type "+re.type:String(re)));return v}function En(re,p){return re&&re.type==="atom"&&re.family===p?re:null}function Wi(re){var p=Ai(re);if(!p)throw new Error("Expected node of symbol group type, but got "+(re?"node of type "+re.type:String(re)));return p}function Ai(re){return re&&(re.type==="atom"||yt.hasOwnProperty(re.type))?re:null}var gr={number:3,unit:"mu"},Ci={number:4,unit:"mu"},Ii={number:5,unit:"mu"},hi={mord:{mop:gr,mbin:Ci,mrel:Ii,minner:gr},mop:{mord:gr,mop:gr,mrel:Ii,minner:gr},mbin:{mord:Ci,mop:Ci,mopen:Ci,minner:Ci},mrel:{mord:Ii,mop:Ii,mopen:Ii,minner:Ii},mopen:{},mclose:{mop:gr,mbin:Ci,mrel:Ii,minner:gr},mpunct:{mord:gr,mop:gr,mrel:Ii,mopen:gr,mclose:gr,mpunct:gr,minner:gr},minner:{mord:gr,mop:gr,mbin:Ci,mrel:Ii,mopen:gr,mpunct:gr,minner:gr}},Wn={mord:{mop:gr},mop:{mord:gr,mop:gr},mbin:{},mrel:{},mopen:{},mclose:{mop:gr},mpunct:{},minner:{mop:gr}},Gn={},un={},Gi={};function jt(re){for(var p=re.type,v=re.names,y=re.props,C=re.handler,q=re.htmlBuilder,ee=re.mathmlBuilder,pe={type:p,numArgs:y.numArgs,argTypes:y.argTypes,greediness:y.greediness===void 0?1:y.greediness,allowedInText:!!y.allowedInText,allowedInMath:y.allowedInMath===void 0?!0:y.allowedInMath,numOptionalArgs:y.numOptionalArgs||0,infix:!!y.infix,handler:C},ve=0;ve<v.length;++ve)Gn[v[ve]]=pe;p&&(q&&(un[p]=q),ee&&(Gi[p]=ee))}function Bi(re){var p=re.type,v=re.htmlBuilder,y=re.mathmlBuilder;jt({type:p,names:[],props:{numArgs:0},handler:function(){throw new Error("Should never be called.")},htmlBuilder:v,mathmlBuilder:y})}var Jr=function(p){var v=Mr(p,"ordgroup");return v?v.body:[p]},_i=et.makeSpan,Kn=["leftmost","mbin","mopen","mrel","mop","mpunct"],bi=["rightmost","mrel","mclose","mpunct"],Ni={display:M.DISPLAY,text:M.TEXT,script:M.SCRIPT,scriptscript:M.SCRIPTSCRIPT},Ki={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Kr=function(p,v,y,C){C===void 0&&(C=[null,null]);for(var q=[],ee=0;ee<p.length;ee++){var pe=br(p[ee],v);if(pe instanceof Bt){var ve=pe.children;q.push.apply(q,ve)}else q.push(pe)}if(!y)return q;var Ce=v;if(p.length===1){var $e=Mr(p[0],"sizing")||Mr(p[0],"styling");$e&&($e.type==="sizing"?Ce=v.havingSize($e.size):$e.type==="styling"&&(Ce=v.havingStyle(Ni[$e.style])))}var Ye=_i([C[0]||"leftmost"],[],v),lt=_i([C[1]||"rightmost"],[],v);return Qi(q,function(dt,bt){var Rt=bt.classes[0],Be=dt.classes[0];Rt==="mbin"&&k.contains(bi,Be)?bt.classes[0]="mord":Be==="mbin"&&k.contains(Kn,Rt)&&(dt.classes[0]="mord")},{node:Ye},lt),Qi(q,function(dt,bt){var Rt=Ui(bt),Be=Ui(dt),ar=Rt&&Be?dt.hasClass("mtight")?Wn[Rt][Be]:hi[Rt][Be]:null;if(ar)return et.makeGlue(ar,Ce)},{node:Ye},lt),q},Qi=function re(p,v,y,C){C&&p.push(C);for(var q=0;q<p.length;q++){var ee=p[q],pe=tr(ee);if(pe){re(pe.children,v,y);continue}if(ee.classes[0]!=="mspace"){var ve=v(ee,y.node);ve&&(y.insertAfter?y.insertAfter(ve):(p.unshift(ve),q++)),y.node=ee,y.insertAfter=function(Ce){return function($e){p.splice(Ce+1,0,$e),q++}}(q)}}C&&p.pop()},tr=function(p){return p instanceof Bt||p instanceof ot?p:null},On=function re(p,v){var y=tr(p);if(y){var C=y.children;if(C.length){if(v==="right")return re(C[C.length-1],"right");if(v==="left")return re(C[0],"left")}}return p},Ui=function(p,v){return p?(v&&(p=On(p,v)),Ki[p.classes[0]]||null):null},Si=function(p,v){var y=["nulldelimiter"].concat(p.baseSizingClasses());return _i(v.concat(y))},br=function(p,v,y){if(!p)return _i();if(un[p.type]){var C=un[p.type](p,v);if(y&&v.size!==y.size){C=_i(v.sizingClasses(y),[C],v);var q=v.sizeMultiplier/y.sizeMultiplier;C.height*=q,C.depth*=q}return C}else throw new d("Got group of unknown type: '"+p.type+"'")};function xn(re,p){var v=_i(["base"],re,p),y=_i(["strut"]);return y.style.height=v.height+v.depth+"em",y.style.verticalAlign=-v.depth+"em",v.children.unshift(y),v}function Pn(re,p){var v=null;re.length===1&&re[0].type==="tag"&&(v=re[0].tag,re=re[0].body);for(var y=Kr(re,p,!0),C=[],q=[],ee=0;ee<y.length;ee++)if(q.push(y[ee]),y[ee].hasClass("mbin")||y[ee].hasClass("mrel")||y[ee].hasClass("allowbreak")){for(var pe=!1;ee<y.length-1&&y[ee+1].hasClass("mspace")&&!y[ee+1].hasClass("newline");)ee++,q.push(y[ee]),y[ee].hasClass("nobreak")&&(pe=!0);pe||(C.push(xn(q,p)),q=[])}else y[ee].hasClass("newline")&&(q.pop(),q.length>0&&(C.push(xn(q,p)),q=[]),C.push(y[ee]));q.length>0&&C.push(xn(q,p));var ve;v&&(ve=xn(Kr(v,p,!0)),ve.classes=["tag"],C.push(ve));var Ce=_i(["katex-html"],C);if(Ce.setAttribute("aria-hidden","true"),ve){var $e=ve.children[0];$e.style.height=Ce.height+Ce.depth+"em",$e.style.verticalAlign=-Ce.depth+"em"}return Ce}function wn(re){return new Bt(re)}var _r=function(){function re(v,y){this.type=void 0,this.attributes=void 0,this.children=void 0,this.type=v,this.attributes={},this.children=y||[]}var p=re.prototype;return p.setAttribute=function(y,C){this.attributes[y]=C},p.getAttribute=function(y){return this.attributes[y]},p.toNode=function(){var y=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var C in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,C)&&y.setAttribute(C,this.attributes[C]);for(var q=0;q<this.children.length;q++)y.appendChild(this.children[q].toNode());return y},p.toMarkup=function(){var y="<"+this.type;for(var C in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,C)&&(y+=" "+C+'="',y+=k.escape(this.attributes[C]),y+='"');y+=">";for(var q=0;q<this.children.length;q++)y+=this.children[q].toMarkup();return y+="</"+this.type+">",y},p.toText=function(){return this.children.map(function(y){return y.toText()}).join("")},re}(),cn=function(){function re(v){this.text=void 0,this.text=v}var p=re.prototype;return p.toNode=function(){return document.createTextNode(this.text)},p.toMarkup=function(){return k.escape(this.toText())},p.toText=function(){return this.text},re}(),ts=function(){function re(v){this.width=void 0,this.character=void 0,this.width=v,v>=.05555&&v<=.05556?this.character="\u200A":v>=.1666&&v<=.1667?this.character="\u2009":v>=.2222&&v<=.2223?this.character="\u2005":v>=.2777&&v<=.2778?this.character="\u2005\u200A":v>=-.05556&&v<=-.05555?this.character="\u200A\u2063":v>=-.1667&&v<=-.1666?this.character="\u2009\u2063":v>=-.2223&&v<=-.2222?this.character="\u205F\u2063":v>=-.2778&&v<=-.2777?this.character="\u2005\u2063":this.character=null}var p=re.prototype;return p.toNode=function(){if(this.character)return document.createTextNode(this.character);var y=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return y.setAttribute("width",this.width+"em"),y},p.toMarkup=function(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+this.width+'em"/>'},p.toText=function(){return this.character?this.character:" "},re}(),wt={MathNode:_r,TextNode:cn,SpaceNode:ts,newDocumentFragment:wn},vi=function(p,v,y){return Nt[v][p]&&Nt[v][p].replace&&p.charCodeAt(0)!==55349&&!(kt.hasOwnProperty(p)&&y&&(y.fontFamily&&y.fontFamily.substr(4,2)==="tt"||y.font&&y.font.substr(4,2)==="tt"))&&(p=Nt[v][p].replace),new wt.TextNode(p)},Mn=function(p){return p.length===1?p[0]:new wt.MathNode("mrow",p)},An=function(p,v){if(v.fontFamily==="texttt")return"monospace";if(v.fontFamily==="textsf")return v.fontShape==="textit"&&v.fontWeight==="textbf"?"sans-serif-bold-italic":v.fontShape==="textit"?"sans-serif-italic":v.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(v.fontShape==="textit"&&v.fontWeight==="textbf")return"bold-italic";if(v.fontShape==="textit")return"italic";if(v.fontWeight==="textbf")return"bold";var y=v.font;if(!y||y==="mathnormal")return null;var C=p.mode;if(y==="mathit")return"italic";if(y==="boldsymbol")return"bold-italic";if(y==="mathbf")return"bold";if(y==="mathbb")return"double-struck";if(y==="mathfrak")return"fraktur";if(y==="mathscr"||y==="mathcal")return"script";if(y==="mathsf")return"sans-serif";if(y==="mathtt")return"monospace";var q=p.text;if(k.contains(["\\imath","\\jmath"],q))return null;Nt[C][q]&&Nt[C][q].replace&&(q=Nt[C][q].replace);var ee=et.fontMap[y].fontName;return gt(q,ee,C)?et.fontMap[y].variant:null},li=function(p,v,y){if(p.length===1){var C=Dr(p[0],v);return y&&C instanceof _r&&C.type==="mo"&&(C.setAttribute("lspace","0em"),C.setAttribute("rspace","0em")),[C]}for(var q=[],ee,pe=0;pe<p.length;pe++){var ve=Dr(p[pe],v);if(ve instanceof _r&&ee instanceof _r){if(ve.type==="mtext"&&ee.type==="mtext"&&ve.getAttribute("mathvariant")===ee.getAttribute("mathvariant")){var Ce;(Ce=ee.children).push.apply(Ce,ve.children);continue}else if(ve.type==="mn"&&ee.type==="mn"){var $e;($e=ee.children).push.apply($e,ve.children);continue}else if(ve.type==="mi"&&ve.children.length===1&&ee.type==="mn"){var Ye=ve.children[0];if(Ye instanceof cn&&Ye.text==="."){var lt;(lt=ee.children).push.apply(lt,ve.children);continue}}else if(ee.type==="mi"&&ee.children.length===1){var dt=ee.children[0];if(dt instanceof cn&&dt.text==="\u0338"&&(ve.type==="mo"||ve.type==="mi"||ve.type==="mn")){var bt=ve.children[0];bt instanceof cn&&bt.text.length>0&&(bt.text=bt.text.slice(0,1)+"\u0338"+bt.text.slice(1),q.pop())}}}q.push(ve),ee=ve}return q},ei=function(p,v,y){return Mn(li(p,v,y))},Dr=function(p,v){if(!p)return new wt.MathNode("mrow");if(Gi[p.type]){var y=Gi[p.type](p,v);return y}else throw new d("Got group of unknown type: '"+p.type+"'")};function Ti(re,p,v,y){var C=li(re,v),q;C.length===1&&C[0]instanceof _r&&k.contains(["mrow","mtable"],C[0].type)?q=C[0]:q=new wt.MathNode("mrow",C);var ee=new wt.MathNode("annotation",[new wt.TextNode(p)]);ee.setAttribute("encoding","application/x-tex");var pe=new wt.MathNode("semantics",[q,ee]),ve=new wt.MathNode("math",[pe]);ve.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML");var Ce=y?"katex":"katex-mathml";return et.makeSpan([Ce],[ve])}var Ji=function(p){return new gi({style:p.displayMode?M.DISPLAY:M.TEXT,maxSize:p.maxSize,minRuleThickness:p.minRuleThickness})},hn=function(p,v){if(v.displayMode){var y=["katex-display"];v.leqno&&y.push("leqno"),v.fleqn&&y.push("fleqn"),p=et.makeSpan(y,[p])}return p},fn=function(p,v,y){var C=Ji(y),q;if(y.output==="mathml")return Ti(p,v,C,!0);if(y.output==="html"){var ee=Pn(p,C);q=et.makeSpan(["katex"],[ee])}else{var pe=Ti(p,v,C,!1),ve=Pn(p,C);q=et.makeSpan(["katex"],[pe,ve])}return hn(q,y)},en=function(p,v,y){var C=Ji(y),q=Pn(p,C),ee=et.makeSpan(["katex"],[q]);return hn(ee,y)},xr=fn,fi={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xrightleftarrows:"\u21C4",xrightequilibrium:"\u21CC",xleftequilibrium:"\u21CB"},Fn=function(p){var v=new wt.MathNode("mo",[new wt.TextNode(fi[p.substr(1)])]);return v.setAttribute("stretchy","true"),v},Cn={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Bn=function(p){return p.type==="ordgroup"?p.body.length:1},Nn=function(p,v){function y(){var ve=4e5,Ce=p.label.substr(1);if(k.contains(["widehat","widecheck","widetilde","utilde"],Ce)){var $e=p,Ye=Bn($e.base),lt,dt,bt;if(Ye>5)Ce==="widehat"||Ce==="widecheck"?(lt=420,ve=2364,bt=.42,dt=Ce+"4"):(lt=312,ve=2340,bt=.34,dt="tilde4");else{var Rt=[1,1,2,2,3,3][Ye];Ce==="widehat"||Ce==="widecheck"?(ve=[0,1062,2364,2364,2364][Rt],lt=[0,239,300,360,420][Rt],bt=[0,.24,.3,.3,.36,.42][Rt],dt=Ce+Rt):(ve=[0,600,1033,2339,2340][Rt],lt=[0,260,286,306,312][Rt],bt=[0,.26,.286,.3,.306,.34][Rt],dt="tilde"+Rt)}var Be=new Ae(dt),ar=new De([Be],{width:"100%",height:bt+"em",viewBox:"0 0 "+ve+" "+lt,preserveAspectRatio:"none"});return{span:et.makeSvgSpan([],[ar],v),minWidth:0,height:bt}}else{var or=[],dr=Cn[Ce],Ir=dr[0],Nr=dr[1],Yr=dr[2],Zr=Yr/1e3,ri=Ir.length,Ei,ii;if(ri===1){var Or=dr[3];Ei=["hide-tail"],ii=[Or]}else if(ri===2)Ei=["halfarrow-left","halfarrow-right"],ii=["xMinYMin","xMaxYMin"];else if(ri===3)Ei=["brace-left","brace-center","brace-right"],ii=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
|
`+ri+" children.");for(var Oi=0;Oi<ri;Oi++){var Yi=new Ae(Ir[Oi]),ni=new De([Yi],{width:"400em",height:Zr+"em",viewBox:"0 0 "+ve+" "+Yr,preserveAspectRatio:ii[Oi]+" slice"}),xi=et.makeSvgSpan([Ei[Oi]],[ni],v);if(ri===1)return{span:xi,minWidth:Nr,height:Zr};xi.style.height=Zr+"em",or.push(xi)}return{span:et.makeSpan(["stretchy"],or,v),minWidth:Nr,height:Zr}}}var C=y(),q=C.span,ee=C.minWidth,pe=C.height;return q.height=pe,q.style.height=pe+"em",ee>0&&(q.style.minWidth=ee+"em"),q},Wt=function(p,v,y,C){var q,ee=p.height+p.depth+2*y;if(/fbox|color/.test(v)){if(q=et.makeSpan(["stretchy",v],[],C),v==="fbox"){var pe=C.color&&C.getColor();pe&&(q.style.borderColor=pe)}}else{var ve=[];/^[bx]cancel$/.test(v)&&ve.push(new Ne({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(v)&&ve.push(new Ne({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var Ce=new De(ve,{width:"100%",height:ee+"em"});q=et.makeSvgSpan([],[Ce],C)}return q.height=ee,q.style.height=ee+"em",q},Zt={encloseSpan:Wt,mathMLnode:Fn,svgSpan:Nn},Wr=function(p,v){var y,C,q=Mr(p,"supsub"),ee;q?(C=rr(q.base,"accent"),y=C.base,q.base=y,ee=Qe(br(q,v)),q.base=C):(C=rr(p,"accent"),y=C.base);var pe=br(y,v.havingCrampedStyle()),ve=C.isShifty&&k.isCharacterBox(y),Ce=0;if(ve){var $e=k.getBaseElem(y),Ye=br($e,v.havingCrampedStyle());Ce=je(Ye).skew}var lt=Math.min(pe.height,v.fontMetrics().xHeight),dt;if(C.isStretchy)dt=Zt.svgSpan(C,v),dt=et.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:pe},{type:"elem",elem:dt,wrapperClasses:["svg-align"],wrapperStyle:Ce>0?{width:"calc(100% - "+2*Ce+"em)",marginLeft:2*Ce+"em"}:void 0}]},v);else{var bt,Rt;C.label==="\\vec"?(bt=et.staticSvg("vec",v),Rt=et.svgData.vec[1]):(bt=et.makeOrd({mode:C.mode,text:C.label},v,"textord"),bt=je(bt),bt.italic=0,Rt=bt.width),dt=et.makeSpan(["accent-body"],[bt]);var Be=C.label==="\\textcircled";Be&&(dt.classes.push("accent-full"),lt=pe.height);var ar=Ce;Be||(ar-=Rt/2),dt.style.left=ar+"em",C.label==="\\textcircled"&&(dt.style.top=".2em"),dt=et.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:pe},{type:"kern",size:-lt},{type:"elem",elem:dt}]},v)}var or=et.makeSpan(["mord","accent"],[dt],v);return ee?(ee.children[0]=or,ee.height=Math.max(or.height,ee.height),ee.classes[0]="mord",ee):or},ti=function(p,v){var y=p.isStretchy?Zt.mathMLnode(p.label):new wt.MathNode("mo",[vi(p.label,p.mode)]),C=new wt.MathNode("mover",[Dr(p.base,v),y]);return C.setAttribute("accent","true"),C},qr=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(function(re){return"\\"+re}).join("|"));jt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:function(p,v){var y=v[0],C=!qr.test(p.funcName),q=!C||p.funcName==="\\widehat"||p.funcName==="\\widetilde"||p.funcName==="\\widecheck";return{type:"accent",mode:p.parser.mode,label:p.funcName,isStretchy:C,isShifty:q,base:y}},htmlBuilder:Wr,mathmlBuilder:ti}),jt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!1},handler:function(p,v){var y=v[0];return{type:"accent",mode:p.parser.mode,label:p.funcName,isStretchy:!1,isShifty:!0,base:y}},htmlBuilder:Wr,mathmlBuilder:ti}),jt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(p,v){var y=p.parser,C=p.funcName,q=v[0];return{type:"accentUnder",mode:y.mode,label:C,base:q}},htmlBuilder:function(p,v){var y=br(p.base,v),C=Zt.svgSpan(p,v),q=p.label==="\\utilde"?.12:0,ee=et.makeVList({positionType:"bottom",positionData:C.height+q,children:[{type:"elem",elem:C,wrapperClasses:["svg-align"]},{type:"kern",size:q},{type:"elem",elem:y}]},v);return et.makeSpan(["mord","accentunder"],[ee],v)},mathmlBuilder:function(p,v){var y=Zt.mathMLnode(p.label),C=new wt.MathNode("munder",[Dr(p.base,v),y]);return C.setAttribute("accentunder","true"),C}});var tn=function(p){var v=new wt.MathNode("mpadded",p?[p]:[]);return v.setAttribute("width","+0.6em"),v.setAttribute("lspace","0.3em"),v};jt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium"],props:{numArgs:1,numOptionalArgs:1},handler:function(p,v,y){var C=p.parser,q=p.funcName;return{type:"xArrow",mode:C.mode,label:q,body:v[0],below:y[0]}},htmlBuilder:function(p,v){var y=v.style,C=v.havingStyle(y.sup()),q=et.wrapFragment(br(p.body,C,v),v);q.classes.push("x-arrow-pad");var ee;p.below&&(C=v.havingStyle(y.sub()),ee=et.wrapFragment(br(p.below,C,v),v),ee.classes.push("x-arrow-pad"));var pe=Zt.svgSpan(p,v),ve=-v.fontMetrics().axisHeight+.5*pe.height,Ce=-v.fontMetrics().axisHeight-.5*pe.height-.111;(q.depth>.25||p.label==="\\xleftequilibrium")&&(Ce-=q.depth);var $e;if(ee){var Ye=-v.fontMetrics().axisHeight+ee.height+.5*pe.height+.111;$e=et.makeVList({positionType:"individualShift",children:[{type:"elem",elem:q,shift:Ce},{type:"elem",elem:pe,shift:ve},{type:"elem",elem:ee,shift:Ye}]},v)}else $e=et.makeVList({positionType:"individualShift",children:[{type:"elem",elem:q,shift:Ce},{type:"elem",elem:pe,shift:ve}]},v);return $e.children[0].children[0].children[1].classes.push("svg-align"),et.makeSpan(["mrel","x-arrow"],[$e],v)},mathmlBuilder:function(p,v){var y=Zt.mathMLnode(p.label),C;if(p.body){var q=tn(Dr(p.body,v));if(p.below){var ee=tn(Dr(p.below,v));C=new wt.MathNode("munderover",[y,ee,q])}else C=new wt.MathNode("mover",[y,q])}else if(p.below){var pe=tn(Dr(p.below,v));C=new wt.MathNode("munder",[y,pe])}else C=tn(),C=new wt.MathNode("mover",[y,C]);return C}}),jt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){for(var y=p.parser,C=rr(v[0],"ordgroup"),q=C.body,ee="",pe=0;pe<q.length;pe++){var ve=rr(q[pe],"textord");ee+=ve.text}var Ce=parseInt(ee);if(isNaN(Ce))throw new d("\\@char has non-numeric argument "+ee);return{type:"textord",mode:y.mode,text:String.fromCharCode(Ce)}}});var dn=function(p,v){var y=Kr(p.body,v.withColor(p.color),!1);return et.makeFragment(y)},pn=function(p,v){var y=li(p.body,v.withColor(p.color)),C=new wt.MathNode("mstyle",y);return C.setAttribute("mathcolor",p.color),C};jt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","original"]},handler:function(p,v){var y=p.parser,C=rr(v[0],"color-token").color,q=v[1];return{type:"color",mode:y.mode,color:C,body:Jr(q)}},htmlBuilder:dn,mathmlBuilder:pn}),jt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,greediness:3,argTypes:["color"]},handler:function(p,v){var y=p.parser,C=p.breakOnTokenText,q=rr(v[0],"color-token").color;y.gullet.macros.set("\\current@color",q);var ee=y.parseExpression(!0,C);return{type:"color",mode:y.mode,color:q,body:ee}},htmlBuilder:dn,mathmlBuilder:pn}),jt({type:"cr",names:["\\cr","\\newline"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler:function(p,v,y){var C=p.parser,q=p.funcName,ee=y[0],pe=q==="\\cr",ve=!1;return pe||(C.settings.displayMode&&C.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode")?ve=!1:ve=!0),{type:"cr",mode:C.mode,newLine:ve,newRow:pe,size:ee&&rr(ee,"size").value}},htmlBuilder:function(p,v){if(p.newRow)throw new d("\\cr valid only within a tabular/array environment");var y=et.makeSpan(["mspace"],[],v);return p.newLine&&(y.classes.push("newline"),p.size&&(y.style.marginTop=mr(p.size,v)+"em")),y},mathmlBuilder:function(p,v){var y=new wt.MathNode("mspace");return p.newLine&&(y.setAttribute("linebreak","newline"),p.size&&y.setAttribute("height",mr(p.size,v)+"em")),y}});var rn=function(p,v,y){var C=Nt.math[p]&&Nt.math[p].replace,q=gt(C||p,v,y);if(!q)throw new Error("Unsupported symbol "+p+" and font size "+v+".");return q},ds=function(p,v,y,C){var q=y.havingBaseStyle(v),ee=et.makeSpan(C.concat(q.sizingClasses(y)),[p],y),pe=q.sizeMultiplier/y.sizeMultiplier;return ee.height*=pe,ee.depth*=pe,ee.maxFontSize=q.sizeMultiplier,ee},Ps=function(p,v,y){var C=v.havingBaseStyle(y),q=(1-v.sizeMultiplier/C.sizeMultiplier)*v.fontMetrics().axisHeight;p.classes.push("delimcenter"),p.style.top=q+"em",p.height-=q,p.depth+=q},co=function(p,v,y,C,q,ee){var pe=et.makeSymbol(p,"Main-Regular",q,C),ve=ds(pe,v,C,ee);return y&&Ps(ve,C,v),ve},Ms=function(p,v,y,C){return et.makeSymbol(p,"Size"+v+"-Regular",y,C)},ga=function(p,v,y,C,q,ee){var pe=Ms(p,v,q,C),ve=ds(et.makeSpan(["delimsizing","size"+v],[pe],C),M.TEXT,C,ee);return y&&Ps(ve,C,M.TEXT),ve},yi=function(p,v,y){var C;v==="Size1-Regular"?C="delim-size1":C="delim-size4";var q=et.makeSpan(["delimsizinginner",C],[et.makeSpan([],[et.makeSymbol(p,v,y)])]);return{type:"elem",elem:q}},Vn={type:"kern",size:-.005},_a=function(p,v,y,C,q,ee){var pe,ve,Ce,$e;pe=Ce=$e=p,ve=null;var Ye="Size1-Regular";p==="\\uparrow"?Ce=$e="\u23D0":p==="\\Uparrow"?Ce=$e="\u2016":p==="\\downarrow"?pe=Ce="\u23D0":p==="\\Downarrow"?pe=Ce="\u2016":p==="\\updownarrow"?(pe="\\uparrow",Ce="\u23D0",$e="\\downarrow"):p==="\\Updownarrow"?(pe="\\Uparrow",Ce="\u2016",$e="\\Downarrow"):p==="["||p==="\\lbrack"?(pe="\u23A1",Ce="\u23A2",$e="\u23A3",Ye="Size4-Regular"):p==="]"||p==="\\rbrack"?(pe="\u23A4",Ce="\u23A5",$e="\u23A6",Ye="Size4-Regular"):p==="\\lfloor"||p==="\u230A"?(Ce=pe="\u23A2",$e="\u23A3",Ye="Size4-Regular"):p==="\\lceil"||p==="\u2308"?(pe="\u23A1",Ce=$e="\u23A2",Ye="Size4-Regular"):p==="\\rfloor"||p==="\u230B"?(Ce=pe="\u23A5",$e="\u23A6",Ye="Size4-Regular"):p==="\\rceil"||p==="\u2309"?(pe="\u23A4",Ce=$e="\u23A5",Ye="Size4-Regular"):p==="("||p==="\\lparen"?(pe="\u239B",Ce="\u239C",$e="\u239D",Ye="Size4-Regular"):p===")"||p==="\\rparen"?(pe="\u239E",Ce="\u239F",$e="\u23A0",Ye="Size4-Regular"):p==="\\{"||p==="\\lbrace"?(pe="\u23A7",ve="\u23A8",$e="\u23A9",Ce="\u23AA",Ye="Size4-Regular"):p==="\\}"||p==="\\rbrace"?(pe="\u23AB",ve="\u23AC",$e="\u23AD",Ce="\u23AA",Ye="Size4-Regular"):p==="\\lgroup"||p==="\u27EE"?(pe="\u23A7",$e="\u23A9",Ce="\u23AA",Ye="Size4-Regular"):p==="\\rgroup"||p==="\u27EF"?(pe="\u23AB",$e="\u23AD",Ce="\u23AA",Ye="Size4-Regular"):p==="\\lmoustache"||p==="\u23B0"?(pe="\u23A7",$e="\u23AD",Ce="\u23AA",Ye="Size4-Regular"):(p==="\\rmoustache"||p==="\u23B1")&&(pe="\u23AB",$e="\u23A9",Ce="\u23AA",Ye="Size4-Regular");var lt=rn(pe,Ye,q),dt=lt.height+lt.depth,bt=rn(Ce,Ye,q),Rt=bt.height+bt.depth,Be=rn($e,Ye,q),ar=Be.height+Be.depth,or=0,dr=1;if(ve!==null){var Ir=rn(ve,Ye,q);or=Ir.height+Ir.depth,dr=2}var Nr=dt+ar+or,Yr=Math.max(0,Math.ceil((v-Nr)/(dr*Rt))),Zr=Nr+Yr*dr*Rt,ri=C.fontMetrics().axisHeight;y&&(ri*=C.sizeMultiplier);var Ei=Zr/2-ri,ii=(Yr+1)*.005-Rt,Or=[];if(Or.push(yi($e,Ye,q)),ve===null)for(var Oi=0;Oi<Yr;Oi++)Or.push(Vn),Or.push(yi(Ce,Ye,q));else{for(var Yi=0;Yi<Yr;Yi++)Or.push(Vn),Or.push(yi(Ce,Ye,q));Or.push({type:"kern",size:ii}),Or.push(yi(Ce,Ye,q)),Or.push(Vn),Or.push(yi(ve,Ye,q));for(var ni=0;ni<Yr;ni++)Or.push(Vn),Or.push(yi(Ce,Ye,q))}Or.push({type:"kern",size:ii}),Or.push(yi(Ce,Ye,q)),Or.push(Vn),Or.push(yi(pe,Ye,q));var xi=C.havingBaseStyle(M.TEXT),_n=et.makeVList({positionType:"bottom",positionData:Ei,children:Or},xi);return ds(et.makeSpan(["delimsizing","mult"],[_n],xi),M.TEXT,C,ee)},ps=80,ms=.08,gs=function(p,v,y,C,q){var ee=Jt(p,C,y),pe=new Ae(p,ee),ve=new De([pe],{width:"400em",height:v+"em",viewBox:"0 0 400000 "+y,preserveAspectRatio:"xMinYMin slice"});return et.makeSvgSpan(["hide-tail"],[ve],q)},va=function(p,v){var y=v.havingBaseSizing(),C=Sa("\\surd",p*y.sizeMultiplier,Us,y),q=y.sizeMultiplier,ee=Math.max(0,v.minRuleThickness-v.fontMetrics().sqrtRuleThickness),pe,ve=0,Ce=0,$e=0,Ye;return C.type==="small"?($e=1e3+1e3*ee+ps,p<1?q=1:p<1.4&&(q=.7),ve=(1+ee+ms)/q,Ce=(1+ee)/q,pe=gs("sqrtMain",ve,$e,ee,v),pe.style.minWidth="0.853em",Ye=.833/q):C.type==="large"?($e=(1e3+ps)*rs[C.size],Ce=(rs[C.size]+ee)/q,ve=(rs[C.size]+ee+ms)/q,pe=gs("sqrtSize"+C.size,ve,$e,ee,v),pe.style.minWidth="1.02em",Ye=1/q):(ve=p+ee+ms,Ce=p+ee,$e=Math.floor(1e3*p+ee)+ps,pe=gs("sqrtTall",ve,$e,ee,v),pe.style.minWidth="0.742em",Ye=1.056),pe.height=Ce,pe.style.height=ve+"em",{span:pe,advanceWidth:Ye,ruleWidth:(v.fontMetrics().sqrtRuleThickness+ee)*q}},ya=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],Fs=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],Bs=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],rs=[0,1.2,1.8,2.4,3],mn=function(p,v,y,C,q){if(p==="<"||p==="\\lt"||p==="\u27E8"?p="\\langle":(p===">"||p==="\\gt"||p==="\u27E9")&&(p="\\rangle"),k.contains(ya,p)||k.contains(Bs,p))return ga(p,v,!1,y,C,q);if(k.contains(Fs,p))return _a(p,rs[v],!1,y,C,q);throw new d("Illegal delimiter: '"+p+"'")},ba=[{type:"small",style:M.SCRIPTSCRIPT},{type:"small",style:M.SCRIPT},{type:"small",style:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Ns=[{type:"small",style:M.SCRIPTSCRIPT},{type:"small",style:M.SCRIPT},{type:"small",style:M.TEXT},{type:"stack"}],Us=[{type:"small",style:M.SCRIPTSCRIPT},{type:"small",style:M.SCRIPT},{type:"small",style:M.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],ho=function(p){if(p.type==="small")return"Main-Regular";if(p.type==="large")return"Size"+p.size+"-Regular";if(p.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+p.type+"' here.")},Sa=function(p,v,y,C){for(var q=Math.min(2,3-C.style.size),ee=q;ee<y.length&&y[ee].type!=="stack";ee++){var pe=rn(p,ho(y[ee]),"math"),ve=pe.height+pe.depth;if(y[ee].type==="small"){var Ce=C.havingBaseStyle(y[ee].style);ve*=Ce.sizeMultiplier}if(ve>v)return y[ee]}return y[y.length-1]},Ea=function(p,v,y,C,q,ee){p==="<"||p==="\\lt"||p==="\u27E8"?p="\\langle":(p===">"||p==="\\gt"||p==="\u27E9")&&(p="\\rangle");var pe;k.contains(Bs,p)?pe=ba:k.contains(ya,p)?pe=Us:pe=Ns;var ve=Sa(p,v,pe,C);return ve.type==="small"?co(p,ve.style,y,C,q,ee):ve.type==="large"?ga(p,ve.size,y,C,q,ee):_a(p,v,y,C,q,ee)},fo=function(p,v,y,C,q,ee){var pe=C.fontMetrics().axisHeight*C.sizeMultiplier,ve=901,Ce=5/C.fontMetrics().ptPerEm,$e=Math.max(v-pe,y+pe),Ye=Math.max($e/500*ve,2*$e-Ce);return Ea(p,Ye,!0,C,q,ee)},gn={sqrtImage:va,sizedDelim:mn,customSizedDelim:Ea,leftRightDelim:fo},$s={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},zs=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function is(re,p){var v=Ai(re);if(v&&k.contains(zs,v.text))return v;throw new d("Invalid delimiter: '"+(v?v.text:JSON.stringify(re))+"' after '"+p.funcName+"'",re)}jt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1},handler:function(p,v){var y=is(v[0],p);return{type:"delimsizing",mode:p.parser.mode,size:$s[p.funcName].size,mclass:$s[p.funcName].mclass,delim:y.text}},htmlBuilder:function(p,v){return p.delim==="."?et.makeSpan([p.mclass]):gn.sizedDelim(p.delim,p.size,v,p.mode,[p.mclass])},mathmlBuilder:function(p){var v=[];p.delim!=="."&&v.push(vi(p.delim,p.mode));var y=new wt.MathNode("mo",v);return p.mclass==="mopen"||p.mclass==="mclose"?y.setAttribute("fence","true"):y.setAttribute("fence","false"),y}});function xa(re){if(!re.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}jt({type:"leftright-right",names:["\\right"],props:{numArgs:1},handler:function(p,v){var y=p.parser.gullet.macros.get("\\current@color");if(y&&typeof y!="string")throw new d("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:p.parser.mode,delim:is(v[0],p).text,color:y}}}),jt({type:"leftright",names:["\\left"],props:{numArgs:1},handler:function(p,v){var y=is(v[0],p),C=p.parser;++C.leftrightDepth;var q=C.parseExpression(!1);--C.leftrightDepth,C.expect("\\right",!1);var ee=rr(C.parseFunction(),"leftright-right");return{type:"leftright",mode:C.mode,body:q,left:y.text,right:ee.delim,rightColor:ee.color}},htmlBuilder:function(p,v){xa(p);for(var y=Kr(p.body,v,!0,["mopen","mclose"]),C=0,q=0,ee=!1,pe=0;pe<y.length;pe++)y[pe].isMiddle?ee=!0:(C=Math.max(y[pe].height,C),q=Math.max(y[pe].depth,q));C*=v.sizeMultiplier,q*=v.sizeMultiplier;var ve;if(p.left==="."?ve=Si(v,["mopen"]):ve=gn.leftRightDelim(p.left,C,q,v,p.mode,["mopen"]),y.unshift(ve),ee)for(var Ce=1;Ce<y.length;Ce++){var $e=y[Ce],Ye=$e.isMiddle;Ye&&(y[Ce]=gn.leftRightDelim(Ye.delim,C,q,Ye.options,p.mode,[]))}var lt;if(p.right===".")lt=Si(v,["mclose"]);else{var dt=p.rightColor?v.withColor(p.rightColor):v;lt=gn.leftRightDelim(p.right,C,q,dt,p.mode,["mclose"])}return y.push(lt),et.makeSpan(["minner"],y,v)},mathmlBuilder:function(p,v){xa(p);var y=li(p.body,v);if(p.left!=="."){var C=new wt.MathNode("mo",[vi(p.left,p.mode)]);C.setAttribute("fence","true"),y.unshift(C)}if(p.right!=="."){var q=new wt.MathNode("mo",[vi(p.right,p.mode)]);q.setAttribute("fence","true"),p.rightColor&&q.setAttribute("mathcolor",p.rightColor),y.push(q)}return Mn(y)}}),jt({type:"middle",names:["\\middle"],props:{numArgs:1},handler:function(p,v){var y=is(v[0],p);if(!p.parser.leftrightDepth)throw new d("\\middle without preceding \\left",y);return{type:"middle",mode:p.parser.mode,delim:y.text}},htmlBuilder:function(p,v){var y;if(p.delim===".")y=Si(v,[]);else{y=gn.sizedDelim(p.delim,1,v,p.mode,[]);var C={delim:p.delim,options:v};y.isMiddle=C}return y},mathmlBuilder:function(p,v){var y=p.delim==="\\vert"||p.delim==="|"?vi("|","text"):vi(p.delim,p.mode),C=new wt.MathNode("mo",[y]);return C.setAttribute("fence","true"),C.setAttribute("lspace","0.05em"),C.setAttribute("rspace","0.05em"),C}});var _s=function(p,v){var y=et.wrapFragment(br(p.body,v),v),C=p.label.substr(1),q=v.sizeMultiplier,ee,pe=0,ve=k.isCharacterBox(p.body);if(C==="sout")ee=et.makeSpan(["stretchy","sout"]),ee.height=v.fontMetrics().defaultRuleThickness/q,pe=-.5*v.fontMetrics().xHeight;else{/cancel/.test(C)?ve||y.classes.push("cancel-pad"):y.classes.push("boxpad");var Ce=0,$e=0;/box/.test(C)?($e=Math.max(v.fontMetrics().fboxrule,v.minRuleThickness),Ce=v.fontMetrics().fboxsep+(C==="colorbox"?0:$e)):Ce=ve?.2:0,ee=Zt.encloseSpan(y,C,Ce,v),/fbox|boxed|fcolorbox/.test(C)&&(ee.style.borderStyle="solid",ee.style.borderWidth=$e+"em"),pe=y.depth+Ce,p.backgroundColor&&(ee.style.backgroundColor=p.backgroundColor,p.borderColor&&(ee.style.borderColor=p.borderColor))}var Ye;return p.backgroundColor?Ye=et.makeVList({positionType:"individualShift",children:[{type:"elem",elem:ee,shift:pe},{type:"elem",elem:y,shift:0}]},v):Ye=et.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:0},{type:"elem",elem:ee,shift:pe,wrapperClasses:/cancel/.test(C)?["svg-align"]:[]}]},v),/cancel/.test(C)&&(Ye.height=y.height,Ye.depth=y.depth),/cancel/.test(C)&&!ve?et.makeSpan(["mord","cancel-lap"],[Ye],v):et.makeSpan(["mord"],[Ye],v)},vs=function(p,v){var y=0,C=new wt.MathNode(p.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Dr(p.body,v)]);switch(p.label){case"\\cancel":C.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":C.setAttribute("notation","downdiagonalstrike");break;case"\\sout":C.setAttribute("notation","horizontalstrike");break;case"\\fbox":C.setAttribute("notation","box");break;case"\\fcolorbox":case"\\colorbox":if(y=v.fontMetrics().fboxsep*v.fontMetrics().ptPerEm,C.setAttribute("width","+"+2*y+"pt"),C.setAttribute("height","+"+2*y+"pt"),C.setAttribute("lspace",y+"pt"),C.setAttribute("voffset",y+"pt"),p.label==="\\fcolorbox"){var q=Math.max(v.fontMetrics().fboxrule,v.minRuleThickness);C.setAttribute("style","border: "+q+"em solid "+String(p.borderColor))}break;case"\\xcancel":C.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return p.backgroundColor&&C.setAttribute("mathbackground",p.backgroundColor),C};jt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","text"]},handler:function(p,v,y){var C=p.parser,q=p.funcName,ee=rr(v[0],"color-token").color,pe=v[1];return{type:"enclose",mode:C.mode,label:q,backgroundColor:ee,body:pe}},htmlBuilder:_s,mathmlBuilder:vs}),jt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,greediness:3,argTypes:["color","color","text"]},handler:function(p,v,y){var C=p.parser,q=p.funcName,ee=rr(v[0],"color-token").color,pe=rr(v[1],"color-token").color,ve=v[2];return{type:"enclose",mode:C.mode,label:q,backgroundColor:pe,borderColor:ee,body:ve}},htmlBuilder:_s,mathmlBuilder:vs}),jt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:function(p,v){var y=p.parser;return{type:"enclose",mode:y.mode,label:"\\fbox",body:v[0]}}}),jt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout"],props:{numArgs:1},handler:function(p,v,y){var C=p.parser,q=p.funcName,ee=v[0];return{type:"enclose",mode:C.mode,label:q,body:ee}},htmlBuilder:_s,mathmlBuilder:vs});var Hs={};function $i(re){for(var p=re.type,v=re.names,y=re.props,C=re.handler,q=re.htmlBuilder,ee=re.mathmlBuilder,pe={type:p,numArgs:y.numArgs||0,greediness:1,allowedInText:!1,numOptionalArgs:0,handler:C},ve=0;ve<v.length;++ve)Hs[v[ve]]=pe;q&&(un[p]=q),ee&&(Gi[p]=ee)}function wa(re){var p=[];re.consumeSpaces();for(var v=re.fetch().text;v==="\\hline"||v==="\\hdashline";)re.consume(),p.push(v==="\\hdashline"),re.consumeSpaces(),v=re.fetch().text;return p}function Tn(re,p,v){var y=p.hskipBeforeAndAfter,C=p.addJot,q=p.cols,ee=p.arraystretch,pe=p.colSeparationType;if(re.gullet.beginGroup(),re.gullet.macros.set("\\\\","\\cr"),!ee){var ve=re.gullet.expandMacroAsText("\\arraystretch");if(ve==null)ee=1;else if(ee=parseFloat(ve),!ee||ee<0)throw new d("Invalid \\arraystretch: "+ve)}re.gullet.beginGroup();var Ce=[],$e=[Ce],Ye=[],lt=[];for(lt.push(wa(re));;){var dt=re.parseExpression(!1,"\\cr");re.gullet.endGroup(),re.gullet.beginGroup(),dt={type:"ordgroup",mode:re.mode,body:dt},v&&(dt={type:"styling",mode:re.mode,style:v,body:[dt]}),Ce.push(dt);var bt=re.fetch().text;if(bt==="&")re.consume();else if(bt==="\\end"){Ce.length===1&&dt.type==="styling"&&dt.body[0].body.length===0&&$e.pop(),lt.length<$e.length+1&<.push([]);break}else if(bt==="\\cr"){var Rt=rr(re.parseFunction(),"cr");Ye.push(Rt.size),lt.push(wa(re)),Ce=[],$e.push(Ce)}else throw new d("Expected & or \\\\ or \\cr or \\end",re.nextToken)}return re.gullet.endGroup(),re.gullet.endGroup(),{type:"array",mode:re.mode,addJot:C,arraystretch:ee,body:$e,cols:q,rowGaps:Ye,hskipBeforeAndAfter:y,hLinesBeforeRow:lt,colSeparationType:pe}}function ys(re){return re.substr(0,1)==="d"?"display":"text"}var Dn=function(p,v){var y,C,q=p.body.length,ee=p.hLinesBeforeRow,pe=0,ve=new Array(q),Ce=[],$e=Math.max(v.fontMetrics().arrayRuleWidth,v.minRuleThickness),Ye=1/v.fontMetrics().ptPerEm,lt=5*Ye;if(p.colSeparationType&&p.colSeparationType==="small"){var dt=v.havingStyle(M.SCRIPT).sizeMultiplier;lt=.2778*(dt/v.sizeMultiplier)}var bt=12*Ye,Rt=3*Ye,Be=p.arraystretch*bt,ar=.7*Be,or=.3*Be,dr=0;function Ir(ca){for(var Ds=0;Ds<ca.length;++Ds)Ds>0&&(dr+=.25),Ce.push({pos:dr,isDashed:ca[Ds]})}for(Ir(ee[0]),y=0;y<p.body.length;++y){var Nr=p.body[y],Yr=ar,Zr=or;pe<Nr.length&&(pe=Nr.length);var ri=new Array(Nr.length);for(C=0;C<Nr.length;++C){var Ei=br(Nr[C],v);Zr<Ei.depth&&(Zr=Ei.depth),Yr<Ei.height&&(Yr=Ei.height),ri[C]=Ei}var ii=p.rowGaps[y],Or=0;ii&&(Or=mr(ii,v),Or>0&&(Or+=or,Zr<Or&&(Zr=Or),Or=0)),p.addJot&&(Zr+=Rt),ri.height=Yr,ri.depth=Zr,dr+=Yr,ri.pos=dr,dr+=Zr+Or,ve[y]=ri,Ir(ee[y+1])}var Oi=dr/2+v.fontMetrics().axisHeight,Yi=p.cols||[],ni=[],xi,_n;for(C=0,_n=0;C<pe||_n<Yi.length;++C,++_n){for(var nn=Yi[_n]||{},Ja=!0;nn.type==="separator";){if(Ja||(xi=et.makeSpan(["arraycolsep"],[]),xi.style.width=v.fontMetrics().doubleRuleSep+"em",ni.push(xi)),nn.separator==="|"||nn.separator===":"){var Ao=nn.separator==="|"?"solid":"dashed",zn=et.makeSpan(["vertical-separator"],[],v);zn.style.height=dr+"em",zn.style.borderRightWidth=$e+"em",zn.style.borderRightStyle=Ao,zn.style.margin="0 -"+$e/2+"em",zn.style.verticalAlign=-(dr-Oi)+"em",ni.push(zn)}else throw new d("Invalid separator type: "+nn.separator);_n++,nn=Yi[_n]||{},Ja=!1}if(!(C>=pe)){var Di=void 0;(C>0||p.hskipBeforeAndAfter)&&(Di=k.deflt(nn.pregap,lt),Di!==0&&(xi=et.makeSpan(["arraycolsep"],[]),xi.style.width=Di+"em",ni.push(xi)));var vn=[];for(y=0;y<q;++y){var ls=ve[y],Ts=ls[C];if(Ts){var aa=ls.pos-Oi;Ts.depth=ls.depth,Ts.height=ls.height,vn.push({type:"elem",elem:Ts,shift:aa})}}vn=et.makeVList({positionType:"individualShift",children:vn},v),vn=et.makeSpan(["col-align-"+(nn.align||"c")],[vn]),ni.push(vn),(C<pe-1||p.hskipBeforeAndAfter)&&(Di=k.deflt(nn.postgap,lt),Di!==0&&(xi=et.makeSpan(["arraycolsep"],[]),xi.style.width=Di+"em",ni.push(xi)))}}if(ve=et.makeSpan(["mtable"],ni),Ce.length>0){for(var us=et.makeLineSpan("hline",v,$e),Co=et.makeLineSpan("hdashline",v,$e),oa=[{type:"elem",elem:ve,shift:0}];Ce.length>0;){var la=Ce.pop(),ua=la.pos-Oi;la.isDashed?oa.push({type:"elem",elem:Co,shift:ua}):oa.push({type:"elem",elem:us,shift:ua})}ve=et.makeVList({positionType:"individualShift",children:oa},v)}return et.makeSpan(["mord"],[ve],v)},Aa={c:"center ",l:"left ",r:"right "},Vi=function(p,v){var y=new wt.MathNode("mtable",p.body.map(function(dr){return new wt.MathNode("mtr",dr.map(function(Ir){return new wt.MathNode("mtd",[Dr(Ir,v)])}))})),C=p.arraystretch===.5?.1:.16+p.arraystretch-1+(p.addJot?.09:0);y.setAttribute("rowspacing",C+"em");var q="",ee="";if(p.cols){var pe=p.cols,ve="",Ce=!1,$e=0,Ye=pe.length;pe[0].type==="separator"&&(q+="top ",$e=1),pe[pe.length-1].type==="separator"&&(q+="bottom ",Ye-=1);for(var lt=$e;lt<Ye;lt++)pe[lt].type==="align"?(ee+=Aa[pe[lt].align],Ce&&(ve+="none "),Ce=!0):pe[lt].type==="separator"&&Ce&&(ve+=pe[lt].separator==="|"?"solid ":"dashed ",Ce=!1);y.setAttribute("columnalign",ee.trim()),/[sd]/.test(ve)&&y.setAttribute("columnlines",ve.trim())}if(p.colSeparationType==="align"){for(var dt=p.cols||[],bt="",Rt=1;Rt<dt.length;Rt++)bt+=Rt%2?"0em ":"1em ";y.setAttribute("columnspacing",bt.trim())}else p.colSeparationType==="alignat"?y.setAttribute("columnspacing","0em"):p.colSeparationType==="small"?y.setAttribute("columnspacing","0.2778em"):y.setAttribute("columnspacing","1em");var Be="",ar=p.hLinesBeforeRow;q+=ar[0].length>0?"left ":"",q+=ar[ar.length-1].length>0?"right ":"";for(var or=1;or<ar.length-1;or++)Be+=ar[or].length===0?"none ":ar[or][0]?"dashed ":"solid ";return/[sd]/.test(Be)&&y.setAttribute("rowlines",Be.trim()),q!==""&&(y=new wt.MathNode("menclose",[y]),y.setAttribute("notation",q.trim())),p.arraystretch&&p.arraystretch<1&&(y=new wt.MathNode("mstyle",[y]),y.setAttribute("scriptlevel","1")),y},Ca=function(p,v){var y=[],C=Tn(p.parser,{cols:y,addJot:!0},"display"),q,ee=0,pe={type:"ordgroup",mode:p.mode,body:[]},ve=Mr(v[0],"ordgroup");if(ve){for(var Ce="",$e=0;$e<ve.body.length;$e++){var Ye=rr(ve.body[$e],"textord");Ce+=Ye.text}q=Number(Ce),ee=q*2}var lt=!ee;C.body.forEach(function(Be){for(var ar=1;ar<Be.length;ar+=2){var or=rr(Be[ar],"styling"),dr=rr(or.body[0],"ordgroup");dr.body.unshift(pe)}if(lt)ee<Be.length&&(ee=Be.length);else{var Ir=Be.length/2;if(q<Ir)throw new d("Too many math in a row: "+("expected "+q+", but got "+Ir),Be[0])}});for(var dt=0;dt<ee;++dt){var bt="r",Rt=0;dt%2===1?bt="l":dt>0&<&&(Rt=1),y[dt]={type:"align",align:bt,pregap:Rt,postgap:0}}return C.colSeparationType=lt?"align":"alignat",C};$i({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(p,v){var y=Ai(v[0]),C=y?[v[0]]:rr(v[0],"ordgroup").body,q=C.map(function(pe){var ve=Wi(pe),Ce=ve.text;if("lcr".indexOf(Ce)!==-1)return{type:"align",align:Ce};if(Ce==="|")return{type:"separator",separator:"|"};if(Ce===":")return{type:"separator",separator:":"};throw new d("Unknown column alignment: "+Ce,pe)}),ee={cols:q,hskipBeforeAndAfter:!0};return Tn(p.parser,ee,ys(p.envName))},htmlBuilder:Dn,mathmlBuilder:Vi}),$i({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix"],props:{numArgs:0},handler:function(p){var v={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[p.envName],y={hskipBeforeAndAfter:!1},C=Tn(p.parser,y,ys(p.envName));return v?{type:"leftright",mode:p.mode,body:[C],left:v[0],right:v[1],rightColor:void 0}:C},htmlBuilder:Dn,mathmlBuilder:Vi}),$i({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(p){var v={arraystretch:.5},y=Tn(p.parser,v,"script");return y.colSeparationType="small",y},htmlBuilder:Dn,mathmlBuilder:Vi}),$i({type:"array",names:["subarray"],props:{numArgs:1},handler:function(p,v){var y=Ai(v[0]),C=y?[v[0]]:rr(v[0],"ordgroup").body,q=C.map(function(pe){var ve=Wi(pe),Ce=ve.text;if("lc".indexOf(Ce)!==-1)return{type:"align",align:Ce};throw new d("Unknown column alignment: "+Ce,pe)});if(q.length>1)throw new d("{subarray} can contain only one column");var ee={cols:q,hskipBeforeAndAfter:!1,arraystretch:.5};if(ee=Tn(p.parser,ee,"script"),ee.body[0].length>1)throw new d("{subarray} can contain only one column");return ee},htmlBuilder:Dn,mathmlBuilder:Vi}),$i({type:"array",names:["cases","dcases"],props:{numArgs:0},handler:function(p){var v={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},y=Tn(p.parser,v,ys(p.envName));return{type:"leftright",mode:p.mode,body:[y],left:"\\{",right:".",rightColor:void 0}},htmlBuilder:Dn,mathmlBuilder:Vi}),$i({type:"array",names:["aligned"],props:{numArgs:0},handler:Ca,htmlBuilder:Dn,mathmlBuilder:Vi}),$i({type:"array",names:["gathered"],props:{numArgs:0},handler:function(p){var v={cols:[{type:"align",align:"c"}],addJot:!0};return Tn(p.parser,v,"display")},htmlBuilder:Dn,mathmlBuilder:Vi}),$i({type:"array",names:["alignedat"],props:{numArgs:1},handler:Ca,htmlBuilder:Dn,mathmlBuilder:Vi}),jt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler:function(p,v){throw new d(p.funcName+" valid only within array environment")}});var ft=Hs,bs=ft;jt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler:function(p,v){var y=p.parser,C=p.funcName,q=v[0];if(q.type!=="ordgroup")throw new d("Invalid environment name",q);for(var ee="",pe=0;pe<q.body.length;++pe)ee+=rr(q.body[pe],"textord").text;if(C==="\\begin"){if(!bs.hasOwnProperty(ee))throw new d("No such environment: "+ee,q);var ve=bs[ee],Ce=y.parseArguments("\\begin{"+ee+"}",ve),$e=Ce.args,Ye=Ce.optArgs,lt={mode:y.mode,envName:ee,parser:y},dt=ve.handler(lt,$e,Ye);y.expect("\\end",!1);var bt=y.nextToken,Rt=rr(y.parseFunction(),"environment");if(Rt.name!==ee)throw new d("Mismatch: \\begin{"+ee+"} matched by \\end{"+Rt.name+"}",bt);return dt}return{type:"environment",mode:y.mode,name:ee,nameGroup:q}}});var Ta=et.makeSpan;function js(re,p){var v=Kr(re.body,p,!0);return Ta([re.mclass],v,p)}function Da(re,p){var v,y=li(re.body,p);return re.mclass==="minner"?wt.newDocumentFragment(y):(re.mclass==="mord"?re.isCharacterBox?(v=y[0],v.type="mi"):v=new wt.MathNode("mi",y):(re.isCharacterBox?(v=y[0],v.type="mo"):v=new wt.MathNode("mo",y),re.mclass==="mbin"?(v.attributes.lspace="0.22em",v.attributes.rspace="0.22em"):re.mclass==="mpunct"?(v.attributes.lspace="0em",v.attributes.rspace="0.17em"):(re.mclass==="mopen"||re.mclass==="mclose")&&(v.attributes.lspace="0em",v.attributes.rspace="0em")),v)}jt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1},handler:function(p,v){var y=p.parser,C=p.funcName,q=v[0];return{type:"mclass",mode:y.mode,mclass:"m"+C.substr(5),body:Jr(q),isCharacterBox:k.isCharacterBox(q)}},htmlBuilder:js,mathmlBuilder:Da});var ns=function(p){var v=p.type==="ordgroup"&&p.body.length?p.body[0]:p;return v.type==="atom"&&(v.family==="bin"||v.family==="rel")?"m"+v.family:"mord"};jt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:function(p,v){var y=p.parser;return{type:"mclass",mode:y.mode,mclass:ns(v[0]),body:[v[1]],isCharacterBox:k.isCharacterBox(v[1])}}}),jt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler:function(p,v){var y=p.parser,C=p.funcName,q=v[1],ee=v[0],pe;C!=="\\stackrel"?pe=ns(q):pe="mrel";var ve={type:"op",mode:q.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:C!=="\\stackrel",body:Jr(q)},Ce={type:"supsub",mode:ee.mode,base:ve,sup:C==="\\underset"?null:ee,sub:C==="\\underset"?ee:null};return{type:"mclass",mode:y.mode,mclass:pe,body:[Ce],isCharacterBox:k.isCharacterBox(Ce)}},htmlBuilder:js,mathmlBuilder:Da});var Ws=function(p,v){var y=p.font,C=v.withFont(y);return br(p.body,C)},La=function(p,v){var y=p.font,C=v.withFont(y);return Dr(p.body,C)},Ra={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};jt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,greediness:2},handler:function(p,v){var y=p.parser,C=p.funcName,q=v[0],ee=C;return ee in Ra&&(ee=Ra[ee]),{type:"font",mode:y.mode,font:ee.slice(1),body:q}},htmlBuilder:Ws,mathmlBuilder:La}),jt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1,greediness:2},handler:function(p,v){var y=p.parser,C=v[0],q=k.isCharacterBox(C);return{type:"mclass",mode:y.mode,mclass:ns(C),body:[{type:"font",mode:y.mode,font:"boldsymbol",body:C}],isCharacterBox:q}}}),jt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it"],props:{numArgs:0,allowedInText:!0},handler:function(p,v){var y=p.parser,C=p.funcName,q=p.breakOnTokenText,ee=y.mode,pe=y.parseExpression(!0,q),ve="math"+C.slice(1);return{type:"font",mode:ee,font:ve,body:{type:"ordgroup",mode:y.mode,body:pe}}},htmlBuilder:Ws,mathmlBuilder:La});var Ss=function(p,v){var y=v;return p==="display"?y=y.id>=M.SCRIPT.id?y.text():M.DISPLAY:p==="text"&&y.size===M.DISPLAY.size?y=M.TEXT:p==="script"?y=M.SCRIPT:p==="scriptscript"&&(y=M.SCRIPTSCRIPT),y},Un=function(p,v){var y=Ss(p.size,v.style),C=y.fracNum(),q=y.fracDen(),ee;ee=v.havingStyle(C);var pe=br(p.numer,ee,v);if(p.continued){var ve=8.5/v.fontMetrics().ptPerEm,Ce=3.5/v.fontMetrics().ptPerEm;pe.height=pe.height<ve?ve:pe.height,pe.depth=pe.depth<Ce?Ce:pe.depth}ee=v.havingStyle(q);var $e=br(p.denom,ee,v),Ye,lt,dt;p.hasBarLine?(p.barSize?(lt=mr(p.barSize,v),Ye=et.makeLineSpan("frac-line",v,lt)):Ye=et.makeLineSpan("frac-line",v),lt=Ye.height,dt=Ye.height):(Ye=null,lt=0,dt=v.fontMetrics().defaultRuleThickness);var bt,Rt,Be;y.size===M.DISPLAY.size||p.size==="display"?(bt=v.fontMetrics().num1,lt>0?Rt=3*dt:Rt=7*dt,Be=v.fontMetrics().denom1):(lt>0?(bt=v.fontMetrics().num2,Rt=dt):(bt=v.fontMetrics().num3,Rt=3*dt),Be=v.fontMetrics().denom2);var ar;if(Ye){var dr=v.fontMetrics().axisHeight;bt-pe.depth-(dr+.5*lt)<Rt&&(bt+=Rt-(bt-pe.depth-(dr+.5*lt))),dr-.5*lt-($e.height-Be)<Rt&&(Be+=Rt-(dr-.5*lt-($e.height-Be)));var Ir=-(dr-.5*lt);ar=et.makeVList({positionType:"individualShift",children:[{type:"elem",elem:$e,shift:Be},{type:"elem",elem:Ye,shift:Ir},{type:"elem",elem:pe,shift:-bt}]},v)}else{var or=bt-pe.depth-($e.height-Be);or<Rt&&(bt+=.5*(Rt-or),Be+=.5*(Rt-or)),ar=et.makeVList({positionType:"individualShift",children:[{type:"elem",elem:$e,shift:Be},{type:"elem",elem:pe,shift:-bt}]},v)}ee=v.havingStyle(y),ar.height*=ee.sizeMultiplier/v.sizeMultiplier,ar.depth*=ee.sizeMultiplier/v.sizeMultiplier;var Nr;y.size===M.DISPLAY.size?Nr=v.fontMetrics().delim1:Nr=v.fontMetrics().delim2;var Yr,Zr;return p.leftDelim==null?Yr=Si(v,["mopen"]):Yr=gn.customSizedDelim(p.leftDelim,Nr,!0,v.havingStyle(y),p.mode,["mopen"]),p.continued?Zr=et.makeSpan([]):p.rightDelim==null?Zr=Si(v,["mclose"]):Zr=gn.customSizedDelim(p.rightDelim,Nr,!0,v.havingStyle(y),p.mode,["mclose"]),et.makeSpan(["mord"].concat(ee.sizingClasses(v)),[Yr,et.makeSpan(["mfrac"],[ar]),Zr],v)},Ln=function(p,v){var y=new wt.MathNode("mfrac",[Dr(p.numer,v),Dr(p.denom,v)]);if(!p.hasBarLine)y.setAttribute("linethickness","0px");else if(p.barSize){var C=mr(p.barSize,v);y.setAttribute("linethickness",C+"em")}var q=Ss(p.size,v.style);if(q.size!==v.style.size){y=new wt.MathNode("mstyle",[y]);var ee=q.size===M.DISPLAY.size?"true":"false";y.setAttribute("displaystyle",ee),y.setAttribute("scriptlevel","0")}if(p.leftDelim!=null||p.rightDelim!=null){var pe=[];if(p.leftDelim!=null){var ve=new wt.MathNode("mo",[new wt.TextNode(p.leftDelim.replace("\\",""))]);ve.setAttribute("fence","true"),pe.push(ve)}if(pe.push(y),p.rightDelim!=null){var Ce=new wt.MathNode("mo",[new wt.TextNode(p.rightDelim.replace("\\",""))]);Ce.setAttribute("fence","true"),pe.push(Ce)}return Mn(pe)}return y};jt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,greediness:2},handler:function(p,v){var y=p.parser,C=p.funcName,q=v[0],ee=v[1],pe,ve=null,Ce=null,$e="auto";switch(C){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":pe=!0;break;case"\\\\atopfrac":pe=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":pe=!1,ve="(",Ce=")";break;case"\\\\bracefrac":pe=!1,ve="\\{",Ce="\\}";break;case"\\\\brackfrac":pe=!1,ve="[",Ce="]";break;default:throw new Error("Unrecognized genfrac command")}switch(C){case"\\cfrac":case"\\dfrac":case"\\dbinom":$e="display";break;case"\\tfrac":case"\\tbinom":$e="text";break}return{type:"genfrac",mode:y.mode,continued:C==="\\cfrac",numer:q,denom:ee,hasBarLine:pe,leftDelim:ve,rightDelim:Ce,size:$e,barSize:null}},htmlBuilder:Un,mathmlBuilder:Ln}),jt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler:function(p){var v=p.parser,y=p.funcName,C=p.token,q;switch(y){case"\\over":q="\\frac";break;case"\\choose":q="\\binom";break;case"\\atop":q="\\\\atopfrac";break;case"\\brace":q="\\\\bracefrac";break;case"\\brack":q="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:v.mode,replaceWith:q,token:C}}});var ka=["display","text","script","scriptscript"],Ia=function(p){var v=null;return p.length>0&&(v=p,v=v==="."?null:v),v};jt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,greediness:6,argTypes:["math","math","size","text","math","math"]},handler:function(p,v){var y=p.parser,C=v[4],q=v[5],ee=Mr(v[0],"atom");ee&&(ee=Fr(v[0],"open"));var pe=ee?Ia(ee.text):null,ve=Mr(v[1],"atom");ve&&(ve=Fr(v[1],"close"));var Ce=ve?Ia(ve.text):null,$e=rr(v[2],"size"),Ye,lt=null;$e.isBlank?Ye=!0:(lt=$e.value,Ye=lt.number>0);var dt="auto",bt=Mr(v[3],"ordgroup");if(bt){if(bt.body.length>0){var Rt=rr(bt.body[0],"textord");dt=ka[Number(Rt.text)]}}else bt=rr(v[3],"textord"),dt=ka[Number(bt.text)];return{type:"genfrac",mode:y.mode,numer:C,denom:q,continued:!1,hasBarLine:Ye,barSize:lt,leftDelim:pe,rightDelim:Ce,size:dt}},htmlBuilder:Un,mathmlBuilder:Ln}),jt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(p,v){var y=p.parser,C=p.funcName,q=p.token;return{type:"infix",mode:y.mode,replaceWith:"\\\\abovefrac",size:rr(v[0],"size").value,token:q}}}),jt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(p,v){var y=p.parser,C=p.funcName,q=v[0],ee=x(rr(v[1],"infix").size),pe=v[2],ve=ee.number>0;return{type:"genfrac",mode:y.mode,numer:q,denom:pe,continued:!1,hasBarLine:ve,barSize:ee,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Un,mathmlBuilder:Ln});var Oa=function(p,v){var y=v.style,C,q,ee=Mr(p,"supsub");ee?(C=ee.sup?br(ee.sup,v.havingStyle(y.sup()),v):br(ee.sub,v.havingStyle(y.sub()),v),q=rr(ee.base,"horizBrace")):q=rr(p,"horizBrace");var pe=br(q.base,v.havingBaseStyle(M.DISPLAY)),ve=Zt.svgSpan(q,v),Ce;if(q.isOver?(Ce=et.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:pe},{type:"kern",size:.1},{type:"elem",elem:ve}]},v),Ce.children[0].children[0].children[1].classes.push("svg-align")):(Ce=et.makeVList({positionType:"bottom",positionData:pe.depth+.1+ve.height,children:[{type:"elem",elem:ve},{type:"kern",size:.1},{type:"elem",elem:pe}]},v),Ce.children[0].children[0].children[0].classes.push("svg-align")),C){var $e=et.makeSpan(["mord",q.isOver?"mover":"munder"],[Ce],v);q.isOver?Ce=et.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:$e},{type:"kern",size:.2},{type:"elem",elem:C}]},v):Ce=et.makeVList({positionType:"bottom",positionData:$e.depth+.2+C.height+C.depth,children:[{type:"elem",elem:C},{type:"kern",size:.2},{type:"elem",elem:$e}]},v)}return et.makeSpan(["mord",q.isOver?"mover":"munder"],[Ce],v)},po=function(p,v){var y=Zt.mathMLnode(p.label);return new wt.MathNode(p.isOver?"mover":"munder",[Dr(p.base,v),y])};jt({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(p,v){var y=p.parser,C=p.funcName;return{type:"horizBrace",mode:y.mode,label:C,isOver:/^\\over/.test(C),base:v[0]}},htmlBuilder:Oa,mathmlBuilder:po}),jt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(p,v){var y=p.parser,C=v[1],q=rr(v[0],"url").url;return y.settings.isTrusted({command:"\\href",url:q})?{type:"href",mode:y.mode,href:q,body:Jr(C)}:y.formatUnsupportedCmd("\\href")},htmlBuilder:function(p,v){var y=Kr(p.body,v,!1);return et.makeAnchor(p.href,[],y,v)},mathmlBuilder:function(p,v){var y=ei(p.body,v);return y instanceof _r||(y=new _r("mrow",[y])),y.setAttribute("href",p.href),y}}),jt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(p,v){var y=p.parser,C=rr(v[0],"url").url;if(!y.settings.isTrusted({command:"\\url",url:C}))return y.formatUnsupportedCmd("\\url");for(var q=[],ee=0;ee<C.length;ee++){var pe=C[ee];pe==="~"&&(pe="\\textasciitilde"),q.push({type:"textord",mode:"text",text:pe})}var ve={type:"text",mode:y.mode,font:"\\texttt",body:q};return{type:"href",mode:y.mode,href:C,body:Jr(ve)}}}),jt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:function(p,v){var y=p.parser;return{type:"htmlmathml",mode:y.mode,html:Jr(v[0]),mathml:Jr(v[1])}},htmlBuilder:function(p,v){var y=Kr(p.html,v,!1);return et.makeFragment(y)},mathmlBuilder:function(p,v){return ei(p.mathml,v)}});var Es=function(p){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(p))return{number:+p,unit:"bp"};var v=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(p);if(!v)throw new d("Invalid size: '"+p+"' in \\includegraphics");var y={number:+(v[1]+v[2]),unit:v[3]};if(!Br(y))throw new d("Invalid unit: '"+y.unit+"' in \\includegraphics.");return y};jt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:function(p,v,y){var C=p.parser,q={number:0,unit:"em"},ee={number:.9,unit:"em"},pe={number:0,unit:"em"},ve="";if(y[0])for(var Ce=rr(y[0],"raw").string,$e=Ce.split(","),Ye=0;Ye<$e.length;Ye++){var lt=$e[Ye].split("=");if(lt.length===2){var dt=lt[1].trim();switch(lt[0].trim()){case"alt":ve=dt;break;case"width":q=Es(dt);break;case"height":ee=Es(dt);break;case"totalheight":pe=Es(dt);break;default:throw new d("Invalid key: '"+lt[0]+"' in \\includegraphics.")}}}var bt=rr(v[0],"url").url;return ve===""&&(ve=bt,ve=ve.replace(/^.*[\\/]/,""),ve=ve.substring(0,ve.lastIndexOf("."))),C.settings.isTrusted({command:"\\includegraphics",url:bt})?{type:"includegraphics",mode:C.mode,alt:ve,width:q,height:ee,totalheight:pe,src:bt}:C.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:function(p,v){var y=mr(p.height,v),C=0;p.totalheight.number>0&&(C=mr(p.totalheight,v)-y,C=Number(C.toFixed(2)));var q=0;p.width.number>0&&(q=mr(p.width,v));var ee={height:y+C+"em"};q>0&&(ee.width=q+"em"),C>0&&(ee.verticalAlign=-C+"em");var pe=new ut(p.src,p.alt,ee);return pe.height=y,pe.depth=C,pe},mathmlBuilder:function(p,v){var y=new wt.MathNode("mglyph",[]);y.setAttribute("alt",p.alt);var C=mr(p.height,v),q=0;if(p.totalheight.number>0&&(q=mr(p.totalheight,v)-C,q=q.toFixed(2),y.setAttribute("valign","-"+q+"em")),y.setAttribute("height",C+q+"em"),p.width.number>0){var ee=mr(p.width,v);y.setAttribute("width",ee+"em")}return y.setAttribute("src",p.src),y}}),jt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],allowedInText:!0},handler:function(p,v){var y=p.parser,C=p.funcName,q=rr(v[0],"size");if(y.settings.strict){var ee=C[1]==="m",pe=q.value.unit==="mu";ee?(pe||y.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+C+" supports only mu units, "+("not "+q.value.unit+" units")),y.mode!=="math"&&y.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+C+" works only in math mode")):pe&&y.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+C+" doesn't support mu units")}return{type:"kern",mode:y.mode,dimension:q.value}},htmlBuilder:function(p,v){return et.makeGlue(p.dimension,v)},mathmlBuilder:function(p,v){var y=mr(p.dimension,v);return new wt.SpaceNode(y)}}),jt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var y=p.parser,C=p.funcName,q=v[0];return{type:"lap",mode:y.mode,alignment:C.slice(5),body:q}},htmlBuilder:function(p,v){var y;p.alignment==="clap"?(y=et.makeSpan([],[br(p.body,v)]),y=et.makeSpan(["inner"],[y],v)):y=et.makeSpan(["inner"],[br(p.body,v)]);var C=et.makeSpan(["fix"],[]),q=et.makeSpan([p.alignment],[y,C],v),ee=et.makeSpan(["strut"]);return ee.style.height=q.height+q.depth+"em",ee.style.verticalAlign=-q.depth+"em",q.children.unshift(ee),q=et.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:q}]},v),et.makeSpan(["mord"],[q],v)},mathmlBuilder:function(p,v){var y=new wt.MathNode("mpadded",[Dr(p.body,v)]);if(p.alignment!=="rlap"){var C=p.alignment==="llap"?"-1":"-0.5";y.setAttribute("lspace",C+"width")}return y.setAttribute("width","0px"),y}}),jt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(p,v){var y=p.funcName,C=p.parser,q=C.mode;C.switchMode("math");var ee=y==="\\("?"\\)":"$",pe=C.parseExpression(!1,ee);return C.expect(ee),C.switchMode(q),{type:"styling",mode:C.mode,style:"text",body:pe}}}),jt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(p,v){throw new d("Mismatched "+p.funcName)}});var xs=function(p,v){switch(v.style.size){case M.DISPLAY.size:return p.display;case M.TEXT.size:return p.text;case M.SCRIPT.size:return p.script;case M.SCRIPTSCRIPT.size:return p.scriptscript;default:return p.text}};jt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4},handler:function(p,v){var y=p.parser;return{type:"mathchoice",mode:y.mode,display:Jr(v[0]),text:Jr(v[1]),script:Jr(v[2]),scriptscript:Jr(v[3])}},htmlBuilder:function(p,v){var y=xs(p,v),C=Kr(y,v,!1);return et.makeFragment(C)},mathmlBuilder:function(p,v){var y=xs(p,v);return ei(y,v)}});var ss=function(p,v,y,C,q,ee,pe){p=et.makeSpan([],[p]);var ve,Ce;if(v){var $e=br(v,C.havingStyle(q.sup()),C);Ce={elem:$e,kern:Math.max(C.fontMetrics().bigOpSpacing1,C.fontMetrics().bigOpSpacing3-$e.depth)}}if(y){var Ye=br(y,C.havingStyle(q.sub()),C);ve={elem:Ye,kern:Math.max(C.fontMetrics().bigOpSpacing2,C.fontMetrics().bigOpSpacing4-Ye.height)}}var lt;if(Ce&&ve){var dt=C.fontMetrics().bigOpSpacing5+ve.elem.height+ve.elem.depth+ve.kern+p.depth+pe;lt=et.makeVList({positionType:"bottom",positionData:dt,children:[{type:"kern",size:C.fontMetrics().bigOpSpacing5},{type:"elem",elem:ve.elem,marginLeft:-ee+"em"},{type:"kern",size:ve.kern},{type:"elem",elem:p},{type:"kern",size:Ce.kern},{type:"elem",elem:Ce.elem,marginLeft:ee+"em"},{type:"kern",size:C.fontMetrics().bigOpSpacing5}]},C)}else if(ve){var bt=p.height-pe;lt=et.makeVList({positionType:"top",positionData:bt,children:[{type:"kern",size:C.fontMetrics().bigOpSpacing5},{type:"elem",elem:ve.elem,marginLeft:-ee+"em"},{type:"kern",size:ve.kern},{type:"elem",elem:p}]},C)}else if(Ce){var Rt=p.depth+pe;lt=et.makeVList({positionType:"bottom",positionData:Rt,children:[{type:"elem",elem:p},{type:"kern",size:Ce.kern},{type:"elem",elem:Ce.elem,marginLeft:ee+"em"},{type:"kern",size:C.fontMetrics().bigOpSpacing5}]},C)}else return p;return et.makeSpan(["mop","op-limits"],[lt],C)},qn=["\\smallint"],Yn=function(p,v){var y,C,q=!1,ee,pe=Mr(p,"supsub");pe?(y=pe.sup,C=pe.sub,ee=rr(pe.base,"op"),q=!0):ee=rr(p,"op");var ve=v.style,Ce=!1;ve.size===M.DISPLAY.size&&ee.symbol&&!k.contains(qn,ee.name)&&(Ce=!0);var $e;if(ee.symbol){var Ye=Ce?"Size2-Regular":"Size1-Regular",lt="";if((ee.name==="\\oiint"||ee.name==="\\oiiint")&&(lt=ee.name.substr(1),ee.name=lt==="oiint"?"\\iint":"\\iiint"),$e=et.makeSymbol(ee.name,Ye,"math",v,["mop","op-symbol",Ce?"large-op":"small-op"]),lt.length>0){var dt=$e.italic,bt=et.staticSvg(lt+"Size"+(Ce?"2":"1"),v);$e=et.makeVList({positionType:"individualShift",children:[{type:"elem",elem:$e,shift:0},{type:"elem",elem:bt,shift:Ce?.08:0}]},v),ee.name="\\"+lt,$e.classes.unshift("mop"),$e.italic=dt}}else if(ee.body){var Rt=Kr(ee.body,v,!0);Rt.length===1&&Rt[0]instanceof be?($e=Rt[0],$e.classes[0]="mop"):$e=et.makeSpan(["mop"],et.tryCombineChars(Rt),v)}else{for(var Be=[],ar=1;ar<ee.name.length;ar++)Be.push(et.mathsym(ee.name[ar],ee.mode,v));$e=et.makeSpan(["mop"],Be,v)}var or=0,dr=0;return($e instanceof be||ee.name==="\\oiint"||ee.name==="\\oiiint")&&!ee.suppressBaseShift&&(or=($e.height-$e.depth)/2-v.fontMetrics().axisHeight,dr=$e.italic),q?ss($e,y,C,v,ve,dr,or):(or&&($e.style.position="relative",$e.style.top=or+"em"),$e)},Zn=function(p,v){var y;if(p.symbol)y=new _r("mo",[vi(p.name,p.mode)]),k.contains(qn,p.name)&&y.setAttribute("largeop","false");else if(p.body)y=new _r("mo",li(p.body,v));else{y=new _r("mi",[new cn(p.name.slice(1))]);var C=new _r("mo",[vi("\u2061","text")]);p.parentIsSupSub?y=new _r("mo",[y,C]):y=wn([y,C])}return y},Pa={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};jt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"],props:{numArgs:0},handler:function(p,v){var y=p.parser,C=p.funcName,q=C;return q.length===1&&(q=Pa[q]),{type:"op",mode:y.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:q}},htmlBuilder:Yn,mathmlBuilder:Zn}),jt({type:"op",names:["\\mathop"],props:{numArgs:1},handler:function(p,v){var y=p.parser,C=v[0];return{type:"op",mode:y.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Jr(C)}},htmlBuilder:Yn,mathmlBuilder:Zn});var Gs={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};jt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler:function(p){var v=p.parser,y=p.funcName;return{type:"op",mode:v.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:y}},htmlBuilder:Yn,mathmlBuilder:Zn}),jt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler:function(p){var v=p.parser,y=p.funcName;return{type:"op",mode:v.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:y}},htmlBuilder:Yn,mathmlBuilder:Zn}),jt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler:function(p){var v=p.parser,y=p.funcName,C=y;return C.length===1&&(C=Gs[C]),{type:"op",mode:v.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:C}},htmlBuilder:Yn,mathmlBuilder:Zn});var Ma=function(p,v){var y,C,q=!1,ee,pe=Mr(p,"supsub");pe?(y=pe.sup,C=pe.sub,ee=rr(pe.base,"operatorname"),q=!0):ee=rr(p,"operatorname");var ve;if(ee.body.length>0){for(var Ce=ee.body.map(function(dt){var bt=dt.text;return typeof bt=="string"?{type:"textord",mode:dt.mode,text:bt}:dt}),$e=Kr(Ce,v.withFont("mathrm"),!0),Ye=0;Ye<$e.length;Ye++){var lt=$e[Ye];lt instanceof be&&(lt.text=lt.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}ve=et.makeSpan(["mop"],$e,v)}else ve=et.makeSpan(["mop"],[],v);return q?ss(ve,y,C,v,v.style,0,0):ve},ws=function(p,v){for(var y=li(p.body,v.withFont("mathrm")),C=!0,q=0;q<y.length;q++){var ee=y[q];if(!(ee instanceof wt.SpaceNode))if(ee instanceof wt.MathNode)switch(ee.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var pe=ee.children[0];ee.children.length===1&&pe instanceof wt.TextNode?pe.text=pe.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):C=!1;break}default:C=!1}else C=!1}if(C){var ve=y.map(function(Ye){return Ye.toText()}).join("");y=[new wt.TextNode(ve)]}var Ce=new wt.MathNode("mi",y);Ce.setAttribute("mathvariant","normal");var $e=new wt.MathNode("mo",[vi("\u2061","text")]);return p.parentIsSupSub?new wt.MathNode("mo",[Ce,$e]):wt.newDocumentFragment([Ce,$e])};jt({type:"operatorname",names:["\\operatorname","\\operatorname*"],props:{numArgs:1},handler:function(p,v){var y=p.parser,C=p.funcName,q=v[0];return{type:"operatorname",mode:y.mode,body:Jr(q),alwaysHandleSupSub:C==="\\operatorname*",limits:!1,parentIsSupSub:!1}},htmlBuilder:Ma,mathmlBuilder:ws}),Bi({type:"ordgroup",htmlBuilder:function(p,v){return p.semisimple?et.makeFragment(Kr(p.body,v,!1)):et.makeSpan(["mord"],Kr(p.body,v,!0),v)},mathmlBuilder:function(p,v){return ei(p.body,v,!0)}}),jt({type:"overline",names:["\\overline"],props:{numArgs:1},handler:function(p,v){var y=p.parser,C=v[0];return{type:"overline",mode:y.mode,body:C}},htmlBuilder:function(p,v){var y=br(p.body,v.havingCrampedStyle()),C=et.makeLineSpan("overline-line",v),q=v.fontMetrics().defaultRuleThickness,ee=et.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:y},{type:"kern",size:3*q},{type:"elem",elem:C},{type:"kern",size:q}]},v);return et.makeSpan(["mord","overline"],[ee],v)},mathmlBuilder:function(p,v){var y=new wt.MathNode("mo",[new wt.TextNode("\u203E")]);y.setAttribute("stretchy","true");var C=new wt.MathNode("mover",[Dr(p.body,v),y]);return C.setAttribute("accent","true"),C}}),jt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var y=p.parser,C=v[0];return{type:"phantom",mode:y.mode,body:Jr(C)}},htmlBuilder:function(p,v){var y=Kr(p.body,v.withPhantom(),!1);return et.makeFragment(y)},mathmlBuilder:function(p,v){var y=li(p.body,v);return new wt.MathNode("mphantom",y)}}),jt({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var y=p.parser,C=v[0];return{type:"hphantom",mode:y.mode,body:C}},htmlBuilder:function(p,v){var y=et.makeSpan([],[br(p.body,v.withPhantom())]);if(y.height=0,y.depth=0,y.children)for(var C=0;C<y.children.length;C++)y.children[C].height=0,y.children[C].depth=0;return y=et.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:y}]},v),et.makeSpan(["mord"],[y],v)},mathmlBuilder:function(p,v){var y=li(Jr(p.body),v),C=new wt.MathNode("mphantom",y),q=new wt.MathNode("mpadded",[C]);return q.setAttribute("height","0px"),q.setAttribute("depth","0px"),q}}),jt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var y=p.parser,C=v[0];return{type:"vphantom",mode:y.mode,body:C}},htmlBuilder:function(p,v){var y=et.makeSpan(["inner"],[br(p.body,v.withPhantom())]),C=et.makeSpan(["fix"],[]);return et.makeSpan(["mord","rlap"],[y,C],v)},mathmlBuilder:function(p,v){var y=li(Jr(p.body),v),C=new wt.MathNode("mphantom",y),q=new wt.MathNode("mpadded",[C]);return q.setAttribute("width","0px"),q}}),jt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler:function(p,v){var y=p.parser,C=rr(v[0],"size").value,q=v[1];return{type:"raisebox",mode:y.mode,dy:C,body:q}},htmlBuilder:function(p,v){var y=br(p.body,v),C=mr(p.dy,v);return et.makeVList({positionType:"shift",positionData:-C,children:[{type:"elem",elem:y}]},v)},mathmlBuilder:function(p,v){var y=new wt.MathNode("mpadded",[Dr(p.body,v)]),C=p.dy.number+p.dy.unit;return y.setAttribute("voffset",C),y}}),jt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler:function(p,v,y){var C=p.parser,q=y[0],ee=rr(v[0],"size"),pe=rr(v[1],"size");return{type:"rule",mode:C.mode,shift:q&&rr(q,"size").value,width:ee.value,height:pe.value}},htmlBuilder:function(p,v){var y=et.makeSpan(["mord","rule"],[],v),C=mr(p.width,v),q=mr(p.height,v),ee=p.shift?mr(p.shift,v):0;return y.style.borderRightWidth=C+"em",y.style.borderTopWidth=q+"em",y.style.bottom=ee+"em",y.width=C,y.height=q+ee,y.depth=-ee,y.maxFontSize=q*1.125*v.sizeMultiplier,y},mathmlBuilder:function(p,v){var y=mr(p.width,v),C=mr(p.height,v),q=p.shift?mr(p.shift,v):0,ee=v.color&&v.getColor()||"black",pe=new wt.MathNode("mspace");pe.setAttribute("mathbackground",ee),pe.setAttribute("width",y+"em"),pe.setAttribute("height",C+"em");var ve=new wt.MathNode("mpadded",[pe]);return q>=0?ve.setAttribute("height","+"+q+"em"):(ve.setAttribute("height",q+"em"),ve.setAttribute("depth","+"+-q+"em")),ve.setAttribute("voffset",q+"em"),ve}});function Fa(re,p,v){for(var y=Kr(re,p,!1),C=p.sizeMultiplier/v.sizeMultiplier,q=0;q<y.length;q++){var ee=y[q].classes.indexOf("sizing");ee<0?Array.prototype.push.apply(y[q].classes,p.sizingClasses(v)):y[q].classes[ee+1]==="reset-size"+p.size&&(y[q].classes[ee+1]="reset-size"+v.size),y[q].height*=C,y[q].depth*=C}return et.makeFragment(y)}var Ba=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],Na=function(p,v){var y=v.havingSize(p.size);return Fa(p.body,y,v)};jt({type:"sizing",names:Ba,props:{numArgs:0,allowedInText:!0},handler:function(p,v){var y=p.breakOnTokenText,C=p.funcName,q=p.parser,ee=q.parseExpression(!1,y);return{type:"sizing",mode:q.mode,size:Ba.indexOf(C)+1,body:ee}},htmlBuilder:Na,mathmlBuilder:function(p,v){var y=v.havingSize(p.size),C=li(p.body,y),q=new wt.MathNode("mstyle",C);return q.setAttribute("mathsize",y.sizeMultiplier+"em"),q}}),jt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(p,v,y){var C=p.parser,q=!1,ee=!1,pe=y[0]&&rr(y[0],"ordgroup");if(pe)for(var ve="",Ce=0;Ce<pe.body.length;++Ce){var $e=pe.body[Ce];if(ve=$e.text,ve==="t")q=!0;else if(ve==="b")ee=!0;else{q=!1,ee=!1;break}}else q=!0,ee=!0;var Ye=v[0];return{type:"smash",mode:C.mode,body:Ye,smashHeight:q,smashDepth:ee}},htmlBuilder:function(p,v){var y=et.makeSpan([],[br(p.body,v)]);if(!p.smashHeight&&!p.smashDepth)return y;if(p.smashHeight&&(y.height=0,y.children))for(var C=0;C<y.children.length;C++)y.children[C].height=0;if(p.smashDepth&&(y.depth=0,y.children))for(var q=0;q<y.children.length;q++)y.children[q].depth=0;var ee=et.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:y}]},v);return et.makeSpan(["mord"],[ee],v)},mathmlBuilder:function(p,v){var y=new wt.MathNode("mpadded",[Dr(p.body,v)]);return p.smashHeight&&y.setAttribute("height","0px"),p.smashDepth&&y.setAttribute("depth","0px"),y}}),jt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler:function(p,v,y){var C=p.parser,q=y[0],ee=v[0];return{type:"sqrt",mode:C.mode,body:ee,index:q}},htmlBuilder:function(p,v){var y=br(p.body,v.havingCrampedStyle());y.height===0&&(y.height=v.fontMetrics().xHeight),y=et.wrapFragment(y,v);var C=v.fontMetrics(),q=C.defaultRuleThickness,ee=q;v.style.id<M.TEXT.id&&(ee=v.fontMetrics().xHeight);var pe=q+ee/4,ve=y.height+y.depth+pe+q,Ce=gn.sqrtImage(ve,v),$e=Ce.span,Ye=Ce.ruleWidth,lt=Ce.advanceWidth,dt=$e.height-Ye;dt>y.height+y.depth+pe&&(pe=(pe+dt-y.height-y.depth)/2);var bt=$e.height-y.height-pe-Ye;y.style.paddingLeft=lt+"em";var Rt=et.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:y,wrapperClasses:["svg-align"]},{type:"kern",size:-(y.height+bt)},{type:"elem",elem:$e},{type:"kern",size:Ye}]},v);if(p.index){var Be=v.havingStyle(M.SCRIPTSCRIPT),ar=br(p.index,Be,v),or=.6*(Rt.height-Rt.depth),dr=et.makeVList({positionType:"shift",positionData:-or,children:[{type:"elem",elem:ar}]},v),Ir=et.makeSpan(["root"],[dr]);return et.makeSpan(["mord","sqrt"],[Ir,Rt],v)}else return et.makeSpan(["mord","sqrt"],[Rt],v)},mathmlBuilder:function(p,v){var y=p.body,C=p.index;return C?new wt.MathNode("mroot",[Dr(y,v),Dr(C,v)]):new wt.MathNode("msqrt",[Dr(y,v)])}});var Ks={display:M.DISPLAY,text:M.TEXT,script:M.SCRIPT,scriptscript:M.SCRIPTSCRIPT};jt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0},handler:function(p,v){var y=p.breakOnTokenText,C=p.funcName,q=p.parser,ee=q.parseExpression(!0,y),pe=C.slice(1,C.length-5);return{type:"styling",mode:q.mode,style:pe,body:ee}},htmlBuilder:function(p,v){var y=Ks[p.style],C=v.havingStyle(y).withFont("");return Fa(p.body,C,v)},mathmlBuilder:function(p,v){var y=Ks[p.style],C=v.havingStyle(y),q=li(p.body,C),ee=new wt.MathNode("mstyle",q),pe={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},ve=pe[p.style];return ee.setAttribute("scriptlevel",ve[0]),ee.setAttribute("displaystyle",ve[1]),ee}});var mo=function(p,v){var y=p.base;if(y)if(y.type==="op"){var C=y.limits&&(v.style.size===M.DISPLAY.size||y.alwaysHandleSupSub);return C?Yn:null}else if(y.type==="operatorname"){var q=y.alwaysHandleSupSub&&(v.style.size===M.DISPLAY.size||y.limits);return q?Ma:null}else{if(y.type==="accent")return k.isCharacterBox(y.base)?Wr:null;if(y.type==="horizBrace"){var ee=!p.sub;return ee===y.isOver?Oa:null}else return null}else return null};Bi({type:"supsub",htmlBuilder:function(p,v){var y=mo(p,v);if(y)return y(p,v);var C=p.base,q=p.sup,ee=p.sub,pe=br(C,v),ve,Ce,$e=v.fontMetrics(),Ye=0,lt=0,dt=C&&k.isCharacterBox(C);if(q){var bt=v.havingStyle(v.style.sup());ve=br(q,bt,v),dt||(Ye=pe.height-bt.fontMetrics().supDrop*bt.sizeMultiplier/v.sizeMultiplier)}if(ee){var Rt=v.havingStyle(v.style.sub());Ce=br(ee,Rt,v),dt||(lt=pe.depth+Rt.fontMetrics().subDrop*Rt.sizeMultiplier/v.sizeMultiplier)}var Be;v.style===M.DISPLAY?Be=$e.sup1:v.style.cramped?Be=$e.sup3:Be=$e.sup2;var ar=v.sizeMultiplier,or=.5/$e.ptPerEm/ar+"em",dr=null;if(Ce){var Ir=p.base&&p.base.type==="op"&&p.base.name&&(p.base.name==="\\oiint"||p.base.name==="\\oiiint");(pe instanceof be||Ir)&&(dr=-pe.italic+"em")}var Nr;if(ve&&Ce){Ye=Math.max(Ye,Be,ve.depth+.25*$e.xHeight),lt=Math.max(lt,$e.sub2);var Yr=$e.defaultRuleThickness,Zr=4*Yr;if(Ye-ve.depth-(Ce.height-lt)<Zr){lt=Zr-(Ye-ve.depth)+Ce.height;var ri=.8*$e.xHeight-(Ye-ve.depth);ri>0&&(Ye+=ri,lt-=ri)}var Ei=[{type:"elem",elem:Ce,shift:lt,marginRight:or,marginLeft:dr},{type:"elem",elem:ve,shift:-Ye,marginRight:or}];Nr=et.makeVList({positionType:"individualShift",children:Ei},v)}else if(Ce){lt=Math.max(lt,$e.sub1,Ce.height-.8*$e.xHeight);var ii=[{type:"elem",elem:Ce,marginLeft:dr,marginRight:or}];Nr=et.makeVList({positionType:"shift",positionData:lt,children:ii},v)}else if(ve)Ye=Math.max(Ye,Be,ve.depth+.25*$e.xHeight),Nr=et.makeVList({positionType:"shift",positionData:-Ye,children:[{type:"elem",elem:ve,marginRight:or}]},v);else throw new Error("supsub must have either sup or sub.");var Or=Ui(pe,"right")||"mord";return et.makeSpan([Or],[pe,et.makeSpan(["msupsub"],[Nr])],v)},mathmlBuilder:function(p,v){var y=!1,C,q,ee=Mr(p.base,"horizBrace");ee&&(q=!!p.sup,q===ee.isOver&&(y=!0,C=ee.isOver)),p.base&&(p.base.type==="op"||p.base.type==="operatorname")&&(p.base.parentIsSupSub=!0);var pe=[Dr(p.base,v)];p.sub&&pe.push(Dr(p.sub,v)),p.sup&&pe.push(Dr(p.sup,v));var ve;if(y)ve=C?"mover":"munder";else if(p.sub)if(p.sup){var Ye=p.base;Ye&&Ye.type==="op"&&Ye.limits&&v.style===M.DISPLAY||Ye&&Ye.type==="operatorname"&&Ye.alwaysHandleSupSub&&(v.style===M.DISPLAY||Ye.limits)?ve="munderover":ve="msubsup"}else{var $e=p.base;$e&&$e.type==="op"&&$e.limits&&(v.style===M.DISPLAY||$e.alwaysHandleSupSub)||$e&&$e.type==="operatorname"&&$e.alwaysHandleSupSub&&($e.limits||v.style===M.DISPLAY)?ve="munder":ve="msub"}else{var Ce=p.base;Ce&&Ce.type==="op"&&Ce.limits&&(v.style===M.DISPLAY||Ce.alwaysHandleSupSub)||Ce&&Ce.type==="operatorname"&&Ce.alwaysHandleSupSub&&(Ce.limits||v.style===M.DISPLAY)?ve="mover":ve="msup"}var lt=new wt.MathNode(ve,pe);return lt}}),Bi({type:"atom",htmlBuilder:function(p,v){return et.mathsym(p.text,p.mode,v,["m"+p.family])},mathmlBuilder:function(p,v){var y=new wt.MathNode("mo",[vi(p.text,p.mode)]);if(p.family==="bin"){var C=An(p,v);C==="bold-italic"&&y.setAttribute("mathvariant",C)}else p.family==="punct"?y.setAttribute("separator","true"):(p.family==="open"||p.family==="close")&&y.setAttribute("stretchy","false");return y}});var Vs={mi:"italic",mn:"normal",mtext:"normal"};Bi({type:"mathord",htmlBuilder:function(p,v){return et.makeOrd(p,v,"mathord")},mathmlBuilder:function(p,v){var y=new wt.MathNode("mi",[vi(p.text,p.mode,v)]),C=An(p,v)||"italic";return C!==Vs[y.type]&&y.setAttribute("mathvariant",C),y}}),Bi({type:"textord",htmlBuilder:function(p,v){return et.makeOrd(p,v,"textord")},mathmlBuilder:function(p,v){var y=vi(p.text,p.mode,v),C=An(p,v)||"normal",q;return p.mode==="text"?q=new wt.MathNode("mtext",[y]):/[0-9]/.test(p.text)?q=new wt.MathNode("mn",[y]):p.text==="\\prime"?q=new wt.MathNode("mo",[y]):q=new wt.MathNode("mi",[y]),C!==Vs[q.type]&&q.setAttribute("mathvariant",C),q}});var qs={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Ys={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Bi({type:"spacing",htmlBuilder:function(p,v){if(Ys.hasOwnProperty(p.text)){var y=Ys[p.text].className||"";if(p.mode==="text"){var C=et.makeOrd(p,v,"textord");return C.classes.push(y),C}else return et.makeSpan(["mspace",y],[et.mathsym(p.text,p.mode,v)],v)}else{if(qs.hasOwnProperty(p.text))return et.makeSpan(["mspace",qs[p.text]],[],v);throw new d('Unknown type of space "'+p.text+'"')}},mathmlBuilder:function(p,v){var y;if(Ys.hasOwnProperty(p.text))y=new wt.MathNode("mtext",[new wt.TextNode("\xA0")]);else{if(qs.hasOwnProperty(p.text))return new wt.MathNode("mspace");throw new d('Unknown type of space "'+p.text+'"')}return y}});var Ua=function(){var p=new wt.MathNode("mtd",[]);return p.setAttribute("width","50%"),p};Bi({type:"tag",mathmlBuilder:function(p,v){var y=new wt.MathNode("mtable",[new wt.MathNode("mtr",[Ua(),new wt.MathNode("mtd",[ei(p.body,v)]),Ua(),new wt.MathNode("mtd",[ei(p.tag,v)])])]);return y.setAttribute("width","100%"),y}});var $a={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},za={"\\textbf":"textbf","\\textmd":"textmd"},Ha={"\\textit":"textit","\\textup":"textup"},ja=function(p,v){var y=p.font;return y?$a[y]?v.withTextFontFamily($a[y]):za[y]?v.withTextFontWeight(za[y]):v.withTextFontShape(Ha[y]):v};jt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],greediness:2,allowedInText:!0},handler:function(p,v){var y=p.parser,C=p.funcName,q=v[0];return{type:"text",mode:y.mode,body:Jr(q),font:C}},htmlBuilder:function(p,v){var y=ja(p,v),C=Kr(p.body,y,!0);return et.makeSpan(["mord","text"],et.tryCombineChars(C),y)},mathmlBuilder:function(p,v){var y=ja(p,v);return ei(p.body,y)}}),jt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var y=p.parser;return{type:"underline",mode:y.mode,body:v[0]}},htmlBuilder:function(p,v){var y=br(p.body,v),C=et.makeLineSpan("underline-line",v),q=v.fontMetrics().defaultRuleThickness,ee=et.makeVList({positionType:"top",positionData:y.height,children:[{type:"kern",size:q},{type:"elem",elem:C},{type:"kern",size:3*q},{type:"elem",elem:y}]},v);return et.makeSpan(["mord","underline"],[ee],v)},mathmlBuilder:function(p,v){var y=new wt.MathNode("mo",[new wt.TextNode("\u203E")]);y.setAttribute("stretchy","true");var C=new wt.MathNode("munder",[Dr(p.body,v),y]);return C.setAttribute("accentunder","true"),C}}),jt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(p,v,y){throw new d("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(p,v){for(var y=Wa(p),C=[],q=v.havingStyle(v.style.text()),ee=0;ee<y.length;ee++){var pe=y[ee];pe==="~"&&(pe="\\textasciitilde"),C.push(et.makeSymbol(pe,"Typewriter-Regular",p.mode,q,["mord","texttt"]))}return et.makeSpan(["mord","text"].concat(q.sizingClasses(v)),et.tryCombineChars(C),q)},mathmlBuilder:function(p,v){var y=new wt.TextNode(Wa(p)),C=new wt.MathNode("mtext",[y]);return C.setAttribute("mathvariant","monospace"),C}});var Wa=function(p){return p.body.replace(/ /g,p.star?"\u2423":"\xA0")},go=Gn,$n=go,Zs=`[ \r
|
|
|
]`,Ga="\\\\[a-zA-Z@]+",_o="\\\\[^\uD800-\uDFFF]",vo=""+Ga+Zs+"*",yo=new RegExp("^("+Ga+")"+Zs+"*$"),Xs="[\u0300-\u036F]",As=new RegExp(Xs+"+$"),bo="("+Zs+"+)|([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(Xs+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Xs+"*")+"|\\\\verb\\*([^]).*?\\3|\\\\verb([^*a-zA-Z]).*?\\4|\\\\operatorname\\*"+("|"+vo)+("|"+_o+")"),Qs=function(){function re(v,y){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=v,this.settings=y,this.tokenRegex=new RegExp(bo,"g"),this.catcodes={"%":14}}var p=re.prototype;return p.setCatcode=function(y,C){this.catcodes[y]=C},p.lex=function(){var y=this.input,C=this.tokenRegex.lastIndex;if(C===y.length)return new I("EOF",new V(this,C,C));var q=this.tokenRegex.exec(y);if(q===null||q.index!==C)throw new d("Unexpected character: '"+y[C]+"'",new I(y[C],new V(this,C,C+1)));var ee=q[2]||" ";if(this.catcodes[ee]===14){var pe=y.indexOf(`
|
|
|
`,this.tokenRegex.lastIndex);return pe===-1?(this.tokenRegex.lastIndex=y.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=pe+1,this.lex()}var ve=ee.match(yo);return ve&&(ee=ve[1]),new I(ee,new V(this,C,this.tokenRegex.lastIndex))},re}(),Ka=function(){function re(v,y){v===void 0&&(v={}),y===void 0&&(y={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=y,this.builtins=v,this.undefStack=[]}var p=re.prototype;return p.beginGroup=function(){this.undefStack.push({})},p.endGroup=function(){if(this.undefStack.length===0)throw new d("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var y=this.undefStack.pop();for(var C in y)y.hasOwnProperty(C)&&(y[C]===void 0?delete this.current[C]:this.current[C]=y[C])},p.has=function(y){return this.current.hasOwnProperty(y)||this.builtins.hasOwnProperty(y)},p.get=function(y){return this.current.hasOwnProperty(y)?this.current[y]:this.builtins[y]},p.set=function(y,C,q){if(q===void 0&&(q=!1),q){for(var ee=0;ee<this.undefStack.length;ee++)delete this.undefStack[ee][y];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][y]=C)}else{var pe=this.undefStack[this.undefStack.length-1];pe&&!pe.hasOwnProperty(y)&&(pe[y]=this.current[y])}this.current[y]=C},re}(),Va={},Js=Va;function Se(re,p){Va[re]=p}Se("\\@firstoftwo",function(re){var p=re.consumeArgs(2);return{tokens:p[0],numArgs:0}}),Se("\\@secondoftwo",function(re){var p=re.consumeArgs(2);return{tokens:p[1],numArgs:0}}),Se("\\@ifnextchar",function(re){var p=re.consumeArgs(3),v=re.future();return p[0].length===1&&p[0][0].text===v.text?{tokens:p[1],numArgs:0}:{tokens:p[2],numArgs:0}}),Se("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Se("\\TextOrMath",function(re){var p=re.consumeArgs(2);return re.mode==="text"?{tokens:p[0],numArgs:0}:{tokens:p[1],numArgs:0}});var qi={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Se("\\char",function(re){var p=re.popToken(),v,y="";if(p.text==="'")v=8,p=re.popToken();else if(p.text==='"')v=16,p=re.popToken();else if(p.text==="`")if(p=re.popToken(),p.text[0]==="\\")y=p.text.charCodeAt(1);else{if(p.text==="EOF")throw new d("\\char` missing argument");y=p.text.charCodeAt(0)}else v=10;if(v){if(y=qi[p.text],y==null||y>=v)throw new d("Invalid base-"+v+" digit "+p.text);for(var C;(C=qi[re.future().text])!=null&&C<v;)y*=v,y+=C,re.popToken()}return"\\@char{"+y+"}"});var as=function(p,v){var y=p.consumeArgs(1)[0];if(y.length!==1)throw new d("\\gdef's first argument must be a macro name");var C=y[0].text,q=0;for(y=p.consumeArgs(1)[0];y.length===1&&y[0].text==="#";){if(y=p.consumeArgs(1)[0],y.length!==1)throw new d('Invalid argument number length "'+y.length+'"');if(!/^[1-9]$/.test(y[0].text))throw new d('Invalid argument number "'+y[0].text+'"');if(q++,parseInt(y[0].text)!==q)throw new d('Argument number "'+y[0].text+'" out of order');y=p.consumeArgs(1)[0]}return p.macros.set(C,{tokens:y,numArgs:q},v),""};Se("\\gdef",function(re){return as(re,!0)}),Se("\\def",function(re){return as(re,!1)}),Se("\\global",function(re){var p=re.consumeArgs(1)[0];if(p.length!==1)throw new d("Invalid command after \\global");var v=p[0].text;if(v==="\\def")return as(re,!0);throw new d("Invalid command '"+v+"' after \\global")});var ea=function(p,v,y){var C=p.consumeArgs(1)[0];if(C.length!==1)throw new d("\\newcommand's first argument must be a macro name");var q=C[0].text,ee=p.isDefined(q);if(ee&&!v)throw new d("\\newcommand{"+q+"} attempting to redefine "+(q+"; use \\renewcommand"));if(!ee&&!y)throw new d("\\renewcommand{"+q+"} when command "+q+" does not yet exist; use \\newcommand");var pe=0;if(C=p.consumeArgs(1)[0],C.length===1&&C[0].text==="["){for(var ve="",Ce=p.expandNextToken();Ce.text!=="]"&&Ce.text!=="EOF";)ve+=Ce.text,Ce=p.expandNextToken();if(!ve.match(/^\s*[0-9]+\s*$/))throw new d("Invalid number of arguments: "+ve);pe=parseInt(ve),C=p.consumeArgs(1)[0]}return p.macros.set(q,{tokens:C,numArgs:pe}),""};Se("\\newcommand",function(re){return ea(re,!1,!0)}),Se("\\renewcommand",function(re){return ea(re,!0,!1)}),Se("\\providecommand",function(re){return ea(re,!0,!0)}),Se("\\bgroup","{"),Se("\\egroup","}"),Se("\\lq","`"),Se("\\rq","'"),Se("\\aa","\\r a"),Se("\\AA","\\r A"),Se("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}"),Se("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Se("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}"),Se("\u212C","\\mathscr{B}"),Se("\u2130","\\mathscr{E}"),Se("\u2131","\\mathscr{F}"),Se("\u210B","\\mathscr{H}"),Se("\u2110","\\mathscr{I}"),Se("\u2112","\\mathscr{L}"),Se("\u2133","\\mathscr{M}"),Se("\u211B","\\mathscr{R}"),Se("\u212D","\\mathfrak{C}"),Se("\u210C","\\mathfrak{H}"),Se("\u2128","\\mathfrak{Z}"),Se("\\Bbbk","\\Bbb{k}"),Se("\xB7","\\cdotp"),Se("\\llap","\\mathllap{\\textrm{#1}}"),Se("\\rlap","\\mathrlap{\\textrm{#1}}"),Se("\\clap","\\mathclap{\\textrm{#1}}"),Se("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Se("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"),Se("\\ne","\\neq"),Se("\u2260","\\neq"),Se("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"),Se("\u2209","\\notin"),Se("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"),Se("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"),Se("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}"),Se("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}"),Se("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}"),Se("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}"),Se("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}"),Se("\u27C2","\\perp"),Se("\u203C","\\mathclose{!\\mkern-0.8mu!}"),Se("\u220C","\\notni"),Se("\u231C","\\ulcorner"),Se("\u231D","\\urcorner"),Se("\u231E","\\llcorner"),Se("\u231F","\\lrcorner"),Se("\xA9","\\copyright"),Se("\xAE","\\textregistered"),Se("\uFE0F","\\textregistered"),Se("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),Se("\u22EE","\\vdots"),Se("\\varGamma","\\mathit{\\Gamma}"),Se("\\varDelta","\\mathit{\\Delta}"),Se("\\varTheta","\\mathit{\\Theta}"),Se("\\varLambda","\\mathit{\\Lambda}"),Se("\\varXi","\\mathit{\\Xi}"),Se("\\varPi","\\mathit{\\Pi}"),Se("\\varSigma","\\mathit{\\Sigma}"),Se("\\varUpsilon","\\mathit{\\Upsilon}"),Se("\\varPhi","\\mathit{\\Phi}"),Se("\\varPsi","\\mathit{\\Psi}"),Se("\\varOmega","\\mathit{\\Omega}"),Se("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Se("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu"),Se("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Se("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Se("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Se("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var os={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};Se("\\dots",function(re){var p="\\dotso",v=re.expandAfterFuture().text;return v in os?p=os[v]:(v.substr(0,4)==="\\not"||v in Nt.math&&k.contains(["bin","rel"],Nt.math[v].group))&&(p="\\dotsb"),p});var ta={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Se("\\dotso",function(re){var p=re.future().text;return p in ta?"\\ldots\\,":"\\ldots"}),Se("\\dotsc",function(re){var p=re.future().text;return p in ta&&p!==","?"\\ldots\\,":"\\ldots"}),Se("\\cdots",function(re){var p=re.future().text;return p in ta?"\\@cdots\\,":"\\@cdots"}),Se("\\dotsb","\\cdots"),Se("\\dotsm","\\cdots"),Se("\\dotsi","\\!\\cdots"),Se("\\dotsx","\\ldots\\,"),Se("\\DOTSI","\\relax"),Se("\\DOTSB","\\relax"),Se("\\DOTSX","\\relax"),Se("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Se("\\,","\\tmspace+{3mu}{.1667em}"),Se("\\thinspace","\\,"),Se("\\>","\\mskip{4mu}"),Se("\\:","\\tmspace+{4mu}{.2222em}"),Se("\\medspace","\\:"),Se("\\;","\\tmspace+{5mu}{.2777em}"),Se("\\thickspace","\\;"),Se("\\!","\\tmspace-{3mu}{.1667em}"),Se("\\negthinspace","\\!"),Se("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Se("\\negthickspace","\\tmspace-{5mu}{.277em}"),Se("\\enspace","\\kern.5em "),Se("\\enskip","\\hskip.5em\\relax"),Se("\\quad","\\hskip1em\\relax"),Se("\\qquad","\\hskip2em\\relax"),Se("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Se("\\tag@paren","\\tag@literal{({#1})}"),Se("\\tag@literal",function(re){if(re.macros.get("\\df@tag"))throw new d("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Se("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Se("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Se("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Se("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Se("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),Se("\\\\","\\newline"),Se("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var qa=at["Main-Regular"][84][1]-.7*at["Main-Regular"][65][1]+"em";Se("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+qa+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),Se("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+qa+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),Se("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Se("\\@hspace","\\hskip #1\\relax"),Se("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Se("\\ordinarycolon",":"),Se("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Se("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Se("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Se("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Se("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Se("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Se("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Se("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Se("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Se("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Se("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Se("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Se("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Se("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Se("\u2237","\\dblcolon"),Se("\u2239","\\eqcolon"),Se("\u2254","\\coloneqq"),Se("\u2255","\\eqqcolon"),Se("\u2A74","\\Coloneqq"),Se("\\ratio","\\vcentcolon"),Se("\\coloncolon","\\dblcolon"),Se("\\colonequals","\\coloneqq"),Se("\\coloncolonequals","\\Coloneqq"),Se("\\equalscolon","\\eqqcolon"),Se("\\equalscoloncolon","\\Eqqcolon"),Se("\\colonminus","\\coloneq"),Se("\\coloncolonminus","\\Coloneq"),Se("\\minuscolon","\\eqcolon"),Se("\\minuscoloncolon","\\Eqcolon"),Se("\\coloncolonapprox","\\Colonapprox"),Se("\\coloncolonsim","\\Colonsim"),Se("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Se("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Se("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Se("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Se("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}"),Se("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Se("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Se("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),Se("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),Se("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),Se("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),Se("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),Se("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),Se("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),Se("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),Se("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),Se("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),Se("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}"),Se("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}"),Se("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}"),Se("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}"),Se("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}"),Se("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}"),Se("\u27E6","\\llbracket"),Se("\u27E7","\\rrbracket"),Se("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),Se("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),Se("\u2983","\\lBrace"),Se("\u2984","\\rBrace"),Se("\\darr","\\downarrow"),Se("\\dArr","\\Downarrow"),Se("\\Darr","\\Downarrow"),Se("\\lang","\\langle"),Se("\\rang","\\rangle"),Se("\\uarr","\\uparrow"),Se("\\uArr","\\Uparrow"),Se("\\Uarr","\\Uparrow"),Se("\\N","\\mathbb{N}"),Se("\\R","\\mathbb{R}"),Se("\\Z","\\mathbb{Z}"),Se("\\alef","\\aleph"),Se("\\alefsym","\\aleph"),Se("\\Alpha","\\mathrm{A}"),Se("\\Beta","\\mathrm{B}"),Se("\\bull","\\bullet"),Se("\\Chi","\\mathrm{X}"),Se("\\clubs","\\clubsuit"),Se("\\cnums","\\mathbb{C}"),Se("\\Complex","\\mathbb{C}"),Se("\\Dagger","\\ddagger"),Se("\\diamonds","\\diamondsuit"),Se("\\empty","\\emptyset"),Se("\\Epsilon","\\mathrm{E}"),Se("\\Eta","\\mathrm{H}"),Se("\\exist","\\exists"),Se("\\harr","\\leftrightarrow"),Se("\\hArr","\\Leftrightarrow"),Se("\\Harr","\\Leftrightarrow"),Se("\\hearts","\\heartsuit"),Se("\\image","\\Im"),Se("\\infin","\\infty"),Se("\\Iota","\\mathrm{I}"),Se("\\isin","\\in"),Se("\\Kappa","\\mathrm{K}"),Se("\\larr","\\leftarrow"),Se("\\lArr","\\Leftarrow"),Se("\\Larr","\\Leftarrow"),Se("\\lrarr","\\leftrightarrow"),Se("\\lrArr","\\Leftrightarrow"),Se("\\Lrarr","\\Leftrightarrow"),Se("\\Mu","\\mathrm{M}"),Se("\\natnums","\\mathbb{N}"),Se("\\Nu","\\mathrm{N}"),Se("\\Omicron","\\mathrm{O}"),Se("\\plusmn","\\pm"),Se("\\rarr","\\rightarrow"),Se("\\rArr","\\Rightarrow"),Se("\\Rarr","\\Rightarrow"),Se("\\real","\\Re"),Se("\\reals","\\mathbb{R}"),Se("\\Reals","\\mathbb{R}"),Se("\\Rho","\\mathrm{P}"),Se("\\sdot","\\cdot"),Se("\\sect","\\S"),Se("\\spades","\\spadesuit"),Se("\\sub","\\subset"),Se("\\sube","\\subseteq"),Se("\\supe","\\supseteq"),Se("\\Tau","\\mathrm{T}"),Se("\\thetasym","\\vartheta"),Se("\\weierp","\\wp"),Se("\\Zeta","\\mathrm{Z}"),Se("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Se("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Se("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Se("\\blue","\\textcolor{##6495ed}{#1}"),Se("\\orange","\\textcolor{##ffa500}{#1}"),Se("\\pink","\\textcolor{##ff00af}{#1}"),Se("\\red","\\textcolor{##df0030}{#1}"),Se("\\green","\\textcolor{##28ae7b}{#1}"),Se("\\gray","\\textcolor{gray}{#1}"),Se("\\purple","\\textcolor{##9d38bd}{#1}"),Se("\\blueA","\\textcolor{##ccfaff}{#1}"),Se("\\blueB","\\textcolor{##80f6ff}{#1}"),Se("\\blueC","\\textcolor{##63d9ea}{#1}"),Se("\\blueD","\\textcolor{##11accd}{#1}"),Se("\\blueE","\\textcolor{##0c7f99}{#1}"),Se("\\tealA","\\textcolor{##94fff5}{#1}"),Se("\\tealB","\\textcolor{##26edd5}{#1}"),Se("\\tealC","\\textcolor{##01d1c1}{#1}"),Se("\\tealD","\\textcolor{##01a995}{#1}"),Se("\\tealE","\\textcolor{##208170}{#1}"),Se("\\greenA","\\textcolor{##b6ffb0}{#1}"),Se("\\greenB","\\textcolor{##8af281}{#1}"),Se("\\greenC","\\textcolor{##74cf70}{#1}"),Se("\\greenD","\\textcolor{##1fab54}{#1}"),Se("\\greenE","\\textcolor{##0d923f}{#1}"),Se("\\goldA","\\textcolor{##ffd0a9}{#1}"),Se("\\goldB","\\textcolor{##ffbb71}{#1}"),Se("\\goldC","\\textcolor{##ff9c39}{#1}"),Se("\\goldD","\\textcolor{##e07d10}{#1}"),Se("\\goldE","\\textcolor{##a75a05}{#1}"),Se("\\redA","\\textcolor{##fca9a9}{#1}"),Se("\\redB","\\textcolor{##ff8482}{#1}"),Se("\\redC","\\textcolor{##f9685d}{#1}"),Se("\\redD","\\textcolor{##e84d39}{#1}"),Se("\\redE","\\textcolor{##bc2612}{#1}"),Se("\\maroonA","\\textcolor{##ffbde0}{#1}"),Se("\\maroonB","\\textcolor{##ff92c6}{#1}"),Se("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Se("\\maroonD","\\textcolor{##ca337c}{#1}"),Se("\\maroonE","\\textcolor{##9e034e}{#1}"),Se("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Se("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Se("\\purpleC","\\textcolor{##aa87ff}{#1}"),Se("\\purpleD","\\textcolor{##7854ab}{#1}"),Se("\\purpleE","\\textcolor{##543b78}{#1}"),Se("\\mintA","\\textcolor{##f5f9e8}{#1}"),Se("\\mintB","\\textcolor{##edf2df}{#1}"),Se("\\mintC","\\textcolor{##e0e5cc}{#1}"),Se("\\grayA","\\textcolor{##f6f7f7}{#1}"),Se("\\grayB","\\textcolor{##f0f1f2}{#1}"),Se("\\grayC","\\textcolor{##e3e5e6}{#1}"),Se("\\grayD","\\textcolor{##d6d8da}{#1}"),Se("\\grayE","\\textcolor{##babec2}{#1}"),Se("\\grayF","\\textcolor{##888d93}{#1}"),Se("\\grayG","\\textcolor{##626569}{#1}"),Se("\\grayH","\\textcolor{##3b3e40}{#1}"),Se("\\grayI","\\textcolor{##21242c}{#1}"),Se("\\kaBlue","\\textcolor{##314453}{#1}"),Se("\\kaGreen","\\textcolor{##71B307}{#1}");var Ya={"\\relax":!0,"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},So=function(){function re(v,y,C){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=y,this.expansionCount=0,this.feed(v),this.macros=new Ka(Js,y.macros),this.mode=C,this.stack=[]}var p=re.prototype;return p.feed=function(y){this.lexer=new Qs(y,this.settings)},p.switchMode=function(y){this.mode=y},p.beginGroup=function(){this.macros.beginGroup()},p.endGroup=function(){this.macros.endGroup()},p.future=function(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},p.popToken=function(){return this.future(),this.stack.pop()},p.pushToken=function(y){this.stack.push(y)},p.pushTokens=function(y){var C;(C=this.stack).push.apply(C,y)},p.consumeSpaces=function(){for(;;){var y=this.future();if(y.text===" ")this.stack.pop();else break}},p.consumeArgs=function(y){for(var C=[],q=0;q<y;++q){this.consumeSpaces();var ee=this.popToken();if(ee.text==="{"){for(var pe=[],ve=1;ve!==0;){var Ce=this.popToken();if(pe.push(Ce),Ce.text==="{")++ve;else if(Ce.text==="}")--ve;else if(Ce.text==="EOF")throw new d("End of input in macro argument",ee)}pe.pop(),pe.reverse(),C[q]=pe}else{if(ee.text==="EOF")throw new d("End of input expecting macro argument");C[q]=[ee]}}return C},p.expandOnce=function(){var y=this.popToken(),C=y.text,q=this._getExpansion(C);if(q==null)return this.pushToken(y),y;if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new d("Too many expansions: infinite loop or need to increase maxExpand setting");var ee=q.tokens;if(q.numArgs){var pe=this.consumeArgs(q.numArgs);ee=ee.slice();for(var ve=ee.length-1;ve>=0;--ve){var Ce=ee[ve];if(Ce.text==="#"){if(ve===0)throw new d("Incomplete placeholder at end of macro body",Ce);if(Ce=ee[--ve],Ce.text==="#")ee.splice(ve+1,1);else if(/^[1-9]$/.test(Ce.text)){var $e;($e=ee).splice.apply($e,[ve,2].concat(pe[+Ce.text-1]))}else throw new d("Not a valid argument number",Ce)}}}return this.pushTokens(ee),ee},p.expandAfterFuture=function(){return this.expandOnce(),this.future()},p.expandNextToken=function(){for(;;){var y=this.expandOnce();if(y instanceof I)if(y.text==="\\relax")this.stack.pop();else return this.stack.pop()}throw new Error},p.expandMacro=function(y){if(this.macros.get(y)){var C=[],q=this.stack.length;for(this.pushToken(new I(y));this.stack.length>q;){var ee=this.expandOnce();ee instanceof I&&C.push(this.stack.pop())}return C}},p.expandMacroAsText=function(y){var C=this.expandMacro(y);return C&&C.map(function(q){return q.text}).join("")},p._getExpansion=function(y){var C=this.macros.get(y);if(C==null)return C;var q=typeof C=="function"?C(this):C;if(typeof q=="string"){var ee=0;if(q.indexOf("#")!==-1)for(var pe=q.replace(/##/g,"");pe.indexOf("#"+(ee+1))!==-1;)++ee;for(var ve=new Qs(q,this.settings),Ce=[],$e=ve.lex();$e.text!=="EOF";)Ce.push($e),$e=ve.lex();Ce.reverse();var Ye={tokens:Ce,numArgs:ee};return Ye}return q},p.isDefined=function(y){return this.macros.has(y)||$n.hasOwnProperty(y)||Nt.math.hasOwnProperty(y)||Nt.text.hasOwnProperty(y)||Ya.hasOwnProperty(y)},re}(),ra={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030C":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030A":{text:"\\r",math:"\\mathring"},"\u030B":{text:"\\H"}},ia={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"a\u030A",\u01FB:"a\u030A\u0301",\u1E03:"b\u0307",\u0107:"c\u0301",\u010D:"c\u030C",\u0109:"c\u0302",\u010B:"c\u0307",\u010F:"d\u030C",\u1E0B:"d\u0307",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"e\u0308",\u1EBD:"e\u0303",\u0113:"e\u0304",\u1E17:"e\u0304\u0301",\u1E15:"e\u0304\u0300",\u0115:"e\u0306",\u011B:"e\u030C",\u00EA:"e\u0302",\u1EBF:"e\u0302\u0301",\u1EC1:"e\u0302\u0300",\u1EC5:"e\u0302\u0303",\u0117:"e\u0307",\u1E1F:"f\u0307",\u01F5:"g\u0301",\u1E21:"g\u0304",\u011F:"g\u0306",\u01E7:"g\u030C",\u011D:"g\u0302",\u0121:"g\u0307",\u1E27:"h\u0308",\u021F:"h\u030C",\u0125:"h\u0302",\u1E23:"h\u0307",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"i\u0302",\u01F0:"j\u030C",\u0135:"j\u0302",\u1E31:"k\u0301",\u01E9:"k\u030C",\u013A:"l\u0301",\u013E:"l\u030C",\u1E3F:"m\u0301",\u1E41:"m\u0307",\u0144:"n\u0301",\u01F9:"n\u0300",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"o\u0303",\u1E4D:"o\u0303\u0301",\u1E4F:"o\u0303\u0308",\u022D:"o\u0303\u0304",\u014D:"o\u0304",\u1E53:"o\u0304\u0301",\u1E51:"o\u0304\u0300",\u014F:"o\u0306",\u01D2:"o\u030C",\u00F4:"o\u0302",\u1ED1:"o\u0302\u0301",\u1ED3:"o\u0302\u0300",\u1ED7:"o\u0302\u0303",\u022F:"o\u0307",\u0231:"o\u0307\u0304",\u0151:"o\u030B",\u1E55:"p\u0301",\u1E57:"p\u0307",\u0155:"r\u0301",\u0159:"r\u030C",\u1E59:"r\u0307",\u015B:"s\u0301",\u1E65:"s\u0301\u0307",\u0161:"s\u030C",\u1E67:"s\u030C\u0307",\u015D:"s\u0302",\u1E61:"s\u0307",\u1E97:"t\u0308",\u0165:"t\u030C",\u1E6B:"t\u0307",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"u\u0308",\u01D8:"u\u0308\u0301",\u01DC:"u\u0308\u0300",\u01D6:"u\u0308\u0304",\u01DA:"u\u0308\u030C",\u0169:"u\u0303",\u1E79:"u\u0303\u0301",\u016B:"u\u0304",\u1E7B:"u\u0304\u0308",\u016D:"u\u0306",\u01D4:"u\u030C",\u00FB:"u\u0302",\u016F:"u\u030A",\u0171:"u\u030B",\u1E7D:"v\u0303",\u1E83:"w\u0301",\u1E81:"w\u0300",\u1E85:"w\u0308",\u0175:"w\u0302",\u1E87:"w\u0307",\u1E98:"w\u030A",\u1E8D:"x\u0308",\u1E8B:"x\u0307",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"y\u0308",\u1EF9:"y\u0303",\u0233:"y\u0304",\u0177:"y\u0302",\u1E8F:"y\u0307",\u1E99:"y\u030A",\u017A:"z\u0301",\u017E:"z\u030C",\u1E91:"z\u0302",\u017C:"z\u0307",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"A\u030A",\u01FA:"A\u030A\u0301",\u1E02:"B\u0307",\u0106:"C\u0301",\u010C:"C\u030C",\u0108:"C\u0302",\u010A:"C\u0307",\u010E:"D\u030C",\u1E0A:"D\u0307",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"E\u0308",\u1EBC:"E\u0303",\u0112:"E\u0304",\u1E16:"E\u0304\u0301",\u1E14:"E\u0304\u0300",\u0114:"E\u0306",\u011A:"E\u030C",\u00CA:"E\u0302",\u1EBE:"E\u0302\u0301",\u1EC0:"E\u0302\u0300",\u1EC4:"E\u0302\u0303",\u0116:"E\u0307",\u1E1E:"F\u0307",\u01F4:"G\u0301",\u1E20:"G\u0304",\u011E:"G\u0306",\u01E6:"G\u030C",\u011C:"G\u0302",\u0120:"G\u0307",\u1E26:"H\u0308",\u021E:"H\u030C",\u0124:"H\u0302",\u1E22:"H\u0307",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"I\u0302",\u0130:"I\u0307",\u0134:"J\u0302",\u1E30:"K\u0301",\u01E8:"K\u030C",\u0139:"L\u0301",\u013D:"L\u030C",\u1E3E:"M\u0301",\u1E40:"M\u0307",\u0143:"N\u0301",\u01F8:"N\u0300",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"O\u0303",\u1E4C:"O\u0303\u0301",\u1E4E:"O\u0303\u0308",\u022C:"O\u0303\u0304",\u014C:"O\u0304",\u1E52:"O\u0304\u0301",\u1E50:"O\u0304\u0300",\u014E:"O\u0306",\u01D1:"O\u030C",\u00D4:"O\u0302",\u1ED0:"O\u0302\u0301",\u1ED2:"O\u0302\u0300",\u1ED6:"O\u0302\u0303",\u022E:"O\u0307",\u0230:"O\u0307\u0304",\u0150:"O\u030B",\u1E54:"P\u0301",\u1E56:"P\u0307",\u0154:"R\u0301",\u0158:"R\u030C",\u1E58:"R\u0307",\u015A:"S\u0301",\u1E64:"S\u0301\u0307",\u0160:"S\u030C",\u1E66:"S\u030C\u0307",\u015C:"S\u0302",\u1E60:"S\u0307",\u0164:"T\u030C",\u1E6A:"T\u0307",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"U\u0308",\u01D7:"U\u0308\u0301",\u01DB:"U\u0308\u0300",\u01D5:"U\u0308\u0304",\u01D9:"U\u0308\u030C",\u0168:"U\u0303",\u1E78:"U\u0303\u0301",\u016A:"U\u0304",\u1E7A:"U\u0304\u0308",\u016C:"U\u0306",\u01D3:"U\u030C",\u00DB:"U\u0302",\u016E:"U\u030A",\u0170:"U\u030B",\u1E7C:"V\u0303",\u1E82:"W\u0301",\u1E80:"W\u0300",\u1E84:"W\u0308",\u0174:"W\u0302",\u1E86:"W\u0307",\u1E8C:"X\u0308",\u1E8A:"X\u0307",\u00DD:"Y\u0301",\u1EF2:"Y\u0300",\u0178:"Y\u0308",\u1EF8:"Y\u0303",\u0232:"Y\u0304",\u0176:"Y\u0302",\u1E8E:"Y\u0307",\u0179:"Z\u0301",\u017D:"Z\u030C",\u1E90:"Z\u0302",\u017B:"Z\u0307",\u03AC:"\u03B1\u0301",\u1F70:"\u03B1\u0300",\u1FB1:"\u03B1\u0304",\u1FB0:"\u03B1\u0306",\u03AD:"\u03B5\u0301",\u1F72:"\u03B5\u0300",\u03AE:"\u03B7\u0301",\u1F74:"\u03B7\u0300",\u03AF:"\u03B9\u0301",\u1F76:"\u03B9\u0300",\u03CA:"\u03B9\u0308",\u0390:"\u03B9\u0308\u0301",\u1FD2:"\u03B9\u0308\u0300",\u1FD1:"\u03B9\u0304",\u1FD0:"\u03B9\u0306",\u03CC:"\u03BF\u0301",\u1F78:"\u03BF\u0300",\u03CD:"\u03C5\u0301",\u1F7A:"\u03C5\u0300",\u03CB:"\u03C5\u0308",\u03B0:"\u03C5\u0308\u0301",\u1FE2:"\u03C5\u0308\u0300",\u1FE1:"\u03C5\u0304",\u1FE0:"\u03C5\u0306",\u03CE:"\u03C9\u0301",\u1F7C:"\u03C9\u0300",\u038E:"\u03A5\u0301",\u1FEA:"\u03A5\u0300",\u03AB:"\u03A5\u0308",\u1FE9:"\u03A5\u0304",\u1FE8:"\u03A5\u0306",\u038F:"\u03A9\u0301",\u1FFA:"\u03A9\u0300"},Xn=function(){function re(v,y){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new So(v,y,this.mode),this.settings=y,this.leftrightDepth=0}var p=re.prototype;return p.expect=function(y,C){if(C===void 0&&(C=!0),this.fetch().text!==y)throw new d("Expected '"+y+"', got '"+this.fetch().text+"'",this.fetch());C&&this.consume()},p.consume=function(){this.nextToken=null},p.fetch=function(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},p.switchMode=function(y){this.mode=y,this.gullet.switchMode(y)},p.parse=function(){this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");var y=this.parseExpression(!1);return this.expect("EOF"),this.gullet.endGroup(),y},p.parseExpression=function(y,C){for(var q=[];;){this.mode==="math"&&this.consumeSpaces();var ee=this.fetch();if(re.endOfExpression.indexOf(ee.text)!==-1||C&&ee.text===C||y&&$n[ee.text]&&$n[ee.text].infix)break;var pe=this.parseAtom(C);if(!pe)break;q.push(pe)}return this.mode==="text"&&this.formLigatures(q),this.handleInfixNodes(q)},p.handleInfixNodes=function(y){for(var C=-1,q,ee=0;ee<y.length;ee++){var pe=Mr(y[ee],"infix");if(pe){if(C!==-1)throw new d("only one infix operator per group",pe.token);C=ee,q=pe.replaceWith}}if(C!==-1&&q){var ve,Ce,$e=y.slice(0,C),Ye=y.slice(C+1);$e.length===1&&$e[0].type==="ordgroup"?ve=$e[0]:ve={type:"ordgroup",mode:this.mode,body:$e},Ye.length===1&&Ye[0].type==="ordgroup"?Ce=Ye[0]:Ce={type:"ordgroup",mode:this.mode,body:Ye};var lt;return q==="\\\\abovefrac"?lt=this.callFunction(q,[ve,y[C],Ce],[]):lt=this.callFunction(q,[ve,Ce],[]),[lt]}else return y},p.handleSupSubscript=function(y){var C=this.fetch(),q=C.text;this.consume();var ee=this.parseGroup(y,!1,re.SUPSUB_GREEDINESS,void 0,void 0,!0);if(!ee)throw new d("Expected group after '"+q+"'",C);return ee},p.formatUnsupportedCmd=function(y){for(var C=[],q=0;q<y.length;q++)C.push({type:"textord",mode:"text",text:y[q]});var ee={type:"text",mode:this.mode,body:C},pe={type:"color",mode:this.mode,color:this.settings.errorColor,body:[ee]};return pe},p.parseAtom=function(y){var C=this.parseGroup("atom",!1,null,y);if(this.mode==="text")return C;for(var q,ee;;){this.consumeSpaces();var pe=this.fetch();if(pe.text==="\\limits"||pe.text==="\\nolimits"){var ve=Mr(C,"op");if(ve){var Ce=pe.text==="\\limits";ve.limits=Ce,ve.alwaysHandleSupSub=!0}else if(ve=Mr(C,"operatorname"),ve&&ve.alwaysHandleSupSub){var $e=pe.text==="\\limits";ve.limits=$e}else throw new d("Limit controls must follow a math operator",pe);this.consume()}else if(pe.text==="^"){if(q)throw new d("Double superscript",pe);q=this.handleSupSubscript("superscript")}else if(pe.text==="_"){if(ee)throw new d("Double subscript",pe);ee=this.handleSupSubscript("subscript")}else if(pe.text==="'"){if(q)throw new d("Double superscript",pe);var Ye={type:"textord",mode:this.mode,text:"\\prime"},lt=[Ye];for(this.consume();this.fetch().text==="'";)lt.push(Ye),this.consume();this.fetch().text==="^"&<.push(this.handleSupSubscript("superscript")),q={type:"ordgroup",mode:this.mode,body:lt}}else break}return q||ee?{type:"supsub",mode:this.mode,base:C,sup:q,sub:ee}:C},p.parseFunction=function(y,C,q){var ee=this.fetch(),pe=ee.text,ve=$n[pe];if(!ve)return null;if(this.consume(),q!=null&&ve.greediness<=q)throw new d("Got function '"+pe+"' with no arguments"+(C?" as "+C:""),ee);if(this.mode==="text"&&!ve.allowedInText)throw new d("Can't use function '"+pe+"' in text mode",ee);if(this.mode==="math"&&ve.allowedInMath===!1)throw new d("Can't use function '"+pe+"' in math mode",ee);var Ce=this.parseArguments(pe,ve),$e=Ce.args,Ye=Ce.optArgs;return this.callFunction(pe,$e,Ye,ee,y)},p.callFunction=function(y,C,q,ee,pe){var ve={funcName:y,parser:this,token:ee,breakOnTokenText:pe},Ce=$n[y];if(Ce&&Ce.handler)return Ce.handler(ve,C,q);throw new d("No function handler for "+y)},p.parseArguments=function(y,C){var q=C.numArgs+C.numOptionalArgs;if(q===0)return{args:[],optArgs:[]};for(var ee=C.greediness,pe=[],ve=[],Ce=0;Ce<q;Ce++){var $e=C.argTypes&&C.argTypes[Ce],Ye=Ce<C.numOptionalArgs,lt=Ce>0&&!Ye||Ce===0&&!Ye&&this.mode==="math",dt=this.parseGroupOfType("argument to '"+y+"'",$e,Ye,ee,lt);if(!dt){if(Ye){ve.push(null);continue}throw new d("Expected group after '"+y+"'",this.fetch())}(Ye?ve:pe).push(dt)}return{args:pe,optArgs:ve}},p.parseGroupOfType=function(y,C,q,ee,pe){switch(C){case"color":return pe&&this.consumeSpaces(),this.parseColorGroup(q);case"size":return pe&&this.consumeSpaces(),this.parseSizeGroup(q);case"url":return this.parseUrlGroup(q,pe);case"math":case"text":return this.parseGroup(y,q,ee,void 0,C,pe);case"hbox":{var ve=this.parseGroup(y,q,ee,void 0,"text",pe);if(!ve)return ve;var Ce={type:"styling",mode:ve.mode,body:[ve],style:"text"};return Ce}case"raw":{if(pe&&this.consumeSpaces(),q&&this.fetch().text==="{")return null;var $e=this.parseStringGroup("raw",q,!0);if($e)return{type:"raw",mode:"text",string:$e.text};throw new d("Expected raw group",this.fetch())}case"original":case null:case void 0:return this.parseGroup(y,q,ee,void 0,void 0,pe);default:throw new d("Unknown group type as "+y,this.fetch())}},p.consumeSpaces=function(){for(;this.fetch().text===" ";)this.consume()},p.parseStringGroup=function(y,C,q){var ee=C?"[":"{",pe=C?"]":"}",ve=this.fetch();if(ve.text!==ee){if(C)return null;if(q&&ve.text!=="EOF"&&/[^{}[\]]/.test(ve.text))return this.consume(),ve}var Ce=this.mode;this.mode="text",this.expect(ee);for(var $e="",Ye=this.fetch(),lt=0,dt=Ye,bt;(bt=this.fetch()).text!==pe||q&<>0;){switch(bt.text){case"EOF":throw new d("Unexpected end of input in "+y,Ye.range(dt,$e));case ee:lt++;break;case pe:lt--;break}dt=bt,$e+=dt.text,this.consume()}return this.expect(pe),this.mode=Ce,Ye.range(dt,$e)},p.parseRegexGroup=function(y,C){var q=this.mode;this.mode="text";for(var ee=this.fetch(),pe=ee,ve="",Ce;(Ce=this.fetch()).text!=="EOF"&&y.test(ve+Ce.text);)pe=Ce,ve+=pe.text,this.consume();if(ve==="")throw new d("Invalid "+C+": '"+ee.text+"'",ee);return this.mode=q,ee.range(pe,ve)},p.parseColorGroup=function(y){var C=this.parseStringGroup("color",y);if(!C)return null;var q=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(C.text);if(!q)throw new d("Invalid color: '"+C.text+"'",C);var ee=q[0];return/^[0-9a-f]{6}$/i.test(ee)&&(ee="#"+ee),{type:"color-token",mode:this.mode,color:ee}},p.parseSizeGroup=function(y){var C,q=!1;if(!y&&this.fetch().text!=="{"?C=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):C=this.parseStringGroup("size",y),!C)return null;!y&&C.text.length===0&&(C.text="0pt",q=!0);var ee=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(C.text);if(!ee)throw new d("Invalid size: '"+C.text+"'",C);var pe={number:+(ee[1]+ee[2]),unit:ee[3]};if(!Br(pe))throw new d("Invalid unit: '"+pe.unit+"'",C);return{type:"size",mode:this.mode,value:pe,isBlank:q}},p.parseUrlGroup=function(y,C){this.gullet.lexer.setCatcode("%",13);var q=this.parseStringGroup("url",y,!0);if(this.gullet.lexer.setCatcode("%",14),!q)return null;var ee=q.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:ee}},p.parseGroup=function(y,C,q,ee,pe,ve){var Ce=this.mode;pe&&this.switchMode(pe),ve&&this.consumeSpaces();var $e=this.fetch(),Ye=$e.text,lt;if(C?Ye==="[":Ye==="{"||Ye==="\\begingroup"){this.consume();var dt=re.endOfGroup[Ye];this.gullet.beginGroup();var bt=this.parseExpression(!1,dt),Rt=this.fetch();this.expect(dt),this.gullet.endGroup(),lt={type:"ordgroup",mode:this.mode,loc:V.range($e,Rt),body:bt,semisimple:Ye==="\\begingroup"||void 0}}else if(C)lt=null;else if(lt=this.parseFunction(ee,y,q)||this.parseSymbol(),lt==null&&Ye[0]==="\\"&&!Ya.hasOwnProperty(Ye)){if(this.settings.throwOnError)throw new d("Undefined control sequence: "+Ye,$e);lt=this.formatUnsupportedCmd(Ye),this.consume()}return pe&&this.switchMode(Ce),lt},p.formLigatures=function(y){for(var C=y.length-1,q=0;q<C;++q){var ee=y[q],pe=ee.text;pe==="-"&&y[q+1].text==="-"&&(q+1<C&&y[q+2].text==="-"?(y.splice(q,3,{type:"textord",mode:"text",loc:V.range(ee,y[q+2]),text:"---"}),C-=2):(y.splice(q,2,{type:"textord",mode:"text",loc:V.range(ee,y[q+1]),text:"--"}),C-=1)),(pe==="'"||pe==="`")&&y[q+1].text===pe&&(y.splice(q,2,{type:"textord",mode:"text",loc:V.range(ee,y[q+1]),text:pe+pe}),C-=1)}},p.parseSymbol=function(){var y=this.fetch(),C=y.text;if(/^\\verb[^a-zA-Z]/.test(C)){this.consume();var q=C.slice(5),ee=q.charAt(0)==="*";if(ee&&(q=q.slice(1)),q.length<2||q.charAt(0)!==q.slice(-1))throw new d(`\\verb assertion failed --
|
|
|
please report what input caused this bug`);return q=q.slice(1,-1),{type:"verb",mode:"text",body:q,star:ee}}ia.hasOwnProperty(C[0])&&!Nt[this.mode][C[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+C[0]+'" used in math mode',y),C=ia[C[0]]+C.substr(1));var pe=As.exec(C);pe&&(C=C.substring(0,pe.index),C==="i"?C="\u0131":C==="j"&&(C="\u0237"));var ve;if(Nt[this.mode][C]){this.settings.strict&&this.mode==="math"&&di.indexOf(C)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+C[0]+'" used in math mode',y);var Ce=Nt[this.mode][C].group,$e=V.range(y),Ye;if(Lt.hasOwnProperty(Ce)){var lt=Ce;Ye={type:"atom",mode:this.mode,family:lt,loc:$e,text:C}}else Ye={type:Ce,mode:this.mode,loc:$e,text:C};ve=Ye}else if(C.charCodeAt(0)>=128)this.settings.strict&&(Oe(C.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+C[0]+'" used in math mode',y):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+C[0]+'"'+(" ("+C.charCodeAt(0)+")"),y)),ve={type:"textord",mode:"text",loc:V.range(y),text:C};else return null;if(this.consume(),pe)for(var dt=0;dt<pe[0].length;dt++){var bt=pe[0][dt];if(!ra[bt])throw new d("Unknown accent ' "+bt+"'",y);var Rt=ra[bt][this.mode];if(!Rt)throw new d("Accent "+bt+" unsupported in "+this.mode+" mode",y);ve={type:"accent",mode:this.mode,loc:V.range(y),label:Rt,isStretchy:!1,isShifty:!0,base:ve}}return ve},re}();Xn.endOfExpression=["}","\\endgroup","\\end","\\right","&"],Xn.endOfGroup={"[":"]","{":"}","\\begingroup":"\\endgroup"},Xn.SUPSUB_GREEDINESS=1;var Za=function(p,v){if(!(typeof p=="string"||p instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var y=new Xn(p,v);delete y.gullet.macros.current["\\df@tag"];var C=y.parse();if(y.gullet.macros.get("\\df@tag")){if(!v.displayMode)throw new d("\\tag works only in display equations");y.gullet.feed("\\df@tag"),C=[{type:"tag",mode:"text",body:C,tag:y.parse()}]}return C},na=Za,sa=function(p,v,y){v.textContent="";var C=Cs(p,y).toNode();v.appendChild(C)};typeof document!="undefined"&&document.compatMode!=="CSS1Compat"&&(typeof console!="undefined"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),sa=function(){throw new d("KaTeX doesn't work in quirks mode.")});var Eo=function(p,v){var y=Cs(p,v).toMarkup();return y},Xa=function(p,v){var y=new T(v);return na(p,y)},Qa=function(p,v,y){if(y.throwOnError||!(p instanceof d))throw p;var C=et.makeSpan(["katex-error"],[new be(v)]);return C.setAttribute("title",p.toString()),C.setAttribute("style","color:"+y.errorColor),C},Cs=function(p,v){var y=new T(v);try{var C=na(p,y);return fn(C,p,y)}catch(q){return Qa(q,p,y)}},xo=function(p,v){var y=new T(v);try{var C=na(p,y);return en(C,p,y)}catch(q){return Qa(q,p,y)}},wo={version:"0.11.1",render:sa,renderToString:Eo,ParseError:d,__parse:Xa,__renderToDomTree:Cs,__renderToHTMLTree:xo,__setFontMetrics:vt,__defineSymbol:j,__defineMacro:Se,__domTree:{Span:Ue,Anchor:ot,SymbolNode:be,SvgNode:De,PathNode:Ae,LineNode:Ne}},Xo=S.default=wo}]).default})},32834:function(Ct){(function(Le,S){Ct.exports=S()})(this,function(){"use strict";function Le(ke,Pe){for(var He=0;He<Pe.length;He++){var he=Pe[He];he.enumerable=he.enumerable||!1,he.configurable=!0,"value"in he&&(he.writable=!0),Object.defineProperty(ke,he.key,he)}}function S(ke,Pe,He){return Pe&&Le(ke.prototype,Pe),He&&Le(ke,He),ke}function N(ke,Pe){if(ke){if(typeof ke=="string")return B(ke,Pe);var He=Object.prototype.toString.call(ke).slice(8,-1);if(He==="Object"&&ke.constructor&&(He=ke.constructor.name),He==="Map"||He==="Set")return Array.from(ke);if(He==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(He))return B(ke,Pe)}}function B(ke,Pe){(Pe==null||Pe>ke.length)&&(Pe=ke.length);for(var He=0,he=new Array(Pe);He<Pe;He++)he[He]=ke[He];return he}function V(ke,Pe){var He=typeof Symbol!="undefined"&&ke[Symbol.iterator]||ke["@@iterator"];if(He)return(He=He.call(ke)).next.bind(He);if(Array.isArray(ke)||(He=N(ke))||Pe&&ke&&typeof ke.length=="number"){He&&(ke=He);var he=0;return function(){return he>=ke.length?{done:!0}:{done:!1,value:ke[he++]}}}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 I={exports:{}};function A(){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 d(ke){I.exports.defaults=ke}I.exports={defaults:A(),getDefaults:A,changeDefaults:d};var U=/[&<>"']/,b=/[&<>"']/g,n=/[<>"']|&(?!#?\w+;)/,E=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(Pe){return f[Pe]};function l(ke,Pe){if(Pe){if(U.test(ke))return ke.replace(b,c)}else if(n.test(ke))return ke.replace(E,c);return ke}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function m(ke){return ke.replace(u,function(Pe,He){return He=He.toLowerCase(),He==="colon"?":":He.charAt(0)==="#"?He.charAt(1)==="x"?String.fromCharCode(parseInt(He.substring(2),16)):String.fromCharCode(+He.substring(1)):""})}var x=/(^|[^\[])\^/g;function F(ke,Pe){ke=ke.source||ke,Pe=Pe||"";var He={replace:function(ge,ye){return ye=ye.source||ye,ye=ye.replace(x,"$1"),ke=ke.replace(ge,ye),He},getRegex:function(){return new RegExp(ke,Pe)}};return He}var k=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(ke,Pe,He){if(ke){var he;try{he=decodeURIComponent(m(He)).replace(k,"").toLowerCase()}catch(ge){return null}if(he.indexOf("javascript:")===0||he.indexOf("vbscript:")===0||he.indexOf("data:")===0)return null}Pe&&!T.test(He)&&(He=z(Pe,He));try{He=encodeURI(He).replace(/%25/g,"%")}catch(ge){return null}return He}var W={},P=/^[^:]+:\/*[^/]*$/,O=/^([^:]+:)[\s\S]*$/,$=/^([^:]+:\/*[^/]*)[\s\S]*$/;function z(ke,Pe){W[" "+ke]||(P.test(ke)?W[" "+ke]=ke+"/":W[" "+ke]=_e(ke,"/",!0)),ke=W[" "+ke];var He=ke.indexOf(":")===-1;return Pe.substring(0,2)==="//"?He?Pe:ke.replace(O,"$1")+Pe:Pe.charAt(0)==="/"?He?Pe:ke.replace($,"$1")+Pe:ke+Pe}var ie={exec:function(){}};function te(ke){for(var Pe=1,He,he;Pe<arguments.length;Pe++){He=arguments[Pe];for(he in He)Object.prototype.hasOwnProperty.call(He,he)&&(ke[he]=He[he])}return ke}function me(ke,Pe){var He=ke.replace(/\|/g,function(ye,Ie,ae){for(var _t=!1,we=Ie;--we>=0&&ae[we]==="\\";)_t=!_t;return _t?"|":" |"}),he=He.split(/ \|/),ge=0;if(he.length>Pe)he.splice(Pe);else for(;he.length<Pe;)he.push("");for(;ge<he.length;ge++)he[ge]=he[ge].trim().replace(/\\\|/g,"|");return he}function _e(ke,Pe,He){var he=ke.length;if(he===0)return"";for(var ge=0;ge<he;){var ye=ke.charAt(he-ge-1);if(ye===Pe&&!He)ge++;else if(ye!==Pe&&He)ge++;else break}return ke.substr(0,he-ge)}function le(ke,Pe){if(ke.indexOf(Pe[1])===-1)return-1;for(var He=ke.length,he=0,ge=0;ge<He;ge++)if(ke[ge]==="\\")ge++;else if(ke[ge]===Pe[0])he++;else if(ke[ge]===Pe[1]&&(he--,he<0))return ge;return-1}function Q(ke){ke&&ke.sanitize&&!ke.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 se(ke,Pe){if(Pe<1)return"";for(var He="";Pe>1;)Pe&1&&(He+=ke),Pe>>=1,ke+=ke;return He+ke}var H={escape:l,unescape:m,edit:F,cleanUrl:L,resolveUrl:z,noopTest:ie,merge:te,splitCells:me,rtrim:_e,findClosingBracket:le,checkSanitizeDeprecation:Q,repeatString:se},J=I.exports.defaults,K=H.rtrim,M=H.splitCells,D=H.escape,ne=H.findClosingBracket;function de(ke,Pe,He){var he=Pe.href,ge=Pe.title?D(Pe.title):null,ye=ke[1].replace(/\\([\[\]])/g,"$1");return ke[0].charAt(0)!=="!"?{type:"link",raw:He,href:he,title:ge,text:ye}:{type:"image",raw:He,href:he,title:ge,text:D(ye)}}function Oe(ke,Pe){var He=ke.match(/^(\s+)(?:```)/);if(He===null)return Pe;var he=He[1];return Pe.split(`
|
|
|
`).map(function(ge){var ye=ge.match(/^\s+/);if(ye===null)return ge;var Ie=ye[0];return Ie.length>=he.length?ge.slice(he.length):ge}).join(`
|
|
|
`)}var Ve=function(){function ke(He){this.options=He||J}var Pe=ke.prototype;return Pe.space=function(he){var ge=this.rules.block.newline.exec(he);if(ge)return ge[0].length>1?{type:"space",raw:ge[0]}:{raw:`
|
|
|
`}},Pe.code=function(he){var ge=this.rules.block.code.exec(he);if(ge){var ye=ge[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ge[0],codeBlockStyle:"indented",text:this.options.pedantic?ye:K(ye,`
|
|
|
`)}}},Pe.fences=function(he){var ge=this.rules.block.fences.exec(he);if(ge){var ye=ge[0],Ie=Oe(ye,ge[3]||"");return{type:"code",raw:ye,lang:ge[2]?ge[2].trim():ge[2],text:Ie}}},Pe.heading=function(he){var ge=this.rules.block.heading.exec(he);if(ge){var ye=ge[2].trim();if(/#$/.test(ye)){var Ie=K(ye,"#");(this.options.pedantic||!Ie||/ $/.test(Ie))&&(ye=Ie.trim())}return{type:"heading",raw:ge[0],depth:ge[1].length,text:ye}}},Pe.nptable=function(he){var ge=this.rules.block.nptable.exec(he);if(ge){var ye={type:"table",header:M(ge[1].replace(/^ *| *\| *$/g,"")),align:ge[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ge[3]?ge[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:ge[0]};if(ye.header.length===ye.align.length){var Ie=ye.align.length,ae;for(ae=0;ae<Ie;ae++)/^ *-+: *$/.test(ye.align[ae])?ye.align[ae]="right":/^ *:-+: *$/.test(ye.align[ae])?ye.align[ae]="center":/^ *:-+ *$/.test(ye.align[ae])?ye.align[ae]="left":ye.align[ae]=null;for(Ie=ye.cells.length,ae=0;ae<Ie;ae++)ye.cells[ae]=M(ye.cells[ae],ye.header.length);return ye}}},Pe.hr=function(he){var ge=this.rules.block.hr.exec(he);if(ge)return{type:"hr",raw:ge[0]}},Pe.blockquote=function(he){var ge=this.rules.block.blockquote.exec(he);if(ge){var ye=ge[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ge[0],text:ye}}},Pe.list=function(he){var ge=this.rules.block.list.exec(he);if(ge){var ye=ge[0],Ie=ge[2],ae=Ie.length>1,_t={type:"list",raw:ye,ordered:ae,start:ae?+Ie.slice(0,-1):"",loose:!1,items:[]},we=ge[0].match(this.rules.block.item),kt=!1,Ft,er,Vt,It,Tt,fr,$r,zr,Qr,Ot=we.length;Vt=this.rules.block.listItemStart.exec(we[0]);for(var Yt=0;Yt<Ot;Yt++){if(Ft=we[Yt],ye=Ft,this.options.pedantic||(Qr=Ft.match(new RegExp("\\n\\s*\\n {0,"+(Vt[0].length-1)+"}\\S")),Qr&&(Tt=Ft.length-Qr.index+we.slice(Yt+1).join(`
|
|
|
`).length,_t.raw=_t.raw.substring(0,_t.raw.length-Tt),Ft=Ft.substring(0,Qr.index),ye=Ft,Ot=Yt+1)),Yt!==Ot-1){if(It=this.rules.block.listItemStart.exec(we[Yt+1]),this.options.pedantic?It[1].length>Vt[1].length:It[1].length>=Vt[0].length||It[1].length>3){we.splice(Yt,2,we[Yt]+(!this.options.pedantic&&It[1].length<Vt[0].length&&!we[Yt].match(/\n$/)?"":`
|
|
|
`)+we[Yt+1]),Yt--,Ot--;continue}else(!this.options.pedantic||this.options.smartLists?It[2][It[2].length-1]!==Ie[Ie.length-1]:ae===(It[2].length===1))&&(Tt=we.slice(Yt+1).join(`
|
|
|
`).length,_t.raw=_t.raw.substring(0,_t.raw.length-Tt),Yt=Ot-1);Vt=It}er=Ft.length,Ft=Ft.replace(/^ *([*+-]|\d+[.)]) ?/,""),~Ft.indexOf(`
|
|
|
`)&&(er-=Ft.length,Ft=this.options.pedantic?Ft.replace(/^ {1,4}/gm,""):Ft.replace(new RegExp("^ {1,"+er+"}","gm"),"")),Ft=K(Ft,`
|
|
|
`),Yt!==Ot-1&&(ye=ye+`
|
|
|
`),fr=kt||/\n\n(?!\s*$)/.test(ye),Yt!==Ot-1&&(kt=ye.slice(-2)===`
|
|
|
|
|
|
`,fr||(fr=kt)),fr&&(_t.loose=!0),this.options.gfm&&($r=/^\[[ xX]\] /.test(Ft),zr=void 0,$r&&(zr=Ft[1]!==" ",Ft=Ft.replace(/^\[[ xX]\] +/,""))),_t.items.push({type:"list_item",raw:ye,task:$r,checked:zr,loose:fr,text:Ft})}return _t}},Pe.html=function(he){var ge=this.rules.block.html.exec(he);if(ge)return{type:this.options.sanitize?"paragraph":"html",raw:ge[0],pre:!this.options.sanitizer&&(ge[1]==="pre"||ge[1]==="script"||ge[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):D(ge[0]):ge[0]}},Pe.def=function(he){var ge=this.rules.block.def.exec(he);if(ge){ge[3]&&(ge[3]=ge[3].substring(1,ge[3].length-1));var ye=ge[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:ye,raw:ge[0],href:ge[2],title:ge[3]}}},Pe.table=function(he){var ge=this.rules.block.table.exec(he);if(ge){var ye={type:"table",header:M(ge[1].replace(/^ *| *\| *$/g,"")),align:ge[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ge[3]?ge[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(ye.header.length===ye.align.length){ye.raw=ge[0];var Ie=ye.align.length,ae;for(ae=0;ae<Ie;ae++)/^ *-+: *$/.test(ye.align[ae])?ye.align[ae]="right":/^ *:-+: *$/.test(ye.align[ae])?ye.align[ae]="center":/^ *:-+ *$/.test(ye.align[ae])?ye.align[ae]="left":ye.align[ae]=null;for(Ie=ye.cells.length,ae=0;ae<Ie;ae++)ye.cells[ae]=M(ye.cells[ae].replace(/^ *\| *| *\| *$/g,""),ye.header.length);return ye}}},Pe.lheading=function(he){var ge=this.rules.block.lheading.exec(he);if(ge)return{type:"heading",raw:ge[0],depth:ge[2].charAt(0)==="="?1:2,text:ge[1]}},Pe.paragraph=function(he){var ge=this.rules.block.paragraph.exec(he);if(ge)return{type:"paragraph",raw:ge[0],text:ge[1].charAt(ge[1].length-1)===`
|
|
|
`?ge[1].slice(0,-1):ge[1]}},Pe.text=function(he){var ge=this.rules.block.text.exec(he);if(ge)return{type:"text",raw:ge[0],text:ge[0]}},Pe.escape=function(he){var ge=this.rules.inline.escape.exec(he);if(ge)return{type:"escape",raw:ge[0],text:D(ge[1])}},Pe.tag=function(he,ge,ye){var Ie=this.rules.inline.tag.exec(he);if(Ie)return!ge&&/^<a /i.test(Ie[0])?ge=!0:ge&&/^<\/a>/i.test(Ie[0])&&(ge=!1),!ye&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ie[0])?ye=!0:ye&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ie[0])&&(ye=!1),{type:this.options.sanitize?"text":"html",raw:Ie[0],inLink:ge,inRawBlock:ye,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ie[0]):D(Ie[0]):Ie[0]}},Pe.link=function(he){var ge=this.rules.inline.link.exec(he);if(ge){var ye=ge[2].trim();if(!this.options.pedantic&&/^</.test(ye)){if(!/>$/.test(ye))return;var Ie=K(ye.slice(0,-1),"\\");if((ye.length-Ie.length)%2===0)return}else{var ae=ne(ge[2],"()");if(ae>-1){var _t=ge[0].indexOf("!")===0?5:4,we=_t+ge[1].length+ae;ge[2]=ge[2].substring(0,ae),ge[0]=ge[0].substring(0,we).trim(),ge[3]=""}}var kt=ge[2],Ft="";if(this.options.pedantic){var er=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(kt);er&&(kt=er[1],Ft=er[3])}else Ft=ge[3]?ge[3].slice(1,-1):"";return kt=kt.trim(),/^</.test(kt)&&(this.options.pedantic&&!/>$/.test(ye)?kt=kt.slice(1):kt=kt.slice(1,-1)),de(ge,{href:kt&&kt.replace(this.rules.inline._escapes,"$1"),title:Ft&&Ft.replace(this.rules.inline._escapes,"$1")},ge[0])}},Pe.reflink=function(he,ge){var ye;if((ye=this.rules.inline.reflink.exec(he))||(ye=this.rules.inline.nolink.exec(he))){var Ie=(ye[2]||ye[1]).replace(/\s+/g," ");if(Ie=ge[Ie.toLowerCase()],!Ie||!Ie.href){var ae=ye[0].charAt(0);return{type:"text",raw:ae,text:ae}}return de(ye,Ie,ye[0])}},Pe.emStrong=function(he,ge,ye){ye===void 0&&(ye="");var Ie=this.rules.inline.emStrong.lDelim.exec(he);if(Ie&&!(Ie[3]&&ye.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 ae=Ie[1]||Ie[2]||"";if(!ae||ae&&(ye===""||this.rules.inline.punctuation.exec(ye))){var _t=Ie[0].length-1,we,kt,Ft=_t,er=0,Vt=Ie[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Vt.lastIndex=0,ge=ge.slice(-1*he.length+_t);(Ie=Vt.exec(ge))!=null;)if(we=Ie[1]||Ie[2]||Ie[3]||Ie[4]||Ie[5]||Ie[6],!!we){if(kt=we.length,Ie[3]||Ie[4]){Ft+=kt;continue}else if((Ie[5]||Ie[6])&&_t%3&&!((_t+kt)%3)){er+=kt;continue}if(Ft-=kt,!(Ft>0))return kt=Math.min(kt,kt+Ft+er),Math.min(_t,kt)%2?{type:"em",raw:he.slice(0,_t+Ie.index+kt+1),text:he.slice(1,_t+Ie.index+kt)}:{type:"strong",raw:he.slice(0,_t+Ie.index+kt+1),text:he.slice(2,_t+Ie.index+kt-1)}}}}},Pe.codespan=function(he){var ge=this.rules.inline.code.exec(he);if(ge){var ye=ge[2].replace(/\n/g," "),Ie=/[^ ]/.test(ye),ae=/^ /.test(ye)&&/ $/.test(ye);return Ie&&ae&&(ye=ye.substring(1,ye.length-1)),ye=D(ye,!0),{type:"codespan",raw:ge[0],text:ye}}},Pe.br=function(he){var ge=this.rules.inline.br.exec(he);if(ge)return{type:"br",raw:ge[0]}},Pe.del=function(he){var ge=this.rules.inline.del.exec(he);if(ge)return{type:"del",raw:ge[0],text:ge[2]}},Pe.autolink=function(he,ge){var ye=this.rules.inline.autolink.exec(he);if(ye){var Ie,ae;return ye[2]==="@"?(Ie=D(this.options.mangle?ge(ye[1]):ye[1]),ae="mailto:"+Ie):(Ie=D(ye[1]),ae=Ie),{type:"link",raw:ye[0],text:Ie,href:ae,tokens:[{type:"text",raw:Ie,text:Ie}]}}},Pe.url=function(he,ge){var ye;if(ye=this.rules.inline.url.exec(he)){var Ie,ae;if(ye[2]==="@")Ie=D(this.options.mangle?ge(ye[0]):ye[0]),ae="mailto:"+Ie;else{var _t;do _t=ye[0],ye[0]=this.rules.inline._backpedal.exec(ye[0])[0];while(_t!==ye[0]);Ie=D(ye[0]),ye[1]==="www."?ae="http://"+Ie:ae=Ie}return{type:"link",raw:ye[0],text:Ie,href:ae,tokens:[{type:"text",raw:Ie,text:Ie}]}}},Pe.inlineText=function(he,ge,ye){var Ie=this.rules.inline.text.exec(he);if(Ie){var ae;return ge?ae=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ie[0]):D(Ie[0]):Ie[0]:ae=D(this.options.smartypants?ye(Ie[0]):Ie[0]),{type:"text",raw:Ie[0],text:ae}}},ke}(),nt=H.noopTest,Fe=H.edit,rt=H.merge,Ze={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:nt,table:nt,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};Ze._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Ze._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ze.def=Fe(Ze.def).replace("label",Ze._label).replace("title",Ze._title).getRegex(),Ze.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ze.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Ze.item=Fe(Ze.item,"gm").replace(/bull/g,Ze.bullet).getRegex(),Ze.listItemStart=Fe(/^( *)(bull) */).replace("bull",Ze.bullet).getRegex(),Ze.list=Fe(Ze.list).replace(/bull/g,Ze.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ze.def.source+")").getRegex(),Ze._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",Ze._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Ze.html=Fe(Ze.html,"i").replace("comment",Ze._comment).replace("tag",Ze._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ze.paragraph=Fe(Ze._paragraph).replace("hr",Ze.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",Ze._tag).getRegex(),Ze.blockquote=Fe(Ze.blockquote).replace("paragraph",Ze.paragraph).getRegex(),Ze.normal=rt({},Ze),Ze.gfm=rt({},Ze.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*|$)"}),Ze.gfm.nptable=Fe(Ze.gfm.nptable).replace("hr",Ze.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",Ze._tag).getRegex(),Ze.gfm.table=Fe(Ze.gfm.table).replace("hr",Ze.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",Ze._tag).getRegex(),Ze.pedantic=rt({},Ze.normal,{html:Fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ze._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:nt,paragraph:Fe(Ze.normal._paragraph).replace("hr",Ze.hr).replace("heading",` *#{1,6} *[^
|
|
|
]`).replace("lheading",Ze.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var st={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:nt,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:nt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};st._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",st.punctuation=Fe(st.punctuation).replace(/punctuation/g,st._punctuation).getRegex(),st.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,st.escapedEmSt=/\\\*|\\_/g,st._comment=Fe(Ze._comment).replace("(?:-->|$)","-->").getRegex(),st.emStrong.lDelim=Fe(st.emStrong.lDelim).replace(/punct/g,st._punctuation).getRegex(),st.emStrong.rDelimAst=Fe(st.emStrong.rDelimAst,"g").replace(/punct/g,st._punctuation).getRegex(),st.emStrong.rDelimUnd=Fe(st.emStrong.rDelimUnd,"g").replace(/punct/g,st._punctuation).getRegex(),st._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,st._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,st._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])?)+(?![-_])/,st.autolink=Fe(st.autolink).replace("scheme",st._scheme).replace("email",st._email).getRegex(),st._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,st.tag=Fe(st.tag).replace("comment",st._comment).replace("attribute",st._attribute).getRegex(),st._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,st._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,st._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,st.link=Fe(st.link).replace("label",st._label).replace("href",st._href).replace("title",st._title).getRegex(),st.reflink=Fe(st.reflink).replace("label",st._label).getRegex(),st.reflinkSearch=Fe(st.reflinkSearch,"g").replace("reflink",st.reflink).replace("nolink",st.nolink).getRegex(),st.normal=rt({},st),st.pedantic=rt({},st.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:Fe(/^!?\[(label)\]\((.*?)\)/).replace("label",st._label).getRegex(),reflink:Fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",st._label).getRegex()}),st.gfm=rt({},st.normal,{escape:Fe(st.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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),st.gfm.url=Fe(st.gfm.url,"i").replace("email",st.gfm._extended_email).getRegex(),st.breaks=rt({},st.gfm,{br:Fe(st.br).replace("{2,}","*").getRegex(),text:Fe(st.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var At={block:Ze,inline:st},Jt=Ve,pt=I.exports.defaults,Bt=At.block,zt=At.inline,$t=H.repeatString;function Me(ke){return ke.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 ze(ke){var Pe="",He,he,ge=ke.length;for(He=0;He<ge;He++)he=ke.charCodeAt(He),Math.random()>.5&&(he="x"+he.toString(16)),Pe+="&#"+he+";";return Pe}var Ue=function(){function ke(He){this.tokens=[],this.tokens.links=Object.create(null),this.options=He||pt,this.options.tokenizer=this.options.tokenizer||new Jt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var he={block:Bt.normal,inline:zt.normal};this.options.pedantic?(he.block=Bt.pedantic,he.inline=zt.pedantic):this.options.gfm&&(he.block=Bt.gfm,this.options.breaks?he.inline=zt.breaks:he.inline=zt.gfm),this.tokenizer.rules=he}ke.lex=function(he,ge){var ye=new ke(ge);return ye.lex(he)},ke.lexInline=function(he,ge){var ye=new ke(ge);return ye.inlineTokens(he)};var Pe=ke.prototype;return Pe.lex=function(he){return he=he.replace(/\r\n|\r/g,`
|
|
|
`).replace(/\t/g," "),this.blockTokens(he,this.tokens,!0),this.inline(this.tokens),this.tokens},Pe.blockTokens=function(he,ge,ye){ge===void 0&&(ge=[]),ye===void 0&&(ye=!0),this.options.pedantic&&(he=he.replace(/^ +$/gm,""));for(var Ie,ae,_t,we;he;){if(Ie=this.tokenizer.space(he)){he=he.substring(Ie.raw.length),Ie.type&&ge.push(Ie);continue}if(Ie=this.tokenizer.code(he)){he=he.substring(Ie.raw.length),we=ge[ge.length-1],we&&we.type==="paragraph"?(we.raw+=`
|
|
|
`+Ie.raw,we.text+=`
|
|
|
`+Ie.text):ge.push(Ie);continue}if(Ie=this.tokenizer.fences(he)){he=he.substring(Ie.raw.length),ge.push(Ie);continue}if(Ie=this.tokenizer.heading(he)){he=he.substring(Ie.raw.length),ge.push(Ie);continue}if(Ie=this.tokenizer.nptable(he)){he=he.substring(Ie.raw.length),ge.push(Ie);continue}if(Ie=this.tokenizer.hr(he)){he=he.substring(Ie.raw.length),ge.push(Ie);continue}if(Ie=this.tokenizer.blockquote(he)){he=he.substring(Ie.raw.length),Ie.tokens=this.blockTokens(Ie.text,[],ye),ge.push(Ie);continue}if(Ie=this.tokenizer.list(he)){for(he=he.substring(Ie.raw.length),_t=Ie.items.length,ae=0;ae<_t;ae++)Ie.items[ae].tokens=this.blockTokens(Ie.items[ae].text,[],!1);ge.push(Ie);continue}if(Ie=this.tokenizer.html(he)){he=he.substring(Ie.raw.length),ge.push(Ie);continue}if(ye&&(Ie=this.tokenizer.def(he))){he=he.substring(Ie.raw.length),this.tokens.links[Ie.tag]||(this.tokens.links[Ie.tag]={href:Ie.href,title:Ie.title});continue}if(Ie=this.tokenizer.table(he)){he=he.substring(Ie.raw.length),ge.push(Ie);continue}if(Ie=this.tokenizer.lheading(he)){he=he.substring(Ie.raw.length),ge.push(Ie);continue}if(ye&&(Ie=this.tokenizer.paragraph(he))){he=he.substring(Ie.raw.length),ge.push(Ie);continue}if(Ie=this.tokenizer.text(he)){he=he.substring(Ie.raw.length),we=ge[ge.length-1],we&&we.type==="text"?(we.raw+=`
|
|
|
`+Ie.raw,we.text+=`
|
|
|
`+Ie.text):ge.push(Ie);continue}if(he){var kt="Infinite loop on byte: "+he.charCodeAt(0);if(this.options.silent){console.error(kt);break}else throw new Error(kt)}}return ge},Pe.inline=function(he){var ge,ye,Ie,ae,_t,we,kt=he.length;for(ge=0;ge<kt;ge++)switch(we=he[ge],we.type){case"paragraph":case"text":case"heading":{we.tokens=[],this.inlineTokens(we.text,we.tokens);break}case"table":{for(we.tokens={header:[],cells:[]},ae=we.header.length,ye=0;ye<ae;ye++)we.tokens.header[ye]=[],this.inlineTokens(we.header[ye],we.tokens.header[ye]);for(ae=we.cells.length,ye=0;ye<ae;ye++)for(_t=we.cells[ye],we.tokens.cells[ye]=[],Ie=0;Ie<_t.length;Ie++)we.tokens.cells[ye][Ie]=[],this.inlineTokens(_t[Ie],we.tokens.cells[ye][Ie]);break}case"blockquote":{this.inline(we.tokens);break}case"list":{for(ae=we.items.length,ye=0;ye<ae;ye++)this.inline(we.items[ye].tokens);break}}return he},Pe.inlineTokens=function(he,ge,ye,Ie){ge===void 0&&(ge=[]),ye===void 0&&(ye=!1),Ie===void 0&&(Ie=!1);var ae,_t,we=he,kt,Ft,er;if(this.tokens.links){var Vt=Object.keys(this.tokens.links);if(Vt.length>0)for(;(kt=this.tokenizer.rules.inline.reflinkSearch.exec(we))!=null;)Vt.includes(kt[0].slice(kt[0].lastIndexOf("[")+1,-1))&&(we=we.slice(0,kt.index)+"["+$t("a",kt[0].length-2)+"]"+we.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(kt=this.tokenizer.rules.inline.blockSkip.exec(we))!=null;)we=we.slice(0,kt.index)+"["+$t("a",kt[0].length-2)+"]"+we.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(kt=this.tokenizer.rules.inline.escapedEmSt.exec(we))!=null;)we=we.slice(0,kt.index)+"++"+we.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;he;){if(Ft||(er=""),Ft=!1,ae=this.tokenizer.escape(he)){he=he.substring(ae.raw.length),ge.push(ae);continue}if(ae=this.tokenizer.tag(he,ye,Ie)){he=he.substring(ae.raw.length),ye=ae.inLink,Ie=ae.inRawBlock;var It=ge[ge.length-1];It&&ae.type==="text"&&It.type==="text"?(It.raw+=ae.raw,It.text+=ae.text):ge.push(ae);continue}if(ae=this.tokenizer.link(he)){he=he.substring(ae.raw.length),ae.type==="link"&&(ae.tokens=this.inlineTokens(ae.text,[],!0,Ie)),ge.push(ae);continue}if(ae=this.tokenizer.reflink(he,this.tokens.links)){he=he.substring(ae.raw.length);var Tt=ge[ge.length-1];ae.type==="link"?(ae.tokens=this.inlineTokens(ae.text,[],!0,Ie),ge.push(ae)):Tt&&ae.type==="text"&&Tt.type==="text"?(Tt.raw+=ae.raw,Tt.text+=ae.text):ge.push(ae);continue}if(ae=this.tokenizer.emStrong(he,we,er)){he=he.substring(ae.raw.length),ae.tokens=this.inlineTokens(ae.text,[],ye,Ie),ge.push(ae);continue}if(ae=this.tokenizer.codespan(he)){he=he.substring(ae.raw.length),ge.push(ae);continue}if(ae=this.tokenizer.br(he)){he=he.substring(ae.raw.length),ge.push(ae);continue}if(ae=this.tokenizer.del(he)){he=he.substring(ae.raw.length),ae.tokens=this.inlineTokens(ae.text,[],ye,Ie),ge.push(ae);continue}if(ae=this.tokenizer.autolink(he,ze)){he=he.substring(ae.raw.length),ge.push(ae);continue}if(!ye&&(ae=this.tokenizer.url(he,ze))){he=he.substring(ae.raw.length),ge.push(ae);continue}if(ae=this.tokenizer.inlineText(he,Ie,Me)){he=he.substring(ae.raw.length),ae.raw.slice(-1)!=="_"&&(er=ae.raw.slice(-1)),Ft=!0,_t=ge[ge.length-1],_t&&_t.type==="text"?(_t.raw+=ae.raw,_t.text+=ae.text):ge.push(ae);continue}if(he){var fr="Infinite loop on byte: "+he.charCodeAt(0);if(this.options.silent){console.error(fr);break}else throw new Error(fr)}}return ge},S(ke,null,[{key:"rules",get:function(){return{block:Bt,inline:zt}}}]),ke}(),ot=I.exports.defaults,ut=H.cleanUrl,ue=H.escape,be=function(){function ke(He){this.options=He||ot}var Pe=ke.prototype;return Pe.code=function(he,ge,ye){var Ie=(ge||"").match(/\S*/)[0];if(this.options.highlight){var ae=this.options.highlight(he,Ie);ae!=null&&ae!==he&&(ye=!0,he=ae)}return he=he.replace(/\n$/,"")+`
|
|
|
`,Ie?'<pre><code class="'+this.options.langPrefix+ue(Ie,!0)+'">'+(ye?he:ue(he,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(ye?he:ue(he,!0))+`</code></pre>
|
|
|
`},Pe.blockquote=function(he){return`<blockquote>
|
|
|
`+he+`</blockquote>
|
|
|
`},Pe.html=function(he){return he},Pe.heading=function(he,ge,ye,Ie){return this.options.headerIds?"<h"+ge+' id="'+this.options.headerPrefix+Ie.slug(ye)+'">'+he+"</h"+ge+`>
|
|
|
`:"<h"+ge+">"+he+"</h"+ge+`>
|
|
|
`},Pe.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},Pe.list=function(he,ge,ye){var Ie=ge?"ol":"ul",ae=ge&&ye!==1?' start="'+ye+'"':"";return"<"+Ie+ae+`>
|
|
|
`+he+"</"+Ie+`>
|
|
|
`},Pe.listitem=function(he){return"<li>"+he+`</li>
|
|
|
`},Pe.checkbox=function(he){return"<input "+(he?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Pe.paragraph=function(he){return"<p>"+he+`</p>
|
|
|
`},Pe.table=function(he,ge){return ge&&(ge="<tbody>"+ge+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+he+`</thead>
|
|
|
`+ge+`</table>
|
|
|
`},Pe.tablerow=function(he){return`<tr>
|
|
|
`+he+`</tr>
|
|
|
`},Pe.tablecell=function(he,ge){var ye=ge.header?"th":"td",Ie=ge.align?"<"+ye+' align="'+ge.align+'">':"<"+ye+">";return Ie+he+"</"+ye+`>
|
|
|
`},Pe.strong=function(he){return"<strong>"+he+"</strong>"},Pe.em=function(he){return"<em>"+he+"</em>"},Pe.codespan=function(he){return"<code>"+he+"</code>"},Pe.br=function(){return this.options.xhtml?"<br/>":"<br>"},Pe.del=function(he){return"<del>"+he+"</del>"},Pe.link=function(he,ge,ye){if(he=ut(this.options.sanitize,this.options.baseUrl,he),he===null)return ye;var Ie='<a href="'+ue(he)+'"';return ge&&(Ie+=' title="'+ge+'"'),Ie+=">"+ye+"</a>",Ie},Pe.image=function(he,ge,ye){if(he=ut(this.options.sanitize,this.options.baseUrl,he),he===null)return ye;var Ie='<img src="'+he+'" alt="'+ye+'"';return ge&&(Ie+=' title="'+ge+'"'),Ie+=this.options.xhtml?"/>":">",Ie},Pe.text=function(he){return he},ke}(),De=function(){function ke(){}var Pe=ke.prototype;return Pe.strong=function(he){return he},Pe.em=function(he){return he},Pe.codespan=function(he){return he},Pe.del=function(he){return he},Pe.html=function(he){return he},Pe.text=function(he){return he},Pe.link=function(he,ge,ye){return""+ye},Pe.image=function(he,ge,ye){return""+ye},Pe.br=function(){return""},ke}(),Ae=function(){function ke(){this.seen={}}var Pe=ke.prototype;return Pe.serialize=function(he){return he.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},Pe.getNextSafeSlug=function(he,ge){var ye=he,Ie=0;if(this.seen.hasOwnProperty(ye)){Ie=this.seen[he];do Ie++,ye=he+"-"+Ie;while(this.seen.hasOwnProperty(ye))}return ge||(this.seen[he]=Ie,this.seen[ye]=0),ye},Pe.slug=function(he,ge){ge===void 0&&(ge={});var ye=this.serialize(he);return this.getNextSafeSlug(ye,ge.dryrun)},ke}(),Ne=be,je=De,Qe=Ae,at=I.exports.defaults,Je=H.unescape,We=function(){function ke(He){this.options=He||at,this.options.renderer=this.options.renderer||new Ne,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new je,this.slugger=new Qe}ke.parse=function(he,ge){var ye=new ke(ge);return ye.parse(he)},ke.parseInline=function(he,ge){var ye=new ke(ge);return ye.parseInline(he)};var Pe=ke.prototype;return Pe.parse=function(he,ge){ge===void 0&&(ge=!0);var ye="",Ie,ae,_t,we,kt,Ft,er,Vt,It,Tt,fr,$r,zr,Qr,Ot,Yt,wr,Hr,Rr=he.length;for(Ie=0;Ie<Rr;Ie++)switch(Tt=he[Ie],Tt.type){case"space":continue;case"hr":{ye+=this.renderer.hr();continue}case"heading":{ye+=this.renderer.heading(this.parseInline(Tt.tokens),Tt.depth,Je(this.parseInline(Tt.tokens,this.textRenderer)),this.slugger);continue}case"code":{ye+=this.renderer.code(Tt.text,Tt.lang,Tt.escaped);continue}case"table":{for(Vt="",er="",we=Tt.header.length,ae=0;ae<we;ae++)er+=this.renderer.tablecell(this.parseInline(Tt.tokens.header[ae]),{header:!0,align:Tt.align[ae]});for(Vt+=this.renderer.tablerow(er),It="",we=Tt.cells.length,ae=0;ae<we;ae++){for(Ft=Tt.tokens.cells[ae],er="",kt=Ft.length,_t=0;_t<kt;_t++)er+=this.renderer.tablecell(this.parseInline(Ft[_t]),{header:!1,align:Tt.align[_t]});It+=this.renderer.tablerow(er)}ye+=this.renderer.table(Vt,It);continue}case"blockquote":{It=this.parse(Tt.tokens),ye+=this.renderer.blockquote(It);continue}case"list":{for(fr=Tt.ordered,$r=Tt.start,zr=Tt.loose,we=Tt.items.length,It="",ae=0;ae<we;ae++)Ot=Tt.items[ae],Yt=Ot.checked,wr=Ot.task,Qr="",Ot.task&&(Hr=this.renderer.checkbox(Yt),zr?Ot.tokens.length>0&&Ot.tokens[0].type==="text"?(Ot.tokens[0].text=Hr+" "+Ot.tokens[0].text,Ot.tokens[0].tokens&&Ot.tokens[0].tokens.length>0&&Ot.tokens[0].tokens[0].type==="text"&&(Ot.tokens[0].tokens[0].text=Hr+" "+Ot.tokens[0].tokens[0].text)):Ot.tokens.unshift({type:"text",text:Hr}):Qr+=Hr),Qr+=this.parse(Ot.tokens,zr),It+=this.renderer.listitem(Qr,wr,Yt);ye+=this.renderer.list(It,fr,$r);continue}case"html":{ye+=this.renderer.html(Tt.text);continue}case"paragraph":{ye+=this.renderer.paragraph(this.parseInline(Tt.tokens));continue}case"text":{for(It=Tt.tokens?this.parseInline(Tt.tokens):Tt.text;Ie+1<Rr&&he[Ie+1].type==="text";)Tt=he[++Ie],It+=`
|
|
|
`+(Tt.tokens?this.parseInline(Tt.tokens):Tt.text);ye+=ge?this.renderer.paragraph(It):It;continue}default:{var di='Token with "'+Tt.type+'" type was not found.';if(this.options.silent){console.error(di);return}else throw new Error(di)}}return ye},Pe.parseInline=function(he,ge){ge=ge||this.renderer;var ye="",Ie,ae,_t=he.length;for(Ie=0;Ie<_t;Ie++)switch(ae=he[Ie],ae.type){case"escape":{ye+=ge.text(ae.text);break}case"html":{ye+=ge.html(ae.text);break}case"link":{ye+=ge.link(ae.href,ae.title,this.parseInline(ae.tokens,ge));break}case"image":{ye+=ge.image(ae.href,ae.title,ae.text);break}case"strong":{ye+=ge.strong(this.parseInline(ae.tokens,ge));break}case"em":{ye+=ge.em(this.parseInline(ae.tokens,ge));break}case"codespan":{ye+=ge.codespan(ae.text);break}case"br":{ye+=ge.br();break}case"del":{ye+=ge.del(this.parseInline(ae.tokens,ge));break}case"text":{ye+=ge.text(ae.text);break}default:{var we='Token with "'+ae.type+'" type was not found.';if(this.options.silent){console.error(we);return}else throw new Error(we)}}return ye},ke}(),vt=Ue,gt=We,mt=Ve,xt=be,Lt=De,yt=Ae,Mt=H.merge,Nt=H.checkSanitizeDeprecation,j=H.escape,Z=I.exports.getDefaults,tt=I.exports.changeDefaults,oe=I.exports.defaults;function xe(ke,Pe,He){if(typeof ke=="undefined"||ke===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ke!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ke)+", string expected");if(typeof Pe=="function"&&(He=Pe,Pe=null),Pe=Mt({},xe.defaults,Pe||{}),Nt(Pe),He){var he=Pe.highlight,ge;try{ge=vt.lex(ke,Pe)}catch(_t){return He(_t)}var ye=function(we){var kt;if(!we)try{Pe.walkTokens&&xe.walkTokens(ge,Pe.walkTokens),kt=gt.parse(ge,Pe)}catch(Ft){we=Ft}return Pe.highlight=he,we?He(we):He(null,kt)};if(!he||he.length<3||(delete Pe.highlight,!ge.length))return ye();var Ie=0;xe.walkTokens(ge,function(_t){_t.type==="code"&&(Ie++,setTimeout(function(){he(_t.text,_t.lang,function(we,kt){if(we)return ye(we);kt!=null&&kt!==_t.text&&(_t.text=kt,_t.escaped=!0),Ie--,Ie===0&&ye()})},0))}),Ie===0&&ye();return}try{var ae=vt.lex(ke,Pe);return Pe.walkTokens&&xe.walkTokens(ae,Pe.walkTokens),gt.parse(ae,Pe)}catch(_t){if(_t.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,Pe.silent)return"<p>An error occurred:</p><pre>"+j(_t.message+"",!0)+"</pre>";throw _t}}xe.options=xe.setOptions=function(ke){return Mt(xe.defaults,ke),tt(xe.defaults),xe},xe.getDefaults=Z,xe.defaults=oe,xe.use=function(ke){var Pe=Mt({},ke);if(ke.renderer&&function(){var he=xe.defaults.renderer||new xt,ge=function(ae){var _t=he[ae];he[ae]=function(){for(var we=arguments.length,kt=new Array(we),Ft=0;Ft<we;Ft++)kt[Ft]=arguments[Ft];var er=ke.renderer[ae].apply(he,kt);return er===!1&&(er=_t.apply(he,kt)),er}};for(var ye in ke.renderer)ge(ye);Pe.renderer=he}(),ke.tokenizer&&function(){var he=xe.defaults.tokenizer||new mt,ge=function(ae){var _t=he[ae];he[ae]=function(){for(var we=arguments.length,kt=new Array(we),Ft=0;Ft<we;Ft++)kt[Ft]=arguments[Ft];var er=ke.tokenizer[ae].apply(he,kt);return er===!1&&(er=_t.apply(he,kt)),er}};for(var ye in ke.tokenizer)ge(ye);Pe.tokenizer=he}(),ke.walkTokens){var He=xe.defaults.walkTokens;Pe.walkTokens=function(he){ke.walkTokens(he),He&&He(he)}}xe.setOptions(Pe)},xe.walkTokens=function(ke,Pe){for(var He=V(ke),he;!(he=He()).done;){var ge=he.value;switch(Pe(ge),ge.type){case"table":{for(var ye=V(ge.tokens.header),Ie;!(Ie=ye()).done;){var ae=Ie.value;xe.walkTokens(ae,Pe)}for(var _t=V(ge.tokens.cells),we;!(we=_t()).done;)for(var kt=we.value,Ft=V(kt),er;!(er=Ft()).done;){var Vt=er.value;xe.walkTokens(Vt,Pe)}break}case"list":{xe.walkTokens(ge.items,Pe);break}default:ge.tokens&&xe.walkTokens(ge.tokens,Pe)}}},xe.parseInline=function(ke,Pe){if(typeof ke=="undefined"||ke===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof ke!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(ke)+", string expected");Pe=Mt({},xe.defaults,Pe||{}),Nt(Pe);try{var He=vt.lexInline(ke,Pe);return Pe.walkTokens&&xe.walkTokens(He,Pe.walkTokens),gt.parseInline(He,Pe)}catch(he){if(he.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,Pe.silent)return"<p>An error occurred:</p><pre>"+j(he.message+"",!0)+"</pre>";throw he}},xe.Parser=gt,xe.parser=gt.parse,xe.Renderer=xt,xe.TextRenderer=Lt,xe.Lexer=vt,xe.lexer=vt.lex,xe.Tokenizer=mt,xe.Slugger=yt,xe.parse=xe;var Kt=xe;return Kt})},11690:function(Ct){const Le=/[&<>"']/,S=/[&<>"']/g,N=/[<>"']|&(?!#?\w+;)/,B=/[<>"']|&(?!#?\w+;)/g,V={"&":"&","<":"<",">":">",'"':""","'":"'"},I=z=>V[z];function A(z,ie){if(ie){if(Le.test(z))return z.replace(S,I)}else if(N.test(z))return z.replace(B,I);return z}const d=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(z){return z.replace(d,(ie,te)=>(te=te.toLowerCase(),te==="colon"?":":te.charAt(0)==="#"?te.charAt(1)==="x"?String.fromCharCode(parseInt(te.substring(2),16)):String.fromCharCode(+te.substring(1)):""))}const b=/(^|[^\[])\^/g;function n(z,ie){z=z.source||z,ie=ie||"";const te={replace:(me,_e)=>(_e=_e.source||_e,_e=_e.replace(b,"$1"),z=z.replace(me,_e),te),getRegex:()=>new RegExp(z,ie)};return te}const E=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function c(z,ie,te){if(z){let me;try{me=decodeURIComponent(U(te)).replace(E,"").toLowerCase()}catch(_e){return null}if(me.indexOf("javascript:")===0||me.indexOf("vbscript:")===0||me.indexOf("data:")===0)return null}ie&&!f.test(te)&&(te=F(ie,te));try{te=encodeURI(te).replace(/%25/g,"%")}catch(me){return null}return te}const l={},u=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function F(z,ie){l[" "+z]||(u.test(z)?l[" "+z]=z+"/":l[" "+z]=W(z,"/",!0)),z=l[" "+z];const te=z.indexOf(":")===-1;return ie.substring(0,2)==="//"?te?ie:z.replace(m,"$1")+ie:ie.charAt(0)==="/"?te?ie:z.replace(x,"$1")+ie:z+ie}const k={exec:function(){}};function T(z){let ie=1,te,me;for(;ie<arguments.length;ie++){te=arguments[ie];for(me in te)Object.prototype.hasOwnProperty.call(te,me)&&(z[me]=te[me])}return z}function L(z,ie){const te=z.replace(/\|/g,(le,Q,se)=>{let H=!1,J=Q;for(;--J>=0&&se[J]==="\\";)H=!H;return H?"|":" |"}),me=te.split(/ \|/);let _e=0;if(me.length>ie)me.splice(ie);else for(;me.length<ie;)me.push("");for(;_e<me.length;_e++)me[_e]=me[_e].trim().replace(/\\\|/g,"|");return me}function W(z,ie,te){const me=z.length;if(me===0)return"";let _e=0;for(;_e<me;){const le=z.charAt(me-_e-1);if(le===ie&&!te)_e++;else if(le!==ie&&te)_e++;else break}return z.substr(0,me-_e)}function P(z,ie){if(z.indexOf(ie[1])===-1)return-1;const te=z.length;let me=0,_e=0;for(;_e<te;_e++)if(z[_e]==="\\")_e++;else if(z[_e]===ie[0])me++;else if(z[_e]===ie[1]&&(me--,me<0))return _e;return-1}function O(z){z&&z.sanitize&&!z.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function $(z,ie){if(ie<1)return"";let te="";for(;ie>1;)ie&1&&(te+=z),ie>>=1,z+=z;return te+z}Ct.exports={escape:A,unescape:U,edit:n,cleanUrl:c,resolveUrl:F,noopTest:k,merge:T,splitCells:L,rtrim:W,findClosingBracket:P,checkSanitizeDeprecation:O,repeatString:$}},75918:function(Ct,Le,S){"use strict";S.d(Le,{Wi:function(){return d},Z0:function(){return U},aU:function(){return A},eZ:function(){return n},wY:function(){return b}});var N=S(4348),B=S(69323),V=S(13268),I=function(E,f,c,l){function u(m){return m instanceof c?m:new c(function(x){x(m)})}return new(c||(c=Promise))(function(m,x){function F(L){try{T(l.next(L))}catch(W){x(W)}}function k(L){try{T(l.throw(L))}catch(W){x(W)}}function T(L){L.done?m(L.value):u(L.value).then(F,k)}T((l=l.apply(E,f||[])).next())})};class A extends B.JT{constructor(f,c="",l="",u=!0,m){super(),this._onDidChange=this._register(new N.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=f,this._label=c,this._cssClass=l,this._enabled=u,this._actionCallback=m}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 I(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(f))})}}class d extends B.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new N.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new N.Q5),this.onDidRun=this._onDidRun.event}run(f,c){return I(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 I(this,void 0,void 0,function*(){yield f.run(c)})}}class U extends A{constructor(f){super(U.ID,f,f?"separator text":"separator"),this.checked=!1,this.enabled=!1}}U.ID="vs.actions.separator";class b{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 I(this,void 0,void 0,function*(){})}}class n extends A{constructor(){super(n.ID,V.N("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},76068:function(Ct,Le,S){"use strict";S.d(Le,{ok:function(){return N}});function N(B,V){if(!B)throw new Error(V?`Assertion failed (${V})`:"Assertion Failed")}},52615:function(Ct,Le,S){"use strict";S.d(Le,{CM:function(){return A},JL:function(){return d},dT:function(){return b},fK:function(){return I},lA:function(){return U}});var N=S(4348);class B{constructor(){this._icons=new Map,this._onDidRegister=new N.Q5}add(E){const f=this._icons.get(E.id);f?E.description?f.description=E.description:console.error(`Duplicate registration of codicon ${E.id}`):(this._icons.set(E.id,E),this._onDidRegister.fire(E))}get(E){return this._icons.get(E)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const V=new B,I=V;function A(n,E){return new U(n,E)}function d(n){return n?n.replace(/\$\((.*?)\)/g,(E,f)=>` ${f} `).trim():""}class U{constructor(E,f,c){this.id=E,this.definition=f,this.description=c,V.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var b;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const E=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function f(u){if(u instanceof U)return["codicon","codicon-"+u.id];const m=E.exec(u.id);if(!m)return f(U.error);let[,x,F]=m;const k=["codicon","codicon-"+x];return F&&k.push("codicon-modifier-"+F.substr(1)),k}n.asClassNameArray=f;function c(u){return f(u).join(" ")}n.asClassName=c;function l(u){return"."+f(u).join(".")}n.asCSSSelector=l})(b||(b={})),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"})}(U||(U={}))},79881:function(Ct,Le,S){"use strict";S.d(Le,{B8:function(){return f},Cp:function(){return I},F0:function(){return b},L6:function(){return E},VV:function(){return U},b1:function(){return n},dL:function(){return V},ri:function(){return A}});class N{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 B=new N;function V(c){U(c)||B.onUnexpectedError(c)}function I(c){U(c)||B.onUnexpectedExternalError(c)}function A(c){if(c instanceof Error){let{name:l,message:u}=c;const m=c.stacktrace||c.stack;return{$isError:!0,name:l,message:u,stack:m}}return c}const d="Canceled";function U(c){return c instanceof Error&&c.name===d&&c.message===d}function b(){const c=new Error(d);return c.name=c.message,c}function n(c){return c?new Error(`Illegal argument: ${c}`):new Error("Illegal argument")}function E(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(Ct,Le,S){"use strict";S.d(Le,{D0:function(){return f},E7:function(){return c},K3:function(){return E},Q5:function(){return n},ZD:function(){return l},ju:function(){return A}});var N=S(79881),B=S(69323),V=S(34502),I=S(95830),A;(function(u){u.None=()=>B.JT.None;function m(se){return(H,J=null,K)=>{let M=!1,D;return D=se(ne=>{if(!M)return D?D.dispose():M=!0,H.call(J,ne)},null,K),M&&D.dispose(),D}}u.once=m;function x(se,H){return P((J,K=null,M)=>se(D=>J.call(K,H(D)),null,M))}u.map=x;function F(se,H){return P((J,K=null,M)=>se(D=>{H(D),J.call(K,D)},null,M))}u.forEach=F;function k(se,H){return P((J,K=null,M)=>se(D=>H(D)&&J.call(K,D),null,M))}u.filter=k;function T(se){return se}u.signal=T;function L(...se){return(H,J=null,K)=>(0,B.F8)(...se.map(M=>M(D=>H.call(J,D),null,K)))}u.any=L;function W(se,H,J){let K=J;return x(se,M=>(K=H(K,M),K))}u.reduce=W;function P(se){let H;const J=new n({onFirstListenerAdd(){H=se(J.fire,J)},onLastListenerRemove(){H.dispose()}});return J.event}function O(se,H,J=100,K=!1,M){let D,ne,de,Oe=0;const Ve=new n({leakWarningThreshold:M,onFirstListenerAdd(){D=se(nt=>{Oe++,ne=H(ne,nt),K&&!de&&(Ve.fire(ne),ne=void 0),clearTimeout(de),de=setTimeout(()=>{const Fe=ne;ne=void 0,de=void 0,(!K||Oe>1)&&Ve.fire(Fe),Oe=0},J)})},onLastListenerRemove(){D.dispose()}});return Ve.event}u.debounce=O;function $(se,H=(J,K)=>J===K){let J=!0,K;return k(se,M=>{const D=J||!H(M,K);return J=!1,K=M,D})}u.latch=$;function z(se,H){return[u.filter(se,H),u.filter(se,J=>!H(J))]}u.split=z;function ie(se,H=!1,J=[]){let K=J.slice(),M=se(de=>{K?K.push(de):ne.fire(de)});const D=()=>{K&&K.forEach(de=>ne.fire(de)),K=null},ne=new n({onFirstListenerAdd(){M||(M=se(de=>ne.fire(de)))},onFirstListenerDidAdd(){K&&(H?setTimeout(D):D())},onLastListenerRemove(){M&&M.dispose(),M=null}});return ne.event}u.buffer=ie;class te{constructor(H){this.event=H}map(H){return new te(x(this.event,H))}forEach(H){return new te(F(this.event,H))}filter(H){return new te(k(this.event,H))}reduce(H,J){return new te(W(this.event,H,J))}latch(){return new te($(this.event))}debounce(H,J=100,K=!1,M){return new te(O(this.event,H,J,K,M))}on(H,J,K){return this.event(H,J,K)}once(H,J,K){return m(this.event)(H,J,K)}}function me(se){return new te(se)}u.chain=me;function _e(se,H,J=K=>K){const K=(...de)=>ne.fire(J(...de)),M=()=>se.on(H,K),D=()=>se.removeListener(H,K),ne=new n({onFirstListenerAdd:M,onLastListenerRemove:D});return ne.event}u.fromNodeEventEmitter=_e;function le(se,H,J=K=>K){const K=(...de)=>ne.fire(J(...de)),M=()=>se.addEventListener(H,K),D=()=>se.removeEventListener(H,K),ne=new n({onFirstListenerAdd:M,onLastListenerRemove:D});return ne.event}u.fromDOMEventEmitter=le;function Q(se){return new Promise(H=>m(se)(H))}u.toPromise=Q})(A||(A={}));class d{constructor(m){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${m}_${d._idPool++}`}start(m){this._stopWatch=new I.G(!0),this._listenerCount=m}stop(){if(this._stopWatch){const m=this._stopWatch.elapsed();this._elapsedOverall+=m,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${m.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}d._idPool=0;let U=-1;class b{constructor(m,x=Math.random().toString(18).slice(2,5)){this.customThreshold=m,this.name=x,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(m){let x=U;if(typeof this.customThreshold=="number"&&(x=this.customThreshold),x<=0||m<x)return;this._stacks||(this._stacks=new Map);const F=new Error().stack.split(`
|
|
|
`).slice(3).join(`
|
|
|
`),k=this._stacks.get(F)||0;if(this._stacks.set(F,k+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=x*.5;let T,L=0;for(const[W,P]of this._stacks)(!T||L<P)&&(T=W,L=P);console.warn(`[${this.name}] potential listener LEAK detected, having ${m} listeners already. MOST frequent listener (${L}):`),console.warn(T)}return()=>{const T=this._stacks.get(F)||0;this._stacks.set(F,T-1)}}}class n{constructor(m){var x;this._disposed=!1,this._options=m,this._leakageMon=U>0?new b(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((x=this._options)===null||x===void 0)&&x._profName?new d(this._options._profName):void 0}get event(){return this._event||(this._event=(m,x,F)=>{var k;this._listeners||(this._listeners=new V.S);const T=this._listeners.isEmpty();T&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const L=this._listeners.push(x?[m,x]:m);T&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,m,x);const W=(k=this._leakageMon)===null||k===void 0?void 0:k.check(this._listeners.size),P=(0,B.OF)(()=>{W&&W(),this._disposed||(L(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return F instanceof B.SL?F.add(P):Array.isArray(F)&&F.push(P),P}),this._event}fire(m){var x,F;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new V.S);for(let k of this._listeners)this._deliveryQueue.push([k,m]);for((x=this._perfMon)===null||x===void 0||x.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[k,T]=this._deliveryQueue.shift();try{typeof k=="function"?k.call(void 0,T):k[0].call(k[1],T)}catch(L){(0,N.dL)(L)}}(F=this._perfMon)===null||F===void 0||F.stop()}}dispose(){var m,x,F,k,T;this._disposed||(this._disposed=!0,(m=this._listeners)===null||m===void 0||m.clear(),(x=this._deliveryQueue)===null||x===void 0||x.clear(),(k=(F=this._options)===null||F===void 0?void 0:F.onLastListenerRemove)===null||k===void 0||k.call(F),(T=this._leakageMon)===null||T===void 0||T.dispose())}}class E extends n{constructor(m){super(m),this._isPaused=0,this._eventQueue=new V.S,this._mergeFn=m==null?void 0:m.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const m=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(m))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(m){this._listeners&&(this._isPaused!==0?this._eventQueue.push(m):super.fire(m))}}class f extends E{constructor(m){var x;super(m),this._delay=(x=m.delay)!==null&&x!==void 0?x:100}fire(m){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(m)}}class c{constructor(){this.buffers=[]}wrapEvent(m){return(x,F,k)=>m(T=>{const L=this.buffers[this.buffers.length-1];L?L.push(()=>x.call(F,T)):x.call(F,T)},void 0,k)}bufferEvents(m){const x=[];this.buffers.push(x);const F=m();return this.buffers.pop(),x.forEach(k=>k()),F}}class l{constructor(){this.listening=!1,this.inputEvent=A.None,this.inputEventListener=B.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(m){this.inputEvent=m,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=m(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(Ct,Le,S){"use strict";S.d(Le,{I:function(){return N}});function N(B){const V=this;let I=!1,A;return function(){return I||(I=!0,A=B.apply(V,arguments)),A}}},88226:function(Ct,Le,S){"use strict";S.d(Le,{$:function(){return N}});var N;(function(B){function V(L){return L&&typeof L=="object"&&typeof L[Symbol.iterator]=="function"}B.is=V;const I=Object.freeze([]);function A(){return I}B.empty=A;function*d(L){yield L}B.single=d;function U(L){return L||I}B.from=U;function b(L){return!L||L[Symbol.iterator]().next().done===!0}B.isEmpty=b;function n(L){return L[Symbol.iterator]().next().value}B.first=n;function E(L,W){for(const P of L)if(W(P))return!0;return!1}B.some=E;function f(L,W){for(const P of L)if(W(P))return P}B.find=f;function*c(L,W){for(const P of L)W(P)&&(yield P)}B.filter=c;function*l(L,W){let P=0;for(const O of L)yield W(O,P++)}B.map=l;function*u(...L){for(const W of L)for(const P of W)yield P}B.concat=u;function*m(L){for(const W of L)for(const P of W)yield P}B.concatNested=m;function x(L,W,P){let O=P;for(const $ of L)O=W(O,$);return O}B.reduce=x;function*F(L,W,P=L.length){for(W<0&&(W+=L.length),P<0?P+=L.length:P>L.length&&(P=L.length);W<P;W++)yield L[W]}B.slice=F;function k(L,W=Number.POSITIVE_INFINITY){const P=[];if(W===0)return[P,L];const O=L[Symbol.iterator]();for(let $=0;$<W;$++){const z=O.next();if(z.done)return[P,B.empty()];P.push(z.value)}return[P,{[Symbol.iterator](){return O}}]}B.consume=k;function T(L,W,P=(O,$)=>O===$){const O=L[Symbol.iterator](),$=W[Symbol.iterator]();for(;;){const z=O.next(),ie=$.next();if(z.done!==ie.done)return!1;if(z.done)return!0;if(!P(z.value,ie.value))return!1}}B.equals=T})(N||(N={}))},69323:function(Ct,Le,S){"use strict";S.d(Le,{B9:function(){return l},F8:function(){return u},JT:function(){return F},Jz:function(){return T},OF:function(){return m},SL:function(){return x},Wf:function(){return c},XK:function(){return k},dk:function(){return E}});var N=S(17845),B=S(88226);const V=!1;let I=null;function A(L){I=L}if(V){const L="__is_disposable_tracked__";A(new class{trackDisposable(W){const P=new Error("Potentially leaked disposable").stack;setTimeout(()=>{W[L]||console.log(P)},3e3)}setParent(W,P){if(W&&W!==F.None)try{W[L]=!0}catch(O){}}markAsDisposed(W){if(W&&W!==F.None)try{W[L]=!0}catch(P){}}markAsSingleton(W){}})}function d(L){return I==null||I.trackDisposable(L),L}function U(L){I==null||I.markAsDisposed(L)}function b(L,W){I==null||I.setParent(L,W)}function n(L,W){if(I)for(const P of L)I.setParent(P,W)}function E(L){return I==null||I.markAsSingleton(L),L}class f extends Error{constructor(W){super(`Encountered errors while disposing of store. Errors: [${W.join(", ")}]`),this.errors=W}}function c(L){return typeof L.dispose=="function"&&L.dispose.length===0}function l(L){if(B.$.is(L)){let W=[];for(const P of L)if(P)try{P.dispose()}catch(O){W.push(O)}if(W.length===1)throw W[0];if(W.length>1)throw new f(W);return Array.isArray(L)?[]:L}else if(L)return L.dispose(),L}function u(...L){const W=m(()=>l(L));return n(L,W),W}function m(L){const W=d({dispose:(0,N.I)(()=>{U(W),L()})});return W}class x{constructor(){this._toDispose=new Set,this._isDisposed=!1,d(this)}dispose(){this._isDisposed||(U(this),this._isDisposed=!0,this.clear())}clear(){try{l(this._toDispose.values())}finally{this._toDispose.clear()}}add(W){if(!W)return W;if(W===this)throw new Error("Cannot register a disposable on itself!");return b(W,this),this._isDisposed?x.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(W),W}}x.DISABLE_DISPOSED_WARNING=!1;class F{constructor(){this._store=new x,d(this),b(this._store,this)}dispose(){U(this),this._store.dispose()}_register(W){if(W===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(W)}}F.None=Object.freeze({dispose(){}});class k{constructor(){this._isDisposed=!1,d(this)}get value(){return this._isDisposed?void 0:this._value}set value(W){var P;this._isDisposed||W===this._value||((P=this._value)===null||P===void 0||P.dispose(),W&&b(W,this),this._value=W)}clear(){this.value=void 0}dispose(){var W;this._isDisposed=!0,U(this),(W=this._value)===null||W===void 0||W.dispose(),this._value=void 0}clearAndLeak(){const W=this._value;return this._value=void 0,W&&b(W,null),W}}class T{constructor(W){this.object=W}dispose(){}}},34502:function(Ct,Le,S){"use strict";S.d(Le,{S:function(){return B}});class N{constructor(I){this.element=I,this.next=N.Undefined,this.prev=N.Undefined}}N.Undefined=new N(void 0);class B{constructor(){this._first=N.Undefined,this._last=N.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===N.Undefined}clear(){let I=this._first;for(;I!==N.Undefined;){const A=I.next;I.prev=N.Undefined,I.next=N.Undefined,I=A}this._first=N.Undefined,this._last=N.Undefined,this._size=0}unshift(I){return this._insert(I,!1)}push(I){return this._insert(I,!0)}_insert(I,A){const d=new N(I);if(this._first===N.Undefined)this._first=d,this._last=d;else if(A){const b=this._last;this._last=d,d.prev=b,b.next=d}else{const b=this._first;this._first=d,d.next=b,b.prev=d}this._size+=1;let U=!1;return()=>{U||(U=!0,this._remove(d))}}shift(){if(this._first!==N.Undefined){const I=this._first.element;return this._remove(this._first),I}}pop(){if(this._last!==N.Undefined){const I=this._last.element;return this._remove(this._last),I}}_remove(I){if(I.prev!==N.Undefined&&I.next!==N.Undefined){const A=I.prev;A.next=I.next,I.next.prev=A}else I.prev===N.Undefined&&I.next===N.Undefined?(this._first=N.Undefined,this._last=N.Undefined):I.next===N.Undefined?(this._last=this._last.prev,this._last.next=N.Undefined):I.prev===N.Undefined&&(this._first=this._first.next,this._first.prev=N.Undefined);this._size-=1}*[Symbol.iterator](){let I=this._first;for(;I!==N.Undefined;)yield I.element,I=I.next}}},23345:function(Ct,Le,S){"use strict";S.d(Le,{$L:function(){return O},ED:function(){return T},IJ:function(){return W},OS:function(){return te},WE:function(){return z},dz:function(){return L},gn:function(){return $},li:function(){return m},r:function(){return le},tY:function(){return P},xS:function(){return ie}});var N=S(97671),B;const V="en";let I=!1,A=!1,d=!1,U=!1,b=!1,n=!1,E=!1,f,c=null,l=null,u;const m=typeof self=="object"?self:typeof S.g=="object"?S.g:{};let x;typeof m.vscode!="undefined"&&typeof m.vscode.process!="undefined"?x=m.vscode.process:typeof N!="undefined"&&(x=N);const F=typeof((B=x==null?void 0:x.versions)===null||B===void 0?void 0:B.electron)=="string"&&x.type==="renderer";if(typeof navigator=="object"&&!F)u=navigator.userAgent,I=u.indexOf("Windows")>=0,A=u.indexOf("Macintosh")>=0,E=(u.indexOf("Macintosh")>=0||u.indexOf("iPad")>=0||u.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,d=u.indexOf("Linux")>=0,n=!0,f=navigator.language,c=f;else if(typeof x=="object"){I=x.platform==="win32",A=x.platform==="darwin",d=x.platform==="linux",U=d&&!!x.env.SNAP&&!!x.env.SNAP_REVISION,f=V,c=V;const Q=x.env.VSCODE_NLS_CONFIG;if(Q)try{const se=JSON.parse(Q),H=se.availableLanguages["*"];f=se.locale,c=H||V,l=se._translationsConfigFile}catch(se){}b=!0}else console.error("Unable to resolve platform.");let k=0;A?k=1:I?k=3:d&&(k=2);const T=I,L=A,W=d,P=b,O=n,$=E,z=u,ie=function(){if(m.setImmediate)return m.setImmediate.bind(m);if(typeof m.postMessage=="function"&&!m.importScripts){let H=[];m.addEventListener("message",K=>{if(K.data&&K.data.vscodeSetImmediateId)for(let M=0,D=H.length;M<D;M++){const ne=H[M];if(ne.id===K.data.vscodeSetImmediateId){H.splice(M,1),ne.callback();return}}});let J=0;return K=>{const M=++J;H.push({id:M,callback:K}),m.postMessage({vscodeSetImmediateId:M},"*")}}if(typeof(x==null?void 0:x.nextTick)=="function")return x.nextTick.bind(x);const se=Promise.resolve();return H=>se.then(H)}(),te=A||E?2:I?1:3;let me=!0,_e=!1;function le(){if(!_e){_e=!0;const Q=new Uint8Array(2);Q[0]=1,Q[1]=2,me=new Uint16Array(Q.buffer)[0]===513}return me}},95830:function(Ct,Le,S){"use strict";S.d(Le,{G:function(){return V}});var N=S(23345);const B=N.li.performance&&typeof N.li.performance.now=="function";class V{constructor(A){this._highResolution=B&&A,this._startTime=this._now(),this._stopTime=-1}static create(A=!0){return new V(A)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?N.li.performance.now():Date.now()}}},82983:function(Ct,Le,S){"use strict";S.d(Le,{$i:function(){return Oe},C8:function(){return Ze},GF:function(){return f},HO:function(){return J},IO:function(){return c},K7:function(){return rt},Kw:function(){return Jt},LC:function(){return m},Mh:function(){return ie},P1:function(){return te},PJ:function(){return pt},Qe:function(){return Ve},R1:function(){return E},RP:function(){return ne},S6:function(){return Bt},TT:function(){return T},Ut:function(){return M},V8:function(){return x},WU:function(){return V},YK:function(){return _e},YU:function(){return I},ZG:function(){return me},ZH:function(){return Q},ab:function(){return nt},c1:function(){return st},df:function(){return O},ec:function(){return A},fi:function(){return zt},fy:function(){return d},j3:function(){return U},j_:function(){return W},m5:function(){return N},mK:function(){return P},mr:function(){return l},oH:function(){return ze},oL:function(){return b},ok:function(){return z},ow:function(){return F},qq:function(){return $},qu:function(){return k},rL:function(){return le},uS:function(){return At},un:function(){return n},uq:function(){return u},vH:function(){return H},xe:function(){return Fe},zY:function(){return L}});function N(ue){return!ue||typeof ue!="string"?!0:ue.trim().length===0}const B=/{(\d+)}/g;function V(ue,...be){return be.length===0?ue:ue.replace(B,function(De,Ae){const Ne=parseInt(Ae,10);return isNaN(Ne)||Ne<0||Ne>=be.length?De:be[Ne]})}function I(ue){return ue.replace(/[<>&]/g,function(be){switch(be){case"<":return"<";case">":return">";case"&":return"&";default:return be}})}function A(ue){return ue.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function d(ue,be=" "){const De=U(ue,be);return b(De,be)}function U(ue,be){if(!ue||!be)return ue;const De=be.length;if(De===0||ue.length===0)return ue;let Ae=0;for(;ue.indexOf(be,Ae)===Ae;)Ae=Ae+De;return ue.substring(Ae)}function b(ue,be){if(!ue||!be)return ue;const De=be.length,Ae=ue.length;if(De===0||Ae===0)return ue;let Ne=Ae,je=-1;for(;je=ue.lastIndexOf(be,Ne-1),!(je===-1||je+De!==Ne);){if(je===0)return"";Ne=je}return ue.substring(0,Ne)}function n(ue){return ue.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function E(ue){return ue.replace(/\*/g,"")}function f(ue,be,De={}){if(!ue)throw new Error("Cannot create regex from empty string");be||(ue=A(ue)),De.wholeWord&&(/\B/.test(ue.charAt(0))||(ue="\\b"+ue),/\B/.test(ue.charAt(ue.length-1))||(ue=ue+"\\b"));let Ae="";return De.global&&(Ae+="g"),De.matchCase||(Ae+="i"),De.multiline&&(Ae+="m"),De.unicode&&(Ae+="u"),new RegExp(ue,Ae)}function c(ue){return ue.source==="^"||ue.source==="^$"||ue.source==="$"||ue.source==="^\\s*$"?!1:!!(ue.exec("")&&ue.lastIndex===0)}function l(ue){return(ue.global?"g":"")+(ue.ignoreCase?"i":"")+(ue.multiline?"m":"")+(ue.unicode?"u":"")}function u(ue){return ue.split(/\r\n|\r|\n/)}function m(ue){for(let be=0,De=ue.length;be<De;be++){const Ae=ue.charCodeAt(be);if(Ae!==32&&Ae!==9)return be}return-1}function x(ue,be=0,De=ue.length){for(let Ae=be;Ae<De;Ae++){const Ne=ue.charCodeAt(Ae);if(Ne!==32&&Ne!==9)return ue.substring(be,Ae)}return ue.substring(be,De)}function F(ue,be=ue.length-1){for(let De=be;De>=0;De--){const Ae=ue.charCodeAt(De);if(Ae!==32&&Ae!==9)return De}return-1}function k(ue,be){return ue<be?-1:ue>be?1:0}function T(ue,be,De=0,Ae=ue.length,Ne=0,je=be.length){for(;De<Ae&&Ne<je;De++,Ne++){let Je=ue.charCodeAt(De),We=be.charCodeAt(Ne);if(Je<We)return-1;if(Je>We)return 1}const Qe=Ae-De,at=je-Ne;return Qe<at?-1:Qe>at?1:0}function L(ue,be){return W(ue,be,0,ue.length,0,be.length)}function W(ue,be,De=0,Ae=ue.length,Ne=0,je=be.length){for(;De<Ae&&Ne<je;De++,Ne++){let Je=ue.charCodeAt(De),We=be.charCodeAt(Ne);if(Je===We)continue;if(Je>=128||We>=128)return T(ue.toLowerCase(),be.toLowerCase(),De,Ae,Ne,je);P(Je)&&(Je-=32),P(We)&&(We-=32);const vt=Je-We;if(vt!==0)return vt}const Qe=Ae-De,at=je-Ne;return Qe<at?-1:Qe>at?1:0}function P(ue){return ue>=97&&ue<=122}function O(ue){return ue>=65&&ue<=90}function $(ue,be){return ue.length===be.length&&W(ue,be)===0}function z(ue,be){const De=be.length;return be.length>ue.length?!1:W(ue,be,0,De)===0}function ie(ue,be){let De,Ae=Math.min(ue.length,be.length);for(De=0;De<Ae;De++)if(ue.charCodeAt(De)!==be.charCodeAt(De))return De;return Ae}function te(ue,be){let De,Ae=Math.min(ue.length,be.length);const Ne=ue.length-1,je=be.length-1;for(De=0;De<Ae;De++)if(ue.charCodeAt(Ne-De)!==be.charCodeAt(je-De))return De;return Ae}function me(ue){return 55296<=ue&&ue<=56319}function _e(ue){return 56320<=ue&&ue<=57343}function le(ue,be){return(ue-55296<<10)+(be-56320)+65536}function Q(ue,be,De){const Ae=ue.charCodeAt(De);if(me(Ae)&&De+1<be){const Ne=ue.charCodeAt(De+1);if(_e(Ne))return le(Ae,Ne)}return Ae}function se(ue,be){const De=ue.charCodeAt(be-1);if(_e(De)&&be>1){const Ae=ue.charCodeAt(be-2);if(me(Ae))return le(Ae,De)}return De}function H(ue,be){const De=$t.getInstance(),Ae=be,Ne=ue.length,je=Q(ue,Ne,be);be+=je>=65536?2:1;let Qe=De.getGraphemeBreakType(je);for(;be<Ne;){const at=Q(ue,Ne,be),Je=De.getGraphemeBreakType(at);if(zt(Qe,Je))break;be+=at>=65536?2:1,Qe=Je}return be-Ae}function J(ue,be){const De=$t.getInstance(),Ae=be,Ne=se(ue,be);be-=Ne>=65536?2:1;let je=De.getGraphemeBreakType(Ne);for(;be>0;){const Qe=se(ue,be),at=De.getGraphemeBreakType(Qe);if(zt(at,je))break;be-=Qe>=65536?2:1,je=at}return Ae-be}const K=/(?:[\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 M(ue){return K.test(ue)}const D=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function ne(ue){return D.test(ue)}const de=/^[\t\n\r\x20-\x7E]*$/;function Oe(ue){return de.test(ue)}const Ve=/[\u2028\u2029]/;function nt(ue){return Ve.test(ue)}function Fe(ue){for(let be=0,De=ue.length;be<De;be++)if(rt(ue.charCodeAt(be)))return!0;return!1}function rt(ue){return ue=+ue,ue>=11904&&ue<=55215||ue>=63744&&ue<=64255||ue>=65281&&ue<=65374}function Ze(ue){return ue>=127462&&ue<=127487||ue===8986||ue===8987||ue===9200||ue===9203||ue>=9728&&ue<=10175||ue===11088||ue===11093||ue>=127744&&ue<=128591||ue>=128640&&ue<=128764||ue>=128992&&ue<=129003||ue>=129280&&ue<=129535||ue>=129648&&ue<=129750}const st="\uFEFF";function At(ue){return!!(ue&&ue.length>0&&ue.charCodeAt(0)===65279)}function Jt(ue,be=!1){return ue?(be&&(ue=ue.replace(/\\./g,"")),ue.toLowerCase()!==ue):!1}function pt(ue){return ue=ue%(2*26),ue<26?String.fromCharCode(97+ue):String.fromCharCode(65+ue-26)}function Bt(ue){return $t.getInstance().getGraphemeBreakType(ue)}function zt(ue,be){return ue===0?be!==5&&be!==7:ue===2&&be===3?!1:ue===4||ue===2||ue===3||be===4||be===2||be===3?!0:!(ue===8&&(be===8||be===9||be===11||be===12)||(ue===11||ue===9)&&(be===9||be===10)||(ue===12||ue===10)&&be===10||be===5||be===13||be===7||ue===1||ue===13&&be===14||ue===6&&be===6)}class $t{constructor(){this._data=Me()}static getInstance(){return $t._INSTANCE||($t._INSTANCE=new $t),$t._INSTANCE}getGraphemeBreakType(be){if(be<32)return be===10?3:be===13?2:4;if(be<127)return 0;const De=this._data,Ae=De.length/3;let Ne=1;for(;Ne<=Ae;)if(be<De[3*Ne])Ne=2*Ne;else if(be>De[3*Ne+1])Ne=2*Ne+1;else return De[3*Ne+2];return 0}}$t._INSTANCE=null;function Me(){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 ze(ue,be){if(ue===0)return 0;const De=Ue(ue,be);if(De!==void 0)return De;const Ae=se(be,ue);return ue-=ot(Ae),ue}function Ue(ue,be){let De=se(be,ue);for(ue-=ot(De);ut(De)||De===65039||De===8419;){if(ue===0)return;De=se(be,ue),ue-=ot(De)}if(Ze(De)){if(ue>=0){const Ae=se(be,ue);Ae===8205&&(ue-=ot(Ae))}return ue}}function ot(ue){return ue>=65536?2:1}function ut(ue){return 127995<=ue&&ue<=127999}},72999:function(Ct,Le,S){"use strict";S.d(Le,{$E:function(){return m},$K:function(){return U},D8:function(){return c},HD:function(){return B},IU:function(){return x},Jp:function(){return b},Kn:function(){return V},cW:function(){return E},f6:function(){return F},hj:function(){return I},jn:function(){return A},kJ:function(){return N},mf:function(){return f},o8:function(){return d},p_:function(){return n},vE:function(){return k}});function N(T){return Array.isArray(T)}function B(T){return typeof T=="string"}function V(T){return typeof T=="object"&&T!==null&&!Array.isArray(T)&&!(T instanceof RegExp)&&!(T instanceof Date)}function I(T){return typeof T=="number"&&!isNaN(T)}function A(T){return T===!0||T===!1}function d(T){return typeof T=="undefined"}function U(T){return!b(T)}function b(T){return d(T)||T===null}function n(T,L){if(!T)throw new Error(L?`Unexpected type, expected '${L}'`:"Unexpected type")}function E(T){if(b(T))throw new Error("Assertion Failed: argument is undefined or null");return T}function f(T){return typeof T=="function"}function c(T,L){const W=Math.min(T.length,L.length);for(let P=0;P<W;P++)l(T[P],L[P])}function l(T,L){if(B(L)){if(typeof T!==L)throw new Error(`argument does not match constraint: typeof ${L}`)}else if(f(L)){try{if(T instanceof L)return}catch(W){}if(!b(T)&&T.constructor===L||L.length===1&&L.call(void 0,T)===!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(T){let L=[],W=Object.getPrototypeOf(T);for(;Object.prototype!==W;)L=L.concat(Object.getOwnPropertyNames(W)),W=Object.getPrototypeOf(W);return L}function m(T){const L=[];for(const W of u(T))typeof T[W]=="function"&&L.push(W);return L}function x(T,L){const W=O=>function(){const $=Array.prototype.slice.call(arguments,0);return L(O,$)};let P={};for(const O of T)P[O]=W(O);return P}function F(T){return T===null?void 0:T}function k(T,L="Unreachable"){throw new Error(L)}},13268:function(Ct,Le,S){"use strict";S.d(Le,{N:function(){return B}});function N(V,I){let A;return I.length===0?A=V:A=V.replace(/\{(\d+)\}/g,function(d,U){const b=U[0];return typeof I[b]!="undefined"?I[b]:d}),A}function B(V,I,...A){return N(I,A)}},96236:function(Ct,Le,S){"use strict";S.d(Le,{BH:function(){return x},NZ:function(){return F},U8:function(){return k},co:function(){return m},eH:function(){return u},vr:function(){return l}});var N=S(75918),B=S(52615),V=S(4348),I=S(88226),A=S(69323),d=S(34502),U=S(35884),b=S(90689),n=S(16925),E=S(49055),f=function(T,L,W,P){var O=arguments.length,$=O<3?L:P===null?P=Object.getOwnPropertyDescriptor(L,W):P,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(T,L,W,P);else for(var ie=T.length-1;ie>=0;ie--)(z=T[ie])&&($=(O<3?z($):O>3?z(L,W,$):z(L,W))||$);return O>3&&$&&Object.defineProperty(L,W,$),$},c=function(T,L){return function(W,P){L(W,P,T)}};function l(T){return T.command!==void 0}class u{constructor(L){this.id=u._idPool++,this._debugName=L}}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 m=(0,n.yh)("menuService"),x=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new V.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:T=>T===u.CommandPalette}}addCommand(T){return this.addCommands(I.$.single(T))}addCommands(T){for(const L of T)this._commands.set(L.id,L);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,A.OF)(()=>{let L=!1;for(const W of T)L=this._commands.delete(W.id)||L;L&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(T){return this._commands.get(T)}getCommands(){const T=new Map;return this._commands.forEach((L,W)=>T.set(W,L)),T}appendMenuItem(T,L){return this.appendMenuItems(I.$.single({id:T,item:L}))}appendMenuItems(T){const L=new Set,W=new d.S;for(const{id:P,item:O}of T){let $=this._menuItems.get(P);$||($=new d.S,this._menuItems.set(P,$)),W.push($.push(O)),L.add(P)}return this._onDidChangeMenu.fire(L),(0,A.OF)(()=>{if(W.size>0){for(let P of W)P();this._onDidChangeMenu.fire(L),W.clear()}})}getMenuItems(T){let L;return this._menuItems.has(T)?L=[...this._menuItems.get(T)]:L=[],T===u.CommandPalette&&this._appendImplicitItems(L),L}_appendImplicitItems(T){const L=new Set;for(const W of T)l(W)&&(L.add(W.command.id),W.alt&&L.add(W.alt.id));this._commands.forEach((W,P)=>{L.has(P)||T.push({command:W})})}};class F extends N.wY{constructor(L,W,P,O){super(`submenuitem.${L.submenu.id}`,typeof L.title=="string"?L.title:L.title.value,[],"submenu"),this.item=L,this._menuService=W,this._contextKeyService=P,this._options=O}get actions(){const L=[],W=this._menuService.createMenu(this.item.submenu,this._contextKeyService),P=W.getActions(this._options);W.dispose();for(const[,O]of P)O.length>0&&(L.push(...O),L.push(new N.Z0));return L.length&&L.pop(),L}}let k=class Zl{constructor(L,W,P,O,$){var z,ie;if(this._commandService=$,this.id=L.id,this.label=P!=null&&P.renderShortTitle&&L.shortTitle?typeof L.shortTitle=="string"?L.shortTitle:L.shortTitle.value:typeof L.title=="string"?L.title:L.title.value,this.tooltip=(ie=typeof L.tooltip=="string"?L.tooltip:(z=L.tooltip)===null||z===void 0?void 0:z.value)!==null&&ie!==void 0?ie:"",this.enabled=!L.precondition||O.contextMatchesRules(L.precondition),this.checked=void 0,L.toggled){const te=L.toggled.condition?L.toggled:{condition:L.toggled};this.checked=O.contextMatchesRules(te.condition),this.checked&&te.tooltip&&(this.tooltip=typeof te.tooltip=="string"?te.tooltip:te.tooltip.value),te.title&&(this.label=typeof te.title=="string"?te.title:te.title.value)}this.item=L,this.alt=W?new Zl(W,void 0,P,O,$):void 0,this._options=P,E.kS.isThemeIcon(L.icon)&&(this.class=B.dT.asClassName(L.icon))}dispose(){}run(...L){var W,P;let O=[];return!((W=this._options)===null||W===void 0)&&W.arg&&(O=[...O,this._options.arg]),!((P=this._options)===null||P===void 0)&&P.shouldForwardArgs&&(O=[...O,...L]),this._commandService.executeCommand(this.id,...O)}};k=f([c(3,b.i6),c(4,U.H)],k)},35884:function(Ct,Le,S){"use strict";S.d(Le,{H:function(){return U},P:function(){return b}});var N=S(4348),B=S(88226),V=S(69323),I=S(34502),A=S(72999),d=S(16925);const U=(0,d.yh)("commandService"),b=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new N.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,E){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!E)throw new Error("invalid command");return this.registerCommand({id:n,handler:E})}if(n.description){const m=[];for(let F of n.description.args)m.push(F.constraint);const x=n.handler;n.handler=function(F,...k){return(0,A.D8)(k,m),x(F,...k)}}const{id:f}=n;let c=this._commands.get(f);c||(c=new I.S,this._commands.set(f,c));let l=c.unshift(n),u=(0,V.OF)(()=>{l();const m=this._commands.get(f);m!=null&&m.isEmpty()&&this._commands.delete(f)});return this._onDidRegisterCommand.fire(f),u}registerCommandAlias(n,E){return b.registerCommand(n,(f,...c)=>f.get(U).executeCommand(E,...c))}getCommand(n){const E=this._commands.get(n);if(!(!E||E.isEmpty()))return B.$.first(E)}getCommands(){const n=new Map;for(const E of this._commands.keys()){const f=this.getCommand(E);f&&n.set(E,f)}return n}};b.registerCommand("noop",()=>{})},90689:function(Ct,Le,S){"use strict";S.d(Le,{Ao:function(){return U},Eq:function(){return le},Fb:function(){return b},K8:function(){return H},i6:function(){return _e},uy:function(){return me}});var N=S(23345),B=S(82983),V=S(16925);let I=N.WE||"";const A=new Map;A.set("false",!1),A.set("true",!0),A.set("isMac",N.dz),A.set("isLinux",N.IJ),A.set("isWindows",N.ED),A.set("isWeb",N.$L),A.set("isMacNative",N.dz&&!N.$L),A.set("isEdge",I.indexOf("Edg/")>=0),A.set("isFirefox",I.indexOf("Firefox")>=0),A.set("isChrome",I.indexOf("Chrome")>=0),A.set("isSafari",I.indexOf("Safari")>=0);const d=Object.prototype.hasOwnProperty;class U{static has(M){return c.create(M)}static equals(M,D){return l.create(M,D)}static regex(M,D){return O.create(M,D)}static not(M){return F.create(M)}static and(...M){return ie.create(M,null)}static or(...M){return te.create(M,null,!0)}static deserialize(M,D=!1){if(M)return this._deserializeOrExpression(M,D)}static _deserializeOrExpression(M,D){let ne=M.split("||");return te.create(ne.map(de=>this._deserializeAndExpression(de,D)),null,!0)}static _deserializeAndExpression(M,D){let ne=M.split("&&");return ie.create(ne.map(de=>this._deserializeOne(de,D)),null)}static _deserializeOne(M,D){if(M=M.trim(),M.indexOf("!=")>=0){let ne=M.split("!=");return x.create(ne[0].trim(),this._deserializeValue(ne[1],D))}if(M.indexOf("==")>=0){let ne=M.split("==");return l.create(ne[0].trim(),this._deserializeValue(ne[1],D))}if(M.indexOf("=~")>=0){let ne=M.split("=~");return O.create(ne[0].trim(),this._deserializeRegexValue(ne[1],D))}if(M.indexOf(" in ")>=0){let ne=M.split(" in ");return u.create(ne[0].trim(),ne[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(M)){const ne=M.split(">=");return L.create(ne[0].trim(),ne[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(M)){const ne=M.split(">");return T.create(ne[0].trim(),ne[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(M)){const ne=M.split("<=");return P.create(ne[0].trim(),ne[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(M)){const ne=M.split("<");return W.create(ne[0].trim(),ne[1].trim())}return/^\!\s*/.test(M)?F.create(M.substr(1).trim()):c.create(M)}static _deserializeValue(M,D){if(M=M.trim(),M==="true")return!0;if(M==="false")return!1;let ne=/^'([^']*)'$/.exec(M);return ne?ne[1].trim():M}static _deserializeRegexValue(M,D){if((0,B.m5)(M)){if(D)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let ne=M.indexOf("/"),de=M.lastIndexOf("/");if(ne===de||ne<0){if(D)throw new Error(`bad regexp-value '${M}', missing /-enclosure`);return console.warn(`bad regexp-value '${M}', missing /-enclosure`),null}let Oe=M.slice(ne+1,de),Ve=M[de+1]==="i"?"i":"";try{return new RegExp(Oe,Ve)}catch(nt){if(D)throw new Error(`bad regexp-value '${M}', parse error: ${nt}`);return console.warn(`bad regexp-value '${M}', parse error: ${nt}`),null}}}function b(K,M){const D=K?K.substituteConstants():void 0,ne=M?M.substituteConstants():void 0;return!D&&!ne?!0:!D||!ne?!1:D.equals(ne)}function n(K,M){return K.cmp(M)}class E{constructor(){this.type=0}cmp(M){return this.type-M.type}equals(M){return M.type===this.type}substituteConstants(){return this}evaluate(M){return!1}serialize(){return"false"}keys(){return[]}negate(){return f.INSTANCE}}E.INSTANCE=new E;class f{constructor(){this.type=1}cmp(M){return this.type-M.type}equals(M){return M.type===this.type}substituteConstants(){return this}evaluate(M){return!0}serialize(){return"true"}keys(){return[]}negate(){return E.INSTANCE}}f.INSTANCE=new f;class c{constructor(M,D){this.key=M,this.negated=D,this.type=2}static create(M,D=null){const ne=A.get(M);return typeof ne=="boolean"?ne?f.INSTANCE:E.INSTANCE:new c(M,D)}cmp(M){return M.type!==this.type?this.type-M.type:Q(this.key,M.key)}equals(M){return M.type===this.type?this.key===M.key:!1}substituteConstants(){const M=A.get(this.key);return typeof M=="boolean"?M?f.INSTANCE:E.INSTANCE:this}evaluate(M){return!!M.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=F.create(this.key,this)),this.negated}}class l{constructor(M,D,ne){this.key=M,this.value=D,this.negated=ne,this.type=4}static create(M,D,ne=null){if(typeof D=="boolean")return D?c.create(M,ne):F.create(M,ne);const de=A.get(M);return typeof de=="boolean"?D===(de?"true":"false")?f.INSTANCE:E.INSTANCE:new l(M,D,ne)}cmp(M){return M.type!==this.type?this.type-M.type:se(this.key,this.value,M.key,M.value)}equals(M){return M.type===this.type?this.key===M.key&&this.value===M.value:!1}substituteConstants(){const M=A.get(this.key);if(typeof M=="boolean"){const D=M?"true":"false";return this.value===D?f.INSTANCE:E.INSTANCE}return this}evaluate(M){return M.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=x.create(this.key,this.value,this)),this.negated}}class u{constructor(M,D){this.key=M,this.valueKey=D,this.type=10,this.negated=null}static create(M,D){return new u(M,D)}cmp(M){return M.type!==this.type?this.type-M.type:se(this.key,this.valueKey,M.key,M.valueKey)}equals(M){return M.type===this.type?this.key===M.key&&this.valueKey===M.valueKey:!1}substituteConstants(){return this}evaluate(M){const D=M.getValue(this.valueKey),ne=M.getValue(this.key);return Array.isArray(D)?D.indexOf(ne)>=0:typeof ne=="string"&&typeof D=="object"&&D!==null?d.call(D,ne):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=m.create(this)),this.negated}}class m{constructor(M){this._actual=M,this.type=11}static create(M){return new m(M)}cmp(M){return M.type!==this.type?this.type-M.type:this._actual.cmp(M._actual)}equals(M){return M.type===this.type?this._actual.equals(M._actual):!1}substituteConstants(){return this}evaluate(M){return!this._actual.evaluate(M)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class x{constructor(M,D,ne){this.key=M,this.value=D,this.negated=ne,this.type=5}static create(M,D,ne=null){if(typeof D=="boolean")return D?F.create(M,ne):c.create(M,ne);const de=A.get(M);return typeof de=="boolean"?D===(de?"true":"false")?E.INSTANCE:f.INSTANCE:new x(M,D,ne)}cmp(M){return M.type!==this.type?this.type-M.type:se(this.key,this.value,M.key,M.value)}equals(M){return M.type===this.type?this.key===M.key&&this.value===M.value:!1}substituteConstants(){const M=A.get(this.key);if(typeof M=="boolean"){const D=M?"true":"false";return this.value===D?E.INSTANCE:f.INSTANCE}return this}evaluate(M){return M.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 F{constructor(M,D){this.key=M,this.negated=D,this.type=3}static create(M,D=null){const ne=A.get(M);return typeof ne=="boolean"?ne?E.INSTANCE:f.INSTANCE:new F(M,D)}cmp(M){return M.type!==this.type?this.type-M.type:Q(this.key,M.key)}equals(M){return M.type===this.type?this.key===M.key:!1}substituteConstants(){const M=A.get(this.key);return typeof M=="boolean"?M?E.INSTANCE:f.INSTANCE:this}evaluate(M){return!M.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 k(K,M){if(typeof K=="string"){const D=parseFloat(K);isNaN(D)||(K=D)}return typeof K=="string"||typeof K=="number"?M(K):E.INSTANCE}class T{constructor(M,D,ne){this.key=M,this.value=D,this.negated=ne,this.type=12}static create(M,D,ne=null){return k(D,de=>new T(M,de,ne))}cmp(M){return M.type!==this.type?this.type-M.type:se(this.key,this.value,M.key,M.value)}equals(M){return M.type===this.type?this.key===M.key&&this.value===M.value:!1}substituteConstants(){return this}evaluate(M){return typeof this.value=="string"?!1:parseFloat(M.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 L{constructor(M,D,ne){this.key=M,this.value=D,this.negated=ne,this.type=13}static create(M,D,ne=null){return k(D,de=>new L(M,de,ne))}cmp(M){return M.type!==this.type?this.type-M.type:se(this.key,this.value,M.key,M.value)}equals(M){return M.type===this.type?this.key===M.key&&this.value===M.value:!1}substituteConstants(){return this}evaluate(M){return typeof this.value=="string"?!1:parseFloat(M.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=W.create(this.key,this.value,this)),this.negated}}class W{constructor(M,D,ne){this.key=M,this.value=D,this.negated=ne,this.type=14}static create(M,D,ne=null){return k(D,de=>new W(M,de,ne))}cmp(M){return M.type!==this.type?this.type-M.type:se(this.key,this.value,M.key,M.value)}equals(M){return M.type===this.type?this.key===M.key&&this.value===M.value:!1}substituteConstants(){return this}evaluate(M){return typeof this.value=="string"?!1:parseFloat(M.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 P{constructor(M,D,ne){this.key=M,this.value=D,this.negated=ne,this.type=15}static create(M,D,ne=null){return k(D,de=>new P(M,de,ne))}cmp(M){return M.type!==this.type?this.type-M.type:se(this.key,this.value,M.key,M.value)}equals(M){return M.type===this.type?this.key===M.key&&this.value===M.value:!1}substituteConstants(){return this}evaluate(M){return typeof this.value=="string"?!1:parseFloat(M.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this.key,this.value,this)),this.negated}}class O{constructor(M,D){this.key=M,this.regexp=D,this.type=7,this.negated=null}static create(M,D){return new O(M,D)}cmp(M){if(M.type!==this.type)return this.type-M.type;if(this.key<M.key)return-1;if(this.key>M.key)return 1;const D=this.regexp?this.regexp.source:"",ne=M.regexp?M.regexp.source:"";return D<ne?-1:D>ne?1:0}equals(M){if(M.type===this.type){const D=this.regexp?this.regexp.source:"",ne=M.regexp?M.regexp.source:"";return this.key===M.key&&D===ne}return!1}substituteConstants(){return this}evaluate(M){let D=M.getValue(this.key);return this.regexp?this.regexp.test(D):!1}serialize(){const M=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${M}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=$.create(this)),this.negated}}class ${constructor(M){this._actual=M,this.type=8}static create(M){return new $(M)}cmp(M){return M.type!==this.type?this.type-M.type:this._actual.cmp(M._actual)}equals(M){return M.type===this.type?this._actual.equals(M._actual):!1}substituteConstants(){return this}evaluate(M){return!this._actual.evaluate(M)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function z(K){let M=null;for(let D=0,ne=K.length;D<ne;D++){const de=K[D].substituteConstants();if(K[D]!==de&&M===null){M=[];for(let Oe=0;Oe<D;Oe++)M[Oe]=K[Oe]}M!==null&&(M[D]=de)}return M===null?K:M}class ie{constructor(M,D){this.expr=M,this.negated=D,this.type=6}static create(M,D){return ie._normalizeArr(M,D)}cmp(M){if(M.type!==this.type)return this.type-M.type;if(this.expr.length<M.expr.length)return-1;if(this.expr.length>M.expr.length)return 1;for(let D=0,ne=this.expr.length;D<ne;D++){const de=n(this.expr[D],M.expr[D]);if(de!==0)return de}return 0}equals(M){if(M.type===this.type){if(this.expr.length!==M.expr.length)return!1;for(let D=0,ne=this.expr.length;D<ne;D++)if(!this.expr[D].equals(M.expr[D]))return!1;return!0}return!1}substituteConstants(){const M=z(this.expr);return M===this.expr?this:ie.create(M,this.negated)}evaluate(M){for(let D=0,ne=this.expr.length;D<ne;D++)if(!this.expr[D].evaluate(M))return!1;return!0}static _normalizeArr(M,D){const ne=[];let de=!1;for(const Oe of M)if(Oe){if(Oe.type===1){de=!0;continue}if(Oe.type===0)return E.INSTANCE;if(Oe.type===6){ne.push(...Oe.expr);continue}ne.push(Oe)}if(ne.length===0&&de)return f.INSTANCE;if(ne.length!==0){if(ne.length===1)return ne[0];ne.sort(n);for(let Oe=1;Oe<ne.length;Oe++)ne[Oe-1].equals(ne[Oe])&&(ne.splice(Oe,1),Oe--);if(ne.length===1)return ne[0];for(;ne.length>1;){const Oe=ne[ne.length-1];if(Oe.type!==9)break;ne.pop();const Ve=ne.pop(),nt=ne.length===0,Fe=te.create(Oe.expr.map(rt=>ie.create([rt,Ve],null)),null,nt);Fe&&(ne.push(Fe),ne.sort(n))}return ne.length===1?ne[0]:new ie(ne,D)}}serialize(){return this.expr.map(M=>M.serialize()).join(" && ")}keys(){const M=[];for(let D of this.expr)M.push(...D.keys());return M}negate(){if(!this.negated){const M=[];for(let D of this.expr)M.push(D.negate());this.negated=te.create(M,this,!0)}return this.negated}}class te{constructor(M,D){this.expr=M,this.negated=D,this.type=9}static create(M,D,ne){return te._normalizeArr(M,D,ne)}cmp(M){if(M.type!==this.type)return this.type-M.type;if(this.expr.length<M.expr.length)return-1;if(this.expr.length>M.expr.length)return 1;for(let D=0,ne=this.expr.length;D<ne;D++){const de=n(this.expr[D],M.expr[D]);if(de!==0)return de}return 0}equals(M){if(M.type===this.type){if(this.expr.length!==M.expr.length)return!1;for(let D=0,ne=this.expr.length;D<ne;D++)if(!this.expr[D].equals(M.expr[D]))return!1;return!0}return!1}substituteConstants(){const M=z(this.expr);return M===this.expr?this:te.create(M,this.negated,!1)}evaluate(M){for(let D=0,ne=this.expr.length;D<ne;D++)if(this.expr[D].evaluate(M))return!0;return!1}static _normalizeArr(M,D,ne){let de=[],Oe=!1;if(M){for(let Ve=0,nt=M.length;Ve<nt;Ve++){const Fe=M[Ve];if(Fe){if(Fe.type===0){Oe=!0;continue}if(Fe.type===1)return f.INSTANCE;if(Fe.type===9){de=de.concat(Fe.expr);continue}de.push(Fe)}}if(de.length===0&&Oe)return E.INSTANCE;de.sort(n)}if(de.length!==0){if(de.length===1)return de[0];for(let Ve=1;Ve<de.length;Ve++)de[Ve-1].equals(de[Ve])&&(de.splice(Ve,1),Ve--);if(de.length===1)return de[0];if(ne){for(let Ve=0;Ve<de.length;Ve++)for(let nt=Ve+1;nt<de.length;nt++)H(de[Ve],de[nt])&&(de.splice(nt,1),nt--);if(de.length===1)return de[0]}return new te(de,D)}}serialize(){return this.expr.map(M=>M.serialize()).join(" || ")}keys(){const M=[];for(let D of this.expr)M.push(...D.keys());return M}negate(){if(!this.negated){let M=[];for(let D of this.expr)M.push(D.negate());for(;M.length>1;){const D=M.shift(),ne=M.shift(),de=[];for(const Ve of J(D))for(const nt of J(ne))de.push(ie.create([Ve,nt],null));const Oe=M.length===0;M.unshift(te.create(de,null,Oe))}this.negated=M[0]}return this.negated}}class me extends c{constructor(M,D,ne){super(M,null),this._defaultValue=D,typeof ne=="object"?me._info.push(Object.assign(Object.assign({},ne),{key:M})):ne!==!0&&me._info.push({key:M,description:ne,type:D!=null?typeof D:void 0})}static all(){return me._info.values()}bindTo(M){return M.createKey(this.key,this._defaultValue)}getValue(M){return M.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(M){return l.create(this.key,M)}}me._info=[];const _e=(0,V.yh)("contextKeyService"),le="setContext";function Q(K,M){return K<M?-1:K>M?1:0}function se(K,M,D,ne){return K<D?-1:K>D?1:M<ne?-1:M>ne?1:0}function H(K,M){if(M.type===6&&K.type!==9&&K.type!==6){for(const de of M.expr)if(K.equals(de))return!0}const D=K.negate(),ne=J(D).concat(J(M));ne.sort(n);for(let de=0;de<ne.length;de++){const Ve=ne[de].negate();for(let nt=de+1;nt<ne.length;nt++){const Fe=ne[nt];if(Ve.equals(Fe))return!0}}return!1}function J(K){return K.type===9?K.expr:[K]}},16925:function(Ct,Le,S){"use strict";S.d(Le,{I8:function(){return N},TG:function(){return B},jt:function(){return A},yh:function(){return I}});var N;(function(d){d.serviceIds=new Map,d.DI_TARGET="$di$target",d.DI_DEPENDENCIES="$di$dependencies";function U(b){return b[d.DI_DEPENDENCIES]||[]}d.getServiceDependencies=U})(N||(N={}));const B=I("instantiationService");function V(d,U,b,n){U[N.DI_TARGET]===U?U[N.DI_DEPENDENCIES].push({id:d,index:b,optional:n}):(U[N.DI_DEPENDENCIES]=[{id:d,index:b,optional:n}],U[N.DI_TARGET]=U)}function I(d){if(N.serviceIds.has(d))return N.serviceIds.get(d);const U=function(b,n,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");V(U,b,E,!1)};return U.toString=()=>d,N.serviceIds.set(d,U),U}function A(d){return function(U,b,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");V(d,U,n,!0)}}},44650:function(Ct,Le,S){"use strict";S.d(Le,{B:function(){return I}});var N=S(76068),B=S(72999);class V{constructor(){this.data=new Map}add(d,U){N.ok(B.HD(d)),N.ok(B.Kn(U)),N.ok(!this.data.has(d),"There is already an extension with this id"),this.data.set(d,U)}as(d){return this.data.get(d)||null}}const I=new V},66213:function(Ct,Le,S){"use strict";S.d(Le,{e:function(){return N}});var N;(function(B){B.DARK="dark",B.LIGHT="light",B.HIGH_CONTRAST="hc"})(N||(N={}))},49055:function(Ct,Le,S){"use strict";S.d(Le,{EN:function(){return n},IP:function(){return c},Ic:function(){return m},XE:function(){return U},bB:function(){return x},kS:function(){return E},m6:function(){return f}});var N=S(52615),B=S(4348),V=S(69323),I=S(16925),A=S(44650),d=S(66213);const U=(0,I.yh)("themeService");var b;(function(F){function k(T){return T&&typeof T=="object"&&typeof T.id=="string"}F.isThemeColor=k})(b||(b={}));function n(F){return{id:F}}var E;(function(F){function k($){return $&&typeof $=="object"&&typeof $.id=="string"&&(typeof $.color=="undefined"||b.isThemeColor($.color))}F.isThemeIcon=k;const T=new RegExp(`^\\$\\((${N.dT.iconNameExpression}(?:${N.dT.iconModifierExpression})?)\\)$`);function L($){const z=T.exec($);if(!z)return;let[,ie]=z;return{id:ie}}F.fromString=L;function W($,z){let ie=$.id;const te=ie.lastIndexOf("~");return te!==-1&&(ie=ie.substring(0,te)),z&&(ie=`${ie}~${z}`),{id:ie}}F.modify=W;function P($,z){var ie,te;return $.id===z.id&&((ie=$.color)===null||ie===void 0?void 0:ie.id)===((te=z.color)===null||te===void 0?void 0:te.id)}F.isEqual=P;function O($,z){return{id:$.id,color:z?n(z):void 0}}F.asThemeIcon=O,F.asClassNameArray=N.dT.asClassNameArray,F.asClassName=N.dT.asClassName,F.asCSSSelector=N.dT.asCSSSelector})(E||(E={}));function f(F){switch(F){case d.e.DARK:return"vs-dark";case d.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 B.Q5}onColorThemeChange(k){return this.themingParticipants.push(k),this.onThemingParticipantAddedEmitter.fire(k),(0,V.OF)(()=>{const T=this.themingParticipants.indexOf(k);this.themingParticipants.splice(T,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new l;A.B.add(c.ThemingContribution,u);function m(F){return u.onColorThemeChange(F)}class x extends V.JT{constructor(k){super(),this.themeService=k,this.theme=k.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(T=>this.onThemeChange(T)))}onThemeChange(k){this.theme=k,this.updateStyles()}updateStyles(){}}},93681:function(Ct,Le,S){"use strict";S.r(Le),S.d(Le,{BaseInput:function(){return E},default:function(){return T}});var N=S(72308),B=S(77321),V=S(49618),I=S(62853),A=S(92310),d=S.n(A),U=S(59301),b=S(5643),n=function(W){var P,O,$=W.inputElement,z=W.prefixCls,ie=W.prefix,te=W.suffix,me=W.addonBefore,_e=W.addonAfter,le=W.className,Q=W.style,se=W.disabled,H=W.readOnly,J=W.focused,K=W.triggerFocus,M=W.allowClear,D=W.value,ne=W.handleReset,de=W.hidden,Oe=W.classes,Ve=W.classNames,nt=W.dataAttrs,Fe=W.styles,rt=W.components,Ze=(rt==null?void 0:rt.affixWrapper)||"span",st=(rt==null?void 0:rt.groupWrapper)||"span",At=(rt==null?void 0:rt.wrapper)||"span",Jt=(rt==null?void 0:rt.groupAddon)||"span",pt=(0,U.useRef)(null),Bt=function(Ne){var je;(je=pt.current)!==null&&je!==void 0&&je.contains(Ne.target)&&(K==null||K())},zt=function(){var Ne;if(!M)return null;var je=!se&&!H&&D,Qe="".concat(z,"-clear-icon"),at=(0,I.Z)(M)==="object"&&M!==null&&M!==void 0&&M.clearIcon?M.clearIcon:"\u2716";return U.createElement("span",{onClick:ne,onMouseDown:function(We){return We.preventDefault()},className:d()(Qe,(Ne={},(0,V.Z)(Ne,"".concat(Qe,"-hidden"),!je),(0,V.Z)(Ne,"".concat(Qe,"-has-suffix"),!!te),Ne)),role:"button",tabIndex:-1},at)},$t=(0,U.cloneElement)($,{value:D,hidden:de,className:d()((P=$.props)===null||P===void 0?void 0:P.className,!(0,b.X3)(W)&&!(0,b.He)(W)&&le)||null,style:(0,B.Z)((0,B.Z)({},(O=$.props)===null||O===void 0?void 0:O.style),!(0,b.X3)(W)&&!(0,b.He)(W)?Q:{})});if((0,b.X3)(W)){var Me,ze="".concat(z,"-affix-wrapper"),Ue=d()(ze,(Me={},(0,V.Z)(Me,"".concat(ze,"-disabled"),se),(0,V.Z)(Me,"".concat(ze,"-focused"),J),(0,V.Z)(Me,"".concat(ze,"-readonly"),H),(0,V.Z)(Me,"".concat(ze,"-input-with-clear-btn"),te&&M&&D),Me),!(0,b.He)(W)&&le,Oe==null?void 0:Oe.affixWrapper,Ve==null?void 0:Ve.affixWrapper),ot=(te||M)&&U.createElement("span",{className:d()("".concat(z,"-suffix"),Ve==null?void 0:Ve.suffix),style:Fe==null?void 0:Fe.suffix},zt(),te);$t=U.createElement(Ze,(0,N.Z)({className:Ue,style:(0,B.Z)((0,B.Z)({},(0,b.He)(W)?void 0:Q),Fe==null?void 0:Fe.affixWrapper),hidden:!(0,b.He)(W)&&de,onClick:Bt},nt==null?void 0:nt.affixWrapper,{ref:pt}),ie&&U.createElement("span",{className:d()("".concat(z,"-prefix"),Ve==null?void 0:Ve.prefix),style:Fe==null?void 0:Fe.prefix},ie),(0,U.cloneElement)($,{value:D,hidden:null}),ot)}if((0,b.He)(W)){var ut="".concat(z,"-group"),ue="".concat(ut,"-addon"),be=d()("".concat(z,"-wrapper"),ut,Oe==null?void 0:Oe.wrapper),De=d()("".concat(z,"-group-wrapper"),le,Oe==null?void 0:Oe.group);return U.createElement(st,{className:De,style:Q,hidden:de},U.createElement(At,{className:be},me&&U.createElement(Jt,{className:ue},me),(0,U.cloneElement)($t,{hidden:null}),_e&&U.createElement(Jt,{className:ue},_e)))}return $t},E=n,f=S(80702),c=S(52487),l=S(74416),u=S(18929),m=S(2738),x=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],F=(0,U.forwardRef)(function(L,W){var P=L.autoComplete,O=L.onChange,$=L.onFocus,z=L.onBlur,ie=L.onPressEnter,te=L.onKeyDown,me=L.prefixCls,_e=me===void 0?"rc-input":me,le=L.disabled,Q=L.htmlSize,se=L.className,H=L.maxLength,J=L.suffix,K=L.showCount,M=L.type,D=M===void 0?"text":M,ne=L.classes,de=L.classNames,Oe=L.styles,Ve=(0,l.Z)(L,x),nt=(0,u.Z)(L.defaultValue,{value:L.value}),Fe=(0,c.Z)(nt,2),rt=Fe[0],Ze=Fe[1],st=(0,U.useState)(!1),At=(0,c.Z)(st,2),Jt=At[0],pt=At[1],Bt=(0,U.useRef)(null),zt=function(De){Bt.current&&(0,b.nH)(Bt.current,De)};(0,U.useImperativeHandle)(W,function(){return{focus:zt,blur:function(){var De;(De=Bt.current)===null||De===void 0||De.blur()},setSelectionRange:function(De,Ae,Ne){var je;(je=Bt.current)===null||je===void 0||je.setSelectionRange(De,Ae,Ne)},select:function(){var De;(De=Bt.current)===null||De===void 0||De.select()},input:Bt.current}}),(0,U.useEffect)(function(){pt(function(be){return be&&le?!1:be})},[le]);var $t=function(De){L.value===void 0&&Ze(De.target.value),Bt.current&&(0,b.rJ)(Bt.current,De,O)},Me=function(De){ie&&De.key==="Enter"&&ie(De),te==null||te(De)},ze=function(De){pt(!0),$==null||$(De)},Ue=function(De){pt(!1),z==null||z(De)},ot=function(De){Ze(""),zt(),Bt.current&&(0,b.rJ)(Bt.current,De,O)},ut=function(){var De=(0,m.Z)(L,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return U.createElement("input",(0,N.Z)({autoComplete:P},De,{onChange:$t,onFocus:ze,onBlur:Ue,onKeyDown:Me,className:d()(_e,(0,V.Z)({},"".concat(_e,"-disabled"),le),de==null?void 0:de.input),style:Oe==null?void 0:Oe.input,ref:Bt,size:Q,type:D}))},ue=function(){var De=Number(H)>0;if(J||K){var Ae=(0,b.D7)(rt),Ne=(0,f.Z)(Ae).length,je=(0,I.Z)(K)==="object"?K.formatter({value:Ae,count:Ne,maxLength:H}):"".concat(Ne).concat(De?" / ".concat(H):"");return U.createElement(U.Fragment,null,!!K&&U.createElement("span",{className:d()("".concat(_e,"-show-count-suffix"),(0,V.Z)({},"".concat(_e,"-show-count-has-suffix"),!!J),de==null?void 0:de.count),style:(0,B.Z)({},Oe==null?void 0:Oe.count)},je),J)}return null};return U.createElement(E,(0,N.Z)({},Ve,{prefixCls:_e,className:se,inputElement:ut(),handleReset:ot,value:(0,b.D7)(rt),focused:Jt,triggerFocus:zt,suffix:ue(),disabled:le,classes:ne,classNames:de,styles:Oe}))}),k=F,T=k},5643:function(Ct,Le,S){"use strict";S.d(Le,{D7:function(){return A},He:function(){return N},X3:function(){return B},nH:function(){return I},rJ:function(){return V}});function N(d){return!!(d.addonBefore||d.addonAfter)}function B(d){return!!(d.prefix||d.suffix||d.allowClear)}function V(d,U,b,n){if(b){var E=U;if(U.type==="click"){var f=d.cloneNode(!0);E=Object.create(U,{target:{value:f},currentTarget:{value:f}}),f.value="",b(E);return}if(n!==void 0){E=Object.create(U,{target:{value:d},currentTarget:{value:d}}),d.value=n,b(E);return}b(E)}}function I(d,U){if(d){d.focus(U);var b=U||{},n=b.cursor;if(n){var E=d.value.length;switch(n){case"start":d.setSelectionRange(0,0);break;case"end":d.setSelectionRange(E,E);break;default:d.setSelectionRange(0,E)}}}}function A(d){return typeof d=="undefined"||d===null?"":String(d)}},29301:function(Ct,Le,S){"use strict";S.d(Le,{Z:function(){return le}});var N=S(72308),B=S(59301),V=S(11592),I=S(48736),A=S(77321),d=S(62853),U=S(76846),b=S(8654),n=B.createContext(null);function E(Q){var se=Q.children,H=Q.onBatchResize,J=B.useRef(0),K=B.useRef([]),M=B.useContext(n),D=B.useCallback(function(ne,de,Oe){J.current+=1;var Ve=J.current;K.current.push({size:ne,element:de,data:Oe}),Promise.resolve().then(function(){Ve===J.current&&(H==null||H(K.current),K.current=[])}),M==null||M(ne,de,Oe)},[H,M]);return B.createElement(n.Provider,{value:D},se)}var f=S(76374),c=new Map;function l(Q){Q.forEach(function(se){var H,J=se.target;(H=c.get(J))===null||H===void 0||H.forEach(function(K){return K(J)})})}var u=new f.Z(l),m=null,x=null;function F(Q,se){c.has(Q)||(c.set(Q,new Set),u.observe(Q)),c.get(Q).add(se)}function k(Q,se){c.has(Q)&&(c.get(Q).delete(se),c.get(Q).size||(u.unobserve(Q),c.delete(Q)))}var T=S(96949),L=S(55090),W=S(77205),P=S(38793),O=function(Q){(0,W.Z)(H,Q);var se=(0,P.Z)(H);function H(){return(0,T.Z)(this,H),se.apply(this,arguments)}return(0,L.Z)(H,[{key:"render",value:function(){return this.props.children}}]),H}(B.Component);function $(Q,se){var H=Q.children,J=Q.disabled,K=B.useRef(null),M=B.useRef(null),D=B.useContext(n),ne=typeof H=="function",de=ne?H(K):H,Oe=B.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ve=!ne&&B.isValidElement(de)&&(0,b.Yr)(de),nt=Ve?(0,b.C4)(de):null,Fe=(0,b.x1)(nt,K),rt=function(){var Jt;return(0,U.ZP)(K.current)||(K.current&&(0,d.Z)(K.current)==="object"?(0,U.ZP)((Jt=K.current)===null||Jt===void 0?void 0:Jt.nativeElement):null)||(0,U.ZP)(M.current)};B.useImperativeHandle(se,function(){return rt()});var Ze=B.useRef(Q);Ze.current=Q;var st=B.useCallback(function(At){var Jt=Ze.current,pt=Jt.onResize,Bt=Jt.data,zt=At.getBoundingClientRect(),$t=zt.width,Me=zt.height,ze=At.offsetWidth,Ue=At.offsetHeight,ot=Math.floor($t),ut=Math.floor(Me);if(Oe.current.width!==ot||Oe.current.height!==ut||Oe.current.offsetWidth!==ze||Oe.current.offsetHeight!==Ue){var ue={width:ot,height:ut,offsetWidth:ze,offsetHeight:Ue};Oe.current=ue;var be=ze===Math.round($t)?$t:ze,De=Ue===Math.round(Me)?Me:Ue,Ae=(0,A.Z)((0,A.Z)({},ue),{},{offsetWidth:be,offsetHeight:De});D==null||D(Ae,At,Bt),pt&&Promise.resolve().then(function(){pt(Ae,At)})}},[]);return B.useEffect(function(){var At=rt();return At&&!J&&F(At,st),function(){return k(At,st)}},[K.current,J]),B.createElement(O,{ref:M},Ve?B.cloneElement(de,{ref:Fe}):de)}var z=B.forwardRef($),ie=z,te="rc-observer-key";function me(Q,se){var H=Q.children,J=typeof H=="function"?[H]:(0,V.Z)(H);return J.map(function(K,M){var D=(K==null?void 0:K.key)||"".concat(te,"-").concat(M);return B.createElement(ie,(0,N.Z)({},Q,{key:D,ref:M===0?se:void 0}),K)})}var _e=B.forwardRef(me);_e.Collection=E;var le=_e},9296:function(Ct,Le,S){"use strict";S.r(Le),S.d(Le,{ResizableTextArea:function(){return me},default:function(){return J}});var N=S(72308),B=S(77321),V=S(49618),I=S(62853),A=S(52487),d=S(74416),U=S(80702),b=S(92310),n=S.n(b),E=S(93681),f=S(5643),c=S(18929),l=S(59301),u=S(29301),m=S(34280),x=S(16089),F=`
|
|
|
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;
|
|
|
`,k=["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"],T={},L;function W(K){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,D=K.getAttribute("id")||K.getAttribute("data-reactid")||K.getAttribute("name");if(M&&T[D])return T[D];var ne=window.getComputedStyle(K),de=ne.getPropertyValue("box-sizing")||ne.getPropertyValue("-moz-box-sizing")||ne.getPropertyValue("-webkit-box-sizing"),Oe=parseFloat(ne.getPropertyValue("padding-bottom"))+parseFloat(ne.getPropertyValue("padding-top")),Ve=parseFloat(ne.getPropertyValue("border-bottom-width"))+parseFloat(ne.getPropertyValue("border-top-width")),nt=k.map(function(rt){return"".concat(rt,":").concat(ne.getPropertyValue(rt))}).join(";"),Fe={sizingStyle:nt,paddingSize:Oe,borderSize:Ve,boxSizing:de};return M&&D&&(T[D]=Fe),Fe}function P(K){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ne=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;L||(L=document.createElement("textarea"),L.setAttribute("tab-index","-1"),L.setAttribute("aria-hidden","true"),document.body.appendChild(L)),K.getAttribute("wrap")?L.setAttribute("wrap",K.getAttribute("wrap")):L.removeAttribute("wrap");var de=W(K,M),Oe=de.paddingSize,Ve=de.borderSize,nt=de.boxSizing,Fe=de.sizingStyle;L.setAttribute("style","".concat(Fe,";").concat(F)),L.value=K.value||K.placeholder||"";var rt=void 0,Ze=void 0,st,At=L.scrollHeight;if(nt==="border-box"?At+=Ve:nt==="content-box"&&(At-=Oe),D!==null||ne!==null){L.value=" ";var Jt=L.scrollHeight-Oe;D!==null&&(rt=Jt*D,nt==="border-box"&&(rt=rt+Oe+Ve),At=Math.max(rt,At)),ne!==null&&(Ze=Jt*ne,nt==="border-box"&&(Ze=Ze+Oe+Ve),st=At>Ze?"":"hidden",At=Math.min(Ze,At))}var pt={height:At,overflowY:st,resize:"none"};return rt&&(pt.minHeight=rt),Ze&&(pt.maxHeight=Ze),pt}var O=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],$=0,z=1,ie=2,te=l.forwardRef(function(K,M){var D=K,ne=D.prefixCls,de=D.onPressEnter,Oe=D.defaultValue,Ve=D.value,nt=D.autoSize,Fe=D.onResize,rt=D.className,Ze=D.style,st=D.disabled,At=D.onChange,Jt=D.onInternalAutoSize,pt=(0,d.Z)(D,O),Bt=(0,c.Z)(Oe,{value:Ve,postState:function(Z){return Z!=null?Z:""}}),zt=(0,A.Z)(Bt,2),$t=zt[0],Me=zt[1],ze=function(Z){Me(Z.target.value),At==null||At(Z)},Ue=l.useRef();l.useImperativeHandle(M,function(){return{textArea:Ue.current}});var ot=l.useMemo(function(){return nt&&(0,I.Z)(nt)==="object"?[nt.minRows,nt.maxRows]:[]},[nt]),ut=(0,A.Z)(ot,2),ue=ut[0],be=ut[1],De=!!nt,Ae=function(){try{if(document.activeElement===Ue.current){var Z=Ue.current,tt=Z.selectionStart,oe=Z.selectionEnd,xe=Z.scrollTop;Ue.current.setSelectionRange(tt,oe),Ue.current.scrollTop=xe}}catch(Kt){}},Ne=l.useState(ie),je=(0,A.Z)(Ne,2),Qe=je[0],at=je[1],Je=l.useState(),We=(0,A.Z)(Je,2),vt=We[0],gt=We[1],mt=function(){at($)};(0,m.Z)(function(){De&&mt()},[Ve,ue,be,De]),(0,m.Z)(function(){if(Qe===$)at(z);else if(Qe===z){var j=P(Ue.current,!1,ue,be);at(ie),gt(j)}else Ae()},[Qe]);var xt=l.useRef(),Lt=function(){x.Z.cancel(xt.current)},yt=function(Z){Qe===ie&&(Fe==null||Fe(Z),nt&&(Lt(),xt.current=(0,x.Z)(function(){mt()})))};l.useEffect(function(){return Lt},[]);var Mt=De?vt:null,Nt=(0,B.Z)((0,B.Z)({},Ze),Mt);return(Qe===$||Qe===z)&&(Nt.overflowY="hidden",Nt.overflowX="hidden"),l.createElement(u.Z,{onResize:yt,disabled:!(nt||Fe)},l.createElement("textarea",(0,N.Z)({},pt,{ref:Ue,style:Nt,className:n()(ne,rt,(0,V.Z)({},"".concat(ne,"-disabled"),st)),disabled:st,value:$t,onChange:ze})))}),me=te,_e=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles","onResize"];function le(K,M){return(0,U.Z)(K||"").slice(0,M).join("")}function Q(K,M,D,ne){var de=D;return K?de=le(D,ne):(0,U.Z)(M||"").length<D.length&&(0,U.Z)(D||"").length>ne&&(de=M),de}var se=l.forwardRef(function(K,M){var D,ne=K.defaultValue,de=K.value,Oe=K.onFocus,Ve=K.onBlur,nt=K.onChange,Fe=K.allowClear,rt=K.maxLength,Ze=K.onCompositionStart,st=K.onCompositionEnd,At=K.suffix,Jt=K.prefixCls,pt=Jt===void 0?"rc-textarea":Jt,Bt=K.classes,zt=K.showCount,$t=K.className,Me=K.style,ze=K.disabled,Ue=K.hidden,ot=K.classNames,ut=K.styles,ue=K.onResize,be=(0,d.Z)(K,_e),De=(0,c.Z)(ne,{value:de,defaultValue:ne}),Ae=(0,A.Z)(De,2),Ne=Ae[0],je=Ae[1],Qe=(0,l.useRef)(null),at=l.useState(!1),Je=(0,A.Z)(at,2),We=Je[0],vt=Je[1],gt=l.useState(!1),mt=(0,A.Z)(gt,2),xt=mt[0],Lt=mt[1],yt=l.useRef(),Mt=l.useRef(0),Nt=l.useState(null),j=(0,A.Z)(Nt,2),Z=j[0],tt=j[1],oe=function(){var It;(It=Qe.current)===null||It===void 0||It.textArea.focus()};(0,l.useImperativeHandle)(M,function(){return{resizableTextArea:Qe.current,focus:oe,blur:function(){var It;(It=Qe.current)===null||It===void 0||It.textArea.blur()}}}),(0,l.useEffect)(function(){vt(function(Vt){return!ze&&Vt})},[ze]);var xe=Number(rt)>0,Kt=function(It){Lt(!0),yt.current=Ne,Mt.current=It.currentTarget.selectionStart,Ze==null||Ze(It)},ke=function(It){Lt(!1);var Tt=It.currentTarget.value;if(xe){var fr,$r=Mt.current>=rt+1||Mt.current===((fr=yt.current)===null||fr===void 0?void 0:fr.length);Tt=Q($r,yt.current,Tt,rt)}Tt!==Ne&&(je(Tt),(0,f.rJ)(It.currentTarget,It,nt,Tt)),st==null||st(It)},Pe=function(It){var Tt=It.target.value;if(!xt&&xe){var fr=It.target.selectionStart>=rt+1||It.target.selectionStart===Tt.length||!It.target.selectionStart;Tt=Q(fr,Ne,Tt,rt)}je(Tt),(0,f.rJ)(It.currentTarget,It,nt,Tt)},He=function(It){var Tt=be.onPressEnter,fr=be.onKeyDown;It.key==="Enter"&&Tt&&Tt(It),fr==null||fr(It)},he=function(It){vt(!0),Oe==null||Oe(It)},ge=function(It){vt(!1),Ve==null||Ve(It)},ye=function(It){var Tt;je(""),oe(),(0,f.rJ)((Tt=Qe.current)===null||Tt===void 0?void 0:Tt.textArea,It,nt)},Ie=(0,f.D7)(Ne);!xt&&xe&&de==null&&(Ie=le(Ie,rt));var ae=At,_t;if(zt){var we=(0,U.Z)(Ie).length;(0,I.Z)(zt)==="object"?_t=zt.formatter({value:Ie,count:we,maxLength:rt}):_t="".concat(we).concat(xe?" / ".concat(rt):""),ae=l.createElement(l.Fragment,null,ae,l.createElement("span",{className:n()("".concat(pt,"-data-count"),ot==null?void 0:ot.count),style:ut==null?void 0:ut.count},_t))}var kt=function(It){var Tt;ue==null||ue(It),(Tt=Qe.current)!==null&&Tt!==void 0&&Tt.textArea.style.height&&tt(!0)},Ft=!be.autoSize&&!zt&&!Fe,er=l.createElement(E.BaseInput,{value:Ie,allowClear:Fe,handleReset:ye,suffix:ae,prefixCls:pt,classes:{affixWrapper:n()(Bt==null?void 0:Bt.affixWrapper,(D={},(0,V.Z)(D,"".concat(pt,"-show-count"),zt),(0,V.Z)(D,"".concat(pt,"-textarea-allow-clear"),Fe),D))},disabled:ze,focused:We,className:$t,style:(0,B.Z)((0,B.Z)({},Me),Z&&!Ft?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof _t=="string"?_t:void 0}},hidden:Ue,inputElement:l.createElement(me,(0,N.Z)({},be,{onKeyDown:He,onChange:Pe,onFocus:he,onBlur:ge,onCompositionStart:Kt,onCompositionEnd:ke,className:ot==null?void 0:ot.textarea,style:(0,B.Z)((0,B.Z)({},ut==null?void 0:ut.textarea),{},{resize:Me==null?void 0:Me.resize}),disabled:ze,prefixCls:pt,onResize:kt,ref:Qe}))});return er}),H=se,J=H},55477:function(Ct,Le,S){"use strict";S.d(Le,{G:function(){return l},Z:function(){return F}});var N=S(72308),B=S(77321),V=S(74416),I=S(35593),A=S(59301),d={shiftX:64,adjustY:1},U={adjustX:1,shiftY:!0},b=[0,0],n={left:{points:["cr","cl"],overflow:U,offset:[-4,0],targetOffset:b},right:{points:["cl","cr"],overflow:U,offset:[4,0],targetOffset:b},top:{points:["bc","tc"],overflow:d,offset:[0,-4],targetOffset:b},bottom:{points:["tc","bc"],overflow:d,offset:[0,4],targetOffset:b},topLeft:{points:["bl","tl"],overflow:d,offset:[0,-4],targetOffset:b},leftTop:{points:["tr","tl"],overflow:U,offset:[-4,0],targetOffset:b},topRight:{points:["br","tr"],overflow:d,offset:[0,-4],targetOffset:b},rightTop:{points:["tl","tr"],overflow:U,offset:[4,0],targetOffset:b},bottomRight:{points:["tr","br"],overflow:d,offset:[0,4],targetOffset:b},rightBottom:{points:["bl","br"],overflow:U,offset:[4,0],targetOffset:b},bottomLeft:{points:["tl","bl"],overflow:d,offset:[0,4],targetOffset:b},leftBottom:{points:["br","bl"],overflow:U,offset:[-4,0],targetOffset:b}},E=null,f=S(92310),c=S.n(f);function l(k){var T=k.children,L=k.prefixCls,W=k.id,P=k.overlayInnerStyle,O=k.className,$=k.style;return A.createElement("div",{className:c()("".concat(L,"-content"),O),style:$},A.createElement("div",{className:"".concat(L,"-inner"),id:W,role:"tooltip",style:P},typeof T=="function"?T():T))}var u=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],m=function(T,L){var W=T.overlayClassName,P=T.trigger,O=P===void 0?["hover"]:P,$=T.mouseEnterDelay,z=$===void 0?0:$,ie=T.mouseLeaveDelay,te=ie===void 0?.1:ie,me=T.overlayStyle,_e=T.prefixCls,le=_e===void 0?"rc-tooltip":_e,Q=T.children,se=T.onVisibleChange,H=T.afterVisibleChange,J=T.transitionName,K=T.animation,M=T.motion,D=T.placement,ne=D===void 0?"right":D,de=T.align,Oe=de===void 0?{}:de,Ve=T.destroyTooltipOnHide,nt=Ve===void 0?!1:Ve,Fe=T.defaultVisible,rt=T.getTooltipContainer,Ze=T.overlayInnerStyle,st=T.arrowContent,At=T.overlay,Jt=T.id,pt=T.showArrow,Bt=pt===void 0?!0:pt,zt=(0,V.Z)(T,u),$t=(0,A.useRef)(null);(0,A.useImperativeHandle)(L,function(){return $t.current});var Me=(0,B.Z)({},zt);"visible"in T&&(Me.popupVisible=T.visible);var ze=function(){return A.createElement(l,{key:"content",prefixCls:le,id:Jt,overlayInnerStyle:Ze},At)};return A.createElement(I.Z,(0,N.Z)({popupClassName:W,prefixCls:le,popup:ze,action:O,builtinPlacements:n,popupPlacement:ne,ref:$t,popupAlign:Oe,getPopupContainer:rt,onPopupVisibleChange:se,afterPopupVisibleChange:H,popupTransitionName:J,popupAnimation:K,popupMotion:M,defaultPopupVisible:Fe,autoDestroy:nt,mouseLeaveDelay:te,popupStyle:me,mouseEnterDelay:z,arrow:Bt},Me),Q)},x=(0,A.forwardRef)(m),F=x},49658:function(Ct,Le){"use strict";Le.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var S=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(S)||/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(S==null?void 0:S.substr(0,4))}},83145:function(Ct,Le,S){"use strict";Object.defineProperty(Le,"__esModule",{value:!0}),Le.CopyToClipboard=void 0;var N=V(S(59301)),B=V(S(25769));function V(T){return T&&T.__esModule?T:{default:T}}function I(T){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?I=function(W){return typeof W}:I=function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W},I(T)}function A(T,L){var W=Object.keys(T);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(T);L&&(P=P.filter(function(O){return Object.getOwnPropertyDescriptor(T,O).enumerable})),W.push.apply(W,P)}return W}function d(T){for(var L=1;L<arguments.length;L++){var W=arguments[L]!=null?arguments[L]:{};L%2?A(W,!0).forEach(function(P){F(T,P,W[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(W)):A(W).forEach(function(P){Object.defineProperty(T,P,Object.getOwnPropertyDescriptor(W,P))})}return T}function U(T,L){if(T==null)return{};var W=b(T,L),P,O;if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(T);for(O=0;O<$.length;O++)P=$[O],!(L.indexOf(P)>=0)&&Object.prototype.propertyIsEnumerable.call(T,P)&&(W[P]=T[P])}return W}function b(T,L){if(T==null)return{};var W={},P=Object.keys(T),O,$;for($=0;$<P.length;$++)O=P[$],!(L.indexOf(O)>=0)&&(W[O]=T[O]);return W}function n(T,L){if(!(T instanceof L))throw new TypeError("Cannot call a class as a function")}function E(T,L){for(var W=0;W<L.length;W++){var P=L[W];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(T,P.key,P)}}function f(T,L,W){return L&&E(T.prototype,L),W&&E(T,W),T}function c(T,L){return L&&(I(L)==="object"||typeof L=="function")?L:u(T)}function l(T){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(W){return W.__proto__||Object.getPrototypeOf(W)},l(T)}function u(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function m(T,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(L&&L.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),L&&x(T,L)}function x(T,L){return x=Object.setPrototypeOf||function(P,O){return P.__proto__=O,P},x(T,L)}function F(T,L,W){return L in T?Object.defineProperty(T,L,{value:W,enumerable:!0,configurable:!0,writable:!0}):T[L]=W,T}var k=function(T){m(L,T);function L(){var W,P;n(this,L);for(var O=arguments.length,$=new Array(O),z=0;z<O;z++)$[z]=arguments[z];return P=c(this,(W=l(L)).call.apply(W,[this].concat($))),F(u(P),"onClick",function(ie){var te=P.props,me=te.text,_e=te.onCopy,le=te.children,Q=te.options,se=N.default.Children.only(le),H=(0,B.default)(me,Q);_e&&_e(me,H),se&&se.props&&typeof se.props.onClick=="function"&&se.props.onClick(ie)}),P}return f(L,[{key:"render",value:function(){var P=this.props,O=P.text,$=P.onCopy,z=P.options,ie=P.children,te=U(P,["text","onCopy","options","children"]),me=N.default.Children.only(ie);return N.default.cloneElement(me,d({},te,{onClick:this.onClick}))}}]),L}(N.default.PureComponent);Le.CopyToClipboard=k,F(k,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(Ct,Le,S){"use strict";var N=S(83145),B=N.CopyToClipboard;B.CopyToClipboard=B,Ct.exports=B},76374:function(Ct,Le,S){"use strict";var N=function(){if(typeof Map!="undefined")return Map;function le(Q,se){var H=-1;return Q.some(function(J,K){return J[0]===se?(H=K,!0):!1}),H}return function(){function Q(){this.__entries__=[]}return Object.defineProperty(Q.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),Q.prototype.get=function(se){var H=le(this.__entries__,se),J=this.__entries__[H];return J&&J[1]},Q.prototype.set=function(se,H){var J=le(this.__entries__,se);~J?this.__entries__[J][1]=H:this.__entries__.push([se,H])},Q.prototype.delete=function(se){var H=this.__entries__,J=le(H,se);~J&&H.splice(J,1)},Q.prototype.has=function(se){return!!~le(this.__entries__,se)},Q.prototype.clear=function(){this.__entries__.splice(0)},Q.prototype.forEach=function(se,H){H===void 0&&(H=null);for(var J=0,K=this.__entries__;J<K.length;J++){var M=K[J];se.call(H,M[1],M[0])}},Q}()}(),B=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,V=function(){return typeof S.g!="undefined"&&S.g.Math===Math?S.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),I=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(V):function(le){return setTimeout(function(){return le(Date.now())},1e3/60)}}(),A=2;function d(le,Q){var se=!1,H=!1,J=0;function K(){se&&(se=!1,le()),H&&D()}function M(){I(K)}function D(){var ne=Date.now();if(se){if(ne-J<A)return;H=!0}else se=!0,H=!1,setTimeout(M,Q);J=ne}return D}var U=20,b=["top","right","bottom","left","width","height","size","weight"],n=typeof MutationObserver!="undefined",E=function(){function le(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=d(this.refresh.bind(this),U)}return le.prototype.addObserver=function(Q){~this.observers_.indexOf(Q)||this.observers_.push(Q),this.connected_||this.connect_()},le.prototype.removeObserver=function(Q){var se=this.observers_,H=se.indexOf(Q);~H&&se.splice(H,1),!se.length&&this.connected_&&this.disconnect_()},le.prototype.refresh=function(){var Q=this.updateObservers_();Q&&this.refresh()},le.prototype.updateObservers_=function(){var Q=this.observers_.filter(function(se){return se.gatherActive(),se.hasActive()});return Q.forEach(function(se){return se.broadcastActive()}),Q.length>0},le.prototype.connect_=function(){!B||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)},le.prototype.disconnect_=function(){!B||!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)},le.prototype.onTransitionEnd_=function(Q){var se=Q.propertyName,H=se===void 0?"":se,J=b.some(function(K){return!!~H.indexOf(K)});J&&this.refresh()},le.getInstance=function(){return this.instance_||(this.instance_=new le),this.instance_},le.instance_=null,le}(),f=function(le,Q){for(var se=0,H=Object.keys(Q);se<H.length;se++){var J=H[se];Object.defineProperty(le,J,{value:Q[J],enumerable:!1,writable:!1,configurable:!0})}return le},c=function(le){var Q=le&&le.ownerDocument&&le.ownerDocument.defaultView;return Q||V},l=O(0,0,0,0);function u(le){return parseFloat(le)||0}function m(le){for(var Q=[],se=1;se<arguments.length;se++)Q[se-1]=arguments[se];return Q.reduce(function(H,J){var K=le["border-"+J+"-width"];return H+u(K)},0)}function x(le){for(var Q=["top","right","bottom","left"],se={},H=0,J=Q;H<J.length;H++){var K=J[H],M=le["padding-"+K];se[K]=u(M)}return se}function F(le){var Q=le.getBBox();return O(0,0,Q.width,Q.height)}function k(le){var Q=le.clientWidth,se=le.clientHeight;if(!Q&&!se)return l;var H=c(le).getComputedStyle(le),J=x(H),K=J.left+J.right,M=J.top+J.bottom,D=u(H.width),ne=u(H.height);if(H.boxSizing==="border-box"&&(Math.round(D+K)!==Q&&(D-=m(H,"left","right")+K),Math.round(ne+M)!==se&&(ne-=m(H,"top","bottom")+M)),!L(le)){var de=Math.round(D+K)-Q,Oe=Math.round(ne+M)-se;Math.abs(de)!==1&&(D-=de),Math.abs(Oe)!==1&&(ne-=Oe)}return O(J.left,J.top,D,ne)}var T=function(){return typeof SVGGraphicsElement!="undefined"?function(le){return le instanceof c(le).SVGGraphicsElement}:function(le){return le instanceof c(le).SVGElement&&typeof le.getBBox=="function"}}();function L(le){return le===c(le).document.documentElement}function W(le){return B?T(le)?F(le):k(le):l}function P(le){var Q=le.x,se=le.y,H=le.width,J=le.height,K=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,M=Object.create(K.prototype);return f(M,{x:Q,y:se,width:H,height:J,top:se,right:Q+H,bottom:J+se,left:Q}),M}function O(le,Q,se,H){return{x:le,y:Q,width:se,height:H}}var $=function(){function le(Q){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=O(0,0,0,0),this.target=Q}return le.prototype.isActive=function(){var Q=W(this.target);return this.contentRect_=Q,Q.width!==this.broadcastWidth||Q.height!==this.broadcastHeight},le.prototype.broadcastRect=function(){var Q=this.contentRect_;return this.broadcastWidth=Q.width,this.broadcastHeight=Q.height,Q},le}(),z=function(){function le(Q,se){var H=P(se);f(this,{target:Q,contentRect:H})}return le}(),ie=function(){function le(Q,se,H){if(this.activeObservations_=[],this.observations_=new N,typeof Q!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=Q,this.controller_=se,this.callbackCtx_=H}return le.prototype.observe=function(Q){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(Q instanceof c(Q).Element))throw new TypeError('parameter 1 is not of type "Element".');var se=this.observations_;se.has(Q)||(se.set(Q,new $(Q)),this.controller_.addObserver(this),this.controller_.refresh())}},le.prototype.unobserve=function(Q){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(Q instanceof c(Q).Element))throw new TypeError('parameter 1 is not of type "Element".');var se=this.observations_;se.has(Q)&&(se.delete(Q),se.size||this.controller_.removeObserver(this))}},le.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},le.prototype.gatherActive=function(){var Q=this;this.clearActive(),this.observations_.forEach(function(se){se.isActive()&&Q.activeObservations_.push(se)})},le.prototype.broadcastActive=function(){if(this.hasActive()){var Q=this.callbackCtx_,se=this.activeObservations_.map(function(H){return new z(H.target,H.broadcastRect())});this.callback_.call(Q,se,Q),this.clearActive()}},le.prototype.clearActive=function(){this.activeObservations_.splice(0)},le.prototype.hasActive=function(){return this.activeObservations_.length>0},le}(),te=typeof WeakMap!="undefined"?new WeakMap:new N,me=function(){function le(Q){if(!(this instanceof le))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var se=E.getInstance(),H=new ie(Q,se,this);te.set(this,H)}return le}();["observe","unobserve","disconnect"].forEach(function(le){me.prototype[le]=function(){var Q;return(Q=te.get(this))[le].apply(Q,arguments)}});var _e=function(){return typeof V.ResizeObserver!="undefined"?V.ResizeObserver:me}();Le.Z=_e},98040:function(Ct){Ct.exports=function(){var Le=document.getSelection();if(!Le.rangeCount)return function(){};for(var S=document.activeElement,N=[],B=0;B<Le.rangeCount;B++)N.push(Le.getRangeAt(B));switch(S.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":S.blur();break;default:S=null;break}return Le.removeAllRanges(),function(){Le.type==="Caret"&&Le.removeAllRanges(),Le.rangeCount||N.forEach(function(V){Le.addRange(V)}),S&&S.focus()}}},34376:function(Ct){(function(Le,S){if(1)Ct.exports=S();else var N,B})(window,function(){return function(Le){var S={};function N(B){if(S[B])return S[B].exports;var V=S[B]={i:B,l:!1,exports:{}};return Le[B].call(V.exports,V,V.exports,N),V.l=!0,V.exports}return N.m=Le,N.c=S,N.d=function(B,V,I){N.o(B,V)||Object.defineProperty(B,V,{enumerable:!0,get:I})},N.r=function(B){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(B,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(B,"__esModule",{value:!0})},N.t=function(B,V){if(1&V&&(B=N(B)),8&V||4&V&&typeof B=="object"&&B&&B.__esModule)return B;var I=Object.create(null);if(N.r(I),Object.defineProperty(I,"default",{enumerable:!0,value:B}),2&V&&typeof B!="string")for(var A in B)N.d(I,A,function(d){return B[d]}.bind(null,A));return I},N.n=function(B){var V=B&&B.__esModule?function(){return B.default}:function(){return B};return N.d(V,"a",V),V},N.o=function(B,V){return Object.prototype.hasOwnProperty.call(B,V)},N.p="",N(N.s=34)}([function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.forwardEvent=S.EventEmitter=void 0;var B=function(){function V(){this._listeners=[],this._disposed=!1}return Object.defineProperty(V.prototype,"event",{get:function(){var I=this;return this._event||(this._event=function(A){return I._listeners.push(A),{dispose:function(){if(!I._disposed){for(var d=0;d<I._listeners.length;d++)if(I._listeners[d]===A)return void I._listeners.splice(d,1)}}}}),this._event},enumerable:!1,configurable:!0}),V.prototype.fire=function(I,A){for(var d=[],U=0;U<this._listeners.length;U++)d.push(this._listeners[U]);for(U=0;U<d.length;U++)d[U].call(void 0,I,A)},V.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},V}();S.EventEmitter=B,S.forwardEvent=function(V,I){return V(function(A){return I.fire(A)})}},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.IUnicodeService=S.IOptionsService=S.ILogService=S.IInstantiationService=S.IDirtyRowService=S.ICharsetService=S.ICoreService=S.ICoreMouseService=S.IBufferService=void 0;var B=N(14);S.IBufferService=B.createDecorator("BufferService"),S.ICoreMouseService=B.createDecorator("CoreMouseService"),S.ICoreService=B.createDecorator("CoreService"),S.ICharsetService=B.createDecorator("CharsetService"),S.IDirtyRowService=B.createDecorator("DirtyRowService"),S.IInstantiationService=B.createDecorator("InstantiationService"),S.ILogService=B.createDecorator("LogService"),S.IOptionsService=B.createDecorator("OptionsService"),S.IUnicodeService=B.createDecorator("UnicodeService")},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.getDisposeArrayDisposable=S.disposeArray=S.Disposable=void 0;var B=function(){function I(){this._disposables=[],this._isDisposed=!1}return I.prototype.dispose=function(){this._isDisposed=!0;for(var A=0,d=this._disposables;A<d.length;A++)d[A].dispose();this._disposables.length=0},I.prototype.register=function(A){return this._disposables.push(A),A},I.prototype.unregister=function(A){var d=this._disposables.indexOf(A);d!==-1&&this._disposables.splice(d,1)},I}();function V(I){for(var A=0,d=I;A<d.length;A++)d[A].dispose();I.length=0}S.Disposable=B,S.disposeArray=V,S.getDisposeArrayDisposable=function(I){return{dispose:function(){return V(I)}}}},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.WHITESPACE_CELL_CODE=S.WHITESPACE_CELL_WIDTH=S.WHITESPACE_CELL_CHAR=S.NULL_CELL_CODE=S.NULL_CELL_WIDTH=S.NULL_CELL_CHAR=S.CHAR_DATA_CODE_INDEX=S.CHAR_DATA_WIDTH_INDEX=S.CHAR_DATA_CHAR_INDEX=S.CHAR_DATA_ATTR_INDEX=S.DEFAULT_ATTR=S.DEFAULT_COLOR=void 0,S.DEFAULT_COLOR=256,S.DEFAULT_ATTR=256|S.DEFAULT_COLOR<<9,S.CHAR_DATA_ATTR_INDEX=0,S.CHAR_DATA_CHAR_INDEX=1,S.CHAR_DATA_WIDTH_INDEX=2,S.CHAR_DATA_CODE_INDEX=3,S.NULL_CELL_CHAR="",S.NULL_CELL_WIDTH=1,S.NULL_CELL_CODE=0,S.WHITESPACE_CELL_CHAR=" ",S.WHITESPACE_CELL_WIDTH=1,S.WHITESPACE_CELL_CODE=32},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(b,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,f){E.__proto__=f}||function(E,f){for(var c in f)f.hasOwnProperty(c)&&(E[c]=f[c])})(b,n)},function(b,n){function E(){this.constructor=b}B(b,n),b.prototype=n===null?Object.create(n):(E.prototype=n.prototype,new E)});Object.defineProperty(S,"__esModule",{value:!0}),S.CellData=void 0;var I=N(8),A=N(3),d=N(6),U=function(b){function n(){var E=b!==null&&b.apply(this,arguments)||this;return E.content=0,E.fg=0,E.bg=0,E.extended=new d.ExtendedAttrs,E.combinedData="",E}return V(n,b),n.fromCharData=function(E){var f=new n;return f.setFromCharData(E),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?I.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(E){this.fg=E[A.CHAR_DATA_ATTR_INDEX],this.bg=0;var f=!1;if(E[A.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(E[A.CHAR_DATA_CHAR_INDEX].length===2){var c=E[A.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=c&&c<=56319){var l=E[A.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(c-55296)+l-56320+65536|E[A.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=E[A.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[A.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=E[A.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[A.CHAR_DATA_WIDTH_INDEX]<<22)},n.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},n}(d.AttributeData);S.CellData=U},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.ISoundService=S.ISelectionService=S.IRenderService=S.IMouseService=S.ICoreBrowserService=S.ICharSizeService=void 0;var B=N(14);S.ICharSizeService=B.createDecorator("CharSizeService"),S.ICoreBrowserService=B.createDecorator("CoreBrowserService"),S.IMouseService=B.createDecorator("MouseService"),S.IRenderService=B.createDecorator("RenderService"),S.ISelectionService=B.createDecorator("SelectionService"),S.ISoundService=B.createDecorator("SoundService")},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.ExtendedAttrs=S.AttributeData=void 0;var B=function(){function I(){this.fg=0,this.bg=0,this.extended=new V}return I.toColorRGB=function(A){return[A>>>16&255,A>>>8&255,255&A]},I.fromColorRGB=function(A){return(255&A[0])<<16|(255&A[1])<<8|255&A[2]},I.prototype.clone=function(){var A=new I;return A.fg=this.fg,A.bg=this.bg,A.extended=this.extended.clone(),A},I.prototype.isInverse=function(){return 67108864&this.fg},I.prototype.isBold=function(){return 134217728&this.fg},I.prototype.isUnderline=function(){return 268435456&this.fg},I.prototype.isBlink=function(){return 536870912&this.fg},I.prototype.isInvisible=function(){return 1073741824&this.fg},I.prototype.isItalic=function(){return 67108864&this.bg},I.prototype.isDim=function(){return 134217728&this.bg},I.prototype.getFgColorMode=function(){return 50331648&this.fg},I.prototype.getBgColorMode=function(){return 50331648&this.bg},I.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},I.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},I.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},I.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},I.prototype.isFgDefault=function(){return(50331648&this.fg)==0},I.prototype.isBgDefault=function(){return(50331648&this.bg)==0},I.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},I.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},I.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},I.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},I.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},I.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()},I.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},I.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},I.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},I.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},I.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},I}();S.AttributeData=B;var V=function(){function I(A,d){A===void 0&&(A=0),d===void 0&&(d=-1),this.underlineStyle=A,this.underlineColor=d}return I.prototype.clone=function(){return new I(this.underlineStyle,this.underlineColor)},I.prototype.isEmpty=function(){return this.underlineStyle===0},I}();S.ExtendedAttrs=V},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.addDisposableDomListener=void 0,S.addDisposableDomListener=function(B,V,I,A){B.addEventListener(V,I,A);var d=!1;return{dispose:function(){d||(d=!0,B.removeEventListener(V,I,A))}}}},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.Utf8ToUtf32=S.StringToUtf32=S.utf32ToString=S.stringFromCodePoint=void 0,S.stringFromCodePoint=function(I){return I>65535?(I-=65536,String.fromCharCode(55296+(I>>10))+String.fromCharCode(I%1024+56320)):String.fromCharCode(I)},S.utf32ToString=function(I,A,d){A===void 0&&(A=0),d===void 0&&(d=I.length);for(var U="",b=A;b<d;++b){var n=I[b];n>65535?(n-=65536,U+=String.fromCharCode(55296+(n>>10))+String.fromCharCode(n%1024+56320)):U+=String.fromCharCode(n)}return U};var B=function(){function I(){this._interim=0}return I.prototype.clear=function(){this._interim=0},I.prototype.decode=function(A,d){var U=A.length;if(!U)return 0;var b=0,n=0;this._interim&&(56320<=(c=A.charCodeAt(n++))&&c<=57343?d[b++]=1024*(this._interim-55296)+c-56320+65536:(d[b++]=this._interim,d[b++]=c),this._interim=0);for(var E=n;E<U;++E){var f=A.charCodeAt(E);if(55296<=f&&f<=56319){if(++E>=U)return this._interim=f,b;var c;56320<=(c=A.charCodeAt(E))&&c<=57343?d[b++]=1024*(f-55296)+c-56320+65536:(d[b++]=f,d[b++]=c)}else d[b++]=f}return b},I}();S.StringToUtf32=B;var V=function(){function I(){this.interim=new Uint8Array(3)}return I.prototype.clear=function(){this.interim.fill(0)},I.prototype.decode=function(A,d){var U=A.length;if(!U)return 0;var b,n,E,f,c=0,l=0,u=0;if(this.interim[0]){var m=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;for(var F=0,k=void 0;(k=63&this.interim[++F])&&F<4;)x<<=6,x|=k;for(var T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=T-F;u<L;){if(u>=U)return 0;if((192&(k=A[u++]))!=128){u--,m=!0;break}this.interim[F++]=k,x<<=6,x|=63&k}m||(T===2?x<128?u--:d[c++]=x:T===3?x<2048||x>=55296&&x<=57343||(d[c++]=x):x<65536||x>1114111||(d[c++]=x)),this.interim.fill(0)}for(var W=U-4,P=u;P<U;){for(;!(!(P<W)||128&(b=A[P])||128&(n=A[P+1])||128&(E=A[P+2])||128&(f=A[P+3]));)d[c++]=b,d[c++]=n,d[c++]=E,d[c++]=f,P+=4;if((b=A[P++])<128)d[c++]=b;else if((224&b)==192){if(P>=U)return this.interim[0]=b,c;if((192&(n=A[P++]))!=128){P--;continue}if((l=(31&b)<<6|63&n)<128){P--;continue}d[c++]=l}else if((240&b)==224){if(P>=U)return this.interim[0]=b,c;if((192&(n=A[P++]))!=128){P--;continue}if(P>=U)return this.interim[0]=b,this.interim[1]=n,c;if((192&(E=A[P++]))!=128){P--;continue}if((l=(15&b)<<12|(63&n)<<6|63&E)<2048||l>=55296&&l<=57343)continue;d[c++]=l}else if((248&b)==240){if(P>=U)return this.interim[0]=b,c;if((192&(n=A[P++]))!=128){P--;continue}if(P>=U)return this.interim[0]=b,this.interim[1]=n,c;if((192&(E=A[P++]))!=128){P--;continue}if(P>=U)return this.interim[0]=b,this.interim[1]=n,this.interim[2]=E,c;if((192&(f=A[P++]))!=128){P--;continue}if((l=(7&b)<<18|(63&n)<<12|(63&E)<<6|63&f)<65536||l>1114111)continue;d[c++]=l}}return c},I}();S.Utf8ToUtf32=V},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CHAR_ATLAS_CELL_SPACING=S.DIM_OPACITY=S.INVERTED_DEFAULT_COLOR=void 0,S.INVERTED_DEFAULT_COLOR=257,S.DIM_OPACITY=.5,S.CHAR_ATLAS_CELL_SPACING=1},function(Le,S,N){"use strict";var B,V,I,A;function d(b){var n=b.toString(16);return n.length<2?"0"+n:n}function U(b,n){return b<n?(n+.05)/(b+.05):(b+.05)/(n+.05)}Object.defineProperty(S,"__esModule",{value:!0}),S.contrastRatio=S.toPaddedHex=S.rgba=S.rgb=S.css=S.color=S.channels=void 0,function(b){b.toCss=function(n,E,f,c){return c!==void 0?"#"+d(n)+d(E)+d(f)+d(c):"#"+d(n)+d(E)+d(f)},b.toRgba=function(n,E,f,c){return c===void 0&&(c=255),(n<<24|E<<16|f<<8|c)>>>0}}(B=S.channels||(S.channels={})),(V=S.color||(S.color={})).blend=function(b,n){var E=(255&n.rgba)/255;if(E===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=b.rgba>>24&255,m=b.rgba>>16&255,x=b.rgba>>8&255,F=u+Math.round((f-u)*E),k=m+Math.round((c-m)*E),T=x+Math.round((l-x)*E);return{css:B.toCss(F,k,T),rgba:B.toRgba(F,k,T)}},V.isOpaque=function(b){return(255&b.rgba)==255},V.ensureContrastRatio=function(b,n,E){var f=A.ensureContrastRatio(b.rgba,n.rgba,E);if(f)return A.toColor(f>>24&255,f>>16&255,f>>8&255)},V.opaque=function(b){var n=(255|b.rgba)>>>0,E=A.toChannels(n),f=E[0],c=E[1],l=E[2];return{css:B.toCss(f,c,l),rgba:n}},V.opacity=function(b,n){var E=Math.round(255*n),f=A.toChannels(b.rgba),c=f[0],l=f[1],u=f[2];return{css:B.toCss(c,l,u,E),rgba:B.toRgba(c,l,u,E)}},(S.css||(S.css={})).toColor=function(b){switch(b.length){case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(b){function n(E,f,c){var l=E/255,u=f/255,m=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*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))}b.relativeLuminance=function(E){return n(E>>16&255,E>>8&255,255&E)},b.relativeLuminance2=n}(I=S.rgb||(S.rgb={})),function(b){function n(f,c,l){for(var u=f>>24&255,m=f>>16&255,x=f>>8&255,F=c>>24&255,k=c>>16&255,T=c>>8&255,L=U(I.relativeLuminance2(F,T,k),I.relativeLuminance2(u,m,x));L<l&&(F>0||k>0||T>0);)F-=Math.max(0,Math.ceil(.1*F)),k-=Math.max(0,Math.ceil(.1*k)),T-=Math.max(0,Math.ceil(.1*T)),L=U(I.relativeLuminance2(F,T,k),I.relativeLuminance2(u,m,x));return(F<<24|k<<16|T<<8|255)>>>0}function E(f,c,l){for(var u=f>>24&255,m=f>>16&255,x=f>>8&255,F=c>>24&255,k=c>>16&255,T=c>>8&255,L=U(I.relativeLuminance2(F,T,k),I.relativeLuminance2(u,m,x));L<l&&(F<255||k<255||T<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),k=Math.min(255,k+Math.ceil(.1*(255-k))),T=Math.min(255,T+Math.ceil(.1*(255-T))),L=U(I.relativeLuminance2(F,T,k),I.relativeLuminance2(u,m,x));return(F<<24|k<<16|T<<8|255)>>>0}b.ensureContrastRatio=function(f,c,l){var u=I.relativeLuminance(f>>8),m=I.relativeLuminance(c>>8);if(U(u,m)<l)return m<u?n(f,c,l):E(f,c,l)},b.reduceLuminance=n,b.increaseLuminance=E,b.toChannels=function(f){return[f>>24&255,f>>16&255,f>>8&255,255&f]},b.toColor=function(f,c,l){return{css:B.toCss(f,c,l),rgba:B.toRgba(f,c,l)}}}(A=S.rgba||(S.rgba={})),S.toPaddedHex=d,S.contrastRatio=U},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.isLinux=S.isWindows=S.isIphone=S.isIpad=S.isMac=S.isSafari=S.isFirefox=void 0;var B=typeof navigator=="undefined",V=B?"node":navigator.userAgent,I=B?"node":navigator.platform;function A(d,U){return d.indexOf(U)>=0}S.isFirefox=!!~V.indexOf("Firefox"),S.isSafari=/^((?!chrome|android).)*safari/i.test(V),S.isMac=A(["Macintosh","MacIntel","MacPPC","Mac68K"],I),S.isIpad=I==="iPad",S.isIphone=I==="iPhone",S.isWindows=A(["Windows","Win16","Win32","WinCE"],I),S.isLinux=I.indexOf("Linux")>=0},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.C1=S.C0=void 0,function(B){B.NUL="\0",B.SOH="",B.STX="",B.ETX="",B.EOT="",B.ENQ="",B.ACK="",B.BEL="\x07",B.BS="\b",B.HT=" ",B.LF=`
|
|
|
`,B.VT="\v",B.FF="\f",B.CR="\r",B.SO="",B.SI="",B.DLE="",B.DC1="",B.DC2="",B.DC3="",B.DC4="",B.NAK="",B.SYN="",B.ETB="",B.CAN="",B.EM="",B.SUB="",B.ESC="\x1B",B.FS="",B.GS="",B.RS="",B.US="",B.SP=" ",B.DEL="\x7F"}(S.C0||(S.C0={})),function(B){B.PAD="\x80",B.HOP="\x81",B.BPH="\x82",B.NBH="\x83",B.IND="\x84",B.NEL="\x85",B.SSA="\x86",B.ESA="\x87",B.HTS="\x88",B.HTJ="\x89",B.VTS="\x8A",B.PLD="\x8B",B.PLU="\x8C",B.RI="\x8D",B.SS2="\x8E",B.SS3="\x8F",B.DCS="\x90",B.PU1="\x91",B.PU2="\x92",B.STS="\x93",B.CCH="\x94",B.MW="\x95",B.SPA="\x96",B.EPA="\x97",B.SOS="\x98",B.SGCI="\x99",B.SCI="\x9A",B.CSI="\x9B",B.ST="\x9C",B.OSC="\x9D",B.PM="\x9E",B.APC="\x9F"}(S.C1||(S.C1={}))},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.BaseRenderLayer=void 0;var B=N(3),V=N(9),I=N(25),A=N(6),d=N(28),U=N(10),b=N(17),n=function(){function E(f,c,l,u,m,x,F,k){this._container=f,this._alpha=u,this._colors=m,this._rendererId=x,this._bufferService=F,this._optionsService=k,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 E.prototype.dispose=function(){var f;b.removeElementFromParent(this._canvas),(f=this._charAtlas)===null||f===void 0||f.dispose()},E.prototype._initCanvas=function(){this._ctx=d.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},E.prototype.onOptionsChanged=function(){},E.prototype.onBlur=function(){},E.prototype.onFocus=function(){},E.prototype.onCursorMove=function(){},E.prototype.onGridChanged=function(f,c){},E.prototype.onSelectionChanged=function(f,c,l){l===void 0&&(l=!1)},E.prototype.setColors=function(f){this._refreshCharAtlas(f)},E.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)}},E.prototype._refreshCharAtlas=function(f){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=I.acquireCharAtlas(this._optionsService.options,this._rendererId,f,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},E.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)},E.prototype._fillCells=function(f,c,l,u){this._ctx.fillRect(f*this._scaledCellWidth,c*this._scaledCellHeight,l*this._scaledCellWidth,u*this._scaledCellHeight)},E.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)},E.prototype._fillLeftLineAtCell=function(f,c,l){this._ctx.fillRect(f*this._scaledCellWidth,c*this._scaledCellHeight,window.devicePixelRatio*l,this._scaledCellHeight)},E.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)},E.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))},E.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))},E.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)},E.prototype._drawChars=function(f,c,l){var u,m,x=this._getContrastColor(f);x||f.isFgRGB()||f.isBgRGB()?this._drawUncachedChars(f,c,l,x):(f.isInverse()?(u=f.isBgDefault()?V.INVERTED_DEFAULT_COLOR:f.getBgColor(),m=f.isFgDefault()?V.INVERTED_DEFAULT_COLOR:f.getFgColor()):(m=f.isBgDefault()?B.DEFAULT_COLOR:f.getBgColor(),u=f.isFgDefault()?B.DEFAULT_COLOR:f.getFgColor()),u+=this._optionsService.options.drawBoldTextInBrightColors&&f.isBold()&&u<8?8:0,this._currentGlyphIdentifier.chars=f.getChars()||B.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=f.getCode()||B.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=m,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))},E.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=U.color.opaque(this._colors.background).css;else if(f.isBgRGB())this._ctx.fillStyle="rgb("+A.AttributeData.toColorRGB(f.getBgColor()).join(",")+")";else{var m=f.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&f.isBold()&&m<8&&(m+=8),this._ctx.fillStyle=this._colors.ansi[m].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("+A.AttributeData.toColorRGB(f.getFgColor()).join(",")+")";else{var x=f.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&f.isBold()&&x<8&&(x+=8),this._ctx.fillStyle=this._colors.ansi[x].css}this._clipRow(l),f.isDim()&&(this._ctx.globalAlpha=V.DIM_OPACITY),this._ctx.fillText(f.getChars(),c*this._scaledCellWidth+this._scaledCharLeft,l*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},E.prototype._clipRow=function(f){this._ctx.beginPath(),this._ctx.rect(0,f*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},E.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},E.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(),m=f.getBgColor(),x=f.getBgColorMode(),F=!!f.isInverse(),k=!!f.isInverse();if(F){var T=l;l=m,m=T;var L=u;u=x,x=L}var W=this._resolveBackgroundRgba(x,m,F),P=this._resolveForegroundRgba(u,l,F,k),O=U.rgba.ensureContrastRatio(W,P,this._optionsService.options.minimumContrastRatio);if(O){var $={css:U.channels.toCss(O>>24&255,O>>16&255,O>>8&255),rgba:O};return this._colors.contrastCache.setColor(f.bg,f.fg,$),$}this._colors.contrastCache.setColor(f.bg,f.fg,null)}},E.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}},E.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}},E}();S.BaseRenderLayer=n},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.createDecorator=S.getServiceDependencies=S.serviceRegistry=void 0;function B(V,I,A){I.di$target===I?I.di$dependencies.push({id:V,index:A}):(I.di$dependencies=[{id:V,index:A}],I.di$target=I)}S.serviceRegistry=new Map,S.getServiceDependencies=function(V){return V.di$dependencies||[]},S.createDecorator=function(V){if(S.serviceRegistry.has(V))return S.serviceRegistry.get(V);var I=function(A,d,U){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");B(I,A,U)};return I.toString=function(){return V},S.serviceRegistry.set(V,I),I}},function(Le,S,N){"use strict";function B(V,I,A,d){if(A===void 0&&(A=0),d===void 0&&(d=V.length),A>=V.length)return V;A=(V.length+A)%V.length,d=d>=V.length?V.length:(V.length+d)%V.length;for(var U=A;U<d;++U)V[U]=I;return V}Object.defineProperty(S,"__esModule",{value:!0}),S.concat=S.fillFallback=S.fill=void 0,S.fill=function(V,I,A,d){return V.fill?V.fill(I,A,d):B(V,I,A,d)},S.fillFallback=B,S.concat=function(V,I){var A=new V.constructor(V.length+I.length);return A.set(V),A.set(I,V.length),A}},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.BufferLine=S.DEFAULT_ATTR_DATA=void 0;var B=N(8),V=N(3),I=N(4),A=N(6);S.DEFAULT_ATTR_DATA=Object.freeze(new A.AttributeData);var d=function(){function U(b,n,E){E===void 0&&(E=!1),this.isWrapped=E,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);for(var f=n||I.CellData.fromCharData([0,V.NULL_CELL_CHAR,V.NULL_CELL_WIDTH,V.NULL_CELL_CODE]),c=0;c<b;++c)this.setCell(c,f);this.length=b}return U.prototype.get=function(b){var n=this._data[3*b+0],E=2097151&n;return[this._data[3*b+1],2097152&n?this._combined[b]:E?B.stringFromCodePoint(E):"",n>>22,2097152&n?this._combined[b].charCodeAt(this._combined[b].length-1):E]},U.prototype.set=function(b,n){this._data[3*b+1]=n[V.CHAR_DATA_ATTR_INDEX],n[V.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=n[1],this._data[3*b+0]=2097152|b|n[V.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=n[V.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|n[V.CHAR_DATA_WIDTH_INDEX]<<22},U.prototype.getWidth=function(b){return this._data[3*b+0]>>22},U.prototype.hasWidth=function(b){return 12582912&this._data[3*b+0]},U.prototype.getFg=function(b){return this._data[3*b+1]},U.prototype.getBg=function(b){return this._data[3*b+2]},U.prototype.hasContent=function(b){return 4194303&this._data[3*b+0]},U.prototype.getCodePoint=function(b){var n=this._data[3*b+0];return 2097152&n?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&n},U.prototype.isCombined=function(b){return 2097152&this._data[3*b+0]},U.prototype.getString=function(b){var n=this._data[3*b+0];return 2097152&n?this._combined[b]:2097151&n?B.stringFromCodePoint(2097151&n):""},U.prototype.loadCell=function(b,n){var E=3*b;return n.content=this._data[E+0],n.fg=this._data[E+1],n.bg=this._data[E+2],2097152&n.content&&(n.combinedData=this._combined[b]),268435456&n.bg&&(n.extended=this._extendedAttrs[b]),n},U.prototype.setCell=function(b,n){2097152&n.content&&(this._combined[b]=n.combinedData),268435456&n.bg&&(this._extendedAttrs[b]=n.extended),this._data[3*b+0]=n.content,this._data[3*b+1]=n.fg,this._data[3*b+2]=n.bg},U.prototype.setCellFromCodePoint=function(b,n,E,f,c,l){268435456&c&&(this._extendedAttrs[b]=l),this._data[3*b+0]=n|E<<22,this._data[3*b+1]=f,this._data[3*b+2]=c},U.prototype.addCodepointToCell=function(b,n){var E=this._data[3*b+0];2097152&E?this._combined[b]+=B.stringFromCodePoint(n):(2097151&E?(this._combined[b]=B.stringFromCodePoint(2097151&E)+B.stringFromCodePoint(n),E&=-2097152,E|=2097152):E=n|1<<22,this._data[3*b+0]=E)},U.prototype.insertCells=function(b,n,E,f){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodePoint(b-1,0,1,(f==null?void 0:f.fg)||0,(f==null?void 0:f.bg)||0,(f==null?void 0:f.extended)||new A.ExtendedAttrs),n<this.length-b){for(var c=new I.CellData,l=this.length-b-n-1;l>=0;--l)this.setCell(b+n+l,this.loadCell(b+l,c));for(l=0;l<n;++l)this.setCell(b+l,E)}else for(l=b;l<this.length;++l)this.setCell(l,E);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 A.ExtendedAttrs)},U.prototype.deleteCells=function(b,n,E,f){if(b%=this.length,n<this.length-b){for(var c=new I.CellData,l=0;l<this.length-b-n;++l)this.setCell(b+l,this.loadCell(b+n+l,c));for(l=this.length-n;l<this.length;++l)this.setCell(l,E)}else for(l=b;l<this.length;++l)this.setCell(l,E);b&&this.getWidth(b-1)===2&&this.setCellFromCodePoint(b-1,0,1,(f==null?void 0:f.fg)||0,(f==null?void 0:f.bg)||0,(f==null?void 0:f.extended)||new A.ExtendedAttrs),this.getWidth(b)!==0||this.hasContent(b)||this.setCellFromCodePoint(b,0,1,(f==null?void 0:f.fg)||0,(f==null?void 0:f.bg)||0,(f==null?void 0:f.extended)||new A.ExtendedAttrs)},U.prototype.replaceCells=function(b,n,E,f){for(b&&this.getWidth(b-1)===2&&this.setCellFromCodePoint(b-1,0,1,(f==null?void 0:f.fg)||0,(f==null?void 0:f.bg)||0,(f==null?void 0:f.extended)||new A.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 A.ExtendedAttrs);b<n&&b<this.length;)this.setCell(b++,E)},U.prototype.resize=function(b,n){if(b!==this.length){if(b>this.length){var E=new Uint32Array(3*b);this.length&&(3*b<this._data.length?E.set(this._data.subarray(0,3*b)):E.set(this._data)),this._data=E;for(var f=this.length;f<b;++f)this.setCell(f,n)}else if(b){(E=new Uint32Array(3*b)).set(this._data.subarray(0,3*b)),this._data=E;var c=Object.keys(this._combined);for(f=0;f<c.length;f++){var l=parseInt(c[f],10);l>=b&&delete this._combined[l]}}else this._data=new Uint32Array(0),this._combined={};this.length=b}},U.prototype.fill=function(b){this._combined={},this._extendedAttrs={};for(var n=0;n<this.length;++n)this.setCell(n,b)},U.prototype.copyFrom=function(b){for(var n in this.length!==b.length?this._data=new Uint32Array(b._data):this._data.set(b._data),this.length=b.length,this._combined={},b._combined)this._combined[n]=b._combined[n];for(var n in this._extendedAttrs={},b._extendedAttrs)this._extendedAttrs[n]=b._extendedAttrs[n];this.isWrapped=b.isWrapped},U.prototype.clone=function(){var b=new U(0);for(var n in b._data=new Uint32Array(this._data),b.length=this.length,this._combined)b._combined[n]=this._combined[n];for(var n in this._extendedAttrs)b._extendedAttrs[n]=this._extendedAttrs[n];return b.isWrapped=this.isWrapped,b},U.prototype.getTrimmedLength=function(){for(var b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0])return b+(this._data[3*b+0]>>22);return 0},U.prototype.copyCellsFrom=function(b,n,E,f,c){var l=b._data;if(c)for(var u=f-1;u>=0;u--)for(var m=0;m<3;m++)this._data[3*(E+u)+m]=l[3*(n+u)+m];else for(u=0;u<f;u++)for(m=0;m<3;m++)this._data[3*(E+u)+m]=l[3*(n+u)+m];var x=Object.keys(b._combined);for(m=0;m<x.length;m++){var F=parseInt(x[m],10);F>=n&&(this._combined[F-n+E]=b._combined[F])}},U.prototype.translateToString=function(b,n,E){b===void 0&&(b=!1),n===void 0&&(n=0),E===void 0&&(E=this.length),b&&(E=Math.min(E,this.getTrimmedLength()));for(var f="";n<E;){var c=this._data[3*n+0],l=2097151&c;f+=2097152&c?this._combined[n]:l?B.stringFromCodePoint(l):V.WHITESPACE_CELL_CHAR,n+=c>>22||1}return f},U}();S.BufferLine=d},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.removeElementFromParent=void 0,S.removeElementFromParent=function(){for(var B,V=[],I=0;I<arguments.length;I++)V[I]=arguments[I];for(var A=0,d=V;A<d.length;A++){var U=d[A];(B=U==null?void 0:U.parentElement)===null||B===void 0||B.removeChild(U)}}},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.tooMuchOutput=S.promptLabel=void 0,S.promptLabel="Terminal input",S.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(P,O){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function($,z){$.__proto__=z}||function($,z){for(var ie in z)z.hasOwnProperty(ie)&&($[ie]=z[ie])})(P,O)},function(P,O){function $(){this.constructor=P}B(P,O),P.prototype=O===null?Object.create(O):($.prototype=O.prototype,new $)});Object.defineProperty(S,"__esModule",{value:!0}),S.InputHandler=S.WindowsOptionsReportType=void 0;var I,A=N(12),d=N(20),U=N(39),b=N(2),n=N(15),E=N(8),f=N(16),c=N(0),l=N(3),u=N(4),m=N(6),x=N(22),F=N(24),k={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function T(P,O){if(P>24)return O.setWinLines||!1;switch(P){case 1:return!!O.restoreWin;case 2:return!!O.minimizeWin;case 3:return!!O.setWinPosition;case 4:return!!O.setWinSizePixels;case 5:return!!O.raiseWin;case 6:return!!O.lowerWin;case 7:return!!O.refreshWin;case 8:return!!O.setWinSizeChars;case 9:return!!O.maximizeWin;case 10:return!!O.fullscreenWin;case 11:return!!O.getWinState;case 13:return!!O.getWinPosition;case 14:return!!O.getWinSizePixels;case 15:return!!O.getScreenSizePixels;case 16:return!!O.getCellSizePixels;case 18:return!!O.getWinSizeChars;case 19:return!!O.getScreenSizeChars;case 20:return!!O.getIconTitle;case 21:return!!O.getWinTitle;case 22:return!!O.pushTitle;case 23:return!!O.popTitle;case 24:return!!O.setWinLines}return!1}(function(P){P[P.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",P[P.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(I=S.WindowsOptionsReportType||(S.WindowsOptionsReportType={}));var L=function(){function P(O,$,z,ie){this._bufferService=O,this._coreService=$,this._logService=z,this._optionsService=ie,this._data=new Uint32Array(0)}return P.prototype.hook=function(O){this._data=new Uint32Array(0)},P.prototype.put=function(O,$,z){this._data=n.concat(this._data,O.subarray($,z))},P.prototype.unhook=function(O){if(O){var $=E.utf32ToString(this._data);switch(this._data=new Uint32Array(0),$){case'"q':return this._coreService.triggerDataEvent(A.C0.ESC+'P1$r0"q'+A.C0.ESC+"\\");case'"p':return this._coreService.triggerDataEvent(A.C0.ESC+'P1$r61;1"p'+A.C0.ESC+"\\");case"r":var z=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(A.C0.ESC+"P1$r"+z+A.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(A.C0.ESC+"P1$r0m"+A.C0.ESC+"\\");case" q":var ie={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return ie-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(A.C0.ESC+"P1$r"+ie+" q"+A.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",$),this._coreService.triggerDataEvent(A.C0.ESC+"P0$r"+A.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},P}(),W=function(P){function O($,z,ie,te,me,_e,le,Q,se){se===void 0&&(se=new U.EscapeSequenceParser);var H=P.call(this)||this;H._bufferService=$,H._charsetService=z,H._coreService=ie,H._dirtyRowService=te,H._logService=me,H._optionsService=_e,H._coreMouseService=le,H._unicodeService=Q,H._parser=se,H._parseBuffer=new Uint32Array(4096),H._stringDecoder=new E.StringToUtf32,H._utf8Decoder=new E.Utf8ToUtf32,H._workCell=new u.CellData,H._windowTitle="",H._iconName="",H._windowTitleStack=[],H._iconNameStack=[],H._curAttrData=f.DEFAULT_ATTR_DATA.clone(),H._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone(),H._onRequestBell=new c.EventEmitter,H._onRequestRefreshRows=new c.EventEmitter,H._onRequestReset=new c.EventEmitter,H._onRequestScroll=new c.EventEmitter,H._onRequestSyncScrollBar=new c.EventEmitter,H._onRequestWindowsOptionsReport=new c.EventEmitter,H._onA11yChar=new c.EventEmitter,H._onA11yTab=new c.EventEmitter,H._onCursorMove=new c.EventEmitter,H._onLineFeed=new c.EventEmitter,H._onScroll=new c.EventEmitter,H._onTitleChange=new c.EventEmitter,H.register(H._parser),H._parser.setCsiHandlerFallback(function(D,ne){H._logService.debug("Unknown CSI code: ",{identifier:H._parser.identToString(D),params:ne.toArray()})}),H._parser.setEscHandlerFallback(function(D){H._logService.debug("Unknown ESC code: ",{identifier:H._parser.identToString(D)})}),H._parser.setExecuteHandlerFallback(function(D){H._logService.debug("Unknown EXECUTE code: ",{code:D})}),H._parser.setOscHandlerFallback(function(D,ne,de){H._logService.debug("Unknown OSC code: ",{identifier:D,action:ne,data:de})}),H._parser.setDcsHandlerFallback(function(D,ne,de){ne==="HOOK"&&(de=de.toArray()),H._logService.debug("Unknown DCS code: ",{identifier:H._parser.identToString(D),action:ne,payload:de})}),H._parser.setPrintHandler(function(D,ne,de){return H.print(D,ne,de)}),H._parser.setCsiHandler({final:"@"},function(D){return H.insertChars(D)}),H._parser.setCsiHandler({intermediates:" ",final:"@"},function(D){return H.scrollLeft(D)}),H._parser.setCsiHandler({final:"A"},function(D){return H.cursorUp(D)}),H._parser.setCsiHandler({intermediates:" ",final:"A"},function(D){return H.scrollRight(D)}),H._parser.setCsiHandler({final:"B"},function(D){return H.cursorDown(D)}),H._parser.setCsiHandler({final:"C"},function(D){return H.cursorForward(D)}),H._parser.setCsiHandler({final:"D"},function(D){return H.cursorBackward(D)}),H._parser.setCsiHandler({final:"E"},function(D){return H.cursorNextLine(D)}),H._parser.setCsiHandler({final:"F"},function(D){return H.cursorPrecedingLine(D)}),H._parser.setCsiHandler({final:"G"},function(D){return H.cursorCharAbsolute(D)}),H._parser.setCsiHandler({final:"H"},function(D){return H.cursorPosition(D)}),H._parser.setCsiHandler({final:"I"},function(D){return H.cursorForwardTab(D)}),H._parser.setCsiHandler({final:"J"},function(D){return H.eraseInDisplay(D)}),H._parser.setCsiHandler({prefix:"?",final:"J"},function(D){return H.eraseInDisplay(D)}),H._parser.setCsiHandler({final:"K"},function(D){return H.eraseInLine(D)}),H._parser.setCsiHandler({prefix:"?",final:"K"},function(D){return H.eraseInLine(D)}),H._parser.setCsiHandler({final:"L"},function(D){return H.insertLines(D)}),H._parser.setCsiHandler({final:"M"},function(D){return H.deleteLines(D)}),H._parser.setCsiHandler({final:"P"},function(D){return H.deleteChars(D)}),H._parser.setCsiHandler({final:"S"},function(D){return H.scrollUp(D)}),H._parser.setCsiHandler({final:"T"},function(D){return H.scrollDown(D)}),H._parser.setCsiHandler({final:"X"},function(D){return H.eraseChars(D)}),H._parser.setCsiHandler({final:"Z"},function(D){return H.cursorBackwardTab(D)}),H._parser.setCsiHandler({final:"`"},function(D){return H.charPosAbsolute(D)}),H._parser.setCsiHandler({final:"a"},function(D){return H.hPositionRelative(D)}),H._parser.setCsiHandler({final:"b"},function(D){return H.repeatPrecedingCharacter(D)}),H._parser.setCsiHandler({final:"c"},function(D){return H.sendDeviceAttributesPrimary(D)}),H._parser.setCsiHandler({prefix:">",final:"c"},function(D){return H.sendDeviceAttributesSecondary(D)}),H._parser.setCsiHandler({final:"d"},function(D){return H.linePosAbsolute(D)}),H._parser.setCsiHandler({final:"e"},function(D){return H.vPositionRelative(D)}),H._parser.setCsiHandler({final:"f"},function(D){return H.hVPosition(D)}),H._parser.setCsiHandler({final:"g"},function(D){return H.tabClear(D)}),H._parser.setCsiHandler({final:"h"},function(D){return H.setMode(D)}),H._parser.setCsiHandler({prefix:"?",final:"h"},function(D){return H.setModePrivate(D)}),H._parser.setCsiHandler({final:"l"},function(D){return H.resetMode(D)}),H._parser.setCsiHandler({prefix:"?",final:"l"},function(D){return H.resetModePrivate(D)}),H._parser.setCsiHandler({final:"m"},function(D){return H.charAttributes(D)}),H._parser.setCsiHandler({final:"n"},function(D){return H.deviceStatus(D)}),H._parser.setCsiHandler({prefix:"?",final:"n"},function(D){return H.deviceStatusPrivate(D)}),H._parser.setCsiHandler({intermediates:"!",final:"p"},function(D){return H.softReset(D)}),H._parser.setCsiHandler({intermediates:" ",final:"q"},function(D){return H.setCursorStyle(D)}),H._parser.setCsiHandler({final:"r"},function(D){return H.setScrollRegion(D)}),H._parser.setCsiHandler({final:"s"},function(D){return H.saveCursor(D)}),H._parser.setCsiHandler({final:"t"},function(D){return H.windowOptions(D)}),H._parser.setCsiHandler({final:"u"},function(D){return H.restoreCursor(D)}),H._parser.setCsiHandler({intermediates:"'",final:"}"},function(D){return H.insertColumns(D)}),H._parser.setCsiHandler({intermediates:"'",final:"~"},function(D){return H.deleteColumns(D)}),H._parser.setExecuteHandler(A.C0.BEL,function(){return H.bell()}),H._parser.setExecuteHandler(A.C0.LF,function(){return H.lineFeed()}),H._parser.setExecuteHandler(A.C0.VT,function(){return H.lineFeed()}),H._parser.setExecuteHandler(A.C0.FF,function(){return H.lineFeed()}),H._parser.setExecuteHandler(A.C0.CR,function(){return H.carriageReturn()}),H._parser.setExecuteHandler(A.C0.BS,function(){return H.backspace()}),H._parser.setExecuteHandler(A.C0.HT,function(){return H.tab()}),H._parser.setExecuteHandler(A.C0.SO,function(){return H.shiftOut()}),H._parser.setExecuteHandler(A.C0.SI,function(){return H.shiftIn()}),H._parser.setExecuteHandler(A.C1.IND,function(){return H.index()}),H._parser.setExecuteHandler(A.C1.NEL,function(){return H.nextLine()}),H._parser.setExecuteHandler(A.C1.HTS,function(){return H.tabSet()}),H._parser.setOscHandler(0,new x.OscHandler(function(D){H.setTitle(D),H.setIconName(D)})),H._parser.setOscHandler(1,new x.OscHandler(function(D){return H.setIconName(D)})),H._parser.setOscHandler(2,new x.OscHandler(function(D){return H.setTitle(D)})),H._parser.setEscHandler({final:"7"},function(){return H.saveCursor()}),H._parser.setEscHandler({final:"8"},function(){return H.restoreCursor()}),H._parser.setEscHandler({final:"D"},function(){return H.index()}),H._parser.setEscHandler({final:"E"},function(){return H.nextLine()}),H._parser.setEscHandler({final:"H"},function(){return H.tabSet()}),H._parser.setEscHandler({final:"M"},function(){return H.reverseIndex()}),H._parser.setEscHandler({final:"="},function(){return H.keypadApplicationMode()}),H._parser.setEscHandler({final:">"},function(){return H.keypadNumericMode()}),H._parser.setEscHandler({final:"c"},function(){return H.fullReset()}),H._parser.setEscHandler({final:"n"},function(){return H.setgLevel(2)}),H._parser.setEscHandler({final:"o"},function(){return H.setgLevel(3)}),H._parser.setEscHandler({final:"|"},function(){return H.setgLevel(3)}),H._parser.setEscHandler({final:"}"},function(){return H.setgLevel(2)}),H._parser.setEscHandler({final:"~"},function(){return H.setgLevel(1)}),H._parser.setEscHandler({intermediates:"%",final:"@"},function(){return H.selectDefaultCharset()}),H._parser.setEscHandler({intermediates:"%",final:"G"},function(){return H.selectDefaultCharset()});var J=function(D){K._parser.setEscHandler({intermediates:"(",final:D},function(){return H.selectCharset("("+D)}),K._parser.setEscHandler({intermediates:")",final:D},function(){return H.selectCharset(")"+D)}),K._parser.setEscHandler({intermediates:"*",final:D},function(){return H.selectCharset("*"+D)}),K._parser.setEscHandler({intermediates:"+",final:D},function(){return H.selectCharset("+"+D)}),K._parser.setEscHandler({intermediates:"-",final:D},function(){return H.selectCharset("-"+D)}),K._parser.setEscHandler({intermediates:".",final:D},function(){return H.selectCharset("."+D)}),K._parser.setEscHandler({intermediates:"/",final:D},function(){return H.selectCharset("/"+D)})},K=this;for(var M in d.CHARSETS)J(M);return H._parser.setEscHandler({intermediates:"#",final:"8"},function(){return H.screenAlignmentPattern()}),H._parser.setErrorHandler(function(D){return H._logService.error("Parsing error: ",D),D}),H._parser.setDcsHandler({intermediates:"$",final:"q"},new L(H._bufferService,H._coreService,H._logService,H._optionsService)),H}return V(O,P),Object.defineProperty(O.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),O.prototype.dispose=function(){P.prototype.dispose.call(this)},O.prototype.parse=function($){var z=this._bufferService.buffer,ie=z.x,te=z.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 me=0;me<$.length;me+=131072){var _e=me+131072<$.length?me+131072:$.length,le=typeof $=="string"?this._stringDecoder.decode($.substring(me,_e),this._parseBuffer):this._utf8Decoder.decode($.subarray(me,_e),this._parseBuffer);this._parser.parse(this._parseBuffer,le)}else le=typeof $=="string"?this._stringDecoder.decode($,this._parseBuffer):this._utf8Decoder.decode($,this._parseBuffer),this._parser.parse(this._parseBuffer,le);(z=this._bufferService.buffer).x===ie&&z.y===te||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},O.prototype.print=function($,z,ie){var te,me,_e=this._bufferService.buffer,le=this._charsetService.charset,Q=this._optionsService.options.screenReaderMode,se=this._bufferService.cols,H=this._coreService.decPrivateModes.wraparound,J=this._coreService.modes.insertMode,K=this._curAttrData,M=_e.lines.get(_e.ybase+_e.y);this._dirtyRowService.markDirty(_e.y),_e.x&&ie-z>0&&M.getWidth(_e.x-1)===2&&M.setCellFromCodePoint(_e.x-1,0,1,K.fg,K.bg,K.extended);for(var D=z;D<ie;++D){if(te=$[D],me=this._unicodeService.wcwidth(te),te<127&&le){var ne=le[String.fromCharCode(te)];ne&&(te=ne.charCodeAt(0))}if(Q&&this._onA11yChar.fire(E.stringFromCodePoint(te)),me||!_e.x){if(_e.x+me-1>=se){if(H){for(;_e.x<se;)M.setCellFromCodePoint(_e.x++,0,1,K.fg,K.bg,K.extended);_e.x=0,_e.y++,_e.y===_e.scrollBottom+1?(_e.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(_e.y>=this._bufferService.rows&&(_e.y=this._bufferService.rows-1),_e.lines.get(_e.ybase+_e.y).isWrapped=!0),M=_e.lines.get(_e.ybase+_e.y)}else if(_e.x=se-1,me===2)continue}if(J&&(M.insertCells(_e.x,me,_e.getNullCell(K),K),M.getWidth(se-1)===2&&M.setCellFromCodePoint(se-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,K.fg,K.bg,K.extended)),M.setCellFromCodePoint(_e.x++,te,me,K.fg,K.bg,K.extended),me>0)for(;--me;)M.setCellFromCodePoint(_e.x++,0,0,K.fg,K.bg,K.extended)}else M.getWidth(_e.x-1)?M.addCodepointToCell(_e.x-1,te):M.addCodepointToCell(_e.x-2,te)}ie-z>0&&(M.loadCell(_e.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),_e.x<se&&ie-z>0&&M.getWidth(_e.x)===0&&!M.hasContent(_e.x)&&M.setCellFromCodePoint(_e.x,0,1,K.fg,K.bg,K.extended),this._dirtyRowService.markDirty(_e.y)},O.prototype.addCsiHandler=function($,z){var ie=this;return $.final!=="t"||$.prefix||$.intermediates?this._parser.addCsiHandler($,z):this._parser.addCsiHandler($,function(te){return!T(te.params[0],ie._optionsService.options.windowOptions)||z(te)})},O.prototype.addDcsHandler=function($,z){return this._parser.addDcsHandler($,new F.DcsHandler(z))},O.prototype.addEscHandler=function($,z){return this._parser.addEscHandler($,z)},O.prototype.addOscHandler=function($,z){return this._parser.addOscHandler($,new x.OscHandler(z))},O.prototype.bell=function(){this._onRequestBell.fire()},O.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()},O.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},O.prototype.backspace=function(){var $,z=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),void(z.x>0&&z.x--);if(this._restrictCursor(this._bufferService.cols),z.x>0)z.x--;else if(z.x===0&&z.y>z.scrollTop&&z.y<=z.scrollBottom&&(!(($=z.lines.get(z.ybase+z.y))===null||$===void 0)&&$.isWrapped)){z.lines.get(z.ybase+z.y).isWrapped=!1,z.y--,z.x=this._bufferService.cols-1;var ie=z.lines.get(z.ybase+z.y);ie.hasWidth(z.x)&&!ie.hasContent(z.x)&&z.x--}this._restrictCursor()},O.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-$)}},O.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},O.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},O.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)},O.prototype._setCursor=function($,z){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=$,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+z):(this._bufferService.buffer.x=$,this._bufferService.buffer.y=z),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},O.prototype._moveCursor=function($,z){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+$,this._bufferService.buffer.y+z)},O.prototype.cursorUp=function($){var z=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;z>=0?this._moveCursor(0,-Math.min(z,$.params[0]||1)):this._moveCursor(0,-($.params[0]||1))},O.prototype.cursorDown=function($){var z=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;z>=0?this._moveCursor(0,Math.min(z,$.params[0]||1)):this._moveCursor(0,$.params[0]||1)},O.prototype.cursorForward=function($){this._moveCursor($.params[0]||1,0)},O.prototype.cursorBackward=function($){this._moveCursor(-($.params[0]||1),0)},O.prototype.cursorNextLine=function($){this.cursorDown($),this._bufferService.buffer.x=0},O.prototype.cursorPrecedingLine=function($){this.cursorUp($),this._bufferService.buffer.x=0},O.prototype.cursorCharAbsolute=function($){this._setCursor(($.params[0]||1)-1,this._bufferService.buffer.y)},O.prototype.cursorPosition=function($){this._setCursor($.length>=2?($.params[1]||1)-1:0,($.params[0]||1)-1)},O.prototype.charPosAbsolute=function($){this._setCursor(($.params[0]||1)-1,this._bufferService.buffer.y)},O.prototype.hPositionRelative=function($){this._moveCursor($.params[0]||1,0)},O.prototype.linePosAbsolute=function($){this._setCursor(this._bufferService.buffer.x,($.params[0]||1)-1)},O.prototype.vPositionRelative=function($){this._moveCursor(0,$.params[0]||1)},O.prototype.hVPosition=function($){this.cursorPosition($)},O.prototype.tabClear=function($){var z=$.params[0];z===0?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:z===3&&(this._bufferService.buffer.tabs={})},O.prototype.cursorForwardTab=function($){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var z=$.params[0]||1;z--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},O.prototype.cursorBackwardTab=function($){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var z=$.params[0]||1,ie=this._bufferService.buffer;z--;)ie.x=ie.prevStop()},O.prototype._eraseInBufferLine=function($,z,ie,te){te===void 0&&(te=!1);var me=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+$);me.replaceCells(z,ie,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),te&&(me.isWrapped=!1)},O.prototype._resetBufferLine=function($){var z=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+$);z.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1},O.prototype.eraseInDisplay=function($){var z;switch(this._restrictCursor(),$.params[0]){case 0:for(z=this._bufferService.buffer.y,this._dirtyRowService.markDirty(z),this._eraseInBufferLine(z++,this._bufferService.buffer.x,this._bufferService.cols,this._bufferService.buffer.x===0);z<this._bufferService.rows;z++)this._resetBufferLine(z);this._dirtyRowService.markDirty(z);break;case 1:for(z=this._bufferService.buffer.y,this._dirtyRowService.markDirty(z),this._eraseInBufferLine(z,0,this._bufferService.buffer.x+1,!0),this._bufferService.buffer.x+1>=this._bufferService.cols&&(this._bufferService.buffer.lines.get(z+1).isWrapped=!1);z--;)this._resetBufferLine(z);this._dirtyRowService.markDirty(0);break;case 2:for(z=this._bufferService.rows,this._dirtyRowService.markDirty(z-1);z--;)this._resetBufferLine(z);this._dirtyRowService.markDirty(0);break;case 3:var ie=this._bufferService.buffer.lines.length-this._bufferService.rows;ie>0&&(this._bufferService.buffer.lines.trimStart(ie),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-ie,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-ie,0),this._onScroll.fire(0))}},O.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)},O.prototype.insertLines=function($){this._restrictCursor();var z=$.params[0]||1,ie=this._bufferService.buffer;if(!(ie.y>ie.scrollBottom||ie.y<ie.scrollTop)){for(var te=ie.ybase+ie.y,me=this._bufferService.rows-1-ie.scrollBottom,_e=this._bufferService.rows-1+ie.ybase-me+1;z--;)ie.lines.splice(_e-1,1),ie.lines.splice(te,0,ie.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(ie.y,ie.scrollBottom),ie.x=0}},O.prototype.deleteLines=function($){this._restrictCursor();var z=$.params[0]||1,ie=this._bufferService.buffer;if(!(ie.y>ie.scrollBottom||ie.y<ie.scrollTop)){var te,me=ie.ybase+ie.y;for(te=this._bufferService.rows-1-ie.scrollBottom,te=this._bufferService.rows-1+ie.ybase-te;z--;)ie.lines.splice(me,1),ie.lines.splice(te,0,ie.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(ie.y,ie.scrollBottom),ie.x=0}},O.prototype.insertChars=function($){this._restrictCursor();var z=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);z&&(z.insertCells(this._bufferService.buffer.x,$.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},O.prototype.deleteChars=function($){this._restrictCursor();var z=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);z&&(z.deleteCells(this._bufferService.buffer.x,$.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},O.prototype.scrollUp=function($){for(var z=$.params[0]||1,ie=this._bufferService.buffer;z--;)ie.lines.splice(ie.ybase+ie.scrollTop,1),ie.lines.splice(ie.ybase+ie.scrollBottom,0,ie.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(ie.scrollTop,ie.scrollBottom)},O.prototype.scrollDown=function($){for(var z=$.params[0]||1,ie=this._bufferService.buffer;z--;)ie.lines.splice(ie.ybase+ie.scrollBottom,1),ie.lines.splice(ie.ybase+ie.scrollTop,0,ie.getBlankLine(f.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(ie.scrollTop,ie.scrollBottom)},O.prototype.scrollLeft=function($){var z=this._bufferService.buffer;if(!(z.y>z.scrollBottom||z.y<z.scrollTop)){for(var ie=$.params[0]||1,te=z.scrollTop;te<=z.scrollBottom;++te){var me=z.lines.get(z.ybase+te);me.deleteCells(0,ie,z.getNullCell(this._eraseAttrData()),this._eraseAttrData()),me.isWrapped=!1}this._dirtyRowService.markRangeDirty(z.scrollTop,z.scrollBottom)}},O.prototype.scrollRight=function($){var z=this._bufferService.buffer;if(!(z.y>z.scrollBottom||z.y<z.scrollTop)){for(var ie=$.params[0]||1,te=z.scrollTop;te<=z.scrollBottom;++te){var me=z.lines.get(z.ybase+te);me.insertCells(0,ie,z.getNullCell(this._eraseAttrData()),this._eraseAttrData()),me.isWrapped=!1}this._dirtyRowService.markRangeDirty(z.scrollTop,z.scrollBottom)}},O.prototype.insertColumns=function($){var z=this._bufferService.buffer;if(!(z.y>z.scrollBottom||z.y<z.scrollTop)){for(var ie=$.params[0]||1,te=z.scrollTop;te<=z.scrollBottom;++te){var me=this._bufferService.buffer.lines.get(z.ybase+te);me.insertCells(z.x,ie,z.getNullCell(this._eraseAttrData()),this._eraseAttrData()),me.isWrapped=!1}this._dirtyRowService.markRangeDirty(z.scrollTop,z.scrollBottom)}},O.prototype.deleteColumns=function($){var z=this._bufferService.buffer;if(!(z.y>z.scrollBottom||z.y<z.scrollTop)){for(var ie=$.params[0]||1,te=z.scrollTop;te<=z.scrollBottom;++te){var me=z.lines.get(z.ybase+te);me.deleteCells(z.x,ie,z.getNullCell(this._eraseAttrData()),this._eraseAttrData()),me.isWrapped=!1}this._dirtyRowService.markRangeDirty(z.scrollTop,z.scrollBottom)}},O.prototype.eraseChars=function($){this._restrictCursor();var z=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);z&&(z.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))},O.prototype.repeatPrecedingCharacter=function($){if(this._parser.precedingCodepoint){for(var z=$.params[0]||1,ie=new Uint32Array(z),te=0;te<z;++te)ie[te]=this._parser.precedingCodepoint;this.print(ie,0,ie.length)}},O.prototype.sendDeviceAttributesPrimary=function($){$.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(A.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(A.C0.ESC+"[?6c"))},O.prototype.sendDeviceAttributesSecondary=function($){$.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(A.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(A.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent($.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(A.C0.ESC+"[>83;40003;0c"))},O.prototype._is=function($){return(this._optionsService.options.termName+"").indexOf($)===0},O.prototype.setMode=function($){for(var z=0;z<$.length;z++)switch($.params[z]){case 4:this._coreService.modes.insertMode=!0}},O.prototype.setModePrivate=function($){for(var z=0;z<$.length;z++)switch($.params[z]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),this._charsetService.setgCharset(1,d.DEFAULT_CHARSET),this._charsetService.setgCharset(2,d.DEFAULT_CHARSET),this._charsetService.setgCharset(3,d.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}},O.prototype.resetMode=function($){for(var z=0;z<$.length;z++)switch($.params[z]){case 4:this._coreService.modes.insertMode=!1}},O.prototype.resetModePrivate=function($){for(var z=0;z<$.length;z++)switch($.params[z]){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[z]===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}},O.prototype._updateAttrColor=function($,z,ie,te,me){return z===2?($|=50331648,$&=-16777216,$|=m.AttributeData.fromColorRGB([ie,te,me])):z===5&&($&=-50331904,$|=33554432|255&ie),$},O.prototype._extractColor=function($,z,ie){var te=[0,0,-1,0,0,0],me=0,_e=0;do{if(te[_e+me]=$.params[z+_e],$.hasSubParams(z+_e)){var le=$.getSubParams(z+_e),Q=0;do te[1]===5&&(me=1),te[_e+Q+1+me]=le[Q];while(++Q<le.length&&Q+_e+1+me<te.length);break}if(te[1]===5&&_e+me>=2||te[1]===2&&_e+me>=5)break;te[1]&&(me=1)}while(++_e+z<$.length&&_e+me<te.length);for(Q=2;Q<te.length;++Q)te[Q]===-1&&(te[Q]=0);switch(te[0]){case 38:ie.fg=this._updateAttrColor(ie.fg,te[1],te[3],te[4],te[5]);break;case 48:ie.bg=this._updateAttrColor(ie.bg,te[1],te[3],te[4],te[5]);break;case 58:ie.extended=ie.extended.clone(),ie.extended.underlineColor=this._updateAttrColor(ie.extended.underlineColor,te[1],te[3],te[4],te[5])}return _e},O.prototype._processUnderline=function($,z){z.extended=z.extended.clone(),(!~$||$>5)&&($=1),z.extended.underlineStyle=$,z.fg|=268435456,$===0&&(z.fg&=-268435457),z.updateExtended()},O.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 z,ie=$.length,te=this._curAttrData,me=0;me<ie;me++)(z=$.params[me])>=30&&z<=37?(te.fg&=-50331904,te.fg|=16777216|z-30):z>=40&&z<=47?(te.bg&=-50331904,te.bg|=16777216|z-40):z>=90&&z<=97?(te.fg&=-50331904,te.fg|=16777224|z-90):z>=100&&z<=107?(te.bg&=-50331904,te.bg|=16777224|z-100):z===0?(te.fg=f.DEFAULT_ATTR_DATA.fg,te.bg=f.DEFAULT_ATTR_DATA.bg):z===1?te.fg|=134217728:z===3?te.bg|=67108864:z===4?(te.fg|=268435456,this._processUnderline($.hasSubParams(me)?$.getSubParams(me)[0]:1,te)):z===5?te.fg|=536870912:z===7?te.fg|=67108864:z===8?te.fg|=1073741824:z===2?te.bg|=134217728:z===21?this._processUnderline(2,te):z===22?(te.fg&=-134217729,te.bg&=-134217729):z===23?te.bg&=-67108865:z===24?te.fg&=-268435457:z===25?te.fg&=-536870913:z===27?te.fg&=-67108865:z===28?te.fg&=-1073741825:z===39?(te.fg&=-67108864,te.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):z===49?(te.bg&=-67108864,te.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):z===38||z===48||z===58?me+=this._extractColor($,me,te):z===59?(te.extended=te.extended.clone(),te.extended.underlineColor=-1,te.updateExtended()):z===100?(te.fg&=-67108864,te.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,te.bg&=-67108864,te.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",z)},O.prototype.deviceStatus=function($){switch($.params[0]){case 5:this._coreService.triggerDataEvent(A.C0.ESC+"[0n");break;case 6:var z=this._bufferService.buffer.y+1,ie=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(A.C0.ESC+"["+z+";"+ie+"R")}},O.prototype.deviceStatusPrivate=function($){switch($.params[0]){case 6:var z=this._bufferService.buffer.y+1,ie=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(A.C0.ESC+"[?"+z+";"+ie+"R")}},O.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},O.prototype.setCursorStyle=function($){var z=$.params[0]||1;switch(z){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 ie=z%2==1;this._optionsService.options.cursorBlink=ie},O.prototype.setScrollRegion=function($){var z,ie=$.params[0]||1;($.length<2||(z=$.params[1])>this._bufferService.rows||z===0)&&(z=this._bufferService.rows),z>ie&&(this._bufferService.buffer.scrollTop=ie-1,this._bufferService.buffer.scrollBottom=z-1,this._setCursor(0,0))},O.prototype.windowOptions=function($){if(T($.params[0],this._optionsService.options.windowOptions)){var z=$.length>1?$.params[1]:0;switch($.params[0]){case 14:z!==2&&this._onRequestWindowsOptionsReport.fire(I.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(I.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(A.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:z!==0&&z!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),z!==0&&z!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:z!==0&&z!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),z!==0&&z!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},O.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},O.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()},O.prototype.setTitle=function($){this._windowTitle=$,this._onTitleChange.fire($)},O.prototype.setIconName=function($){this._iconName=$},O.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},O.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},O.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},O.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,d.DEFAULT_CHARSET)},O.prototype.selectCharset=function($){$.length===2?$[0]!=="/"&&this._charsetService.setgCharset(k[$[0]],d.CHARSETS[$[1]]||d.DEFAULT_CHARSET):this.selectDefaultCharset()},O.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()},O.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},O.prototype.reverseIndex=function(){this._restrictCursor();var $=this._bufferService.buffer;if($.y===$.scrollTop){var z=$.scrollBottom-$.scrollTop;$.lines.shiftElements($.ybase+$.y,z,1),$.lines.set($.ybase+$.y,$.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty($.scrollTop,$.scrollBottom)}else $.y--,this._restrictCursor()},O.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},O.prototype.reset=function(){this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone()},O.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},O.prototype.setgLevel=function($){this._charsetService.setgLevel($)},O.prototype.screenAlignmentPattern=function(){var $=new u.CellData;$.content=1<<22|69,$.fg=this._curAttrData.fg,$.bg=this._curAttrData.bg;var z=this._bufferService.buffer;this._setCursor(0,0);for(var ie=0;ie<this._bufferService.rows;++ie){var te=z.ybase+z.y+ie,me=z.lines.get(te);me&&(me.fill($),me.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},O}(b.Disposable);S.InputHandler=W},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.DEFAULT_CHARSET=S.CHARSETS=void 0,S.CHARSETS={},S.DEFAULT_CHARSET=S.CHARSETS.B,S.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"},S.CHARSETS.A={"#":"\xA3"},S.CHARSETS.B=void 0,S.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},S.CHARSETS.C=S.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},S.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},S.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},S.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},S.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},S.CHARSETS.E=S.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},S.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},S.CHARSETS.H=S.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},S.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.Params=void 0;var B=function(){function V(I,A){if(I===void 0&&(I=32),A===void 0&&(A=32),this.maxLength=I,this.maxSubParamsLength=A,A>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(I),this.length=0,this._subParams=new Int32Array(A),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(I),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return V.fromArray=function(I){var A=new V;if(!I.length)return A;for(var d=I[0]instanceof Array?1:0;d<I.length;++d){var U=I[d];if(U instanceof Array)for(var b=0;b<U.length;++b)A.addSubParam(U[b]);else A.addParam(U)}return A},V.prototype.clone=function(){var I=new V(this.maxLength,this.maxSubParamsLength);return I.params.set(this.params),I.length=this.length,I._subParams.set(this._subParams),I._subParamsLength=this._subParamsLength,I._subParamsIdx.set(this._subParamsIdx),I._rejectDigits=this._rejectDigits,I._rejectSubDigits=this._rejectSubDigits,I._digitIsSub=this._digitIsSub,I},V.prototype.toArray=function(){for(var I=[],A=0;A<this.length;++A){I.push(this.params[A]);var d=this._subParamsIdx[A]>>8,U=255&this._subParamsIdx[A];U-d>0&&I.push(Array.prototype.slice.call(this._subParams,d,U))}return I},V.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},V.prototype.addParam=function(I){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(I<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=I>2147483647?2147483647:I}},V.prototype.addSubParam=function(I){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(I<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=I>2147483647?2147483647:I,this._subParamsIdx[this.length-1]++}},V.prototype.hasSubParams=function(I){return(255&this._subParamsIdx[I])-(this._subParamsIdx[I]>>8)>0},V.prototype.getSubParams=function(I){var A=this._subParamsIdx[I]>>8,d=255&this._subParamsIdx[I];return d-A>0?this._subParams.subarray(A,d):null},V.prototype.getSubParamsAll=function(){for(var I={},A=0;A<this.length;++A){var d=this._subParamsIdx[A]>>8,U=255&this._subParamsIdx[A];U-d>0&&(I[A]=this._subParams.slice(d,U))}return I},V.prototype.addDigit=function(I){var A;if(!(this._rejectDigits||!(A=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var d=this._digitIsSub?this._subParams:this.params,U=d[A-1];d[A-1]=~U?Math.min(10*U+I,2147483647):I}},V}();S.Params=B},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.OscHandler=S.OscParser=void 0;var B=N(23),V=N(8),I=function(){function d(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return d.prototype.addHandler=function(U,b){this._handlers[U]===void 0&&(this._handlers[U]=[]);var n=this._handlers[U];return n.push(b),{dispose:function(){var E=n.indexOf(b);E!==-1&&n.splice(E,1)}}},d.prototype.setHandler=function(U,b){this._handlers[U]=[b]},d.prototype.clearHandler=function(U){this._handlers[U]&&delete this._handlers[U]},d.prototype.setHandlerFallback=function(U){this._handlerFb=U},d.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},d.prototype.reset=function(){this._state===2&&this.end(!1),this._id=-1,this._state=0},d.prototype._start=function(){var U=this._handlers[this._id];if(U)for(var b=U.length-1;b>=0;b--)U[b].start();else this._handlerFb(this._id,"START")},d.prototype._put=function(U,b,n){var E=this._handlers[this._id];if(E)for(var f=E.length-1;f>=0;f--)E[f].put(U,b,n);else this._handlerFb(this._id,"PUT",V.utf32ToString(U,b,n))},d.prototype._end=function(U){var b=this._handlers[this._id];if(b){for(var n=b.length-1;n>=0&&b[n].end(U)===!1;n--);for(n--;n>=0;n--)b[n].end(!1)}else this._handlerFb(this._id,"END",U)},d.prototype.start=function(){this.reset(),this._id=-1,this._state=1},d.prototype.put=function(U,b,n){if(this._state!==3){if(this._state===1)for(;b<n;){var E=U[b++];if(E===59){this._state=2,this._start();break}if(E<48||57<E)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+E-48}this._state===2&&n-b>0&&this._put(U,b,n)}},d.prototype.end=function(U){this._state!==0&&(this._state!==3&&(this._state===1&&this._start(),this._end(U)),this._id=-1,this._state=0)},d}();S.OscParser=I;var A=function(){function d(U){this._handler=U,this._data="",this._hitLimit=!1}return d.prototype.start=function(){this._data="",this._hitLimit=!1},d.prototype.put=function(U,b,n){this._hitLimit||(this._data+=V.utf32ToString(U,b,n),this._data.length>B.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},d.prototype.end=function(U){var b;return this._hitLimit?b=!1:U&&(b=this._handler(this._data)),this._data="",this._hitLimit=!1,b},d}();S.OscHandler=A},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.PAYLOAD_LIMIT=void 0,S.PAYLOAD_LIMIT=1e7},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.DcsHandler=S.DcsParser=void 0;var B=N(8),V=N(21),I=N(23),A=[],d=function(){function b(){this._handlers=Object.create(null),this._active=A,this._ident=0,this._handlerFb=function(){}}return b.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},b.prototype.addHandler=function(n,E){this._handlers[n]===void 0&&(this._handlers[n]=[]);var f=this._handlers[n];return f.push(E),{dispose:function(){var c=f.indexOf(E);c!==-1&&f.splice(c,1)}}},b.prototype.setHandler=function(n,E){this._handlers[n]=[E]},b.prototype.clearHandler=function(n){this._handlers[n]&&delete this._handlers[n]},b.prototype.setHandlerFallback=function(n){this._handlerFb=n},b.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=A,this._ident=0},b.prototype.hook=function(n,E){if(this.reset(),this._ident=n,this._active=this._handlers[n]||A,this._active.length)for(var f=this._active.length-1;f>=0;f--)this._active[f].hook(E);else this._handlerFb(this._ident,"HOOK",E)},b.prototype.put=function(n,E,f){if(this._active.length)for(var c=this._active.length-1;c>=0;c--)this._active[c].put(n,E,f);else this._handlerFb(this._ident,"PUT",B.utf32ToString(n,E,f))},b.prototype.unhook=function(n){if(this._active.length){for(var E=this._active.length-1;E>=0&&this._active[E].unhook(n)===!1;E--);for(E--;E>=0;E--)this._active[E].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",n);this._active=A,this._ident=0},b}();S.DcsParser=d;var U=function(){function b(n){this._handler=n,this._data="",this._hitLimit=!1}return b.prototype.hook=function(n){this._params=n.clone(),this._data="",this._hitLimit=!1},b.prototype.put=function(n,E,f){this._hitLimit||(this._data+=B.utf32ToString(n,E,f),this._data.length>I.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},b.prototype.unhook=function(n){var E;return this._hitLimit?E=!1:n&&(E=this._handler(this._data,this._params||new V.Params)),this._params=void 0,this._data="",this._hitLimit=!1,E},b}();S.DcsHandler=U},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.removeTerminalFromCache=S.acquireCharAtlas=void 0;var B=N(26),V=N(43),I=[];S.acquireCharAtlas=function(A,d,U,b,n){for(var E=B.generateConfig(b,n,A,U),f=0;f<I.length;f++){var c=(l=I[f]).ownedBy.indexOf(d);if(c>=0){if(B.configEquals(l.config,E))return l.atlas;l.ownedBy.length===1?(l.atlas.dispose(),I.splice(f,1)):l.ownedBy.splice(c,1);break}}for(f=0;f<I.length;f++){var l=I[f];if(B.configEquals(l.config,E))return l.ownedBy.push(d),l.atlas}var u={atlas:new V.DynamicCharAtlas(document,E),config:E,ownedBy:[d]};return I.push(u),u.atlas},S.removeTerminalFromCache=function(A){for(var d=0;d<I.length;d++){var U=I[d].ownedBy.indexOf(A);if(U!==-1){I[d].ownedBy.length===1?(I[d].atlas.dispose(),I.splice(d,1)):I[d].ownedBy.splice(U,1);break}}}},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.is256Color=S.configEquals=S.generateConfig=void 0;var B=N(3);S.generateConfig=function(V,I,A,d){var U={foreground:d.foreground,background:d.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:d.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:V,scaledCharHeight:I,fontFamily:A.fontFamily,fontSize:A.fontSize,fontWeight:A.fontWeight,fontWeightBold:A.fontWeightBold,allowTransparency:A.allowTransparency,colors:U}},S.configEquals=function(V,I){for(var A=0;A<V.colors.ansi.length;A++)if(V.colors.ansi[A].rgba!==I.colors.ansi[A].rgba)return!1;return V.devicePixelRatio===I.devicePixelRatio&&V.fontFamily===I.fontFamily&&V.fontSize===I.fontSize&&V.fontWeight===I.fontWeight&&V.fontWeightBold===I.fontWeightBold&&V.allowTransparency===I.allowTransparency&&V.scaledCharWidth===I.scaledCharWidth&&V.scaledCharHeight===I.scaledCharHeight&&V.colors.foreground===I.colors.foreground&&V.colors.background===I.colors.background},S.is256Color=function(V){return V<B.DEFAULT_COLOR}},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.ColorManager=S.DEFAULT_ANSI_COLORS=void 0;var B=N(10),V=N(45),I=B.css.toColor("#ffffff"),A=B.css.toColor("#000000"),d=B.css.toColor("#ffffff"),U=B.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};S.DEFAULT_ANSI_COLORS=function(){for(var E=[B.css.toColor("#2e3436"),B.css.toColor("#cc0000"),B.css.toColor("#4e9a06"),B.css.toColor("#c4a000"),B.css.toColor("#3465a4"),B.css.toColor("#75507b"),B.css.toColor("#06989a"),B.css.toColor("#d3d7cf"),B.css.toColor("#555753"),B.css.toColor("#ef2929"),B.css.toColor("#8ae234"),B.css.toColor("#fce94f"),B.css.toColor("#729fcf"),B.css.toColor("#ad7fa8"),B.css.toColor("#34e2e2"),B.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],m=f[c%6];E.push({css:B.channels.toCss(l,u,m),rgba:B.channels.toRgba(l,u,m)})}for(c=0;c<24;c++){var x=8+10*c;E.push({css:B.channels.toCss(x,x,x),rgba:B.channels.toRgba(x,x,x)})}return E}();var n=function(){function E(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 V.ColorContrastCache,this.colors={foreground:I,background:A,cursor:d,cursorAccent:U,selectionTransparent:b,selectionOpaque:B.color.blend(A,b),ansi:S.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return E.prototype.onOptionsChange=function(f){f==="minimumContrastRatio"&&this._contrastCache.clear()},E.prototype.setTheme=function(f){f===void 0&&(f={}),this.colors.foreground=this._parseColor(f.foreground,I),this.colors.background=this._parseColor(f.background,A),this.colors.cursor=this._parseColor(f.cursor,d,!0),this.colors.cursorAccent=this._parseColor(f.cursorAccent,U,!0),this.colors.selectionTransparent=this._parseColor(f.selection,b,!0),this.colors.selectionOpaque=B.color.blend(this.colors.background,this.colors.selectionTransparent),B.color.isOpaque(this.colors.selectionTransparent)&&(this.colors.selectionTransparent=B.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(f.black,S.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(f.red,S.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(f.green,S.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(f.yellow,S.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(f.blue,S.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(f.magenta,S.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(f.cyan,S.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(f.white,S.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(f.brightBlack,S.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(f.brightRed,S.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(f.brightGreen,S.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(f.brightYellow,S.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(f.brightBlue,S.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(f.brightMagenta,S.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(f.brightCyan,S.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(f.brightWhite,S.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},E.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 m=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(W){return Number(W)}),x=m[0],F=m[1],k=m[2],T=m[3],L=Math.round(255*T);return{rgba:B.channels.toRgba(x,F,k,L),css:f}}return{css:this._ctx.fillStyle,rgba:B.channels.toRgba(u[0],u[1],u[2],u[3])}},E}();S.ColorManager=n},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.throwIfFalsy=void 0,S.throwIfFalsy=function(B){if(!B)throw new Error("value must not be falsy");return B}},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(n,E){return(B=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,E)},function(n,E){function f(){this.constructor=n}B(n,E),n.prototype=E===null?Object.create(E):(f.prototype=E.prototype,new f)});Object.defineProperty(S,"__esModule",{value:!0}),S.CharacterJoinerRegistry=S.JoinedCellData=void 0;var I=N(6),A=N(3),d=N(4),U=function(n){function E(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 V(E,n),E.prototype.isCombined=function(){return 2097152},E.prototype.getWidth=function(){return this._width},E.prototype.getChars=function(){return this.combinedData},E.prototype.getCode=function(){return 2097151},E.prototype.setFromCharData=function(f){throw new Error("not implemented")},E.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},E}(I.AttributeData);S.JoinedCellData=U;var b=function(){function n(E){this._bufferService=E,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new d.CellData}return n.prototype.registerCharacterJoiner=function(E){var f={id:this._nextCharacterJoinerId++,handler:E};return this._characterJoiners.push(f),f.id},n.prototype.deregisterCharacterJoiner=function(E){for(var f=0;f<this._characterJoiners.length;f++)if(this._characterJoiners[f].id===E)return this._characterJoiners.splice(f,1),!0;return!1},n.prototype.getJoinedCharacters=function(E){if(this._characterJoiners.length===0)return[];var f=this._bufferService.buffer.lines.get(E);if(!f||f.length===0)return[];for(var c=[],l=f.translateToString(!0),u=0,m=0,x=0,F=f.getFg(0),k=f.getBg(0),T=0;T<f.getTrimmedLength();T++)if(f.loadCell(T,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==F||this._workCell.bg!==k){if(T-u>1)for(var L=this._getJoinedRanges(l,x,m,f,u),W=0;W<L.length;W++)c.push(L[W]);u=T,x=m,F=this._workCell.fg,k=this._workCell.bg}m+=this._workCell.getChars().length||A.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-u>1)for(L=this._getJoinedRanges(l,x,m,f,u),W=0;W<L.length;W++)c.push(L[W]);return c},n.prototype._getJoinedRanges=function(E,f,c,l,u){for(var m=E.substring(f,c),x=this._characterJoiners[0].handler(m),F=1;F<this._characterJoiners.length;F++)for(var k=this._characterJoiners[F].handler(m),T=0;T<k.length;T++)n._mergeRanges(x,k[T]);return this._stringRangesToCellRanges(x,l,u),x},n.prototype._stringRangesToCellRanges=function(E,f,c){var l=0,u=!1,m=0,x=E[l];if(x){for(var F=c;F<this._bufferService.cols;F++){var k=f.getWidth(F),T=f.getString(F).length||A.WHITESPACE_CELL_CHAR.length;if(k!==0){if(!u&&x[0]<=m&&(x[0]=F,u=!0),x[1]<=m){if(x[1]=F,!(x=E[++l]))break;x[0]<=m?(x[0]=F,u=!0):u=!1}m+=T}}x&&(x[1]=this._bufferService.cols)}},n._mergeRanges=function(E,f){for(var c=!1,l=0;l<E.length;l++){var u=E[l];if(c){if(f[1]<=u[0])return E[l-1][1]=f[1],E;if(f[1]<=u[1])return E[l-1][1]=Math.max(f[1],u[1]),E.splice(l,1),E;E.splice(l,1),l--}else{if(f[1]<=u[0])return E.splice(l,0,f),E;if(f[1]<=u[1])return u[0]=Math.min(f[0],u[0]),E;f[0]<u[1]&&(u[0]=Math.min(f[0],u[0]),c=!0)}}return c?E[E.length-1][1]=f[1]:E.push(f),E},n}();S.CharacterJoinerRegistry=b},function(Le,S,N){"use strict";function B(V,I){var A=I.getBoundingClientRect();return[V.clientX-A.left,V.clientY-A.top]}Object.defineProperty(S,"__esModule",{value:!0}),S.getRawByteCoords=S.getCoords=S.getCoordsRelativeToElement=void 0,S.getCoordsRelativeToElement=B,S.getCoords=function(V,I,A,d,U,b,n,E){if(U){var f=B(V,I);if(f)return f[0]=Math.ceil((f[0]+(E?b/2:0))/b),f[1]=Math.ceil(f[1]/n),f[0]=Math.min(Math.max(f[0],1),A+(E?1:0)),f[1]=Math.min(Math.max(f[1],1),d),f}},S.getRawByteCoords=function(V){if(V)return{x:V[0]+32,y:V[1]+32}}},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.RenderDebouncer=void 0;var B=function(){function V(I){this._renderCallback=I}return V.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},V.prototype.refresh=function(I,A,d){var U=this;this._rowCount=d,I=I!==void 0?I:0,A=A!==void 0?A:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,I):I,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,A):A,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return U._innerRefresh()}))},V.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var I=Math.max(this._rowStart,0),A=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0,this._renderCallback(I,A)}},V}();S.RenderDebouncer=B},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(A,d){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,b){U.__proto__=b}||function(U,b){for(var n in b)b.hasOwnProperty(n)&&(U[n]=b[n])})(A,d)},function(A,d){function U(){this.constructor=A}B(A,d),A.prototype=d===null?Object.create(d):(U.prototype=d.prototype,new U)});Object.defineProperty(S,"__esModule",{value:!0}),S.ScreenDprMonitor=void 0;var I=function(A){function d(){var U=A!==null&&A.apply(this,arguments)||this;return U._currentDevicePixelRatio=window.devicePixelRatio,U}return V(d,A),d.prototype.setListener=function(U){var b=this;this._listener&&this.clearListener(),this._listener=U,this._outerListener=function(){b._listener&&(b._listener(window.devicePixelRatio,b._currentDevicePixelRatio),b._updateDpr())},this._updateDpr()},d.prototype.dispose=function(){A.prototype.dispose.call(this),this.clearListener()},d.prototype._updateDpr=function(){var U;this._outerListener&&((U=this._resolutionMediaMatchList)===null||U===void 0||U.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},d.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)},d}(N(2).Disposable);S.ScreenDprMonitor=I},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.clone=void 0,S.clone=function B(V,I){if(I===void 0&&(I=5),typeof V!="object")return V;var A=Array.isArray(V)?[]:{};for(var d in V)A[d]=I<=1?V[d]:V[d]?B(V[d],I-1):V[d];return A}},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.Terminal=void 0;var B=N(4),V=N(35),I=N(18),A=N(0),d=N(83),U=function(){function l(u){this._core=new V.Terminal(u),this._addonManager=new d.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,m){this._verifyIntegers(u,m),this._core.resize(u,m)},l.prototype.open=function(u){this._core.open(u)},l.prototype.attachCustomKeyEventHandler=function(u){this._core.attachCustomKeyEventHandler(u)},l.prototype.registerLinkMatcher=function(u,m,x){return this._checkProposedApi(),this._core.registerLinkMatcher(u,m,x)},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,m,x){this._verifyIntegers(u,m,x),this._core.select(u,m,x)},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,m){this._verifyIntegers(u,m),this._core.selectLines(u,m)},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,m){this._core.write(u,m)},l.prototype.writeUtf8=function(u,m){this._core.write(u,m)},l.prototype.writeln=function(u,m){this._core.write(u),this._core.write(`\r
|
|
|
`,m)},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,m){this._core.optionsService.setOption(u,m)},l.prototype.refresh=function(u,m){this._verifyIntegers(u,m),this._core.refresh(u,m)},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 I},enumerable:!1,configurable:!0}),l.prototype._verifyIntegers=function(){for(var u=[],m=0;m<arguments.length;m++)u[m]=arguments[m];for(var x=0,F=u;x<F.length;x++){var k=F[x];if(k===1/0||isNaN(k)||k%1!=0)throw new Error("This API only accepts integers")}},l}();S.Terminal=U;var b=function(){function l(u,m){this._buffer=u,this.type=m}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 m=this._buffer.lines.get(u);if(m)return new E(m)},l.prototype.getNullCell=function(){return new B.CellData},l}(),n=function(){function l(u){var m=this;this._buffers=u,this._onBufferChange=new A.EventEmitter,this._normal=new b(this._buffers.normal,"normal"),this._alternate=new b(this._buffers.alt,"alternate"),this._buffers.onBufferActivate(function(){return m._onBufferChange.fire(m.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}(),E=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,m){if(!(u<0||u>=this._line.length))return m?(this._line.loadCell(u,m),m):this._line.loadCell(u,new B.CellData)},l.prototype.translateToString=function(u,m,x){return this._line.translateToString(u,m,x)},l}(),f=function(){function l(u){this._core=u}return l.prototype.registerCsiHandler=function(u,m){return this._core.addCsiHandler(u,function(x){return m(x.toArray())})},l.prototype.addCsiHandler=function(u,m){return this.registerCsiHandler(u,m)},l.prototype.registerDcsHandler=function(u,m){return this._core.addDcsHandler(u,function(x,F){return m(x,F.toArray())})},l.prototype.addDcsHandler=function(u,m){return this.registerDcsHandler(u,m)},l.prototype.registerEscHandler=function(u,m){return this._core.addEscHandler(u,m)},l.prototype.addEscHandler=function(u,m){return this.registerEscHandler(u,m)},l.prototype.registerOscHandler=function(u,m){return this._core.addOscHandler(u,m)},l.prototype.addOscHandler=function(u,m){return this.registerOscHandler(u,m)},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(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(se,H){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,K){J.__proto__=K}||function(J,K){for(var M in K)K.hasOwnProperty(M)&&(J[M]=K[M])})(se,H)},function(se,H){function J(){this.constructor=se}B(se,H),se.prototype=H===null?Object.create(H):(J.prototype=H.prototype,new J)});Object.defineProperty(S,"__esModule",{value:!0}),S.Terminal=void 0;var I=N(36),A=N(37),d=N(38),U=N(12),b=N(19),n=N(40),E=N(50),f=N(51),c=N(11),l=N(7),u=N(18),m=N(54),x=N(55),F=N(56),k=N(57),T=N(59),L=N(0),W=N(16),P=N(27),O=N(60),$=N(5),z=N(61),ie=N(62),te=N(63),me=N(64),_e=N(65),le=typeof window!="undefined"?window.document:null,Q=function(se){function H(J){J===void 0&&(J={});var K=se.call(this,J)||this;return K.browser=c,K._keyDownHandled=!1,K._onCursorMove=new L.EventEmitter,K._onKey=new L.EventEmitter,K._onRender=new L.EventEmitter,K._onSelectionChange=new L.EventEmitter,K._onTitleChange=new L.EventEmitter,K._onFocus=new L.EventEmitter,K._onBlur=new L.EventEmitter,K._onA11yCharEmitter=new L.EventEmitter,K._onA11yTabEmitter=new L.EventEmitter,K._setup(),K.linkifier=K._instantiationService.createInstance(E.Linkifier),K.linkifier2=K.register(K._instantiationService.createInstance(te.Linkifier2)),K.register(K._inputHandler.onRequestBell(function(){return K.bell()})),K.register(K._inputHandler.onRequestRefreshRows(function(M,D){return K.refresh(M,D)})),K.register(K._inputHandler.onRequestReset(function(){return K.reset()})),K.register(K._inputHandler.onRequestScroll(function(M,D){return K.scroll(M,D||void 0)})),K.register(K._inputHandler.onRequestWindowsOptionsReport(function(M){return K._reportWindowsOptions(M)})),K.register(L.forwardEvent(K._inputHandler.onCursorMove,K._onCursorMove)),K.register(L.forwardEvent(K._inputHandler.onTitleChange,K._onTitleChange)),K.register(L.forwardEvent(K._inputHandler.onA11yChar,K._onA11yCharEmitter)),K.register(L.forwardEvent(K._inputHandler.onA11yTab,K._onA11yTabEmitter)),K.register(K._bufferService.onResize(function(M){return K._afterResize(M.cols,M.rows)})),K}return V(H,se),Object.defineProperty(H.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),H.prototype.dispose=function(){var J,K,M;this._isDisposed||(se.prototype.dispose.call(this),(J=this._renderService)===null||J===void 0||J.dispose(),this._customKeyEventHandler=void 0,this.write=function(){},(M=(K=this.element)===null||K===void 0?void 0:K.parentNode)===null||M===void 0||M.removeChild(this.element))},H.prototype._setup=function(){se.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(H.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),H.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},H.prototype._updateOptions=function(J){var K,M,D,ne;switch(se.prototype._updateOptions.call(this,J),J){case"fontFamily":case"fontSize":(K=this._renderService)===null||K===void 0||K.clear(),(M=this._charSizeService)===null||M===void 0||M.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":(D=this.viewport)===null||D===void 0||D.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new F.AccessibilityManager(this,this._renderService)):((ne=this._accessibilityManager)===null||ne===void 0||ne.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.options.theme)}},H.prototype._onTextAreaFocus=function(J){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(U.C0.ESC+"[I"),this.updateCursorStyle(J),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},H.prototype.blur=function(){var J;return(J=this.textarea)===null||J===void 0?void 0:J.blur()},H.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(U.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},H.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var J=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),K=this._bufferService.buffer.y*J,M=this._bufferService.buffer.x*this._charSizeService.width;this.textarea.style.left=M+"px",this.textarea.style.top=K+"px",this.textarea.style.width=this._charSizeService.width+"px",this.textarea.style.height=J+"px",this.textarea.style.lineHeight=J+"px",this.textarea.style.zIndex="-5"}},H.prototype._initGlobal=function(){var J=this;this._bindKeys(),this.register(l.addDisposableDomListener(this.element,"copy",function(M){J.hasSelection()&&d.copyHandler(M,J._selectionService)}));var K=function(M){return d.handlePasteEvent(M,J.textarea,J._coreService)};this.register(l.addDisposableDomListener(this.textarea,"paste",K)),this.register(l.addDisposableDomListener(this.element,"paste",K)),c.isFirefox?this.register(l.addDisposableDomListener(this.element,"mousedown",function(M){M.button===2&&d.rightClickHandler(M,J.textarea,J.screenElement,J._selectionService,J.options.rightClickSelectsWord)})):this.register(l.addDisposableDomListener(this.element,"contextmenu",function(M){d.rightClickHandler(M,J.textarea,J.screenElement,J._selectionService,J.options.rightClickSelectsWord)})),c.isLinux&&this.register(l.addDisposableDomListener(this.element,"auxclick",function(M){M.button===1&&d.moveTextAreaUnderMouseCursor(M,J.textarea,J.screenElement)}))},H.prototype._bindKeys=function(){var J=this;this.register(l.addDisposableDomListener(this.textarea,"keyup",function(K){return J._keyUp(K)},!0)),this.register(l.addDisposableDomListener(this.textarea,"keydown",function(K){return J._keyDown(K)},!0)),this.register(l.addDisposableDomListener(this.textarea,"keypress",function(K){return J._keyPress(K)},!0)),this.register(l.addDisposableDomListener(this.textarea,"compositionstart",function(){return J._compositionHelper.compositionstart()})),this.register(l.addDisposableDomListener(this.textarea,"compositionupdate",function(K){return J._compositionHelper.compositionupdate(K)})),this.register(l.addDisposableDomListener(this.textarea,"compositionend",function(){return J._compositionHelper.compositionend()})),this.register(this.onRender(function(){return J._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(K){return J._queueLinkification(K.start,K.end)}))},H.prototype.open=function(J){var K=this;if(!J)throw new Error("Terminal requires a parent element.");le.body.contains(J)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=J.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"),J.appendChild(this.element);var M=le.createDocumentFragment();this._viewportElement=le.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),M.appendChild(this._viewportElement),this._viewportScrollArea=le.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=le.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=le.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),M.appendChild(this.screenElement),this.textarea=le.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(de){return K._onTextAreaFocus(de)})),this.register(l.addDisposableDomListener(this.textarea,"blur",function(){return K._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);var D=this._instantiationService.createInstance(me.CoreBrowserService,this.textarea);this._instantiationService.setService($.ICoreBrowserService,D),this._charSizeService=this._instantiationService.createInstance(z.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService($.ICharSizeService,this._charSizeService),this._compositionView=le.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(I.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(M),this._theme=this.options.theme||this._theme,this._colorManager=new P.ColorManager(le,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(function(de){return K._colorManager.onOptionsChange(de)})),this._colorManager.setTheme(this._theme);var ne=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(O.RenderService,ne,this.rows,this.screenElement)),this._instantiationService.setService($.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange(function(de){return K._onRender.fire(de)})),this.onResize(function(de){return K._renderService.resize(de.cols,de.rows)}),this._soundService=this._instantiationService.createInstance(m.SoundService),this._instantiationService.setService($.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(ie.MouseService),this._instantiationService.setService($.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(A.Viewport,function(de,Oe){return K.scrollLines(de,Oe)},this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(function(){return K.viewport.syncScrollArea()})),this.register(this.viewport),this.register(this.onCursorMove(function(){K._renderService.onCursorMove(),K._syncTextArea()})),this.register(this.onResize(function(){return K._renderService.onResize(K.cols,K.rows)})),this.register(this.onBlur(function(){return K._renderService.onBlur()})),this.register(this.onFocus(function(){return K._renderService.onFocus()})),this.register(this._renderService.onDimensionsChange(function(){return K.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(de){return K.scrollLines(de.amount,de.suppressScrollEvent)})),this.register(this._selectionService.onSelectionChange(function(){return K._onSelectionChange.fire()})),this.register(this._selectionService.onRequestRedraw(function(de){return K._renderService.onSelectionChanged(de.start,de.end,de.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(de){K.textarea.value=de,K.textarea.focus(),K.textarea.select()})),this.register(this.onScroll(function(){K.viewport.syncScrollArea(),K._selectionService.refresh()})),this.register(l.addDisposableDomListener(this._viewportElement,"scroll",function(){return K._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(x.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return K._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(de){return K._selectionService.onMouseDown(de)})),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new F.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},H.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(k.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier,this.linkifier2);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},H.prototype._setTheme=function(J){var K,M,D;this._theme=J,(K=this._colorManager)===null||K===void 0||K.setTheme(J),(M=this._renderService)===null||M===void 0||M.setColors(this._colorManager.colors),(D=this.viewport)===null||D===void 0||D.onThemeChange(this._colorManager.colors)},H.prototype.bindMouse=function(){var J=this,K=this,M=this.element;function D(Fe){var rt,Ze,st=K._mouseService.getRawByteCoords(Fe,K.screenElement,K.cols,K.rows);if(!st)return!1;switch(Fe.overrideType||Fe.type){case"mousemove":Ze=32,Fe.buttons===void 0?(rt=3,Fe.button!==void 0&&(rt=Fe.button<3?Fe.button:3)):rt=1&Fe.buttons?0:4&Fe.buttons?1:2&Fe.buttons?2:3;break;case"mouseup":Ze=0,rt=Fe.button<3?Fe.button:3;break;case"mousedown":Ze=1,rt=Fe.button<3?Fe.button:3;break;case"wheel":Fe.deltaY!==0&&(Ze=Fe.deltaY<0?0:1),rt=4;break;default:return!1}return!(Ze===void 0||rt===void 0||rt>4)&&K._coreMouseService.triggerMouseEvent({col:st.x-33,row:st.y-33,button:rt,action:Ze,ctrl:Fe.ctrlKey,alt:Fe.altKey,shift:Fe.shiftKey})}var ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de=function(Fe){return D(Fe),Fe.buttons||(J._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&J._document.removeEventListener("mousemove",ne.mousedrag)),J.cancel(Fe)},Oe=function(Fe){return D(Fe),Fe.preventDefault(),J.cancel(Fe)},Ve=function(Fe){Fe.buttons&&D(Fe)},nt=function(Fe){Fe.buttons||D(Fe)};this.register(this._coreMouseService.onProtocolChange(function(Fe){Fe?(J.optionsService.options.logLevel==="debug"&&J._logService.debug("Binding to mouse events:",J._coreMouseService.explainEvents(Fe)),J.element.classList.add("enable-mouse-events"),J._selectionService.disable()):(J._logService.debug("Unbinding from mouse events."),J.element.classList.remove("enable-mouse-events"),J._selectionService.enable()),8&Fe?ne.mousemove||(M.addEventListener("mousemove",nt),ne.mousemove=nt):(M.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&Fe?ne.wheel||(M.addEventListener("wheel",Oe,{passive:!1}),ne.wheel=Oe):(M.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&Fe?ne.mouseup||(ne.mouseup=de):(J._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&Fe?ne.mousedrag||(ne.mousedrag=Ve):(J._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(l.addDisposableDomListener(M,"mousedown",function(Fe){if(Fe.preventDefault(),J.focus(),J._coreMouseService.areMouseEventsActive&&!J._selectionService.shouldForceSelection(Fe))return D(Fe),ne.mouseup&&J._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&J._document.addEventListener("mousemove",ne.mousedrag),J.cancel(Fe)})),this.register(l.addDisposableDomListener(M,"wheel",function(Fe){if(!ne.wheel){if(!J.buffer.hasScrollback){var rt=J.viewport.getLinesScrolled(Fe);if(rt===0)return;for(var Ze=U.C0.ESC+(J._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Fe.deltaY<0?"A":"B"),st="",At=0;At<Math.abs(rt);At++)st+=Ze;J._coreService.triggerDataEvent(st,!0)}}},{passive:!0})),this.register(l.addDisposableDomListener(M,"wheel",function(Fe){if(!ne.wheel)return J.viewport.onWheel(Fe)?void 0:J.cancel(Fe)},{passive:!1})),this.register(l.addDisposableDomListener(M,"touchstart",function(Fe){if(!J._coreMouseService.areMouseEventsActive)return J.viewport.onTouchStart(Fe),J.cancel(Fe)},{passive:!0})),this.register(l.addDisposableDomListener(M,"touchmove",function(Fe){if(!J._coreMouseService.areMouseEventsActive)return J.viewport.onTouchMove(Fe)?void 0:J.cancel(Fe)},{passive:!1}))},H.prototype.refresh=function(J,K){var M;(M=this._renderService)===null||M===void 0||M.refreshRows(J,K)},H.prototype._queueLinkification=function(J,K){var M;(M=this.linkifier)===null||M===void 0||M.linkifyRows(J,K)},H.prototype.updateCursorStyle=function(J){this._selectionService&&this._selectionService.shouldColumnSelect(J)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},H.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},H.prototype.scrollLines=function(J,K){se.prototype.scrollLines.call(this,J,K),this.refresh(0,this.rows-1)},H.prototype.paste=function(J){d.paste(J,this.textarea,this._coreService)},H.prototype.attachCustomKeyEventHandler=function(J){this._customKeyEventHandler=J},H.prototype.registerLinkMatcher=function(J,K,M){var D=this.linkifier.registerLinkMatcher(J,K,M);return this.refresh(0,this.rows-1),D},H.prototype.deregisterLinkMatcher=function(J){this.linkifier.deregisterLinkMatcher(J)&&this.refresh(0,this.rows-1)},H.prototype.registerLinkProvider=function(J){return this.linkifier2.registerLinkProvider(J)},H.prototype.registerCharacterJoiner=function(J){var K=this._renderService.registerCharacterJoiner(J);return this.refresh(0,this.rows-1),K},H.prototype.deregisterCharacterJoiner=function(J){this._renderService.deregisterCharacterJoiner(J)&&this.refresh(0,this.rows-1)},Object.defineProperty(H.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),H.prototype.addMarker=function(J){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+J)},H.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},H.prototype.select=function(J,K,M){this._selectionService.setSelection(J,K,M)},H.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},H.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]}},H.prototype.clearSelection=function(){var J;(J=this._selectionService)===null||J===void 0||J.clearSelection()},H.prototype.selectAll=function(){var J;(J=this._selectionService)===null||J===void 0||J.selectAll()},H.prototype.selectLines=function(J,K){var M;(M=this._selectionService)===null||M===void 0||M.selectLines(J,K)},H.prototype._keyDown=function(J){if(this._keyDownHandled=!1,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;if(!this._compositionHelper.keydown(J))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var K=T.evaluateKeyboardEvent(J,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(J),K.type===3||K.type===2){var M=this.rows-1;return this.scrollLines(K.type===2?-M:M),this.cancel(J,!0)}return K.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,J)||(K.cancel&&this.cancel(J,!0),!K.key||(K.key!==U.C0.ETX&&K.key!==U.C0.CR||(this.textarea.value=""),this._onKey.fire({key:K.key,domEvent:J}),this._showCursor(),this._coreService.triggerDataEvent(K.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(J,!0)))},H.prototype._isThirdLevelShift=function(J,K){var M=J.isMac&&!this.options.macOptionIsMeta&&K.altKey&&!K.ctrlKey&&!K.metaKey||J.isWindows&&K.altKey&&K.ctrlKey&&!K.metaKey;return K.type==="keypress"?M:M&&(!K.keyCode||K.keyCode>47)},H.prototype._keyUp=function(J){this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1||(function(K){return K.keyCode===16||K.keyCode===17||K.keyCode===18}(J)||this.focus(),this.updateCursorStyle(J))},H.prototype._keyPress=function(J){var K;if(this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;if(this.cancel(J),J.charCode)K=J.charCode;else if(J.which===null||J.which===void 0)K=J.keyCode;else{if(J.which===0||J.charCode===0)return!1;K=J.which}return!(!K||(J.altKey||J.ctrlKey||J.metaKey)&&!this._isThirdLevelShift(this.browser,J))&&(K=String.fromCharCode(K),this._onKey.fire({key:K,domEvent:J}),this._showCursor(),this._coreService.triggerDataEvent(K,!0),!0)},H.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},H.prototype.resize=function(J,K){J!==this.cols||K!==this.rows?se.prototype.resize.call(this,J,K):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},H.prototype._afterResize=function(J,K){var M,D;(M=this._charSizeService)===null||M===void 0||M.measure(),(D=this.viewport)===null||D===void 0||D.syncScrollArea(!0)},H.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 J=1;J<this.rows;J++)this.buffer.lines.push(this.buffer.getBlankLine(W.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},H.prototype.reset=function(){var J,K;this.options.rows=this.rows,this.options.cols=this.cols;var M=this._customKeyEventHandler;this._setup(),se.prototype.reset.call(this),(J=this._selectionService)===null||J===void 0||J.reset(),this._customKeyEventHandler=M,this.refresh(0,this.rows-1),(K=this.viewport)===null||K===void 0||K.syncScrollArea()},H.prototype._reportWindowsOptions=function(J){if(this._renderService)switch(J){case b.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:var K=this._renderService.dimensions.scaledCanvasWidth.toFixed(0),M=this._renderService.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(U.C0.ESC+"[4;"+M+";"+K+"t");break;case b.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var D=this._renderService.dimensions.scaledCellWidth.toFixed(0),ne=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(U.C0.ESC+"[6;"+ne+";"+D+"t")}},H.prototype.cancel=function(J,K){if(this.options.cancelEvents||K)return J.preventDefault(),J.stopPropagation(),!1},H.prototype._visualBell=function(){return!1},H.prototype._soundBell=function(){return this.options.bellStyle==="sound"},H}(_e.CoreTerminal);S.Terminal=Q},function(Le,S,N){"use strict";var B=this&&this.__decorate||function(U,b,n,E){var f,c=arguments.length,l=c<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,n):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(U,b,n,E);else for(var u=U.length-1;u>=0;u--)(f=U[u])&&(l=(c<3?f(l):c>3?f(b,n,l):f(b,n))||l);return c>3&&l&&Object.defineProperty(b,n,l),l},V=this&&this.__param||function(U,b){return function(n,E){b(n,E,U)}};Object.defineProperty(S,"__esModule",{value:!0}),S.CompositionHelper=void 0;var I=N(5),A=N(1),d=function(){function U(b,n,E,f,c,l){this._textarea=b,this._compositionView=n,this._bufferService=E,this._optionsService=f,this._charSizeService=c,this._coreService=l,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}return Object.defineProperty(U.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),U.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},U.prototype.compositionupdate=function(b){var n=this;this._compositionView.textContent=b.data,this.updateCompositionElements(),setTimeout(function(){n._compositionPosition.end=n._textarea.value.length},0)},U.prototype.compositionend=function(){this._finalizeComposition(!0)},U.prototype.keydown=function(b){if(this._isComposing||this._isSendingComposition){if(b.keyCode===229||b.keyCode===16||b.keyCode===17||b.keyCode===18)return!1;this._finalizeComposition(!1)}return b.keyCode!==229||(this._handleAnyTextareaChanges(),!1)},U.prototype._finalizeComposition=function(b){var n=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,b){var E={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(E.start,E.end):n._textarea.value.substring(E.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)}},U.prototype._handleAnyTextareaChanges=function(){var b=this,n=this._textarea.value;setTimeout(function(){if(!b._isComposing){var E=b._textarea.value.replace(n,"");E.length>0&&b._coreService.triggerDataEvent(E,!0)}},0)},U.prototype.updateCompositionElements=function(b){var n=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var E=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),f=this._bufferService.buffer.y*E,c=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=E+"px",this._compositionView.style.lineHeight=E+"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"}b||setTimeout(function(){return n.updateCompositionElements(!0)},0)}},U=B([V(2,A.IBufferService),V(3,A.IOptionsService),V(4,I.ICharSizeService),V(5,A.ICoreService)],U)}();S.CompositionHelper=d},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(f,c){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var m in u)u.hasOwnProperty(m)&&(l[m]=u[m])})(f,c)},function(f,c){function l(){this.constructor=f}B(f,c),f.prototype=c===null?Object.create(c):(l.prototype=c.prototype,new l)}),I=this&&this.__decorate||function(f,c,l,u){var m,x=arguments.length,F=x<3?c:u===null?u=Object.getOwnPropertyDescriptor(c,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(f,c,l,u);else for(var k=f.length-1;k>=0;k--)(m=f[k])&&(F=(x<3?m(F):x>3?m(c,l,F):m(c,l))||F);return x>3&&F&&Object.defineProperty(c,l,F),F},A=this&&this.__param||function(f,c){return function(l,u){c(l,u,f)}};Object.defineProperty(S,"__esModule",{value:!0}),S.Viewport=void 0;var d=N(2),U=N(7),b=N(5),n=N(1),E=function(f){function c(l,u,m,x,F,k,T){var L=f.call(this)||this;return L._scrollLines=l,L._viewportElement=u,L._scrollArea=m,L._bufferService=x,L._optionsService=F,L._charSizeService=k,L._renderService=T,L.scrollBarWidth=0,L._currentRowHeight=0,L._lastRecordedBufferLength=0,L._lastRecordedViewportHeight=0,L._lastRecordedBufferHeight=0,L._lastTouchY=0,L._lastScrollTop=0,L._wheelPartialScroll=0,L._refreshAnimationFrame=null,L._ignoreNextScrollEvent=!1,L.scrollBarWidth=L._viewportElement.offsetWidth-L._scrollArea.offsetWidth||15,L.register(U.addDisposableDomListener(L._viewportElement,"scroll",L._onScroll.bind(L))),setTimeout(function(){return L.syncScrollArea()},0),L}return V(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 m=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(u<0&&this._viewportElement.scrollTop!==0||u>0&&m<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 m=this._optionsService.options.fastScrollModifier;return m==="alt"&&u.altKey||m==="ctrl"&&u.ctrlKey||m==="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=I([A(3,n.IBufferService),A(4,n.IOptionsService),A(5,b.ICharSizeService),A(6,b.IRenderService)],c)}(d.Disposable);S.Viewport=E},function(Le,S,N){"use strict";function B(d){return d.replace(/\r?\n/g,"\r")}function V(d,U){return U?"\x1B[200~"+d+"\x1B[201~":d}function I(d,U,b){d=V(d=B(d),b.decPrivateModes.bracketedPasteMode),b.triggerDataEvent(d,!0),U.value=""}function A(d,U,b){var n=b.getBoundingClientRect(),E=d.clientX-n.left-10,f=d.clientY-n.top-10;U.style.width="20px",U.style.height="20px",U.style.left=E+"px",U.style.top=f+"px",U.style.zIndex="1000",U.focus()}Object.defineProperty(S,"__esModule",{value:!0}),S.rightClickHandler=S.moveTextAreaUnderMouseCursor=S.paste=S.handlePasteEvent=S.copyHandler=S.bracketTextForPaste=S.prepareTextForTerminal=void 0,S.prepareTextForTerminal=B,S.bracketTextForPaste=V,S.copyHandler=function(d,U){d.clipboardData&&d.clipboardData.setData("text/plain",U.selectionText),d.preventDefault()},S.handlePasteEvent=function(d,U,b){d.stopPropagation(),d.clipboardData&&I(d.clipboardData.getData("text/plain"),U,b)},S.paste=I,S.moveTextAreaUnderMouseCursor=A,S.rightClickHandler=function(d,U,b,n,E){A(d,U,b),E&&!n.isClickInSelection(d)&&n.selectWordAtCursor(d),U.value=n.selectionText,U.select()}},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(f,c){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var m in u)u.hasOwnProperty(m)&&(l[m]=u[m])})(f,c)},function(f,c){function l(){this.constructor=f}B(f,c),f.prototype=c===null?Object.create(c):(l.prototype=c.prototype,new l)});Object.defineProperty(S,"__esModule",{value:!0}),S.EscapeSequenceParser=S.VT500_TRANSITION_TABLE=S.TransitionTable=void 0;var I=N(2),A=N(15),d=N(21),U=N(22),b=N(24),n=function(){function f(c){this.table=new Uint8Array(c)}return f.prototype.setDefault=function(c,l){A.fill(this.table,c<<4|l)},f.prototype.add=function(c,l,u,m){this.table[l<<8|c]=u<<4|m},f.prototype.addMany=function(c,l,u,m){for(var x=0;x<c.length;x++)this.table[l<<8|c[x]]=u<<4|m},f}();S.TransitionTable=n,S.VT500_TRANSITION_TABLE=function(){var f=new n(4095),c=Array.apply(null,Array(256)).map(function(k,T){return T}),l=function(k,T){return c.slice(k,T)},u=l(32,127),m=l(0,24);m.push(25),m.push.apply(m,l(28,32));var x,F=l(0,14);for(x in f.setDefault(1,0),f.addMany(u,0,2,0),F)f.addMany([24,26,153,154],x,3,0),f.addMany(l(128,144),x,3,0),f.addMany(l(144,152),x,3,0),f.add(156,x,0,0),f.add(27,x,11,1),f.add(157,x,4,8),f.addMany([152,158,159],x,0,7),f.add(155,x,11,3),f.add(144,x,11,9);return f.addMany(m,0,3,0),f.addMany(m,1,3,1),f.add(127,1,0,1),f.addMany(m,8,0,8),f.addMany(m,3,3,3),f.add(127,3,0,3),f.addMany(m,4,3,4),f.add(127,4,0,4),f.addMany(m,6,3,6),f.addMany(m,5,3,5),f.add(127,5,0,5),f.addMany(m,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(m,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(m,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(m,11,0,11),f.addMany(l(32,128),11,0,11),f.addMany(l(28,32),11,0,11),f.addMany(m,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(m,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(m,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 E=function(f){function c(l){l===void 0&&(l=S.VT500_TRANSITION_TABLE);var u=f.call(this)||this;return u._transitions=l,u.initialState=0,u.currentState=u.initialState,u._params=new d.Params,u._params.addParam(0),u._collect=0,u.precedingCodepoint=0,u._printHandlerFb=function(m,x,F){},u._executeHandlerFb=function(m){},u._csiHandlerFb=function(m,x){},u._escHandlerFb=function(m){},u._errorHandlerFb=function(m){return m},u._printHandler=u._printHandlerFb,u._executeHandlers=Object.create(null),u._csiHandlers=Object.create(null),u._escHandlers=Object.create(null),u._oscParser=new U.OscParser,u._dcsParser=new b.DcsParser,u._errorHandler=u._errorHandlerFb,u.setEscHandler({final:"\\"},function(){}),u}return V(c,f),c.prototype._identifier=function(l,u){u===void 0&&(u=[64,126]);var m=0;if(l.prefix){if(l.prefix.length>1)throw new Error("only one byte as prefix supported");if((m=l.prefix.charCodeAt(0))&&60>m||m>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 x=0;x<l.intermediates.length;++x){var F=l.intermediates.charCodeAt(x);if(32>F||F>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");m<<=8,m|=F}}if(l.final.length!==1)throw new Error("final must be a single byte");var k=l.final.charCodeAt(0);if(u[0]>k||k>u[1])throw new Error("final must be in range "+u[0]+" .. "+u[1]);return m<<=8,m|=k},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 m=this._identifier(l,[48,126]);this._escHandlers[m]===void 0&&(this._escHandlers[m]=[]);var x=this._escHandlers[m];return x.push(u),{dispose:function(){var F=x.indexOf(u);F!==-1&&x.splice(F,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 m=this._identifier(l);this._csiHandlers[m]===void 0&&(this._csiHandlers[m]=[]);var x=this._csiHandlers[m];return x.push(u),{dispose:function(){var F=x.indexOf(u);F!==-1&&x.splice(F,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 m=0,x=0,F=this.currentState,k=this._oscParser,T=this._dcsParser,L=this._collect,W=this._params,P=this._transitions.table,O=0;O<u;++O){switch((x=P[F<<8|((m=l[O])<160?m:160)])>>4){case 2:for(var $=O+1;;++$){if($>=u||(m=l[$])<32||m>126&&m<160){this._printHandler(l,O,$),O=$-1;break}if(++$>=u||(m=l[$])<32||m>126&&m<160){this._printHandler(l,O,$),O=$-1;break}if(++$>=u||(m=l[$])<32||m>126&&m<160){this._printHandler(l,O,$),O=$-1;break}if(++$>=u||(m=l[$])<32||m>126&&m<160){this._printHandler(l,O,$),O=$-1;break}}break;case 3:this._executeHandlers[m]?this._executeHandlers[m]():this._executeHandlerFb(m),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:O,code:m,currentState:F,collect:L,params:W,abort:!1}).abort)return;break;case 7:for(var z=this._csiHandlers[L<<8|m],ie=z?z.length-1:-1;ie>=0&&z[ie](W)===!1;ie--);ie<0&&this._csiHandlerFb(L<<8|m,W),this.precedingCodepoint=0;break;case 8:do switch(m){case 59:W.addParam(0);break;case 58:W.addSubParam(-1);break;default:W.addDigit(m-48)}while(++O<u&&(m=l[O])>47&&m<60);O--;break;case 9:L<<=8,L|=m;break;case 10:for(var te=this._escHandlers[L<<8|m],me=te?te.length-1:-1;me>=0&&te[me]()===!1;me--);me<0&&this._escHandlerFb(L<<8|m),this.precedingCodepoint=0;break;case 11:W.reset(),W.addParam(0),L=0;break;case 12:T.hook(L<<8|m,W);break;case 13:for(var _e=O+1;;++_e)if(_e>=u||(m=l[_e])===24||m===26||m===27||m>127&&m<160){T.put(l,O,_e),O=_e-1;break}break;case 14:T.unhook(m!==24&&m!==26),m===27&&(x|=1),W.reset(),W.addParam(0),L=0,this.precedingCodepoint=0;break;case 4:k.start();break;case 5:for(var le=O+1;;le++)if(le>=u||(m=l[le])<32||m>127&&m<=159){k.put(l,O,le),O=le-1;break}break;case 6:k.end(m!==24&&m!==26),m===27&&(x|=1),W.reset(),W.addParam(0),L=0,this.precedingCodepoint=0}F=15&x}this._collect=L,this.currentState=F},c}(I.Disposable);S.EscapeSequenceParser=E},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(k,T){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,W){L.__proto__=W}||function(L,W){for(var P in W)W.hasOwnProperty(P)&&(L[P]=W[P])})(k,T)},function(k,T){function L(){this.constructor=k}B(k,T),k.prototype=T===null?Object.create(T):(L.prototype=T.prototype,new L)}),I=this&&this.__decorate||function(k,T,L,W){var P,O=arguments.length,$=O<3?T:W===null?W=Object.getOwnPropertyDescriptor(T,L):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(k,T,L,W);else for(var z=k.length-1;z>=0;z--)(P=k[z])&&($=(O<3?P($):O>3?P(T,L,$):P(T,L))||$);return O>3&&$&&Object.defineProperty(T,L,$),$},A=this&&this.__param||function(k,T){return function(L,W){T(L,W,k)}};Object.defineProperty(S,"__esModule",{value:!0}),S.Renderer=void 0;var d=N(41),U=N(47),b=N(48),n=N(49),E=N(29),f=N(2),c=N(5),l=N(1),u=N(25),m=N(0),x=1,F=function(k){function T(L,W,P,O,$,z,ie,te,me){var _e=k.call(this)||this;_e._colors=L,_e._screenElement=W,_e._bufferService=$,_e._charSizeService=z,_e._optionsService=ie,_e._id=x++,_e._onRequestRedraw=new m.EventEmitter;var le=_e._optionsService.options.allowTransparency;return _e._characterJoinerRegistry=new E.CharacterJoinerRegistry(_e._bufferService),_e._renderLayers=[new d.TextRenderLayer(_e._screenElement,0,_e._colors,_e._characterJoinerRegistry,le,_e._id,_e._bufferService,ie),new U.SelectionRenderLayer(_e._screenElement,1,_e._colors,_e._id,_e._bufferService,ie),new n.LinkRenderLayer(_e._screenElement,2,_e._colors,_e._id,P,O,_e._bufferService,ie),new b.CursorRenderLayer(_e._screenElement,3,_e._colors,_e._id,_e._onRequestRedraw,_e._bufferService,ie,te,me)],_e.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},_e._devicePixelRatio=window.devicePixelRatio,_e._updateDimensions(),_e.onOptionsChanged(),_e}return V(T,k),Object.defineProperty(T.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),T.prototype.dispose=function(){for(var L=0,W=this._renderLayers;L<W.length;L++)W[L].dispose();k.prototype.dispose.call(this),u.removeTerminalFromCache(this._id)},T.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},T.prototype.setColors=function(L){this._colors=L;for(var W=0,P=this._renderLayers;W<P.length;W++){var O=P[W];O.setColors(this._colors),O.reset()}},T.prototype.onResize=function(L,W){this._updateDimensions();for(var P=0,O=this._renderLayers;P<O.length;P++)O[P].resize(this.dimensions);this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},T.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},T.prototype.onBlur=function(){this._runOperation(function(L){return L.onBlur()})},T.prototype.onFocus=function(){this._runOperation(function(L){return L.onFocus()})},T.prototype.onSelectionChanged=function(L,W,P){P===void 0&&(P=!1),this._runOperation(function(O){return O.onSelectionChanged(L,W,P)})},T.prototype.onCursorMove=function(){this._runOperation(function(L){return L.onCursorMove()})},T.prototype.onOptionsChanged=function(){this._runOperation(function(L){return L.onOptionsChanged()})},T.prototype.clear=function(){this._runOperation(function(L){return L.reset()})},T.prototype._runOperation=function(L){for(var W=0,P=this._renderLayers;W<P.length;W++)L(P[W])},T.prototype.renderRows=function(L,W){for(var P=0,O=this._renderLayers;P<O.length;P++)O[P].onGridChanged(L,W)},T.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)},T.prototype.registerCharacterJoiner=function(L){return this._characterJoinerRegistry.registerCharacterJoiner(L)},T.prototype.deregisterCharacterJoiner=function(L){return this._characterJoinerRegistry.deregisterCharacterJoiner(L)},T=I([A(4,l.IBufferService),A(5,c.ICharSizeService),A(6,l.IOptionsService),A(7,l.ICoreService),A(8,c.ICoreBrowserService)],T)}(f.Disposable);S.Renderer=F},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(f,c){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var m in u)u.hasOwnProperty(m)&&(l[m]=u[m])})(f,c)},function(f,c){function l(){this.constructor=f}B(f,c),f.prototype=c===null?Object.create(c):(l.prototype=c.prototype,new l)});Object.defineProperty(S,"__esModule",{value:!0}),S.TextRenderLayer=void 0;var I=N(42),A=N(13),d=N(6),U=N(3),b=N(29),n=N(4),E=function(f){function c(l,u,m,x,F,k,T,L){var W=f.call(this,l,"text",u,F,m,k,T,L)||this;return W._characterWidth=0,W._characterFont="",W._characterOverlapCache={},W._workCell=new n.CellData,W._state=new I.GridCache,W._characterJoinerRegistry=x,W}return V(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,m,x){for(var F=l;F<=u;F++)for(var k=F+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.lines.get(k),L=m?m.getJoinedCharacters(k):[],W=0;W<this._bufferService.cols;W++){T.loadCell(W,this._workCell);var P=this._workCell,O=!1,$=W;if(P.getWidth()!==0){if(L.length>0&&W===L[0][0]){O=!0;var z=L.shift();P=new b.JoinedCellData(this._workCell,T.translateToString(!0,z[0],z[1]),z[1]-z[0]),$=z[1]-1}!O&&this._isOverlapping(P)&&$<T.length-1&&T.getCodePoint($+1)===U.NULL_CELL_CODE&&(P.content&=-12582913,P.content|=2<<22),x(P,W,F),W=$}}},c.prototype._drawBackground=function(l,u){var m=this,x=this._ctx,F=this._bufferService.cols,k=0,T=0,L=null;x.save(),this._forEachCell(l,u,null,function(W,P,O){var $=null;W.isInverse()?$=W.isFgDefault()?m._colors.foreground.css:W.isFgRGB()?"rgb("+d.AttributeData.toColorRGB(W.getFgColor()).join(",")+")":m._colors.ansi[W.getFgColor()].css:W.isBgRGB()?$="rgb("+d.AttributeData.toColorRGB(W.getBgColor()).join(",")+")":W.isBgPalette()&&($=m._colors.ansi[W.getBgColor()].css),L===null&&(k=P,T=O),O!==T?(x.fillStyle=L||"",m._fillCells(k,T,F-k,1),k=P,T=O):L!==$&&(x.fillStyle=L||"",m._fillCells(k,T,P-k,1),k=P,T=O),L=$}),L!==null&&(x.fillStyle=L,this._fillCells(k,T,F-k,1)),x.restore()},c.prototype._drawForeground=function(l,u){var m=this;this._forEachCell(l,u,this._characterJoinerRegistry,function(x,F,k){if(!x.isInvisible()&&(m._drawChars(x,F,k),x.isUnderline())){if(m._ctx.save(),x.isInverse())if(x.isBgDefault())m._ctx.fillStyle=m._colors.background.css;else if(x.isBgRGB())m._ctx.fillStyle="rgb("+d.AttributeData.toColorRGB(x.getBgColor()).join(",")+")";else{var T=x.getBgColor();m._optionsService.options.drawBoldTextInBrightColors&&x.isBold()&&T<8&&(T+=8),m._ctx.fillStyle=m._colors.ansi[T].css}else if(x.isFgDefault())m._ctx.fillStyle=m._colors.foreground.css;else if(x.isFgRGB())m._ctx.fillStyle="rgb("+d.AttributeData.toColorRGB(x.getFgColor()).join(",")+")";else{var L=x.getFgColor();m._optionsService.options.drawBoldTextInBrightColors&&x.isBold()&&L<8&&(L+=8),m._ctx.fillStyle=m._colors.ansi[L].css}m._fillBottomLineAtCells(F,k,x.getWidth()),m._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 m=Math.floor(this._ctx.measureText(u).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[u]=m,m},c}(A.BaseRenderLayer);S.TextRenderLayer=E},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.GridCache=void 0;var B=function(){function V(){this.cache=[]}return V.prototype.resize=function(I,A){for(var d=0;d<I;d++){this.cache.length<=d&&this.cache.push([]);for(var U=this.cache[d].length;U<A;U++)this.cache[d].push(void 0);this.cache[d].length=A}this.cache.length=I},V.prototype.clear=function(){for(var I=0;I<this.cache.length;I++)for(var A=0;A<this.cache[I].length;A++)this.cache[I][A]=void 0},V}();S.GridCache=B},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(m,x){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,k){F.__proto__=k}||function(F,k){for(var T in k)k.hasOwnProperty(T)&&(F[T]=k[T])})(m,x)},function(m,x){function F(){this.constructor=m}B(m,x),m.prototype=x===null?Object.create(x):(F.prototype=x.prototype,new F)});Object.defineProperty(S,"__esModule",{value:!0}),S.NoneCharAtlas=S.DynamicCharAtlas=S.getGlyphCacheKey=void 0;var I=N(9),A=N(44),d=N(27),U=N(46),b=N(11),n=N(28),E=N(10),f={css:"rgba(0, 0, 0, 0)",rgba:0};function c(m){return m.code<<21|m.bg<<12|m.fg<<3|(m.bold?0:4)+(m.dim?0:2)+(m.italic?0:1)}S.getGlyphCacheKey=c;var l=function(m){function x(F,k){var T=m.call(this)||this;T._config=k,T._drawToCacheCount=0,T._glyphsWaitingOnBitmap=[],T._bitmapCommitTimeout=null,T._bitmap=null,T._cacheCanvas=F.createElement("canvas"),T._cacheCanvas.width=1024,T._cacheCanvas.height=1024,T._cacheCtx=n.throwIfFalsy(T._cacheCanvas.getContext("2d",{alpha:!0}));var L=F.createElement("canvas");L.width=T._config.scaledCharWidth,L.height=T._config.scaledCharHeight,T._tmpCtx=n.throwIfFalsy(L.getContext("2d",{alpha:T._config.allowTransparency})),T._width=Math.floor(1024/T._config.scaledCharWidth),T._height=Math.floor(1024/T._config.scaledCharHeight);var W=T._width*T._height;return T._cacheMap=new U.LRUMap(W),T._cacheMap.prealloc(W),T}return V(x,m),x.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},x.prototype.beginFrame=function(){this._drawToCacheCount=0},x.prototype.draw=function(F,k,T,L){if(k.code===32)return!0;if(!this._canCache(k))return!1;var W=c(k),P=this._cacheMap.get(W);if(P!=null)return this._drawFromCache(F,P,T,L),!0;if(this._drawToCacheCount<100){var O=void 0;O=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var $=this._drawToCache(k,O);return this._cacheMap.set(W,$),this._drawFromCache(F,$,T,L),!0}return!1},x.prototype._canCache=function(F){return F.code<256},x.prototype._toCoordinateX=function(F){return F%this._width*this._config.scaledCharWidth},x.prototype._toCoordinateY=function(F){return Math.floor(F/this._width)*this._config.scaledCharHeight},x.prototype._drawFromCache=function(F,k,T,L){if(!k.isEmpty){var W=this._toCoordinateX(k.index),P=this._toCoordinateY(k.index);F.drawImage(k.inBitmap?this._bitmap:this._cacheCanvas,W,P,this._config.scaledCharWidth,this._config.scaledCharHeight,T,L,this._config.scaledCharWidth,this._config.scaledCharHeight)}},x.prototype._getColorFromAnsiIndex=function(F){return F<this._config.colors.ansi.length?this._config.colors.ansi[F]:d.DEFAULT_ANSI_COLORS[F]},x.prototype._getBackgroundColor=function(F){return this._config.allowTransparency?f:F.bg===I.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:F.bg<256?this._getColorFromAnsiIndex(F.bg):this._config.colors.background},x.prototype._getForegroundColor=function(F){return F.fg===I.INVERTED_DEFAULT_COLOR?E.color.opaque(this._config.colors.background):F.fg<256?this._getColorFromAnsiIndex(F.fg):this._config.colors.foreground},x.prototype._drawToCache=function(F,k){this._drawToCacheCount++,this._tmpCtx.save();var T=this._getBackgroundColor(F);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=T.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var L=F.bold?this._config.fontWeightBold:this._config.fontWeight,W=F.italic?"italic":"";this._tmpCtx.font=W+" "+L+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(F).css,F.dim&&(this._tmpCtx.globalAlpha=I.DIM_OPACITY),this._tmpCtx.fillText(F.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var P=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),O=!1;this._config.allowTransparency||(O=function(te,me){for(var _e=!0,le=me.rgba>>>24,Q=me.rgba>>>16&255,se=me.rgba>>>8&255,H=0;H<te.data.length;H+=4)te.data[H]===le&&te.data[H+1]===Q&&te.data[H+2]===se?te.data[H+3]=0:_e=!1;return _e}(P,T));var $=this._toCoordinateX(k),z=this._toCoordinateY(k);this._cacheCtx.putImageData(P,$,z);var ie={index:k,isEmpty:O,inBitmap:!1};return this._addGlyphToBitmap(ie),ie},x.prototype._addGlyphToBitmap=function(F){var k=this;!("createImageBitmap"in window)||b.isFirefox||b.isSafari||(this._glyphsWaitingOnBitmap.push(F),this._bitmapCommitTimeout===null&&(this._bitmapCommitTimeout=window.setTimeout(function(){return k._generateBitmap()},100)))},x.prototype._generateBitmap=function(){var F=this,k=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(T){F._bitmap=T;for(var L=0;L<k.length;L++)k[L].inBitmap=!0}),this._bitmapCommitTimeout=null},x}(A.BaseCharAtlas);S.DynamicCharAtlas=l;var u=function(m){function x(F,k){return m.call(this)||this}return V(x,m),x.prototype.draw=function(F,k,T,L){return!1},x}(A.BaseCharAtlas);S.NoneCharAtlas=u},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.BaseCharAtlas=void 0;var B=function(){function V(){this._didWarmUp=!1}return V.prototype.dispose=function(){},V.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},V.prototype._doWarmUp=function(){},V.prototype.beginFrame=function(){},V}();S.BaseCharAtlas=B},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.ColorContrastCache=void 0;var B=function(){function V(){this._color={},this._rgba={}}return V.prototype.clear=function(){this._color={},this._rgba={}},V.prototype.setCss=function(I,A,d){this._rgba[I]||(this._rgba[I]={}),this._rgba[I][A]=d},V.prototype.getCss=function(I,A){return this._rgba[I]?this._rgba[I][A]:void 0},V.prototype.setColor=function(I,A,d){this._color[I]||(this._color[I]={}),this._color[I][A]=d},V.prototype.getColor=function(I,A){return this._color[I]?this._color[I][A]:void 0},V}();S.ColorContrastCache=B},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.LRUMap=void 0;var B=function(){function V(I){this.capacity=I,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return V.prototype._unlinkNode=function(I){var A=I.prev,d=I.next;I===this._head&&(this._head=d),I===this._tail&&(this._tail=A),A!==null&&(A.next=d),d!==null&&(d.prev=A)},V.prototype._appendNode=function(I){var A=this._tail;A!==null&&(A.next=I),I.prev=A,I.next=null,this._tail=I,this._head===null&&(this._head=I)},V.prototype.prealloc=function(I){for(var A=this._nodePool,d=0;d<I;d++)A.push({prev:null,next:null,key:null,value:null})},V.prototype.get=function(I){var A=this._map[I];return A!==void 0?(this._unlinkNode(A),this._appendNode(A),A.value):null},V.prototype.peekValue=function(I){var A=this._map[I];return A!==void 0?A.value:null},V.prototype.peek=function(){var I=this._head;return I===null?null:I.value},V.prototype.set=function(I,A){var d=this._map[I];if(d!==void 0)d=this._map[I],this._unlinkNode(d),d.value=A;else if(this.size>=this.capacity)d=this._head,this._unlinkNode(d),delete this._map[d.key],d.key=I,d.value=A,this._map[I]=d;else{var U=this._nodePool;U.length>0?((d=U.pop()).key=I,d.value=A):d={prev:null,next:null,key:I,value:A},this._map[I]=d,this.size++}this._appendNode(d)},V}();S.LRUMap=B},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(A,d){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,b){U.__proto__=b}||function(U,b){for(var n in b)b.hasOwnProperty(n)&&(U[n]=b[n])})(A,d)},function(A,d){function U(){this.constructor=A}B(A,d),A.prototype=d===null?Object.create(d):(U.prototype=d.prototype,new U)});Object.defineProperty(S,"__esModule",{value:!0}),S.SelectionRenderLayer=void 0;var I=function(A){function d(U,b,n,E,f,c){var l=A.call(this,U,"selection",b,!0,n,E,f,c)||this;return l._clearState(),l}return V(d,A),d.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},d.prototype.resize=function(U){A.prototype.resize.call(this,U),this._clearState()},d.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},d.prototype.onSelectionChanged=function(U,b,n){if(this._didStateChange(U,b,n,this._bufferService.buffer.ydisp))if(this._clearAll(),U&&b){var E=U[1]-this._bufferService.buffer.ydisp,f=b[1]-this._bufferService.buffer.ydisp,c=Math.max(E,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=U[0],m=b[0]-u,x=l-c+1;this._fillCells(u,c,m,x)}else{u=E===c?U[0]:0;var F=c===l?b[0]:this._bufferService.cols;this._fillCells(u,c,F-u,1);var k=Math.max(l-c-1,0);if(this._fillCells(0,c+1,this._bufferService.cols,k),c!==l){var T=f===l?b[0]:this._bufferService.cols;this._fillCells(0,l,T,1)}}this._state.start=[U[0],U[1]],this._state.end=[b[0],b[1]],this._state.columnSelectMode=n,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},d.prototype._didStateChange=function(U,b,n,E){return!this._areCoordinatesEqual(U,this._state.start)||!this._areCoordinatesEqual(b,this._state.end)||n!==this._state.columnSelectMode||E!==this._state.ydisp},d.prototype._areCoordinatesEqual=function(U,b){return!(!U||!b)&&U[0]===b[0]&&U[1]===b[1]},d}(N(13).BaseRenderLayer);S.SelectionRenderLayer=I},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(b,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,f){E.__proto__=f}||function(E,f){for(var c in f)f.hasOwnProperty(c)&&(E[c]=f[c])})(b,n)},function(b,n){function E(){this.constructor=b}B(b,n),b.prototype=n===null?Object.create(n):(E.prototype=n.prototype,new E)});Object.defineProperty(S,"__esModule",{value:!0}),S.CursorRenderLayer=void 0;var I=N(13),A=N(4),d=function(b){function n(E,f,c,l,u,m,x,F,k){var T=b.call(this,E,"cursor",f,!0,c,l,m,x)||this;return T._onRequestRedraw=u,T._coreService=F,T._coreBrowserService=k,T._cell=new A.CellData,T._state={x:0,y:0,isFocused:!1,style:"",width:0},T._cursorRenderers={bar:T._renderBarCursor.bind(T),block:T._renderBlockCursor.bind(T),underline:T._renderUnderlineCursor.bind(T)},T}return V(n,b),n.prototype.resize=function(E){b.prototype.resize.call(this,E),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 E,f=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new U(this._coreBrowserService.isFocused,function(){f._render(!0)})):((E=this._cursorBlinkStateManager)===null||E===void 0||E.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(E,f){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},n.prototype._render=function(E){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(E,f,c){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(E,f,this._optionsService.options.cursorWidth),this._ctx.restore()},n.prototype._renderBlockCursor=function(E,f,c){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(E,f,c.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(c,E,f),this._ctx.restore()},n.prototype._renderUnderlineCursor=function(E,f,c){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(E,f),this._ctx.restore()},n.prototype._renderBlurCursor=function(E,f,c){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(E,f,c.getWidth(),1),this._ctx.restore()},n}(I.BaseRenderLayer);S.CursorRenderLayer=d;var U=function(){function b(n,E){this._renderCallback=E,this.isCursorVisible=!0,n&&this._restartInterval()}return Object.defineProperty(b.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),b.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)},b.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})))},b.prototype._restartInterval=function(n){var E=this;n===void 0&&(n=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(E._animationTimeRestarted){var f=600-(Date.now()-E._animationTimeRestarted);if(E._animationTimeRestarted=void 0,f>0)return void E._restartInterval(f)}E.isCursorVisible=!1,E._animationFrame=window.requestAnimationFrame(function(){E._renderCallback(),E._animationFrame=void 0}),E._blinkInterval=window.setInterval(function(){if(E._animationTimeRestarted){var c=600-(Date.now()-E._animationTimeRestarted);return E._animationTimeRestarted=void 0,void E._restartInterval(c)}E.isCursorVisible=!E.isCursorVisible,E._animationFrame=window.requestAnimationFrame(function(){E._renderCallback(),E._animationFrame=void 0})},600)},n)},b.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)},b.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},b}()},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(b,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,f){E.__proto__=f}||function(E,f){for(var c in f)f.hasOwnProperty(c)&&(E[c]=f[c])})(b,n)},function(b,n){function E(){this.constructor=b}B(b,n),b.prototype=n===null?Object.create(n):(E.prototype=n.prototype,new E)});Object.defineProperty(S,"__esModule",{value:!0}),S.LinkRenderLayer=void 0;var I=N(13),A=N(9),d=N(26),U=function(b){function n(E,f,c,l,u,m,x,F){var k=b.call(this,E,"link",f,!0,c,l,x,F)||this;return u.onShowLinkUnderline(function(T){return k._onShowLinkUnderline(T)}),u.onHideLinkUnderline(function(T){return k._onHideLinkUnderline(T)}),m.onShowLinkUnderline(function(T){return k._onShowLinkUnderline(T)}),m.onHideLinkUnderline(function(T){return k._onHideLinkUnderline(T)}),k}return V(n,b),n.prototype.resize=function(E){b.prototype.resize.call(this,E),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 E=this._state.y2-this._state.y1-1;E>0&&this._clearCells(0,this._state.y1+1,this._state.cols,E),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},n.prototype._onShowLinkUnderline=function(E){if(E.fg===A.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:E.fg&&d.is256Color(E.fg)?this._ctx.fillStyle=this._colors.ansi[E.fg].css:this._ctx.fillStyle=this._colors.foreground.css,E.y1===E.y2)this._fillBottomLineAtCells(E.x1,E.y1,E.x2-E.x1);else{this._fillBottomLineAtCells(E.x1,E.y1,E.cols-E.x1);for(var f=E.y1+1;f<E.y2;f++)this._fillBottomLineAtCells(0,f,E.cols);this._fillBottomLineAtCells(0,E.y2,E.x2)}this._state=E},n.prototype._onHideLinkUnderline=function(E){this._clearCurrentLink()},n}(I.BaseRenderLayer);S.LinkRenderLayer=U},function(Le,S,N){"use strict";var B=this&&this.__decorate||function(b,n,E,f){var c,l=arguments.length,u=l<3?n:f===null?f=Object.getOwnPropertyDescriptor(n,E):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(b,n,E,f);else for(var m=b.length-1;m>=0;m--)(c=b[m])&&(u=(l<3?c(u):l>3?c(n,E,u):c(n,E))||u);return l>3&&u&&Object.defineProperty(n,E,u),u},V=this&&this.__param||function(b,n){return function(E,f){n(E,f,b)}};Object.defineProperty(S,"__esModule",{value:!0}),S.MouseZone=S.Linkifier=void 0;var I=N(0),A=N(1),d=function(){function b(n,E,f){this._bufferService=n,this._logService=E,this._unicodeService=f,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new I.EventEmitter,this._onHideLinkUnderline=new I.EventEmitter,this._onLinkTooltip=new I.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(b.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),b.prototype.attachToDom=function(n,E){this._element=n,this._mouseZoneManager=E},b.prototype.linkifyRows=function(n,E){var f=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=n,this._rowsToLinkify.end=E):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,n),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,E)),this._mouseZoneManager.clearAll(n,E),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return f._linkifyRows()},b._timeBeforeLatency))},b.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var n=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var E=n.ydisp+this._rowsToLinkify.start;if(!(E>=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,E,f,c,c);l.hasNext();)for(var u=l.next(),m=0;m<this._linkMatchers.length;m++)this._doLinkifyRow(u.range.first,u.content,this._linkMatchers[m]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},b.prototype.registerLinkMatcher=function(n,E,f){if(f===void 0&&(f={}),!E)throw new Error("handler must be defined");var c={id:this._nextLinkMatcherId++,regex:n,handler:E,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},b.prototype._addLinkMatcherToList=function(n){if(this._linkMatchers.length!==0){for(var E=this._linkMatchers.length-1;E>=0;E--)if(n.priority<=this._linkMatchers[E].priority)return void this._linkMatchers.splice(E+1,0,n);this._linkMatchers.splice(0,0,n)}else this._linkMatchers.push(n)},b.prototype.deregisterLinkMatcher=function(n){for(var E=0;E<this._linkMatchers.length;E++)if(this._linkMatchers[E].id===n)return this._linkMatchers.splice(E,1),!0;return!1},b.prototype._doLinkifyRow=function(n,E,f){for(var c,l=this,u=new RegExp(f.regex.source,(f.regex.flags||"")+"g"),m=-1,x=function(){var k=c[typeof f.matchIndex!="number"?0:f.matchIndex];if(!k)return F._logService.debug("match found without corresponding matchIndex",c,f),"break";if(m=E.indexOf(k,m+1),u.lastIndex=m+k.length,m<0)return"break";var T=F._bufferService.buffer.stringIndexToBufferIndex(n,m);if(T[0]<0)return"break";var L=F._bufferService.buffer.lines.get(T[0]);if(!L)return"break";var W=L.getFg(T[1]),P=W?W>>9&511:void 0;f.validationCallback?f.validationCallback(k,function(O){l._rowsTimeoutId||O&&l._addLink(T[1],T[0]-l._bufferService.buffer.ydisp,k,f,P)}):F._addLink(T[1],T[0]-F._bufferService.buffer.ydisp,k,f,P)},F=this;(c=u.exec(E))!==null&&x()!=="break";);},b.prototype._addLink=function(n,E,f,c,l){var u=this;if(this._mouseZoneManager&&this._element){var m=this._unicodeService.getStringCellWidth(f),x=n%this._bufferService.cols,F=E+Math.floor(n/this._bufferService.cols),k=(x+m)%this._bufferService.cols,T=F+Math.floor((x+m)/this._bufferService.cols);k===0&&(k=this._bufferService.cols,T--),this._mouseZoneManager.add(new U(x+1,F+1,k+1,T+1,function(L){if(c.handler)return c.handler(L,f);var W=window.open();W?(W.opener=null,W.location.href=f):console.warn("Opening link blocked as opener could not be cleared")},function(){u._onShowLinkUnderline.fire(u._createLinkHoverEvent(x,F,k,T,l)),u._element.classList.add("xterm-cursor-pointer")},function(L){u._onLinkTooltip.fire(u._createLinkHoverEvent(x,F,k,T,l)),c.hoverTooltipCallback&&c.hoverTooltipCallback(L,f,{start:{x,y:F},end:{x:k,y:T}})},function(){u._onHideLinkUnderline.fire(u._createLinkHoverEvent(x,F,k,T,l)),u._element.classList.remove("xterm-cursor-pointer"),c.hoverLeaveCallback&&c.hoverLeaveCallback()},function(L){return!c.willLinkActivate||c.willLinkActivate(L,f)}))}},b.prototype._createLinkHoverEvent=function(n,E,f,c,l){return{x1:n,y1:E,x2:f,y2:c,cols:this._bufferService.cols,fg:l}},b._timeBeforeLatency=200,b=B([V(0,A.IBufferService),V(1,A.ILogService),V(2,A.IUnicodeService)],b)}();S.Linkifier=d;var U=function(b,n,E,f,c,l,u,m,x){this.x1=b,this.y1=n,this.x2=E,this.y2=f,this.clickCallback=c,this.hoverCallback=l,this.tooltipCallback=u,this.leaveCallback=m,this.willLinkActivate=x};S.MouseZone=U},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(k,T){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,W){L.__proto__=W}||function(L,W){for(var P in W)W.hasOwnProperty(P)&&(L[P]=W[P])})(k,T)},function(k,T){function L(){this.constructor=k}B(k,T),k.prototype=T===null?Object.create(T):(L.prototype=T.prototype,new L)}),I=this&&this.__decorate||function(k,T,L,W){var P,O=arguments.length,$=O<3?T:W===null?W=Object.getOwnPropertyDescriptor(T,L):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(k,T,L,W);else for(var z=k.length-1;z>=0;z--)(P=k[z])&&($=(O<3?P($):O>3?P(T,L,$):P(T,L))||$);return O>3&&$&&Object.defineProperty(T,L,$),$},A=this&&this.__param||function(k,T){return function(L,W){T(L,W,k)}};Object.defineProperty(S,"__esModule",{value:!0}),S.SelectionService=void 0;var d=N(11),U=N(52),b=N(4),n=N(0),E=N(5),f=N(1),c=N(30),l=N(53),u=N(2),m="\xA0",x=new RegExp(m,"g"),F=function(k){function T(L,W,P,O,$,z,ie){var te=k.call(this)||this;return te._element=L,te._screenElement=W,te._bufferService=P,te._coreService=O,te._mouseService=$,te._optionsService=z,te._renderService=ie,te._dragScrollAmount=0,te._enabled=!0,te._workCell=new b.CellData,te._mouseDownTimeStamp=0,te._onLinuxMouseSelection=te.register(new n.EventEmitter),te._onRedrawRequest=te.register(new n.EventEmitter),te._onSelectionChange=te.register(new n.EventEmitter),te._onRequestScrollLines=te.register(new n.EventEmitter),te._mouseMoveListener=function(me){return te._onMouseMove(me)},te._mouseUpListener=function(me){return te._onMouseUp(me)},te._coreService.onUserInput(function(){te.hasSelection&&te.clearSelection()}),te._trimListener=te._bufferService.buffer.lines.onTrim(function(me){return te._onTrim(me)}),te.register(te._bufferService.buffers.onBufferActivate(function(me){return te._onBufferActivate(me)})),te.enable(),te._model=new U.SelectionModel(te._bufferService),te._activeSelectionMode=0,te}return V(T,k),Object.defineProperty(T.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),T.prototype.dispose=function(){this._removeMouseDownListeners()},T.prototype.reset=function(){this.clearSelection()},T.prototype.disable=function(){this.clearSelection(),this._enabled=!1},T.prototype.enable=function(){this._enabled=!0},Object.defineProperty(T.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"hasSelection",{get:function(){var L=this._model.finalSelectionStart,W=this._model.finalSelectionEnd;return!(!L||!W)&&(L[0]!==W[0]||L[1]!==W[1])},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"selectionText",{get:function(){var L=this._model.finalSelectionStart,W=this._model.finalSelectionEnd;if(!L||!W)return"";var P=this._bufferService.buffer,O=[];if(this._activeSelectionMode===3){if(L[0]===W[0])return"";for(var $=L[1];$<=W[1];$++){var z=P.translateBufferLineToString($,!0,L[0],W[0]);O.push(z)}}else{var ie=L[1]===W[1]?W[0]:void 0;for(O.push(P.translateBufferLineToString(L[1],!0,L[0],ie)),$=L[1]+1;$<=W[1]-1;$++){var te=P.lines.get($);z=P.translateBufferLineToString($,!0),te&&te.isWrapped?O[O.length-1]+=z:O.push(z)}L[1]!==W[1]&&(te=P.lines.get(W[1]),z=P.translateBufferLineToString(W[1],!0,0,W[0]),te&&te.isWrapped?O[O.length-1]+=z:O.push(z))}return O.map(function(me){return me.replace(x," ")}).join(d.isWindows?`\r
|
|
|
`:`
|
|
|
`)},enumerable:!1,configurable:!0}),T.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},T.prototype.refresh=function(L){var W=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return W._refresh()})),d.isLinux&&L&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},T.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})},T.prototype.isClickInSelection=function(L){var W=this._getMouseBufferCoords(L),P=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!!(P&&O&&W)&&this._areCoordsInSelection(W,P,O)},T.prototype._areCoordsInSelection=function(L,W,P){return L[1]>W[1]&&L[1]<P[1]||W[1]===P[1]&&L[1]===W[1]&&L[0]>=W[0]&&L[0]<P[0]||W[1]<P[1]&&L[1]===P[1]&&L[0]<P[0]||W[1]<P[1]&&L[1]===W[1]&&L[0]>=W[0]},T.prototype.selectWordAtCursor=function(L){var W=this._getMouseBufferCoords(L);W&&(this._selectWordAt(W,!1),this._model.selectionEnd=void 0,this.refresh(!0))},T.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},T.prototype.selectLines=function(L,W){this._model.clearSelection(),L=Math.max(L,0),W=Math.min(W,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,L],this._model.selectionEnd=[this._bufferService.cols,W],this.refresh(),this._onSelectionChange.fire()},T.prototype._onTrim=function(L){this._model.onTrim(L)&&this.refresh()},T.prototype._getMouseBufferCoords=function(L){var W=this._mouseService.getCoords(L,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(W)return W[0]--,W[1]--,W[1]+=this._bufferService.buffer.ydisp,W},T.prototype._getMouseEventScrollAmount=function(L){var W=c.getCoordsRelativeToElement(L,this._screenElement)[1],P=this._renderService.dimensions.canvasHeight;return W>=0&&W<=P?0:(W>P&&(W-=P),W=Math.min(Math.max(W,-50),50),(W/=50)/Math.abs(W)+Math.round(14*W))},T.prototype.shouldForceSelection=function(L){return d.isMac?L.altKey&&this._optionsService.options.macOptionClickForcesSelection:L.shiftKey},T.prototype.onMouseDown=function(L){if(this._mouseDownTimeStamp=L.timeStamp,(L.button!==2||!this.hasSelection)&&L.button===0){if(!this._enabled){if(!this.shouldForceSelection(L))return;L.stopPropagation()}L.preventDefault(),this._dragScrollAmount=0,this._enabled&&L.shiftKey?this._onIncrementalClick(L):L.detail===1?this._onSingleClick(L):L.detail===2?this._onDoubleClick(L):L.detail===3&&this._onTripleClick(L),this._addMouseDownListeners(),this.refresh(!0)}},T.prototype._addMouseDownListeners=function(){var L=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return L._dragScroll()},50)},T.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},T.prototype._onIncrementalClick=function(L){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(L))},T.prototype._onSingleClick=function(L){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(L)?3:0,this._model.selectionStart=this._getMouseBufferCoords(L),this._model.selectionStart){this._model.selectionEnd=void 0;var W=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);W&&W.length!==this._model.selectionStart[0]&&W.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},T.prototype._onDoubleClick=function(L){var W=this._getMouseBufferCoords(L);W&&(this._activeSelectionMode=1,this._selectWordAt(W,!0))},T.prototype._onTripleClick=function(L){var W=this._getMouseBufferCoords(L);W&&(this._activeSelectionMode=2,this._selectLineAt(W[1]))},T.prototype.shouldColumnSelect=function(L){return L.altKey&&!(d.isMac&&this._optionsService.options.macOptionClickForcesSelection)},T.prototype._onMouseMove=function(L){if(L.stopImmediatePropagation(),this._model.selectionStart){var W=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(L),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(L),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var P=this._bufferService.buffer;if(this._model.selectionEnd[1]<P.lines.length){var O=P.lines.get(this._model.selectionEnd[1]);O&&O.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}W&&W[0]===this._model.selectionEnd[0]&&W[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}},T.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});var L=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(L.ydisp+this._bufferService.rows,L.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=L.ydisp),this.refresh()}},T.prototype._onMouseUp=function(L){var W=L.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&W<500&&L.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var P=this._mouseService.getCoords(L,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(P&&P[0]!==void 0&&P[1]!==void 0){var O=l.moveToCellSequence(P[0]-1,P[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(O,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},T.prototype._onBufferActivate=function(L){var W=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=L.activeBuffer.lines.onTrim(function(P){return W._onTrim(P)})},T.prototype._convertViewportColToCharacterIndex=function(L,W){for(var P=W[0],O=0;W[0]>=O;O++){var $=L.loadCell(O,this._workCell).getChars().length;this._workCell.getWidth()===0?P--:$>1&&W[0]!==O&&(P+=$-1)}return P},T.prototype.setSelection=function(L,W,P){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[L,W],this._model.selectionStartLength=P,this.refresh()},T.prototype._getWordAt=function(L,W,P,O){if(P===void 0&&(P=!0),O===void 0&&(O=!0),!(L[0]>=this._bufferService.cols)){var $=this._bufferService.buffer,z=$.lines.get(L[1]);if(z){var ie=$.translateBufferLineToString(L[1],!1),te=this._convertViewportColToCharacterIndex(z,L),me=te,_e=L[0]-te,le=0,Q=0,se=0,H=0;if(ie.charAt(te)===" "){for(;te>0&&ie.charAt(te-1)===" ";)te--;for(;me<ie.length&&ie.charAt(me+1)===" ";)me++}else{var J=L[0],K=L[0];z.getWidth(J)===0&&(le++,J--),z.getWidth(K)===2&&(Q++,K++);var M=z.getString(K).length;for(M>1&&(H+=M-1,me+=M-1);J>0&&te>0&&!this._isCharWordSeparator(z.loadCell(J-1,this._workCell));){z.loadCell(J-1,this._workCell);var D=this._workCell.getChars().length;this._workCell.getWidth()===0?(le++,J--):D>1&&(se+=D-1,te-=D-1),te--,J--}for(;K<z.length&&me+1<ie.length&&!this._isCharWordSeparator(z.loadCell(K+1,this._workCell));){z.loadCell(K+1,this._workCell);var ne=this._workCell.getChars().length;this._workCell.getWidth()===2?(Q++,K++):ne>1&&(H+=ne-1,me+=ne-1),me++,K++}}me++;var de=te+_e-le+se,Oe=Math.min(this._bufferService.cols,me-te+le+Q-se-H);if(W||ie.slice(te,me).trim()!==""){if(P&&de===0&&z.getCodePoint(0)!==32){var Ve=$.lines.get(L[1]-1);if(Ve&&z.isWrapped&&Ve.getCodePoint(this._bufferService.cols-1)!==32){var nt=this._getWordAt([this._bufferService.cols-1,L[1]-1],!1,!0,!1);if(nt){var Fe=this._bufferService.cols-nt.start;de-=Fe,Oe+=Fe}}}if(O&&de+Oe===this._bufferService.cols&&z.getCodePoint(this._bufferService.cols-1)!==32){var rt=$.lines.get(L[1]+1);if(rt&&rt.isWrapped&&rt.getCodePoint(0)!==32){var Ze=this._getWordAt([0,L[1]+1],!1,!1,!0);Ze&&(Oe+=Ze.length)}}return{start:de,length:Oe}}}}},T.prototype._selectWordAt=function(L,W){var P=this._getWordAt(L,W);if(P){for(;P.start<0;)P.start+=this._bufferService.cols,L[1]--;this._model.selectionStart=[P.start,L[1]],this._model.selectionStartLength=P.length}},T.prototype._selectToWordAt=function(L){var W=this._getWordAt(L,!0);if(W){for(var P=L[1];W.start<0;)W.start+=this._bufferService.cols,P--;if(!this._model.areSelectionValuesReversed())for(;W.start+W.length>this._bufferService.cols;)W.length-=this._bufferService.cols,P++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?W.start:W.start+W.length,P]}},T.prototype._isCharWordSeparator=function(L){return L.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(L.getChars())>=0},T.prototype._selectLineAt=function(L){var W=this._bufferService.buffer.getWrappedRangeForLine(L);this._model.selectionStart=[0,W.first],this._model.selectionEnd=[this._bufferService.cols,W.last],this._model.selectionStartLength=0},T=I([A(2,f.IBufferService),A(3,f.ICoreService),A(4,E.IMouseService),A(5,f.IOptionsService),A(6,E.IRenderService)],T)}(u.Disposable);S.SelectionService=F},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.SelectionModel=void 0;var B=function(){function V(I){this._bufferService=I,this.isSelectAllActive=!1,this.selectionStartLength=0}return V.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(V.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(V.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 I=this.selectionStart[0]+this.selectionStartLength;return I>this._bufferService.cols?[I%this._bufferService.cols,this.selectionStart[1]+Math.floor(I/this._bufferService.cols)]:[I,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}),V.prototype.areSelectionValuesReversed=function(){var I=this.selectionStart,A=this.selectionEnd;return!(!I||!A)&&(I[1]>A[1]||I[1]===A[1]&&I[0]>A[0])},V.prototype.onTrim=function(I){return this.selectionStart&&(this.selectionStart[1]-=I),this.selectionEnd&&(this.selectionEnd[1]-=I),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},V}();S.SelectionModel=B},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.moveToCellSequence=void 0;var B=N(12);function V(n,E,f,c){var l=n-I(f,n),u=E-I(f,E);return b(Math.abs(l-u)-function(m,x,F){for(var k=0,T=m-I(F,m),L=x-I(F,x),W=0;W<Math.abs(T-L);W++){var P=A(m,x)==="A"?-1:1,O=F.buffer.lines.get(T+P*W);O&&O.isWrapped&&k++}return k}(n,E,f),U(A(n,E),c))}function I(n,E){for(var f=0,c=n.buffer.lines.get(E),l=c&&c.isWrapped;l&&E>=0&&E<n.rows;)f++,l=(c=n.buffer.lines.get(--E))&&c.isWrapped;return f}function A(n,E){return n>E?"A":"B"}function d(n,E,f,c,l,u){for(var m=n,x=E,F="";m!==f||x!==c;)m+=l?1:-1,l&&m>u.cols-1?(F+=u.buffer.translateBufferLineToString(x,!1,n,m),m=0,n=0,x++):!l&&m<0&&(F+=u.buffer.translateBufferLineToString(x,!1,0,n+1),n=m=u.cols-1,x--);return F+u.buffer.translateBufferLineToString(x,!1,n,m)}function U(n,E){var f=E?"O":"[";return B.C0.ESC+f+n}function b(n,E){n=Math.floor(n);for(var f="",c=0;c<n;c++)f+=E;return f}S.moveToCellSequence=function(n,E,f,c){var l,u=f.buffer.x,m=f.buffer.y;if(!f.buffer.hasScrollback)return function(F,k,T,L,W,P){return V(k,L,W,P).length===0?"":b(d(F,k,F,k-I(W,k),!1,W).length,U("D",P))}(u,m,0,E,f,c)+V(m,E,f,c)+function(F,k,T,L,W,P){var O;O=V(k,L,W,P).length>0?L-I(W,L):k;var $=L,z=function(ie,te,me,_e,le,Q){var se;return se=V(me,_e,le,Q).length>0?_e-I(le,_e):te,ie<me&&se<=_e||ie>=me&&se<_e?"C":"D"}(F,k,T,L,W,P);return b(d(F,O,T,$,z==="C",W).length,U(z,P))}(u,m,n,E,f,c);if(m===E)return l=u>n?"D":"C",b(Math.abs(u-n),U(l,c));l=m>E?"D":"C";var x=Math.abs(m-E);return b(function(F,k){return k.cols-F}(m>E?n:u,f)+(x-1)*f.cols+1+((m>E?u:n)-1),U(l,c))}},function(Le,S,N){"use strict";var B=this&&this.__decorate||function(d,U,b,n){var E,f=arguments.length,c=f<3?U:n===null?n=Object.getOwnPropertyDescriptor(U,b):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(d,U,b,n);else for(var l=d.length-1;l>=0;l--)(E=d[l])&&(c=(f<3?E(c):f>3?E(U,b,c):E(U,b))||c);return f>3&&c&&Object.defineProperty(U,b,c),c},V=this&&this.__param||function(d,U){return function(b,n){U(b,n,d)}};Object.defineProperty(S,"__esModule",{value:!0}),S.SoundService=void 0;var I=N(1),A=function(){function d(U){this._optionsService=U}return Object.defineProperty(d,"audioContext",{get:function(){if(!d._audioContext){var U=window.AudioContext||window.webkitAudioContext;if(!U)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;d._audioContext=new U}return d._audioContext},enumerable:!1,configurable:!0}),d.prototype.playBellSound=function(){var U=d.audioContext;if(U){var b=U.createBufferSource();U.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(n){b.buffer=n,b.connect(U.destination),b.start(0)})}},d.prototype._base64ToArrayBuffer=function(U){for(var b=window.atob(U),n=b.length,E=new Uint8Array(n),f=0;f<n;f++)E[f]=b.charCodeAt(f);return E.buffer},d.prototype._removeMimeType=function(U){return U.split(",")[1]},d=B([V(0,I.IOptionsService)],d)}();S.SoundService=A},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(f,c){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var m in u)u.hasOwnProperty(m)&&(l[m]=u[m])})(f,c)},function(f,c){function l(){this.constructor=f}B(f,c),f.prototype=c===null?Object.create(c):(l.prototype=c.prototype,new l)}),I=this&&this.__decorate||function(f,c,l,u){var m,x=arguments.length,F=x<3?c:u===null?u=Object.getOwnPropertyDescriptor(c,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(f,c,l,u);else for(var k=f.length-1;k>=0;k--)(m=f[k])&&(F=(x<3?m(F):x>3?m(c,l,F):m(c,l))||F);return x>3&&F&&Object.defineProperty(c,l,F),F},A=this&&this.__param||function(f,c){return function(l,u){c(l,u,f)}};Object.defineProperty(S,"__esModule",{value:!0}),S.MouseZoneManager=void 0;var d=N(2),U=N(7),b=N(5),n=N(1),E=function(f){function c(l,u,m,x,F,k){var T=f.call(this)||this;return T._element=l,T._screenElement=u,T._bufferService=m,T._mouseService=x,T._selectionService=F,T._optionsService=k,T._zones=[],T._areZonesActive=!1,T._lastHoverCoords=[void 0,void 0],T._initialSelectionLength=0,T.register(U.addDisposableDomListener(T._element,"mousedown",function(L){return T._onMouseDown(L)})),T._mouseMoveListener=function(L){return T._onMouseMove(L)},T._mouseLeaveListener=function(L){return T._onMouseLeave(L)},T._clickListener=function(L){return T._onClick(L)},T}return V(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 m=0;m<this._zones.length;m++){var x=this._zones[m];(x.y1>l&&x.y1<=u+1||x.y2>l&&x.y2<=u+1||x.y1<l&&x.y2>u+1)&&(this._currentZone&&this._currentZone===x&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(m--,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,m=this._findZoneEventAt(l);m!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),m&&(this._currentZone=m,m.hoverCallback&&m.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),m=this._getSelectionLength();u&&m===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 m=u[0],x=u[1],F=0;F<this._zones.length;F++){var k=this._zones[F];if(k.y1===k.y2){if(x===k.y1&&m>=k.x1&&m<k.x2)return k}else if(x===k.y1&&m>=k.x1||x===k.y2&&m<k.x2||x>k.y1&&x<k.y2)return k}},c=I([A(2,n.IBufferService),A(3,b.IMouseService),A(4,b.ISelectionService),A(5,n.IOptionsService)],c)}(d.Disposable);S.MouseZoneManager=E},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(c,l){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,m){u.__proto__=m}||function(u,m){for(var x in m)m.hasOwnProperty(x)&&(u[x]=m[x])})(c,l)},function(c,l){function u(){this.constructor=c}B(c,l),c.prototype=l===null?Object.create(l):(u.prototype=l.prototype,new u)});Object.defineProperty(S,"__esModule",{value:!0}),S.AccessibilityManager=void 0;var I=N(18),A=N(11),d=N(31),U=N(7),b=N(2),n=N(32),E=N(17),f=function(c){function l(u,m){var x=c.call(this)||this;x._terminal=u,x._renderService=m,x._liveRegionLineCount=0,x._charsToConsume=[],x._charsToAnnounce="",x._accessibilityTreeRoot=document.createElement("div"),x._accessibilityTreeRoot.classList.add("xterm-accessibility"),x._rowContainer=document.createElement("div"),x._rowContainer.classList.add("xterm-accessibility-tree"),x._rowContainer.setAttribute("role","list"),x._rowElements=[];for(var F=0;F<x._terminal.rows;F++)x._rowElements[F]=x._createAccessibilityTreeNode(),x._rowContainer.appendChild(x._rowElements[F]);if(x._topBoundaryFocusListener=function(k){return x._onBoundaryFocus(k,0)},x._bottomBoundaryFocusListener=function(k){return x._onBoundaryFocus(k,1)},x._rowElements[0].addEventListener("focus",x._topBoundaryFocusListener),x._rowElements[x._rowElements.length-1].addEventListener("focus",x._bottomBoundaryFocusListener),x._refreshRowsDimensions(),x._accessibilityTreeRoot.appendChild(x._rowContainer),x._renderRowsDebouncer=new d.RenderDebouncer(x._renderRows.bind(x)),x._refreshRows(),x._liveRegion=document.createElement("div"),x._liveRegion.classList.add("live-region"),x._liveRegion.setAttribute("aria-live","assertive"),x._accessibilityTreeRoot.appendChild(x._liveRegion),!x._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return x._terminal.element.insertAdjacentElement("afterbegin",x._accessibilityTreeRoot),x.register(x._renderRowsDebouncer),x.register(x._terminal.onResize(function(k){return x._onResize(k.rows)})),x.register(x._terminal.onRender(function(k){return x._refreshRows(k.start,k.end)})),x.register(x._terminal.onScroll(function(){return x._refreshRows()})),x.register(x._terminal.onA11yChar(function(k){return x._onChar(k)})),x.register(x._terminal.onLineFeed(function(){return x._onChar(`
|
|
|
`)})),x.register(x._terminal.onA11yTab(function(k){return x._onTab(k)})),x.register(x._terminal.onKey(function(k){return x._onKey(k.key)})),x.register(x._terminal.onBlur(function(){return x._clearLiveRegion()})),x.register(x._renderService.onDimensionsChange(function(){return x._refreshRowsDimensions()})),x._screenDprMonitor=new n.ScreenDprMonitor,x.register(x._screenDprMonitor),x._screenDprMonitor.setListener(function(){return x._refreshRowsDimensions()}),x.register(U.addDisposableDomListener(window,"resize",function(){return x._refreshRowsDimensions()})),x}return V(l,c),l.prototype.dispose=function(){c.prototype.dispose.call(this),E.removeElementFromParent(this._accessibilityTreeRoot),this._rowElements.length=0},l.prototype._onBoundaryFocus=function(u,m){var x=u.target,F=this._rowElements[m===0?1:this._rowElements.length-2];if(x.getAttribute("aria-posinset")!==(m===0?"1":""+this._terminal.buffer.lines.length)&&u.relatedTarget===F){var k,T;if(m===0?(k=x,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(k=this._rowElements.shift(),T=x,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),m===0){var L=this._createAccessibilityTreeNode();this._rowElements.unshift(L),this._rowContainer.insertAdjacentElement("afterbegin",L)}else L=this._createAccessibilityTreeNode(),this._rowElements.push(L),this._rowContainer.appendChild(L);this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(m===0?-1:1),this._rowElements[m===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 m=this._rowContainer.children.length;m<this._terminal.rows;m++)this._rowElements[m]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[m]);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 m=0;m<u;m++)this._onChar(" ")},l.prototype._onChar=function(u){var m=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+=I.tooMuchOutput)),A.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){m._accessibilityTreeRoot.appendChild(m._liveRegion)},0))},l.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,A.isMac&&E.removeElementFromParent(this._liveRegion)},l.prototype._onKey=function(u){this._clearLiveRegion(),this._charsToConsume.push(u)},l.prototype._refreshRows=function(u,m){this._renderRowsDebouncer.refresh(u,m,this._terminal.rows)},l.prototype._renderRows=function(u,m){for(var x=this._terminal.buffer,F=x.lines.length.toString(),k=u;k<=m;k++){var T=x.translateBufferLineToString(x.ydisp+k,!0),L=(x.ydisp+k+1).toString(),W=this._rowElements[k];W&&(T.length===0?W.innerHTML=" ":W.textContent=T,W.setAttribute("aria-posinset",L),W.setAttribute("aria-setsize",F))}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}(b.Disposable);S.AccessibilityManager=f},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(x,F){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,T){k.__proto__=T}||function(k,T){for(var L in T)T.hasOwnProperty(L)&&(k[L]=T[L])})(x,F)},function(x,F){function k(){this.constructor=x}B(x,F),x.prototype=F===null?Object.create(F):(k.prototype=F.prototype,new k)}),I=this&&this.__decorate||function(x,F,k,T){var L,W=arguments.length,P=W<3?F:T===null?T=Object.getOwnPropertyDescriptor(F,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(x,F,k,T);else for(var O=x.length-1;O>=0;O--)(L=x[O])&&(P=(W<3?L(P):W>3?L(F,k,P):L(F,k))||P);return W>3&&P&&Object.defineProperty(F,k,P),P},A=this&&this.__param||function(x,F){return function(k,T){F(k,T,x)}};Object.defineProperty(S,"__esModule",{value:!0}),S.DomRenderer=void 0;var d=N(58),U=N(9),b=N(2),n=N(5),E=N(1),f=N(0),c=N(10),l=N(17),u=1,m=function(x){function F(k,T,L,W,P,O,$,z,ie){var te=x.call(this)||this;return te._colors=k,te._element=T,te._screenElement=L,te._viewportElement=W,te._linkifier=P,te._linkifier2=O,te._charSizeService=$,te._optionsService=z,te._bufferService=ie,te._terminalClass=u++,te._rowElements=[],te._rowContainer=document.createElement("div"),te._rowContainer.classList.add("xterm-rows"),te._rowContainer.style.lineHeight="normal",te._rowContainer.setAttribute("aria-hidden","true"),te._refreshRowElements(te._bufferService.cols,te._bufferService.rows),te._selectionContainer=document.createElement("div"),te._selectionContainer.classList.add("xterm-selection"),te._selectionContainer.setAttribute("aria-hidden","true"),te.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},te._updateDimensions(),te._injectCss(),te._rowFactory=new d.DomRendererRowFactory(document,te._optionsService,te._colors),te._element.classList.add("xterm-dom-renderer-owner-"+te._terminalClass),te._screenElement.appendChild(te._rowContainer),te._screenElement.appendChild(te._selectionContainer),te._linkifier.onShowLinkUnderline(function(me){return te._onLinkHover(me)}),te._linkifier.onHideLinkUnderline(function(me){return te._onLinkLeave(me)}),te._linkifier2.onShowLinkUnderline(function(me){return te._onLinkHover(me)}),te._linkifier2.onHideLinkUnderline(function(me){return te._onLinkLeave(me)}),te}return V(F,x),Object.defineProperty(F.prototype,"onRequestRedraw",{get:function(){return new f.EventEmitter().event},enumerable:!1,configurable:!0}),F.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),l.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),x.prototype.dispose.call(this)},F.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 k=0,T=this._rowElements;k<T.length;k++){var L=T[k];L.style.width=this.dimensions.canvasWidth+"px",L.style.height=this.dimensions.actualCellHeight+"px",L.style.lineHeight=this.dimensions.actualCellHeight+"px",L.style.overflow="hidden"}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var W=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=W,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},F.prototype.setColors=function(k){this._colors=k,this._injectCss()},F.prototype._injectCss=function(){var k=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var T=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";T+=this._terminalSelector+" span:not(."+d.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+d.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+d.ITALIC_CLASS+" { font-style: italic;}",T+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",T+="@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+"; }}",T+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+d.CURSOR_CLASS+"."+d.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+d.CURSOR_CLASS+"."+d.CURSOR_BLINK_CLASS+":not(."+d.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+d.CURSOR_CLASS+"."+d.CURSOR_BLINK_CLASS+"."+d.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+d.CURSOR_CLASS+"."+d.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+d.CURSOR_CLASS+"."+d.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+d.CURSOR_CLASS+"."+d.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",T+=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(L,W){T+=k._terminalSelector+" .xterm-fg-"+W+" { color: "+L.css+"; }"+k._terminalSelector+" .xterm-bg-"+W+" { background-color: "+L.css+"; }"}),T+=this._terminalSelector+" .xterm-fg-"+U.INVERTED_DEFAULT_COLOR+" { color: "+c.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+U.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=T},F.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},F.prototype._refreshRowElements=function(k,T){for(var L=this._rowElements.length;L<=T;L++){var W=document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>T;)this._rowContainer.removeChild(this._rowElements.pop())},F.prototype.onResize=function(k,T){this._refreshRowElements(k,T),this._updateDimensions()},F.prototype.onCharSizeChanged=function(){this._updateDimensions()},F.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},F.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},F.prototype.onSelectionChanged=function(k,T,L){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(k&&T){var W=k[1]-this._bufferService.buffer.ydisp,P=T[1]-this._bufferService.buffer.ydisp,O=Math.max(W,0),$=Math.min(P,this._bufferService.rows-1);if(!(O>=this._bufferService.rows||$<0)){var z=document.createDocumentFragment();if(L)z.appendChild(this._createSelectionElement(O,k[0],T[0],$-O+1));else{var ie=W===O?k[0]:0,te=O===$?T[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(O,ie,te));var me=$-O-1;if(z.appendChild(this._createSelectionElement(O+1,0,this._bufferService.cols,me)),O!==$){var _e=P===$?T[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement($,0,_e))}}this._selectionContainer.appendChild(z)}}},F.prototype._createSelectionElement=function(k,T,L,W){W===void 0&&(W=1);var P=document.createElement("div");return P.style.height=W*this.dimensions.actualCellHeight+"px",P.style.top=k*this.dimensions.actualCellHeight+"px",P.style.left=T*this.dimensions.actualCellWidth+"px",P.style.width=this.dimensions.actualCellWidth*(L-T)+"px",P},F.prototype.onCursorMove=function(){},F.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},F.prototype.clear=function(){for(var k=0,T=this._rowElements;k<T.length;k++)T[k].innerHTML=""},F.prototype.renderRows=function(k,T){for(var L=this._bufferService.buffer.ybase+this._bufferService.buffer.y,W=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),P=this._optionsService.options.cursorBlink,O=k;O<=T;O++){var $=this._rowElements[O];$.innerHTML="";var z=O+this._bufferService.buffer.ydisp,ie=this._bufferService.buffer.lines.get(z),te=this._optionsService.options.cursorStyle;$.appendChild(this._rowFactory.createRow(ie,z===L,te,W,P,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(F.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),F.prototype.registerCharacterJoiner=function(k){return-1},F.prototype.deregisterCharacterJoiner=function(k){return!1},F.prototype._onLinkHover=function(k){this._setCellUnderline(k.x1,k.x2,k.y1,k.y2,k.cols,!0)},F.prototype._onLinkLeave=function(k){this._setCellUnderline(k.x1,k.x2,k.y1,k.y2,k.cols,!1)},F.prototype._setCellUnderline=function(k,T,L,W,P,O){for(;k!==T||L!==W;){var $=this._rowElements[L];if(!$)return;var z=$.children[k];z&&(z.style.textDecoration=O?"underline":"none"),++k>=P&&(k=0,L++)}},F=I([A(6,n.ICharSizeService),A(7,E.IOptionsService),A(8,E.IBufferService)],F)}(b.Disposable);S.DomRenderer=m},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.DomRendererRowFactory=S.CURSOR_STYLE_UNDERLINE_CLASS=S.CURSOR_STYLE_BAR_CLASS=S.CURSOR_STYLE_BLOCK_CLASS=S.CURSOR_BLINK_CLASS=S.CURSOR_CLASS=S.UNDERLINE_CLASS=S.ITALIC_CLASS=S.DIM_CLASS=S.BOLD_CLASS=void 0;var B=N(9),V=N(3),I=N(4),A=N(10);S.BOLD_CLASS="xterm-bold",S.DIM_CLASS="xterm-dim",S.ITALIC_CLASS="xterm-italic",S.UNDERLINE_CLASS="xterm-underline",S.CURSOR_CLASS="xterm-cursor",S.CURSOR_BLINK_CLASS="xterm-cursor-blink",S.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",S.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",S.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var d=function(){function b(n,E,f){this._document=n,this._optionsService=E,this._colors=f,this._workCell=new I.CellData}return b.prototype.setColors=function(n){this._colors=n},b.prototype.createRow=function(n,E,f,c,l,u,m){for(var x=this._document.createDocumentFragment(),F=0,k=Math.min(n.length,m)-1;k>=0;k--)if(n.loadCell(k,this._workCell).getCode()!==V.NULL_CELL_CODE||E&&k===c){F=k+1;break}for(k=0;k<F;k++){n.loadCell(k,this._workCell);var T=this._workCell.getWidth();if(T!==0){var L=this._document.createElement("span");if(T>1&&(L.style.width=u*T+"px"),E&&k===c)switch(L.classList.add(S.CURSOR_CLASS),l&&L.classList.add(S.CURSOR_BLINK_CLASS),f){case"bar":L.classList.add(S.CURSOR_STYLE_BAR_CLASS);break;case"underline":L.classList.add(S.CURSOR_STYLE_UNDERLINE_CLASS);break;default:L.classList.add(S.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&L.classList.add(S.BOLD_CLASS),this._workCell.isItalic()&&L.classList.add(S.ITALIC_CLASS),this._workCell.isDim()&&L.classList.add(S.DIM_CLASS),this._workCell.isUnderline()&&L.classList.add(S.UNDERLINE_CLASS),this._workCell.isInvisible()?L.textContent=V.WHITESPACE_CELL_CHAR:L.textContent=this._workCell.getChars()||V.WHITESPACE_CELL_CHAR;var W=this._workCell.getFgColor(),P=this._workCell.getFgColorMode(),O=this._workCell.getBgColor(),$=this._workCell.getBgColorMode(),z=!!this._workCell.isInverse();if(z){var ie=W;W=O,O=ie;var te=P;P=$,$=te}switch(P){case 16777216:case 33554432:this._workCell.isBold()&&W<8&&this._optionsService.options.drawBoldTextInBrightColors&&(W+=8),this._applyMinimumContrast(L,this._colors.background,this._colors.ansi[W])||L.classList.add("xterm-fg-"+W);break;case 50331648:var me=A.rgba.toColor(W>>16&255,W>>8&255,255&W);this._applyMinimumContrast(L,this._colors.background,me)||this._addStyle(L,"color:#"+U(W.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(L,this._colors.background,this._colors.foreground)||z&&L.classList.add("xterm-fg-"+B.INVERTED_DEFAULT_COLOR)}switch($){case 16777216:case 33554432:L.classList.add("xterm-bg-"+O);break;case 50331648:this._addStyle(L,"background-color:#"+U(O.toString(16),"0",6));break;case 0:default:z&&L.classList.add("xterm-bg-"+B.INVERTED_DEFAULT_COLOR)}x.appendChild(L)}}return x},b.prototype._applyMinimumContrast=function(n,E,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=A.color.ensureContrastRatio(E,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)},b.prototype._addStyle=function(n,E){n.setAttribute("style",""+(n.getAttribute("style")||"")+E+";")},b}();function U(b,n,E){for(;b.length<E;)b=n+b;return b}S.DomRendererRowFactory=d},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.evaluateKeyboardEvent=void 0;var B=N(12),V={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:["'",'"']};S.evaluateKeyboardEvent=function(I,A,d,U){var b={type:0,cancel:!1,key:void 0},n=(I.shiftKey?1:0)|(I.altKey?2:0)|(I.ctrlKey?4:0)|(I.metaKey?8:0);switch(I.keyCode){case 0:I.key==="UIKeyInputUpArrow"?b.key=A?B.C0.ESC+"OA":B.C0.ESC+"[A":I.key==="UIKeyInputLeftArrow"?b.key=A?B.C0.ESC+"OD":B.C0.ESC+"[D":I.key==="UIKeyInputRightArrow"?b.key=A?B.C0.ESC+"OC":B.C0.ESC+"[C":I.key==="UIKeyInputDownArrow"&&(b.key=A?B.C0.ESC+"OB":B.C0.ESC+"[B");break;case 8:if(I.shiftKey){b.key=B.C0.BS;break}if(I.altKey){b.key=B.C0.ESC+B.C0.DEL;break}b.key=B.C0.DEL;break;case 9:if(I.shiftKey){b.key=B.C0.ESC+"[Z";break}b.key=B.C0.HT,b.cancel=!0;break;case 13:b.key=I.altKey?B.C0.ESC+B.C0.CR:B.C0.CR,b.cancel=!0;break;case 27:b.key=B.C0.ESC,I.altKey&&(b.key=B.C0.ESC+B.C0.ESC),b.cancel=!0;break;case 37:if(I.metaKey)break;n?(b.key=B.C0.ESC+"[1;"+(n+1)+"D",b.key===B.C0.ESC+"[1;3D"&&(b.key=B.C0.ESC+(d?"b":"[1;5D"))):b.key=A?B.C0.ESC+"OD":B.C0.ESC+"[D";break;case 39:if(I.metaKey)break;n?(b.key=B.C0.ESC+"[1;"+(n+1)+"C",b.key===B.C0.ESC+"[1;3C"&&(b.key=B.C0.ESC+(d?"f":"[1;5C"))):b.key=A?B.C0.ESC+"OC":B.C0.ESC+"[C";break;case 38:if(I.metaKey)break;n?(b.key=B.C0.ESC+"[1;"+(n+1)+"A",d||b.key!==B.C0.ESC+"[1;3A"||(b.key=B.C0.ESC+"[1;5A")):b.key=A?B.C0.ESC+"OA":B.C0.ESC+"[A";break;case 40:if(I.metaKey)break;n?(b.key=B.C0.ESC+"[1;"+(n+1)+"B",d||b.key!==B.C0.ESC+"[1;3B"||(b.key=B.C0.ESC+"[1;5B")):b.key=A?B.C0.ESC+"OB":B.C0.ESC+"[B";break;case 45:I.shiftKey||I.ctrlKey||(b.key=B.C0.ESC+"[2~");break;case 46:b.key=n?B.C0.ESC+"[3;"+(n+1)+"~":B.C0.ESC+"[3~";break;case 36:b.key=n?B.C0.ESC+"[1;"+(n+1)+"H":A?B.C0.ESC+"OH":B.C0.ESC+"[H";break;case 35:b.key=n?B.C0.ESC+"[1;"+(n+1)+"F":A?B.C0.ESC+"OF":B.C0.ESC+"[F";break;case 33:I.shiftKey?b.type=2:b.key=B.C0.ESC+"[5~";break;case 34:I.shiftKey?b.type=3:b.key=B.C0.ESC+"[6~";break;case 112:b.key=n?B.C0.ESC+"[1;"+(n+1)+"P":B.C0.ESC+"OP";break;case 113:b.key=n?B.C0.ESC+"[1;"+(n+1)+"Q":B.C0.ESC+"OQ";break;case 114:b.key=n?B.C0.ESC+"[1;"+(n+1)+"R":B.C0.ESC+"OR";break;case 115:b.key=n?B.C0.ESC+"[1;"+(n+1)+"S":B.C0.ESC+"OS";break;case 116:b.key=n?B.C0.ESC+"[15;"+(n+1)+"~":B.C0.ESC+"[15~";break;case 117:b.key=n?B.C0.ESC+"[17;"+(n+1)+"~":B.C0.ESC+"[17~";break;case 118:b.key=n?B.C0.ESC+"[18;"+(n+1)+"~":B.C0.ESC+"[18~";break;case 119:b.key=n?B.C0.ESC+"[19;"+(n+1)+"~":B.C0.ESC+"[19~";break;case 120:b.key=n?B.C0.ESC+"[20;"+(n+1)+"~":B.C0.ESC+"[20~";break;case 121:b.key=n?B.C0.ESC+"[21;"+(n+1)+"~":B.C0.ESC+"[21~";break;case 122:b.key=n?B.C0.ESC+"[23;"+(n+1)+"~":B.C0.ESC+"[23~";break;case 123:b.key=n?B.C0.ESC+"[24;"+(n+1)+"~":B.C0.ESC+"[24~";break;default:if(!I.ctrlKey||I.shiftKey||I.altKey||I.metaKey)if(d&&!U||!I.altKey||I.metaKey)d&&!I.altKey&&!I.ctrlKey&&I.metaKey?I.keyCode===65&&(b.type=1):I.key&&!I.ctrlKey&&!I.altKey&&!I.metaKey&&I.keyCode>=48&&I.key.length===1?b.key=I.key:I.key&&I.ctrlKey&&I.key==="_"&&(b.key=B.C0.US);else{var E=V[I.keyCode],f=E&&E[I.shiftKey?1:0];if(f)b.key=B.C0.ESC+f;else if(I.keyCode>=65&&I.keyCode<=90){var c=I.ctrlKey?I.keyCode-64:I.keyCode+32;b.key=B.C0.ESC+String.fromCharCode(c)}}else I.keyCode>=65&&I.keyCode<=90?b.key=String.fromCharCode(I.keyCode-64):I.keyCode===32?b.key=B.C0.NUL:I.keyCode>=51&&I.keyCode<=55?b.key=String.fromCharCode(I.keyCode-51+27):I.keyCode===56?b.key=B.C0.DEL:I.keyCode===219?b.key=B.C0.ESC:I.keyCode===220?b.key=B.C0.FS:I.keyCode===221&&(b.key=B.C0.GS)}return b}},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(u,m){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,F){x.__proto__=F}||function(x,F){for(var k in F)F.hasOwnProperty(k)&&(x[k]=F[k])})(u,m)},function(u,m){function x(){this.constructor=u}B(u,m),u.prototype=m===null?Object.create(m):(x.prototype=m.prototype,new x)}),I=this&&this.__decorate||function(u,m,x,F){var k,T=arguments.length,L=T<3?m:F===null?F=Object.getOwnPropertyDescriptor(m,x):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(u,m,x,F);else for(var W=u.length-1;W>=0;W--)(k=u[W])&&(L=(T<3?k(L):T>3?k(m,x,L):k(m,x))||L);return T>3&&L&&Object.defineProperty(m,x,L),L},A=this&&this.__param||function(u,m){return function(x,F){m(x,F,u)}};Object.defineProperty(S,"__esModule",{value:!0}),S.RenderService=void 0;var d=N(31),U=N(0),b=N(2),n=N(32),E=N(7),f=N(1),c=N(5),l=function(u){function m(x,F,k,T,L,W){var P=u.call(this)||this;if(P._renderer=x,P._rowCount=F,P._isPaused=!1,P._needsFullRefresh=!1,P._isNextRenderRedrawOnly=!0,P._needsSelectionRefresh=!1,P._canvasWidth=0,P._canvasHeight=0,P._selectionState={start:void 0,end:void 0,columnSelectMode:!1},P._onDimensionsChange=new U.EventEmitter,P._onRender=new U.EventEmitter,P._onRefreshRequest=new U.EventEmitter,P.register({dispose:function(){return P._renderer.dispose()}}),P._renderDebouncer=new d.RenderDebouncer(function($,z){return P._renderRows($,z)}),P.register(P._renderDebouncer),P._screenDprMonitor=new n.ScreenDprMonitor,P._screenDprMonitor.setListener(function(){return P.onDevicePixelRatioChange()}),P.register(P._screenDprMonitor),P.register(W.onResize(function($){return P._fullRefresh()})),P.register(T.onOptionChange(function(){return P._renderer.onOptionsChanged()})),P.register(L.onCharSizeChange(function(){return P.onCharSizeChanged()})),P._renderer.onRequestRedraw(function($){return P.refreshRows($.start,$.end,!0)}),P.register(E.addDisposableDomListener(window,"resize",function(){return P.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var O=new IntersectionObserver(function($){return P._onIntersectionChange($[$.length-1])},{threshold:0});O.observe(k),P.register({dispose:function(){return O.disconnect()}})}return P}return V(m,u),Object.defineProperty(m.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),m.prototype._onIntersectionChange=function(x){this._isPaused=x.intersectionRatio===0,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},m.prototype.refreshRows=function(x,F,k){k===void 0&&(k=!1),this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(x,F,this._rowCount))},m.prototype._renderRows=function(x,F){this._renderer.renderRows(x,F),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:x,end:F}),this._isNextRenderRedrawOnly=!0},m.prototype.resize=function(x,F){this._rowCount=F,this._fireOnCanvasResize()},m.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},m.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},m.prototype.dispose=function(){u.prototype.dispose.call(this)},m.prototype.setRenderer=function(x){var F=this;this._renderer.dispose(),this._renderer=x,this._renderer.onRequestRedraw(function(k){return F.refreshRows(k.start,k.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},m.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},m.prototype.setColors=function(x){this._renderer.setColors(x),this._fullRefresh()},m.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},m.prototype.onResize=function(x,F){this._renderer.onResize(x,F),this._fullRefresh()},m.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},m.prototype.onBlur=function(){this._renderer.onBlur()},m.prototype.onFocus=function(){this._renderer.onFocus()},m.prototype.onSelectionChanged=function(x,F,k){this._selectionState.start=x,this._selectionState.end=F,this._selectionState.columnSelectMode=k,this._renderer.onSelectionChanged(x,F,k)},m.prototype.onCursorMove=function(){this._renderer.onCursorMove()},m.prototype.clear=function(){this._renderer.clear()},m.prototype.registerCharacterJoiner=function(x){return this._renderer.registerCharacterJoiner(x)},m.prototype.deregisterCharacterJoiner=function(x){return this._renderer.deregisterCharacterJoiner(x)},m=I([A(3,f.IOptionsService),A(4,c.ICharSizeService),A(5,f.IBufferService)],m)}(b.Disposable);S.RenderService=l},function(Le,S,N){"use strict";var B=this&&this.__decorate||function(b,n,E,f){var c,l=arguments.length,u=l<3?n:f===null?f=Object.getOwnPropertyDescriptor(n,E):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(b,n,E,f);else for(var m=b.length-1;m>=0;m--)(c=b[m])&&(u=(l<3?c(u):l>3?c(n,E,u):c(n,E))||u);return l>3&&u&&Object.defineProperty(n,E,u),u},V=this&&this.__param||function(b,n){return function(E,f){n(E,f,b)}};Object.defineProperty(S,"__esModule",{value:!0}),S.CharSizeService=void 0;var I=N(1),A=N(0),d=function(){function b(n,E,f){this._optionsService=f,this.width=0,this.height=0,this._onCharSizeChange=new A.EventEmitter,this._measureStrategy=new U(n,E,this._optionsService)}return Object.defineProperty(b.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),b.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())},b=B([V(2,I.IOptionsService)],b)}();S.CharSizeService=d;var U=function(){function b(n,E,f){this._document=n,this._parentElement=E,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 b.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},b}()},function(Le,S,N){"use strict";var B=this&&this.__decorate||function(U,b,n,E){var f,c=arguments.length,l=c<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,n):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(U,b,n,E);else for(var u=U.length-1;u>=0;u--)(f=U[u])&&(l=(c<3?f(l):c>3?f(b,n,l):f(b,n))||l);return c>3&&l&&Object.defineProperty(b,n,l),l},V=this&&this.__param||function(U,b){return function(n,E){b(n,E,U)}};Object.defineProperty(S,"__esModule",{value:!0}),S.MouseService=void 0;var I=N(5),A=N(30),d=function(){function U(b,n){this._renderService=b,this._charSizeService=n}return U.prototype.getCoords=function(b,n,E,f,c){return A.getCoords(b,n,E,f,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,c)},U.prototype.getRawByteCoords=function(b,n,E,f){var c=this.getCoords(b,n,E,f);return A.getRawByteCoords(c)},U=B([V(0,I.IRenderService),V(1,I.ICharSizeService)],U)}();S.MouseService=d},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(f,c){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var m in u)u.hasOwnProperty(m)&&(l[m]=u[m])})(f,c)},function(f,c){function l(){this.constructor=f}B(f,c),f.prototype=c===null?Object.create(c):(l.prototype=c.prototype,new l)}),I=this&&this.__decorate||function(f,c,l,u){var m,x=arguments.length,F=x<3?c:u===null?u=Object.getOwnPropertyDescriptor(c,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(f,c,l,u);else for(var k=f.length-1;k>=0;k--)(m=f[k])&&(F=(x<3?m(F):x>3?m(c,l,F):m(c,l))||F);return x>3&&F&&Object.defineProperty(c,l,F),F},A=this&&this.__param||function(f,c){return function(l,u){c(l,u,f)}};Object.defineProperty(S,"__esModule",{value:!0}),S.Linkifier2=void 0;var d=N(1),U=N(0),b=N(2),n=N(7),E=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 U.EventEmitter),u._onHideLinkUnderline=u.register(new U.EventEmitter),u.register(b.getDisposeArrayDisposable(u._linkCacheDisposables)),u}return V(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 m=u._linkProviders.indexOf(l);m!==-1&&u._linkProviders.splice(m,1)}}},c.prototype.attachToDom=function(l,u,m){var x=this;this._element=l,this._mouseService=u,this._renderService=m,this.register(n.addDisposableDomListener(this._element,"mouseleave",function(){x._isMouseOut=!0,x._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 m=l.composedPath(),x=0;x<m.length;x++){var F=m[x];if(F.classList.contains("xterm"))break;if(F.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 m=this;this._activeProviderReplies&&u||(this._activeProviderReplies=new Map,this._activeLine=l.y);var x=!1;this._linkProviders.forEach(function(F,k){var T;u?!((T=m._activeProviderReplies)===null||T===void 0)&&T.get(k)&&(x=m._checkLinkProviderResult(k,l,x)):F.provideLinks(l.y,function(L){var W,P;if(!m._isMouseOut){var O=L==null?void 0:L.map(function($){return{link:$}});(W=m._activeProviderReplies)===null||W===void 0||W.set(k,O),x=m._checkLinkProviderResult(k,l,x),((P=m._activeProviderReplies)===null||P===void 0?void 0:P.size)===m._linkProviders.length&&m._removeIntersectingLinks(l.y,m._activeProviderReplies)}})})},c.prototype._removeIntersectingLinks=function(l,u){for(var m=new Set,x=0;x<u.size;x++){var F=u.get(x);if(F)for(var k=0;k<F.length;k++)for(var T=F[k],L=T.link.range.start.y<l?0:T.link.range.start.x,W=T.link.range.end.y>l?this._bufferService.cols:T.link.range.end.x,P=L;P<=W;P++){if(m.has(P)){F.splice(k--,1);break}m.add(P)}}},c.prototype._checkLinkProviderResult=function(l,u,m){var x,F=this;if(!this._activeProviderReplies)return m;for(var k=this._activeProviderReplies.get(l),T=!1,L=0;L<l;L++)this._activeProviderReplies.has(L)&&!this._activeProviderReplies.get(L)||(T=!0);if(!T&&k){var W=k.find(function(O){return F._linkAtPosition(O.link,u)});W&&(m=!0,this._handleNewLink(W))}if(this._activeProviderReplies.size===this._linkProviders.length&&!m)for(L=0;L<this._activeProviderReplies.size;L++){var P=(x=this._activeProviderReplies.get(L))===null||x===void 0?void 0:x.find(function(O){return F._linkAtPosition(O.link,u)});if(P){m=!0,this._handleNewLink(P);break}}return m},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,b.disposeArray(this._linkCacheDisposables))},c.prototype._handleNewLink=function(l){var u=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var m=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);m&&this._linkAtPosition(l.link,m)&&(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 x,F;return(F=(x=u._currentLink)===null||x===void 0?void 0:x.state)===null||F===void 0?void 0:F.decorations.pointerCursor},set:function(x){var F,k;!((F=u._currentLink)===null||F===void 0)&&F.state&&u._currentLink.state.decorations.pointerCursor!==x&&(u._currentLink.state.decorations.pointerCursor=x,u._currentLink.state.isHovered&&((k=u._element)===null||k===void 0||k.classList.toggle("xterm-cursor-pointer",x)))}},underline:{get:function(){var x,F;return(F=(x=u._currentLink)===null||x===void 0?void 0:x.state)===null||F===void 0?void 0:F.decorations.underline},set:function(x){var F,k,T;!((F=u._currentLink)===null||F===void 0)&&F.state&&((T=(k=u._currentLink)===null||k===void 0?void 0:k.state)===null||T===void 0?void 0:T.decorations.underline)!==x&&(u._currentLink.state.decorations.underline=x,u._currentLink.state.isHovered&&u._fireUnderlineEvent(l.link,x))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(x){var F=x.start===0?0:x.start+1+u._bufferService.buffer.ydisp;u._clearCurrentLink(F,x.end+1+u._bufferService.buffer.ydisp)})))}},c.prototype._linkHover=function(l,u,m){var x;!((x=this._currentLink)===null||x===void 0)&&x.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(m,u.text)},c.prototype._fireUnderlineEvent=function(l,u){var m=l.range,x=this._bufferService.buffer.ydisp,F=this._createLinkUnderlineEvent(m.start.x-1,m.start.y-x-1,m.end.x,m.end.y-x-1,void 0);(u?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(F)},c.prototype._linkLeave=function(l,u,m){var x;!((x=this._currentLink)===null||x===void 0)&&x.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(m,u.text)},c.prototype._linkAtPosition=function(l,u){var m=l.range.start.y===l.range.end.y,x=l.range.start.y<u.y,F=l.range.end.y>u.y;return(m&&l.range.start.x<=u.x&&l.range.end.x>=u.x||x&&l.range.end.x>=u.x||F&&l.range.start.x<=u.x||x&&F)&&l.range.start.y<=u.y&&l.range.end.y>=u.y},c.prototype._positionFromMouseEvent=function(l,u,m){var x=m.getCoords(l,u,this._bufferService.cols,this._bufferService.rows);if(x)return{x:x[0],y:x[1]+this._bufferService.buffer.ydisp}},c.prototype._createLinkUnderlineEvent=function(l,u,m,x,F){return{x1:l,y1:u,x2:m,y2:x,cols:this._bufferService.cols,fg:F}},c=I([A(0,d.IBufferService)],c)}(b.Disposable);S.Linkifier2=E},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CoreBrowserService=void 0;var B=function(){function V(I){this._textarea=I}return Object.defineProperty(V.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),V}();S.CoreBrowserService=B},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(L,W){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(P,O){P.__proto__=O}||function(P,O){for(var $ in O)O.hasOwnProperty($)&&(P[$]=O[$])})(L,W)},function(L,W){function P(){this.constructor=L}B(L,W),L.prototype=W===null?Object.create(W):(P.prototype=W.prototype,new P)});Object.defineProperty(S,"__esModule",{value:!0}),S.CoreTerminal=void 0;var I=N(2),A=N(1),d=N(66),U=N(67),b=N(68),n=N(74),E=N(75),f=N(0),c=N(76),l=N(77),u=N(78),m=N(80),x=N(81),F=N(19),k=N(82),T=function(L){function W(P){var O=L.call(this)||this;return O._onBinary=new f.EventEmitter,O._onData=new f.EventEmitter,O._onLineFeed=new f.EventEmitter,O._onResize=new f.EventEmitter,O._onScroll=new f.EventEmitter,O._instantiationService=new d.InstantiationService,O.optionsService=new n.OptionsService(P),O._instantiationService.setService(A.IOptionsService,O.optionsService),O._bufferService=O.register(O._instantiationService.createInstance(b.BufferService)),O._instantiationService.setService(A.IBufferService,O._bufferService),O._logService=O._instantiationService.createInstance(U.LogService),O._instantiationService.setService(A.ILogService,O._logService),O._coreService=O.register(O._instantiationService.createInstance(E.CoreService,function(){return O.scrollToBottom()})),O._instantiationService.setService(A.ICoreService,O._coreService),O._coreMouseService=O._instantiationService.createInstance(c.CoreMouseService),O._instantiationService.setService(A.ICoreMouseService,O._coreMouseService),O._dirtyRowService=O._instantiationService.createInstance(l.DirtyRowService),O._instantiationService.setService(A.IDirtyRowService,O._dirtyRowService),O.unicodeService=O._instantiationService.createInstance(u.UnicodeService),O._instantiationService.setService(A.IUnicodeService,O.unicodeService),O._charsetService=O._instantiationService.createInstance(m.CharsetService),O._instantiationService.setService(A.ICharsetService,O._charsetService),O._inputHandler=new F.InputHandler(O._bufferService,O._charsetService,O._coreService,O._dirtyRowService,O._logService,O.optionsService,O._coreMouseService,O.unicodeService),O.register(f.forwardEvent(O._inputHandler.onLineFeed,O._onLineFeed)),O.register(O._inputHandler),O.register(f.forwardEvent(O._bufferService.onResize,O._onResize)),O.register(f.forwardEvent(O._coreService.onData,O._onData)),O.register(f.forwardEvent(O._coreService.onBinary,O._onBinary)),O.register(O.optionsService.onOptionChange(function($){return O._updateOptions($)})),O._writeBuffer=new k.WriteBuffer(function($){return O._inputHandler.parse($)}),O}return V(W,L),Object.defineProperty(W.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),W.prototype.dispose=function(){var P;this._isDisposed||(L.prototype.dispose.call(this),(P=this._windowsMode)===null||P===void 0||P.dispose(),this._windowsMode=void 0)},W.prototype.write=function(P,O){this._writeBuffer.write(P,O)},W.prototype.writeSync=function(P){this._writeBuffer.writeSync(P)},W.prototype.resize=function(P,O){isNaN(P)||isNaN(O)||(P=Math.max(P,b.MINIMUM_COLS),O=Math.max(O,b.MINIMUM_ROWS),this._bufferService.resize(P,O))},W.prototype.scroll=function(P,O){O===void 0&&(O=!1);var $,z=this._bufferService.buffer;($=this._cachedBlankLine)&&$.length===this.cols&&$.getFg(0)===P.fg&&$.getBg(0)===P.bg||($=z.getBlankLine(P,O),this._cachedBlankLine=$),$.isWrapped=O;var ie=z.ybase+z.scrollTop,te=z.ybase+z.scrollBottom;if(z.scrollTop===0){var me=z.lines.isFull;te===z.lines.length-1?me?z.lines.recycle().copyFrom($):z.lines.push($.clone()):z.lines.splice(te+1,0,$.clone()),me?this._bufferService.isUserScrolling&&(z.ydisp=Math.max(z.ydisp-1,0)):(z.ybase++,this._bufferService.isUserScrolling||z.ydisp++)}else{var _e=te-ie+1;z.lines.shiftElements(ie+1,_e-1,-1),z.lines.set(te,$.clone())}this._bufferService.isUserScrolling||(z.ydisp=z.ybase),this._dirtyRowService.markRangeDirty(z.scrollTop,z.scrollBottom),this._onScroll.fire(z.ydisp)},W.prototype.scrollLines=function(P,O){var $=this._bufferService.buffer;if(P<0){if($.ydisp===0)return;this._bufferService.isUserScrolling=!0}else P+$.ydisp>=$.ybase&&(this._bufferService.isUserScrolling=!1);var z=$.ydisp;$.ydisp=Math.max(Math.min($.ydisp+P,$.ybase),0),z!==$.ydisp&&(O||this._onScroll.fire($.ydisp))},W.prototype.scrollPages=function(P){this.scrollLines(P*(this.rows-1))},W.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},W.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},W.prototype.scrollToLine=function(P){var O=P-this._bufferService.buffer.ydisp;O!==0&&this.scrollLines(O)},W.prototype.addEscHandler=function(P,O){return this._inputHandler.addEscHandler(P,O)},W.prototype.addDcsHandler=function(P,O){return this._inputHandler.addDcsHandler(P,O)},W.prototype.addCsiHandler=function(P,O){return this._inputHandler.addCsiHandler(P,O)},W.prototype.addOscHandler=function(P,O){return this._inputHandler.addOscHandler(P,O)},W.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},W.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},W.prototype._updateOptions=function(P){var O;switch(P){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():((O=this._windowsMode)===null||O===void 0||O.dispose(),this._windowsMode=void 0)}},W.prototype._enableWindowsMode=function(){var P=this;if(!this._windowsMode){var O=[];O.push(this.onLineFeed(x.updateWindowsModeWrappedState.bind(null,this._bufferService))),O.push(this.addCsiHandler({final:"H"},function(){return x.updateWindowsModeWrappedState(P._bufferService),!1})),this._windowsMode={dispose:function(){for(var $=0,z=O;$<z.length;$++)z[$].dispose()}}}},W}(I.Disposable);S.CoreTerminal=T},function(Le,S,N){"use strict";var B=this&&this.__spreadArrays||function(){for(var U=0,b=0,n=arguments.length;b<n;b++)U+=arguments[b].length;var E=Array(U),f=0;for(b=0;b<n;b++)for(var c=arguments[b],l=0,u=c.length;l<u;l++,f++)E[f]=c[l];return E};Object.defineProperty(S,"__esModule",{value:!0}),S.InstantiationService=S.ServiceCollection=void 0;var V=N(1),I=N(14),A=function(){function U(){for(var b=[],n=0;n<arguments.length;n++)b[n]=arguments[n];this._entries=new Map;for(var E=0,f=b;E<f.length;E++){var c=f[E],l=c[0],u=c[1];this.set(l,u)}}return U.prototype.set=function(b,n){var E=this._entries.get(b);return this._entries.set(b,n),E},U.prototype.forEach=function(b){this._entries.forEach(function(n,E){return b(E,n)})},U.prototype.has=function(b){return this._entries.has(b)},U.prototype.get=function(b){return this._entries.get(b)},U}();S.ServiceCollection=A;var d=function(){function U(){this._services=new A,this._services.set(V.IInstantiationService,this)}return U.prototype.setService=function(b,n){this._services.set(b,n)},U.prototype.getService=function(b){return this._services.get(b)},U.prototype.createInstance=function(b){for(var n=[],E=1;E<arguments.length;E++)n[E-1]=arguments[E];for(var f=I.getServiceDependencies(b).sort(function(k,T){return k.index-T.index}),c=[],l=0,u=f;l<u.length;l++){var m=u[l],x=this._services.get(m.id);if(!x)throw new Error("[createInstance] "+b.name+" depends on UNKNOWN service "+m.id+".");c.push(x)}var F=f.length>0?f[0].index:n.length;if(n.length!==F)throw new Error("[createInstance] First service dependency of "+b.name+" at position "+(F+1)+" conflicts with "+n.length+" static arguments");return new(b.bind.apply(b,B([void 0],B(n,c))))},U}();S.InstantiationService=d},function(Le,S,N){"use strict";var B=this&&this.__decorate||function(n,E,f,c){var l,u=arguments.length,m=u<3?E:c===null?c=Object.getOwnPropertyDescriptor(E,f):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(n,E,f,c);else for(var x=n.length-1;x>=0;x--)(l=n[x])&&(m=(u<3?l(m):u>3?l(E,f,m):l(E,f))||m);return u>3&&m&&Object.defineProperty(E,f,m),m},V=this&&this.__param||function(n,E){return function(f,c){E(f,c,n)}},I=this&&this.__spreadArrays||function(){for(var n=0,E=0,f=arguments.length;E<f;E++)n+=arguments[E].length;var c=Array(n),l=0;for(E=0;E<f;E++)for(var u=arguments[E],m=0,x=u.length;m<x;m++,l++)c[l]=u[m];return c};Object.defineProperty(S,"__esModule",{value:!0}),S.LogService=S.LogLevel=void 0;var A,d=N(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"})(A=S.LogLevel||(S.LogLevel={}));var U={debug:A.DEBUG,info:A.INFO,warn:A.WARN,error:A.ERROR,off:A.OFF},b=function(){function n(E){var f=this;this._optionsService=E,this._updateLogLevel(),this._optionsService.onOptionChange(function(c){c==="logLevel"&&f._updateLogLevel()})}return n.prototype._updateLogLevel=function(){this._logLevel=U[this._optionsService.options.logLevel]},n.prototype._evalLazyOptionalParams=function(E){for(var f=0;f<E.length;f++)typeof E[f]=="function"&&(E[f]=E[f]())},n.prototype._log=function(E,f,c){this._evalLazyOptionalParams(c),E.call.apply(E,I([console,"xterm.js: "+f],c))},n.prototype.debug=function(E){for(var f=[],c=1;c<arguments.length;c++)f[c-1]=arguments[c];this._logLevel<=A.DEBUG&&this._log(console.log,E,f)},n.prototype.info=function(E){for(var f=[],c=1;c<arguments.length;c++)f[c-1]=arguments[c];this._logLevel<=A.INFO&&this._log(console.info,E,f)},n.prototype.warn=function(E){for(var f=[],c=1;c<arguments.length;c++)f[c-1]=arguments[c];this._logLevel<=A.WARN&&this._log(console.warn,E,f)},n.prototype.error=function(E){for(var f=[],c=1;c<arguments.length;c++)f[c-1]=arguments[c];this._logLevel<=A.ERROR&&this._log(console.error,E,f)},n=B([V(0,d.IOptionsService)],n)}();S.LogService=b},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(f,c){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var m in u)u.hasOwnProperty(m)&&(l[m]=u[m])})(f,c)},function(f,c){function l(){this.constructor=f}B(f,c),f.prototype=c===null?Object.create(c):(l.prototype=c.prototype,new l)}),I=this&&this.__decorate||function(f,c,l,u){var m,x=arguments.length,F=x<3?c:u===null?u=Object.getOwnPropertyDescriptor(c,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(f,c,l,u);else for(var k=f.length-1;k>=0;k--)(m=f[k])&&(F=(x<3?m(F):x>3?m(c,l,F):m(c,l))||F);return x>3&&F&&Object.defineProperty(c,l,F),F},A=this&&this.__param||function(f,c){return function(l,u){c(l,u,f)}};Object.defineProperty(S,"__esModule",{value:!0}),S.BufferService=S.MINIMUM_ROWS=S.MINIMUM_COLS=void 0;var d=N(1),U=N(69),b=N(0),n=N(2);S.MINIMUM_COLS=2,S.MINIMUM_ROWS=1;var E=function(f){function c(l){var u=f.call(this)||this;return u._optionsService=l,u.isUserScrolling=!1,u._onResize=new b.EventEmitter,u.cols=Math.max(l.options.cols,S.MINIMUM_COLS),u.rows=Math.max(l.options.rows,S.MINIMUM_ROWS),u.buffers=new U.BufferSet(l,u),u}return V(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 U.BufferSet(this._optionsService,this),this.isUserScrolling=!1},c=I([A(0,d.IOptionsService)],c)}(n.Disposable);S.BufferService=E},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(U,b){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,E){n.__proto__=E}||function(n,E){for(var f in E)E.hasOwnProperty(f)&&(n[f]=E[f])})(U,b)},function(U,b){function n(){this.constructor=U}B(U,b),U.prototype=b===null?Object.create(b):(n.prototype=b.prototype,new n)});Object.defineProperty(S,"__esModule",{value:!0}),S.BufferSet=void 0;var I=N(70),A=N(0),d=function(U){function b(n,E){var f=U.call(this)||this;return f._onBufferActivate=f.register(new A.EventEmitter),f._normal=new I.Buffer(!0,n,E),f._normal.fillViewportRows(),f._alt=new I.Buffer(!1,n,E),f._activeBuffer=f._normal,f.setupTabStops(),f}return V(b,U),Object.defineProperty(b.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),b.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}))},b.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}))},b.prototype.resize=function(n,E){this._normal.resize(n,E),this._alt.resize(n,E)},b.prototype.setupTabStops=function(n){this._normal.setupTabStops(n),this._alt.setupTabStops(n)},b}(N(2).Disposable);S.BufferSet=d},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.BufferStringIterator=S.Buffer=S.MAX_BUFFER_SIZE=void 0;var B=N(71),V=N(16),I=N(4),A=N(3),d=N(72),U=N(73),b=N(20),n=N(6);S.MAX_BUFFER_SIZE=4294967295;var E=function(){function c(l,u,m){this._hasScrollback=l,this._optionsService=u,this._bufferService=m,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=V.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=I.CellData.fromCharData([0,A.NULL_CELL_CHAR,A.NULL_CELL_WIDTH,A.NULL_CELL_CODE]),this._whitespaceCell=I.CellData.fromCharData([0,A.WHITESPACE_CELL_CHAR,A.WHITESPACE_CELL_WIDTH,A.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new B.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 V.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>S.MAX_BUFFER_SIZE?S.MAX_BUFFER_SIZE:u},c.prototype.fillViewportRows=function(l){if(this.lines.length===0){l===void 0&&(l=V.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 B.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},c.prototype.resize=function(l,u){var m=this.getNullCell(V.DEFAULT_ATTR_DATA),x=this._getCorrectBufferLength(u);if(x>this.lines.maxLength&&(this.lines.maxLength=x),this.lines.length>0){if(this._cols<l)for(var F=0;F<this.lines.length;F++)this.lines.get(F).resize(l,m);var k=0;if(this._rows<u)for(var T=this._rows;T<u;T++)this.lines.length<u+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new V.BufferLine(l,m)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new V.BufferLine(l,m)));else for(T=this._rows;T>u;T--)this.lines.length>u+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(x<this.lines.maxLength){var L=this.lines.length-x;L>0&&(this.lines.trimStart(L),this.ybase=Math.max(this.ybase-L,0),this.ydisp=Math.max(this.ydisp-L,0),this.savedY=Math.max(this.savedY-L,0)),this.lines.maxLength=x}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,u-1),k&&(this.y+=k),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(F=0;F<this.lines.length;F++)this.lines.get(F).resize(l,m);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 m=d.reflowLargerGetLinesToRemove(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(V.DEFAULT_ATTR_DATA));if(m.length>0){var x=d.reflowLargerCreateNewLayout(this.lines,m);d.reflowLargerApplyNewLayout(this.lines,x.layout),this._reflowLargerAdjustViewport(l,u,x.countRemoved)}},c.prototype._reflowLargerAdjustViewport=function(l,u,m){for(var x=this.getNullCell(V.DEFAULT_ATTR_DATA),F=m;F-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<u&&this.lines.push(new V.BufferLine(l,x))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-m,0)},c.prototype._reflowSmaller=function(l,u){for(var m=this.getNullCell(V.DEFAULT_ATTR_DATA),x=[],F=0,k=this.lines.length-1;k>=0;k--){var T=this.lines.get(k);if(!(!T||!T.isWrapped&&T.getTrimmedLength()<=l)){for(var L=[T];T.isWrapped&&k>0;)T=this.lines.get(--k),L.unshift(T);var W=this.ybase+this.y;if(!(W>=k&&W<k+L.length)){var P=L[L.length-1].getTrimmedLength(),O=d.reflowSmallerGetNewLineLengths(L,this._cols,l),$=O.length-L.length,z=void 0;z=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 ie=[],te=0;te<$;te++){var me=this.getBlankLine(V.DEFAULT_ATTR_DATA,!0);ie.push(me)}ie.length>0&&(x.push({start:k+L.length+F,newLines:ie}),F+=ie.length),L.push.apply(L,ie);var _e=O.length-1,le=O[_e];le===0&&(le=O[--_e]);for(var Q=L.length-$-1,se=P;Q>=0;){var H=Math.min(se,le);if(L[_e].copyCellsFrom(L[Q],se-H,le-H,H,!0),(le-=H)===0&&(le=O[--_e]),(se-=H)===0){Q--;var J=Math.max(Q,0);se=d.getWrappedLineTrimmedLength(L,J,this._cols)}}for(te=0;te<L.length;te++)O[te]<l&&L[te].setCell(O[te],m);for(var K=$-z;K-- >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+F)-u&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+$,this.ybase+u-1)}}}if(x.length>0){var M=[],D=[];for(te=0;te<this.lines.length;te++)D.push(this.lines.get(te));var ne=this.lines.length,de=ne-1,Oe=0,Ve=x[Oe];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+F);var nt=0;for(te=Math.min(this.lines.maxLength-1,ne+F-1);te>=0;te--)if(Ve&&Ve.start>de+nt){for(var Fe=Ve.newLines.length-1;Fe>=0;Fe--)this.lines.set(te--,Ve.newLines[Fe]);te++,M.push({index:de+1,amount:Ve.newLines.length}),nt+=Ve.newLines.length,Ve=x[++Oe]}else this.lines.set(te,D[de--]);var rt=0;for(te=M.length-1;te>=0;te--)M[te].index+=rt,this.lines.onInsertEmitter.fire(M[te]),rt+=M[te].amount;var Ze=Math.max(0,ne+F-this.lines.maxLength);Ze>0&&this.lines.onTrimEmitter.fire(Ze)}},c.prototype.stringIndexToBufferIndex=function(l,u,m){for(m===void 0&&(m=!1);u;){var x=this.lines.get(l);if(!x)return[-1,-1];for(var F=m?x.getTrimmedLength():x.length,k=0;k<F;++k)if(x.get(k)[A.CHAR_DATA_WIDTH_INDEX]&&(u-=x.get(k)[A.CHAR_DATA_CHAR_INDEX].length||1),u<0)return[l,k];l++}return[l,0]},c.prototype.translateBufferLineToString=function(l,u,m,x){m===void 0&&(m=0);var F=this.lines.get(l);return F?F.translateToString(u,m,x):""},c.prototype.getWrappedRangeForLine=function(l){for(var u=l,m=l;u>0&&this.lines.get(u).isWrapped;)u--;for(;m+1<this.lines.length&&this.lines.get(m+1).isWrapped;)m++;return{first:u,last:m}},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,m=new U.Marker(l);return this.markers.push(m),m.register(this.lines.onTrim(function(x){m.line-=x,m.line<0&&m.dispose()})),m.register(this.lines.onInsert(function(x){m.line>=x.index&&(m.line+=x.amount)})),m.register(this.lines.onDelete(function(x){m.line>=x.index&&m.line<x.index+x.amount&&m.dispose(),m.line>x.index&&(m.line-=x.amount)})),m.register(m.onDispose(function(){return u._removeMarker(m)})),m},c.prototype._removeMarker=function(l){this.markers.splice(this.markers.indexOf(l),1)},c.prototype.iterator=function(l,u,m,x,F){return new f(this,l,u,m,x,F)},c}();S.Buffer=E;var f=function(){function c(l,u,m,x,F,k){m===void 0&&(m=0),x===void 0&&(x=l.lines.length),F===void 0&&(F=0),k===void 0&&(k=0),this._buffer=l,this._trimRight=u,this._startIndex=m,this._endIndex=x,this._startOverscan=F,this._endOverscan=k,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="",m=l.first;m<=l.last;++m)u+=this._buffer.translateBufferLineToString(m,this._trimRight);return this._current=l.last+1,{range:l,content:u}},c}();S.BufferStringIterator=f},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CircularList=void 0;var B=N(0),V=function(){function I(A){this._maxLength=A,this.onDeleteEmitter=new B.EventEmitter,this.onInsertEmitter=new B.EventEmitter,this.onTrimEmitter=new B.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(I.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"maxLength",{get:function(){return this._maxLength},set:function(A){if(this._maxLength!==A){for(var d=new Array(A),U=0;U<Math.min(A,this.length);U++)d[U]=this._array[this._getCyclicIndex(U)];this._array=d,this._maxLength=A,this._startIndex=0}},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"length",{get:function(){return this._length},set:function(A){if(A>this._length)for(var d=this._length;d<A;d++)this._array[d]=void 0;this._length=A},enumerable:!1,configurable:!0}),I.prototype.get=function(A){return this._array[this._getCyclicIndex(A)]},I.prototype.set=function(A,d){this._array[this._getCyclicIndex(A)]=d},I.prototype.push=function(A){this._array[this._getCyclicIndex(this._length)]=A,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},I.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(I.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),I.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},I.prototype.splice=function(A,d){for(var U=[],b=2;b<arguments.length;b++)U[b-2]=arguments[b];if(d){for(var n=A;n<this._length-d;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+d)];this._length-=d}for(n=this._length-1;n>=A;n--)this._array[this._getCyclicIndex(n+U.length)]=this._array[this._getCyclicIndex(n)];for(n=0;n<U.length;n++)this._array[this._getCyclicIndex(A+n)]=U[n];if(this._length+U.length>this._maxLength){var E=this._length+U.length-this._maxLength;this._startIndex+=E,this._length=this._maxLength,this.onTrimEmitter.fire(E)}else this._length+=U.length},I.prototype.trimStart=function(A){A>this._length&&(A=this._length),this._startIndex+=A,this._length-=A,this.onTrimEmitter.fire(A)},I.prototype.shiftElements=function(A,d,U){if(!(d<=0)){if(A<0||A>=this._length)throw new Error("start argument out of range");if(A+U<0)throw new Error("Cannot shift elements in list beyond index 0");if(U>0){for(var b=d-1;b>=0;b--)this.set(A+b+U,this.get(A+b));var n=A+d+U-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(b=0;b<d;b++)this.set(A+b+U,this.get(A+b))}},I.prototype._getCyclicIndex=function(A){return(this._startIndex+A)%this._maxLength},I}();S.CircularList=V},function(Le,S,N){"use strict";function B(V,I,A){if(I===V.length-1)return V[I].getTrimmedLength();var d=!V[I].hasContent(A-1)&&V[I].getWidth(A-1)===1,U=V[I+1].getWidth(0)===2;return d&&U?A-1:A}Object.defineProperty(S,"__esModule",{value:!0}),S.getWrappedLineTrimmedLength=S.reflowSmallerGetNewLineLengths=S.reflowLargerApplyNewLayout=S.reflowLargerCreateNewLayout=S.reflowLargerGetLinesToRemove=void 0,S.reflowLargerGetLinesToRemove=function(V,I,A,d,U){for(var b=[],n=0;n<V.length-1;n++){var E=n,f=V.get(++E);if(f.isWrapped){for(var c=[V.get(n)];E<V.length&&f.isWrapped;)c.push(f),f=V.get(++E);if(d>=n&&d<E)n+=c.length-1;else{for(var l=0,u=B(c,l,I),m=1,x=0;m<c.length;){var F=B(c,m,I),k=F-x,T=A-u,L=Math.min(k,T);c[l].copyCellsFrom(c[m],x,u,L,!1),(u+=L)===A&&(l++,u=0),(x+=L)===F&&(m++,x=0),u===0&&l!==0&&c[l-1].getWidth(A-1)===2&&(c[l].copyCellsFrom(c[l-1],A-1,u++,1,!1),c[l-1].setCell(A-1,U))}c[l].replaceCells(u,A,U);for(var W=0,P=c.length-1;P>0&&(P>l||c[P].getTrimmedLength()===0);P--)W++;W>0&&(b.push(n+c.length-W),b.push(W)),n+=c.length-1}}}return b},S.reflowLargerCreateNewLayout=function(V,I){for(var A=[],d=0,U=I[d],b=0,n=0;n<V.length;n++)if(U===n){var E=I[++d];V.onDeleteEmitter.fire({index:n-b,amount:E}),n+=E-1,b+=E,U=I[++d]}else A.push(n);return{layout:A,countRemoved:b}},S.reflowLargerApplyNewLayout=function(V,I){for(var A=[],d=0;d<I.length;d++)A.push(V.get(I[d]));for(d=0;d<A.length;d++)V.set(d,A[d]);V.length=I.length},S.reflowSmallerGetNewLineLengths=function(V,I,A){for(var d=[],U=V.map(function(u,m){return B(V,m,I)}).reduce(function(u,m){return u+m}),b=0,n=0,E=0;E<U;){if(U-E<A){d.push(U-E);break}b+=A;var f=B(V,n,I);b>f&&(b-=f,n++);var c=V[n].getWidth(b-1)===2;c&&b--;var l=c?A-1:A;d.push(l),E+=l}return d},S.getWrappedLineTrimmedLength=B},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(d,U){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,n){b.__proto__=n}||function(b,n){for(var E in n)n.hasOwnProperty(E)&&(b[E]=n[E])})(d,U)},function(d,U){function b(){this.constructor=d}B(d,U),d.prototype=U===null?Object.create(U):(b.prototype=U.prototype,new b)});Object.defineProperty(S,"__esModule",{value:!0}),S.Marker=void 0;var I=N(0),A=function(d){function U(b){var n=d.call(this)||this;return n.line=b,n._id=U._nextId++,n.isDisposed=!1,n._onDispose=new I.EventEmitter,n}return V(U,d),Object.defineProperty(U.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),U.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},U._nextId=1,U}(N(2).Disposable);S.Marker=A},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.OptionsService=S.DEFAULT_OPTIONS=S.DEFAULT_BELL_SOUND=void 0;var B=N(0),V=N(11),I=N(33);S.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",S.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:S.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:V.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var A=["cols","rows"],d=function(){function U(b){this._onOptionChange=new B.EventEmitter,this.options=I.clone(S.DEFAULT_OPTIONS);for(var n=0,E=Object.keys(b);n<E.length;n++){var f=E[n];if(f in this.options){var c=b[f];this.options[f]=c}}}return Object.defineProperty(U.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),U.prototype.setOption=function(b,n){if(!(b in S.DEFAULT_OPTIONS))throw new Error('No option with key "'+b+'"');if(A.indexOf(b)!==-1)throw new Error('Option "'+b+'" can only be set in the constructor');this.options[b]!==n&&(n=this._sanitizeAndValidateOption(b,n),this.options[b]!==n&&(this.options[b]=n,this._onOptionChange.fire(b)))},U.prototype._sanitizeAndValidateOption=function(b,n){switch(b){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":n||(n=S.DEFAULT_OPTIONS[b]);break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(b+" 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(b+" cannot be less than 0, value: "+n);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(b+" cannot be less than or equal to 0, value: "+n)}return n},U.prototype.getOption=function(b){if(!(b in S.DEFAULT_OPTIONS))throw new Error('No option with key "'+b+'"');return this.options[b]},U}();S.OptionsService=d},function(Le,S,N){"use strict";var B,V=this&&this.__extends||(B=function(l,u){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,x){m.__proto__=x}||function(m,x){for(var F in x)x.hasOwnProperty(F)&&(m[F]=x[F])})(l,u)},function(l,u){function m(){this.constructor=l}B(l,u),l.prototype=u===null?Object.create(u):(m.prototype=u.prototype,new m)}),I=this&&this.__decorate||function(l,u,m,x){var F,k=arguments.length,T=k<3?u:x===null?x=Object.getOwnPropertyDescriptor(u,m):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(l,u,m,x);else for(var L=l.length-1;L>=0;L--)(F=l[L])&&(T=(k<3?F(T):k>3?F(u,m,T):F(u,m))||T);return k>3&&T&&Object.defineProperty(u,m,T),T},A=this&&this.__param||function(l,u){return function(m,x){u(m,x,l)}};Object.defineProperty(S,"__esModule",{value:!0}),S.CoreService=void 0;var d=N(1),U=N(0),b=N(33),n=N(2),E=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(m,x,F,k){var T=l.call(this)||this;return T._bufferService=x,T._logService=F,T._optionsService=k,T.isCursorInitialized=!1,T.isCursorHidden=!1,T._onData=T.register(new U.EventEmitter),T._onUserInput=T.register(new U.EventEmitter),T._onBinary=T.register(new U.EventEmitter),T._scrollToBottom=m,T.register({dispose:function(){return T._scrollToBottom=void 0}}),T.modes=b.clone(E),T.decPrivateModes=b.clone(f),T}return V(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=b.clone(E),this.decPrivateModes=b.clone(f)},u.prototype.triggerDataEvent=function(m,x){if(x===void 0&&(x=!1),!this._optionsService.options.disableStdin){var F=this._bufferService.buffer;F.ybase!==F.ydisp&&this._scrollToBottom(),x&&this._onUserInput.fire(),this._logService.debug('sending data "'+m+'"',function(){return m.split("").map(function(k){return k.charCodeAt(0)})}),this._onData.fire(m)}},u.prototype.triggerBinaryEvent=function(m){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+m+'"',function(){return m.split("").map(function(x){return x.charCodeAt(0)})}),this._onBinary.fire(m))},u=I([A(1,d.IBufferService),A(2,d.ILogService),A(3,d.IOptionsService)],u)}(n.Disposable);S.CoreService=c},function(Le,S,N){"use strict";var B=this&&this.__decorate||function(f,c,l,u){var m,x=arguments.length,F=x<3?c:u===null?u=Object.getOwnPropertyDescriptor(c,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(f,c,l,u);else for(var k=f.length-1;k>=0;k--)(m=f[k])&&(F=(x<3?m(F):x>3?m(c,l,F):m(c,l))||F);return x>3&&F&&Object.defineProperty(c,l,F),F},V=this&&this.__param||function(f,c){return function(l,u){c(l,u,f)}};Object.defineProperty(S,"__esModule",{value:!0}),S.CoreMouseService=void 0;var I=N(1),A=N(0),d={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 U(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 b=String.fromCharCode,n={DEFAULT:function(f){var c=[U(f,!1)+32,f.col+32,f.row+32];return c[0]>255||c[1]>255||c[2]>255?"":"\x1B[M"+b(c[0])+b(c[1])+b(c[2])},SGR:function(f){var c=f.action===0&&f.button!==4?"m":"M";return"\x1B[<"+U(f,!0)+";"+f.col+";"+f.row+c}},E=function(){function f(c,l){this._bufferService=c,this._coreService=l,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new A.EventEmitter,this._lastEvent=null;for(var u=0,m=Object.keys(d);u<m.length;u++){var x=m[u];this.addProtocol(x,d[x])}for(var F=0,k=Object.keys(n);F<k.length;F++){var T=k[F];this.addEncoding(T,n[T])}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=B([V(0,I.IBufferService),V(1,I.ICoreService)],f)}();S.CoreMouseService=E},function(Le,S,N){"use strict";var B=this&&this.__decorate||function(d,U,b,n){var E,f=arguments.length,c=f<3?U:n===null?n=Object.getOwnPropertyDescriptor(U,b):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(d,U,b,n);else for(var l=d.length-1;l>=0;l--)(E=d[l])&&(c=(f<3?E(c):f>3?E(U,b,c):E(U,b))||c);return f>3&&c&&Object.defineProperty(U,b,c),c},V=this&&this.__param||function(d,U){return function(b,n){U(b,n,d)}};Object.defineProperty(S,"__esModule",{value:!0}),S.DirtyRowService=void 0;var I=N(1),A=function(){function d(U){this._bufferService=U,this.clearRange()}return Object.defineProperty(d.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),d.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},d.prototype.markDirty=function(U){U<this._start?this._start=U:U>this._end&&(this._end=U)},d.prototype.markRangeDirty=function(U,b){if(U>b){var n=U;U=b,b=n}U<this._start&&(this._start=U),b>this._end&&(this._end=b)},d.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},d=B([V(0,I.IBufferService)],d)}();S.DirtyRowService=A},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UnicodeService=void 0;var B=N(0),V=N(79),I=function(){function A(){this._providers=Object.create(null),this._active="",this._onChange=new B.EventEmitter;var d=new V.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}return Object.defineProperty(A.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"activeVersion",{get:function(){return this._active},set:function(d){if(!this._providers[d])throw new Error('unknown Unicode version "'+d+'"');this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)},enumerable:!1,configurable:!0}),A.prototype.register=function(d){this._providers[d.version]=d},A.prototype.wcwidth=function(d){return this._activeProvider.wcwidth(d)},A.prototype.getStringCellWidth=function(d){for(var U=0,b=d.length,n=0;n<b;++n){var E=d.charCodeAt(n);if(55296<=E&&E<=56319){if(++n>=b)return U+this.wcwidth(E);var f=d.charCodeAt(n);56320<=f&&f<=57343?E=1024*(E-55296)+f-56320+65536:U+=this.wcwidth(f)}U+=this.wcwidth(E)}return U},A}();S.UnicodeService=I},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UnicodeV6=void 0;var B,V=N(15),I=[[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]],A=[[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]],d=function(){function U(){if(this.version="6",!B){B=new Uint8Array(65536),V.fill(B,1),B[0]=0,V.fill(B,0,1,32),V.fill(B,0,127,160),V.fill(B,2,4352,4448),B[9001]=2,B[9002]=2,V.fill(B,2,11904,42192),B[12351]=1,V.fill(B,2,44032,55204),V.fill(B,2,63744,64256),V.fill(B,2,65040,65050),V.fill(B,2,65072,65136),V.fill(B,2,65280,65377),V.fill(B,2,65504,65511);for(var b=0;b<I.length;++b)V.fill(B,0,I[b][0],I[b][1]+1)}}return U.prototype.wcwidth=function(b){return b<32?0:b<127?1:b<65536?B[b]:function(n,E){var f,c=0,l=E.length-1;if(n<E[0][0]||n>E[l][1])return!1;for(;l>=c;)if(n>E[f=c+l>>1][1])c=f+1;else{if(!(n<E[f][0]))return!0;l=f-1}return!1}(b,A)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1},U}();S.UnicodeV6=d},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CharsetService=void 0;var B=function(){function V(){this.glevel=0,this._charsets=[]}return V.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},V.prototype.setgLevel=function(I){this.glevel=I,this.charset=this._charsets[I]},V.prototype.setgCharset=function(I,A){this._charsets[I]=A,this.glevel===I&&(this.charset=A)},V}();S.CharsetService=B},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.updateWindowsModeWrappedState=void 0;var B=N(3);S.updateWindowsModeWrappedState=function(V){var I=V.buffer.lines.get(V.buffer.ybase+V.buffer.y-1),A=I==null?void 0:I.get(V.cols-1),d=V.buffer.lines.get(V.buffer.ybase+V.buffer.y);d&&A&&(d.isWrapped=A[B.CHAR_DATA_CODE_INDEX]!==B.NULL_CELL_CODE&&A[B.CHAR_DATA_CODE_INDEX]!==B.WHITESPACE_CELL_CODE)}},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.WriteBuffer=void 0;var B=function(){function V(I){this._action=I,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return V.prototype.writeSync=function(I){if(this._writeBuffer.length){for(var A=this._bufferOffset;A<this._writeBuffer.length;++A){var d=this._writeBuffer[A],U=this._callbacks[A];this._action(d),U&&U()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(I)},V.prototype.write=function(I,A){var d=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 d._innerWrite()})),this._pendingData+=I.length,this._writeBuffer.push(I),this._callbacks.push(A)},V.prototype._innerWrite=function(){for(var I=this,A=Date.now();this._writeBuffer.length>this._bufferOffset;){var d=this._writeBuffer[this._bufferOffset],U=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(d),this._pendingData-=d.length,U&&U(),Date.now()-A>=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 I._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},V}();S.WriteBuffer=B},function(Le,S,N){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.AddonManager=void 0;var B=function(){function V(){this._addons=[]}return V.prototype.dispose=function(){for(var I=this._addons.length-1;I>=0;I--)this._addons[I].instance.dispose()},V.prototype.loadAddon=function(I,A){var d=this,U={instance:A,dispose:A.dispose,isDisposed:!1};this._addons.push(U),A.dispose=function(){return d._wrappedAddonDispose(U)},A.activate(I)},V.prototype._wrappedAddonDispose=function(I){if(!I.isDisposed){for(var A=-1,d=0;d<this._addons.length;d++)if(this._addons[d]===I){A=d;break}if(A===-1)throw new Error("Could not dispose an addon that has not been loaded");I.isDisposed=!0,I.dispose.apply(I.instance),this._addons.splice(A,1)}},V}();S.AddonManager=B}])})},93314:function(Ct){"use strict";Ct.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=="},46284:function(Ct,Le,S){"use strict";S.d(Le,{ZP:function(){return Jn}});const N=Number.isFinite||function(o){return typeof o=="number"&&isFinite(o)},B=Number.isSafeInteger||function(o){return typeof o=="number"&&Math.abs(o)<=V},V=Number.MAX_SAFE_INTEGER||9007199254740991;let I=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}({}),A=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}({}),d=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 U={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},b={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class n{constructor(e,t=0,r=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_=r}sample(e,t){const r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*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 E{constructor(e,t,r,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new n(e),this.fast_=new n(t),this.defaultTTFB_=i,this.ttfb_=new n(e)}update(e,t){const{slow_:r,fast_:i,ttfb_:s}=this;r.halfLife!==e&&(this.slow_=new n(e,r.getEstimate(),r.getTotalWeight())),i.halfLife!==t&&(this.fast_=new n(t,i.getEstimate(),i.getTotalWeight())),s.halfLife!==e&&(this.ttfb_=new n(e,s.getEstimate(),s.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const r=8*t,i=e/1e3,s=r/i;this.fast_.sample(i,s),this.slow_.sample(i,s)}sampleTTFB(e){const t=e/1e3,r=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(r,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=x(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 r in t)({}).hasOwnProperty.call(t,r)&&(o[r]=t[r])}return o},c.apply(null,arguments)}function l(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable})),t.push.apply(t,r)}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(r){f(o,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(t,r))})}return o}function m(o,e){if(typeof o!="object"||!o)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var r=t.call(o,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function x(o){var e=m(o,"string");return typeof e=="symbol"?e:e+""}class F{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 r=`[${e}]:`;this.trace=k,this.debug=t.debug.bind(null,r),this.log=t.log.bind(null,r),this.warn=t.warn.bind(null,r),this.info=t.info.bind(null,r),this.error=t.error.bind(null,r)}}const k=function(){},T={trace:k,debug:k,log:k,warn:k,info:k,error:k};function L(){return c({},T)}function W(o,e){const t=self.console[o];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${o}] >`):k}function P(o,e,t){return e[o]?e[o].bind(e):W(o,t)}const O=L();function $(o,e,t){const r=L();if(typeof console=="object"&&o===!0||typeof o=="object"){const i=["debug","log","info","warn","error"];i.forEach(s=>{r[s]=P(s,o,t)});try{r.log(`Debug logs enabled for "${e}" in hls.js version 1.6.1`)}catch(s){return L()}i.forEach(s=>{O[s]=P(s,o)})}else c(O,r);return r}const z=O;function ie(o=!0){return typeof self=="undefined"?void 0:(o||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function te(o){return typeof self!="undefined"&&o===self.ManagedMediaSource}function me(o,e){const t=Object.keys(o),r=Object.keys(e),i=t.length,s=r.length;return!i||!s||i===s&&!t.some(a=>r.indexOf(a)===-1)}function _e(o,e=!1){if(typeof TextDecoder!="undefined"){const g=new TextDecoder("utf-8").decode(o);if(e){const w=g.indexOf("\0");return w!==-1?g.substring(0,w):g}return g.replace(/\0/g,"")}const t=o.length;let r,i,s,a="",h=0;for(;h<t;){if(r=o[h++],r===0&&e)return a;if(r===0||r===3)continue;switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(r);break;case 12:case 13:i=o[h++],a+=String.fromCharCode((r&31)<<6|i&63);break;case 14:i=o[h++],s=o[h++],a+=String.fromCharCode((r&15)<<12|(i&63)<<6|(s&63)<<0);break}}return a}const le={hexDump:function(o){let e="";for(let t=0;t<o.length;t++){let r=o[t].toString(16);r.length<2&&(r="0"+r),e+=r}return e}};function Q(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var se={exports:{}},H;function J(){return H||(H=1,function(o,e){(function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,h={buildAbsoluteURL:function(_,g,w){if(w=w||{},_=_.trim(),g=g.trim(),!g){if(!w.alwaysNormalize)return _;var R=h.parseURL(_);if(!R)throw new Error("Error trying to parse base URL.");return R.path=h.normalizePath(R.path),h.buildURLFromParts(R)}var G=h.parseURL(g);if(!G)throw new Error("Error trying to parse relative URL.");if(G.scheme)return w.alwaysNormalize?(G.path=h.normalizePath(G.path),h.buildURLFromParts(G)):g;var Y=h.parseURL(_);if(!Y)throw new Error("Error trying to parse base URL.");if(!Y.netLoc&&Y.path&&Y.path[0]!=="/"){var X=i.exec(Y.path);Y.netLoc=X[1],Y.path=X[2]}Y.netLoc&&!Y.path&&(Y.path="/");var fe={scheme:Y.scheme,netLoc:G.netLoc,path:null,params:G.params,query:G.query,fragment:G.fragment};if(!G.netLoc&&(fe.netLoc=Y.netLoc,G.path[0]!=="/"))if(!G.path)fe.path=Y.path,G.params||(fe.params=Y.params,G.query||(fe.query=Y.query));else{var ce=Y.path,Ee=ce.substring(0,ce.lastIndexOf("/")+1)+G.path;fe.path=h.normalizePath(Ee)}return fe.path===null&&(fe.path=w.alwaysNormalize?h.normalizePath(G.path):G.path),h.buildURLFromParts(fe)},parseURL:function(_){var g=r.exec(_);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(_){for(_=_.split("").reverse().join("").replace(s,"");_.length!==(_=_.replace(a,"")).length;);return _.split("").reverse().join("")},buildURLFromParts:function(_){return _.scheme+_.netLoc+_.path+_.params+_.query+_.fragment}};o.exports=h})()}(se)),se.exports}var K=J();class M{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var D={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class ne{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,Fe(this,"stats")}setByteRange(e,t){const r=e.split("@",2);let i;r.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(r[1]),this._byteRange=[i,parseInt(r[0])+i]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[D.AUDIO]:null,[D.VIDEO]:null,[D.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new M),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=K.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[D.AUDIO]=null,e[D.VIDEO]=null,e[D.AUDIOVIDEO]=null}}function de(o){return o.sn!=="initSegment"}class Oe extends ne{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(N(e)&&N(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 r=Object.keys(this.levelkeys);if(r.length===1)return this._decryptdata=this.levelkeys[r[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=N(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),r=t.length;if(r>1||r===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(!N(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return de(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,r,i,s,a=!1){const{elementaryStreams:h}=this,_=h[e];if(!_){h[e]={startPTS:t,endPTS:r,startDTS:i,endDTS:s,partial:a};return}_.startPTS=Math.min(_.startPTS,t),_.endPTS=Math.max(_.endPTS,r),_.startDTS=Math.min(_.startDTS,i),_.endDTS=Math.max(_.endDTS,s)}}class Ve extends ne{constructor(e,t,r,i,s){super(r),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const 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 nt(o,e){const t=Object.getPrototypeOf(o);if(t){const r=Object.getOwnPropertyDescriptor(t,e);return r||nt(t,e)}}function Fe(o,e){const t=nt(o,e);t&&(t.enumerable=!0,Object.defineProperty(o,e,t))}const rt=Math.pow(2,32)-1,Ze=[].push,st={video:1,audio:2,id3:3,text:4};function At(o){return String.fromCharCode.apply(null,o)}function Jt(o,e){const t=o[e]<<8|o[e+1];return t<0?65536+t:t}function pt(o,e){const t=zt(o,e);return t<0?4294967296+t:t}function Bt(o,e){let t=pt(o,e);return t*=Math.pow(2,32),t+=pt(o,e+4),t}function zt(o,e){return o[e]<<24|o[e+1]<<16|o[e+2]<<8|o[e+3]}function $t(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 Me(o){const e=o.byteLength;for(let t=0;t<e;){const r=pt(o,t);if(r>8&&o[t+4]===109&&o[t+5]===111&&o[t+6]===111&&o[t+7]===102)return!0;t=r>1?t+r:e}return!1}function ze(o,e){const t=[];if(!e.length)return t;const r=o.byteLength;for(let i=0;i<r;){const s=pt(o,i),a=At(o.subarray(i+4,i+8)),h=s>1?i+s:r;if(a===e[0])if(e.length===1)t.push(o.subarray(i+8,h));else{const _=ze(o.subarray(i+8,h),e.slice(1));_.length&&Ze.apply(t,_)}i=h}return t}function Ue(o){const e=[],t=o[0];let r=8;const i=pt(o,r);r+=4;let s=0,a=0;t===0?(s=pt(o,r),a=pt(o,r+4),r+=8):(s=Bt(o,r),a=Bt(o,r+8),r+=16),r+=2;let h=o.length+a;const _=Jt(o,r);r+=2;for(let g=0;g<_;g++){let w=r;const R=pt(o,w);w+=4;const G=R&2147483647;if((R&2147483648)>>>31===1)return z.warn("SIDX has hierarchical references (not supported)"),null;const X=pt(o,w);w+=4,e.push({referenceSize:G,subsegmentDuration:X,info:{duration:X/i,start:h,end:h+G-1}}),h+=G,w+=4,r=w}return{earliestPresentationTime:s,timescale:i,version:t,referencesCount:_,references:e}}function ot(o){const e=[],t=ze(o,["moov","trak"]);for(let i=0;i<t.length;i++){const s=t[i],a=ze(s,["tkhd"])[0];if(a){let h=a[0];const _=pt(a,h===0?12:20),g=ze(s,["mdia","mdhd"])[0];if(g){h=g[0];const w=pt(g,h===0?12:20),R=ze(s,["mdia","hdlr"])[0];if(R){const G=At(R.subarray(8,12)),Y={soun:D.AUDIO,vide:D.VIDEO}[G],X=ze(s,["mdia","minf","stbl","stsd"])[0],fe=ut(X);Y?(e[_]={timescale:w,type:Y,stsd:fe},e[Y]=u({timescale:w,id:_},fe)):e[_]={timescale:w,type:G,stsd:fe}}}}}return ze(o,["moov","mvex","trex"]).forEach(i=>{const s=pt(i,4),a=e[s];a&&(a.default={duration:pt(i,12),flags:pt(i,20)})}),e}function ut(o){const e=o.subarray(8),t=e.subarray(86),r=At(e.subarray(4,8));let i=r,s;const a=r==="enca"||r==="encv";if(a){const g=ze(e,[r])[0].subarray(r==="enca"?28:78);ze(g,["sinf"]).forEach(R=>{const G=ze(R,["schm"])[0];if(G){const Y=At(G.subarray(4,8));if(Y==="cbcs"||Y==="cenc"){const X=ze(R,["frma"])[0];X&&(i=At(X))}}})}const h=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const _=ze(t,["avcC"])[0];_&&_.length>3&&(i+="."+De(_[1])+De(_[2])+De(_[3]),s=ue(h==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const _=ze(e,[r])[0],g=ze(_.subarray(28),["esds"])[0];if(g&&g.length>7){let w=4;if(g[w++]!==3)break;w=be(g,w),w+=2;const R=g[w++];if(R&128&&(w+=2),R&64&&(w+=g[w++]),g[w++]!==4)break;w=be(g,w);const G=g[w++];if(G===64)i+="."+De(G);else break;if(w+=12,g[w++]!==5)break;w=be(g,w);const Y=g[w++];let X=(Y&248)>>3;X===31&&(X+=1+((Y&7)<<3)+((g[w]&224)>>5)),i+="."+X}break}case"hvc1":case"hev1":{const _=ze(t,["hvcC"])[0];if(_&&_.length>12){const g=_[1],w=["","A","B","C"][g>>6],R=g&31,G=pt(_,2),Y=(g&32)>>5?"H":"L",X=_[12],fe=_.subarray(6,12);i+="."+w+R,i+="."+G.toString(16).toUpperCase(),i+="."+Y+X;let ce="";for(let Ee=fe.length;Ee--;){const Re=fe[Ee];(Re||ce)&&(ce="."+Re.toString(16).toUpperCase()+ce)}i+=ce}s=ue(h=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{i=ue(i,t)||i;break}case"vp09":{const _=ze(t,["vpcC"])[0];if(_&&_.length>6){const g=_[4],w=_[5],R=_[6]>>4&15;i+="."+Ae(g)+"."+Ae(w)+"."+Ae(R)}break}case"av01":{const _=ze(t,["av1C"])[0];if(_&&_.length>2){const g=_[1]>>>5,w=_[1]&31,R=_[2]>>>7?"H":"M",G=(_[2]&64)>>6,Y=(_[2]&32)>>5,X=g===2&&G?Y?12:10:G?10:8,fe=(_[2]&16)>>4,ce=(_[2]&8)>>3,Ee=(_[2]&4)>>2,Re=_[2]&3;i+="."+g+"."+Ae(w)+R+"."+Ae(X)+"."+fe+"."+ce+Ee+Re+"."+Ae(1)+"."+Ae(1)+"."+Ae(1)+"."+0,s=ue("dav1",t)}break}}return{codec:i,encrypted:a,supplemental:s}}function ue(o,e){const t=ze(e,["dvvC"]),r=t.length?t[0]:ze(e,["dvcC"])[0];if(r){const i=r[2]>>1&127,s=r[2]<<5&32|r[3]>>3&31;return o+"."+Ae(i)+"."+Ae(s)}}function be(o,e){const t=e+5;for(;o[e++]&128&&e<t;);return e}function De(o){return("0"+o.toString(16).toUpperCase()).slice(-2)}function Ae(o){return(o<10?"0":"")+o}function Ne(o,e){if(!o||!e)return o;const t=e.keyId;return t&&e.isCommonEncryption&&ze(o,["moov","trak"]).forEach(i=>{const a=ze(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let h=ze(a,["enca"]);const _=h.length>0;_||(h=ze(a,["encv"])),h.forEach(g=>{const w=_?g.subarray(28):g.subarray(78);ze(w,["sinf"]).forEach(G=>{const Y=je(G);if(Y){const X=Y.subarray(8,24);X.some(fe=>fe!==0)||(z.log(`[eme] Patching keyId in 'enc${_?"a":"v"}>sinf>>tenc' box: ${le.hexDump(X)} -> ${le.hexDump(t)}`),Y.set(t,8))}})})}),o}function je(o){const e=ze(o,["schm"])[0];if(e){const t=At(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return ze(o,["schi","tenc"])[0]}return null}function Qe(o,e){return ze(e,["moof","traf"]).reduce((t,r)=>{const i=ze(r,["tfdt"])[0],s=i[0],a=ze(r,["tfhd"]).reduce((h,_)=>{const g=pt(_,4),w=o[g];if(w){let R=pt(i,4);if(s===1){if(R===rt)return z.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),h;R*=rt+1,R+=pt(i,8)}const G=w.timescale||9e4,Y=R/G;if(N(Y)&&(h===null||Y<h))return Y}return h},null);return a!==null&&N(a)&&(t===null||a<t)?a:t},null)}function at(o,e){let t=0,r=0,i=0;const s=ze(o,["moof","traf"]);for(let a=0;a<s.length;a++){const h=s[a],_=ze(h,["tfhd"])[0],g=pt(_,4),w=e[g];if(!w)continue;const R=w.default,G=pt(_,0)|(R==null?void 0:R.flags);let Y=R==null?void 0:R.duration;G&8&&(G&2?Y=pt(_,12):Y=pt(_,8));const X=w.timescale||9e4,fe=ze(h,["trun"]);for(let ce=0;ce<fe.length;ce++){if(t=Je(fe[ce]),!t&&Y){const Ee=pt(fe[ce],4);t=Y*Ee}w.type===D.VIDEO?r+=t/X:w.type===D.AUDIO&&(i+=t/X)}}if(r===0&&i===0){let a=1/0,h=0,_=0;const g=ze(o,["sidx"]);for(let w=0;w<g.length;w++){const R=Ue(g[w]);if(R!=null&&R.references){a=Math.min(a,R.earliestPresentationTime/R.timescale);const G=R.references.reduce((Y,X)=>Y+X.info.duration||0,0);h=Math.max(h,G+R.earliestPresentationTime/R.timescale),_=h-a}}if(_&&N(_))return _}return r||i}function Je(o){const e=pt(o,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let r=0;const i=pt(o,4);for(let s=0;s<i;s++){if(e&256){const a=pt(o,t);r+=a,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return r}function We(o,e,t){ze(e,["moof","traf"]).forEach(r=>{ze(r,["tfhd"]).forEach(i=>{const s=pt(i,4),a=o[s];if(!a)return;const h=a.timescale||9e4;ze(r,["tfdt"]).forEach(_=>{const g=_[0],w=t*h;if(w){let R=pt(_,4);if(g===0)R-=w,R=Math.max(R,0),$t(_,4,R);else{R*=Math.pow(2,32),R+=pt(_,8),R-=w,R=Math.max(R,0);const G=Math.floor(R/(rt+1)),Y=Math.floor(R%(rt+1));$t(_,4,G),$t(_,8,Y)}}})})})}function vt(o){const e={valid:null,remainder:null},t=ze(o,["moof"]);if(t.length<2)return e.remainder=o,e;const r=t[t.length-1];return e.valid=o.slice(0,r.byteOffset-8),e.remainder=o.slice(r.byteOffset-8),e}function gt(o,e){const t=new Uint8Array(o.length+e.length);return t.set(o),t.set(e,o.length),t}function mt(o,e){const t=[],r=e.samples,i=e.timescale,s=e.id;let a=!1;return ze(r,["moof"]).map(_=>{const g=_.byteOffset-8;ze(_,["traf"]).map(R=>{const G=ze(R,["tfdt"]).map(Y=>{const X=Y[0];let fe=pt(Y,4);return X===1&&(fe*=Math.pow(2,32),fe+=pt(Y,8)),fe/i})[0];return G!==void 0&&(o=G),ze(R,["tfhd"]).map(Y=>{const X=pt(Y,4),fe=pt(Y,0)&16777215,ce=(fe&1)!==0,Ee=(fe&2)!==0,Re=(fe&8)!==0;let Te=0;const Ge=(fe&16)!==0;let Ke=0;const ct=(fe&32)!==0;let qe=8;X===s&&(ce&&(qe+=8),Ee&&(qe+=4),Re&&(Te=pt(Y,qe),qe+=4),Ge&&(Ke=pt(Y,qe),qe+=4),ct&&(qe+=4),e.type==="video"&&(a=xt(e.codec)),ze(R,["trun"]).map(it=>{const ht=it[0],Xe=pt(it,0)&16777215,St=(Xe&1)!==0;let Pt=0;const Sr=(Xe&4)!==0,ir=(Xe&256)!==0;let Xt=0;const Gt=(Xe&512)!==0;let Qt=0;const qt=(Xe&1024)!==0,Et=(Xe&2048)!==0;let Dt=0;const lr=pt(it,4);let nr=8;St&&(Pt=pt(it,nr),nr+=4),Sr&&(nr+=4);let vr=Pt+g;for(let Lr=0;Lr<lr;Lr++){if(ir?(Xt=pt(it,nr),nr+=4):Xt=Te,Gt?(Qt=pt(it,nr),nr+=4):Qt=Ke,qt&&(nr+=4),Et&&(ht===0?Dt=pt(it,nr):Dt=zt(it,nr),nr+=4),e.type===D.VIDEO){let Ur=0;for(;Ur<Qt;){const Vr=pt(r,vr);if(vr+=4,Lt(a,r[vr])){const Pi=r.subarray(vr,vr+Vr);yt(Pi,a?2:1,o+Dt/i,t)}vr+=Vr,Ur+=Vr+4}}o+=Xt/i}}))})})}),t}function xt(o){if(!o)return!1;const e=o.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function Lt(o,e){if(o){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function yt(o,e,t,r){const i=Mt(o);let s=0;s+=e;let a=0,h=0,_=0;for(;s<i.length;){a=0;do{if(s>=i.length)break;_=i[s++],a+=_}while(_===255);h=0;do{if(s>=i.length)break;_=i[s++],h+=_}while(_===255);const g=i.length-s;let w=s;if(h<g)s+=h;else if(h>g){z.error(`Malformed SEI payload. ${h} is too small, only ${g} bytes left to parse.`);break}if(a===4){if(i[w++]===181){const G=Jt(i,w);if(w+=2,G===49){const Y=pt(i,w);if(w+=4,Y===1195456820){const X=i[w++];if(X===3){const fe=i[w++],ce=31&fe,Ee=64&fe,Re=Ee?2+ce*3:0,Te=new Uint8Array(Re);if(Ee){Te[0]=fe;for(let Ge=1;Ge<Re;Ge++)Te[Ge]=i[w++]}r.push({type:X,payloadType:a,pts:t,bytes:Te})}}}}}else if(a===5&&h>16){const R=[];for(let X=0;X<16;X++){const fe=i[w++].toString(16);R.push(fe.length==1?"0"+fe:fe),(X===3||X===5||X===7||X===9)&&R.push("-")}const G=h-16,Y=new Uint8Array(G);for(let X=0;X<G;X++)Y[X]=i[w++];r.push({payloadType:a,pts:t,uuid:R.join(""),userData:_e(Y),userDataBytes:Y})}}}function Mt(o){const e=o.byteLength,t=[];let r=1;for(;r<e-2;)o[r]===0&&o[r+1]===0&&o[r+2]===3?(t.push(r+2),r+=2):r++;if(t.length===0)return o;const i=e-t.length,s=new Uint8Array(i);let a=0;for(r=0;r<i;a++,r++)a===t[0]&&(a++,t.shift()),s[r]=o[a];return s}function Nt(o){const e=o[0];let t="",r="",i=0,s=0,a=0,h=0,_=0,g=0;if(e===0){for(;At(o.subarray(g,g+1))!=="\0";)t+=At(o.subarray(g,g+1)),g+=1;for(t+=At(o.subarray(g,g+1)),g+=1;At(o.subarray(g,g+1))!=="\0";)r+=At(o.subarray(g,g+1)),g+=1;r+=At(o.subarray(g,g+1)),g+=1,i=pt(o,12),s=pt(o,16),h=pt(o,20),_=pt(o,24),g=28}else if(e===1){g+=4,i=pt(o,g),g+=4;const R=pt(o,g);g+=4;const G=pt(o,g);for(g+=4,a=ql(2,32)*R+G,B(a)||(a=Number.MAX_SAFE_INTEGER,z.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),h=pt(o,g),g+=4,_=pt(o,g),g+=4;At(o.subarray(g,g+1))!=="\0";)t+=At(o.subarray(g,g+1)),g+=1;for(t+=At(o.subarray(g,g+1)),g+=1;At(o.subarray(g,g+1))!=="\0";)r+=At(o.subarray(g,g+1)),g+=1;r+=At(o.subarray(g,g+1)),g+=1}const w=o.subarray(g,o.byteLength);return{schemeIdUri:t,value:r,timeScale:i,presentationTime:a,presentationTimeDelta:s,eventDuration:h,id:_,payload:w}}function j(o,...e){const t=e.length;let r=8,i=t;for(;i--;)r+=e[i].byteLength;const s=new Uint8Array(r);for(s[0]=r>>24&255,s[1]=r>>16&255,s[2]=r>>8&255,s[3]=r&255,s.set(o,4),i=0,r=8;i<t;i++)s.set(e[i],r),r+=e[i].byteLength;return s}function Z(o,e,t){if(o.byteLength!==16)throw new RangeError("Invalid system id");let r,i;r=0,i=new Uint8Array;let s;r>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),j([112,115,115,104],new Uint8Array([r,0,0,0]),o,s,i,a,t||new Uint8Array)}function tt(o){const e=[];if(o instanceof ArrayBuffer){const t=o.byteLength;let r=0;for(;r+32<t;){const i=new DataView(o,r),s=oe(i);e.push(s),r+=s.size}}return e}function oe(o){const e=o.getUint32(0),t=o.byteOffset,r=o.byteLength;if(r<e)return{offset:t,size:r};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=le.hexDump(new Uint8Array(a,t+12,16)),_=o.getUint32(28);let g=null,w=null;if(s===0){if(e-32<_||_<22)return{offset:t,size:e};w=new Uint8Array(a,t+32,_)}else if(s===1){if(!_||r<t+32+_*16+16)return{offset:t,size:e};g=[];for(let R=0;R<_;R++)g.push(new Uint8Array(a,t+32+R*16,16))}return{version:s,systemId:h,kids:g,data:w,offset:t,size:e}}const xe=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Kt={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 ke(o,e){const t=Kt[e];return!!t&&!!t[o.slice(0,4)]}function Pe(o,e,t=!0){return!o.split(",").some(r=>!He(r,e,t))}function He(o,e,t=!0){var r;const i=ie(t);return(r=i==null?void 0:i.isTypeSupported(he(o,e)))!=null?r:!1}function he(o,e){return`${e}/mp4;codecs=${o}`}function ge(o){if(o){const e=o.substring(0,4);return Kt.video[e]}return 2}function ye(o){const e=xe();return o.split(",").reduce((t,r)=>{const s=e&&xt(r)?9:Kt.video[r];return s?(s*2+t)/(t?3:2):(Kt.audio[r]+t)/(t?2:1)},0)}const Ie={};function ae(o,e=!0){if(Ie[o])return Ie[o];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[o];for(let i=0;i<t.length;i++){var r;if(He(t[i],"audio",e))return Ie[o]=t[i],t[i];if(t[i]==="mp3"&&(r=ie(e))!=null&&r.isTypeSupported("audio/mpeg"))return""}return o}const _t=/flac|opus|mp4a\.40\.34/i;function we(o,e=!0){return o.replace(_t,t=>ae(t.toLowerCase(),e))}function kt(o,e){const t=[];if(o){const r=o.split(",");for(let i=0;i<r.length;i++)ke(r[i],"video")||t.push(r[i])}return e&&t.push(e),t.join(",")}function Ft(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 r=t.length;r--;)if(t[r].substring(0,4)===o.substring(0,4))return t[r]}return t[0]}}return e||o}function er(o){const e=o.split(",");for(let t=0;t<e.length;t++){const r=e[t].split(".");if(r.length>2){let i=r.shift()+".";i+=parseInt(r.shift()).toString(16),i+=("000"+parseInt(r.shift()).toString(16)).slice(-4),e[t]=i}}return e.join(",")}function Vt(o){if(o.startsWith("av01.")){const e=o.split("."),t=["0","111","01","01","01","0"];for(let r=e.length;r>4&&r<10;r++)e[r]=t[r-4];return e.join(".")}return o}function It(o){const e=ie(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 Tt(o){return o.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const fr={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function $r(o,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:o}}const zr={};function Qr(o,e,t,r,i,s){const a=o.audioCodec?o.audioGroups:null,h=s==null?void 0:s.audioCodec,_=s==null?void 0:s.channels,g=_?parseInt(_):h?1/0:2;let w=null;if(a!=null&&a.length)try{a.length===1&&a[0]?w=e.groups[a[0]].channels:w=a.reduce((R,G)=>{if(G){const Y=e.groups[G];if(!Y)throw new Error(`Audio track group ${G} not found`);Object.keys(Y.channels).forEach(X=>{R[X]=(R[X]||0)+Y.channels[X]})}return R},{2:0})}catch(R){return!0}return o.videoCodec!==void 0&&(o.width>1920&&o.height>1088||o.height>1920&&o.width>1088||o.frameRate>Math.max(r,30)||o.videoRange!=="SDR"&&o.videoRange!==t||o.bitrate>Math.max(i,8e6))||!!w&&N(g)&&Object.keys(w).some(R=>parseInt(R)>g)}function Ot(o,e,t){const r=o.videoCodec,i=o.audioCodec;if(!r&&!i||!t)return Promise.resolve(fr);const s=[];if(r){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 _=r.split(","),g=navigator.userAgent;if(_.some(w=>xt(w))&&xe())return Promise.resolve($r(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (${g})`),s));s.push.apply(s,_.map(w=>({type:"media-source",video:u(u({},a),{},{contentType:he(Vt(w),"video")})})))}return i&&o.audioGroups&&o.audioGroups.forEach(a=>{var h;a&&((h=e.groups[a])==null||h.tracks.forEach(_=>{if(_.groupId===a){const g=_.channels||"",w=parseFloat(g);N(w)&&w>2&&s.push.apply(s,i.split(",").map(R=>({type:"media-source",audio:{contentType:he(R,"audio"),channels:""+w}})))}}))}),Promise.all(s.map(a=>{const h=Yt(a);return zr[h]||(zr[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 Yt(o){const{audio:e,video:t}=o,r=t||e;if(r){const i=Tt(r.contentType);if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}const wr=["NONE","TYPE-0","TYPE-1",null];function Hr(o){return wr.indexOf(o)>-1}const Rr=["SDR","PQ","HLG"];function di(o){return!!o&&Rr.indexOf(o)>-1}var Er={No:"",Yes:"YES",v2:"v2"};function wi(o){const{canSkipUntil:e,canSkipDateRanges:t,age:r}=o,i=r<e/2;return e&&i?t?Er.v2:Er.Yes:Er.No}class si{constructor(e,t,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=r}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 Ri{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(r=>!!r).map(r=>r.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const r=(t=e.supplemental)==null?void 0:t.videoCodec;r&&r!==e.videoCodec&&(this.codecSet+=`,${r.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 Ht(this._audioGroups,e)}hasSubtitleGroup(e){return Ht(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let r=this._audioGroups;r||(r=this._audioGroups=[]),r.indexOf(t)===-1&&r.push(t)}else if(e==="text"){let r=this._subtitleGroups;r||(r=this._subtitleGroups=[]),r.indexOf(t)===-1&&r.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 Ht(o,e){return!e||!o?!1:o.indexOf(e)!==-1}function Ut(){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 ur(o,e){let t=!1,r=[];if(o&&(t=o!=="SDR",r=[o]),e){r=e.allowedVideoRanges||Rr.slice(0);const i=r.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:i&&Ut(),t||(r=["SDR"])}return{preferHDR:t,allowedVideoRanges:r}}const pr=o=>{const e=new WeakSet;return(t,r)=>{if(o&&(r=o(t,r)),typeof r=="object"&&r!==null){if(e.has(r))return;e.add(r)}return r}},sr=(o,e)=>JSON.stringify(o,pr(e));function gi(o,e,t,r,i){const s=Object.keys(o),a=r==null?void 0:r.channels,h=r==null?void 0:r.audioCodec,_=i==null?void 0:i.videoCodec,g=a&&parseInt(a)===2;let w=!1,R=!1,G=1/0,Y=1/0,X=1/0,fe=1/0,ce=0,Ee=[];const{preferHDR:Re,allowedVideoRanges:Te}=ur(e,i);for(let it=s.length;it--;){const ht=o[s[it]];w||(w=ht.channels[2]>0),G=Math.min(G,ht.minHeight),Y=Math.min(Y,ht.minFramerate),X=Math.min(X,ht.minBitrate),Te.filter(St=>ht.videoRanges[St]>0).length>0&&(R=!0)}G=N(G)?G:0,Y=N(Y)?Y:0;const Ge=Math.max(1080,G),Ke=Math.max(30,Y);X=N(X)?X:t,t=Math.max(X,t),R||(e=void 0);const ct=s.length>1;return{codecSet:s.reduce((it,ht)=>{const Xe=o[ht];if(ht===it)return it;if(Ee=R?Te.filter(St=>Xe.videoRanges[St]>0):[],ct){if(Xe.minBitrate>t)return kr(ht,`min bitrate of ${Xe.minBitrate} > current estimate of ${t}`),it;if(!Xe.hasDefaultAudio)return kr(ht,"no renditions with default or auto-select sound found"),it;if(h&&ht.indexOf(h.substring(0,4))%5!==0)return kr(ht,`audio codec preference "${h}" not found`),it;if(a&&!g){if(!Xe.channels[a])return kr(ht,`no renditions with ${a} channel sound found (channels options: ${Object.keys(Xe.channels)})`),it}else if((!h||g)&&w&&Xe.channels[2]===0)return kr(ht,"no renditions with stereo sound found"),it;if(Xe.minHeight>Ge)return kr(ht,`min resolution of ${Xe.minHeight} > maximum of ${Ge}`),it;if(Xe.minFramerate>Ke)return kr(ht,`min framerate of ${Xe.minFramerate} > maximum of ${Ke}`),it;if(!Ee.some(St=>Xe.videoRanges[St]>0))return kr(ht,`no variants with VIDEO-RANGE of ${sr(Ee)} found`),it;if(_&&ht.indexOf(_.substring(0,4))%5!==0)return kr(ht,`video codec preference "${_}" not found`),it;if(Xe.maxScore<ce)return kr(ht,`max score of ${Xe.maxScore} < selected max of ${ce}`),it}return it&&(ye(ht)>=ye(it)||Xe.fragmentError>o[it].fragmentError)?it:(fe=Xe.minIndex,ce=Xe.maxScore,ht)},void 0),videoRanges:Ee,preferHDR:Re,minFramerate:Y,minBitrate:X,minIndex:fe}}function kr(o,e){z.log(`[abr] start candidates with "${o}" ignored because ${e}`)}function ui(o){return o.reduce((e,t)=>{let r=e.groups[t.groupId];r||(r=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),r.tracks.push(t);const i=t.channels||"2";return r.channels[i]=(r.channels[i]||0)+1,r.hasDefault=r.hasDefault||t.default,r.hasAutoSelect=r.hasAutoSelect||t.autoselect,r.hasDefault&&(e.hasDefaultAudio=!0),r.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Br(o,e,t,r){return o.slice(t,r+1).reduce((i,s,a)=>{if(!s.codecSet)return i;const h=s.audioGroups;let _=i[s.codecSet];_||(i[s.codecSet]=_={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:a,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!h,fragmentError:0}),_.minBitrate=Math.min(_.minBitrate,s.bitrate);const g=Math.min(s.height,s.width);return _.minHeight=Math.min(_.minHeight,g),_.minFramerate=Math.min(_.minFramerate,s.frameRate),_.minIndex=Math.min(_.minIndex,a),_.maxScore=Math.max(_.maxScore,s.score),_.fragmentError+=s.fragmentError,_.videoRanges[s.videoRange]=(_.videoRanges[s.videoRange]||0)+1,h&&h.forEach(w=>{if(!w)return;const R=e.groups[w];R&&(_.hasDefaultAudio=_.hasDefaultAudio||e.hasDefaultAudio?R.hasDefault:R.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(R.channels).forEach(G=>{_.channels[G]=(_.channels[G]||0)+R.channels[G]}))}),i},{})}function mr(o){if(!o)return o;const{lang:e,assocLang:t,characteristics:r,channels:i,audioCodec:s}=o;return{lang:e,assocLang:t,characteristics:r,channels:i,audioCodec:s}}function jr(o,e,t){if("attrs"in o){const r=e.indexOf(o);if(r!==-1)return r}for(let r=0;r<e.length;r++){const i=e[r];if(ai(o,i,t))return r}return-1}function ai(o,e,t){const{groupId:r,name:i,lang:s,assocLang:a,default:h}=o,_=o.forced;return(r===void 0||e.groupId===r)&&(i===void 0||e.name===i)&&(s===void 0||Gr(s,e.lang))&&(s===void 0||e.assocLang===a)&&(h===void 0||e.default===h)&&(_===void 0||e.forced===_)&&(!("characteristics"in o)||pi(o.characteristics||"",e.characteristics))&&(t===void 0||t(o,e))}function Gr(o,e="--"){return o.length===e.length?o===e:o.startsWith(e)||e.startsWith(o)}function pi(o,e=""){const t=o.split(","),r=e.split(",");return t.length===r.length&&!t.some(i=>r.indexOf(i)===-1)}function cr(o,e){const{audioCodec:t,channels:r}=o;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(r===void 0||r===(e.channels||"2"))}function Cr(o,e,t,r,i){const s=e[r],h=e.reduce((G,Y,X)=>{const fe=Y.uri;return(G[fe]||(G[fe]=[])).push(X),G},{})[s.uri];h.length>1&&(r=Math.max.apply(Math,h));const _=s.videoRange,g=s.frameRate,w=s.codecSet.substring(0,4),R=yr(e,r,G=>{if(G.videoRange!==_||G.frameRate!==g||G.codecSet.substring(0,4)!==w)return!1;const Y=G.audioGroups,X=t.filter(fe=>!Y||Y.indexOf(fe.groupId)!==-1);return jr(o,X,i)>-1});return R>-1?R:yr(e,r,G=>{const Y=G.audioGroups,X=t.filter(fe=>!Y||Y.indexOf(fe.groupId)!==-1);return jr(o,X,i)>-1})}function yr(o,e,t){for(let r=e;r>-1;r--)if(t(o[r]))return r;for(let r=e+1;r<o.length;r++)if(t(o[r]))return r;return-1}function Tr(o,e){var t;return!!o&&o!==((t=e.loadLevelObj)==null?void 0:t.uri)}class ci extends F{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 r;const{fragCurrent:i,partCurrent:s,hls:a}=this,{autoLevelEnabled:h,media:_}=a;if(!i||!_)return;const g=performance.now(),w=s?s.stats:i.stats,R=s?s.duration:i.duration,G=g-w.loading.start,Y=a.minAutoLevel,X=i.level,fe=this._nextAutoLevel;if(w.aborted||w.loaded&&w.loaded===w.total||X<=Y){this.clearTimer(),this._nextAutoLevel=-1;return}if(!h)return;const ce=fe>-1&&fe!==X,Ee=!!t||ce;if(!Ee&&(_.paused||!_.playbackRate||!_.readyState))return;const Re=a.mainForwardBufferInfo;if(!Ee&&Re===null)return;const Te=this.bwEstimator.getEstimateTTFB(),Ge=Math.abs(_.playbackRate);if(G<=Math.max(Te,1e3*(R/(Ge*2))))return;const Ke=Re?Re.len/Ge:0,ct=w.loading.first?w.loading.first-w.loading.start:-1,qe=w.loaded&&ct>-1,it=this.getBwEstimate(),ht=a.levels,Xe=ht[X],St=Math.max(w.loaded,Math.round(R*(i.bitrate||Xe.averageBitrate)/8));let Pt=qe?G-ct:G;Pt<1&&qe&&(Pt=Math.min(G,w.loaded*8/it));const Sr=qe?w.loaded*1e3/Pt:0,ir=Te/1e3,Xt=Sr?(St-w.loaded)/Sr:St*8/it+ir;if(Xt<=Ke)return;const Gt=Sr?Sr*8:it,Qt=((r=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:r.live)===!0,qt=this.hls.config.abrBandWidthUpFactor;let Et=Number.POSITIVE_INFINITY,Dt;for(Dt=X-1;Dt>Y;Dt--){const Lr=ht[Dt].maxBitrate,Ur=!ht[Dt].details||Qt;if(Et=this.getTimeToLoadFrag(ir,Gt,R*Lr,Ur),Et<Math.min(Ke,R+ir))break}if(Et>=Xt||Et>R*10)return;qe?this.bwEstimator.sample(G-Math.min(Te,ct),w.loaded):this.bwEstimator.sampleTTFB(G);const lr=ht[Dt].maxBitrate;this.getBwEstimate()*qt>lr&&this.resetEstimator(lr);const nr=this.findBestLevel(lr,Y,Dt,0,Ke,1,1);nr>-1&&(Dt=nr),this.warn(`Fragment ${i.sn}${s?" part "+s.index:""} of level ${X} is loading too slowly;
|
|
|
Fragment duration: ${i.duration.toFixed(3)}
|
|
|
Time to underbuffer: ${Ke.toFixed(3)} s
|
|
|
Estimated load time for current fragment: ${Xt.toFixed(3)} s
|
|
|
Estimated load time for down switch fragment: ${Et.toFixed(3)} s
|
|
|
TTFB estimate: ${ct|0} ms
|
|
|
Current BW estimate: ${N(it)?it|0:"Unknown"} bps
|
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
|
Switching to level ${Dt} @ ${lr|0} bps`),a.nextLoadLevel=a.nextAutoLevel=Dt,this.clearTimer();const vr=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===Dt&&Dt>0){const Lr=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${Dt>0?"and switching down":""}
|
|
|
Fragment duration: ${i.duration.toFixed(3)} s
|
|
|
Time to underbuffer: ${Lr.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,Dt>Y){let Ur=this.findBestLevel(this.hls.levels[Y].bitrate,Y,Dt,0,Lr,1,1);Ur===-1&&(Ur=Y),this.hls.nextLoadLevel=this.hls.nextAutoLevel=Ur,this.resetEstimator(this.hls.levels[Ur].bitrate)}}};ce||Xt>Et*2?vr():this.timer=self.setInterval(vr,Et*1e3),a.trigger(d.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:s,stats:w})},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 E(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(d.MANIFEST_LOADING,this.onManifestLoading,this),e.on(d.FRAG_LOADING,this.onFragLoading,this),e.on(d.FRAG_LOADED,this.onFragLoaded,this),e.on(d.FRAG_BUFFERED,this.onFragBuffered,this),e.on(d.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(d.LEVEL_LOADED,this.onLevelLoaded,this),e.on(d.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(d.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(d.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(d.MANIFEST_LOADING,this.onManifestLoading,this),e.off(d.FRAG_LOADING,this.onFragLoading,this),e.off(d.FRAG_LOADED,this.onFragLoaded,this),e.off(d.FRAG_BUFFERED,this.onFragBuffered,this),e.off(d.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(d.LEVEL_LOADED,this.onLevelLoaded,this),e.off(d.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(d.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(d.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 r=t.frag;if(!this.ignoreFragment(r)){if(!r.bitrateTest){var i;this.fragCurrent=r,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case A.BUFFER_ADD_CODEC_ERROR:case A.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case A.FRAG_LOAD_TIMEOUT:{const r=t.frag,{fragCurrent:i,partCurrent:s}=this;if(r&&i&&r.sn===i.sn&&r.level===i.level){const a=performance.now(),h=s?s.stats:r.stats,_=a-h.loading.start,g=h.loading.first?h.loading.first-h.loading.start:-1;if(h.loaded&&g>-1){const R=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(_-Math.min(R,g),h.loaded)}else this.bwEstimator.sampleTTFB(_)}break}}}getTimeToLoadFrag(e,t,r,i){const s=e+r/t,a=i?e+this.lastLevelLoadSec:0;return s+a}onLevelLoaded(e,t){const r=this.hls.config,{loading:i}=t.stats,s=i.end-i.first;N(s)&&(this.lastLevelLoadSec=s/1e3),t.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:r}){const i=r?r.stats:t.stats;if(t.type===b.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const s=r?r.duration:t.duration,a=this.hls.levels[t.level],h=(a.loaded?a.loaded.bytes:0)+i.loaded,_=(a.loaded?a.loaded.duration:0)+s;a.loaded={bytes:h,duration:_},a.realBitrate=Math.round(8*h/_)}if(t.bitrateTest){const s={stats:i,frag:t,part:r,id:t.type};this.onFragBuffered(d.FRAG_BUFFERED,s),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:r,part:i}=t,s=i!=null&&i.stats.loaded?i.stats:r.stats;if(s.aborted||this.ignoreFragment(r))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(),r.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==b.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,r=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,s=this.findBestLevel(r,t,e,0,i,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,r=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!r||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const s=r&&i?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:r}=this;if(r.levels.length<=1)return r.loadLevel;const{maxAutoLevel:i,config:s,minAutoLevel:a}=r,h=t?t.duration:e?e.duration:0,_=this.getBwEstimate(),g=this.getStarvationDelay();let w=s.abrBandWidthFactor,R=s.abrBandWidthUpFactor;if(g){const ce=this.findBestLevel(_,a,i,g,0,w,R);if(ce>=0)return this.rebufferNotice=-1,ce}let G=h?Math.min(h,s.maxStarvationDelay):s.maxStarvationDelay;if(!g){const ce=this.bitrateTestDelay;ce&&(G=(h?Math.min(h,s.maxLoadingDelay):s.maxLoadingDelay)-ce,this.info(`bitrate test took ${Math.round(1e3*ce)}ms, set first fragment max fetchDuration to ${Math.round(1e3*G)} ms`),w=R=1)}const Y=this.findBestLevel(_,a,i,g,G,w,R);if(this.rebufferNotice!==Y&&(this.rebufferNotice=Y,this.info(`${g?"rebuffering expected":"buffer is empty"}, optimal quality level ${Y}`)),Y>-1)return Y;const X=r.levels[a],fe=r.loadLevelObj;return fe&&(X==null?void 0:X.bitrate)<fe.bitrate?a:r.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const r=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/r}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,r,i,s,a,h){var _;const g=i+s,w=this.lastLoadedFragLevel,R=w===-1?this.hls.firstLevel:w,{fragCurrent:G,partCurrent:Y}=this,{levels:X,allAudioTracks:fe,loadLevel:ce,config:Ee}=this.hls;if(X.length===1)return 0;const Re=X[R],Te=!!((_=this.hls.latestLevelDetails)!=null&&_.live),Ge=ce===-1||w===-1;let Ke,ct="SDR",qe=(Re==null?void 0:Re.frameRate)||0;const{audioPreference:it,videoPreference:ht}=Ee,Xe=this.audioTracksByGroup||(this.audioTracksByGroup=ui(fe));let St=-1;if(Ge){if(this.firstSelection!==-1)return this.firstSelection;const Gt=this.codecTiers||(this.codecTiers=Br(X,Xe,t,r)),Qt=gi(Gt,ct,e,it,ht),{codecSet:qt,videoRanges:Et,minFramerate:Dt,minBitrate:lr,minIndex:nr,preferHDR:vr}=Qt;St=nr,Ke=qt,ct=vr?Et[Et.length-1]:Et[0],qe=Dt,e=Math.max(e,lr),this.log(`picked start tier ${sr(Qt)}`)}else Ke=Re==null?void 0:Re.codecSet,ct=Re==null?void 0:Re.videoRange;const Pt=Y?Y.duration:G?G.duration:0,Sr=this.bwEstimator.getEstimateTTFB()/1e3,ir=[];for(let Gt=r;Gt>=t;Gt--){var Xt;const Qt=X[Gt],qt=Gt>R;if(!Qt)continue;if(Ee.useMediaCapabilities&&!Qt.supportedResult&&!Qt.supportedPromise){const Ur=navigator.mediaCapabilities;typeof(Ur==null?void 0:Ur.decodingInfo)=="function"&&(Qr(Qt,Xe,ct,qe,e,it)||xt(Qt.videoCodec))?(Qt.supportedPromise=Ot(Qt,Xe,Ur),Qt.supportedPromise.then(Vr=>{if(!this.hls)return;Qt.supportedResult=Vr;const Pi=this.hls.levels,Hi=Pi.indexOf(Qt);Vr.error?this.warn(`MediaCapabilities decodingInfo error: "${Vr.error}" for level ${Hi} ${sr(Vr)}`):Vr.supported||(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${Hi} ${sr(Vr)}`),Hi>-1&&Pi.length>1&&(this.log(`Removing unsupported level ${Hi}`),this.hls.removeLevel(Hi),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):Qt.supportedResult=fr}if((Ke&&Qt.codecSet!==Ke||ct&&Qt.videoRange!==ct||qt&&qe>Qt.frameRate||!qt&&qe>0&&qe<Qt.frameRate||Qt.supportedResult&&!((Xt=Qt.supportedResult.decodingInfoResults)!=null&&Xt[0].smooth))&&(!Ge||Gt!==St)){ir.push(Gt);continue}const Et=Qt.details,Dt=(Y?Et==null?void 0:Et.partTarget:Et==null?void 0:Et.averagetargetduration)||Pt;let lr;qt?lr=h*e:lr=a*e;const nr=Pt&&i>=Pt*2&&s===0?Qt.averageBitrate:Qt.maxBitrate,vr=this.getTimeToLoadFrag(Sr,lr,nr*Dt,Et===void 0);if(lr>=nr&&(Gt===w||Qt.loadError===0&&Qt.fragmentError===0)&&(vr<=Sr||!N(vr)||Te&&!this.bitrateTestDelay||vr<g)){const Ur=this.forcedAutoLevel;return Gt!==ce&&(Ur===-1||Ur!==ce)&&(ir.length&&this.trace(`Skipped level(s) ${ir.join(",")} of ${r} max with CODECS and VIDEO-RANGE:"${X[ir[0]].codecs}" ${X[ir[0]].videoRange}; not compatible with "${Ke}" ${ct}`),this.info(`switch candidate:${R}->${Gt} adjustedbw(${Math.round(lr)})-bitrate=${Math.round(lr-nr)} ttfb:${Sr.toFixed(1)} avgDuration:${Dt.toFixed(1)} maxFetchDuration:${g.toFixed(1)} fetchDuration:${vr.toFixed(1)} firstSelection:${Ge} codecSet:${Qt.codecSet} videoRange:${Qt.videoRange} hls.loadLevel:${ce}`)),Ge&&(this.firstSelection=Gt),Gt}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:r}=this.hls;return Math.min(Math.max(e,r),t)}}const oi={search:function(o,e){let t=0,r=o.length-1,i=null,s=null;for(;t<=r;){i=(t+r)/2|0,s=o[i];const a=e(s);if(a>0)t=i+1;else if(a<0)r=i-1;else return s}return null}};function Mi(o,e,t){if(e===null||!Array.isArray(o)||!o.length||!N(e))return null;const r=o[0].programDateTime;if(e<(r||0))return null;const i=o[o.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let s=0;s<o.length;++s){const a=o[s];if(Fi(e,t,a))return a}return null}function hr(o,e,t=0,r=0,i=.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)&&ki(t,r,s)===0||Ar(s,o,Math.min(i,r))))return s;const a=oi.search(e,ki.bind(null,t,r));return a&&(a!==o||!s)?a:s}function Ar(o,e,t){if(e&&e.start===0&&e.level<o.level&&(e.endPTS||0)>0){const r=e.tagList.reduce((i,s)=>(s[0]==="INF"&&(i+=parseFloat(s[1])),i),t);return o.start<=r}return!1}function ki(o=0,e=0,t){if(t.start<=o&&t.start+t.duration>o)return 0;const r=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-r<=o?1:t.start-r>o&&t.start?-1:0}function Fi(o,e,t){const r=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-r>o}function ji(o,e){return oi.search(o,t=>t.cc<e?1:t.cc>e?-1:0)}function In(o,e,t){if(o&&o.startCC<=e&&o.endCC>=e){const r=t.start,i=t.end;let s=o.fragments;if(!t.relurl){const{fragmentHint:a}=o;a&&(s=s.concat(a))}return oi.search(s,a=>a.cc<e||a.end<=r?1:a.cc>e||a.start>=i?-1:0)}return null}function Zi(o){switch(o.details){case A.FRAG_LOAD_TIMEOUT:case A.KEY_LOAD_TIMEOUT:case A.LEVEL_LOAD_TIMEOUT:case A.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Sn(o,e){const t=Zi(e);return o.default[`${t?"timeout":"error"}Retry`]}function mi(o,e){const t=o.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*o.retryDelayMs,o.maxRetryDelayMs)}function on(o){return u(u({},o),{errorRetry:null,timeoutRetry:null})}function Xi(o,e,t,r){if(!o)return!1;const i=r==null?void 0:r.code,s=e<o.maxNumRetry&&(ln(i)||!!t);return o.shouldRetry?o.shouldRetry(o,e,t,r,s):s}function ln(o){return o===0&&navigator.onLine===!1||!!o&&(o<400||o>499)}var Xr={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},et={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class rr extends F{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(d.ERROR,this.onError,this),e.on(d.MANIFEST_LOADING,this.onManifestLoading,this),e.on(d.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(d.ERROR,this.onError,this),e.off(d.ERROR,this.onErrorOut,this),e.off(d.MANIFEST_LOADING,this.onManifestLoading,this),e.off(d.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)===b.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var r;if(t.fatal)return;const i=this.hls,s=t.context;switch(t.details){case A.FRAG_LOAD_ERROR:case A.FRAG_LOAD_TIMEOUT:case A.KEY_LOAD_ERROR:case A.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case A.FRAG_PARSING_ERROR:if((r=t.frag)!=null&&r.gap){t.errorAction=Mr();return}case A.FRAG_GAP:case A.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Xr.SendAlternateToPenaltyBox;return}case A.LEVEL_EMPTY_ERROR:case A.LEVEL_PARSING_ERROR:{var a,h;const g=t.parent===b.MAIN?t.level:i.loadLevel;t.details===A.LEVEL_EMPTY_ERROR&&((a=t.context)!=null&&(h=a.levelDetails)!=null&&h.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,g):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,g))}return;case A.LEVEL_LOAD_ERROR:case A.LEVEL_LOAD_TIMEOUT:typeof(s==null?void 0:s.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.level));return;case A.AUDIO_TRACK_LOAD_ERROR:case A.AUDIO_TRACK_LOAD_TIMEOUT:case A.SUBTITLE_LOAD_ERROR:case A.SUBTITLE_TRACK_LOAD_TIMEOUT:if(s){const g=i.loadLevelObj;if(g&&(s.type===U.AUDIO_TRACK&&g.hasAudioGroup(s.groupId)||s.type===U.SUBTITLE_TRACK&&g.hasSubtitleGroup(s.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=Xr.SendAlternateToPenaltyBox,t.errorAction.flags=et.MoveAllAlternatesMatchingHost;return}}return;case A.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const g=i.loadLevelObj,w=g==null?void 0:g.attrs["HDCP-LEVEL"];w?t.errorAction={action:Xr.SendAlternateToPenaltyBox,flags:et.MoveAllAlternatesMatchingHDCP,hdcpLevel:w}:this.keySystemError(t)}return;case A.BUFFER_ADD_CODEC_ERROR:case A.REMUX_ALLOC_ERROR:case A.BUFFER_APPEND_ERROR:if(!t.errorAction){var _;t.errorAction=this.getLevelSwitchAction(t,(_=t.level)!=null?_:i.loadLevel)}return;case A.INTERNAL_EXCEPTION:case A.BUFFER_APPENDING_ERROR:case A.BUFFER_FULL_ERROR:case A.LEVEL_SWITCH_ERROR:case A.BUFFER_STALLED_ERROR:case A.BUFFER_SEEK_OVER_HOLE:case A.BUFFER_NUDGE_ON_STALL:t.errorAction=Mr();return}t.type===I.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 r=this.hls,i=Sn(r.config.playlistLoadPolicy,e),s=this.playlistError++;if(Xi(i,s,Zi(e),e.response))return{action:Xr.RetryRequest,flags:et.None,retryConfig:i,retryCount:s};const h=this.getLevelSwitchAction(e,t);return i&&(h.retryConfig=i,h.retryCount=s),h}getFragRetryOrSwitchAction(e){const t=this.hls,r=this.getVariantLevelIndex(e.frag),i=t.levels[r],{fragLoadPolicy:s,keyLoadPolicy:a}=t.config,h=Sn(e.details.startsWith("key")?a:s,e),_=t.levels.reduce((w,R)=>w+R.fragmentError,0);if(i&&(e.details!==A.FRAG_GAP&&i.fragmentError++,Xi(h,_,Zi(e),e.response)))return{action:Xr.RetryRequest,flags:et.None,retryConfig:h,retryCount:_};const g=this.getLevelSwitchAction(e,r);return h&&(g.retryConfig=h,g.retryCount=_),g}getLevelSwitchAction(e,t){const r=this.hls;t==null&&(t=r.loadLevel);const i=this.hls.levels[t];if(i){var s,a;const g=e.details;i.loadError++,g===A.BUFFER_APPEND_ERROR&&i.fragmentError++;let w=-1;const{levels:R,loadLevel:G,minAutoLevel:Y,maxAutoLevel:X}=r;r.autoLevelEnabled||(r.loadLevel=-1);const fe=(s=e.frag)==null?void 0:s.type,Ee=(fe===b.AUDIO&&g===A.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(g===A.BUFFER_ADD_CODEC_ERROR||g===A.BUFFER_APPEND_ERROR))&&R.some(({audioCodec:ct})=>i.audioCodec!==ct),Te=e.sourceBufferName==="video"&&(g===A.BUFFER_ADD_CODEC_ERROR||g===A.BUFFER_APPEND_ERROR)&&R.some(({codecSet:ct,audioCodec:qe})=>i.codecSet!==ct&&i.audioCodec===qe),{type:Ge,groupId:Ke}=(a=e.context)!=null?a:{};for(let ct=R.length;ct--;){const qe=(ct+G)%R.length;if(qe!==G&&qe>=Y&&qe<=X&&R[qe].loadError===0){var h,_;const it=R[qe];if(g===A.FRAG_GAP&&fe===b.MAIN&&e.frag){const ht=R[qe].details;if(ht){const Xe=hr(e.frag,ht.fragments,e.frag.start);if(Xe!=null&&Xe.gap)continue}}else{if(Ge===U.AUDIO_TRACK&&it.hasAudioGroup(Ke)||Ge===U.SUBTITLE_TRACK&&it.hasSubtitleGroup(Ke))continue;if(fe===b.AUDIO&&(h=i.audioGroups)!=null&&h.some(ht=>it.hasAudioGroup(ht))||fe===b.SUBTITLE&&(_=i.subtitleGroups)!=null&&_.some(ht=>it.hasSubtitleGroup(ht))||Ee&&i.audioCodec===it.audioCodec||!Ee&&i.audioCodec!==it.audioCodec||Te&&i.codecSet===it.codecSet)continue}w=qe;break}}if(w>-1&&r.loadLevel!==w)return e.levelRetry=!0,this.playlistError=0,{action:Xr.SendAlternateToPenaltyBox,flags:et.None,nextAutoLevel:w}}return{action:Xr.SendAlternateToPenaltyBox,flags:et.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var r;switch((r=t.errorAction)==null?void 0:r.action){case Xr.DoNothing:break;case Xr.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==A.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 Xr.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,r=e.errorAction;if(!r)return;const{flags:i,hdcpLevel:s,nextAutoLevel:a}=r;switch(i){case et.None:this.switchLevel(e,a);break;case et.MoveAllAlternatesMatchingHDCP:s&&(t.maxHdcpLevel=wr[wr.indexOf(s)-1],r.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}r.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===A.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const r=Tt(e.mimeType),i=this.hls.levels;for(let s=i.length;s--;)i[s][`${e.sourceBufferName}Codec`]===r&&this.hls.removeLevel(s)}}}function Mr(o){const e={action:Xr.DoNothing,flags:et.None};return o&&(e.resolved=!0),e}var Fr={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class En{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(d.MANIFEST_LOADING,this.onManifestLoading,this),e.on(d.BUFFER_APPENDED,this.onBufferAppended,this),e.on(d.FRAG_BUFFERED,this.onFragBuffered,this),e.on(d.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(d.MANIFEST_LOADING,this.onManifestLoading,this),e.off(d.BUFFER_APPENDED,this.onBufferAppended,this),e.off(d.FRAG_BUFFERED,this.onFragBuffered,this),e.off(d.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const r=this.activePartLists[t];if(r)for(let i=r.length;i--;){const s=r[i];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,r){const{fragments:i}=this,s=Object.keys(i);for(let a=s.length;a--;){const h=i[s[a]];if((h==null?void 0:h.body.type)===t&&(!r||h.buffered)){const _=h.body;if(_.start<=e&&e<=_.end)return _}}return null}detectEvictedFragments(e,t,r,i,s){this.timeRanges&&(this.timeRanges[e]=t);const a=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(h=>{const _=this.fragments[h];if(!_||a>=_.body.sn)return;if(!_.buffered&&(!_.loaded||s)){_.body.type===r&&this.removeFragment(_.body);return}const g=_.range[e];if(g){if(g.time.length===0){this.removeFragment(_.body);return}g.time.some(w=>{const R=!this.isTimeBuffered(w.startPTS,w.endPTS,t);return R&&this.removeFragment(_.body),R})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const r=e.frag,i=Ai(r),s=this.fragments[i];if(!s||s.buffered&&r.gap)return;const a=!r.relurl;Object.keys(t).forEach(h=>{const _=r.elementaryStreams[h];if(!_)return;const g=t[h],w=a||_.partial===!0;s.range[h]=this.getBufferedTimes(r,e.part,w,g)}),s.loaded=null,Object.keys(s.range).length?(s.buffered=!0,(s.body.endList=r.endList||s.body.endList)&&(this.endListFragments[s.body.type]=s),Wi(s)||this.removeParts(r.sn-1,r.type)):this.removeFragment(s.body)}removeParts(e,t){const r=this.activePartLists[t];r&&(this.activePartLists[t]=r.filter(i=>i.fragment.sn>=e))}fragBuffered(e,t){const r=Ai(e);let i=this.fragments[r];!i&&t&&(i=this.fragments[r]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,r,i){const s={time:[],partial:r},a=e.start,h=e.end,_=e.minEndPTS||h,g=e.maxStartPTS||a;for(let w=0;w<i.length;w++){const R=i.start(w)-this.bufferPadding,G=i.end(w)+this.bufferPadding;if(g>=R&&_<=G){s.time.push({startPTS:Math.max(a,i.start(w)),endPTS:Math.min(h,i.end(w))});break}else if(a<G&&h>R){const Y=Math.max(a,i.start(w)),X=Math.min(h,i.end(w));X>Y&&(s.partial=!0,s.time.push({startPTS:Y,endPTS:X}))}else if(h<=R)break}return s}getPartialFragment(e){let t=null,r,i,s,a=0;const{bufferPadding:h,fragments:_}=this;return Object.keys(_).forEach(g=>{const w=_[g];w&&Wi(w)&&(i=w.body.start-h,s=w.body.end+h,e>=i&&e<=s&&(r=Math.min(e-i,s-e),a<=r&&(t=w.body,a=r)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Wi(t))}getState(e){const t=Ai(e),r=this.fragments[t];return r?r.buffered?Wi(r)?Fr.PARTIAL:Fr.OK:Fr.APPENDING:Fr.NOT_LOADED}isTimeBuffered(e,t,r){let i,s;for(let a=0;a<r.length;a++){if(i=r.start(a)-this.bufferPadding,s=r.end(a)+this.bufferPadding,e>=i&&t<=s)return!0;if(t<=i)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const r=t.frag,i=t.part?null:t,s=Ai(r);this.fragments[s]={body:r,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:r,part:i,timeRanges:s,type:a}=t;if(r.sn==="initSegment")return;const h=r.type;if(i){let g=this.activePartLists[h];g||(this.activePartLists[h]=g=[]),g.push(i)}this.timeRanges=s;const _=s[a];this.detectEvictedFragments(a,_,h,i)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Ai(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,r=Object.keys(t);if(!e)return r.length>0;for(let i=r.length;i--;){const s=t[r[i]];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,r,i,s){i&&!this.hasGaps||Object.keys(this.fragments).forEach(a=>{const h=this.fragments[a];if(!h)return;const _=h.body;_.type!==r||i&&!_.gap||_.start<t&&_.end>e&&(h.buffered||s)&&this.removeFragment(_)})}removeFragment(e){const t=Ai(e);e.clearElementaryStreamInfo();const r=this.activePartLists[e.type];if(r){const i=e.sn;this.activePartLists[e.type]=r.filter(s=>s.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e,t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const r=(e=this.hls)==null||(t=e.latestLevelDetails)==null?void 0:t.partList;r&&r.forEach(i=>i.clearElementaryStreamInfo())}}function Wi(o){var e,t,r;return o.buffered&&(o.body.gap||((e=o.range.video)==null?void 0:e.partial)||((t=o.range.audio)==null?void 0:t.partial)||((r=o.range.audiovideo)==null?void 0:r.partial))}function Ai(o){return`${o.type}_${o.level}_${o.sn}`}var gr={cbc:0,ctr:1};class Ci{constructor(e,t,r){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=r}decrypt(e,t){switch(this.aesMode){case gr.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case gr.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 Ii(o){const e=o.byteLength,t=e&&new DataView(o.buffer).getUint8(e-1);return t?o.slice(0,e-t):o}class hi{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),r=new Uint32Array(4);for(let i=0;i<4;i++)r[i]=t.getUint32(i*4);return r}initTable(){const e=this.sBox,t=this.invSBox,r=this.subMix,i=r[0],s=r[1],a=r[2],h=r[3],_=this.invSubMix,g=_[0],w=_[1],R=_[2],G=_[3],Y=new Uint32Array(256);let X=0,fe=0,ce=0;for(ce=0;ce<256;ce++)ce<128?Y[ce]=ce<<1:Y[ce]=ce<<1^283;for(ce=0;ce<256;ce++){let Ee=fe^fe<<1^fe<<2^fe<<3^fe<<4;Ee=Ee>>>8^Ee&255^99,e[X]=Ee,t[Ee]=X;const Re=Y[X],Te=Y[Re],Ge=Y[Te];let Ke=Y[Ee]*257^Ee*16843008;i[X]=Ke<<24|Ke>>>8,s[X]=Ke<<16|Ke>>>16,a[X]=Ke<<8|Ke>>>24,h[X]=Ke,Ke=Ge*16843009^Te*65537^Re*257^X*16843008,g[Ee]=Ke<<24|Ke>>>8,w[Ee]=Ke<<16|Ke>>>16,R[Ee]=Ke<<8|Ke>>>24,G[Ee]=Ke,X?(X=Re^Y[Y[Y[Ge^Re]]],fe^=Y[Y[fe]]):X=fe=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let r=!0,i=0;for(;i<t.length&&r;)r=t[i]===this.key[i],i++;if(r)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,_;const g=this.keySchedule=new Uint32Array(a),w=this.invKeySchedule=new Uint32Array(a),R=this.sBox,G=this.rcon,Y=this.invSubMix,X=Y[0],fe=Y[1],ce=Y[2],Ee=Y[3];let Re,Te;for(h=0;h<a;h++){if(h<s){Re=g[h]=t[h];continue}Te=Re,h%s===0?(Te=Te<<8|Te>>>24,Te=R[Te>>>24]<<24|R[Te>>>16&255]<<16|R[Te>>>8&255]<<8|R[Te&255],Te^=G[h/s|0]<<24):s>6&&h%s===4&&(Te=R[Te>>>24]<<24|R[Te>>>16&255]<<16|R[Te>>>8&255]<<8|R[Te&255]),g[h]=Re=(g[h-s]^Te)>>>0}for(_=0;_<a;_++)h=a-_,_&3?Te=g[h]:Te=g[h-4],_<4||h<=4?w[_]=Te:w[_]=X[R[Te>>>24]]^fe[R[Te>>>16&255]]^ce[R[Te>>>8&255]]^Ee[R[Te&255]],w[_]=w[_]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,r){const i=this.keySize+6,s=this.invKeySchedule,a=this.invSBox,h=this.invSubMix,_=h[0],g=h[1],w=h[2],R=h[3],G=this.uint8ArrayToUint32Array_(r);let Y=G[0],X=G[1],fe=G[2],ce=G[3];const Ee=new Int32Array(e),Re=new Int32Array(Ee.length);let Te,Ge,Ke,ct,qe,it,ht,Xe,St,Pt,Sr,ir,Xt,Gt;const Qt=this.networkToHostOrderSwap;for(;t<Ee.length;){for(St=Qt(Ee[t]),Pt=Qt(Ee[t+1]),Sr=Qt(Ee[t+2]),ir=Qt(Ee[t+3]),qe=St^s[0],it=ir^s[1],ht=Sr^s[2],Xe=Pt^s[3],Xt=4,Gt=1;Gt<i;Gt++)Te=_[qe>>>24]^g[it>>16&255]^w[ht>>8&255]^R[Xe&255]^s[Xt],Ge=_[it>>>24]^g[ht>>16&255]^w[Xe>>8&255]^R[qe&255]^s[Xt+1],Ke=_[ht>>>24]^g[Xe>>16&255]^w[qe>>8&255]^R[it&255]^s[Xt+2],ct=_[Xe>>>24]^g[qe>>16&255]^w[it>>8&255]^R[ht&255]^s[Xt+3],qe=Te,it=Ge,ht=Ke,Xe=ct,Xt=Xt+4;Te=a[qe>>>24]<<24^a[it>>16&255]<<16^a[ht>>8&255]<<8^a[Xe&255]^s[Xt],Ge=a[it>>>24]<<24^a[ht>>16&255]<<16^a[Xe>>8&255]<<8^a[qe&255]^s[Xt+1],Ke=a[ht>>>24]<<24^a[Xe>>16&255]<<16^a[qe>>8&255]<<8^a[it&255]^s[Xt+2],ct=a[Xe>>>24]<<24^a[qe>>16&255]<<16^a[it>>8&255]<<8^a[ht&255]^s[Xt+3],Re[t]=Qt(Te^Y),Re[t+1]=Qt(ct^X),Re[t+2]=Qt(Ke^fe),Re[t+3]=Qt(Ge^ce),Y=St,X=Pt,fe=Sr,ce=ir,t=t+4}return Re.buffer}}class Wn{constructor(e,t,r){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=r}expandKey(){const e=Gn(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function Gn(o){switch(o){case gr.cbc:return"AES-CBC";case gr.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${o}`)}}const un=16;class Gi{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 r=self.crypto;r&&(this.subtle=r.subtle||r.webkitSubtle)}catch(r){}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 r=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?Ii(r):r}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,r,i){return this.useSoftware?new Promise((s,a)=>{const h=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(h,t,r,i);const _=this.flush();_?s(_.buffer):a(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,r,i)}softwareDecrypt(e,t,r,i){const{currentIV:s,currentResult:a,remainderData:h}=this;if(i!==gr.cbc||t.byteLength!==16)return z.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),h&&(e=gt(h,e),this.remainderData=null);const _=this.getValidChunk(e);if(!_.length)return null;s&&(r=s);let g=this.softwareDecrypter;g||(g=this.softwareDecrypter=new hi),g.expandKey(t);const w=a;return this.currentResult=g.decrypt(_.buffer,0,r),this.currentIV=_.slice(-16).buffer,w||null}webCryptoDecrypt(e,t,r,i){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,r,i));this.key=t,this.fastAesKey=new Wn(this.subtle,t,i)}return this.fastAesKey.expandKey().then(s=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new Ci(this.subtle,new Uint8Array(r),i).decrypt(e.buffer,s)):Promise.reject(new Error("web crypto not initialized"))).catch(s=>(z.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${s.name}: ${s.message}`),this.onWebCryptoError(e,t,r,i)))}onWebCryptoError(e,t,r,i){const s=this.enableSoftwareAES;if(s){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,r,i);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 r=e.length-e.length%un;return r!==e.length&&(t=e.slice(0,r),this.remainderData=e.slice(r)),t}logOnce(e){this.logEnabled&&(z.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const jt=Math.pow(2,17);class Bi{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 r=e.url;if(!r)return Promise.reject(new bi({type:I.NETWORK_ERROR,details:A.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${r?"part list":"url"}`),networkDetails:null}));this.abort();const i=this.config,s=i.fLoader,a=i.loader;return new Promise((h,_)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(X=>X[0]==="GAP")){_(_i(e));return}else e.gap=!1;const g=this.loader=s?new s(i):new a(i),w=Jr(e);e.loader=g;const R=on(i.fragLoadPolicy.default),G={loadPolicy:R,timeout:R.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:jt};e.stats=g.stats;const Y={onSuccess:(X,fe,ce,Ee)=>{this.resetLoader(e,g);let Re=X.data;ce.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(Re.slice(0,16)),Re=Re.slice(16)),h({frag:e,part:null,payload:Re,networkDetails:Ee})},onError:(X,fe,ce,Ee)=>{this.resetLoader(e,g),_(new bi({type:I.NETWORK_ERROR,details:A.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:u({url:r,data:void 0},X),error:new Error(`HTTP Error ${X.code} ${X.text}`),networkDetails:ce,stats:Ee}))},onAbort:(X,fe,ce)=>{this.resetLoader(e,g),_(new bi({type:I.NETWORK_ERROR,details:A.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:ce,stats:X}))},onTimeout:(X,fe,ce)=>{this.resetLoader(e,g),_(new bi({type:I.NETWORK_ERROR,details:A.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${G.timeout}ms`),networkDetails:ce,stats:X}))}};t&&(Y.onProgress=(X,fe,ce,Ee)=>t({frag:e,part:null,payload:ce,networkDetails:Ee})),g.load(w,G,Y)})}loadPart(e,t,r){this.abort();const i=this.config,s=i.fLoader,a=i.loader;return new Promise((h,_)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){_(_i(e,t));return}const g=this.loader=s?new s(i):new a(i),w=Jr(e,t);e.loader=g;const R=on(i.fragLoadPolicy.default),G={loadPolicy:R,timeout:R.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:jt};t.stats=g.stats,g.load(w,G,{onSuccess:(Y,X,fe,ce)=>{this.resetLoader(e,g),this.updateStatsFromPart(e,t);const Ee={frag:e,part:t,payload:Y.data,networkDetails:ce};r(Ee),h(Ee)},onError:(Y,X,fe,ce)=>{this.resetLoader(e,g),_(new bi({type:I.NETWORK_ERROR,details:A.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:u({url:w.url,data:void 0},Y),error:new Error(`HTTP Error ${Y.code} ${Y.text}`),networkDetails:fe,stats:ce}))},onAbort:(Y,X,fe)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,g),_(new bi({type:I.NETWORK_ERROR,details:A.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:fe,stats:Y}))},onTimeout:(Y,X,fe)=>{this.resetLoader(e,g),_(new bi({type:I.NETWORK_ERROR,details:A.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${G.timeout}ms`),networkDetails:fe,stats:Y}))}})})}updateStatsFromPart(e,t){const r=e.stats,i=t.stats,s=i.total;if(r.loaded+=i.loaded,s){const _=Math.round(e.duration/t.duration),g=Math.min(Math.round(r.loaded/s),_),R=(_-g)*Math.round(r.loaded/g);r.total=r.loaded+R}else r.total=Math.max(r.loaded,r.total);const a=r.loading,h=i.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 Jr(o,e=null){const t=e||o,r={frag:o,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,s=t.byteRangeEndOffset;if(N(i)&&N(s)){var a;let h=i,_=s;if(o.sn==="initSegment"&&Kn((a=o.decryptdata)==null?void 0:a.method)){const g=s-i;g%16&&(_=s+(16-g%16)),i!==0&&(r.resetIV=!0,h=i-16)}r.rangeStart=h,r.rangeEnd=_}return r}function _i(o,e){const t=new Error(`GAP ${o.gap?"tag":"attribute"} found`),r={type:I.MEDIA_ERROR,details:A.FRAG_GAP,fatal:!1,frag:o,error:t,networkDetails:null};return e&&(r.part=e),(e||o).stats.aborted=!0,new bi(r)}function Kn(o){return o==="AES-128"||o==="AES-256"}class bi extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Ni extends F{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 Ki{constructor(e,t,r,i=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=Kr(),this.buffering={audio:Kr(),video:Kr(),audiovideo:Kr()},this.level=e,this.sn=t,this.id=r,this.size=i,this.part=s,this.partial=a}}function Kr(){return{start:0,executeStart:0,executeEnd:0,end:0}}const Qi={length:0,start:()=>0,end:()=>0};class tr{static isBuffered(e,t){if(e){const r=tr.getBuffered(e);for(let i=r.length;i--;)if(t>=r.start(i)&&t<=r.end(i))return!0}return!1}static bufferedRanges(e){if(e){const t=tr.getBuffered(e);return tr.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t}static bufferInfo(e,t,r){if(e){const i=tr.bufferedRanges(e);if(i.length)return tr.bufferedInfo(i,t,r)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,r){t=Math.max(0,t),e.length>1&&e.sort((w,R)=>w.start-R.start||R.end-w.end);let i=-1,s=[];if(r)for(let w=0;w<e.length;w++){t>=e[w].start&&t<=e[w].end&&(i=w);const R=s.length;if(R){const G=s[R-1].end;e[w].start-G<r?e[w].end>G&&(s[R-1].end=e[w].end):s.push(e[w])}else s.push(e[w])}else s=e;let a=0,h,_=t,g=t;for(let w=0;w<s.length;w++){const R=s[w].start,G=s[w].end;if(i===-1&&t>=R&&t<=G&&(i=w),t+r>=R&&t<G)_=R,g=G,a=g-t;else if(t+r<R){h=R;break}}return{len:a,start:_||0,end:g||0,nextStart:h,buffered:e,bufferedIndex:i}}static getBuffered(e){try{return e.buffered||Qi}catch(t){return z.log("failed to get media.buffered",t),Qi}}}const On=/\{\$([a-zA-Z0-9-_]+)\}/g;function Ui(o){return On.test(o)}function Si(o,e){if(o.variableList!==null||o.hasVariableRefs){const t=o.variableList;return e.replace(On,r=>{const i=r.substring(2,r.length-1),s=t==null?void 0:t[i];return s===void 0?(o.playlistParsingError||(o.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),r):s})}return e}function br(o,e,t){let r=o.variableList;r||(o.variableList=r={});let i,s;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const a=new self.URL(t).searchParams;if(a.has(i))s=a.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(a){o.playlistParsingError||(o.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${a.message}`))}}else i=e.NAME,s=e.VALUE;i in r?o.playlistParsingError||(o.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):r[i]=s||""}function xn(o,e,t){const r=e.IMPORT;if(t&&r in t){let i=o.variableList;i||(o.variableList=i={}),i[r]=t[r]}else o.playlistParsingError||(o.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${r}"`))}const Pn=/^(\d+)x(\d+)$/,wn=/(.+?)=(".*?"|.*?)(?:,|$)/g;class _r{constructor(e,t){typeof e=="string"&&(e=_r.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 r=new Uint8Array(t.length/2);for(let i=0;i<t.length/2;i++)r[i]=parseInt(t.slice(i*2,i*2+2),16);return r}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 r=this[e];return r?parseFloat(r):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const r=this[e];return(r?r.split(/[ ,]+/):[]).reduce((i,s)=>(i[s.toLowerCase()]=!0,i),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Pn.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let r;const i={},s='"';for(wn.lastIndex=0;(r=wn.exec(e))!==null;){const a=r[1].trim();let h=r[2];const _=h.indexOf(s)===0&&h.lastIndexOf(s)===h.length-1;let g=!1;if(_)h=h.slice(1,-1);else switch(a){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":g=!0}if(t&&(_||g))h=Si(t,h);else if(!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":z.warn(`${e}: attribute ${a} is missing quotes`)}i[a]=h}return i}}const cn="com.apple.hls.interstitial";function ts(o){return o!=="ID"&&o!=="CLASS"&&o!=="CUE"&&o!=="START-DATE"&&o!=="DURATION"&&o!=="END-DATE"&&o!=="END-ON-NEXT"}function wt(o){return o==="SCTE35-OUT"||o==="SCTE35-IN"||o==="SCTE35-CMD"}class vi{constructor(e,t,r=0){var i;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(t==null?void 0:t.tagAnchor)||null,this.tagOrder=(i=t==null?void 0:t.tagOrder)!=null?i:r,t){const s=t.attr;for(const a in s)if(Object.prototype.hasOwnProperty.call(e,a)&&e[a]!==s[a]){z.warn(`DATERANGE tag attribute: "${a}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=a;break}e=c(new _r({}),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"]);N(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?(z.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return t!==null?this._dateAtEnd=new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(N(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===cn}get isValid(){return!!this.id&&!this._badValueForSameId&&N(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 Mn=10;class An{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,r=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!r||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&r>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}get hasProgramDateTime(){return this.fragments.length?N(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Mn}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 r=e.length;r--;)if(e[r].index>t)return e[r].index;return t}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function li(o){return o==="AES-128"||o==="AES-256"||o==="AES-256-CTR"}function ei(o){switch(o){case"AES-128":case"AES-256":return gr.cbc;case"AES-256-CTR":return gr.ctr;default:throw new Error(`invalid full segment method ${o}`)}}function Dr(o){return Uint8Array.from(atob(o),e=>e.charCodeAt(0))}function Ti(o){return Uint8Array.from(unescape(encodeURIComponent(o)),e=>e.charCodeAt(0))}function Ji(o){const e=Ti(o).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function hn(o){const e=function(r,i,s){const a=r[i];r[i]=r[s],r[s]=a};e(o,0,3),e(o,1,2),e(o,4,5),e(o,6,7)}function fn(o){const e=o.split(":");let t=null;if(e[0]==="data"&&e.length===2){const r=e[1].split(";"),i=r[r.length-1].split(",");if(i.length===2){const s=i[0]==="base64",a=i[1];s?(r.splice(-1,1),t=Dr(a)):t=Ji(a)}}return t}const en=typeof self!="undefined"?self:void 0;var xr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},fi={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Fn(o){switch(o){case fi.FAIRPLAY:return xr.FAIRPLAY;case fi.PLAYREADY:return xr.PLAYREADY;case fi.WIDEVINE:return xr.WIDEVINE;case fi.CLEARKEY:return xr.CLEARKEY}}var Cn={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function Bn(o){if(o===Cn.WIDEVINE)return xr.WIDEVINE;if(o===Cn.PLAYREADY)return xr.PLAYREADY;if(o===Cn.CENC||o===Cn.CLEARKEY)return xr.CLEARKEY}function Nn(o){switch(o){case xr.FAIRPLAY:return fi.FAIRPLAY;case xr.PLAYREADY:return fi.PLAYREADY;case xr.WIDEVINE:return fi.WIDEVINE;case xr.CLEARKEY:return fi.CLEARKEY}}function Wt(o){const{drmSystems:e,widevineLicenseUrl:t}=o,r=e?[xr.FAIRPLAY,xr.WIDEVINE,xr.PLAYREADY,xr.CLEARKEY].filter(i=>!!e[i]):[];return!r[xr.WIDEVINE]&&t&&r.push(xr.WIDEVINE),r}const Zt=function(o){return en!=null&&(o=en.navigator)!=null&&o.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function Wr(o,e,t,r){let i;switch(o){case xr.FAIRPLAY:i=["cenc","sinf"];break;case xr.WIDEVINE:case xr.PLAYREADY:i=["cenc"];break;case xr.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${o}`)}return ti(i,e,t,r)}function ti(o,e,t,r){return[{initDataTypes:o,persistentState:r.persistentState||"optional",distinctiveIdentifier:r.distinctiveIdentifier||"optional",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:e.map(s=>({contentType:`audio/mp4; codecs=${s}`,robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null})),videoCapabilities:t.map(s=>({contentType:`video/mp4; codecs=${s}`,robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null}))}]}function qr(o){var e;return o.sessionType==="persistent-license"||!!((e=o.sessionTypes)!=null&&e.some(t=>t==="persistent-license"))}function tn(o){const e=new Uint16Array(o.buffer,o.byteOffset,o.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),r=t.substring(t.indexOf("<"),t.length),a=new DOMParser().parseFromString(r,"text/xml").getElementsByTagName("KID")[0];if(a){const h=a.childNodes[0]?a.childNodes[0].nodeValue:a.getAttribute("VALUE");if(h){const _=Dr(h).subarray(0,16);return hn(_),_}}return null}let dn={};class pn{static clearKeyUriToKeyIdMap(){dn={}}constructor(e,t,r,i=[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=r,this.keyFormatVersions=i,this.iv=s,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!li(e)}isSupported(){if(this.method){if(li(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case fi.FAIRPLAY:case fi.WIDEVINE:case fi.PLAYREADY:case fi.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(li(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(z.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const r=rn(e);return new pn(this.method,this.uri,"identity",this.keyFormatVersions,r)}const t=fn(this.uri);if(t)switch(this.keyFormat){case fi.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case fi.PLAYREADY:{const r=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Z(r,null,t),this.keyId=tn(t);break}default:{let r=t.subarray(0,16);if(r.length!==16){const i=new Uint8Array(16);i.set(r,16-r.length),r=i}this.keyId=r;break}}if(!this.keyId||this.keyId.byteLength!==16){let r=dn[this.uri];if(!r){const i=Object.keys(dn).length%Number.MAX_SAFE_INTEGER;r=new Uint8Array(16),new DataView(r.buffer,12,4).setUint32(0,i),dn[this.uri]=r}this.keyId=r}return this}}function rn(o){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=o>>8*(15-t)&255;return e}const ds=/#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,Ps=/#EXT-X-MEDIA:(.*)/g,co=/^#EXT(?:INF|-X-TARGETDURATION):/m,Ms=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),ga=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 yi{static findGroup(e,t){for(let r=0;r<e.length;r++){const i=e[r];if(i.id===t)return i}}static resolve(e,t){return K.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return co.test(e)}static parseMasterPlaylist(e,t){const r=Ui(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:r},s=[];ds.lastIndex=0;let a;for(;(a=ds.exec(e))!=null;)if(a[1]){var h;const g=new _r(a[1],i),w=Si(i,a[2]),R={attrs:g,bitrate:g.decimalInteger("BANDWIDTH")||g.decimalInteger("AVERAGE-BANDWIDTH"),name:g.NAME,url:yi.resolve(w,t)},G=g.decimalResolution("RESOLUTION");G&&(R.width=G.width,R.height=G.height),gs(g.CODECS,R);const Y=g["SUPPLEMENTAL-CODECS"];Y&&(R.supplemental={},gs(Y,R.supplemental)),(h=R.unknownCodecs)!=null&&h.length||s.push(R),i.levels.push(R)}else if(a[3]){const g=a[3],w=a[4];switch(g){case"SESSION-DATA":{const R=new _r(w,i),G=R["DATA-ID"];G&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[G]=R);break}case"SESSION-KEY":{const R=ps(w,t,i);R.encrypted&&R.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(R)):z.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${w}"`);break}case"DEFINE":{{const R=new _r(w,i);br(i,R,t)}break}case"CONTENT-STEERING":{const R=new _r(w,i);i.contentSteering={uri:yi.resolve(R["SERVER-URI"],t),pathwayId:R["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=ms(w);break}}}const _=s.length>0&&s.length<i.levels.length;return i.levels=_?s:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,r){let i;const s={},a=r.levels,h={AUDIO:a.map(g=>({id:g.attrs.AUDIO,audioCodec:g.audioCodec})),SUBTITLES:a.map(g=>({id:g.attrs.SUBTITLES,textCodec:g.textCodec})),"CLOSED-CAPTIONS":[]};let _=0;for(Ps.lastIndex=0;(i=Ps.exec(e))!==null;){const g=new _r(i[1],r),w=g.TYPE;if(w){const R=h[w],G=s[w]||[];s[w]=G;const Y=g.LANGUAGE,X=g["ASSOC-LANGUAGE"],fe=g.CHANNELS,ce=g.CHARACTERISTICS,Ee=g["INSTREAM-ID"],Re={attrs:g,bitrate:0,id:_++,groupId:g["GROUP-ID"]||"",name:g.NAME||Y||"",type:w,default:g.bool("DEFAULT"),autoselect:g.bool("AUTOSELECT"),forced:g.bool("FORCED"),lang:Y,url:g.URI?yi.resolve(g.URI,t):""};if(X&&(Re.assocLang=X),fe&&(Re.channels=fe),ce&&(Re.characteristics=ce),Ee&&(Re.instreamId=Ee),R!=null&&R.length){const Te=yi.findGroup(R,Re.groupId)||R[0];va(Re,Te,"audioCodec"),va(Re,Te,"textCodec")}G.push(Re)}}return s}static parseLevelPlaylist(e,t,r,i,s,a){var h;const _={url:t},g=new An(t),w=g.fragments,R=[];let G=null,Y=0,X=0,fe=0,ce=0,Ee=0,Re=null,Te=new Oe(i,_),Ge,Ke,ct,qe=-1,it=!1,ht=null,Xe;if(Ms.lastIndex=0,g.m3u8=e,g.hasVariableRefs=Ui(e),((h=Ms.exec(e))==null?void 0:h[0])!=="#EXTM3U")return g.playlistParsingError=new Error("Missing format identifier #EXTM3U"),g;for(;(Ge=Ms.exec(e))!==null;){it&&(it=!1,Te=new Oe(i,_),Te.playlistOffset=fe,Te.start=fe,Te.sn=Y,Te.cc=ce,Ee&&(Te.bitrate=Ee),Te.level=r,G&&(Te.initSegment=G,G.rawProgramDateTime&&(Te.rawProgramDateTime=G.rawProgramDateTime,G.rawProgramDateTime=null),ht&&(Te.setByteRange(ht),ht=null)));const ir=Ge[1];if(ir){Te.duration=parseFloat(ir);const Xt=(" "+Ge[2]).slice(1);Te.title=Xt||null,Te.tagList.push(Xt?["INF",ir,Xt]:["INF",ir])}else if(Ge[3]){if(N(Te.duration)){Te.playlistOffset=fe,Te.start=fe,ct&&rs(Te,ct,g),Te.sn=Y,Te.level=r,Te.cc=ce,w.push(Te);const Xt=(" "+Ge[3]).slice(1);Te.relurl=Si(g,Xt),Fs(Te,Re,R),Re=Te,fe+=Te.duration,Y++,X=0,it=!0}}else{if(Ge=Ge[0].match(ga),!Ge){z.warn("No matches on slow regex match for level playlist!");continue}for(Ke=1;Ke<Ge.length&&Ge[Ke]===void 0;Ke++);const Xt=(" "+Ge[Ke]).slice(1),Gt=(" "+Ge[Ke+1]).slice(1),Qt=Ge[Ke+2]?(" "+Ge[Ke+2]).slice(1):null;switch(Xt){case"BYTERANGE":Re?Te.setByteRange(Gt,Re):Te.setByteRange(Gt);break;case"PROGRAM-DATE-TIME":Te.rawProgramDateTime=Gt,Te.tagList.push(["PROGRAM-DATE-TIME",Gt]),qe===-1&&(qe=w.length);break;case"PLAYLIST-TYPE":g.type&&mn(g,Xt,Ge),g.type=Gt.toUpperCase();break;case"MEDIA-SEQUENCE":g.startSN!==0?mn(g,Xt,Ge):w.length>0&&ba(g,Xt,Ge),Y=g.startSN=parseInt(Gt);break;case"SKIP":{g.skippedSegments&&mn(g,Xt,Ge);const qt=new _r(Gt,g),Et=qt.decimalInteger("SKIPPED-SEGMENTS");if(N(Et)){g.skippedSegments+=Et;for(let lr=Et;lr--;)w.push(null);Y+=Et}const Dt=qt.enumeratedString("RECENTLY-REMOVED-DATERANGES");Dt&&(g.recentlyRemovedDateranges=(g.recentlyRemovedDateranges||[]).concat(Dt.split(" ")));break}case"TARGETDURATION":g.targetduration!==0&&mn(g,Xt,Ge),g.targetduration=Math.max(parseInt(Gt),1);break;case"VERSION":g.version!==null&&mn(g,Xt,Ge),g.version=parseInt(Gt);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":g.live||mn(g,Xt,Ge),g.live=!1;break;case"#":(Gt||Qt)&&Te.tagList.push(Qt?[Gt,Qt]:[Gt]);break;case"DISCONTINUITY":ce++,Te.tagList.push(["DIS"]);break;case"GAP":Te.gap=!0,Te.tagList.push([Xt]);break;case"BITRATE":Te.tagList.push([Xt,Gt]),Ee=parseInt(Gt)*1e3,N(Ee)?Te.bitrate=Ee:Ee=0;break;case"DATERANGE":{const qt=new _r(Gt,g),Et=new vi(qt,g.dateRanges[qt.ID],g.dateRangeTagCount);g.dateRangeTagCount++,Et.isValid||g.skippedSegments?g.dateRanges[Et.id]=Et:z.warn(`Ignoring invalid DATERANGE tag: "${Gt}"`),Te.tagList.push(["EXT-X-DATERANGE",Gt]);break}case"DEFINE":{{const qt=new _r(Gt,g);"IMPORT"in qt?xn(g,qt,a):br(g,qt,t)}break}case"DISCONTINUITY-SEQUENCE":g.startCC!==0?mn(g,Xt,Ge):w.length>0&&ba(g,Xt,Ge),g.startCC=ce=parseInt(Gt);break;case"KEY":{const qt=ps(Gt,t,g);if(qt.isSupported()){if(qt.method==="NONE"){ct=void 0;break}ct||(ct={}),ct[qt.keyFormat]&&(ct=c({},ct)),ct[qt.keyFormat]=qt}else z.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${Gt}"`);break}case"START":g.startTimeOffset=ms(Gt);break;case"MAP":{const qt=new _r(Gt,g);if(Te.duration){const Et=new Oe(i,_);Bs(Et,qt,r,ct),G=Et,Te.initSegment=G,G.rawProgramDateTime&&!Te.rawProgramDateTime&&(Te.rawProgramDateTime=G.rawProgramDateTime)}else{const Et=Te.byteRangeEndOffset;if(Et){const Dt=Te.byteRangeStartOffset;ht=`${Et-Dt}@${Dt}`}else ht=null;Bs(Te,qt,r,ct),G=Te,it=!0}G.cc=ce;break}case"SERVER-CONTROL":{Xe&&mn(g,Xt,Ge),Xe=new _r(Gt),g.canBlockReload=Xe.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=Xe.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&Xe.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=Xe.optionalFloat("PART-HOLD-BACK",0),g.holdBack=Xe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{g.partTarget&&mn(g,Xt,Ge);const qt=new _r(Gt);g.partTarget=qt.decimalFloatingPoint("PART-TARGET");break}case"PART":{let qt=g.partList;qt||(qt=g.partList=[]);const Et=X>0?qt[qt.length-1]:void 0,Dt=X++,lr=new _r(Gt,g),nr=new Ve(lr,Te,_,Dt,Et);qt.push(nr),Te.duration+=nr.duration;break}case"PRELOAD-HINT":{const qt=new _r(Gt,g);g.preloadHint=qt;break}case"RENDITION-REPORT":{const qt=new _r(Gt,g);g.renditionReports=g.renditionReports||[],g.renditionReports.push(qt);break}default:z.warn(`line parsed but not handled: ${Ge}`);break}}}Re&&!Re.relurl?(w.pop(),fe-=Re.duration,g.partList&&(g.fragmentHint=Re)):g.partList&&(Fs(Te,Re,R),Te.cc=ce,g.fragmentHint=Te,ct&&rs(Te,ct,g)),g.targetduration||(g.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const St=w.length,Pt=w[0],Sr=w[St-1];if(fe+=g.skippedSegments*g.targetduration,fe>0&&St&&Sr){g.averagetargetduration=fe/St;const ir=Sr.sn;g.endSN=ir!=="initSegment"?ir:0,g.live||(Sr.endList=!0),Pt&&g.startCC===void 0&&(g.startCC=Pt.cc),qe>0&&(ya(w,qe),Pt&&R.unshift(Pt))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(fe+=g.fragmentHint.duration),g.totalduration=fe,R.length&&g.dateRangeTagCount&&Pt&&Vn(R,g),g.endCC=ce,g}}function Vn(o,e){const t=o.length,r=o[t-1],i=e.live?1/0:e.totalduration,s=Object.keys(e.dateRanges);for(let a=s.length;a--;){const h=e.dateRanges[s[a]],_=h.startDate.getTime();h.tagAnchor=r.ref;for(let g=t;g--;){const w=_a(e,_,o,g,i);if(w!==-1){h.tagAnchor=e.fragments[w].ref;break}}}}function _a(o,e,t,r,i){const s=t[r];if(s){const h=s.programDateTime;if(e>=h||r===0){var a;const _=(((a=t[r+1])==null?void 0:a.start)||i)-s.start;if(e<=h+_*1e3){const g=t[r].sn-o.startSN,w=o.fragments;if(w.length>t.length){const G=(t[r+1]||w[w.length-1]).sn-o.startSN;for(let Y=G;Y>g;Y--){const X=w[Y].programDateTime;if(e>=X&&e<X+w[Y].duration*1e3)return Y}}return g}}}return-1}function ps(o,e,t){var r,i;const s=new _r(o,t),a=(r=s.METHOD)!=null?r:"",h=s.URI,_=s.hexadecimalInteger("IV"),g=s.KEYFORMATVERSIONS,w=(i=s.KEYFORMAT)!=null?i:"identity";h&&s.IV&&!_&&z.error(`Invalid IV: ${s.IV}`);const R=h?yi.resolve(h,e):"",G=(g||"1").split("/").map(Number).filter(Number.isFinite);return new pn(a,R,w,G,_)}function ms(o){const t=new _r(o).decimalFloatingPoint("TIME-OFFSET");return N(t)?t:null}function gs(o,e){let t=(o||"").split(/[ ,]+/).filter(r=>r);["video","audio","text"].forEach(r=>{const i=t.filter(s=>ke(s,r));i.length&&(e[`${r}Codec`]=i.map(s=>s.split("/")[0]).join(","),t=t.filter(s=>i.indexOf(s)===-1))}),e.unknownCodecs=t}function va(o,e,t){const r=e[t];r&&(o[t]=r)}function ya(o,e){let t=o[e];for(let r=e;r--;){const i=o[r];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function Fs(o,e,t){o.rawProgramDateTime?t.push(o):e!=null&&e.programDateTime&&(o.programDateTime=e.endProgramDateTime)}function Bs(o,e,t,r){o.relurl=e.URI,e.BYTERANGE&&o.setByteRange(e.BYTERANGE),o.level=t,o.sn="initSegment",r&&(o.levelkeys=r),o.initSegment=null}function rs(o,e,t){o.levelkeys=e;const{encryptedFragments:r}=t;(!r.length||r[r.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&r.push(o)}function mn(o,e,t){o.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function ba(o,e,t){o.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function Ns(o,e){const t=e.startPTS;if(N(t)){let r=0,i;e.sn>o.sn?(r=t-o.start,i=o):(r=o.start-t,i=e),i.duration!==r&&i.setDuration(r)}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 Us(o,e,t,r,i,s){r-t<=0&&(z.warn("Fragment should have a positive duration",e),r=t+e.duration,s=i+e.duration);let h=t,_=r;const g=e.startPTS,w=e.endPTS;if(N(g)){const ce=Math.abs(g-t);N(e.deltaPTS)?e.deltaPTS=Math.max(ce,e.deltaPTS):e.deltaPTS=ce,h=Math.max(t,g),t=Math.min(t,g),i=Math.min(i,e.startDTS),_=Math.min(r,w),r=Math.max(r,w),s=Math.max(s,e.endDTS)}const R=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(r-e.start),e.startPTS=t,e.maxStartPTS=h,e.startDTS=i,e.endPTS=r,e.minEndPTS=_,e.endDTS=s;const G=e.sn;if(!o||G<o.startSN||G>o.endSN)return 0;let Y;const X=G-o.startSN,fe=o.fragments;for(fe[X]=e,Y=X;Y>0;Y--)Ns(fe[Y],fe[Y-1]);for(Y=X;Y<fe.length-1;Y++)Ns(fe[Y],fe[Y+1]);return o.fragmentHint&&Ns(fe[fe.length-1],o.fragmentHint),o.PTSKnown=o.alignedSliding=!0,R}function ho(o,e){if(o===e)return;let t=null;const r=o.fragments;for(let _=r.length-1;_>=0;_--){const g=r[_].initSegment;if(g){t=g;break}}o.fragmentHint&&delete o.fragmentHint.endPTS;let i;fo(o,e,(_,g,w,R)=>{if(e.skippedSegments&&g.cc!==_.cc){const G=_.cc-g.cc;for(let Y=w;Y<R.length;Y++)R[Y].cc+=G}N(_.startPTS)&&N(_.endPTS)&&(g.setStart(g.startPTS=_.startPTS),g.startDTS=_.startDTS,g.maxStartPTS=_.maxStartPTS,g.endPTS=_.endPTS,g.endDTS=_.endDTS,g.minEndPTS=_.minEndPTS,g.setDuration(_.endPTS-_.startPTS),g.duration&&(i=g),e.PTSKnown=e.alignedSliding=!0),_.hasStreams&&(g.elementaryStreams=_.elementaryStreams),g.loader=_.loader,_.hasStats&&(g.stats=_.stats),_.initSegment&&(g.initSegment=_.initSegment,t=_.initSegment)});const s=e.fragments,a=e.fragmentHint?s.concat(e.fragmentHint):s;if(t&&a.forEach(_=>{var g;_&&(!_.initSegment||_.initSegment.relurl===((g=t)==null?void 0:g.relurl))&&(_.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=s.some(_=>!_),e.deltaUpdateFailed){z.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let _=e.skippedSegments;_--;)s.shift();e.startSN=s[0].sn}else{e.endCC=s[s.length-1].cc,e.canSkipDateRanges&&(e.dateRanges=Sa(o.dateRanges,e));const _=o.fragments.filter(g=>g.rawProgramDateTime);if(o.hasProgramDateTime&&!e.hasProgramDateTime)for(let g=1;g<a.length;g++)a[g].programDateTime===null&&Fs(a[g],a[g-1],_);Vn(_,e)}Ea(o.partList,e.partList,(_,g)=>{g.elementaryStreams=_.elementaryStreams,g.stats=_.stats}),i?Us(e,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):$s(o,e),s.length&&(e.totalduration=e.edge-s[0].start),e.driftStartTime=o.driftStartTime,e.driftStart=o.driftStart;const h=e.advancedDateTime;if(e.advanced&&h){const _=e.edge;e.driftStart||(e.driftStartTime=h,e.driftStart=_),e.driftEndTime=h,e.driftEnd=_}else e.driftEndTime=o.driftEndTime,e.driftEnd=o.driftEnd,e.advancedDateTime=o.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=o.requestScheduled)}function Sa(o,e){const{dateRanges:t,recentlyRemovedDateranges:r}=e,i=c({},o);r&&r.forEach(h=>{delete i[h]});const a=Object.keys(i).length;return a&&Object.keys(t).forEach(h=>{const _=i[h],g=new vi(t[h].attr,_);g.isValid?(i[h]=g,_||(g.tagOrder+=a)):z.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${sr(t[h].attr)}"`)}),i}function Ea(o,e,t){if(o&&e){let r=0;for(let i=0,s=o.length;i<=s;i++){const a=o[i],h=e[i+r];a&&h&&a.index===h.index&&a.fragment.sn===h.fragment.sn?t(a,h):r--}}}function fo(o,e,t){const r=e.skippedSegments,i=Math.max(o.startSN,e.startSN)-e.startSN,s=(o.fragmentHint?1:0)+(r?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,_=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments;for(let g=i;g<=s;g++){const w=_[a+g];let R=h[g];if(r&&!R&&w&&(R=e.fragments[g]=w),w&&R){if(t(w,R,g,h),w.url&&w.url!==R.url){e.playlistParsingError=gn(`media sequence mismatch ${R.sn}:`,o,e,w,R);return}else if(w.cc!==R.cc){e.playlistParsingError=gn(`discontinuity sequence mismatch (${w.cc}!=${R.cc})`,o,e,w,R);return}}}}function gn(o,e,t,r,i){return new Error(`${o} ${i.url}
|
|
|
Playlist starting @${e.startSN}
|
|
|
${e.m3u8}
|
|
|
|
|
|
Playlist starting @${t.startSN}
|
|
|
${t.m3u8}`)}function $s(o,e,t=!0){const r=e.startSN+e.skippedSegments-o.startSN,i=o.fragments,s=r>=0;let a=0;if(s&&r<i.length)a=i[r].start;else if(s&&e.startSN===o.endSN+1)a=o.fragmentEnd;else if(s&&t)a=o.fragmentStart+r*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)a=o.fragmentStart;else return;zs(e,a)}function zs(o,e){if(e){const t=o.fragments;for(let r=o.skippedSegments;r<t.length;r++)t[r].addStart(e);o.fragmentHint&&o.fragmentHint.addStart(e)}}function is(o,e=1/0){let t=1e3*o.targetduration;if(o.updated){const r=o.fragments;if(r.length&&t*4>e){const s=r[r.length-1].duration*1e3;s<t&&(t=s)}}else t/=2;return Math.round(t)}function xa(o,e,t){if(!o)return null;let r=o.fragments[e-o.startSN];return r||(r=o.fragmentHint,r&&r.sn===e)?r:e<o.startSN&&t&&t.sn===e?t:null}function _s(o,e,t){return o?vs(o.partList,e,t):null}function vs(o,e,t){if(o)for(let r=o.length;r--;){const i=o[r];if(i.index===t&&i.fragment.sn===e)return i}return null}function Hs(o){o.forEach((e,t)=>{var r;(r=e.details)==null||r.fragments.forEach(i=>{i.level=t,i.initSegment&&(i.initSegment.level=t)})})}function $i(o,e){for(let r=0,i=o.length;r<i;r++){var t;if(((t=o[r])==null?void 0:t.cc)===e)return o[r]}return null}function wa(o,e){return!!(o&&e.startCC<o.endCC&&e.endCC>o.startCC)}function Tn(o,e){if(o){const t=o.start+e;o.start=o.startPTS=t,o.endPTS=t+o.duration}}function ys(o,e){const t=e.fragments;for(let r=0,i=t.length;r<i;r++)Tn(t[r],o);e.fragmentHint&&Tn(e.fragmentHint,o),e.alignedSliding=!0}function Dn(o,e){o&&(Aa(e,o),!e.alignedSliding&&o&&Vi(e,o),!e.alignedSliding&&o&&!e.skippedSegments&&$s(o,e,!1))}function Aa(o,e){if(!wa(e,o))return;const t=Math.min(e.endCC,o.endCC),r=$i(e.fragments,t),i=$i(o.fragments,t);if(!r||!i)return;z.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const s=r.start-i.start;ys(s,o)}function Vi(o,e){if(!o.hasProgramDateTime||!e.hasProgramDateTime)return;const t=o.fragments,r=e.fragments;if(!t.length||!r.length)return;let i,s;const a=Math.min(e.endCC,o.endCC);e.startCC<a&&o.startCC<a&&(i=$i(r,a),s=$i(t,a)),(!i||!s)&&(i=r[Math.floor(r.length/2)],s=$i(t,i.cc)||t[Math.floor(t.length/2)]);const h=i.programDateTime,_=s.programDateTime;if(!h||!_)return;const g=(_-h)/1e3-(s.start-i.start);ys(g,o)}const Ca={toString:function(o){let e="";const t=o.length;for(let r=0;r<t;r++)e+=`[${o.start(r).toFixed(3)}-${o.end(r).toFixed(3)}]`;return e}},ft={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 bs extends Ni{constructor(e,t,r,i,s){super(i,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=ft.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:_,mediaBuffer:g,state:w}=this,R=_?_.currentTime:0,G=tr.bufferInfo(g||_,R,a.maxBufferHole);if(this.log(`media seeking to ${N(R)?R.toFixed(3):R}, state: ${w}`),this.state===ft.ENDED)this.resetLoadingState();else if(h){const Y=a.maxFragLookUpTolerance,X=h.start-Y,fe=h.start+h.duration+Y;if(!G.len||fe<G.start||X>G.end){const ce=R>fe;(R<X||ce)&&(ce&&h.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),h.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(_){this.fragmentTracker.removeFragmentsInRange(R,1/0,this.playlistType,!0);const Y=this.lastCurrentTime;if(R>Y&&(this.lastCurrentTime=R),!this.loadingParts){const X=Math.max(G.end,R),fe=this.shouldLoadParts(this.getLevelDetails(),X);fe&&(this.log(`LL-Part loading ON after seeking to ${R.toFixed(2)} with buffer @${X.toFixed(2)}`),this.loadingParts=fe)}}!this.hls.hasEnoughToStart&&!G.len&&(this.log(`setting startPosition to ${R} because of seek before start`),this.nextLoadPosition=this.startPosition=R),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 Bi(e.config),this.keyLoader=r,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Gi(e.config)}registerListeners(){const{hls:e}=this;e.on(d.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(d.MANIFEST_LOADING,this.onManifestLoading,this),e.on(d.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(d.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(d.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(d.MANIFEST_LOADING,this.onManifestLoading,this),e.off(d.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(d.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===ft.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=ft.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 r=e.end||0,i=this.config.timelineOffset||0;if(r<=i)return!1;const s=e.nextStart;if(s&&s>i&&s<t.edge||this.media.currentTime<e.start)return!1;const h=t.partList;if(h!=null&&h.length){const g=h[h.length-1];return tr.isBuffered(this.media,g.start+g.duration/2)}const _=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(_)}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 r=this.media=this.mediaBuffer=t.media;r.removeEventListener("seeking",this.onMediaSeeking),r.removeEventListener("ended",this.onMediaEnded),r.addEventListener("seeking",this.onMediaSeeking),r.addEventListener("ended",this.onMediaEnded);const i=this.config;this.levels&&i.autoStartLoad&&this.state===ft.STOPPED&&this.startLoad(i.startPosition)}onMediaDetaching(e,t){const r=!!t.transferMedia,i=this.media;if(i!==null){if(i.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),i.removeEventListener("seeking",this.onMediaSeeking),i.removeEventListener("ended",this.onMediaEnded),this.keyLoader&&!r&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,r){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=ft.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,r){this.startFragRequested=!0,this._loadFragForPlayback(e,t,r)}_loadFragForPlayback(e,t,r){const i=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,r,i).then(s=>{if(!s)return;const a=this.state,h=s.frag;if(this.fragContextChanged(h)){(a===ft.FRAG_LOADING||!this.fragCurrent&&a===ft.PARSING)&&(this.fragmentTracker.removeFragment(h),this.state=ft.IDLE);return}"payload"in s&&(this.log(`Loaded ${h.type} sn: ${h.sn} of ${this.playlistLabel()} ${h.level}`),this.hls.trigger(d.FRAG_LOADED,s)),this._handleFragmentLoadComplete(s)}).catch(s=>{this.state===ft.STOPPED||this.state===ft.ERROR||(this.warn(`Frag error: ${(s==null?void 0:s.message)||s}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:r}=this;if(r.getState(e)===Fr.APPENDING){const s=e.type,a=this.getFwdBufferInfo(this.mediaBuffer,s),h=Math.max(e.duration,a?a.len:this.config.maxBufferLength),_=this.backtrackFragment;((_?e.sn-_.sn:0)===1||this.reduceMaxBufferLength(h,e.duration))&&r.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?r.removeAllFragments():r.hasParts(e.type)&&(r.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),r.getState(e)===Fr.PARTIAL&&r.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,r=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:r};this.hls.trigger(d.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(r=>{const i=r==null?void 0:r.frag;if(!i||this.fragContextChanged(i)||!this.levels)throw new Error("init load aborted");return r}).then(r=>{const{hls:i}=this,{frag:s,payload:a}=r,h=s.decryptdata;if(a&&a.byteLength>0&&h!=null&&h.key&&h.iv&&li(h.method)){const _=self.performance.now();return this.decrypter.decrypt(new Uint8Array(a),h.key.buffer,h.iv.buffer,ei(h.method)).catch(g=>{throw i.trigger(d.ERROR,{type:I.MEDIA_ERROR,details:A.FRAG_DECRYPT_ERROR,fatal:!1,error:g,reason:g.message,frag:s}),g}).then(g=>{const w=self.performance.now();return i.trigger(d.FRAG_DECRYPTED,{frag:s,payload:g,stats:{tstart:_,tdecrypt:w}}),r.payload=g,this.completeInitSegmentLoad(r)})}return this.completeInitSegmentLoad(r)}).catch(r=>{this.state===ft.STOPPED||this.state===ft.ERROR||(this.warn(r),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const r=e.frag.stats;this.state!==ft.STOPPED&&(this.state=ft.IDLE),e.frag.data=new Uint8Array(e.payload),r.parsing.start=r.buffering.start=self.performance.now(),r.parsing.end=r.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 r=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:${r?Ca.toString(tr.getBuffered(r)):"(detached)"})`),de(e)){var i;if(e.type!==b.SUBTITLE){const a=e.elementaryStreams;if(!Object.keys(a).some(h=>!!a[h])){this.state=ft.IDLE;return}}const s=(i=this.levels)==null?void 0:i[e.level];s!=null&&s.fragmentError&&(this.log(`Resetting level fragment error count of ${s.fragmentError} on frag buffered`),s.fragmentError=0)}this.state=ft.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:r,part:i,partsLoaded:s}=e,a=!s||s.length===0||s.some(_=>!_),h=new Ki(r.level,r.sn,r.stats.chunkCount+1,0,i?i.index:-1,!a);t.flush(h)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,r=null,i){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=ft.KEY_LOADING,this.fragCurrent=e,h=this.keyLoader.load(e).then(R=>{if(!this.fragContextChanged(R.frag))return this.hls.trigger(d.KEY_LOADED,R),this.state===ft.KEY_LOADING&&(this.state=ft.IDLE),R}),this.hls.trigger(d.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(h=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&a.encryptedFragments.length&&this.keyLoader.loadClear(e,a.encryptedFragments);const _=this.fragPrevious;if(de(e)&&(!_||e.sn!==_.sn)){const R=this.shouldLoadParts(t.details,e.end);R!==this.loadingParts&&(this.log(`LL-Part loading ${R?"ON":"OFF"} loading sn ${_==null?void 0:_.sn}->${e.sn}`),this.loadingParts=R)}if(r=Math.max(e.start,r||0),this.loadingParts&&de(e)){const R=a.partList;if(R&&i){r>e.end&&a.fragmentHint&&(e=a.fragmentHint);const G=this.getNextPart(R,e,r);if(G>-1){const Y=R[G];e=this.fragCurrent=Y.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${Y.index} (${G}/${R.length-1}) of ${this.fragInfo(e,!1,Y)}) cc: ${e.cc} [${a.startSN}-${a.endSN}], target: ${parseFloat(r.toFixed(3))}`),this.nextLoadPosition=Y.start+Y.duration,this.state=ft.FRAG_LOADING;let X;return h?X=h.then(fe=>!fe||this.fragContextChanged(fe.frag)?null:this.doFragPartsLoad(e,Y,t,i)).catch(fe=>this.handleFragLoadError(fe)):X=this.doFragPartsLoad(e,Y,t,i).catch(fe=>this.handleFragLoadError(fe)),this.hls.trigger(d.FRAG_LOADING,{frag:e,part:Y,targetBufferTime:r}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):X}else if(!e.url||this.loadedEndOfParts(R,r))return Promise.resolve(null)}}if(de(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${r.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(r.toFixed(3))}`),N(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=ft.FRAG_LOADING;const g=this.config.progressive;let w;return g&&h?w=h.then(R=>!R||this.fragContextChanged(R==null?void 0:R.frag)?null:this.fragmentLoader.load(e,i)).catch(R=>this.handleFragLoadError(R)):w=Promise.all([this.fragmentLoader.load(e,g?i:void 0),h]).then(([R])=>(!g&&R&&i&&i(R),R)).catch(R=>this.handleFragLoadError(R)),this.hls.trigger(d.FRAG_LOADING,{frag:e,targetBufferTime:r}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):w}doFragPartsLoad(e,t,r,i){return new Promise((s,a)=>{var h;const _=[],g=(h=r.details)==null?void 0:h.partList,w=R=>{this.fragmentLoader.loadPart(e,R,i).then(G=>{_[R.index]=G;const Y=G.part;this.hls.trigger(d.FRAG_LOADED,G);const X=_s(r.details,e.sn,R.index+1)||vs(g,e.sn,R.index+1);if(X)w(X);else return s({frag:e,part:Y,partsLoaded:_})}).catch(a)};w(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===A.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(d.ERROR,t)}else this.hls.trigger(d.ERROR,{type:I.OTHER_ERROR,details:A.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==ft.PARSING){!this.fragCurrent&&this.state!==ft.STOPPED&&this.state!==ft.ERROR&&(this.state=ft.IDLE);return}const{frag:r,part:i,level:s}=t,a=self.performance.now();r.stats.parsing.end=a,i&&(i.stats.parsing.end=a);const h=this.getLevelDetails(),g=h&&r.sn>h.endSN||this.shouldLoadParts(h,r.end);g!==this.loadingParts&&(this.log(`LL-Part loading ${g?"ON":"OFF"} after parsing segment ending @${r.end.toFixed(2)}`),this.loadingParts=g),this.updateLevelTiming(r,i,s,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e!=null&&e.partList){var r;const s=e.partList[0],a=s.end+(((r=e.fragmentHint)==null?void 0:r.duration)||0);if(t>=a){var i;if((this.hls.hasEnoughToStart?((i=this.media)==null?void 0:i.currentTime)||this.lastCurrentTime:this.getLoadPosition())>s.start-s.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:r}=this,{level:i,sn:s,part:a}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${s} of ${this.playlistLabel()} ${i}. The current chunk will not be buffered.`),null;const h=t[i],_=h.details,g=a>-1?_s(_,s,a):null,w=g?g.fragment:xa(_,s,r);return w?(r&&r!==w&&(w.stats=r.stats),{frag:w,part:g,level:h}):null}bufferFragmentData(e,t,r,i,s){var a;if(!e||this.state!==ft.PARSING)return;const{data1:h,data2:_}=e;let g=h;if(h&&_&&(g=gt(h,_)),!((a=g)!=null&&a.length))return;const w={type:e.type,frag:t,part:r,chunkMeta:i,parent:t.type,data:g};if(this.hls.trigger(d.BUFFER_APPENDING,w),e.dropped&&e.independent&&!r){if(s)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!tr.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const r=t.currentTime,i=tr.bufferInfo(t,r,0),s=e.duration,a=Math.min(this.config.maxFragLookUpTolerance*2,s*.25),h=Math.max(Math.min(e.start-a,i.end-a),r+a);e.start-h>a&&this.flushMainBuffer(h,e.start)}getFwdBufferInfo(e,t){var r;const i=this.getLoadPosition();if(!N(i))return null;const a=this.lastCurrentTime>i||(r=this.media)!=null&&r.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,i,t,a)}getFwdBufferInfoAtPos(e,t,r,i){const s=tr.bufferInfo(e,t,i);if(s.len===0&&s.nextStart!==void 0){const a=this.fragmentTracker.getBufferedFrag(t,r);if(a&&(s.nextStart<=a.end||a.gap)){const h=Math.max(Math.min(s.nextStart,a.end)-t,i);return tr.bufferInfo(e,t,h)}}return s}getMaxBufferLength(e){const{config:t}=this;let r;return e?r=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):r=t.maxBufferLength,Math.min(r,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const r=this.config,i=Math.max(Math.min(e-t,r.maxBufferLength),t),s=Math.max(e-t*3,r.maxMaxBufferLength/2,i);return s>=i?(r.maxMaxBufferLength=s,this.warn(`Reduce max buffer length to ${s}s`),!0):!1}getAppendedFrag(e,t=b.MAIN){var r;const i=(r=this.fragmentTracker)==null?void 0:r.getAppendedFrag(e,t);return i&&"fragment"in i?i.fragment:i}getNextFragment(e,t){const r=t.fragments,i=r.length;if(!i)return null;const{config:s}=this,a=r[0].start,h=s.lowLatencyMode&&!!t.partList;let _=null;if(t.live){const R=s.initialLiveManifestSize;if(i<R)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${R})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<a){var g;h&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),_=this.getInitialLiveFragment(t,r);const G=this.hls.startPosition,Y=this.hls.liveSyncPosition,X=_?(G!==-1&&G>=a?G:Y)||_.start:e;this.log(`Setting startPosition to ${X} to match start frag at live edge. mainStart: ${G} liveSyncPosition: ${Y} frag.start: ${(g=_)==null?void 0:g.start}`),this.startPosition=this.nextLoadPosition=X}}else e<=a&&(_=r[0]);if(!_){const R=this.loadingParts?t.partEnd:t.fragmentEnd;_=this.getFragmentAtPosition(e,R,t)}let w=this.filterReplacedPrimary(_,t);if(!w&&_){const R=_.sn-t.startSN;w=this.filterReplacedPrimary(r[R+1]||null,t)}return this.mapToInitFragWhenRequired(w)}isLoopLoading(e,t){const r=this.fragmentTracker.getState(e);return(r===Fr.OK||r===Fr.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,r,i,s){let a=null;if(e.gap&&(a=this.getNextFragment(this.nextLoadPosition,t),a&&!a.gap&&r.nextStart)){const h=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,r.nextStart,i,0);if(h!==null&&r.len+h.len>=s){const _=a.sn;return this.loopSn!==_&&(this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${_}`),this.loopSn=_),null}}return this.loopSn=void 0,a}get primaryPrefetch(){if(Ta(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(Ta(this.hls.config)&&e.type!==b.SUBTITLE){const r=this.hls.interstitialsManager,i=r==null?void 0:r.bufferingItem;if(i){const a=i.event;if(a){if(a.appendInPlace||Math.abs(e.start-i.start)>1||i.start===0)return null}else if(e.end<=i.start&&(t==null?void 0:t.live)===!1||e.start>i.end&&i.nextEvent&&(i.nextEvent.appendInPlace||e.start-i.end>1))return null}const s=r==null?void 0:r.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,r){let i=-1,s=!1,a=!0;for(let h=0,_=e.length;h<_;h++){const g=e[h];if(a=a&&!g.independent,i>-1&&r<g.start)break;const w=g.loaded;w?i=-1:(s||g.independent||a)&&g.fragment===t&&(i=h),s=w}return i}loadedEndOfParts(e,t){const r=e[e.length-1];return r&&t>r.start&&r.loaded}getInitialLiveFragment(e,t){const r=this.fragPrevious;let i=null;if(r){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${r.programDateTime}`),i=Mi(t,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const s=r.sn+1;if(s>=e.startSN&&s<=e.endSN){const a=t[s-e.startSN];r.cc===a.cc&&(i=a,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=ji(t,r.cc),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const s=this.hls.liveSyncPosition;s!==null&&(i=this.getFragmentAtPosition(s,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,r){const{config:i}=this;let{fragPrevious:s}=this,{fragments:a,endSN:h}=r;const{fragmentHint:_}=r,{maxFragLookUpTolerance:g}=i,w=r.partList,R=!!(this.loadingParts&&w!=null&&w.length&&_);R&&_&&!this.bitrateTest&&w[w.length-1].fragment.sn===_.sn&&(a=a.concat(_),h=_.sn);let G;if(e<t){var Y;const fe=e<this.lastCurrentTime||e>t-g||(Y=this.media)!=null&&Y.paused||!this.startFragRequested?0:g;G=hr(s,a,e,fe)}else G=a[a.length-1];if(G){const X=G.sn-r.startSN,fe=this.fragmentTracker.getState(G);if((fe===Fr.OK||fe===Fr.PARTIAL&&G.gap)&&(s=G),s&&G.sn===s.sn&&(!R||w[0].fragment.sn>G.sn||!r.live&&!R)&&s&&G.level===s.level){const Ee=a[X+1];G.sn<h&&this.fragmentTracker.getState(Ee)!==Fr.OK?G=Ee:G=null}}return G}alignPlaylists(e,t,r){const i=e.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const s=e.fragmentStart,a=!t,h=e.alignedSliding&&N(s);if(a||!h&&!s){Dn(r,e);const _=e.fragmentStart;return this.log(`Live playlist sliding: ${_.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${i}`),_}return s}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let r=this.startPosition;r<t&&(r=-1);const i=this.timelineOffset;if(r===-1){const s=this.startTimeOffset!==null,a=s?this.startTimeOffset:e.startTimeOffset;a!==null&&N(a)?(r=t+a,a<0&&(r+=e.edge),r=Math.min(Math.max(t,r),t+e.totalduration),this.log(`Setting startPosition to ${r} for start time offset ${a} found in ${s?"multivariant":"media"} playlist`),this.startPosition=r):e.live?(r=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${r}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=r=0),this.lastCurrentTime=r+i}this.nextLoadPosition=r+i}getLoadPosition(){var e;const{media:t}=this;let r=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?r=t.currentTime:this.nextLoadPosition>=0&&(r=this.nextLoadPosition),r}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&de(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!==ft.FRAG_LOADING_WAITING_RETRY)&&(this.state=ft.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const X=this.getCurrentContext(t.chunkMeta);X&&(t.frag=X.frag)}const r=t.frag;if(!r||r.type!==e||!this.levels)return;if(this.fragContextChanged(r)){var i;this.warn(`Frag load error must match current frag to retry ${r.url} > ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const s=t.details===A.FRAG_GAP;s&&this.fragmentTracker.fragBuffered(r,!0);const a=t.errorAction,{action:h,flags:_,retryCount:g=0,retryConfig:w}=a||{},R=!!a&&!!w,G=R&&h===Xr.RetryRequest,Y=R&&!a.resolved&&_===et.MoveAllAlternatesMatchingHost;if(!G&&Y&&de(r)&&!r.endList)this.resetFragmentErrors(e),this.treatAsGap(r),a.resolved=!0;else if((G||Y)&&g<w.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const X=mi(w,g);this.warn(`Fragment ${r.sn} of ${e} ${r.level} errored with ${t.details}, retrying loading ${g+1}/${w.maxNumRetry} in ${X}ms`),a.resolved=!0,this.retryDate=self.performance.now()+X,this.state=ft.FRAG_LOADING_WAITING_RETRY}else if(w&&a)if(this.resetFragmentErrors(e),g<w.maxNumRetry)!s&&h!==Xr.RemoveAlternatePermanently&&(a.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${g})`);return}else h===Xr.SendAlternateToPenaltyBox?this.state=ft.WAITING_LEVEL:this.state=ft.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===ft.PARSING||this.state===ft.PARSED){const t=e.frag,r=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,r),s=i&&i.len>.5;s&&this.reduceMaxBufferLength(i.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 ${r} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),a}return!1}resetFragmentErrors(e){e===b.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==ft.STOPPED&&(this.state=ft.IDLE)}afterBufferFlushed(e,t,r){if(!e)return;const i=tr.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,r),this.state===ft.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==ft.STOPPED&&(this.state=ft.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,r,i){const s=r.details;if(!s){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((_,g)=>{const w=e.elementaryStreams[g];if(w){const R=w.endPTS-w.startPTS;if(R<=0)return this.warn(`Could not parse fragment ${e.sn} ${g} duration reliably (${R})`),_||!1;const G=i?0:Us(s,e,w.startPTS,w.endPTS,w.startDTS,w.endDTS);return this.hls.trigger(d.LEVEL_PTS_UPDATED,{details:s,level:r,drift:G,type:g,frag:e,start:w.startPTS,end:w.endPTS}),!0}return _},!1)){var h;if(r.fragmentError===0&&this.treatAsGap(e,r),((h=this.transmuxer)==null?void 0:h.error)===null){const _=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(_.message),this.hls.trigger(d.ERROR,{type:I.MEDIA_ERROR,details:A.FRAG_PARSING_ERROR,fatal:!1,error:_,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${r.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=ft.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(d.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===b.MAIN?"level":"track"}fragInfo(e,t=!0,r){var i,s;return`${this.playlistLabel()} ${e.level} (${r?"part":"frag"}:[${((i=t&&!r?e.startPTS:(r||e).start)!=null?i:NaN).toFixed(3)}-${((s=t&&!r?e.endPTS:(r||e).end)!=null?s:NaN).toFixed(3)}]${r&&e.type==="main"?"INDEPENDENT="+(r.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 Ta(o){return!!o.interstitialsController&&o.enableInterstitialPlayback!==!1}class js{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let r;if(e.length)e.length===1?r=e[0]:r=Da(e,t);else return new Uint8Array(0);return this.reset(),r}reset(){this.chunks.length=0,this.dataLength=0}}function Da(o,e){const t=new Uint8Array(e);let r=0;for(let i=0;i<o.length;i++){const s=o[i];t.set(s,r),r+=s.length}return t}var ns={exports:{}},Ws;function La(){return Ws||(Ws=1,function(o){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function i(_,g,w){this.fn=_,this.context=g,this.once=w||!1}function s(_,g,w,R,G){if(typeof w!="function")throw new TypeError("The listener must be a function");var Y=new i(w,R||_,G),X=t?t+g:g;return _._events[X]?_._events[X].fn?_._events[X]=[_._events[X],Y]:_._events[X].push(Y):(_._events[X]=Y,_._eventsCount++),_}function a(_,g){--_._eventsCount===0?_._events=new r:delete _._events[g]}function h(){this._events=new r,this._eventsCount=0}h.prototype.eventNames=function(){var g=[],w,R;if(this._eventsCount===0)return g;for(R in w=this._events)e.call(w,R)&&g.push(t?R.slice(1):R);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(w)):g},h.prototype.listeners=function(g){var w=t?t+g:g,R=this._events[w];if(!R)return[];if(R.fn)return[R.fn];for(var G=0,Y=R.length,X=new Array(Y);G<Y;G++)X[G]=R[G].fn;return X},h.prototype.listenerCount=function(g){var w=t?t+g:g,R=this._events[w];return R?R.fn?1:R.length:0},h.prototype.emit=function(g,w,R,G,Y,X){var fe=t?t+g:g;if(!this._events[fe])return!1;var ce=this._events[fe],Ee=arguments.length,Re,Te;if(ce.fn){switch(ce.once&&this.removeListener(g,ce.fn,void 0,!0),Ee){case 1:return ce.fn.call(ce.context),!0;case 2:return ce.fn.call(ce.context,w),!0;case 3:return ce.fn.call(ce.context,w,R),!0;case 4:return ce.fn.call(ce.context,w,R,G),!0;case 5:return ce.fn.call(ce.context,w,R,G,Y),!0;case 6:return ce.fn.call(ce.context,w,R,G,Y,X),!0}for(Te=1,Re=new Array(Ee-1);Te<Ee;Te++)Re[Te-1]=arguments[Te];ce.fn.apply(ce.context,Re)}else{var Ge=ce.length,Ke;for(Te=0;Te<Ge;Te++)switch(ce[Te].once&&this.removeListener(g,ce[Te].fn,void 0,!0),Ee){case 1:ce[Te].fn.call(ce[Te].context);break;case 2:ce[Te].fn.call(ce[Te].context,w);break;case 3:ce[Te].fn.call(ce[Te].context,w,R);break;case 4:ce[Te].fn.call(ce[Te].context,w,R,G);break;default:if(!Re)for(Ke=1,Re=new Array(Ee-1);Ke<Ee;Ke++)Re[Ke-1]=arguments[Ke];ce[Te].fn.apply(ce[Te].context,Re)}}return!0},h.prototype.on=function(g,w,R){return s(this,g,w,R,!1)},h.prototype.once=function(g,w,R){return s(this,g,w,R,!0)},h.prototype.removeListener=function(g,w,R,G){var Y=t?t+g:g;if(!this._events[Y])return this;if(!w)return a(this,Y),this;var X=this._events[Y];if(X.fn)X.fn===w&&(!G||X.once)&&(!R||X.context===R)&&a(this,Y);else{for(var fe=0,ce=[],Ee=X.length;fe<Ee;fe++)(X[fe].fn!==w||G&&!X[fe].once||R&&X[fe].context!==R)&&ce.push(X[fe]);ce.length?this._events[Y]=ce.length===1?ce[0]:ce:a(this,Y)}return this},h.prototype.removeAllListeners=function(g){var w;return g?(w=t?t+g:g,this._events[w]&&a(this,w)):(this._events=new r,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}(ns)),ns.exports}var Ra=La(),Ss=Q(Ra);const Un="1.6.1",Ln={};function ka(){return typeof __HLS_WORKER_BUNDLE__=="function"}function Ia(){const o=Ln[Un];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),i={worker:new self.Worker(t),objectURL:t,clientCount:1};return Ln[Un]=i,i}function Oa(o){const e=Ln[o];if(e)return e.clientCount++,e;const t=new self.URL(o,self.location.href).href,i={worker:new self.Worker(t),scriptURL:t,clientCount:1};return Ln[o]=i,i}function po(o){const e=Ln[o||Un];if(e&&e.clientCount--===1){const{worker:r,objectURL:i}=e;delete Ln[o||Un],i&&self.URL.revokeObjectURL(i),r.terminate()}}function Es(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 xs(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 ss(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 qn(o,e){const t=e;let r=0;for(;xs(o,e);){r+=10;const i=ss(o,e+6);r+=i,Es(o,e+10)&&(r+=10),e+=r}if(r>0)return o.subarray(t,t+r)}function Yn(o,e,t,r){const i=[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 Y=new Error(`invalid ADTS sampling index:${a}`);o.emit(d.ERROR,d.ERROR,{type:I.MEDIA_ERROR,details:A.FRAG_PARSING_ERROR,fatal:!0,error:Y,reason:Y.message});return}const h=(s>>6&3)+1,_=e[t+3]>>6&3|(s&1)<<2,g="mp4a.40."+h,w=i[a];let R=a;(h===5||h===29)&&(R-=3);const G=[h<<3|(R&14)>>1,(R&1)<<7|_<<3];return z.log(`manifest codec:${r}, parsed codec:${g}, channels:${_}, rate:${w} (ADTS object type:${h} sampling index:${a})`),{config:G,samplerate:w,channelCount:_,codec:g,parsedCodec:g,manifestCodec:r}}function Zn(o,e){return o[e]===255&&(o[e+1]&246)===240}function Pa(o,e){return o[e+1]&1?7:9}function Gs(o,e){return(o[e+3]&3)<<11|o[e+4]<<3|(o[e+5]&224)>>>5}function Ma(o,e){return e+5<o.length}function ws(o,e){return e+1<o.length&&Zn(o,e)}function Fa(o,e){return Ma(o,e)&&Zn(o,e)&&Gs(o,e)<=o.length-e}function Ba(o,e){if(ws(o,e)){const t=Pa(o,e);if(e+t>=o.length)return!1;const r=Gs(o,e);if(r<=t)return!1;const i=e+r;return i===o.length||ws(o,i)}return!1}function Na(o,e,t,r,i){if(!o.samplerate){const s=Yn(e,t,r,i);if(!s)return;c(o,s)}}function Ks(o){return 1024*9e4/o}function mo(o,e){const t=Pa(o,e);if(e+t<=o.length){const r=Gs(o,e)-t;if(r>0)return{headerLength:t,frameLength:r}}}function Vs(o,e,t,r,i){const s=Ks(o.samplerate),a=r+i*s,h=mo(e,t);let _;if(h){const{frameLength:R,headerLength:G}=h,Y=G+R,X=Math.max(0,t+Y-e.length);X?(_=new Uint8Array(Y-G),_.set(e.subarray(t+G,e.length),0)):_=e.subarray(t+G,t+Y);const fe={unit:_,pts:a};return X||o.samples.push(fe),{sample:fe,length:Y,missing:X}}const g=e.length-t;return _=new Uint8Array(g),_.set(e.subarray(t,e.length),0),{sample:{unit:_,pts:a},length:g,missing:-1}}function qs(o,e){return xs(o,e)&&ss(o,e+6)+10<=o.length-e}function Ys(o){if(o.size<2)return;const e=_e(o.data,!0),t=new Uint8Array(o.data.subarray(e.length+1));return{key:o.type,info:e,data:t.buffer}}function Ua(o){if(o.size<2)return;if(o.type==="TXXX"){let t=1;const r=_e(o.data.subarray(t),!0);t+=r.length+1;const i=_e(o.data.subarray(t));return{key:o.type,info:r,data:i}}const e=_e(o.data.subarray(1));return{key:o.type,info:"",data:e}}function $a(o){if(o.type==="WXXX"){if(o.size<2)return;let t=1;const r=_e(o.data.subarray(t),!0);t+=r.length+1;const i=_e(o.data.subarray(t));return{key:o.type,info:r,data:i}}const e=_e(o.data);return{key:o.type,info:"",data:e}}function za(o){return btoa(String.fromCharCode(...o))}function Ha(o,e){if(o<0)return-Ha(-o,e);const t=Math.pow(10,e);if(Math.abs(o*t%1-.5)<Number.EPSILON){const i=Math.floor(o*t);return(i%2===0?i:i+1)/t}else return Math.round(o*t)/t}function ja(o,e){const t=new URL(o),r=new URL(e);if(t.origin!==r.origin)return o;const i=t.pathname.split("/").slice(1),s=r.pathname.split("/").slice(1,-1);for(;i[0]===s[0];)i.shift(),s.shift();for(;s.length;)s.shift(),i.unshift("..");return i.join("/")}function Wa(){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,i=>{const s=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?s:s&3|8).toString(16)})}}}function go(o){return o instanceof ArrayBuffer?o:o.byteOffset==0&&o.byteLength==o.buffer.byteLength?o.buffer:new Uint8Array(o).buffer}function $n(o,e=0,t=1/0){return Zs(o,e,t,Uint8Array)}function Zs(o,e,t,r){const i=Ga(o);let s=1;"BYTES_PER_ELEMENT"in r&&(s=r.BYTES_PER_ELEMENT);const a=_o(o)?o.byteOffset:0,h=(a+o.byteLength)/s,_=(a+e)/s,g=Math.floor(Math.max(0,Math.min(_,h))),w=Math.floor(Math.min(g+Math.max(t,0),h));return new r(i,g,w-g)}function Ga(o){return o instanceof ArrayBuffer?o:o.buffer}function _o(o){return o&&o.buffer instanceof ArrayBuffer&&o.byteLength!==void 0&&o.byteOffset!==void 0}function vo(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 r=o.data.subarray(1).indexOf(0);if(r===-1)return;const i=_e($n(o.data,1,r)),s=o.data[2+r],a=o.data.subarray(3+r).indexOf(0);if(a===-1)return;const h=_e($n(o.data,3+r,a));let _;return i==="-->"?_=_e($n(o.data,4+r+a)):_=go(o.data.subarray(4+r+a)),e.mimeType=i,e.pictureType=s,e.description=h,e.data=_,e}function yo(o){return o.type==="PRIV"?Ys(o):o.type[0]==="W"?$a(o):o.type==="APIC"?vo(o):Ua(o)}function Xs(o){const e=String.fromCharCode(o[0],o[1],o[2],o[3]),t=ss(o,4),r=10;return{type:e,size:t,data:o.subarray(r,r+t)}}const As=10,bo=10;function Qs(o){let e=0;const t=[];for(;xs(o,e);){const r=ss(o,e+6);o[e+5]>>6&1&&(e+=As),e+=As;const i=e+r;for(;e+bo<i;){const s=Xs(o.subarray(e)),a=yo(s);a&&t.push(a),e+=s.size+As}Es(o,e)&&(e+=As)}return t}function Ka(o){return o&&o.key==="PRIV"&&o.info==="com.apple.streaming.transportStreamTimestamp"}function Va(o){if(o.data.byteLength===8){const e=new Uint8Array(o.data),t=e[3]&1;let r=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return r/=45,t&&(r+=4772185884e-2),Math.round(r)}}function Js(o){const e=Qs(o);for(let t=0;t<e.length;t++){const r=e[t];if(Ka(r))return Va(r)}}let Se=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 qi(o="",e=9e4){return{type:o,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class as{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,r,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,r){}demux(e,t){this.cachedData&&(e=gt(this.cachedData,e),this.cachedData=null);let r=qn(e,0),i=r?r.length:0,s;const a=this._audioTrack,h=this._id3Track,_=r?Js(r):void 0,g=e.length;for((this.basePTS===null||this.frameIndex===0&&N(_))&&(this.basePTS=ea(_,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),r&&r.length>0&&h.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:Se.audioId3,duration:Number.POSITIVE_INFINITY});i<g;){if(this.canParse(e,i)){const w=this.appendFrame(a,e,i);w?(this.frameIndex++,this.lastPTS=w.sample.pts,i+=w.length,s=i):i=g}else qs(e,i)?(r=qn(e,i),h.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:Se.audioId3,duration:Number.POSITIVE_INFINITY}),i+=r.length,s=i):i++;if(i===g&&s!==g){const w=e.slice(s);this.cachedData?this.cachedData=gt(this.cachedData,w):this.cachedData=w}}return{audioTrack:a,videoTrack:qi(),id3Track:h,textTrack:qi()}}demuxSampleAes(e,t,r){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:qi(),id3Track:this._id3Track,textTrack:qi()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const ea=(o,e,t)=>{if(N(o))return o*90;const r=t?t.baseTime*9e4/t.timescale:0;return e*9e4+r};let os=null;const ta=[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],qa=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Ya=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],So=[0,1,1,4];function ra(o,e,t,r,i){if(t+24>e.length)return;const s=ia(e,t);if(s&&t+s.frameLength<=e.length){const a=s.samplesPerFrame*9e4/s.sampleRate,h=r+i*a,_={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(_),{sample:_,length:s.frameLength,missing:0}}}function ia(o,e){const t=o[e+1]>>3&3,r=o[e+1]>>1&3,i=o[e+2]>>4&15,s=o[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&s!==3){const a=o[e+2]>>1&1,h=o[e+3]>>6,_=t===3?3-r:r===3?3:4,g=ta[_*14+i-1]*1e3,R=qa[(t===3?0:t===2?1:2)*3+s],G=h===3?1:2,Y=Ya[t][r],X=So[r],fe=Y*8*X,ce=Math.floor(Y*g/R+a)*X;if(os===null){const Te=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);os=Te?parseInt(Te[1]):0}return!!os&&os<=87&&r===2&&g>=224e3&&h===0&&(o[e+3]=o[e+3]|128),{sampleRate:R,channelCount:G,frameLength:ce,samplesPerFrame:fe}}}function Xn(o,e){return o[e]===255&&(o[e+1]&224)===224&&(o[e+1]&6)!==0}function Za(o,e){return e+1<o.length&&Xn(o,e)}function na(o,e){return Xn(o,e)&&4<=o.length-e}function sa(o,e){if(e+1<o.length&&Xn(o,e)){const r=ia(o,e);let i=4;r!=null&&r.frameLength&&(i=r.frameLength);const s=e+i;return s===o.length||Za(o,s)}return!1}class Eo extends as{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,r,i){super.resetInitSegment(e,t,r,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const r=qn(e,0);let i=(r==null?void 0:r.length)||0;if(sa(e,i))return!1;for(let s=e.length;i<s;i++)if(Ba(e,i))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return Fa(e,t)}appendFrame(e,t,r){Na(e,this.observer,t,r,e.manifestCodec);const i=Vs(e,t,r,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const Xa=(o,e)=>{let t=0,r=5;e+=r;const i=new Uint32Array(1),s=new Uint32Array(1),a=new Uint8Array(1);for(;r>0;){a[0]=o[e];const h=Math.min(r,8),_=8-h;s[0]=4278190080>>>24+_<<_,i[0]=(a[0]&s[0])>>_,t=t?t<<h|i[0]:i[0],e+=1,r-=h}return t};class Qa extends as{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,r,i){super.resetInitSegment(e,t,r,i),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,r){const i=Cs(e,t,r,this.basePTS,this.frameIndex);if(i!==-1)return{sample:e.samples[e.samples.length-1],length:i,missing:0}}static probe(e){if(!e)return!1;const t=qn(e,0);if(!t)return!1;const r=t.length;return e[r]===11&&e[r+1]===119&&Js(t)!==void 0&&Xa(e,r)<16}}function Cs(o,e,t,r,i){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],_=e[t+4]&63,w=[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][_*3+s]*2;if(t+w>e.length)return-1;const R=e[t+6]>>5;let G=0;R===2?G+=2:(R&1&&R!==1&&(G+=2),R&4&&(G+=2));const Y=(e[t+6]<<8|e[t+7])>>12-G&1,fe=[2,1,2,3,3,4,4,5][R]+Y,ce=e[t+5]>>3,Ee=e[t+5]&7,Re=new Uint8Array([s<<6|ce<<1|Ee>>2,(Ee&3)<<6|R<<3|Y<<2|_>>4,_<<4&224]),Te=1536/h*9e4,Ge=r+i*Te,Ke=e.subarray(t,t+w);return o.config=Re,o.channelCount=fe,o.samplerate=h,o.samples.push({unit:Ke,pts:Ge}),w}class xo extends as{resetInitSegment(e,t,r,i){super.resetInitSegment(e,t,r,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=qn(e,0);let r=(t==null?void 0:t.length)||0;if(t&&e[r]===11&&e[r+1]===119&&Js(t)!==void 0&&Xa(e,r)<=16)return!1;for(let i=e.length;r<i;r++)if(sa(e,r))return z.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return na(e,t)}appendFrame(e,t,r){if(this.basePTS!==null)return ra(e,t,r,this.basePTS,this.frameIndex)}}const wo=/\/emsg[-/]ID3/i;class Xo{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,r,i){const s=this.videoTrack=qi("video",1),a=this.audioTrack=qi("audio",1),h=this.txtTrack=qi("text",1);if(this.id3Track=qi("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const _=ot(e);if(_.video){const{id:g,timescale:w,codec:R,supplemental:G}=_.video;s.id=g,s.timescale=h.timescale=w,s.codec=R,s.supplemental=G}if(_.audio){const{id:g,timescale:w,codec:R}=_.audio;a.id=g,a.timescale=w,a.codec=R}h.id=st.text,s.sampleDuration=0,s.duration=a.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return Me(e)}demux(e,t){this.timeOffset=t;let r=e;const i=this.videoTrack,s=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=gt(this.remainderData,e));const h=vt(r);this.remainderData=h.remainder,i.samples=h.valid||new Uint8Array}else i.samples=r;const a=this.extractID3Track(i,t);return s.samples=mt(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:a,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,r=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(t,this.timeOffset);return r.samples=mt(e,t),{videoTrack:t,audioTrack:qi(),id3Track:i,textTrack:qi()}}extractID3Track(e,t){const r=this.id3Track;if(e.samples.length){const i=ze(e.samples,["emsg"]);i&&i.forEach(s=>{const a=Nt(s);if(wo.test(a.schemeIdUri)){const h=re(a,t);let _=a.eventDuration===4294967295?Number.POSITIVE_INFINITY:a.eventDuration/a.timeScale;_<=.001&&(_=Number.POSITIVE_INFINITY);const g=a.payload;r.samples.push({data:g,len:g.byteLength,dts:h,pts:h,type:Se.emsg,duration:_})}else if(this.config.enableEmsgKLVMetadata&&a.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const h=re(a,t);r.samples.push({data:a.payload,len:a.payload.byteLength,dts:h,pts:h,type:Se.misbklv,duration:Number.POSITIVE_INFINITY})}})}return r}demuxSampleAes(e,t,r){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 re(o,e){return N(o.presentationTime)?o.presentationTime/o.timeScale:e+o.presentationTimeDelta/o.timeScale}class p{constructor(e,t,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new Gi(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,gr.cbc)}decryptAacSample(e,t,r){const i=e[t].unit;if(i.length<=16)return;const s=i.subarray(16,i.length-i.length%16),a=s.buffer.slice(s.byteOffset,s.byteOffset+s.length);this.decryptBuffer(a).then(h=>{const _=new Uint8Array(h);i.set(_,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,r)})}decryptAacSamples(e,t,r){for(;;t++){if(t>=e.length){r();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,r),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,r=new Int8Array(t);let i=0;for(let s=32;s<e.length-16;s+=160,i+=16)r.set(e.subarray(s,s+16),i);return r}getAvcDecryptedUnit(e,t){const r=new Uint8Array(t);let i=0;for(let s=32;s<e.length-16;s+=160,i+=16)e.set(r.subarray(i,i+16),s);return e}decryptAvcSample(e,t,r,i,s){const a=Mt(s.data),h=this.getAvcEncryptedData(a);this.decryptBuffer(h.buffer).then(_=>{s.data=this.getAvcDecryptedUnit(a,_),this.decrypter.isSync()||this.decryptAvcSamples(e,t,r+1,i)})}decryptAvcSamples(e,t,r,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,r=0){if(t>=e.length){i();return}const s=e[t].units;for(;!(r>=s.length);r++){const a=s[r];if(!(a.data.length<=48||a.type!==1&&a.type!==5)&&(this.decryptAvcSample(e,t,r,i,a),!this.decrypter.isSync()))return}}}}class v{constructor(){this.VideoSample=null}createVideoSample(e,t,r){return{key:e,frame:!1,pts:t,dts:r,units:[],length:0}}getLastNalUnit(e){var t;let r=this.VideoSample,i;if((!r||r.units.length===0)&&(r=e[e.length-1]),(t=r)!=null&&t.units){const s=r.units;i=s[s.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const r=t.samples,i=r.length;if(i){const s=r[i-1];e.pts=s.pts,e.dts=s.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,r){const i=t.byteLength;let s=e.naluState||0;const a=s,h=[];let _=0,g,w,R,G=-1,Y=0;for(s===-1&&(G=0,Y=this.getNALuType(t,0),s=0,_=1);_<i;){if(g=t[_++],!s){s=g?0:1;continue}if(s===1){s=g?0:2;continue}if(!g)s=3;else if(g===1){if(w=_-s-1,G>=0){const X={data:t.subarray(G,w),type:Y};h.push(X)}else{const X=this.getLastNalUnit(e.samples);X&&(a&&_<=4-a&&X.state&&(X.data=X.data.subarray(0,X.data.byteLength-a)),w>0&&(X.data=gt(X.data,t.subarray(0,w)),X.state=0))}_<i?(R=this.getNALuType(t,_),G=_,Y=R,s=0):s=-1}else s=0}if(G>=0&&s>=0){const X={data:t.subarray(G,i),type:Y,state:s};h.push(X)}if(h.length===0){const X=this.getLastNalUnit(e.samples);X&&(X.data=gt(X.data,t))}return e.naluState=s,h}}class y{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,r=e.byteLength-t,i=new Uint8Array(4),s=Math.min(4,t);if(s===0)throw new Error("no bytes available");i.set(e.subarray(r,r+s)),this.word=new DataView(i.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 r=this.word>>>32-t;if(e>32&&z.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?r<<t|this.readBits(t):r}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 C extends v{parsePES(e,t,r,i){const s=this.parseNALu(e,r.data,i);let a=this.VideoSample,h,_=!1;r.data=null,a&&s.length&&!e.audFound&&(this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),s.forEach(g=>{var w,R;switch(g.type){case 1:{let fe=!1;h=!0;const ce=g.data;if(_&&ce.length>4){const Ee=this.readSliceType(ce);(Ee===2||Ee===4||Ee===7||Ee===9)&&(fe=!0)}if(fe){var G;(G=a)!=null&&G.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null)}a||(a=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),a.frame=!0,a.key=fe;break}case 5:h=!0,(w=a)!=null&&w.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null),a||(a=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),a.key=!0,a.frame=!0;break;case 6:{h=!0,yt(g.data,1,r.pts,t.samples);break}case 7:{var Y,X;h=!0,_=!0;const fe=g.data,ce=this.readSPS(fe);if(!e.sps||e.width!==ce.width||e.height!==ce.height||((Y=e.pixelRatio)==null?void 0:Y[0])!==ce.pixelRatio[0]||((X=e.pixelRatio)==null?void 0:X[1])!==ce.pixelRatio[1]){e.width=ce.width,e.height=ce.height,e.pixelRatio=ce.pixelRatio,e.sps=[fe];const Ee=fe.subarray(1,4);let Re="avc1.";for(let Te=0;Te<3;Te++){let Ge=Ee[Te].toString(16);Ge.length<2&&(Ge="0"+Ge),Re+=Ge}e.codec=Re}break}case 8:h=!0,e.pps=[g.data];break;case 9:h=!0,e.audFound=!0,(R=a)!=null&&R.frame&&(this.pushAccessUnit(a,e),a=null),a||(a=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts));break;case 12:h=!0;break;default:h=!1;break}a&&h&&a.units.push(g)}),i&&a&&(this.pushAccessUnit(a,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new y(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let r=8,i=8,s;for(let a=0;a<e;a++)i!==0&&(s=t.readEG(),i=(r+s+256)%256),r=i===0?r:i}readSPS(e){const t=new y(e);let r=0,i=0,s=0,a=0,h,_,g;const w=t.readUByte.bind(t),R=t.readBits.bind(t),G=t.readUEG.bind(t),Y=t.readBoolean.bind(t),X=t.skipBits.bind(t),fe=t.skipEG.bind(t),ce=t.skipUEG.bind(t),Ee=this.skipScalingList.bind(this);w();const Re=w();if(R(5),X(3),w(),ce(),Re===100||Re===110||Re===122||Re===244||Re===44||Re===83||Re===86||Re===118||Re===128){const it=G();if(it===3&&X(1),ce(),ce(),X(1),Y())for(_=it!==3?8:12,g=0;g<_;g++)Y()&&(g<6?Ee(16,t):Ee(64,t))}ce();const Te=G();if(Te===0)G();else if(Te===1)for(X(1),fe(),fe(),h=G(),g=0;g<h;g++)fe();ce(),X(1);const Ge=G(),Ke=G(),ct=R(1);ct===0&&X(1),X(1),Y()&&(r=G(),i=G(),s=G(),a=G());let qe=[1,1];if(Y()&&Y())switch(w()){case 1:qe=[1,1];break;case 2:qe=[12,11];break;case 3:qe=[10,11];break;case 4:qe=[16,11];break;case 5:qe=[40,33];break;case 6:qe=[24,11];break;case 7:qe=[20,11];break;case 8:qe=[32,11];break;case 9:qe=[80,33];break;case 10:qe=[18,11];break;case 11:qe=[15,11];break;case 12:qe=[64,33];break;case 13:qe=[160,99];break;case 14:qe=[4,3];break;case 15:qe=[3,2];break;case 16:qe=[2,1];break;case 255:{qe=[w()<<8|w(),w()<<8|w()];break}}return{width:Math.ceil((Ge+1)*16-r*2-i*2),height:(2-ct)*(Ke+1)*16-(ct?2:4)*(s+a),pixelRatio:qe}}}class q extends v{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,r,i){const s=this.parseNALu(e,r.data,i);let a=this.VideoSample,h,_=!1;r.data=null,a&&s.length&&!e.audFound&&(this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),s.forEach(g=>{var w,R;switch(g.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,r.pts,r.dts)),a.frame=!0,h=!0;break;case 16:case 17:case 18:case 21:if(h=!0,_){var G;(G=a)!=null&&G.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null)}a||(a=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),a.key=!0,a.frame=!0;break;case 19:case 20:h=!0,(w=a)!=null&&w.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null),a||(a=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),a.key=!0,a.frame=!0;break;case 39:h=!0,yt(g.data,2,r.pts,t.samples);break;case 32:h=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=c(e.params,this.readVPS(g.data)),this.initVPS=g.data),e.vps=[g.data];break;case 33:if(h=!0,_=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],g.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const Y=this.readSPS(g.data);e.width=Y.width,e.height=Y.height,e.pixelRatio=Y.pixelRatio,e.codec=Y.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const X in Y.params)e.params[X]=Y.params[X]}this.pushParameterSet(e.sps,g.data,e.vps),a||(a=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),a.key=!0;break;case 34:if(h=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const Y=this.readPPS(g.data);for(const X in Y)e.params[X]=Y[X]}this.pushParameterSet(e.pps,g.data,e.vps)}break;case 35:h=!0,e.audFound=!0,(R=a)!=null&&R.frame&&(this.pushAccessUnit(a,e),a=null),a||(a=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts));break;default:h=!1;break}a&&h&&a.units.push(g)}),i&&a&&(this.pushAccessUnit(a,e),this.VideoSample=null)}pushParameterSet(e,t,r){(r&&r[0]===this.initVPS||!r&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let r=0;for(let i=0;i<e.byteLength;i++)i>=2&&e[i]===3&&e[i-1]===0&&e[i-2]===0||(t[r]=e[i],r++);return new Uint8Array(t.buffer,0,r)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new y(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const r=t.readBits(3),i=t.readBoolean();return{numTemporalLayers:r+1,temporalIdNested:i}}readSPS(e){const t=new y(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const r=t.readBits(3);t.readBoolean();const i=t.readBits(2),s=t.readBoolean(),a=t.readBits(5),h=t.readUByte(),_=t.readUByte(),g=t.readUByte(),w=t.readUByte(),R=t.readUByte(),G=t.readUByte(),Y=t.readUByte(),X=t.readUByte(),fe=t.readUByte(),ce=t.readUByte(),Ee=t.readUByte(),Re=[],Te=[];for(let Pr=0;Pr<r;Pr++)Re.push(t.readBoolean()),Te.push(t.readBoolean());if(r>0)for(let Pr=r;Pr<8;Pr++)t.readBits(2);for(let Pr=0;Pr<r;Pr++)Re[Pr]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),Te[Pr]&&t.readUByte();t.readUEG();const Ge=t.readUEG();Ge==3&&t.skipBits(1);const Ke=t.readUEG(),ct=t.readUEG(),qe=t.readBoolean();let it=0,ht=0,Xe=0,St=0;qe&&(it+=t.readUEG(),ht+=t.readUEG(),Xe+=t.readUEG(),St+=t.readUEG());const Pt=t.readUEG(),Sr=t.readUEG(),ir=t.readUEG(),Xt=t.readBoolean();for(let Pr=Xt?0:r;Pr<=r;Pr++)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 Li=0;Li<4;Li++)for(let an=0;an<(Li===3?2:6);an++)if(!t.readBoolean())t.readUEG();else{const bn=Math.min(64,1<<4+(Li<<1));Li>1&&t.readEG();for(let Os=0;Os<bn;Os++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const qt=t.readUEG();let Et=0;for(let Pr=0;Pr<qt;Pr++){let Li=!1;if(Pr!==0&&(Li=t.readBoolean()),Li){Pr===qt&&t.readUEG(),t.readBoolean(),t.readUEG();let an=0;for(let hs=0;hs<=Et;hs++){const bn=t.readBoolean();let Os=!1;bn||(Os=t.readBoolean()),(bn||Os)&&an++}Et=an}else{const an=t.readUEG(),hs=t.readUEG();Et=an+hs;for(let bn=0;bn<an;bn++)t.readUEG(),t.readBoolean();for(let bn=0;bn<hs;bn++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const Pr=t.readUEG();for(let Li=0;Li<Pr;Li++){for(let an=0;an<ir+4;an++)t.readBits(1);t.readBits(1)}}let lr=0,nr=1,vr=1,Lr=!0,Ur=1,Vr=0;t.readBoolean(),t.readBoolean();let Pi=!1;if(t.readBoolean()){if(t.readBoolean()){const fs=t.readUByte(),jl=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],uo=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];fs>0&&fs<16?(nr=jl[fs-1],vr=uo[fs-1]):fs===255&&(nr=t.readBits(16),vr=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(),Pi=t.readBoolean(),Pi&&(it+=t.readUEG(),ht+=t.readUEG(),Xe+=t.readUEG(),St+=t.readUEG()),t.readBoolean()&&(Ur=t.readBits(32),Vr=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const uo=t.readBoolean(),Wl=t.readBoolean();let pa=!1;(uo||Wl)&&(pa=t.readBoolean(),pa&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),pa&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let Gl=0;Gl<=r;Gl++){Lr=t.readBoolean();const t0=Lr||t.readBoolean();let Kl=!1;t0?t.readEG():Kl=t.readBoolean();const Vl=Kl?1:t.readUEG()+1;if(uo)for(let ma=0;ma<Vl;ma++)t.readUEG(),t.readUEG(),pa&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(Wl)for(let ma=0;ma<Vl;ma++)t.readUEG(),t.readUEG(),pa&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),lr=t.readUEG())}let es=Ke,Hl=ct;if(qe||Pi){let Pr=1,Li=1;Ge===1?Pr=Li=2:Ge==2&&(Pr=2),es=Ke-Pr*ht-Pr*it,Hl=ct-Li*St-Li*Xe}const Jc=i?["A","B","C"][i]:"",e0=h<<24|_<<16|g<<8|w;let Yo=0;for(let Pr=0;Pr<32;Pr++)Yo=(Yo|(e0>>Pr&1)<<31-Pr)>>>0;let Zo=Yo.toString(16);return a===1&&Zo==="2"&&(Zo="6"),{codecString:`hvc1.${Jc}${a}.${Zo}.${s?"H":"L"}${Ee}.B0`,params:{general_tier_flag:s,general_profile_idc:a,general_profile_space:i,general_profile_compatibility_flags:[h,_,g,w],general_constraint_indicator_flags:[R,G,Y,X,fe,ce],general_level_idc:Ee,bit_depth:Pt+8,bit_depth_luma_minus8:Pt,bit_depth_chroma_minus8:Sr,min_spatial_segmentation_idc:lr,chroma_format_idc:Ge,frame_rate:{fixed:Lr,fps:Vr/Ur}},width:es,height:Hl,pixelRatio:[nr,vr]}}readPPS(e){const t=new y(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const i=t.readBoolean(),s=t.readBoolean();let a=1;return s&&i?a=0:s?a=3:i&&(a=2),{parallelismType:a}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const ee=188;class pe{constructor(e,t,r,i){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=r,this.logger=i,this.videoParser=null}static probe(e,t){const r=pe.syncOffset(e);return r>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${r}`),r!==-1}static syncOffset(e){const t=e.length;let r=Math.min(ee*5,t-ee)+1,i=0;for(;i<r;){let s=!1,a=-1,h=0;for(let _=i;_<t;_+=ee)if(e[_]===71&&(t-_===ee||e[_+ee]===71)){if(h++,a===-1&&(a=_,a!==0&&(r=Math.min(a+ee*99,e.length-ee)+1)),s||(s=ve(e,_)===0),s&&h>1&&(a===0&&h>2||_+ee>r))return a}else{if(h)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:st[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,r,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=pe.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=pe.createTrack("audio",i),this._id3Track=pe.createTrack("id3"),this._txtTrack=pe.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=r}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:r}=this;e&&(e.pesData=null),t&&(t.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,r=!1,i=!1){r||(this.sampleAes=null);let s;const a=this._videoTrack,h=this._audioTrack,_=this._id3Track,g=this._txtTrack;let w=a.pid,R=a.pesData,G=h.pid,Y=_.pid,X=h.pesData,fe=_.pesData,ce=null,Ee=this.pmtParsed,Re=this._pmtId,Te=e.length;if(this.remainderData&&(e=gt(this.remainderData,e),Te=e.length,this.remainderData=null),Te<ee&&!i)return this.remainderData=e,{audioTrack:h,videoTrack:a,id3Track:_,textTrack:g};const Ge=Math.max(0,pe.syncOffset(e));Te-=(Te-Ge)%ee,Te<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,Te,e.buffer.byteLength-Te));let Ke=0;for(let qe=Ge;qe<Te;qe+=ee)if(e[qe]===71){const it=!!(e[qe+1]&64),ht=ve(e,qe),Xe=(e[qe+3]&48)>>4;let St;if(Xe>1){if(St=qe+5+e[qe+4],St===qe+ee)continue}else St=qe+4;switch(ht){case w:if(it){if(R&&(s=dt(R,this.logger))){if(this.videoParser===null)switch(a.segmentCodec){case"avc":this.videoParser=new C;break;case"hevc":this.videoParser=new q;break}this.videoParser!==null&&this.videoParser.parsePES(a,g,s,!1)}R={data:[],size:0}}R&&(R.data.push(e.subarray(St,qe+ee)),R.size+=qe+ee-St);break;case G:if(it){if(X&&(s=dt(X,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}X={data:[],size:0}}X&&(X.data.push(e.subarray(St,qe+ee)),X.size+=qe+ee-St);break;case Y:it&&(fe&&(s=dt(fe,this.logger))&&this.parseID3PES(_,s),fe={data:[],size:0}),fe&&(fe.data.push(e.subarray(St,qe+ee)),fe.size+=qe+ee-St);break;case 0:it&&(St+=e[St]+1),Re=this._pmtId=Ce(e,St);break;case Re:{it&&(St+=e[St]+1);const Pt=$e(e,St,this.typeSupported,r,this.observer,this.logger);w=Pt.videoPid,w>0&&(a.pid=w,a.segmentCodec=Pt.segmentVideoCodec),G=Pt.audioPid,G>0&&(h.pid=G,h.segmentCodec=Pt.segmentAudioCodec),Y=Pt.id3Pid,Y>0&&(_.pid=Y),ce!==null&&!Ee&&(this.logger.warn(`MPEG-TS PMT found at ${qe} after unknown PID '${ce}'. Backtracking to sync byte @${Ge} to parse all TS packets.`),ce=null,qe=Ge-188),Ee=this.pmtParsed=!0;break}case 17:case 8191:break;default:ce=ht;break}}else Ke++;Ke>0&&Ye(this.observer,new Error(`Found ${Ke} TS packet/s that do not start with 0x47`),void 0,this.logger),a.pesData=R,h.pesData=X,_.pesData=fe;const ct={audioTrack:h,videoTrack:a,id3Track:_,textTrack:g};return i&&this.extractRemainingSamples(ct),ct}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:r,id3Track:i,textTrack:s}=e,a=r.pesData,h=t.pesData,_=i.pesData;let g;if(a&&(g=dt(a,this.logger))){if(this.videoParser===null)switch(r.segmentCodec){case"avc":this.videoParser=new C;break;case"hevc":this.videoParser=new q;break}this.videoParser!==null&&(this.videoParser.parsePES(r,s,g,!0),r.pesData=null)}else r.pesData=a;if(h&&(g=dt(h,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,g);break;case"mp3":this.parseMPEGPES(t,g);break;case"ac3":this.parseAC3PES(t,g);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=dt(_,this.logger))?(this.parseID3PES(i,g),i.pesData=null):i.pesData=_}demuxSampleAes(e,t,r){const i=this.demux(e,r,!0,!this.config.progressive),s=this.sampleAes=new p(this.observer,this.config,t);return this.decrypt(i,s)}decrypt(e,t){return new Promise(r=>{const{audioTrack:i,videoTrack:s}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{s.samples?t.decryptAvcSamples(s.samples,0,0,()=>{r(e)}):r(e)}):s.samples&&t.decryptAvcSamples(s.samples,0,0,()=>{r(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 r=0;const i=this.aacOverFlow;let s=t.data;if(i){this.aacOverFlow=null;const R=i.missing,G=i.sample.unit.byteLength;if(R===-1)s=gt(i.sample.unit,s);else{const Y=G-R;i.sample.unit.set(s.subarray(0,R),Y),e.samples.push(i.sample),r=i.missing}}let a,h;for(a=r,h=s.length;a<h-1&&!ws(s,a);a++);if(a!==r){let R;const G=a<h-1;if(G?R=`AAC PES did not start with ADTS header,offset:${a}`:R="No ADTS header found in AAC PES",Ye(this.observer,new Error(R),G,this.logger),!G)return}Na(e,this.observer,s,a,this.audioCodec);let _;if(t.pts!==void 0)_=t.pts;else if(i){const R=Ks(e.samplerate);_=i.sample.pts+R}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let g=0,w;for(;a<h;)if(w=Vs(e,s,a,_,g),a+=w.length,w.missing){this.aacOverFlow=w;break}else for(g++;a<h-1&&!ws(s,a);a++);}parseMPEGPES(e,t){const r=t.data,i=r.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<i;)if(Za(r,a)){const _=ra(e,r,a,h,s);if(_)a+=_.length,s++;else break}else a++}parseAC3PES(e,t){{const r=t.data,i=t.pts;if(i===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const s=r.length;let a=0,h=0,_;for(;h<s&&(_=Cs(e,r,h,i,a++))>0;)h+=_}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const r=c({},t,{type:this._videoTrack?Se.emsg:Se.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(r)}}function ve(o,e){return((o[e+1]&31)<<8)+o[e+2]}function Ce(o,e){return(o[e+10]&31)<<8|o[e+11]}function $e(o,e,t,r,i,s){const a={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},h=(o[e+1]&15)<<8|o[e+2],_=e+3+h-4,g=(o[e+10]&15)<<8|o[e+11];for(e+=12+g;e<_;){const w=ve(o,e),R=(o[e+3]&15)<<8|o[e+4];switch(o[e]){case 207:if(!r){lt("ADTS AAC",s);break}case 15:a.audioPid===-1&&(a.audioPid=w);break;case 21:a.id3Pid===-1&&(a.id3Pid=w);break;case 219:if(!r){lt("H.264",s);break}case 27:a.videoPid===-1&&(a.videoPid=w);break;case 3:case 4:!t.mpeg&&!t.mp3?s.log("MPEG audio found, not supported in this browser"):a.audioPid===-1&&(a.audioPid=w,a.segmentAudioCodec="mp3");break;case 193:if(!r){lt("AC-3",s);break}case 129:t.ac3?a.audioPid===-1&&(a.audioPid=w,a.segmentAudioCodec="ac3"):s.log("AC-3 audio found, not supported in this browser");break;case 6:if(a.audioPid===-1&&R>0){let G=e+5,Y=R;for(;Y>2;){switch(o[G]){case 106:t.ac3!==!0?s.log("AC-3 audio found, not supported in this browser for now"):(a.audioPid=w,a.segmentAudioCodec="ac3");break}const fe=o[G+1]+2;G+=fe,Y-=fe}}break;case 194:case 135:return Ye(i,new Error("Unsupported EC-3 in M2TS found"),void 0,s),a;case 36:a.videoPid===-1&&(a.videoPid=w,a.segmentVideoCodec="hevc",s.log("HEVC in M2TS found"));break}e+=R+5}return a}function Ye(o,e,t,r){r.warn(`parsing error: ${e.message}`),o.emit(d.ERROR,d.ERROR,{type:I.MEDIA_ERROR,details:A.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function lt(o,e){e.log(`${o} with AES-128-CBC encryption found in unencrypted stream`)}function dt(o,e){let t=0,r,i,s,a,h;const _=o.data;if(!o||o.size===0)return null;for(;_[0].length<19&&_.length>1;)_[0]=gt(_[0],_[1]),_.splice(1,1);if(r=_[0],(r[0]<<16)+(r[1]<<8)+r[2]===1){if(i=(r[4]<<8)+r[5],i&&i>o.size-6)return null;const w=r[7];w&192&&(a=(r[9]&14)*536870912+(r[10]&255)*4194304+(r[11]&254)*16384+(r[12]&255)*128+(r[13]&254)/2,w&64?(h=(r[14]&14)*536870912+(r[15]&255)*4194304+(r[16]&254)*16384+(r[17]&255)*128+(r[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=r[8];let R=s+9;if(o.size<=R)return null;o.size-=R;const G=new Uint8Array(o.size);for(let Y=0,X=_.length;Y<X;Y++){r=_[Y];let fe=r.byteLength;if(R)if(R>fe){R-=fe;continue}else r=r.subarray(R),fe-=R,R=0;G.set(r,t),t+=fe}return i&&(i-=s+3),{data:G,pts:a,dts:h,len:i}}return null}class bt{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 Rt=Math.pow(2,32)-1;class Be{static init(){Be.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 Be.types)Be.types.hasOwnProperty(e)&&(Be.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]),r=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]);Be.HDLR_TYPES={video:t,audio:r};const i=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]);Be.STTS=Be.STSC=Be.STCO=s,Be.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Be.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Be.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Be.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]),_=new Uint8Array([0,0,0,1]);Be.FTYP=Be.box(Be.types.ftyp,a,_,a,h),Be.DINF=Be.box(Be.types.dinf,Be.box(Be.types.dref,i))}static box(e,...t){let r=8,i=t.length;const s=i;for(;i--;)r+=t[i].byteLength;const a=new Uint8Array(r);for(a[0]=r>>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=r&255,a.set(e,4),i=0,r=8;i<s;i++)a.set(t[i],r),r+=t[i].byteLength;return a}static hdlr(e){return Be.box(Be.types.hdlr,Be.HDLR_TYPES[e])}static mdat(e){return Be.box(Be.types.mdat,e)}static mdhd(e,t){t*=e;const r=Math.floor(t/(Rt+1)),i=Math.floor(t%(Rt+1));return Be.box(Be.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,r>>24,r>>16&255,r>>8&255,r&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return Be.box(Be.types.mdia,Be.mdhd(e.timescale||0,e.duration||0),Be.hdlr(e.type),Be.minf(e))}static mfhd(e){return Be.box(Be.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"?Be.box(Be.types.minf,Be.box(Be.types.smhd,Be.SMHD),Be.DINF,Be.stbl(e)):Be.box(Be.types.minf,Be.box(Be.types.vmhd,Be.VMHD),Be.DINF,Be.stbl(e))}static moof(e,t,r){return Be.box(Be.types.moof,Be.mfhd(e),Be.traf(r,t))}static moov(e){let t=e.length;const r=[];for(;t--;)r[t]=Be.trak(e[t]);return Be.box.apply(null,[Be.types.moov,Be.mvhd(e[0].timescale||0,e[0].duration||0)].concat(r).concat(Be.mvex(e)))}static mvex(e){let t=e.length;const r=[];for(;t--;)r[t]=Be.trex(e[t]);return Be.box.apply(null,[Be.types.mvex,...r])}static mvhd(e,t){t*=e;const r=Math.floor(t/(Rt+1)),i=Math.floor(t%(Rt+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,r>>24,r>>16&255,r>>8&255,r&255,i>>24,i>>16&255,i>>8&255,i&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return Be.box(Be.types.mvhd,s)}static sdtp(e){const t=e.samples||[],r=new Uint8Array(4+t.length);let i,s;for(i=0;i<t.length;i++)s=t[i].flags,r[i+4]=s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy;return Be.box(Be.types.sdtp,r)}static stbl(e){return Be.box(Be.types.stbl,Be.stsd(e),Be.box(Be.types.stts,Be.STTS),Be.box(Be.types.stsc,Be.STSC),Be.box(Be.types.stsz,Be.STSZ),Be.box(Be.types.stco,Be.STCO))}static avc1(e){let t=[],r=[],i,s,a;for(i=0;i<e.sps.length;i++)s=e.sps[i],a=s.byteLength,t.push(a>>>8&255),t.push(a&255),t=t.concat(Array.prototype.slice.call(s));for(i=0;i<e.pps.length;i++)s=e.pps[i],a=s.byteLength,r.push(a>>>8&255),r.push(a&255),r=r.concat(Array.prototype.slice.call(s));const h=Be.box(Be.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(r))),_=e.width,g=e.height,w=e.pixelRatio[0],R=e.pixelRatio[1];return Be.box(Be.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,_>>8&255,_&255,g>>8&255,g&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,Be.box(Be.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Be.box(Be.types.pasp,new Uint8Array([w>>24,w>>16&255,w>>8&255,w&255,R>>24,R>>16&255,R>>8&255,R&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 Be.box(Be.types.mp4a,Be.audioStsd(e),Be.box(Be.types.esds,Be.esds(e)))}static mp3(e){return Be.box(Be.types[".mp3"],Be.audioStsd(e))}static ac3(e){return Be.box(Be.types["ac-3"],Be.audioStsd(e),Be.box(Be.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return Be.box(Be.types.stsd,Be.STSD,Be.mp4a(e));if(t==="ac3"&&e.config)return Be.box(Be.types.stsd,Be.STSD,Be.ac3(e));if(t==="mp3"&&e.codec==="mp3")return Be.box(Be.types.stsd,Be.STSD,Be.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return Be.box(Be.types.stsd,Be.STSD,Be.avc1(e));if(t==="hevc"&&e.vps)return Be.box(Be.types.stsd,Be.STSD,Be.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,r=(e.duration||0)*(e.timescale||0),i=e.width||0,s=e.height||0,a=Math.floor(r/(Rt+1)),h=Math.floor(r%(Rt+1));return Be.box(Be.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,i>>8&255,i&255,0,0,s>>8&255,s&255,0,0]))}static traf(e,t){const r=Be.sdtp(e),i=e.id,s=Math.floor(t/(Rt+1)),a=Math.floor(t%(Rt+1));return Be.box(Be.types.traf,Be.box(Be.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),Be.box(Be.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])),Be.trun(e,r.length+16+20+8+16+8+8),r)}static trak(e){return e.duration=e.duration||4294967295,Be.box(Be.types.trak,Be.tkhd(e),Be.mdia(e))}static trex(e){const t=e.id;return Be.box(Be.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 r=e.samples||[],i=r.length,s=12+16*i,a=new Uint8Array(s);let h,_,g,w,R,G;for(t+=8+s,a.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),h=0;h<i;h++)_=r[h],g=_.duration,w=_.size,R=_.flags,G=_.cts,a.set([g>>>24&255,g>>>16&255,g>>>8&255,g&255,w>>>24&255,w>>>16&255,w>>>8&255,w&255,R.isLeading<<2|R.dependsOn,R.isDependedOn<<6|R.hasRedundancy<<4|R.paddingValue<<1|R.isNonSync,R.degradPrio&61440,R.degradPrio&15,G>>>24&255,G>>>16&255,G>>>8&255,G&255],12+16*h);return Be.box(Be.types.trun,a)}static initSegment(e){Be.types||Be.init();const t=Be.moov(e);return gt(Be.FTYP,t)}static hvc1(e){const t=e.params,r=[e.vps,e.sps,e.pps],i=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),i-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),r.length]);let a=s.length;for(let X=0;X<r.length;X+=1){a+=3;for(let fe=0;fe<r[X].length;fe+=1)a+=2+r[X][fe].length}const h=new Uint8Array(a);h.set(s,0),a=s.length;const _=r.length-1;for(let X=0;X<r.length;X+=1){h.set(new Uint8Array([32+X|(X===_?128:0),0,r[X].length]),a),a+=3;for(let fe=0;fe<r[X].length;fe+=1)h.set(new Uint8Array([r[X][fe].length>>8,r[X][fe].length&255]),a),a+=2,h.set(r[X][fe],a),a+=r[X][fe].length}const g=Be.box(Be.types.hvcC,h),w=e.width,R=e.height,G=e.pixelRatio[0],Y=e.pixelRatio[1];return Be.box(Be.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,w>>8&255,w&255,R>>8&255,R&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]),g,Be.box(Be.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Be.box(Be.types.pasp,new Uint8Array([G>>24,G>>16&255,G>>8&255,G&255,Y>>24,Y>>16&255,Y>>8&255,Y&255])))}}Be.types=void 0,Be.HDLR_TYPES=void 0,Be.STTS=void 0,Be.STSC=void 0,Be.STCO=void 0,Be.STSZ=void 0,Be.VMHD=void 0,Be.SMHD=void 0,Be.STSD=void 0,Be.FTYP=void 0,Be.DINF=void 0;const ar=9e4;function or(o,e,t=1,r=!1){const i=o*e*t;return r?Math.round(i):i}function dr(o,e,t=1,r=!1){return or(o,e,1/t,r)}function Ir(o,e=!1){return or(o,1e3,1/ar,e)}function Nr(o,e=1){return or(o,ar,1/e)}const Yr=10*1e3,Zr=1024,ri=1152,Ei=1536;let ii=null,Or=null;function Oi(o,e,t,r){return{duration:e,size:t,cts:r,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:o?2:1,isNonSync:o?0:1}}}class Yi{constructor(e,t,r,i){if(this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=r,this.logger=i,this.ISGenerated=!1,ii===null){const a=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);ii=a?parseInt(a[1]):0}if(Or===null){const s=navigator.userAgent.match(/Safari\/(\d+)/i);Or=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 r=e[0].pts,i=e.reduce((s,a)=>{let h=a.pts,_=h-s;return _<-4294967296&&(t=!0,h=ni(h,r),_=h-s),_>0?s:h},r);return t&&this.logger.debug("PTS rollover detected"),i}remux(e,t,r,i,s,a,h,_){let g,w,R,G,Y,X,fe=s,ce=s;const Ee=e.pid>-1,Re=t.pid>-1,Te=t.samples.length,Ge=e.samples.length>0,Ke=h&&Te>0||Te>1;if((!Ee||Ge)&&(!Re||Ke)||this.ISGenerated||h){if(this.ISGenerated){var qe,it,ht,Xe;const ir=this.videoTrackConfig;(ir&&(t.width!==ir.width||t.height!==ir.height||((qe=t.pixelRatio)==null?void 0:qe[0])!==((it=ir.pixelRatio)==null?void 0:it[0])||((ht=t.pixelRatio)==null?void 0:ht[1])!==((Xe=ir.pixelRatio)==null?void 0:Xe[1]))||!ir&&Ke||this.nextAudioPts===null&&Ge)&&this.resetInitSegment()}this.ISGenerated||(R=this.generateIS(e,t,s,a));const St=this.isVideoContiguous;let Pt=-1,Sr;if(Ke&&(Pt=xi(t.samples),!St&&this.config.forceKeyFrameOnDiscontinuity))if(X=!0,Pt>0){this.logger.warn(`[mp4-remuxer]: Dropped ${Pt} out of ${Te} video samples due to a missing keyframe`);const ir=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(Pt),t.dropped+=Pt,ce+=(t.samples[0].pts-ir)/t.inputTimeScale,Sr=ce}else Pt===-1&&(this.logger.warn(`[mp4-remuxer]: No keyframe found out of ${Te} video samples`),X=!1);if(this.ISGenerated){if(Ge&&Ke){const ir=this.getVideoStartPts(t.samples),Gt=(ni(e.samples[0].pts,ir)-ir)/t.inputTimeScale;fe+=Math.max(0,Gt),ce+=Math.max(0,-Gt)}if(Ge){if(e.samplerate||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),R=this.generateIS(e,t,s,a)),w=this.remuxAudio(e,fe,this.isAudioContiguous,a,Re||Ke||_===b.AUDIO?ce:void 0),Ke){const ir=w?w.endPTS-w.startPTS:0;t.inputTimeScale||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),R=this.generateIS(e,t,s,a)),g=this.remuxVideo(t,ce,St,ir)}}else Ke&&(g=this.remuxVideo(t,ce,St,0));g&&(g.firstKeyFrame=Pt,g.independent=Pt!==-1,g.firstKeyFramePTS=Sr)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(r.samples.length&&(Y=_n(r,s,this._initPTS,this._initDTS)),i.samples.length&&(G=nn(i,s,this._initPTS))),{audio:w,video:g,initSegment:R,independent:X,text:G,id3:Y}}generateIS(e,t,r,i){const s=e.samples,a=t.samples,h=this.typeSupported,_={},g=this._initPTS;let w=!g||i,R="audio/mp4",G,Y,X;if(w&&(G=Y=1/0),e.config&&s.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":h.mpeg?(R="audio/mpeg",e.codec=""):h.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}_.audio={id:"audio",container:R,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&h.mpeg?new Uint8Array(0):Be.initSegment([e]),metadata:{channelCount:e.channelCount}},w&&(X=e.inputTimeScale,!g||X!==g.timescale?G=Y=s[0].pts-Math.round(X*r):w=!1)}if(t.sps&&t.pps&&a.length){if(t.timescale=t.inputTimeScale,_.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Be.initSegment([t]),metadata:{width:t.width,height:t.height}},w)if(X=t.inputTimeScale,!g||X!==g.timescale){const fe=this.getVideoStartPts(a),ce=Math.round(X*r);Y=Math.min(Y,ni(a[0].dts,fe)-ce),G=Math.min(G,fe-ce)}else w=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(_).length)return this.ISGenerated=!0,w?(this._initPTS={baseTime:G,timescale:X},this._initDTS={baseTime:Y,timescale:X}):G=X=void 0,{tracks:_,initPTS:G,timescale:X}}remuxVideo(e,t,r,i){const s=e.inputTimeScale,a=e.samples,h=[],_=a.length,g=this._initPTS;let w=this.nextAvcDts,R=8,G=this.videoSampleDuration,Y,X,fe=Number.POSITIVE_INFINITY,ce=Number.NEGATIVE_INFINITY,Ee=!1;if(!r||w===null){const Et=t*s,Dt=a[0].pts-ni(a[0].dts,a[0].pts);ii&&w!==null&&Math.abs(Et-Dt-w)<15e3?r=!0:w=Et-Dt}const Re=g.baseTime*s/g.timescale;for(let Et=0;Et<_;Et++){const Dt=a[Et];Dt.pts=ni(Dt.pts-Re,w),Dt.dts=ni(Dt.dts-Re,w),Dt.dts<a[Et>0?Et-1:Et].dts&&(Ee=!0)}Ee&&a.sort(function(Et,Dt){const lr=Et.dts-Dt.dts,nr=Et.pts-Dt.pts;return lr||nr}),Y=a[0].dts,X=a[a.length-1].dts;const Te=X-Y,Ge=Te?Math.round(Te/(_-1)):G||e.inputTimeScale/30;if(r){const Et=Y-w,Dt=Et>Ge,lr=Et<-1;if((Dt||lr)&&(Dt?this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Ir(Et,!0)} ms (${Et}dts) hole between fragments detected at ${t.toFixed(3)}`):this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Ir(-Et,!0)} ms (${Et}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!lr||w>=a[0].pts||ii)){Y=w;const nr=a[0].pts-Et;if(Dt)a[0].dts=Y,a[0].pts=nr;else{let vr=!0;for(let Lr=0;Lr<a.length&&!(a[Lr].dts>nr&&vr);Lr++){const Ur=a[Lr].pts;if(a[Lr].dts-=Et,a[Lr].pts-=Et,Lr<a.length-1){const Vr=a[Lr+1].pts,Pi=a[Lr].pts,Hi=Vr<=Pi,es=Vr<=Ur;vr=Hi==es}}}this.logger.log(`Video: Initial PTS/DTS adjusted: ${Ir(nr,!0)}/${Ir(Y,!0)}, delta: ${Ir(Et,!0)} ms`)}}Y=Math.max(0,Y);let Ke=0,ct=0,qe=Y;for(let Et=0;Et<_;Et++){const Dt=a[Et],lr=Dt.units,nr=lr.length;let vr=0;for(let Lr=0;Lr<nr;Lr++)vr+=lr[Lr].data.length;ct+=vr,Ke+=nr,Dt.length=vr,Dt.dts<qe?(Dt.dts=qe,qe+=Ge/4|0||1):qe=Dt.dts,fe=Math.min(Dt.pts,fe),ce=Math.max(Dt.pts,ce)}X=a[_-1].dts;const it=ct+4*Ke+8;let ht;try{ht=new Uint8Array(it)}catch(Et){this.observer.emit(d.ERROR,d.ERROR,{type:I.MUX_ERROR,details:A.REMUX_ALLOC_ERROR,fatal:!1,error:Et,bytes:it,reason:`fail allocating video mdat ${it}`});return}const Xe=new DataView(ht.buffer);Xe.setUint32(0,it),ht.set(Be.types.mdat,4);let St=!1,Pt=Number.POSITIVE_INFINITY,Sr=Number.POSITIVE_INFINITY,ir=Number.NEGATIVE_INFINITY,Xt=Number.NEGATIVE_INFINITY;for(let Et=0;Et<_;Et++){const Dt=a[Et],lr=Dt.units;let nr=0;for(let Ur=0,Vr=lr.length;Ur<Vr;Ur++){const Pi=lr[Ur],Hi=Pi.data,es=Pi.data.byteLength;Xe.setUint32(R,es),R+=4,ht.set(Hi,R),R+=es,nr+=4+es}let vr;if(Et<_-1)G=a[Et+1].dts-Dt.dts,vr=a[Et+1].pts-Dt.pts;else{const Ur=this.config,Vr=Et>0?Dt.dts-a[Et-1].dts:Ge;if(vr=Et>0?Dt.pts-a[Et-1].pts:Ge,Ur.stretchShortVideoTrack&&this.nextAudioPts!==null){const Pi=Math.floor(Ur.maxBufferHole*s),Hi=(i?fe+i*s:this.nextAudioPts)-Dt.pts;Hi>Pi?(G=Hi-Vr,G<0?G=Vr:St=!0,this.logger.log(`[mp4-remuxer]: It is approximately ${Hi/90} ms to the next segment; using duration ${G/90} ms for the last video frame.`)):G=Vr}else G=Vr}const Lr=Math.round(Dt.pts-Dt.dts);Pt=Math.min(Pt,G),ir=Math.max(ir,G),Sr=Math.min(Sr,vr),Xt=Math.max(Xt,vr),h.push(Oi(Dt.key,G,nr,Lr))}if(h.length){if(ii){if(ii<70){const Et=h[0].flags;Et.dependsOn=2,Et.isNonSync=0}}else if(Or&&Xt-Sr<ir-Pt&&Ge/ir<.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=Y;for(let Dt=0,lr=h.length;Dt<lr;Dt++){const nr=Et+h[Dt].duration,vr=Et+h[Dt].cts;if(Dt<lr-1){const Lr=nr+h[Dt+1].cts;h[Dt].duration=Lr-vr}else h[Dt].duration=Dt?h[Dt-1].duration:Ge;h[Dt].cts=0,Et=nr}}}G=St||!G?Ge:G,this.nextAvcDts=w=X+G,this.videoSampleDuration=G,this.isVideoContiguous=!0;const qt={data1:Be.moof(e.sequenceNumber++,Y,c(e,{samples:h})),data2:ht,startPTS:fe/s,endPTS:(ce+G)/s,startDTS:Y/s,endDTS:w/s,type:"video",hasAudio:!1,hasVideo:!0,nb:h.length,dropped:e.dropped};return e.samples=[],e.dropped=0,qt}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return ri;case"ac3":return Ei;default:return Zr}}remuxAudio(e,t,r,i,s){const a=e.inputTimeScale,h=e.samplerate?e.samplerate:a,_=a/h,g=this.getSamplesPerFrame(e),w=g*_,R=this._initPTS,G=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,Y=[],X=s!==void 0;let fe=e.samples,ce=G?0:8,Ee=this.nextAudioPts||-1;const Re=t*a,Te=R.baseTime*a/R.timescale;if(this.isAudioContiguous=r=r||fe.length&&Ee>0&&(i&&Math.abs(Re-Ee)<9e3||Math.abs(ni(fe[0].pts-Te,Re)-Ee)<20*w),fe.forEach(function(Gt){Gt.pts=ni(Gt.pts-Te,Re)}),!r||Ee<0){if(fe=fe.filter(Gt=>Gt.pts>=0),!fe.length)return;s===0?Ee=0:i&&!X?Ee=Math.max(0,Re):Ee=fe[0].pts}if(e.segmentCodec==="aac"){const Gt=this.config.maxAudioFramesDrift;for(let Qt=0,qt=Ee;Qt<fe.length;Qt++){const Et=fe[Qt],Dt=Et.pts,lr=Dt-qt,nr=Math.abs(1e3*lr/a);if(lr<=-Gt*w&&X)Qt===0&&(this.logger.warn(`Audio frame @ ${(Dt/a).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*lr/a)} ms.`),this.nextAudioPts=Ee=qt=Dt);else if(lr>=Gt*w&&nr<Yr&&X){let vr=Math.round(lr/w);qt=Dt-vr*w,qt<0&&(vr--,qt+=w),Qt===0&&(this.nextAudioPts=Ee=qt),this.logger.warn(`[mp4-remuxer]: Injecting ${vr} audio frame @ ${(qt/a).toFixed(3)}s due to ${Math.round(1e3*lr/a)} ms gap.`);for(let Lr=0;Lr<vr;Lr++){const Ur=Math.max(qt,0);let Vr=bt.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);Vr||(this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Vr=Et.unit.subarray()),fe.splice(Qt,0,{unit:Vr,pts:Ur}),qt+=w,Qt++}}Et.pts=qt,qt+=w}}let Ge=null,Ke=null,ct,qe=0,it=fe.length;for(;it--;)qe+=fe[it].unit.byteLength;for(let Gt=0,Qt=fe.length;Gt<Qt;Gt++){const qt=fe[Gt],Et=qt.unit;let Dt=qt.pts;if(Ke!==null){const nr=Y[Gt-1];nr.duration=Math.round((Dt-Ke)/_)}else if(r&&e.segmentCodec==="aac"&&(Dt=Ee),Ge=Dt,qe>0){qe+=ce;try{ct=new Uint8Array(qe)}catch(nr){this.observer.emit(d.ERROR,d.ERROR,{type:I.MUX_ERROR,details:A.REMUX_ALLOC_ERROR,fatal:!1,error:nr,bytes:qe,reason:`fail allocating audio mdat ${qe}`});return}G||(new DataView(ct.buffer).setUint32(0,qe),ct.set(Be.types.mdat,4))}else return;ct.set(Et,ce);const lr=Et.byteLength;ce+=lr,Y.push(Oi(!0,g,lr,0)),Ke=Dt}const ht=Y.length;if(!ht)return;const Xe=Y[Y.length-1];this.nextAudioPts=Ee=Ke+_*Xe.duration;const St=G?new Uint8Array(0):Be.moof(e.sequenceNumber++,Ge/_,c({},e,{samples:Y}));e.samples=[];const Pt=Ge/a,Sr=Ee/a,Xt={data1:St,data2:ct,startPTS:Pt,endPTS:Sr,startDTS:Pt,endDTS:Sr,type:"audio",hasAudio:!0,hasVideo:!1,nb:ht};return this.isAudioContiguous=!0,Xt}}function ni(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 xi(o){for(let e=0;e<o.length;e++)if(o[e].key)return e;return-1}function _n(o,e,t,r){const i=o.samples.length;if(!i)return;const s=o.inputTimeScale;for(let h=0;h<i;h++){const _=o.samples[h];_.pts=ni(_.pts-t.baseTime*s/t.timescale,e*s)/s,_.dts=ni(_.dts-r.baseTime*s/r.timescale,e*s)/s}const a=o.samples;return o.samples=[],{samples:a}}function nn(o,e,t){const r=o.samples.length;if(!r)return;const i=o.inputTimeScale;for(let a=0;a<r;a++){const h=o.samples[a];h.pts=ni(h.pts-t.baseTime*i/t.timescale,e*i)/i}o.samples.sort((a,h)=>a.pts-h.pts);const s=o.samples;return o.samples=[],{samples:s}}class Ja{constructor(e,t,r,i){this.logger=void 0,this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.logger=i}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,r,i){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(Ne(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:r}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=ot(e);i.audio&&(t=zn(i.audio,D.AUDIO)),i.video&&(r=zn(i.video,D.VIDEO));const s={};i.audio&&i.video?s.audiovideo={container:"video/mp4",codec:t+","+r,supplemental:i.video.supplemental,initSegment:e,id:"main"}:i.audio?s.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?s.video={container:"video/mp4",codec:r,supplemental:i.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,r,i,s,a){var h,_;let{initPTS:g,lastEndTime:w}=this;const R={audio:void 0,video:void 0,text:i,id3:r,initSegment:void 0};N(w)||(w=this.lastEndTime=s||0);const G=t.samples;if(!(G!=null&&G.length))return R;const Y={initPTS:void 0,timescale:1};let X=this.initData;if((h=X)!=null&&h.length||(this.generateInitSegment(G),X=this.initData),!((_=X)!=null&&_.length))return this.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),R;this.emitInitSegment&&(Y.tracks=this.initTracks,this.emitInitSegment=!1);const fe=at(G,X),ce=Qe(X,G),Ee=ce===null?s:ce;(a||!g)&&(Ao(g,Ee,s,fe)||Y.timescale!==g.timescale)&&(Y.initPTS=Ee-s,g&&g.timescale===1&&this.logger.warn(`Adjusting initPTS @${s} from ${g.baseTime/g.timescale} to ${Y.initPTS}`),this.initPTS=g={baseTime:Y.initPTS,timescale:1});const Re=e?Ee-g.baseTime/g.timescale:w,Te=Re+fe;We(X,G,g.baseTime/g.timescale),fe>0?this.lastEndTime=Te:(this.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const Ge=!!X.audio,Ke=!!X.video;let ct="";Ge&&(ct+="audio"),Ke&&(ct+="video");const qe={data1:G,startPTS:Re,startDTS:Re,endPTS:Te,endDTS:Te,type:ct,hasAudio:Ge,hasVideo:Ke,nb:1,dropped:0};return R.audio=qe.type==="audio"?qe:void 0,R.video=qe.type!=="audio"?qe:void 0,R.initSegment=Y,R.id3=_n(r,s,g,g),i.samples.length&&(R.text=nn(i,s,g)),R}}function Ao(o,e,t,r){if(o===null)return!0;const i=Math.max(r,1),s=e-o.baseTime/o.timescale;return Math.abs(s-t)>i}function zn(o,e){const t=o==null?void 0:o.codec;return t&&t.length>4?t:e===D.AUDIO?t==="ec-3"||t==="ac-3"||t==="alac"?t:t==="fLaC"||t==="Opus"?we(t,!1):(z.warn(`Unhandled audio codec "${t}" in mp4 MAP`),t||"mp4a"):(z.warn(`Unhandled video codec "${t}" in mp4 MAP`),t||"avc1")}let Di;try{Di=self.performance.now.bind(self.performance)}catch(o){Di=Date.now}const vn=[{demux:Xo,remux:Ja},{demux:pe,remux:Yi},{demux:Eo,remux:Yi},{demux:xo,remux:Yi}];vn.splice(2,0,{demux:Qa,remux:Yi});class ls{constructor(e,t,r,i,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=r,this.id=s,this.logger=a}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,r,i){const s=r.transmuxing;s.executeStart=Di();let a=new Uint8Array(e);const{currentTransmuxState:h,transmuxConfig:_}=this;i&&(this.currentTransmuxState=i);const{contiguous:g,discontinuity:w,trackSwitch:R,accurateTimeOffset:G,timeOffset:Y,initSegmentChange:X}=i||h,{audioCodec:fe,videoCodec:ce,defaultInitPts:Ee,duration:Re,initSegmentData:Te}=_,Ge=Ts(a,t);if(Ge&&li(Ge.method)){const it=this.getDecrypter(),ht=ei(Ge.method);if(it.isSync()){let Xe=it.softwareDecrypt(a,Ge.key.buffer,Ge.iv.buffer,ht);if(r.part>-1){const Pt=it.flush();Xe=Pt&&Pt.buffer}if(!Xe)return s.executeEnd=Di(),aa(r);a=new Uint8Array(Xe)}else return this.asyncResult=!0,this.decryptionPromise=it.webCryptoDecrypt(a,Ge.key.buffer,Ge.iv.buffer,ht).then(Xe=>{const St=this.push(Xe,null,r);return this.decryptionPromise=null,St}),this.decryptionPromise}const Ke=this.needsProbing(w,R);if(Ke){const it=this.configureTransmuxer(a);if(it)return this.logger.warn(`[transmuxer] ${it.message}`),this.observer.emit(d.ERROR,d.ERROR,{type:I.MEDIA_ERROR,details:A.FRAG_PARSING_ERROR,fatal:!1,error:it,reason:it.message}),s.executeEnd=Di(),aa(r)}(w||R||X||Ke)&&this.resetInitSegment(Te,fe,ce,Re,t),(w||X||Ke)&&this.resetInitialTimestamp(Ee),g||this.resetContiguity();const ct=this.transmux(a,Ge,Y,G,r);this.asyncResult=us(ct);const qe=this.currentTransmuxState;return qe.contiguous=!0,qe.discontinuity=!1,qe.trackSwitch=!1,s.executeEnd=Di(),ct}flush(e){const t=e.transmuxing;t.executeStart=Di();const{decrypter:r,currentTransmuxState:i,decryptionPromise:s}=this;if(s)return this.asyncResult=!0,s.then(()=>this.flush(e));const a=[],{timeOffset:h}=i;if(r){const R=r.flush();R&&a.push(this.push(R.buffer,null,e))}const{demuxer:_,remuxer:g}=this;if(!_||!g){t.executeEnd=Di();const R=[aa(e)];return this.asyncResult?Promise.resolve(R):R}const w=_.flush(h);return us(w)?(this.asyncResult=!0,w.then(R=>(this.flushRemux(a,R,e),a))):(this.flushRemux(a,w,e),this.asyncResult?Promise.resolve(a):a)}flushRemux(e,t,r){const{audioTrack:i,videoTrack:s,id3Track:a,textTrack:h}=t,{accurateTimeOffset:_,timeOffset:g}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${r.sn}${r.part>-1?" part: "+r.part:""} of ${this.id===b.MAIN?"level":"track"} ${r.level}`);const w=this.remuxer.remux(i,s,a,h,g,_,!0,this.id);e.push({remuxResult:w,chunkMeta:r}),r.transmuxing.executeEnd=Di()}resetInitialTimestamp(e){const{demuxer:t,remuxer:r}=this;!t||!r||(t.resetTimeStamp(e),r.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,r,i,s){const{demuxer:a,remuxer:h}=this;!a||!h||(a.resetInitSegment(e,t,r,i),h.resetInitSegment(e,t,r,s))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,r,i,s){let a;return t&&t.method==="SAMPLE-AES"?a=this.transmuxSampleAes(e,t,r,i,s):a=this.transmuxUnencrypted(e,r,i,s),a}transmuxUnencrypted(e,t,r,i){const{audioTrack:s,videoTrack:a,id3Track:h,textTrack:_}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(s,a,h,_,t,r,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,r,i,s){return this.demuxer.demuxSampleAes(e,t,r).then(a=>({remuxResult:this.remuxer.remux(a.audioTrack,a.videoTrack,a.id3Track,a.textTrack,r,i,!1,this.id),chunkMeta:s}))}configureTransmuxer(e){const{config:t,observer:r,typeSupported:i}=this;let s;for(let R=0,G=vn.length;R<G;R++){var a;if((a=vn[R].demux)!=null&&a.probe(e,this.logger)){s=vn[R];break}}if(!s)return new Error("Failed to find demuxer by probing fragment data");const h=this.demuxer,_=this.remuxer,g=s.remux,w=s.demux;(!_||!(_ instanceof g))&&(this.remuxer=new g(r,t,i,this.logger)),(!h||!(h instanceof w))&&(this.demuxer=new w(r,t,i,this.logger),this.probe=w.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Gi(this.config)),e}}function Ts(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 aa=o=>({remuxResult:{},chunkMeta:o});function us(o){return"then"in o&&o.then instanceof Function}class Co{constructor(e,t,r,i,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=r,this.duration=i,this.defaultInitPts=s||null}}class oa{constructor(e,t,r,i,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=r,this.trackSwitch=i,this.timeOffset=s,this.initSegmentChange=a}}let la=0;class ua{constructor(e,t,r,i){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=la++,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=_=>{const g=_.data,w=this.hls;if(!(!w||!(g!=null&&g.event)||g.instanceNo!==this.instanceNo))switch(g.event){case"init":{var R;const G=(R=this.workerContext)==null?void 0:R.objectURL;G&&self.URL.revokeObjectURL(G);break}case"transmuxComplete":{this.handleTransmuxComplete(g.data);break}case"flush":{this.onFlush(g.data);break}case"workerLog":{w.logger[g.data.logType]&&w.logger[g.data.logType](g.data.message);break}default:{g.data=g.data||{},g.data.frag=this.frag,g.data.part=this.part,g.data.id=this.id,w.trigger(g.event,g.data);break}}},this.onWorkerError=_=>{if(!this.hls)return;const g=new Error(`${_.message} (${_.filename}:${_.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(d.ERROR,{type:I.OTHER_ERROR,details:A.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:g})};const s=e.config;this.hls=e,this.id=t,this.useWorker=!!s.enableWorker,this.onTransmuxComplete=r,this.onFlush=i;const a=(_,g)=>{g=g||{},g.frag=this.frag||void 0,_===d.ERROR&&(g=g,g.parent=this.id,g.part=this.part,this.error=g.error),this.hls.trigger(_,g)};this.observer=new Ss,this.observer.on(d.FRAG_DECRYPTED,a),this.observer.on(d.ERROR,a);const h=It(s.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const _=this.hls.logger;if(s.workerPath||ka()){try{s.workerPath?(_.log(`loading Web Worker ${s.workerPath} for "${t}"`),this.workerContext=Oa(s.workerPath)):(_.log(`injecting Web Worker for "${t}"`),this.workerContext=Ia());const{worker:w}=this.workerContext;w.addEventListener("message",this.onWorkerMessage),w.addEventListener("error",this.onWorkerError),w.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:h,id:t,config:sr(s)})}catch(w){_.warn(`Error setting up "${t}" Web Worker, fallback to inline`,w),this.terminateWorker(),this.error=null,this.transmuxer=new ls(this.observer,h,s,"",t,e.logger)}return}}this.transmuxer=new ls(this.observer,h,s,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=la++;const t=this.hls.config,r=It(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:r,id:this.id,config:sr(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),po(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,r,i,s,a,h,_,g,w){var R,G;g.transmuxing.start=self.performance.now();const{instanceNo:Y,transmuxer:X}=this,fe=a?a.start:s.start,ce=s.decryptdata,Ee=this.frag,Re=!(Ee&&s.cc===Ee.cc),Te=!(Ee&&g.level===Ee.level),Ge=Ee?g.sn-Ee.sn:-1,Ke=this.part?g.part-this.part.index:-1,ct=Ge===0&&g.id>1&&g.id===(Ee==null?void 0:Ee.stats.chunkCount),qe=!Te&&(Ge===1||Ge===0&&(Ke===1||ct&&Ke<=0)),it=self.performance.now();(Te||Ge||s.stats.parsing.start===0)&&(s.stats.parsing.start=it),a&&(Ke||!qe)&&(a.stats.parsing.start=it);const ht=!(Ee&&((R=s.initSegment)==null?void 0:R.url)===((G=Ee.initSegment)==null?void 0:G.url)),Xe=new oa(Re,qe,_,Te,fe,ht);if(!qe||Re||ht){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${s.type} sn: ${g.sn}${g.part>-1?" part: "+g.part:""} ${this.id===b.MAIN?"level":"track"}: ${g.level} id: ${g.id}
|
|
|
discontinuity: ${Re}
|
|
|
trackSwitch: ${Te}
|
|
|
contiguous: ${qe}
|
|
|
accurateTimeOffset: ${_}
|
|
|
timeOffset: ${fe}
|
|
|
initSegmentChange: ${ht}`);const St=new Co(r,i,t,h,w);this.configureTransmuxer(St)}if(this.frag=s,this.part=a,this.workerContext)this.workerContext.worker.postMessage({instanceNo:Y,cmd:"demux",data:e,decryptdata:ce,chunkMeta:g,state:Xe},e instanceof ArrayBuffer?[e]:[]);else if(X){const St=X.push(e,ce,g,Xe);us(St)?St.then(Pt=>{this.handleTransmuxComplete(Pt)}).catch(Pt=>{this.transmuxerError(Pt,g,"transmuxer-interface push error")}):this.handleTransmuxComplete(St)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:r}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(r){const i=r.flush(e);us(i)?i.then(s=>{this.handleFlushResult(s,e)}).catch(s=>{this.transmuxerError(s,e,"transmuxer-interface flush error")}):this.handleFlushResult(i,e)}}transmuxerError(e,t,r){this.hls&&(this.error=e,this.hls.trigger(d.ERROR,{type:I.MEDIA_ERROR,details:A.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:r}))}handleFlushResult(e,t){e.forEach(r=>{this.handleTransmuxComplete(r)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:r}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):r&&r.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const ca=100;class Ds extends bs{constructor(e,t,r){super(e,t,r,"audio-stream-controller",b.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(d.LEVEL_LOADED,this.onLevelLoaded,this),e.on(d.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(d.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(d.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(d.BUFFER_RESET,this.onBufferReset,this),e.on(d.BUFFER_CREATED,this.onBufferCreated,this),e.on(d.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(d.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(d.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(d.FRAG_LOADING,this.onFragLoading,this),e.on(d.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(d.LEVEL_LOADED,this.onLevelLoaded,this),e.off(d.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(d.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(d.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(d.BUFFER_RESET,this.onBufferReset,this),e.off(d.BUFFER_CREATED,this.onBufferCreated,this),e.off(d.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(d.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(d.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(d.FRAG_LOADING,this.onFragLoading,this),e.off(d.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:r,initPTS:i,timescale:s}){if(r===b.MAIN){const a=t.cc,h=this.fragCurrent;if(this.initPTS[a]={baseTime:i,timescale:s},this.log(`InitPTS for cc: ${a} found from main: ${i}/${s}`),this.mainAnchor=t,this.state===ft.WAITING_INIT_PTS){const _=this.waitingData;(!_&&!this.loadingParts||_&&_.frag.cc!==a)&&(this.nextLoadPosition=this.findSyncFrag(t).start),this.tick()}else!this.hls.hasEnoughToStart&&h&&h.cc!==a?(this.startFragRequested=!1,this.nextLoadPosition=this.findSyncFrag(t).start,h.abortRequests(),this.resetLoadingState()):this.state===ft.IDLE&&this.tick()}}findSyncFrag(e){const t=this.getLevelDetails(),r=e.cc;return In(t,r,e)||t&&ji(t.fragments,r)||e}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=ft.STOPPED;return}const r=this.lastCurrentTime;this.stopLoad(),this.setInterval(ca),r>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r,this.state=ft.IDLE):this.state=ft.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case ft.IDLE:this.doTickIdle();break;case ft.WAITING_TRACK:{const{levels:t,trackId:r}=this,i=t==null?void 0:t[r],s=i==null?void 0:i.details;if(s&&!this.waitForLive(i)){if(this.waitForCdnTuneIn(s))break;this.state=ft.WAITING_INIT_PTS}break}case ft.FRAG_LOADING_WAITING_RETRY:{var e;const t=performance.now(),r=this.retryDate;if(!r||t>=r||(e=this.media)!=null&&e.seeking){const{levels:i,trackId:s}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((i==null?void 0:i[s])||null),this.state=ft.IDLE}break}case ft.WAITING_INIT_PTS:{const t=this.waitingData;if(t){const{frag:r,part:i,cache:s,complete:a}=t,h=this.mainAnchor;if(this.initPTS[r.cc]!==void 0){this.waitingData=null,this.state=ft.FRAG_LOADING;const _=s.flush().buffer,g={frag:r,part:i,payload:_,networkDetails:null};this._handleFragmentLoadProgress(g),a&&super._handleFragmentLoadComplete(g)}else h&&h.cc!==t.frag.cc&&(this.log(`Waiting fragment cc (${r.cc}) cancelled because video is at cc ${h.cc}`),this.nextLoadPosition=this.findSyncFrag(h).start,this.clearWaitingFragment())}else this.state=ft.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.state!==ft.STOPPED&&(this.state=ft.IDLE))}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:r,media:i,trackId:s}=this,a=t.config;if(!this.buffering||!i&&!this.primaryPrefetch&&(this.startFragRequested||!a.startFragPrefetch)||!(r!=null&&r[s]))return;const h=r[s],_=h.details;if(!_||this.waitForLive(h)||this.waitForCdnTuneIn(_)){this.state=ft.WAITING_TRACK,this.startFragRequested=!1;return}const g=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&g&&(this.bufferFlushed=!1,this.afterBufferFlushed(g,D.AUDIO,b.AUDIO));const w=this.getFwdBufferInfo(g,b.AUDIO);if(w===null)return;if(!this.switchingTrack&&this._streamEnded(w,_)){t.trigger(d.BUFFER_EOS,{type:"audio"}),this.state=ft.ENDED;return}const R=w.len,G=t.maxBufferLength,Y=_.fragments,X=Y[0].start,fe=this.getLoadPosition(),ce=this.flushing?fe:w.end;if(this.switchingTrack&&i){const Te=fe;_.PTSKnown&&Te<X&&(w.end>X||w.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=X+.05)}if(R>=G&&!this.switchingTrack&&ce<Y[Y.length-1].start)return;let Ee=this.getNextFragment(ce,_);if(Ee&&this.isLoopLoading(Ee,ce)&&(Ee=this.getNextFragmentLoopLoading(Ee,_,w,b.MAIN,G)),!Ee){this.bufferFlushed=!0;return}let Re=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&Re&&de(Ee)&&!Ee.endList&&(!_.live||!this.loadingParts&&ce<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(Re)===Fr.OK&&(this.mainFragLoading=Re=null),Re&&de(Re))){if(Ee.start>Re.end){const Ge=this.fragmentTracker.getFragAtPos(ce,b.MAIN);Ge&&Ge.end>Re.end&&(Re=Ge,this.mainFragLoading={frag:Ge,targetBufferTime:null})}if(Ee.start>Re.end)return}this.loadFragment(Ee,h,ce)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(r=>new Ri(r))}onAudioTrackSwitching(e,t){const r=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),r?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==ft.STOPPED&&(this.setInterval(ca),this.state=ft.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 r=this.cachedTrackLoadedData;r&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(d.AUDIO_TRACK_LOADED,r))}onAudioTrackLoaded(e,t){var r;const{levels:i}=this,{details:s,id:a,groupId:h,track:_}=t;if(!i){this.warn(`Audio tracks reset while loading track ${a} "${_.name}" of "${h}"`);return}const g=this.mainDetails;if(!g||s.endCC>g.endCC||g.expired){this.cachedTrackLoadedData=t,this.state!==ft.STOPPED&&(this.state=ft.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${a} "${_.name}" of "${h}" loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`);const w=i[a];let R=0;if(s.live||(r=w.details)!=null&&r.live){if(this.checkLiveUpdate(s),s.deltaUpdateFailed)return;if(w.details){var G;R=this.alignPlaylists(s,w.details,(G=this.levelLastLoaded)==null?void 0:G.details)}s.alignedSliding||(Aa(s,g),s.alignedSliding||Vi(s,g),R=s.fragmentStart)}w.details=s,this.levelLastLoaded=w,this.startFragRequested||this.setStartPosition(g,R),this.hls.trigger(d.AUDIO_TRACK_UPDATED,{details:s,id:a,groupId:t.groupId}),this.state===ft.WAITING_TRACK&&!this.waitForCdnTuneIn(s)&&(this.state=ft.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:i,payload:s}=e,{config:a,trackId:h,levels:_}=this;if(!_){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);return}const g=_[h];if(!g){this.warn("Audio track is undefined on fragment load progress");return}const w=g.details;if(!w){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(r.start);return}const R=a.defaultAudioCodec||g.audioCodec||"mp4a.40.2";let G=this.transmuxer;G||(G=this.transmuxer=new ua(this.hls,b.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const Y=this.initPTS[r.cc],X=(t=r.initSegment)==null?void 0:t.data;if(Y!==void 0){const ce=i?i.index:-1,Ee=ce!==-1,Re=new Ki(r.level,r.sn,r.stats.chunkCount,s.byteLength,ce,Ee);G.push(s,X,R,"",r,i,w.totalduration,!1,Re,Y)}else{this.log(`Unknown video PTS for cc ${r.cc}, waiting for video PTS before demuxing audio frag ${r.sn} of [${w.startSN} ,${w.endSN}],track ${h}`);const{cache:fe}=this.waitingData=this.waitingData||{frag:r,part:i,cache:new js,complete:!1};fe.push(new Uint8Array(s)),this.state!==ft.STOPPED&&(this.state=ft.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 r=t.tracks.audio;r&&(this.mediaBuffer=r.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===b.MAIN&&de(t.frag)&&(this.mainFragLoading=t,this.state===ft.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:r,part:i}=t;if(r.type!==b.AUDIO){!this.audioOnly&&r.type===b.MAIN&&!r.elementaryStreams.video&&!r.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(r)){this.warn(`Fragment ${r.sn}${i?" p: "+i.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(de(r)){this.fragPrevious=r;const s=this.switchingTrack;s&&(this.bufferedTrack=s,this.switchingTrack=null,this.hls.trigger(d.AUDIO_TRACK_SWITCHED,u({},s)))}this.fragBufferedComplete(r,i),this.media&&this.tick()}onError(e,t){var r;if(t.fatal){this.state=ft.ERROR;return}switch(t.details){case A.FRAG_GAP:case A.FRAG_PARSING_ERROR:case A.FRAG_DECRYPT_ERROR:case A.FRAG_LOAD_ERROR:case A.FRAG_LOAD_TIMEOUT:case A.KEY_LOAD_ERROR:case A.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(b.AUDIO,t);break;case A.AUDIO_TRACK_LOAD_ERROR:case A.AUDIO_TRACK_LOAD_TIMEOUT:case A.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===ft.WAITING_TRACK&&((r=t.context)==null?void 0:r.type)===U.AUDIO_TRACK&&(this.state=ft.IDLE);break;case A.BUFFER_ADD_CODEC_ERROR:case A.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.resetLoadingState();break;case A.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case A.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==D.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==D.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===ft.ENDED&&(this.state=ft.IDLE);const r=this.mediaBuffer||this.media;r&&(this.afterBufferFlushed(r,t,b.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const r="audio",{hls:i}=this,{remuxResult:s,chunkMeta:a}=e,h=this.getCurrentContext(a);if(!h){this.resetWhenMissingContext(a);return}const{frag:_,part:g,level:w}=h,{details:R}=w,{audio:G,text:Y,id3:X,initSegment:fe}=s;if(this.fragContextChanged(_)||!R){this.fragmentTracker.removeFragment(_);return}if(this.state=ft.PARSING,this.switchingTrack&&G&&this.completeAudioSwitch(this.switchingTrack),fe!=null&&fe.tracks){const ce=_.initSegment||_;this._bufferInitSegment(w,fe.tracks,ce,a),i.trigger(d.FRAG_PARSING_INIT_SEGMENT,{frag:ce,id:r,tracks:fe.tracks})}if(G){const{startPTS:ce,endPTS:Ee,startDTS:Re,endDTS:Te}=G;g&&(g.elementaryStreams[D.AUDIO]={startPTS:ce,endPTS:Ee,startDTS:Re,endDTS:Te}),_.setElementaryStreamInfo(D.AUDIO,ce,Ee,Re,Te),this.bufferFragmentData(G,_,g,a)}if(X!=null&&(t=X.samples)!=null&&t.length){const ce=c({id:r,frag:_,details:R},X);i.trigger(d.FRAG_PARSING_METADATA,ce)}if(Y){const ce=c({id:r,frag:_,details:R},Y);i.trigger(d.FRAG_PARSING_USERDATA,ce)}}_bufferInitSegment(e,t,r,i){if(this.state!==ft.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const s=t.audio;s.id=b.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(d.BUFFER_CODECS,t);const h=s.initSegment;if(h!=null&&h.byteLength){const _={type:"audio",frag:r,part:null,chunkMeta:i,parent:r.type,data:h};this.hls.trigger(d.BUFFER_APPENDING,_)}this.tickImmediate()}loadFragment(e,t,r){const i=this.fragmentTracker.getState(e);if(this.switchingTrack||i===Fr.NOT_LOADED||i===Fr.PARTIAL){var s;if(!de(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=ft.WAITING_INIT_PTS;const a=this.mainDetails;a&&a.fragmentStart!==t.details.fragmentStart&&Vi(t.details,a)}else super.loadFragment(e,t,r)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:r,assocLang:i,characteristics:s,audioCodec:a,channels:h}=this.bufferedTrack;ai({name:t,lang:r,assocLang:i,characteristics:s,audioCodec:a,channels:h},e,cr)||(Tr(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(d.AUDIO_TRACK_SWITCHED,u({},e))}}class To extends F{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,r){const i=t==null?void 0:t.renditionReports;if(i){let s=-1;for(let a=0;a<i.length;a++){const h=i[a];let _;try{_=new self.URL(h.URI,t.url).href}catch(g){this.warn(`Could not construct new URL for Rendition Report: ${g}`),_=h.URI||""}if(_===e){s=a;break}else _===e.substring(0,_.length)&&(s=a)}if(s!==-1){const a=i[s],h=parseInt(a["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let _=parseInt(a["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const w=Math.min(t.age-t.partTarget,t.targetduration);_>=0&&w>t.partTarget&&(_+=1)}const g=r&&wi(r);return new si(h,_>=0?_:void 0,g)}}}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(r){this.warn(`Could not construct new URL with HLS Delivery Directives: ${r}`)}return e}playlistLoaded(e,t,r){const{details:i,stats:s}=t,a=self.performance.now(),h=s.loading.first?Math.max(0,a-s.loading.first):0;i.advancedDateTime=Date.now()-h;const _=this.hls.config.timelineOffset;if(_!==i.appliedTimelineOffset){const w=Math.max(_||0,0);i.appliedTimelineOffset=w,i.fragments.forEach(R=>{R.start=R.playlistOffset+w})}if(i.live||r!=null&&r.live){const w="levelInfo"in t?t.levelInfo:t.track;if(i.reloaded(r),r&&i.fragments.length>0){ho(r,i);const Re=i.playlistParsingError;if(Re){this.warn(Re);const Te=this.hls;if(!Te.config.ignorePlaylistParsingErrors){var g;const{networkDetails:Ge}=t;Te.trigger(d.ERROR,{type:I.NETWORK_ERROR,details:A.LEVEL_PARSING_ERROR,fatal:!1,url:i.url,error:Re,reason:Re.message,level:t.level||void 0,parent:(g=i.fragments[0])==null?void 0:g.type,networkDetails:Ge,stats:s});return}i.playlistParsingError=null}}i.requestScheduled===-1&&(i.requestScheduled=s.loading.start);const R=this.hls.mainForwardBufferInfo,G=R?R.end-R.len:0,Y=(i.edge-G)*1e3,X=is(i,Y);if(i.requestScheduled+X<a?i.requestScheduled=a:i.requestScheduled+=X,this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),!this.canLoad||!i.live)return;let fe,ce,Ee;if(i.canBlockReload&&i.endSN&&i.advanced){const Re=this.hls.config.lowLatencyMode,Te=i.lastPartSn,Ge=i.endSN,Ke=i.lastPartIndex,ct=Ke!==-1,qe=Te===Ge;ct?qe?(ce=Ge+1,Ee=Re?0:Ke):(ce=Te,Ee=Re?Ke+1:i.maxPartIndex):ce=Ge+1;const it=i.age,ht=it+i.ageHeader;let Xe=Math.min(ht-i.partTarget,i.targetduration*1.5);if(Xe>0){if(ht>i.targetduration*3)this.log(`Playlist last advanced ${it.toFixed(2)}s ago. Omitting segment and part directives.`),ce=void 0,Ee=void 0;else if(r!=null&&r.tuneInGoal&&ht-i.partTarget>r.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${r.tuneInGoal} to: ${Xe} with playlist age: ${i.age}`),Xe=0;else{const St=Math.floor(Xe/i.targetduration);if(ce+=St,Ee!==void 0){const Pt=Math.round(Xe%i.targetduration/i.partTarget);Ee+=Pt}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${it.toFixed(2)}s goal: ${Xe} skip sn ${St} to part ${Ee}`)}i.tuneInGoal=Xe}if(fe=this.getDeliveryDirectives(i,t.deliveryDirectives,ce,Ee),Re||!qe){i.requestScheduled=a,this.loadingPlaylist(w,fe);return}}else(i.canBlockReload||i.canSkipUntil)&&(fe=this.getDeliveryDirectives(i,t.deliveryDirectives,ce,Ee));fe&&ce!==void 0&&i.canBlockReload&&(i.requestScheduled=s.loading.first+Math.max(X-h*2,X/2)),this.scheduleLoading(w,fe,i)}else this.clearTimer()}scheduleLoading(e,t,r){const i=r||e.details;if(!i){this.loadingPlaylist(e,t);return}const s=self.performance.now(),a=i.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,r,i){let s=wi(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(r=t.msn,i=t.part,s=Er.No),new si(r,i,s)}checkRetry(e){const t=e.details,r=Zi(e),i=e.errorAction,{action:s,retryCount:a=0,retryConfig:h}=i||{},_=!!i&&!!h&&(s===Xr.RetryRequest||!i.resolved&&s===Xr.SendAlternateToPenaltyBox);if(_){var g;if(a>=h.maxNumRetry)return!1;if(r&&(g=e.context)!=null&&g.deliveryDirectives)this.warn(`Retrying playlist loading ${a+1}/${h.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const w=mi(h,a);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),w),this.warn(`Retrying playlist loading ${a+1}/${h.maxNumRetry} after "${t}" in ${w}ms`)}e.levelRetry=!0,i.resolved=!0}return _}}function Qo(o,e){if(o.length!==e.length)return!1;for(let t=0;t<o.length;t++)if(!ha(o[t].attrs,e[t].attrs))return!1;return!0}function ha(o,e,t){const r=o["STABLE-RENDITION-ID"];return r&&!t?r===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(i=>o[i]!==e[i])}function Do(o,e){return e.label.toLowerCase()===o.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(o.lang||"").toLowerCase())}class Xl extends To{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(d.MANIFEST_LOADING,this.onManifestLoading,this),e.on(d.MANIFEST_PARSED,this.onManifestParsed,this),e.on(d.LEVEL_LOADING,this.onLevelLoading,this),e.on(d.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(d.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(d.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(d.MANIFEST_LOADING,this.onManifestLoading,this),e.off(d.MANIFEST_PARSED,this.onManifestParsed,this),e.off(d.LEVEL_LOADING,this.onLevelLoading,this),e.off(d.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(d.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(d.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:r,groupId:i,details:s}=t,a=this.tracksInGroup[r];if(!a||a.groupId!==i){this.warn(`Audio track with id:${r} and group:${i} not found in active group ${a==null?void 0:a.groupId}`);return}const h=a.details;a.details=t.details,this.log(`Audio track ${r} "${a.name}" lang:${a.lang} group:${i} loaded [${s.startSN}-${s.endSN}]`),r===this.trackId&&this.playlistLoaded(r,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 r=t.audioGroups||null,i=this.groupIds;let s=this.currentTrack;if(!r||(i==null?void 0:i.length)!==(r==null?void 0:r.length)||r!=null&&r.some(h=>(i==null?void 0:i.indexOf(h))===-1)){this.groupIds=r,this.trackId=-1,this.currentTrack=null;const h=this.tracks.filter(G=>!r||r.indexOf(G.groupId)!==-1);if(h.length)this.selectDefaultTrack&&!h.some(G=>G.default)&&(this.selectDefaultTrack=!1),h.forEach((G,Y)=>{G.id=Y});else if(!s&&!this.tracksInGroup.length)return;this.tracksInGroup=h;const _=this.hls.config.audioPreference;if(!s&&_){const G=jr(_,h,cr);if(G>-1)s=h[G];else{const Y=jr(_,this.tracks);s=this.tracks[Y]}}let g=this.findTrackId(s);g===-1&&s&&(g=this.findTrackId(null));const w={audioTracks:h};this.log(`Updating audio tracks, ${h.length} track(s) found in group(s): ${r==null?void 0:r.join(",")}`),this.hls.trigger(d.AUDIO_TRACKS_UPDATED,w);const R=this.trackId;if(g!==-1&&R===-1)this.setAudioTrack(g);else if(h.length&&R===-1){var a;const G=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(G.message),this.hls.trigger(d.ERROR,{type:I.MEDIA_ERROR,details:A.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:G})}}}onError(e,t){t.fatal||!t.context||t.context.type===U.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 r=this.allAudioTracks;if(this.selectDefaultTrack=!1,r.length){const i=this.currentTrack;if(i&&ai(e,i,cr))return i;const s=jr(e,this.tracksInGroup,cr);if(s>-1){const a=this.tracksInGroup[s];return this.setAudioTrack(s),a}else if(i){let a=t.loadLevel;a===-1&&(a=t.firstAutoLevel);const h=Cr(e,t.levels,r,a,cr);if(h===-1)return null;t.nextLoadLevel=h}if(e.channels||e.audioCodec){const a=jr(e,r);if(a>-1)return r[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 r=this.currentTrack,i=t[e],s=i.details&&!i.details.live;if(e===this.trackId&&i===r&&s||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(d.AUDIO_TRACK_SWITCHING,u({},i)),s))return;const a=this.switchParams(i.url,r==null?void 0:r.details,i.details);this.loadPlaylist(a)}findTrackId(e){const t=this.tracksInGroup;for(let r=0;r<t.length;r++){const i=t[r];if(!(this.selectDefaultTrack&&!i.default)&&(!e||ai(e,i,cr)))return r}if(e){const{name:r,lang:i,assocLang:s,characteristics:a,audioCodec:h,channels:_}=e;for(let g=0;g<t.length;g++){const w=t[g];if(ai({name:r,lang:i,assocLang:s,characteristics:a,audioCodec:h,channels:_},w,cr))return g}for(let g=0;g<t.length;g++){const w=t[g];if(ha(e.attrs,w.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return g}for(let g=0;g<t.length;g++){const w=t[g];if(ha(e.attrs,w.attrs,["LANGUAGE"]))return g}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&Tr(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=e.id,i=e.groupId,s=this.getUrlWithDirectives(e.url,t),a=e.details,h=a==null?void 0:a.age;this.log(`Loading audio-track ${r} "${e.name}" lang:${e.lang} group:${i}${(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(d.AUDIO_TRACK_LOADING,{url:s,id:r,groupId:i,deliveryDirectives:t||null,track:e})}}class Ql{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,r){if(this.queues===null||this.tracks===null)return;const i=this.queues[t];i.push(e),i.length===1&&!r&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const r={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(r,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const r={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(r)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const r=(t=e[0])==null?void 0:t.label;(r==="async-blocker"||r==="async-blocker-prepend")&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(this.queues===null)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(this.queues===null||this.tracks===null)return;const t=this.queues[e];if(t.length){const i=t[0];try{i.execute()}catch(s){var r;if(i.onError(s),this.queues===null||this.tracks===null)return;const a=(r=this.tracks[e])==null?void 0:r.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,r;return(t=this.queues)!=null&&t[e]||(r=this.tracks)!=null&&r[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const r=(t=this.tracks)==null?void 0:t[e],i=r==null?void 0:r.buffer;return i?`SourceBuffer${i.updating?" updating":""}${r.ended?" ended":""}${r.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(r=>r.label).join(", "))||""}}const Jo=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,el="HlsJsTrackRemovedError";class Jl extends Error{constructor(e){super(e),this.name=el}}class eu extends F{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=r=>{var i;this.hls&&((i=this.mediaSource)==null?void 0:i.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=r=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=r=>{const{media:i,mediaSource:s}=this;r&&this.log("Media source opened"),!(!i||!s)&&(s.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(d.MEDIA_ATTACHED,{media:i,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:r,_objectUrl:i}=this;r!==i&&this.error(`Media element src was set while attaching MediaSource (${i} > ${r})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=te(ie(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(d.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(d.MANIFEST_LOADING,this.onManifestLoading,this),e.on(d.MANIFEST_PARSED,this.onManifestParsed,this),e.on(d.BUFFER_RESET,this.onBufferReset,this),e.on(d.BUFFER_APPENDING,this.onBufferAppending,this),e.on(d.BUFFER_CODECS,this.onBufferCodecs,this),e.on(d.BUFFER_EOS,this.onBufferEos,this),e.on(d.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(d.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(d.FRAG_PARSED,this.onFragParsed,this),e.on(d.FRAG_CHANGED,this.onFragChanged,this),e.on(d.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(d.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(d.MANIFEST_LOADING,this.onManifestLoading,this),e.off(d.MANIFEST_PARSED,this.onManifestParsed,this),e.off(d.BUFFER_RESET,this.onBufferReset,this),e.off(d.BUFFER_APPENDING,this.onBufferAppending,this),e.off(d.BUFFER_CODECS,this.onBufferCodecs,this),e.off(d.BUFFER_EOS,this.onBufferEos,this),e.off(d.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(d.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(d.FRAG_PARSED,this.onFragParsed,this),e.off(d.FRAG_CHANGED,this.onFragChanged,this),e.off(d.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const r={};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 i=this.transferData;return!this.sourceBufferCount&&i&&i.mediaSource===t?c(r,i.tracks):this.sourceBuffers.forEach(s=>{const[a]=s;a&&(r[a]=c({},this.tracks[a]),this.removeBuffer(a)),s[0]=s[1]=null}),{media:e,mediaSource:t,tracks:r}}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 r;let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsTotal=i,this.log(`${i} bufferCodec event(s) expected.`),(r=this.transferData)!=null&&r.mediaSource&&this.sourceBufferCount&&i&&this.bufferCreated()}onMediaAttaching(e,t){const r=this.media=t.media,i=ie(this.appendSource);if(this.transferData=this.overrides=void 0,r&&i){const s=!!t.mediaSource;(s||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const a=this.mediaSource=t.mediaSource||new i;if(this.assignMediaSource(a),s)this._objectUrl=r.src,this.attachTransferred();else{const h=this._objectUrl=self.URL.createObjectURL(a);if(this.appendSource)try{r.removeAttribute("src");const _=self.ManagedMediaSource;r.disableRemotePlayback=r.disableRemotePlayback||_&&a instanceof _,tl(r),tu(r,h),r.load()}catch(_){r.src=h}else r.src=h}r.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,r;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(r=e.constructor)==null?void 0:r.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 r=this.tracks,i=t.tracks,s=i?Object.keys(i):null,a=s?s.length:0,h=()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()};if(i&&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: ${sr(r,(_,g)=>_==="initSegment"?void 0:g)};
|
|
|
transfer tracks: ${sr(i,(_,g)=>_==="initSegment"?void 0:g)}}`),!me(i,r)){t.mediaSource=null,t.tracks=void 0;const _=e.currentTime,g=this.details,w=Math.max(_,(g==null?void 0:g.fragments[0].start)||0);if(w-_>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${_} -> ${w}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(i)}"->"${Object.keys(r)}") start time: ${w} currentTime: ${_}`),this.onMediaDetaching(d.MEDIA_DETACHING,{}),this.onMediaAttaching(d.MEDIA_ATTACHING,t),e.currentTime=w;return}this.transferData=void 0,s.forEach(_=>{const g=_,w=i[g];if(w){const R=w.buffer;if(R){const G=this.fragmentTracker,Y=w.id;if(G.hasFragments(Y)||G.hasParts(Y)){const ce=tr.getBuffered(R);G.detectEvictedFragments(g,ce,Y,null,!0)}const X=Lo(g),fe=[g,R];this.sourceBuffers[X]=fe,R.updating&&this.operationQueue&&this.operationQueue.prependBlocker(g),this.trackSourceBuffer(g,w)}}}),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 r=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:i,mediaSource:s,_objectUrl:a}=this;if(s){if(this.log(`media source ${r?"transferring":"detaching"}`),r)this.sourceBuffers.forEach(([h])=>{h&&this.removeBuffer(h)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const h=s.readyState==="open";try{const _=s.sourceBuffers;for(let g=_.length;g--;)h&&_[g].abort(),s.removeSourceBuffer(_[g]);h&&s.endOfStream()}catch(_){this.warn(`onMediaDetaching: ${_.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}i&&(i.removeEventListener("emptied",this._onMediaEmptied),r||(a&&self.URL.revokeObjectURL(a),this.mediaSrc===a?(i.removeAttribute("src"),this.appendSource&&tl(i),i.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(d.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const r=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),r)try{var i;(i=this.mediaSource)!=null&&i.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(r)}catch(s){this.warn(`onBufferReset ${e}`,s)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[Lo(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new Ql(this.tracks)}onBufferCodecs(e,t){const r=this.tracks,i=Object.keys(t);this.log(`BUFFER_CODECS: "${i}" (current SB count ${this.sourceBufferCount})`);const s="audiovideo"in t&&(r.audio||r.video)||r.audiovideo&&("audio"in t||"video"in t),a=!s&&this.sourceBufferCount&&this.media&&i.some(h=>!r[h]);if(s||a){this.warn(`Unsupported transition between "${Object.keys(r)}" and "${i}" SourceBuffers`);return}i.forEach(h=>{var _,g,w;const R=t[h],{id:G,codec:Y,levelCodec:X,container:fe,metadata:ce,supplemental:Ee}=R;let Re=r[h];const Te=(_=this.transferData)==null||(g=_.tracks)==null?void 0:g[h],Ge=Te!=null&&Te.buffer?Te:Re,Ke=(Ge==null?void 0:Ge.pendingCodec)||(Ge==null?void 0:Ge.codec),ct=Ge==null?void 0:Ge.levelCodec;Re||(Re=r[h]={buffer:void 0,listeners:[],codec:Y,supplemental:Ee,container:fe,levelCodec:X,metadata:ce,id:G});const qe=Ft(Ke,ct),it=qe==null?void 0:qe.replace(Jo,"$1");let ht=Ft(Y,X);const Xe=(w=ht)==null?void 0:w.replace(Jo,"$1");ht&&qe&&it!==Xe&&(h.slice(0,5)==="audio"&&(ht=we(ht,this.appendSource)),this.log(`switching codec ${Ke} to ${ht}`),ht!==(Re.pendingCodec||Re.codec)&&(Re.pendingCodec=ht),Re.container=fe,this.appendChangeType(h,fe,ht))}),(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 r=this.tracks[t];return e[t]={id:r.id,container:r.container,codec:r.codec,levelCodec:r.levelCodec},e},{})}appendChangeType(e,t,r){const i=`${t};codecs=${r}`,s={label:`change-type=${i}`,execute:()=>{const a=this.tracks[e];if(a){const h=a.buffer;h!=null&&h.changeType&&(this.log(`changing ${e} sourceBuffer type to ${i}`),h.changeType(i),a.codec=r,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 r=e.start,i=r+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(r,b.MAIN))==null?void 0:t.gap)===!0)return;const a={label:"block-audio",execute:()=>{var h;const _=this.tracks.video;(this.lastVideoAppendEnd>i||_!=null&&_.buffer&&tr.isBuffered(_.buffer,i)||((h=this.fragmentTracker.getAppendedFrag(i,b.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:r}=this,{data:i,type:s,parent:a,frag:h,part:_,chunkMeta:g}=t,w=g.buffering[s],R=h.sn,G=self.performance.now();w.start=G;const Y=h.stats.buffering,X=_?_.stats.buffering:null;Y.start===0&&(Y.start=G),X&&X.start===0&&(X.start=G);const fe=r.audio;let ce=!1;s==="audio"&&(fe==null?void 0:fe.container)==="audio/mpeg"&&(ce=!this.lastMpegAudioChunk||g.id===1||this.lastMpegAudioChunk.sn!==g.sn,this.lastMpegAudioChunk=g);const Ee=this.tracks.video,Re=Ee==null?void 0:Ee.buffer;if(Re&&R!=="initSegment"){const Ke=_||h,ct=this.blockedAudioAppend;if(s==="audio"&&a!=="main"&&!this.blockedAudioAppend){const it=Ke.start+Ke.duration*.05,ht=Re.buffered,Xe=this.currentOp("video");!ht.length&&!Xe?this.blockAudio(Ke):!Xe&&!tr.isBuffered(Re,it)&&this.lastVideoAppendEnd<it&&this.blockAudio(Ke)}else if(s==="video"){const qe=Ke.end;if(ct){const it=ct.frag.start;(qe>it||qe<this.lastVideoAppendEnd||tr.isBuffered(Re,it))&&this.unblockAudio()}this.lastVideoAppendEnd=qe}}const Te=(_||h).start,Ge={label:`append-${s}`,execute:()=>{if(w.executeStart=self.performance.now(),ce){const Ke=this.tracks[s];if(Ke){const ct=Ke.buffer;if(ct){const qe=Te-ct.timestampOffset;Math.abs(qe)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${Te} (delta: ${qe}) sn: ${R})`),ct.timestampOffset=Te)}}}this.appendExecutor(i,s)},onStart:()=>{},onComplete:()=>{const Ke=self.performance.now();w.executeEnd=w.end=Ke,Y.first===0&&(Y.first=Ke),X&&X.first===0&&(X.first=Ke);const ct={};this.sourceBuffers.forEach(([qe,it])=>{qe&&(ct[qe]=tr.getBuffered(it))}),this.appendErrors[s]=0,s==="audio"||s==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(d.BUFFER_APPENDED,{type:s,frag:h,part:_,chunkMeta:g,parent:h.type,timeRanges:ct})},onError:Ke=>{var ct;const qe={type:I.MEDIA_ERROR,parent:h.type,details:A.BUFFER_APPEND_ERROR,sourceBufferName:s,frag:h,part:_,chunkMeta:g,error:Ke,err:Ke,fatal:!1},it=(ct=this.media)==null?void 0:ct.error;if(Ke.code===DOMException.QUOTA_EXCEEDED_ERR)qe.details=A.BUFFER_FULL_ERROR;else if(Ke.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!it)qe.errorAction=Mr(!0);else if(Ke.name===el&&this.sourceBufferCount===0)qe.errorAction=Mr(!0);else{const ht=++this.appendErrors[s];this.warn(`Failed ${ht}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${s}" sourceBuffer (${it||"no media error"})`),(ht>=this.hls.config.appendErrorMaxRetry||it)&&(qe.fatal=!0)}this.hls.trigger(d.ERROR,qe)}};this.append(Ge,s,this.isPending(this.tracks[s]))}getFlushOp(e,t,r){return this.log(`queuing "${e}" remove ${t}-${r}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,r)},onStart:()=>{},onComplete:()=>{this.hls.trigger(d.BUFFER_FLUSHED,{type:e})},onError:i=>{this.warn(`Failed to remove ${t}-${r} from "${e}" SourceBuffer`,i)}}}onBufferFlushing(e,t){const{type:r,startOffset:i,endOffset:s}=t;r?this.append(this.getFlushOp(r,i,s),r):this.sourceBuffers.forEach(([a])=>{a&&this.append(this.getFlushOp(a,i,s),a)})}onFragParsed(e,t){const{frag:r,part:i}=t,s=[],a=i?i.elementaryStreams:r.elementaryStreams;a[D.AUDIOVIDEO]?s.push("audiovideo"):(a[D.AUDIO]&&s.push("audio"),a[D.VIDEO]&&s.push("video"));const h=()=>{const _=self.performance.now();r.stats.buffering.end=_,i&&(i.stats.buffering.end=_);const g=i?i.stats:r.stats;this.hls.trigger(d.FRAG_BUFFERED,{frag:r,part:i,stats:g,id:r.type})};s.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${r.type} level: ${r.level} sn: ${r.sn}`),this.blockBuffers(h,s).catch(_=>{this.warn(`Fragment buffered callback ${_}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{var t,r;return e&&(!((t=this.tracks[e])!=null&&t.ended)||((r=this.tracks[e])==null?void 0:r.ending))})}onBufferEos(e,t){var r;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 i=((r=this.overrides)==null?void 0:r.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([a])=>{var h;return a&&!((h=this.tracks[a])!=null&&h.ended)})&&(i?(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(d.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(d.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===A.BUFFER_APPEND_ERROR&&t.frag){var r;const i=(r=t.errorAction)==null?void 0:r.nextAutoLevel;N(i)&&i!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:r}=this;if(!r||t===null||!this.sourceBufferCount)return;const i=e.config,s=r.currentTime,a=t.levelTargetDuration,h=t.live&&i.liveBackBufferLength!==null?i.liveBackBufferLength:i.backBufferLength;if(N(h)&&h>=0){const _=Math.max(h,a),g=Math.floor(s/a)*a-_;this.flushBackBuffer(s,a,g)}if(N(i.frontBufferFlushThreshold)&&i.frontBufferFlushThreshold>0){const _=Math.max(i.maxBufferLength,i.frontBufferFlushThreshold),g=Math.max(_,a),w=Math.floor(s/a)*a+g;this.flushFrontBuffer(s,a,w)}}flushBackBuffer(e,t,r){this.sourceBuffers.forEach(([i,s])=>{if(s){const h=tr.getBuffered(s);if(h.length>0&&r>h.start(0)){var a;this.hls.trigger(d.BACK_BUFFER_REACHED,{bufferEnd:r});const _=this.tracks[i];if((a=this.details)!=null&&a.live)this.hls.trigger(d.LIVE_BACK_BUFFER_REACHED,{bufferEnd:r});else if(_!=null&&_.ended){this.log(`Cannot flush ${i} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(d.BUFFER_FLUSHING,{startOffset:0,endOffset:r,type:i})}}})}flushFrontBuffer(e,t,r){this.sourceBuffers.forEach(([i,s])=>{if(s){const a=tr.getBuffered(s),h=a.length;if(h<2)return;const _=a.start(h-1),g=a.end(h-1);if(r>_||e>=_&&e<=g)return;this.hls.trigger(d.BUFFER_FLUSHING,{startOffset:_,endOffset:1/0,type:i})}})}getDurationAndRange(){var e;const{details:t,mediaSource:r}=this;if(!t||!this.media||(r==null?void 0:r.readyState)!=="open")return null;const i=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&t.live&&r.setLiveSeekableRange){const g=Math.max(0,t.fragmentStart),w=Math.max(g,i);return{duration:1/0,start:g,end:w}}return{duration:1/0}}const s=(e=this.overrides)==null?void 0:e.duration;if(s)return N(s)?{duration:s}:null;const a=this.media.duration,h=N(r.duration)?r.duration:0;return i>h&&i>a||!N(a)?{duration:i}:null}updateMediaSource({duration:e,start:t,end:r}){const i=this.mediaSource;!this.media||!i||i.readyState!=="open"||(i.duration!==e&&(N(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),i.duration=e),t!==void 0&&r!==void 0&&(this.log(`MediaSource duration is set to ${i.duration}. Setting seekable range to ${t}-${r}.`),i.setLiveSeekableRange(t,r)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:r}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${sr(r)}`),this.tracksReady){var i;const s=(i=this.transferData)==null?void 0:i.tracks;s&&Object.keys(s).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,r])=>{if(t){const i=this.tracks[t];e[t]={buffer:r,container:i.container,codec:i.codec,supplemental:i.supplemental,levelCodec:i.levelCodec,id:i.id,metadata:i.metadata}}}),this.hls.trigger(d.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(d.ERROR,{type:I.MEDIA_ERROR,details:A.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:r}=this;if(!r)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 _=this.getTrackCodec(h,a),g=`${h.container};codecs=${_}`;h.codec=_,this.log(`creating sourceBuffer(${g})${this.currentOp(a)?" Queued":""} ${sr(h)}`);try{const w=r.addSourceBuffer(g),R=Lo(a),G=[a,w];t[R]=G,h.buffer=w}catch(w){var i;this.error(`error while trying to add sourceBuffer: ${w.message}`),this.shiftAndExecuteNext(a),(i=this.operationQueue)==null||i.removeBlockers(),delete this.tracks[a],this.hls.trigger(d.ERROR,{type:I.MEDIA_ERROR,details:A.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:w,sourceBufferName:a,mimeType:g,parent:h.id});return}this.trackSourceBuffer(a,h)}}this.bufferCreated()}getTrackCodec(e,t){const r=e.supplemental;let i=e.codec;r&&(t==="video"||t==="audiovideo")&&Pe(r,"video")&&(i=kt(i,r));const s=Ft(i,e.levelCodec);return s?t.slice(0,5)==="audio"?we(s,this.appendSource):s:""}trackSourceBuffer(e,t){const r=t.buffer;if(!r)return;const i=this.getTrackCodec(t,e);this.tracks[e]={buffer:r,codec:i,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(s,a)=>{const h=a.removedRanges;h!=null&&h.length&&this.hls.trigger(d.BUFFER_FLUSHED,{type:s})})}get mediaSrc(){var e,t;const r=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return r==null?void 0:r.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 r=this.currentOp(e);r&&(r.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var r;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(r=this.mediaSource)==null?void 0:r.readyState}`);this.error(`${i}`,t),this.hls.trigger(d.ERROR,{type:I.MEDIA_ERROR,details:A.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const s=this.currentOp(e);s&&s.onError(i)}removeExecutor(e,t,r){const{media:i,mediaSource:s}=this,a=this.tracks[e],h=a==null?void 0:a.buffer;if(!i||!s||!h){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const _=N(i.duration)?i.duration:1/0,g=N(s.duration)?s.duration:1/0,w=Math.max(0,t),R=Math.min(r,_,g);R>w&&(!a.ending||a.ended)?(a.ended=!1,this.log(`Removing [${w},${R}] from the ${e} SourceBuffer`),h.remove(w,R)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const r=this.tracks[t],i=r==null?void 0:r.buffer;if(!i)throw new Jl(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);r.ending=!1,r.ended=!1,i.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:r}=this,i=t.map(a=>this.appendBlocker(a));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(i).then(a=>{r===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var r;const i=(r=this.tracks[t])==null?void 0:r.buffer;!i||i.updating||this.shiftAndExecuteNext(t)})}append(e,t,r){this.operationQueue&&this.operationQueue.append(e,t,r)}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,r){const i=this.tracks[e];if(!i)return;const s=i.buffer;if(!s)return;const a=r.bind(this,e);i.listeners.push({event:t,listener:a}),s.addEventListener(t,a)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const r=t.buffer;r&&(t.listeners.forEach(i=>{r.removeEventListener(i.event,i.listener)}),t.listeners.length=0)}}function tl(o){const e=o.querySelectorAll("source");[].slice.call(e).forEach(t=>{o.removeChild(t)})}function tu(o,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,o.appendChild(t)}function Lo(o){return o==="audio"?1:0}class Ro{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(d.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(d.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(d.MANIFEST_PARSED,this.onManifestParsed,this),e.on(d.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(d.BUFFER_CODECS,this.onBufferCodecs,this),e.on(d.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(d.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(d.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(d.MANIFEST_PARSED,this.onManifestParsed,this),e.off(d.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(d.BUFFER_CODECS,this.onBufferCodecs,this),e.off(d.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const r=this.hls.levels[t.droppedLevel];this.isLevelAllowed(r)&&this.restrictedLevels.push({bitrate:r.bitrate,height:r.height,width:r.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 r=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,r.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&N(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,r=this.getMaxLevel(e.length-1);r!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${r}: ${e[r].height}p@${e[r].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=r,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 r=t.filter((i,s)=>this.isLevelAllowed(i)&&s<=e);return this.clientRect=null,Ro.getMaxLevelByMediaSize(r,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 r=e.getBoundingClientRect();t.width=r.width,t.height=r.height,!t.width&&!t.height&&(t.width=r.right-r.left||e.width||0,t.height=r.bottom-r.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(r=>e.bitrate===r.bitrate&&e.width===r.width&&e.height===r.height)}static getMaxLevelByMediaSize(e,t,r){if(!(e!=null&&e.length))return-1;const i=(h,_)=>_?h.width!==_.width||h.height!==_.height:!0;let s=e.length-1;const a=Math.max(t,r);for(let h=0;h<e.length;h+=1){const _=e[h];if((_.width>=a||_.height>=a)&&i(_,e[h+1])){s=h;break}}return s}}const zi={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},ru={HLS:"h"},fa={OBJECT:"CMCD-Object",REQUEST:"CMCD-Request",SESSION:"CMCD-Session",STATUS:"CMCD-Status"},iu={[fa.OBJECT]:["br","d","ot","tb"],[fa.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[fa.SESSION]:["cid","pr","sf","sid","st","v"],[fa.STATUS]:["bs","rtp"]};class Ls{constructor(e,t){Array.isArray(e)&&(e=e.map(r=>r instanceof Ls?r:new Ls(r))),this.value=e,this.params=t}}const nu="Dict";function su(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 au(o,e,t,r){return new Error(`failed to ${o} "${su(e)}" as ${t}`,{cause:r})}function Rn(o,e,t){return au("serialize",o,e,t)}class rl{constructor(e){this.description=e}}const il="Bare Item",ou="Boolean";function lu(o){if(typeof o!="boolean")throw Rn(o,ou);return o?"?1":"?0"}const uu="Byte Sequence";function cu(o){if(ArrayBuffer.isView(o)===!1)throw Rn(o,uu);return`:${za(o)}:`}const hu="Integer";function fu(o){return o<-999999999999999||999999999999999<o}function nl(o){if(fu(o))throw Rn(o,hu);return o.toString()}function du(o){return`@${nl(o.getTime()/1e3)}`}const pu="Decimal";function mu(o){const e=Ha(o,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Rn(o,pu);const t=e.toString();return t.includes(".")?t:`${t}.0`}const gu="String",_u=/[\x00-\x1f\x7f]+/;function vu(o){if(_u.test(o))throw Rn(o,gu);return`"${o.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function yu(o){return o.description||o.toString().slice(7,-1)}const bu="Token";function sl(o){const e=yu(o);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Rn(e,bu);return e}function ko(o){switch(typeof o){case"number":if(!N(o))throw Rn(o,il);return Number.isInteger(o)?nl(o):mu(o);case"string":return vu(o);case"symbol":return sl(o);case"boolean":return lu(o);case"object":if(o instanceof Date)return du(o);if(o instanceof Uint8Array)return cu(o);if(o instanceof rl)return sl(o);default:throw Rn(o,il)}}const Su="Key";function Io(o){if(/^[a-z*][a-z0-9\-_.*]*$/.test(o)===!1)throw Rn(o,Su);return o}function Oo(o){return o==null?"":Object.entries(o).map(([e,t])=>t===!0?`;${Io(e)}`:`;${Io(e)}=${ko(t)}`).join("")}function al(o){return o instanceof Ls?`${ko(o.value)}${Oo(o.params)}`:ko(o)}function Eu(o){return`(${o.value.map(al).join(" ")})${Oo(o.params)}`}function xu(o,e={whitespace:!0}){if(typeof o!="object")throw Rn(o,nu);const t=o instanceof Map?o.entries():Object.entries(o),r=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,s])=>{s instanceof Ls||(s=new Ls(s));let a=Io(i);return s.value===!0?a+=Oo(s.params):(a+="=",Array.isArray(s.value)?a+=Eu(s):a+=al(s)),a}).join(`,${r}`)}function wu(o,e){return xu(o,e)}function Au(o){return o==="ot"||o==="sf"||o==="st"}function Cu(o){return typeof o=="number"?N(o):o!=null&&o!==""&&o!==!1}const eo=o=>Math.round(o),Tu=(o,e)=>(e!=null&&e.baseUrl&&(o=ja(o,e.baseUrl)),encodeURIComponent(o)),to=o=>eo(o/100)*100,Du={br:eo,d:eo,bl:to,dl:to,mtp:to,nor:Tu,rtp:to,tb:eo};function Lu(o,e){const t={};if(o==null||typeof o!="object")return t;const r=Object.keys(o).sort(),i=c({},Du,e==null?void 0:e.formatters),s=e==null?void 0:e.filter;return r.forEach(a=>{if(s!=null&&s(a))return;let h=o[a];const _=i[a];_&&(h=_(h,e)),!(a==="v"&&h===1)&&(a=="pr"&&h===1||Cu(h)&&(Au(a)&&typeof h=="string"&&(h=new rl(h)),t[a]=h))}),t}function ol(o,e={}){return o?wu(Lu(o,e),c({whitespace:!1},e)):""}function Ru(o,e={}){const t={};if(!o)return t;const r=Object.entries(o),i=Object.entries(iu).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),s=r.reduce((a,h)=>{var _,g;const[w,R]=h,G=((_=i.find(Y=>Y[1].includes(w)))===null||_===void 0?void 0:_[0])||fa.REQUEST;return(g=a[G])!==null&&g!==void 0||(a[G]={}),a[G][w]=R,a},{});return Object.entries(s).reduce((a,[h,_])=>(a[h]=ol(_,e),a),t)}function ku(o,e,t){return c(o,Ru(e,t))}const Iu="CMCD";function Ou(o,e={}){if(!o)return"";const t=ol(o,e);return`${Iu}=${encodeURIComponent(t)}`}const ll=/CMCD=[^&#]+/;function Pu(o,e,t){const r=Ou(e,t);if(!r)return o;if(ll.test(o))return o.replace(ll,r);const i=o.includes("?")?"&":"?";return`${o}${i}${r}`}class Mu{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:zi.MANIFEST,su:!this.initialized})}catch(s){this.hls.logger.warn("Could not generate manifest CMCD data.",s)}},this.applyFragmentData=i=>{try{const{frag:s,part:a}=i,h=this.hls.levels[s.level],_=this.getObjectType(s),g={d:(a||s).duration*1e3,ot:_};(_===zi.VIDEO||_===zi.AUDIO||_==zi.MUXED)&&(g.br=h.bitrate/1e3,g.tb=this.getTopBandwidth(_)/1e3,g.bl=this.getBufferLength(_));const w=a?this.getNextPart(a):this.getNextFrag(s);w!=null&&w.url&&w.url!==s.url&&(g.nor=w.url),this.apply(i,g)}catch(s){this.hls.logger.warn("Could not generate segment CMCD data.",s)}},this.hls=e;const t=this.config=e.config,{cmcd:r}=t;r!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=r.sessionId||e.sessionId,this.cid=r.contentId,this.useHeaders=r.useHeaders===!0,this.includeKeys=r.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(d.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(d.MEDIA_DETACHED,this.onMediaDetached,this),e.on(d.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(d.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(d.MEDIA_DETACHED,this.onMediaDetached,this),e.off(d.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 r,i;this.audioBuffer=(r=t.tracks.audio)==null?void 0:r.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:ru.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 r=t.ot===zi.INIT||t.ot===zi.VIDEO||t.ot===zi.MUXED;this.starved&&r&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((a,h)=>(i.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=Pu(e.url,t,s)}getNextFrag(e){var t;const r=(t=this.hls.levels[e.level])==null?void 0:t.details;if(r){const i=e.sn-r.startSN;return r.fragments[i+1]}}getNextPart(e){var t,r;const{index:i,fragment:s}=e,a=(t=this.hls.levels[s.level])==null||(r=t.details)==null?void 0:r.partList;if(a){const{sn:h}=s;for(let _=a.length-1;_>=0;_--){const g=a[_];if(g.index===i&&g.fragment.sn===h)return a[_+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return zi.TIMED_TEXT;if(e.sn==="initSegment")return zi.INIT;if(t==="audio")return zi.AUDIO;if(t==="main")return this.hls.audioTracks.length?zi.VIDEO:zi.MUXED}getTopBandwidth(e){let t=0,r;const i=this.hls;if(e===zi.AUDIO)r=i.audioTracks;else{const s=i.maxAutoLevel,a=s>-1?s+1:i.levels.length;r=i.levels.slice(0,a)}for(const s of r)s.bitrate>t&&(t=s.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.media,r=e===zi.AUDIO?this.audioBuffer:this.videoBuffer;return!r||!t?NaN:tr.bufferInfo(r,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,r=e||this.config.loader;return class{constructor(s){this.loader=void 0,this.loader=new r(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,r=e||this.config.loader;return class{constructor(s){this.loader=void 0,this.loader=new r(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 Fu=3e5;class Bu extends F{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(d.MANIFEST_LOADING,this.onManifestLoading,this),e.on(d.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(d.MANIFEST_PARSED,this.onManifestParsed,this),e.on(d.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(d.MANIFEST_LOADING,this.onManifestLoading,this),e.off(d.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(d.MANIFEST_PARSED,this.onManifestParsed,this),e.off(d.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(r=>r!==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:r}=t;r!==null&&(this.pathwayId=r.pathwayId,this.uri=r.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:r}=t;if((r==null?void 0:r.action)===Xr.SendAlternateToPenaltyBox&&r.flags===et.MoveAllAlternatesMatchingHost){const i=this.levels;let s=this._pathwayPriority,a=this.pathwayId;if(t.context){const{groupId:h,pathwayId:_,type:g}=t.context;h&&i?a=this.getPathwayForGroupId(h,g,a):_&&(a=_)}a in this.penalizedPathways||(this.penalizedPathways[a]=performance.now()),!s&&i&&(s=this.pathways()),s&&s.length>1&&(this.updatePathwayPriority(s),r.resolved=this.pathwayId!==a),r.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${a} levels: ${i&&i.length} priorities: ${sr(s)} penalized: ${sr(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const r=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${r}"`),t=this.getLevelsForPathway(r),this.pathwayId=r}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 r=this.penalizedPathways,i=performance.now();Object.keys(r).forEach(s=>{i-r[s]>Fu&&delete r[s]});for(let s=0;s<e.length;s++){const a=e[s];if(a in r)continue;if(a===this.pathwayId)return;const h=this.hls.nextLoadLevel,_=this.hls.levels[h];if(t=this.getLevelsForPathway(a),t.length>0){this.log(`Setting Pathway to "${a}"`),this.pathwayId=a,Hs(t),this.hls.trigger(d.LEVELS_UPDATED,{levels:t});const g=this.hls.levels[h];_&&g&&this.levels&&(g.attrs["STABLE-VARIANT-ID"]!==_.attrs["STABLE-VARIANT-ID"]&&g.bitrate!==_.bitrate&&this.log(`Unstable Pathways change from bitrate ${_.bitrate} to ${g.bitrate}`),this.hls.nextLoadLevel=h);break}}}getPathwayForGroupId(e,t,r){const i=this.getLevelsForPathway(r).concat(this.levels||[]);for(let s=0;s<i.length;s++)if(t===U.AUDIO_TRACK&&i[s].hasAudioGroup(e)||t===U.SUBTITLE_TRACK&&i[s].hasSubtitleGroup(e))return i[s].pathwayId;return r}clonePathways(e){const t=this.levels;if(!t)return;const r={},i={};e.forEach(s=>{const{ID:a,"BASE-ID":h,"URI-REPLACEMENT":_}=s;if(t.some(w=>w.pathwayId===a))return;const g=this.getLevelsForPathway(h).map(w=>{const R=new _r(w.attrs);R["PATHWAY-ID"]=a;const G=R.AUDIO&&`${R.AUDIO}_clone_${a}`,Y=R.SUBTITLES&&`${R.SUBTITLES}_clone_${a}`;G&&(r[R.AUDIO]=G,R.AUDIO=G),Y&&(i[R.SUBTITLES]=Y,R.SUBTITLES=Y);const X=cl(w.uri,R["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",_),fe=new Ri({attrs:R,audioCodec:w.audioCodec,bitrate:w.bitrate,height:w.height,name:w.name,url:X,videoCodec:w.videoCodec,width:w.width});if(w.audioGroups)for(let ce=1;ce<w.audioGroups.length;ce++)fe.addGroupId("audio",`${w.audioGroups[ce]}_clone_${a}`);if(w.subtitleGroups)for(let ce=1;ce<w.subtitleGroups.length;ce++)fe.addGroupId("text",`${w.subtitleGroups[ce]}_clone_${a}`);return fe});t.push(...g),ul(this.audioTracks,r,_,a),ul(this.subtitleTracks,i,_,a)})}loadSteeringManifest(e){const t=this.hls.config,r=t.loader;this.loader&&this.loader.destroy(),this.loader=new r(t);let i;try{i=new self.URL(e)}catch(w){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const w=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+w)}const s={responseType:"json",url:i.href},a=t.steeringManifestLoadPolicy.default,h=a.errorRetry||a.timeoutRetry||{},_={loadPolicy:a,timeout:a.maxLoadTimeMs,maxRetry:h.maxNumRetry||0,retryDelay:h.retryDelayMs||0,maxRetryDelay:h.maxRetryDelayMs||0},g={onSuccess:(w,R,G,Y)=>{this.log(`Loaded steering manifest: "${i}"`);const X=w.data;if((X==null?void 0:X.VERSION)!==1){this.log(`Steering VERSION ${X.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=X.TTL;const{"RELOAD-URI":fe,"PATHWAY-CLONES":ce,"PATHWAY-PRIORITY":Ee}=X;if(fe)try{this.uri=new self.URL(fe,i).href}catch(Te){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${fe}`);return}this.scheduleRefresh(this.uri||G.url),ce&&this.clonePathways(ce);const Re={steeringManifest:X,url:i.toString()};this.hls.trigger(d.STEERING_MANIFEST_LOADED,Re),Ee&&this.updatePathwayPriority(Ee)},onError:(w,R,G,Y)=>{if(this.log(`Error loading steering manifest: ${w.code} ${w.text} (${R.url})`),this.stopLoad(),w.code===410){this.enabled=!1,this.log(`Steering manifest ${R.url} no longer available`);return}let X=this.timeToLoad*1e3;if(w.code===429){const fe=this.loader;if(typeof(fe==null?void 0:fe.getResponseHeader)=="function"){const ce=fe.getResponseHeader("Retry-After");ce&&(X=parseFloat(ce)*1e3)}this.log(`Steering manifest ${R.url} rate limited`);return}this.scheduleRefresh(this.uri||R.url,X)},onTimeout:(w,R,G)=>{this.log(`Timeout loading steering manifest (${R.url})`),this.scheduleRefresh(this.uri||R.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(s,_,g)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var r;const i=(r=this.hls)==null?void 0:r.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function ul(o,e,t,r){o&&Object.keys(e).forEach(i=>{const s=o.filter(a=>a.groupId===i).map(a=>{const h=c({},a);return h.details=void 0,h.attrs=new _r(h.attrs),h.url=h.attrs.URI=cl(a.url,a.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),h.groupId=h.attrs["GROUP-ID"]=e[i],h.attrs["PATHWAY-ID"]=r,h});o.push(...s)})}function cl(o,e,t,r){const{HOST:i,PARAMS:s,[t]:a}=r;let h;e&&(h=a==null?void 0:a[e],h&&(o=h));const _=new self.URL(o);return i&&!h&&(_.host=i),s&&Object.keys(s).sort().forEach(g=>{g&&_.searchParams.set(g,s[g])}),_.href}class Rs extends F{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=Rs.CDMCleanupPromise?[Rs.CDMCleanupPromise]:[],this.onMediaEncrypted=t=>{const{initDataType:r,initData:i}=t,s=`"${t.type}" event: init data type: "${r}"`;if(this.debug(s),i!==null){if(!this.keyFormatPromise){let a=Object.keys(this.keySystemAccessPromises);a.length||(a=Wt(this.config));const h=a.map(Nn).filter(_=>!!_);this.keyFormatPromise=this.getKeyFormatPromise(h)}this.keyFormatPromise.then(a=>{const h=Fn(a);let _,g;if(r==="sinf"){if(h!==xr.FAIRPLAY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${r}" for selected key-system ${h}`);return}const X=At(new Uint8Array(i));try{const fe=Dr(JSON.parse(X).sinf),ce=je(fe);if(!ce)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");_=new Uint8Array(ce.subarray(8,24)),g=xr.FAIRPLAY}catch(fe){this.warn(`${s} Failed to parse sinf: ${fe}`);return}}else{if(h!==xr.WIDEVINE&&h!==xr.PLAYREADY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${r}" for selected key-system ${h}`);return}const X=tt(i),fe=X.filter(Ee=>!!Ee.systemId&&Bn(Ee.systemId)===h);fe.length>1&&this.warn(`${s} Using first of ${fe.length} pssh found for selected key-system ${h}`);const ce=fe[0];if(!ce){X.length===0||X.some(Ee=>!Ee.systemId)?this.warn(`${s} contains incomplete or invalid pssh data`):this.log(`ignoring ${s} for ${X.map(Ee=>Bn(Ee.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(g=Bn(ce.systemId),ce.version===0&&ce.data)if(g===xr.WIDEVINE){const Ee=ce.data.length-22;_=new Uint8Array(ce.data.subarray(Ee,Ee+16))}else g===xr.PLAYREADY&&(_=tn(ce.data))}if(!g||!_)return;const w=le.hexDump(_),{keyIdToKeySessionPromise:R,mediaKeySessions:G}=this;let Y=R[w];for(let X=0;X<G.length;X++){const fe=G[X],ce=fe.decryptdata;if(!ce.keyId)continue;const Ee=le.hexDump(ce.keyId);if(w===Ee||ce.uri.replace(/-/g,"").indexOf(w)!==-1){if(Y=R[Ee],ce.pssh)break;delete R[Ee],ce.pssh=new Uint8Array(i),ce.keyId=_,Y=R[w]=Y.then(()=>this.generateRequestWithPreferredKeySession(fe,r,i,"encrypted-event-key-match")),Y.catch(Re=>this.handleError(Re));break}}if(!Y){if(g!==h){this.log(`Ignoring "${t.type}" event with ${g} init data for selected key-system ${h}`);return}Y=R[w]=this.getKeySystemSelectionPromise([g]).then(({keySystem:X,mediaKeys:fe})=>{var ce;this.throwIfDestroyed();const Ee=new pn("ISO-23001-7",w,(ce=Nn(X))!=null?ce:"");return Ee.pssh=new Uint8Array(i),Ee.keyId=_,this.attemptSetMediaKeys(X,fe).then(()=>{this.throwIfDestroyed();const Re=this.createMediaKeySessionContext({decryptdata:Ee,keySystem:X,mediaKeys:fe});return this.generateRequestWithPreferredKeySession(Re,r,i,"encrypted-event-no-match")})}),Y.catch(X=>this.handleError(X))}})}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){const e=this.media;this.unregisterListeners(),this.onMediaDetached(),this._clear(e);const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(d.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(d.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(d.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(d.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(d.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(d.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(d.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(d.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:r}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===xr.WIDEVINE&&r)return r}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,r=t[e];if(r)return r.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,r=(a,h,_)=>!!a&&_.indexOf(a)===h,i=t.map(a=>a.audioCodec).filter(r),s=t.map(a=>a.videoCodec).filter(r);return i.length+s.length===0&&s.push("avc1.42e01e"),new Promise((a,h)=>{const _=g=>{const w=g.shift();this.getMediaKeysPromise(w,i,s).then(R=>a({keySystem:w,mediaKeys:R})).catch(R=>{g.length?_(g):R instanceof sn?h(R):h(new sn({type:I.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_NO_ACCESS,error:R,fatal:!0},R.message))})};_(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:r}=this.config;if(typeof r!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${r}`;return Zt===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return r(e,t)}getMediaKeysPromise(e,t,r){const i=Wr(e,t,r,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: ${sr(i)}`),a=this.requestMediaKeySystemAccess(e,i);const h=this.keySystemAccessPromises[e]={keySystemAccess:a};return a.catch(_=>{this.log(`Failed to obtain access to key-system "${e}": ${_}`)}),a.then(_=>{this.log(`Access for key-system "${_.keySystem}" obtained`);const g=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),h.mediaKeys=_.createMediaKeys().then(w=>(this.log(`Media-keys created for "${e}"`),g.then(R=>R?this.setMediaKeysServerCertificate(w,e,R):w))),h.mediaKeys.catch(w=>{this.error(`Failed to create media-keys for "${e}"}: ${w}`)}),h.mediaKeys})}return a.then(()=>s.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:r}){this.log(`Creating key-system session "${t}" keyId: ${le.hexDump(e.keyId||[])}`);const i=r.createSession(),s={decryptdata:e,keySystem:t,mediaKeys:r,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(s),s}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const r=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),s="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(r,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 le.hexDump(e.keyId)}updateKeySession(e,t){var r;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${le.hexDump(((r=e.decryptdata)==null?void 0:r.keyId)||[])}
|
|
|
} (data length: ${t&&t.byteLength})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,r)=>{const i=Wt(this.config),s=e.map(Fn).filter(a=>!!a&&i.indexOf(a)!==-1);return this.getKeySystemSelectionPromise(s).then(({keySystem:a})=>{const h=Nn(a);h?t(h):r(new Error(`Unable to find format for key-system "${a}"`))}).catch(r)})}loadKey(e){const t=e.keyInfo.decryptdata,r=this.getKeyIdString(t),i=`(keyId: ${r} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let s=this.keyIdToKeySessionPromise[r];return s||(s=this.getKeySystemForKeyPromise(t).then(({keySystem:h,mediaKeys:_})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(h,_).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:h,mediaKeys:_,decryptdata:t}))))),(this.keyIdToKeySessionPromise[r]=s.then(h=>{const _="cenc",g=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(h,_,g,"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 sn?this.hls.trigger(d.ERROR,e.data):this.hls.trigger(d.ERROR,{type:I.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),r=this.keyIdToKeySessionPromise[t];if(!r){const i=Fn(e.keyFormat),s=i?[i]:Wt(this.config);return this.attemptKeySystemAccess(s)}return r}getKeySystemSelectionPromise(e){if(e.length||(e=Wt(this.config)),e.length===0)throw new sn({type:I.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${sr({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){const r=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(r).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),r.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(s=>r.indexOf(s)===-1)})}generateRequestWithPreferredKeySession(e,t,r,i){var s,a;const h=(s=this.config.drmSystems)==null||(a=s[e.keySystem])==null?void 0:a.generateRequest;if(h)try{const X=h.call(this.hls,t,r,e);if(!X)throw new Error("Invalid response from configured generateRequest filter");t=X.initDataType,r=X.initData?X.initData:null,e.decryptdata.pssh=r?new Uint8Array(r):null}catch(X){var _;if(this.warn(X.message),(_=this.hls)!=null&&_.config.debug)throw X}if(r===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const g=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${g} (init data type: ${t} length: ${r?r.byteLength:null})`);const w=new Ss,R=e._onmessage=X=>{const fe=e.mediaKeysSession;if(!fe){w.emit("error",new Error("invalid state"));return}const{messageType:ce,message:Ee}=X;this.log(`"${ce}" message event for session "${fe.sessionId}" message size: ${Ee.byteLength}`),ce==="license-request"||ce==="license-renewal"?this.renewLicense(e,Ee).catch(Re=>{w.eventNames().length?w.emit("error",Re):this.handleError(Re)}):ce==="license-release"?e.keySystem===xr.FAIRPLAY&&(this.updateKeySession(e,Ti("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${ce}"`)},G=e._onkeystatuseschange=X=>{if(!e.mediaKeysSession){w.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const ce=e.keyStatus;w.emit("keyStatus",ce),ce==="expired"&&(this.warn(`${e.keySystem} expired for key ${g}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",R),e.mediaKeysSession.addEventListener("keystatuseschange",G);const Y=new Promise((X,fe)=>{w.on("error",fe),w.on("keyStatus",ce=>{ce.startsWith("usable")?X():ce==="output-restricted"?fe(new sn({type:I.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):ce==="internal-error"?fe(new sn({type:I.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${ce}"`)):ce==="expired"?fe(new Error("key expired while generating request")):this.warn(`unhandled key status change "${ce}"`)})});return e.mediaKeysSession.generateRequest(t,r).then(()=>{var X;this.log(`Request generated for key-session "${(X=e.mediaKeysSession)==null?void 0:X.sessionId}" keyId: ${g}`)}).catch(X=>{throw new sn({type:I.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_NO_SESSION,error:X,fatal:!1},`Error generating key-session request: ${X}`)}).then(()=>Y).catch(X=>{throw w.removeAllListeners(),this.removeSession(e),X}).then(()=>(w.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,r)=>{if(typeof r=="string"&&typeof t=="object"){const i=r;r=t,t=i}this.log(`key status change "${t}" for keyStatuses keyId: ${le.hexDump("buffer"in r?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r))} session keyId: ${le.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,r=t.loader,i=new r(t),s=this.getServerCertificateUrl(e);return s?(this.log(`Fetching server certificate for "${e}"`),new Promise((a,h)=>{const _={responseType:"arraybuffer",url:s},g=t.certLoadPolicy.default,w={loadPolicy:g,timeout:g.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},R={onSuccess:(G,Y,X,fe)=>{a(G.data)},onError:(G,Y,X,fe)=>{h(new sn({type:I.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:X,response:u({url:_.url,data:void 0},G)},`"${e}" certificate request failed (${s}). Status: ${G.code} (${G.text})`))},onTimeout:(G,Y,X)=>{h(new sn({type:I.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:X,response:{url:_.url,data:void 0}},`"${e}" certificate request timed out (${s})`))},onAbort:(G,Y,X)=>{h(new Error("aborted"))}};i.load(_,w,R)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,r){return new Promise((i,s)=>{e.setServerCertificate(r).then(a=>{this.log(`setServerCertificate ${a?"success":"not supported by CDM"} (${r==null?void 0:r.byteLength}) on "${t}"`),i(e)}).catch(a=>{s(new sn({type:I.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:a,fatal:!0},a.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(r=>this.updateKeySession(e,new Uint8Array(r)).catch(i=>{throw new sn({type:I.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const r=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!r.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(r,"application/xml"),s=i.querySelectorAll("HttpHeader");if(s.length>0){let w;for(let R=0,G=s.length;R<G;R++){var a,h;w=s[R];const Y=(a=w.querySelector("name"))==null?void 0:a.textContent,X=(h=w.querySelector("value"))==null?void 0:h.textContent;Y&&X&&e.setRequestHeader(Y,X)}}const _=i.querySelector("Challenge"),g=_==null?void 0:_.textContent;if(!g)throw new Error("Cannot find <Challenge> in key message");return Ti(atob(g))}setupLicenseXHR(e,t,r,i){const s=this.config.licenseXhrSetup;return s?Promise.resolve().then(()=>{if(!r.decryptdata)throw new Error("Key removed");return s.call(this.hls,e,t,r,i)}).catch(a=>{if(!r.decryptdata)throw a;return e.open("POST",t,!0),s.call(this.hls,e,t,r,i)}).then(a=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:a||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const r=this.config.keyLoadPolicy.default;return new Promise((i,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 _=h.response;this.log(`License received ${_ instanceof ArrayBuffer?_.byteLength:_}`);const g=this.config.licenseResponseCallback;if(g)try{_=g.call(this.hls,h,a,e)}catch(w){this.error(w)}i(_)}else{const _=r.errorRetry,g=_?_.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>g||h.status>=400&&h.status<500)s(new sn({type:I.KEY_SYSTEM_ERROR,details:A.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 w=g-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${w} attempts left`),this.requestLicense(e,t).then(i,s)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=h,this.setupLicenseXHR(h,a,e,t).then(({xhr:_,licenseChallenge:g})=>{e.keySystem==xr.PLAYREADY&&(g=this.unpackPlayReadyKeyMessage(_,g)),_.send(g)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const r=t.media;this.media=r,r.removeEventListener("encrypted",this.onMediaEncrypted),r.removeEventListener("waitingforkey",this.onWaitingForKey),r.addEventListener("encrypted",this.onMediaEncrypted),r.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null)}_clear(e){var t;const r=this.mediaKeySessions;this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},pn.clearKeyUriToKeyIdMap();const i=r.length;Rs.CDMCleanupPromise=Promise.all(r.map(s=>this.removeSession(s)).concat(e==null||(t=e.setMediaKeys(null))==null?void 0:t.catch(s=>{var a;this.log(`Could not clear media keys: ${s}`),(a=this.hls)==null||a.trigger(d.ERROR,{type:I.OTHER_ERROR,details:A.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${s}`)})}))).then(()=>{i&&(this.log("finished closing key sessions and clearing media keys"),r.length=0)}).catch(s=>{var a;this.log(`Could not close sessions and clear media keys: ${s}`),(a=this.hls)==null||a.trigger(d.ERROR,{type:I.OTHER_ERROR,details:A.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${s}`)})})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const r=t.reduce((i,s)=>(i.indexOf(s.keyFormat)===-1&&i.push(s.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${r.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(r)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:r}=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),r&&r.readyState!==XMLHttpRequest.DONE&&r.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);i>-1&&this.mediaKeySessions.splice(i,1);const{drmSystemOptions:s}=this.config;return(qr(s)?new Promise((h,_)=>{self.setTimeout(()=>_(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(h)}):Promise.resolve()).catch(h=>{var _;this.log(`Could not remove session: ${h}`),(_=this.hls)==null||_.trigger(d.ERROR,{type:I.OTHER_ERROR,details:A.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${h}`)})}).then(()=>t.close()).catch(h=>{var _;this.log(`Could not close session: ${h}`),(_=this.hls)==null||_.trigger(d.ERROR,{type:I.OTHER_ERROR,details:A.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${h}`)})})}}}Rs.CDMCleanupPromise=void 0;class sn 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(d.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(d.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(d.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(d.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const r=this.hls.config;if(r.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,r){const i=performance.now();if(t){if(this.lastTime){const s=i-this.lastTime,a=r-this.lastDroppedFrames,h=t-this.lastDecodedFrames,_=1e3*a/s,g=this.hls;if(g.trigger(d.FPS_DROP,{currentDropped:a,currentDecoded:h,totalDroppedFrames:r}),_>0&&a>g.config.fpsDroppedMonitoringThreshold*h){let w=g.currentLevel;g.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+w),w>0&&(g.autoLevelCapping===-1||g.autoLevelCapping>=w)&&(w=w-1,g.trigger(d.FPS_DROP_LEVEL_CAPPING,{level:w,droppedLevel:g.currentLevel}),g.autoLevelCapping=w,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,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 hl(o,e){let t;try{t=new Event("addtrack")}catch(r){t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=o,e.dispatchEvent(t)}function fl(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(r){z.debug(`[texttrack-utils]: ${r}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,o.addCue(i)}catch(i){z.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(o.mode=t)}function ks(o,e){const t=o.mode;if(t==="disabled"&&(o.mode="hidden"),o.cues)for(let r=o.cues.length;r--;)e&&o.cues[r].removeEventListener("enter",e),o.removeCue(o.cues[r]);t==="disabled"&&(o.mode=t)}function Po(o,e,t,r){const i=o.mode;if(i==="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++)(!r||r(s[a]))&&o.removeCue(s[a])}i==="disabled"&&(o.mode=i)}function Uu(o,e){if(e<=o[0].startTime)return 0;const t=o.length-1;if(e>o[t].endTime)return-1;let r=0,i=t,s;for(;r<=i;)if(s=Math.floor((i+r)/2),e<o[s].startTime)i=s-1;else if(e>o[s].startTime&&r<t)r=s+1;else return s;return o[r].startTime-e<e-o[i].startTime?r:i}function $u(o,e,t){const r=[],i=Uu(o,e);if(i>-1)for(let s=i,a=o.length;s<a;s++){const h=o[s];if(h.startTime>=e&&h.endTime<=t)r.push(h);else if(h.startTime>t)return r}return r}function ro(o){const e=[];for(let t=0;t<o.length;t++){const r=o[t];(r.kind==="subtitles"||r.kind==="captions")&&r.label&&e.push(o[t])}return e}class zu extends To{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 r=ro(this.media.textTracks);for(let s=0;s<r.length;s++)if(r[s].mode==="hidden")t=r[s];else if(r[s].mode==="showing"){t=r[s];break}const i=this.findTrackForTextTrack(t);this.subtitleTrack!==i&&this.setSubtitleTrack(i)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(d.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(d.MANIFEST_LOADING,this.onManifestLoading,this),e.on(d.MANIFEST_PARSED,this.onManifestParsed,this),e.on(d.LEVEL_LOADING,this.onLevelLoading,this),e.on(d.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(d.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(d.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(d.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(d.MANIFEST_LOADING,this.onManifestLoading,this),e.off(d.MANIFEST_PARSED,this.onManifestParsed,this),e.off(d.LEVEL_LOADING,this.onLevelLoading,this),e.off(d.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(d.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(d.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 r=this.media;if(!r)return;const i=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||r.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,i)return;ro(r.textTracks).forEach(a=>{ks(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:r,groupId:i,details:s}=t,a=this.tracksInGroup[r];if(!a||a.groupId!==i){this.warn(`Subtitle track with id:${r} and group:${i} not found in active group ${a==null?void 0:a.groupId}`);return}const h=a.details;a.details=t.details,this.log(`Subtitle track ${r} "${a.name}" lang:${a.lang} group:${i} loaded [${s.startSN}-${s.endSN}]`),r===this.trackId&&this.playlistLoaded(r,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 r=t.subtitleGroups||null,i=this.groupIds;let s=this.currentTrack;if(!r||(i==null?void 0:i.length)!==(r==null?void 0:r.length)||r!=null&&r.some(a=>(i==null?void 0:i.indexOf(a))===-1)){this.groupIds=r,this.trackId=-1,this.currentTrack=null;const a=this.tracks.filter(w=>!r||r.indexOf(w.groupId)!==-1);if(a.length)this.selectDefaultTrack&&!a.some(w=>w.default)&&(this.selectDefaultTrack=!1),a.forEach((w,R)=>{w.id=R});else if(!s&&!this.tracksInGroup.length)return;this.tracksInGroup=a;const h=this.hls.config.subtitlePreference;if(!s&&h){this.selectDefaultTrack=!1;const w=jr(h,a);if(w>-1)s=a[w];else{const R=jr(h,this.tracks);s=this.tracks[R]}}let _=this.findTrackId(s);_===-1&&s&&(_=this.findTrackId(null));const g={subtitleTracks:a};this.log(`Updating subtitle tracks, ${a.length} track(s) found in "${r==null?void 0:r.join(",")}" group-id`),this.hls.trigger(d.SUBTITLE_TRACKS_UPDATED,g),_!==-1&&this.trackId===-1&&this.setSubtitleTrack(_)}}findTrackId(e){const t=this.tracksInGroup,r=this.selectDefaultTrack;for(let i=0;i<t.length;i++){const s=t[i];if(!(r&&!s.default||!r&&!e)&&(!e||ai(s,e)))return i}if(e){for(let i=0;i<t.length;i++){const s=t[i];if(ha(e.attrs,s.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const s=t[i];if(ha(e.attrs,s.attrs,["LANGUAGE"]))return i}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let r=0;r<t.length;r++){const i=t[r];if(Do(i,e))return r}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===U.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 r=this.currentTrack;if(r&&ai(e,r))return r;const i=jr(e,this.tracksInGroup);if(i>-1){const s=this.tracksInGroup[i];return this.setSubtitleTrack(i),s}else{if(r)return null;{const s=jr(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 r=e.id,i=e.groupId,s=this.getUrlWithDirectives(e.url,t),a=e.details,h=a==null?void 0:a.age;this.log(`Loading subtitle ${r} "${e.name}" lang:${e.lang} group:${i}${(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(d.SUBTITLE_TRACK_LOADING,{url:s,id:r,groupId:i,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=ro(e.textTracks),r=this.currentTrack;let i;if(r&&(i=t.filter(s=>Do(r,s))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${r.name}" and language "${r.lang}"`)),[].slice.call(t).forEach(s=>{s.mode!=="disabled"&&s!==i&&(s.mode="disabled")}),i){const s=this.subtitleDisplay?"showing":"hidden";i.mode!==s&&(i.mode=s)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!N(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const r=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(d.SUBTITLE_TRACK_SWITCH,{id:e});return}const s=!!i.details&&!i.details.live;if(e===this.trackId&&i===r&&s)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:a,groupId:h="",name:_,type:g,url:w}=i;this.hls.trigger(d.SUBTITLE_TRACK_SWITCH,{id:a,groupId:h,name:_,type:g,url:w});const R=this.switchParams(i.url,r==null?void 0:r.details,i.details);this.loadPlaylist(R)}}function da(o){let e=5381,t=o.length;for(;t;)e=e*33^o.charCodeAt(--t);return(e>>>0).toString()}const Is=.025;let io=function(o){return o[o.Point=0]="Point",o[o.Range=1]="Range",o}({});function Hu(o,e,t){return`${o.identifier}-${t+1}-${da(e)}`}class ju{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){if(e>=this.assetList.length)return!0;const t=this.playoutLimit;return e<=0||isNaN(t)?!1:this.assetList[e].startOffset>t}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return Mo(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,r=Mo(t,e);return t-r<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=N(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 Mo(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)<Is))}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"?io.Range:io.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 Wu(this)}}function Mo(o,e){return o-e.start<e.duration/2&&!(Math.abs(o-(e.start+e.duration))<Is)?e.start:e.start+e.duration}function dl(o,e,t){const r=new self.URL(o,t);return r.protocol!=="data:"&&r.searchParams.set("_HLS_primary_id",e),r}function Wu(o){return`["${o.identifier}" ${o.cue.pre?"<pre>":o.cue.post?"<post>":""}${o.timelineStart.toFixed(2)}-${o.resumeTime.toFixed(2)}]`}function Fo(o){const e=o.timelineStart,t=o.duration||0;return`["${o.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class Gu{constructor(e,t,r,i){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{const g=this.interstitial.playoutLimit,w=this.currentTime;this.startOffset+w>=g&&this.hls.trigger(d.PLAYOUT_LIMIT_REACHED,{})};const s=this.hls=new e(t);this.interstitial=r,this.assetItem=i;let a=i.uri;try{a=dl(a,s.sessionId).href}catch(_){}s.loadSource(a);const h=()=>{this.hasDetails=!0};s.once(d.LEVEL_LOADED,h),s.once(d.AUDIO_TRACK_LOADED,h),s.once(d.SUBTITLE_TRACK_LOADED,h),s.on(d.MEDIA_ATTACHING,(_,{media:g})=>{this.removeMediaListeners(),this.mediaAttached=g,this.interstitial.playoutLimit&&g.addEventListener("timeupdate",this.checkPlayout)})}bufferedInPlaceToEnd(e){var t;if(!this.interstitial.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e||!this._bufferedEosTime)return!1;const r=this.timelineOffset,i=tr.bufferInfo(e,r,0);return this.getAssetTime(i.end)>=this._bufferedEosTime-.02}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return((e=this.hls)==null?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=tr.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 r=e-t;if(Math.abs(r)>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,r=this.duration;return Math.min(Math.max(0,e-t),r)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls.destroy(),this.hls=this.interstitial=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){this.hls.attachMedia(e)}detachMedia(){this.removeMediaListeners(),this.mediaAttached=null,this.hls.detachMedia()}resumeBuffering(){this.hls.resumeBuffering()}pauseBuffering(){this.hls.pauseBuffering()}transferMedia(){return this.bufferSnapShot(),this.hls.transferMedia()}on(e,t,r){this.hls.on(e,t)}once(e,t,r){this.hls.once(e,t)}off(e,t,r){this.hls.off(e,t)}toString(){var e,t;return`HlsAssetPlayer: ${Fo(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${(t=this.interstitial)!=null&&t.appendInPlace?"append-in-place":""}`}}const pl=.033;class Ku extends F{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((r,i)=>e<=i.startOffset&&t>i.startOffset?(delete i.error,r+1):r,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 r=-1;e.nextEvent?r=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(r=this.findEventIndex(e.previousEvent.identifier)+1);const i=this.items;if(i)for(i[r]||(t===void 0&&(t=e.start),r=this.findItemIndexAtTime(t));r>=0&&(s=i[r])!=null&&s.event;){var s;r--}return r}findItemIndexAtTime(e,t){const r=this.items;if(r)for(let i=0;i<r.length;i++){let s=r[i];if(t&&t!=="primary"&&(s=s[t]),e===s.start||e>s.start&&e<s.end)return i}return-1}findJumpRestrictedIndex(e,t){const r=this.items;if(r)for(let i=e;i<=t&&r[i];i++){const s=r[i].event;if(s!=null&&s.restrictions.jump&&!s.appendInPlace)return i}return-1}findEventIndex(e){const t=this.items;if(t)for(let i=t.length;i--;){var r;if(((r=t[i].event)==null?void 0:r.identifier)===e)return i}return-1}findAssetIndex(e,t){const r=e.assetList,i=r.length;if(i>1)for(let s=0;s<i;s++){const a=r[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 r=(e=this.items)==null||(t=e[this.length-1])==null?void 0:t.event;if(r){const i=r.assetList,s=i[i.length-1];if(s)return s.identifier}return null}parseInterstitialDateRanges(e,t){const r=e.main.details,{dateRanges:i}=r,s=this.events,a=this.parseDateRanges(i,{url:r.url},t),h=Object.keys(i),_=s?s.filter(g=>!h.includes(g.identifier)):[];a.length&&a.sort((g,w)=>{const R=g.cue.pre,G=g.cue.post,Y=w.cue.pre,X=w.cue.post;if(R&&!Y)return-1;if(Y&&!R||G&&!X)return 1;if(X&&!G)return-1;if(!R&&!Y&&!G&&!X){const fe=g.startTime,ce=w.startTime;if(fe!==ce)return fe-ce}return g.dateRange.tagOrder-w.dateRange.tagOrder}),this.events=a,_.forEach(g=>{this.removeEvent(g)}),this.updateSchedule(e,_)}updateSchedule(e,t=[]){const r=this.events||[];if(r.length||t.length||this.length<2){const i=this.items,s=this.parseSchedule(r,e);(t.length||(i==null?void 0:i.length)!==s.length||s.some((h,_)=>Math.abs(h.playout.start-i[_].playout.start)>.005||Math.abs(h.playout.end-i[_].playout.end)>.005))&&(this.items=s,this.onScheduleUpdate(t,i))}}parseDateRanges(e,t,r){const i=[],s=Object.keys(e);for(let a=0;a<s.length;a++){const h=s[a],_=e[h];if(_.isInterstitial){let g=this.eventMap[h];g?g.setDateRange(_):(g=new ju(_,t),this.eventMap[h]=g,r===!1&&(g.appendInPlace=r)),i.push(g)}}return i}parseSchedule(e,t){const r=[],i=t.main.details,s=i.live?1/0:i.edge;let a=0;if(e=e.filter(_=>!_.error&&!(_.cue.once&&_.hasPlayed)),e.length){this.resolveOffsets(e,t);let _=0,g=0;if(e.forEach((w,R)=>{const G=w.cue.pre,Y=w.cue.post,X=e[R-1]||null,fe=w.appendInPlace,ce=Y?s:w.startOffset,Ee=w.duration,Re=w.timelineOccupancy===io.Range?Ee:0,Te=w.resumptionOffset,Ge=(X==null?void 0:X.startTime)===ce,Ke=ce+w.cumulativeDuration;let ct=fe?Ke+Ee:ce+Te;if(G||!Y&&ce<=0){const it=g;g+=Re,w.timelineStart=Ke;const ht=a;a+=Ee,r.push({event:w,start:Ke,end:ct,playout:{start:ht,end:a},integrated:{start:it,end:g}})}else if(ce<=s){if(!Ge){const Xe=ce-_;if(Xe>pl){const St=_,Pt=g;g+=Xe;const Sr=a;a+=Xe;const ir={previousEvent:e[R-1]||null,nextEvent:w,start:St,end:St+Xe,playout:{start:Sr,end:a},integrated:{start:Pt,end:g}};r.push(ir)}else Xe>0&&X&&(X.cumulativeDuration+=Xe,r[r.length-1].end=ce)}Y&&(ct=Ke),w.timelineStart=Ke;const it=g;g+=Re;const ht=a;a+=Ee,r.push({event:w,start:Ke,end:ct,playout:{start:ht,end:a},integrated:{start:it,end:g}})}else return;const qe=w.resumeTime;Y||qe>s?_=s:_=qe}),_<s){var h;const w=_,R=g,G=s-_;g+=G;const Y=a;a+=G,r.push({previousEvent:((h=r[r.length-1])==null?void 0:h.event)||null,nextEvent:null,start:_,end:w+G,playout:{start:Y,end:a},integrated:{start:R,end:g}})}this.setDurations(s,a,g)}else r.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 r}setDurations(e,t,r){this.durations={primary:e,playout:t,integrated:r}}resolveOffsets(e,t){const r=t.main.details,i=r.live?1/0:r.edge;let s=0,a=-1;e.forEach((h,_)=>{const g=h.cue.pre,w=h.cue.post,R=g?0:w?i:h.startTime;this.updateAssetDurations(h),a===R?h.cumulativeDuration=s:(s=0,a=R),!w&&h.snapOptions.in&&(h.resumeAnchor=hr(null,r.fragments,h.startOffset+h.resumptionOffset,0,0)||void 0),h.appendInPlace&&!h.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(h,t)||(h.appendInPlace=!1)),!h.appendInPlace&&_+1<e.length&&e[_+1].startTime-e[_].resumeTime<pl&&(e[_+1].appendInPlace=!1,e[_+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${h}`));const Y=N(h.resumeOffset)?h.resumeOffset:h.duration;s+=Y})}primaryCanResumeInPlaceAt(e,t){const r=e.resumeTime,i=e.startTime+e.resumptionOffset;return Math.abs(r-i)>Is?(this.log(`"${e.identifier}" resumption ${r} not aligned with estimated timeline end ${i}`),!1):t?!Object.keys(t).some(a=>{const h=t[a].details,_=h.edge;if(r>=_)return this.log(`"${e.identifier}" resumption ${r} past ${a} playlist end ${_}`),!1;const g=hr(null,h.fragments,r);if(!g)return this.log(`"${e.identifier}" resumption ${r} does not align with any fragments in ${a} playlist (${h.fragStart}-${h.fragmentEnd})`),!0;const w=a==="audio"?.175:0;return Math.abs(g.start-r)<Is+w||Math.abs(g.end-r)<Is+w?!1:(this.log(`"${e.identifier}" resumption ${r} not aligned with ${a} fragment bounds (${g.start}-${g.end} sn: ${g.sn} cc: ${g.cc})`),!0)}):(this.log(`"${e.identifier}" resumption ${r} can not be aligned with media (none selected)`),!1)}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let r=0,i=!1,s=!1;e.assetList.forEach((a,h)=>{const _=t+r;a.startOffset=r,a.timelineStart=_,i||(i=a.duration===null),s||(s=!!a.error);const g=a.error?0:a.duration||0;r+=g}),i&&!s?e.duration=Math.max(r,e.duration):e.duration=r}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Qn(o){return`[${o.event?'"'+o.event.identifier+'"':"primary"}: ${o.start.toFixed(2)}-${o.end.toFixed(2)}]`}class Vu{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const r=e.assetListUrl;let i;try{i=dl(r,this.hls.sessionId,e.baseUrl)}catch(G){const Y=this.assignAssetListError(e,A.ASSET_LIST_LOAD_ERROR,G,r);this.hls.trigger(d.ERROR,Y);return}t&&i.protocol!=="data:"&&i.searchParams.set("_HLS_start_offset",""+t);const s=this.hls.config,a=s.loader,h=new a(s),_={responseType:"json",url:i.href},g=s.interstitialAssetListLoadPolicy.default,w={loadPolicy:g,timeout:g.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},R={onSuccess:(G,Y,X,fe)=>{const ce=G.data,Ee=ce==null?void 0:ce.ASSETS;if(!Array.isArray(Ee)){const Re=this.assignAssetListError(e,A.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),X.url,Y,fe);this.hls.trigger(d.ERROR,Re);return}e.assetListResponse=ce,this.hls.trigger(d.ASSET_LIST_LOADED,{event:e,assetListResponse:ce,networkDetails:fe})},onError:(G,Y,X,fe)=>{const ce=this.assignAssetListError(e,A.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${G.code} ${G.text} (${Y.url})`),Y.url,fe,X);this.hls.trigger(d.ERROR,ce)},onTimeout:(G,Y,X)=>{const fe=this.assignAssetListError(e,A.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${Y.url})`),Y.url,G,X);this.hls.trigger(d.ERROR,fe)}};return h.load(_,w,R),this.hls.trigger(d.ASSET_LIST_LOADING,{event:e}),h}assignAssetListError(e,t,r,i,s,a){return e.error=r,{type:I.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:i,error:r,networkDetails:a,stats:s}}}function Hn(o,e,t){kn(o,e,t),o.addEventListener(e,t)}function kn(o,e,t){o.removeEventListener(e,t)}function ml(o){o==null||o.play().catch(()=>{})}class qu extends F{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 r=this.currentTime;if(r===void 0||this.playbackDisabled)return;const i=r-this.timelinePos;if(Math.abs(i)<1/7056e5)return;const a=i<=-.01;this.timelinePos=r,this.bufferedPos=r;const h=this.playingItem;if(!h){this.checkBuffer();return}if(a&&this.schedule.resetErrorsInRange(r,r-i)&&this.updateSchedule(),this.checkBuffer(),a&&r<h.start||r>=h.end){var _;const G=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(h)&&(_=this.media)!=null&&_.paused&&(this.shouldPlay=!1),!a){const Y=this.findItemIndex(h);if(G>Y){const X=this.schedule.findJumpRestrictedIndex(Y+1,G);if(X>Y){this.setSchedulePosition(X);return}}}this.setSchedulePosition(G);return}const g=this.playingAsset;if(!g){if(this.playingLastItem&&this.isInterstitial(h)){const G=h.event.assetList[0];G&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(r,G))}return}const w=g.timelineStart,R=g.duration||0;(a&&r<w||r>=w+R)&&this.setScheduleToAssetAtTime(r,g)},this.onTimeupdate=()=>{const r=this.currentTime;if(r===void 0||this.playbackDisabled)return;if(r>this.timelinePos)this.timelinePos=r,r>this.bufferedPos&&this.checkBuffer();else return;const i=this.playingItem;if(!i||this.playingLastItem)return;if(r>=i.end){this.timelinePos=i.end;const h=this.findItemIndex(i);this.setSchedulePosition(h+1)}const s=this.playingAsset;if(!s)return;const a=s.timelineStart+(s.duration||0);r>=a&&this.setScheduleToAssetAtTime(r,s)},this.onScheduleUpdate=(r,i)=>{const s=this.schedule,a=this.playingItem,h=s.events||[],_=s.items||[],g=s.durations,w=r.map(Y=>Y.identifier),R=!!(h.length||w.length);if(R&&this.log(`INTERSTITIALS_UPDATED (${h.length}): ${h}
|
|
|
Schedule: ${_.map(Y=>Qn(Y))}`),w.length&&this.log(`Removed events ${w}`),this.playerQueue.forEach(Y=>{if(Y.interstitial.appendInPlace){const X=Y.assetItem.timelineStart,fe=Y.timelineOffset-X;if(fe)try{Y.timelineOffset=X}catch(ce){Math.abs(fe)>Is&&this.warn(`${ce} ("${Y.assetId}" ${Y.timelineOffset}->${X})`)}}}),a){const Y=this.updateItem(a,this.timelinePos);this.itemsMatch(a,Y)&&(this.playingItem=Y,this.waitingItem=this.endedItem=null)}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const G=this.bufferingItem;if(G){const Y=this.updateItem(G,this.bufferedPos);this.itemsMatch(G,Y)?this.bufferingItem=Y:G.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(G.event,null))}if(r.forEach(Y=>{Y.assetList.forEach(X=>{this.clearAssetPlayer(X.identifier,null)})}),R||i){if(this.hls.trigger(d.INTERSTITIALS_UPDATED,{events:h.slice(0),schedule:_.slice(0),durations:g,removedIds:w}),this.isInterstitial(a)&&w.includes(a.event.identifier)){this.warn(`Interstitial "${a.event.identifier}" removed while playing`),this.primaryFallback(a.event);return}this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new Vu(e),this.schedule=new Ku(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e.on(d.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(d.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(d.MANIFEST_LOADING,this.onManifestLoading,this),e.on(d.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(d.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(d.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(d.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(d.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(d.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(d.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(d.BUFFER_APPENDED,this.onBufferAppended,this),e.on(d.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(d.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(d.MEDIA_ENDED,this.onMediaEnded,this),e.on(d.ERROR,this.onError,this),e.on(d.DESTROYING,this.onDestroying,this)}unregisterListeners(){const e=this.hls;e&&(e.off(d.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(d.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(d.MANIFEST_LOADING,this.onManifestLoading,this),e.off(d.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(d.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(d.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(d.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(d.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(d.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(d.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(d.BUFFER_CODECS,this.onBufferCodecs,this),e.off(d.BUFFER_APPENDED,this.onBufferAppended,this),e.off(d.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(d.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(d.MEDIA_ENDED,this.onMediaEnded,this),e.off(d.ERROR,this.onError,this),e.off(d.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){kn(e,"play",this.onPlay),kn(e,"pause",this.onPause),kn(e,"seeking",this.onSeeking),kn(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const r=this.media=t.media;Hn(r,"seeking",this.onSeeking),Hn(r,"timeupdate",this.onTimeupdate),Hn(r,"play",this.onPlay),Hn(r,"pause",this.onPause)}onMediaAttached(e,t){const r=this.effectivePlayingItem,i=this.detachedData;if(this.detachedData=null,r===null)this.checkStart();else if(!i){this.clearScheduleState();const s=this.findItemIndex(r);this.setSchedulePosition(s)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const r=!!t.transferMedia,i=this.media;if(this.media=null,!r&&(i&&this.removeMediaListeners(i),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,r=R=>R&&e.getAssetPlayer(R.identifier),i=(R,G,Y,X,fe)=>{if(R){let ce=R[G].start;const Ee=R.event;if(Ee){if(G==="playout"||Ee.timelineOccupancy!==io.Point){const Re=r(Y);(Re==null?void 0:Re.interstitial)===Ee&&(ce+=Re.assetItem.startOffset+Re[fe])}}else{const Re=X==="bufferedPos"?a():e[X];ce+=Re-R.start}return ce}return 0},s=(R,G)=>{if(R!==0&&G!=="primary"&&e.schedule.length){var Y;const X=e.schedule.findItemIndexAtTime(R),fe=(Y=e.schedule.items)==null?void 0:Y[X];if(fe){const ce=fe[G].start-fe.start;return R+ce}}return R},a=()=>{const R=e.bufferedPos;return R===Number.MAX_VALUE?h("primary"):Math.max(R,0)},h=R=>{var G;return(G=e.primaryDetails)!=null&&G.live?e.primaryDetails.edge:e.schedule.durations[R]},_=(R,G)=>{var Y,X;const fe=e.effectivePlayingItem;if(fe!=null&&(Y=fe.event)!=null&&Y.restrictions.skip)return;e.log(`seek to ${R} "${G}"`);const ce=e.effectivePlayingItem,Ee=e.schedule.findItemIndexAtTime(R,G),Re=(X=e.schedule.items)==null?void 0:X[Ee],Te=e.getBufferingPlayer(),Ge=Te==null?void 0:Te.interstitial,Ke=Ge==null?void 0:Ge.appendInPlace,ct=ce&&e.itemsMatch(ce,Re);if(ce&&(Ke||ct)){const it=r(e.playingAsset),ht=(it==null?void 0:it.media)||e.primaryMedia;if(ht){const Xe=G==="primary"?ht.currentTime:i(ce,G,e.playingAsset,"timelinePos","currentTime"),St=R-Xe,Pt=(Ke?Xe:ht.currentTime)+St;if(Pt>=0&&(!it||Ke||Pt<=it.duration)){ht.currentTime=Pt;return}}}if(Re){let it=R;if(G!=="primary"){const Xe=Re[G].start,St=R-Xe;it=Re.start+St}const ht=!e.isInterstitial(Re);if((!e.isInterstitial(ce)||ce.event.appendInPlace)&&(ht||Re.event.appendInPlace)){const Xe=e.media||(Ke?Te==null?void 0:Te.media:null);Xe&&(Xe.currentTime=it)}else if(ce){const Xe=e.findItemIndex(ce);if(Ee>Xe){const Pt=e.schedule.findJumpRestrictedIndex(Xe+1,Ee);if(Pt>Xe){e.setSchedulePosition(Pt);return}}let St=0;if(ht)e.timelinePos=it,e.checkBuffer();else{var qe;const Pt=Re==null||(qe=Re.event)==null?void 0:qe.assetList;if(Pt){const Sr=R-(Re[G]||Re).start;for(let ir=Pt.length;ir--;){const Xt=Pt[ir];if(Xt.duration&&Sr>=Xt.startOffset&&Sr<Xt.startOffset+Xt.duration){St=ir;break}}}}e.setSchedulePosition(Ee,St)}}},g=()=>{const R=e.effectivePlayingItem;if(e.isInterstitial(R))return R;const G=t();return e.isInterstitial(G)?G:null},w={get currentTime(){const R=g(),G=e.effectivePlayingItem;return G&&G===R?i(G,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-G.playout.start:0},set currentTime(R){const G=g(),Y=e.effectivePlayingItem;Y&&Y===G&&_(R+Y.playout.start,"playout")},get duration(){const R=g();return R?R.playout.end-R.playout.start:0},get assetPlayers(){var R;const G=(R=g())==null?void 0:R.event.assetList;return G?G.map(Y=>e.getAssetPlayer(Y.identifier)):[]},get playingIndex(){var R;const G=(R=g())==null?void 0:R.event;return G&&e.effectivePlayingAsset?G.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return g()}};this.manager={get events(){var R,G;return((R=e.schedule)==null||(G=R.events)==null?void 0:G.slice(0))||[]},get schedule(){var R,G;return((R=e.schedule)==null||(G=R.items)==null?void 0:G.slice(0))||[]},get interstitialPlayer(){return g()?w:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const R=t();return e.findItemIndex(R)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const R=e.effectivePlayingItem;return e.findItemIndex(R)},primary:{get bufferedEnd(){return a()},get currentTime(){const R=e.timelinePos;return R>0?R:0},set currentTime(R){_(R,"primary")},get duration(){return h("primary")},get seekableStart(){var R;return((R=e.primaryDetails)==null?void 0:R.fragmentStart)||0}},integrated:{get bufferedEnd(){return i(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return i(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(R){_(R,"integrated")},get duration(){return h("integrated")},get seekableStart(){var R;return s(((R=e.primaryDetails)==null?void 0:R.fragmentStart)||0,"integrated")}},skip:()=>{const R=e.effectivePlayingItem,G=R==null?void 0:R.event;if(G&&!G.restrictions.skip){const Y=e.findItemIndex(R);if(G.appendInPlace){const X=R.playout.start+R.event.duration;_(X+.001,"playout")}else e.advanceAfterAssetEnded(G,Y,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,r=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!r?!1:this.findItemIndex(t)===r.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t,r;if(this.mediaSelection===null)return;const i=this.waitingItem||this.playingItem;if(this.isInterstitial(i)&&!i.event.appendInPlace)return;let s=this.media;!s&&(e=this.bufferingItem)!=null&&(t=e.event)!=null&&t.appendInPlace&&(s=this.primaryMedia);const a=(r=s)==null?void 0:r.currentTime;if(!(a===void 0||!N(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 r=this.getAssetPlayer(e);r&&this.transferMediaFromPlayer(r,t)}transferMediaFromPlayer(e,t){const r=e.interstitial.appendInPlace,i=e.media;if(r&&i===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&i){this.detachedData={media:i};return}const s=e.transferMedia();this.log(`transfer MediaSource from ${e} ${sr(s)}`),this.detachedData=s}else t&&i&&(this.shouldPlay||(this.shouldPlay=!i.paused))}transferMediaTo(e,t){var r,i;if(e.media===t)return;let s=null;const a=this.hls,h=e!==a,_=h&&e.interstitial.appendInPlace,g=(r=this.detachedData)==null?void 0:r.mediaSource;let w;if(a.media)_&&(s=a.transferMedia(),this.detachedData=s),w="Primary";else if(g){const Y=this.getBufferingPlayer();Y?(s=Y.transferMedia(),w=`${Y}`):w="detached MediaSource"}else w="detached media";if(!s){if(g)s=this.detachedData,this.log(`using detachedData: MediaSource ${sr(s)}`);else if(!this.detachedData||a.media===t){const Y=this.playerQueue;Y.length>1&&Y.forEach(X=>{if(h&&X.interstitial.appendInPlace!==_){const fe=X.interstitial;this.clearInterstitial(X.interstitial,null),fe.appendInPlace=!1,fe.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${fe}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const R=s&&"mediaSource"in s&&((i=s.mediaSource)==null?void 0:i.readyState)!=="closed",G=R&&s?s:t;if(this.log(`${R?"transfering MediaSource":"attaching media"} to ${h?e:"Primary"} from ${w}`),G===s){const Y=h&&e.assetId===this.schedule.assetIdAtEnd;G.overrides={duration:this.schedule.duration,endOfStream:!h||Y,cueRemoval:!h}}e.attachMedia(G)}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 r=this.timelinePos,i=this.effectivePlayingItem;if(r===-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(i&&!this.playingItem){const s=e.findItemIndex(i);this.setSchedulePosition(s)}}advanceAfterAssetEnded(e,t,r){const i=r+1;if(!e.isAssetPastPlayoutLimit(i)&&!e.assetList[i].error)this.setSchedulePosition(t,i);else{const s=this.schedule.items;if(s){const a=t+1,h=s.length;if(a>=h){this.setSchedulePosition(-1);return}const _=e.resumeTime;this.timelinePos<_&&(this.timelinePos=_,this.checkBuffer()),this.setSchedulePosition(a)}}}setScheduleToAssetAtTime(e,t){const r=this.schedule,i=t.parentIdentifier,s=r.getEvent(i);if(s){const a=r.findEventIndex(i),h=r.findAssetIndex(s,e);this.setSchedulePosition(a,h)}}setSchedulePosition(e,t){const r=this.schedule.items;if(!r||this.playbackDisabled)return;this.log(`setSchedulePosition ${e}, ${t}`);const i=e>=0?r[e]:null,s=this.playingItem,a=this.playingLastItem;if(this.isInterstitial(s)){var h;const g=s.event,w=this.playingAsset,R=w==null?void 0:w.identifier,G=R?this.getAssetPlayer(R):null;if(G&&R&&(!this.eventItemsMatch(s,i)||t!==void 0&&R!==((h=g.assetList)==null?void 0:h[t].identifier))){var _;const Y=g.findAssetIndex(w);this.log(`INTERSTITIAL_ASSET_ENDED ${Y+1}/${g.assetList.length} ${Fo(w)}`),this.endedAsset=w,this.playingAsset=null,this.hls.trigger(d.INTERSTITIAL_ASSET_ENDED,{asset:w,assetListIndex:Y,event:g,schedule:r.slice(0),scheduleIndex:e,player:G}),this.retreiveMediaSource(R,i),G.media&&!((_=this.detachedData)!=null&&_.mediaSource)&&G.detachMedia()}if(!this.eventItemsMatch(s,i)&&(this.endedItem=s,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${g} ${Qn(s)}`),g.hasPlayed=!0,this.hls.trigger(d.INTERSTITIAL_ENDED,{event:g,schedule:r.slice(0),scheduleIndex:e}),g.cue.once)){this.updateSchedule();const Y=this.schedule.items;if(i&&Y){const X=this.schedule.findItemIndex(i);this.advanceSchedule(X,Y,t,s,a)}return}}this.advanceSchedule(e,r,t,s,a)}advanceSchedule(e,t,r,i,s){const a=e>=0?t[e]:null,h=this.primaryMedia,_=this.playerQueue;if(_.length&&_.forEach(g=>{const w=g.interstitial,R=this.schedule.findEventIndex(w.identifier);(R<e||R>e+1)&&this.clearInterstitial(w,a)}),this.isInterstitial(a)){this.timelinePos=Math.min(Math.max(this.timelinePos,a.start),a.end);const g=a.event;r===void 0&&(r=this.schedule.findAssetIndex(g,this.timelinePos));const w=this.waitingItem;this.assetsBuffered(a,h)||this.setBufferingItem(a);let R=this.preloadAssets(g,r);if(this.eventItemsMatch(a,w||i)||(this.waitingItem=a,this.log(`INTERSTITIAL_STARTED ${Qn(a)} ${g.appendInPlace?"append in place":""}`),this.hls.trigger(d.INTERSTITIAL_STARTED,{event:g,schedule:t.slice(0),scheduleIndex:e})),!g.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${g}`);return}if(g.assetListLoader&&(g.assetListLoader.destroy(),g.assetListLoader=void 0),!h){this.log(`Waiting for attachMedia to start Interstitial ${g}`);return}this.waitingItem=this.endedItem=null,this.playingItem=a;const G=g.assetList[r];if(!G){const Y=t[e+1],X=this.media;Y&&X&&!this.isInterstitial(Y)&&X.currentTime<Y.start&&(X.currentTime=this.timelinePos=Y.start),this.advanceAfterAssetEnded(g,e,r||0);return}if(R||(R=this.getAssetPlayer(G.identifier)),R===null||R.destroyed){const Y=g.assetList.length;this.warn(`asset ${r+1}/${Y} player destroyed ${g}`),R=this.createAssetPlayer(g,G,r)}if(!this.eventItemsMatch(a,this.bufferingItem)&&g.appendInPlace&&this.isAssetBuffered(G))return;this.startAssetPlayer(R,r,t,e,h),this.shouldPlay&&ml(R.media)}else a!==null?(this.resumePrimary(a,e,i),this.shouldPlay&&ml(this.hls.media)):s&&this.isInterstitial(i)&&(this.endedItem=null,this.playingItem=i,i.event.appendInPlace||this.attachPrimary(this.schedule.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e,t;return(e=this.mediaSelection)==null||(t=e.main)==null?void 0:t.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,r){var i;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Qn(e)}`),!((i=this.detachedData)!=null&&i.mediaSource)){let a=this.timelinePos;(a<e.start||a>=e.end)&&(a=this.getPrimaryResumption(e,t),this.timelinePos=a),this.attachPrimary(a,e)}if(!r)return;const s=this.schedule.items;s&&(this.log(`resumed ${Qn(e)}`),this.hls.trigger(d.INTERSTITIALS_PRIMARY_RESUMED,{schedule:s.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const r=e.start;if(this.primaryLive){const i=this.primaryDetails;if(t===0)return this.hls.startPosition;if(i&&(r<i.fragmentStart||r>i.edge))return this.hls.liveSyncPosition||-1}return r}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:tr.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,r){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const i=this.primaryMedia;if(!i)return;const s=this.hls;s.media?this.checkBuffer():(this.transferMediaTo(s,i),r&&this.startLoadingPrimaryAt(e,r)),r||(this.timelinePos=e,this.startLoadingPrimaryAt(e,r))}startLoadingPrimaryAt(e,t){var r;const i=this.hls;!i.loadingEnabled||!i.media||Math.abs((((r=i.mainForwardBufferInfo)==null?void 0:r.start)||i.media.currentTime)-e)>.5?i.startLoad(e,t):i.bufferingEnabled||i.resumeBuffering()}onManifestLoading(){this.stopLoad(),this.schedule.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(d.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(d.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1)return;const r=this.hls.levels[t.level],i=u(u({},this.mediaSelection||this.altSelection),{},{main:r});this.mediaSelection=i,this.schedule.parseInterstitialDateRanges(i,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const r=this.hls.audioTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=u(u({},this.altSelection),{},{audio:r});return}const s=u(u({},i),{},{audio:r});this.mediaSelection=s}onSubtitleTrackUpdated(e,t){const r=this.hls.subtitleTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=u(u({},this.altSelection),{},{subtitles:r});return}const s=u(u({},i),{},{subtitles:r});this.mediaSelection=s}onAudioTrackSwitching(e,t){const r=mr(t);this.playerQueue.forEach(i=>i.hls.setAudioOption(t)||i.hls.setAudioOption(r))}onSubtitleTrackSwitch(e,t){const r=mr(t);this.playerQueue.forEach(i=>i.hls.setSubtitleOption(t)||t.id!==-1&&i.hls.setSubtitleOption(r))}onBufferCodecs(e,t){const r=t.tracks;r&&(this.requiredTracks=r)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const r=this.playingItem;if(r&&!this.itemsMatch(r,this.bufferingItem)&&!this.isInterstitial(r)){const i=this.timelinePos;this.bufferedPos=i,this.checkBuffer()}}onBufferedToEnd(e){const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let i=0;i<t.length;i++){const s=t[i];if(s.cue.post){var r;const a=this.schedule.findEventIndex(s.identifier),h=(r=this.schedule.items)==null?void 0:r[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 r=this.findItemIndex(t);this.setSchedulePosition(r+1)}else this.shouldPlay=!1}updateItem(e,t){const r=this.schedule.items;if(e&&r){const i=this.findItemIndex(e,t);return r[i]||null}return null}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var r;return!!t&&(e===t||e.event.identifier===((r=t.event)==null?void 0:r.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 r=tr.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=r.len<1),this.updateBufferedPos(r.end,t,e)}updateBufferedPos(e,t,r){const i=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 _=i.findItemIndexAtTime(e);if(this.bufferedPos<e){var g,w;const R=this.findItemIndex(s),G=Math.min(R+1,t.length-1),Y=t[G];if((_===-1&&s&&e>=s.end||(g=Y.event)!=null&&g.appendInPlace&&e+.01>=Y.start)&&(_=G),G-h>1&&(s==null||(w=s.event)==null?void 0:w.appendInPlace)===!1)return;if(this.bufferedPos=e,_>R&&_>h)this.bufferedToItem(Y);else{const X=this.primaryDetails;this.primaryLive&&X&&e>X.edge-X.targetduration&&Y.start<X.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(Y)&&this.preloadAssets(Y.event,0)}}else r&&a&&!this.itemsMatch(a,s)&&(_===h?this.bufferedToItem(a):_===h+1&&this.bufferedToItem(t[_]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(i=>{const s=this.getAssetPlayer(i.identifier);return!(s!=null&&s.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,r=this.schedule;if(this.itemsMatch(e,t))this.bufferingItem!==e&&(this.bufferingItem=e);else{const{items:i,events:s}=r;if(!i||!s)return t;const a=this.isInterstitial(e),h=this.getBufferingPlayer();if(this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos)),!this.playbackDisabled){const _=h?h.remaining:t?t.end-this.timelinePos:0;this.log(`buffered to boundary ${Qn(e)}`+(t?` (${_.toFixed(2)} remaining)`:"")),a?e.event.assetList.forEach(g=>{const w=this.getAssetPlayer(g.identifier);w&&w.resumeBuffering()}):(this.hls.resumeBuffering(),this.playerQueue.forEach(g=>g.pauseBuffering()))}this.hls.trigger(d.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:s.slice(0),schedule:i.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}return t}bufferedToItem(e,t=0){const r=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(r!==null){this.bufferingAsset=null;const i=this.detachedData;i?i.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),r=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(r)}bufferedToEvent(e,t){const r=e.event,i=r.assetList.length===0&&!r.assetListLoader,s=r.cue.once;if(i||!s){const a=this.preloadAssets(r,t);if(a!=null&&a.interstitial.appendInPlace){const h=r.assetList[t],_=this.primaryMedia;h&&_&&this.bufferAssetPlayer(a,_)}}}preloadAssets(e,t){const r=e.assetUrl,i=e.assetList.length,s=i===0&&!e.assetListLoader,a=e.cue.once;if(s){const _=e.timelineStart;if(e.appendInPlace){var h;const G=this.playingItem;!this.isInterstitial(G)&&(G==null||(h=G.nextEvent)==null?void 0:h.identifier)===e.identifier&&this.flushFrontBuffer(_+.25)}let g,w=0;if(!this.playingItem&&this.primaryLive&&(w=this.hls.startPosition,w===-1&&(w=this.hls.liveSyncPosition||0)),w&&!(e.cue.pre||e.cue.post)){const G=w-_;G>0&&(g=Math.round(G*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${r?1:i} ${e}${g?` live-start: ${w} start-offset: ${g}`:""}`),r)return this.createAsset(e,0,0,_,e.duration,r);const R=this.assetListLoader.loadAssetList(e,g);R&&(e.assetListLoader=R)}else if(!a&&i){for(let _=t;_<i;_++){const g=e.assetList[_],w=this.getAssetPlayerQueueIndex(g.identifier);(w===-1||this.playerQueue[w].destroyed)&&!g.error&&this.createAssetPlayer(e,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(i=>{this.hls.trigger(d.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:i})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let r=0;r<t.length;r++)if(e===t[r].assetId)return r;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 r=0;r<e.length;r++)if(e[r].media===t)return e[r]}return null}createAsset(e,t,r,i,s,a){const h={parentIdentifier:e.identifier,identifier:Hu(e,a,t),duration:s,startOffset:r,timelineStart:i,uri:a};return this.createAssetPlayer(e,h,t)}createAssetPlayer(e,t,r){this.log(`create HLSAssetPlayer for ${Fo(t)}`);const i=this.hls,s=i.userConfig;let a=s.videoPreference;const h=i.loadLevelObj||i.levels[i.currentLevel];(a||h)&&(a=c({},a),h.videoCodec&&(a.videoCodec=h.videoCodec),h.videoRange&&(a.allowedVideoRanges=[h.videoRange]));const _=i.audioTracks[i.audioTrack],g=i.subtitleTracks[i.subtitleTrack];let w=0;if(this.primaryLive||e.appendInPlace){const Te=this.timelinePos-t.timelineStart;if(Te>1){const Ge=t.duration;Ge&&Te<Ge&&(w=Te)}}const R=t.identifier,G=u(u({},s),{},{autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:i.sessionId,assetPlayerId:R,abrEwmaDefaultEstimate:i.bandwidthEstimate,interstitialsController:void 0,startPosition:w,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:a,audioPreference:_||s.audioPreference,subtitlePreference:g||s.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(G.timelineOffset=t.timelineStart));const Y=G.cmcd;Y!=null&&Y.sessionId&&Y.contentId&&(G.cmcd=c({},Y,{contentId:da(t.uri)})),this.getAssetPlayer(R)&&this.warn(`Duplicate date range identifier ${e} and asset ${R}`);const X=new Gu(this.HlsPlayerClass,G,e,t);this.playerQueue.push(X),e.assetList[r]=t;const fe=Te=>{if(Te.live){const ct=new Error(`Interstitials MUST be VOD assets ${e}`),qe={fatal:!0,type:I.OTHER_ERROR,details:A.INTERSTITIAL_ASSET_ITEM_ERROR,error:ct};this.handleAssetItemError(qe,e,this.schedule.findEventIndex(e.identifier),r,ct.message);return}const Ge=Te.edge-Te.fragmentStart,Ke=t.duration;(Ke===null||Ge>Ke)&&(this.log(`Interstitial asset "${R}" duration change ${Ke} > ${Ge}`),t.duration=Ge,this.updateSchedule())};X.on(d.LEVEL_UPDATED,(Te,{details:Ge})=>fe(Ge)),X.on(d.LEVEL_PTS_UPDATED,(Te,{details:Ge})=>fe(Ge));const ce=(Te,Ge)=>{const Ke=this.getAssetPlayer(R);if(Ke&&Ge.tracks){Ke.off(d.BUFFER_CODECS,ce),Ke.tracks=Ge.tracks;const ct=this.primaryMedia;this.bufferingAsset===Ke.assetItem&&ct&&!Ke.media&&this.bufferAssetPlayer(Ke,ct)}};X.on(d.BUFFER_CODECS,ce);const Ee=()=>{var Te;const Ge=this.getAssetPlayer(R);if(this.log(`buffered to end of asset ${Ge}`),!Ge)return;const Ke=this.schedule.findEventIndex(e.identifier),ct=e.findAssetIndex(t),qe=ct+1,it=(Te=this.schedule.items)==null?void 0:Te[Ke];if(this.isInterstitial(it))if(ct!==-1&&!e.isAssetPastPlayoutLimit(qe)&&!e.assetList[qe].error)this.bufferedToItem(it,qe);else{var ht;const Xe=(ht=this.schedule.items)==null?void 0:ht[Ke+1];Xe&&this.bufferedToItem(Xe)}};X.on(d.BUFFERED_TO_END,Ee);const Re=Te=>()=>{if(!this.getAssetPlayer(R))return;this.shouldPlay=!0;const Ke=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,Ke,Te)};return X.once(d.MEDIA_ENDED,Re(r)),X.once(d.PLAYOUT_LIMIT_REACHED,Re(1/0)),X.on(d.ERROR,(Te,Ge)=>{const Ke=this.getAssetPlayer(R);if(Ge.details===A.BUFFER_STALLED_ERROR){if(Ke!=null&&Ke.media){const ct=Ke.currentTime,qe=Ke.duration-ct;ct&&e.appendInPlace&&qe/Ke.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${R} ${e} at ${Ke.media.currentTime}`),Ee()):(this.warn(`Stalled at ${ct} of ${ct+qe} in asset ${R} ${e}`),this.onTimeupdate(),this.checkBuffer(!0))}return}this.handleAssetItemError(Ge,e,this.schedule.findEventIndex(e.identifier),r,`Asset player error ${Ge.error} ${e}`)}),X.on(d.DESTROYING,()=>{if(!this.getAssetPlayer(R))return;const Ge=new Error(`Asset player destroyed unexpectedly ${R}`),Ke={fatal:!0,type:I.OTHER_ERROR,details:A.INTERSTITIAL_ASSET_ITEM_ERROR,error:Ge};this.handleAssetItemError(Ke,e,this.schedule.findEventIndex(e.identifier),r,Ge.message)}),this.hls.trigger(d.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:r,event:e,player:X}),X}clearInterstitial(e,t){e.assetList.forEach(r=>{this.clearAssetPlayer(r.identifier,t)}),e.reset()}clearAssetPlayer(e,t){const r=this.getAssetPlayerQueueIndex(e);if(r!==-1){this.log(`clearAssetPlayer "${e}" toSegment: ${t&&Qn(t)}`);const i=this.playerQueue[r];this.transferMediaFromPlayer(i,t),this.playerQueue.splice(r,1),i.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,r,i,s){const{interstitial:a,assetItem:h,assetId:_}=e,g=a.assetList.length,w=this.playingAsset;this.endedAsset=null,this.playingAsset=h,(!w||w.identifier!==_)&&(w&&(this.clearAssetPlayer(w.identifier,r[i]),delete w.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${g} ${e}`),this.hls.trigger(d.INTERSTITIAL_ASSET_STARTED,{asset:h,assetListIndex:t,event:a,schedule:r.slice(0),scheduleIndex:i,player:e})),this.bufferAssetPlayer(e,s)}bufferAssetPlayer(e,t){var r,i;const{interstitial:s,assetItem:a,assetId:h}=e,_=this.schedule.findEventIndex(s.identifier),g=(r=this.schedule.items)==null?void 0:r[_];if(!g)return;this.setBufferingItem(g),this.bufferingAsset=a;const w=this.getBufferingPlayer();if(w===e)return;const R=s.appendInPlace;if(R&&(w==null?void 0:w.interstitial.appendInPlace)===!1)return;const G=(w==null?void 0:w.tracks)||((i=this.detachedData)==null?void 0:i.tracks)||this.requiredTracks;if(R&&a!==this.playingAsset){if(!e.tracks)return;if(G&&!me(G,e.tracks)){const Y=new Error(`Asset "${h}" SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(G)}')`),X={fatal:!0,type:I.OTHER_ERROR,details:A.INTERSTITIAL_ASSET_ITEM_ERROR,error:Y},fe=s.findAssetIndex(a);this.handleAssetItemError(X,s,_,fe,Y.message);return}}this.transferMediaTo(e,t)}handleAssetItemError(e,t,r,i,s){if(e.details===A.BUFFER_STALLED_ERROR)return;const a=t.assetList[i]||null;let h=null;if(a){const R=this.getAssetPlayerQueueIndex(a.identifier);h=this.playerQueue[R]||null}const _=this.schedule.items,g=c({},e,{fatal:!1,errorAction:Mr(!0),asset:a,assetListIndex:i,event:t,schedule:_,scheduleIndex:r,player:h});if(this.warn(`Asset item error: ${e.error}`),this.hls.trigger(d.INTERSTITIAL_ASSET_ERROR,g),!e.fatal)return;const w=new Error(s);a&&(this.playingAsset!==a&&this.clearAssetPlayer(a.identifier,null),a.error=w),t.assetList.some(R=>!R.error)?t.appendInPlace&&(t.error=w):t.error=w,this.primaryFallback(t)}primaryFallback(e){const t=e.timelineStart,r=this.effectivePlayingItem;if(this.updateSchedule(),r){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${r?Qn(r):"<none>"} error: ${e.error}`),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t));let i=this.timelinePos;i===-1&&(i=this.hls.startPosition);const s=this.updateItem(r,i);if(this.itemsMatch(r,s))this.clearInterstitial(e,null);else{const a=this.schedule.findItemIndexAtTime(i);this.setSchedulePosition(a)}}else this.checkStart()}onAssetListLoaded(e,t){var r;const i=t.event,s=i.identifier,a=t.assetListResponse.ASSETS;if(!this.schedule.hasEvent(s))return;const h=i.timelineStart,_=i.duration;let g=0;a.forEach((X,fe)=>{const ce=parseFloat(X.DURATION);this.createAsset(i,fe,g,h+g,ce,X.URI),g+=ce}),i.duration=g,this.log(`Loaded asset-list with duration: ${g} (was: ${_}) ${i}`);const w=this.waitingItem,R=(w==null?void 0:w.event.identifier)===s;this.updateSchedule();const G=(r=this.bufferingItem)==null?void 0:r.event;if(R){var Y;const X=this.schedule.findEventIndex(s),fe=(Y=this.schedule.items)==null?void 0:Y[X];if(fe){if(!this.playingItem&&this.timelinePos>fe.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==X){i.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${i}`),this.primaryFallback(i);return}this.setBufferingItem(fe)}this.setSchedulePosition(X)}else if((G==null?void 0:G.identifier)===s&&G.appendInPlace){const X=i.assetList[0],fe=this.getAssetPlayer(X.identifier),ce=this.primaryMedia;X&&fe&&ce&&this.bufferAssetPlayer(fe,ce)}}onError(e,t){switch(t.details){case A.ASSET_LIST_PARSING_ERROR:case A.ASSET_LIST_LOAD_ERROR:case A.ASSET_LIST_LOAD_TIMEOUT:{const r=t.interstitial;r&&this.primaryFallback(r);break}case A.BUFFER_STALLED_ERROR:{this.onTimeupdate(),this.checkBuffer(!0);break}}}}const gl=500;class Yu extends bs{constructor(e,t,r){super(e,t,r,"subtitle-stream-controller",b.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(d.LEVEL_LOADED,this.onLevelLoaded,this),e.on(d.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(d.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(d.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(d.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(d.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(d.LEVEL_LOADED,this.onLevelLoaded,this),e.off(d.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(d.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(d.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(d.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(d.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=ft.IDLE,this.setInterval(gl),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:r,success:i}=t;if(de(r)&&(this.fragPrevious=r),this.state=ft.IDLE,!i)return;const s=this.tracksBuffered[this.currentTrackId];if(!s)return;let a;const h=r.start;for(let g=0;g<s.length;g++)if(h>=s[g].start&&h<=s[g].end){a=s[g];break}const _=r.start+r.duration;a?a.end=_:(a={start:h,end:_},s.push(a)),this.fragmentTracker.fragBuffered(r),this.fragBufferedComplete(r,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:r,endOffset:i}=t;if(r===0&&i!==Number.POSITIVE_INFINITY){const s=i-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(r,s,b.SUBTITLE)}}onError(e,t){const r=t.frag;(r==null?void 0:r.type)===b.SUBTITLE&&(t.details===A.FRAG_GAP&&this.fragmentTracker.fragBuffered(r,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==ft.STOPPED&&(this.state=ft.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&Qo(this.levels,t)){this.levels=t.map(r=>new Ri(r));return}this.tracksBuffered=[],this.levels=t.map(r=>{const i=new Ri(r);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,b.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var r;if(this.currentTrackId=t.id,!((r=this.levels)!=null&&r.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.state!==ft.STOPPED&&this.setInterval(gl)}onSubtitleTrackLoaded(e,t){var r;const{currentTrackId:i,levels:s}=this,{details:a,id:h}=t;if(!s){this.warn(`Subtitle tracks were reset while loading level ${h}`);return}const _=s[h];if(h>=s.length||!_)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 g=0;if(a.live||(r=_.details)!=null&&r.live){const R=this.mainDetails;if(a.deltaUpdateFailed||!R)return;const G=R.fragments[0];if(!_.details)a.hasProgramDateTime&&R.hasProgramDateTime?(Vi(a,R),g=a.fragmentStart):G&&(g=G.start,zs(a,g));else{var w;g=this.alignPlaylists(a,_.details,(w=this.levelLastLoaded)==null?void 0:w.details),g===0&&G&&(g=G.start,zs(a,g))}}_.details=a,this.levelLastLoaded=_,h===i&&(this.hls.trigger(d.SUBTITLE_TRACK_UPDATED,{details:a,id:h,groupId:t.groupId}),this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===ft.IDLE&&(hr(null,a.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),_.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:r}=e,i=t.decryptdata,s=this.hls;if(!this.fragContextChanged(t)&&r&&r.byteLength>0&&i!=null&&i.key&&i.iv&&li(i.method)){const a=performance.now();this.decrypter.decrypt(new Uint8Array(r),i.key.buffer,i.iv.buffer,ei(i.method)).catch(h=>{throw s.trigger(d.ERROR,{type:I.MEDIA_ERROR,details:A.FRAG_DECRYPT_ERROR,fatal:!1,error:h,reason:h.message,frag:t}),h}).then(h=>{const _=performance.now();s.trigger(d.FRAG_DECRYPTED,{frag:t,payload:h,stats:{tstart:a,tdecrypt:_}})}).catch(h=>{this.warn(`${h.name}: ${h.message}`),this.state=ft.IDLE})}}doTick(){if(!this.media){this.state=ft.IDLE;return}if(this.state===ft.IDLE){const{currentTrackId:e,levels:t}=this,r=t==null?void 0:t[e];if(!r||!t.length||!r.details||this.waitForLive(r))return;const{config:i}=this,s=this.getLoadPosition(),a=tr.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],s,i.maxBufferHole),{end:h,len:_}=a,g=r.details,w=this.hls.maxBufferLength+g.levelTargetDuration;if(_>w)return;const R=g.fragments,G=R.length,Y=g.edge;let X=null;const fe=this.fragPrevious;if(h<Y){const Re=i.maxFragLookUpTolerance,Te=h>Y-Re?0:Re;X=hr(fe,R,Math.max(R[0].start,h),Te),!X&&fe&&fe.start<R[0].start&&(X=R[0])}else X=R[G-1];if(X=this.filterReplacedPrimary(X,r.details),!X)return;const ce=X.sn-g.startSN,Ee=R[ce-1];if(Ee&&Ee.cc===X.cc&&this.fragmentTracker.getState(Ee)===Fr.NOT_LOADED&&(X=Ee),this.fragmentTracker.getState(X)===Fr.NOT_LOADED){const Re=this.mapToInitFragWhenRequired(X);Re&&this.loadFragment(Re,r,h)}}}loadFragment(e,t,r){de(e)?super.loadFragment(e,t,r):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Zu(this.tracksBuffered[this.currentTrackId]||[])}}class Zu{constructor(e){this.buffered=void 0;const t=(r,i,s)=>{if(i=i>>>0,i>s-1)throw new DOMException(`Failed to execute '${r}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${s})`);return e[i][r]};this.buffered={get length(){return e.length},end(r){return t("end",r,e.length)},start(r){return t("start",r,e.length)}}}}const Xu={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},_l=o=>String.fromCharCode(Xu[o]||o),yn=15,jn=100,Qu={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Ju={17:2,18:4,21:6,22:8,23:10,19:13,20:15},ec={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},tc={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 ic{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const r=typeof t=="function"?t():t;z.log(`${this.time} [${e}] ${r}`)}}}const cs=function(e){const t=[];for(let r=0;r<e.length;r++)t.push(e[r].toString(16));return t};class vl{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 r=0;r<t.length;r++){const i=t[r];e.hasOwnProperty(i)&&(this[i]=e[i])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class nc{constructor(){this.uchar=" ",this.penState=new vl}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 sc{constructor(e){this.chars=[],this.pos=0,this.currPenState=new vl,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<jn;t++)this.chars.push(new nc);this.logger=e}equals(e){for(let t=0;t<jn;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<jn;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<jn;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>jn&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=jn)}moveCursor(e){const t=this.pos+e;if(e>1)for(let r=this.pos+1;r<t+1;r++)this.chars[r].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=_l(e);if(this.pos>=jn){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<jn;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 r=0;r<jn;r++){const i=this.chars[r].uchar;i!==" "&&(t=!1),e.push(i)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class Bo{constructor(e){this.rows=[],this.currRow=yn-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<yn;t++)this.rows.push(new sc(e));this.logger=e}reset(){for(let e=0;e<yn;e++)this.rows[e].clear();this.currRow=yn-1}equals(e){let t=!0;for(let r=0;r<yn;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t}copy(e){for(let t=0;t<yn;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<yn;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 = "+sr(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<yn;h++)this.rows[h].clear();const s=this.currRow+1-this.nrRollUpRows,a=this.lastOutputScreen;if(a){const h=a.rows[s].cueStartTime,_=this.logger.time;if(h!==null&&_!==null&&h<_)for(let g=0;g<this.nrRollUpRows;g++)this.rows[t-this.nrRollUpRows+g+1].copy(a.rows[s+g])}}this.currRow=t;const r=this.rows[this.currRow];if(e.indent!==null){const s=e.indent,a=Math.max(s-1,0);r.setCursor(e.indent),e.color=r.chars[a].penState.foreground}const i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+sr(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 r="",i=-1;for(let s=0;s<yn;s++){const a=this.rows[s].getTextString();a&&(i=s+1,e?t.push("Row "+i+": '"+a+"'"):t.push(a.trim()))}return t.length>0&&(e?r="["+t.join(" | ")+"]":r=t.join(`
|
|
|
`)),r}getTextAndFormat(){return this.rows}}class yl{constructor(e,t,r){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 Bo(r),this.nonDisplayedMemory=new Bo(r),this.lastOutputScreen=new Bo(r),this.currRollUpRow=this.displayedMemory.rows[yn-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[yn-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 r=0;r<e.length;r++)this.writeScreen.insertChar(e[r]);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 r=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[r]}this.logger.log(2,"MIDROW: "+sr(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 bl{constructor(e,t,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=oc(),this.logger=void 0;const i=this.logger=new ic;this.channels=[null,new yl(e,t,i),new yl(e+1,r,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let r=0;r<t.length;r+=2){const i=t[r]&127,s=t[r+1]&127;let a=!1,h=null;if(i===0&&s===0)continue;this.logger.log(3,()=>"["+cs([t[r],t[r+1]])+"] -> ("+cs([i,s])+")");const _=this.cmdHistory;if(i>=16&&i<=31){if(ac(i,s,_)){no(null,null,_),this.logger.log(3,()=>"Repeated command ("+cs([i,s])+") is dropped");continue}no(i,s,this.cmdHistory),a=this.parseCmd(i,s),a||(a=this.parseMidrow(i,s)),a||(a=this.parsePAC(i,s)),a||(a=this.parseBackgroundAttributes(i,s))}else no(null,null,_);if(!a&&(h=this.parseChars(i,s),h)){const w=this.currentChannel;w&&w>0?this.channels[w].insertChars(h):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!a&&!h&&this.logger.log(2,()=>"Couldn't parse cleaned data "+cs([i,s])+" orig: "+cs([t[r],t[r+1]]))}}parseCmd(e,t){const r=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(r||i))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 r=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?r=1:r=2,r!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[r];return i?(i.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+cs([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let r;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,s=(e===16||e===24)&&t>=64&&t<=95;if(!(i||s))return!1;const a=e<=23?1:2;t>=64&&t<=95?r=a===1?Qu[e]:ec[e]:r=a===1?Ju[e]:tc[e];const h=this.channels[a];return h?(h.setPAC(this.interpretPAC(r,t)),this.currentChannel=a,!0):!1}interpretPAC(e,t){let r;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?r=t-96:r=t-64,i.underline=(r&1)===1,r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((r-16)/2)*4,i}parseChars(e,t){let r,i=null,s=null;if(e>=25?(r=2,s=e-8):(r=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 '"+_l(a)+"' in channel "+r),i=[a]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+cs(i).join(",")),i}parseBackgroundAttributes(e,t){const r=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(r||i))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()}no(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const r=this.channels[t];r&&r.cueSplitAtTime(e)}}}function no(o,e,t){t.a=o,t.b=e}function ac(o,e,t){return t.a===o&&t.b===e}function oc(){return{a:null,b:null}}var No=function(){if(en!=null&&en.VTTCue)return self.VTTCue;const o=["","lr","rl"],e=["start","middle","end","left","right"];function t(h,_){if(typeof _!="string"||!Array.isArray(h))return!1;const g=_.toLowerCase();return~h.indexOf(g)?g:!1}function r(h){return t(o,h)}function i(h){return t(e,h)}function s(h,..._){let g=1;for(;g<arguments.length;g++){const w=arguments[g];for(const R in w)h[R]=w[R]}return h}function a(h,_,g){const w=this,R={enumerable:!0};w.hasBeenReset=!1;let G="",Y=!1,X=h,fe=_,ce=g,Ee=null,Re="",Te=!0,Ge="auto",Ke="start",ct=50,qe="middle",it=50,ht="middle";Object.defineProperty(w,"id",s({},R,{get:function(){return G},set:function(Xe){G=""+Xe}})),Object.defineProperty(w,"pauseOnExit",s({},R,{get:function(){return Y},set:function(Xe){Y=!!Xe}})),Object.defineProperty(w,"startTime",s({},R,{get:function(){return X},set:function(Xe){if(typeof Xe!="number")throw new TypeError("Start time must be set to a number.");X=Xe,this.hasBeenReset=!0}})),Object.defineProperty(w,"endTime",s({},R,{get:function(){return fe},set:function(Xe){if(typeof Xe!="number")throw new TypeError("End time must be set to a number.");fe=Xe,this.hasBeenReset=!0}})),Object.defineProperty(w,"text",s({},R,{get:function(){return ce},set:function(Xe){ce=""+Xe,this.hasBeenReset=!0}})),Object.defineProperty(w,"region",s({},R,{get:function(){return Ee},set:function(Xe){Ee=Xe,this.hasBeenReset=!0}})),Object.defineProperty(w,"vertical",s({},R,{get:function(){return Re},set:function(Xe){const St=r(Xe);if(St===!1)throw new SyntaxError("An invalid or illegal string was specified.");Re=St,this.hasBeenReset=!0}})),Object.defineProperty(w,"snapToLines",s({},R,{get:function(){return Te},set:function(Xe){Te=!!Xe,this.hasBeenReset=!0}})),Object.defineProperty(w,"line",s({},R,{get:function(){return Ge},set:function(Xe){if(typeof Xe!="number"&&Xe!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");Ge=Xe,this.hasBeenReset=!0}})),Object.defineProperty(w,"lineAlign",s({},R,{get:function(){return Ke},set:function(Xe){const St=i(Xe);if(!St)throw new SyntaxError("An invalid or illegal string was specified.");Ke=St,this.hasBeenReset=!0}})),Object.defineProperty(w,"position",s({},R,{get:function(){return ct},set:function(Xe){if(Xe<0||Xe>100)throw new Error("Position must be between 0 and 100.");ct=Xe,this.hasBeenReset=!0}})),Object.defineProperty(w,"positionAlign",s({},R,{get:function(){return qe},set:function(Xe){const St=i(Xe);if(!St)throw new SyntaxError("An invalid or illegal string was specified.");qe=St,this.hasBeenReset=!0}})),Object.defineProperty(w,"size",s({},R,{get:function(){return it},set:function(Xe){if(Xe<0||Xe>100)throw new Error("Size must be between 0 and 100.");it=Xe,this.hasBeenReset=!0}})),Object.defineProperty(w,"align",s({},R,{get:function(){return ht},set:function(Xe){const St=i(Xe);if(!St)throw new SyntaxError("An invalid or illegal string was specified.");ht=St,this.hasBeenReset=!0}})),w.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}();class lc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Sl(o){function e(r,i,s,a){return(r|0)*3600+(i|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 uc{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,r){for(let i=0;i<r.length;++i)if(t===r[i]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const r=parseFloat(t);if(r>=0&&r<=100)return this.set(e,r),!0}return!1}}function El(o,e,t,r){const i=r?o.split(r):[o];for(const s in i){if(typeof i[s]!="string")continue;const a=i[s].split(t);if(a.length!==2)continue;const h=a[0],_=a[1];e(h,_)}}const Uo=new No(0,0,""),so=Uo.align==="middle"?"middle":"center";function cc(o,e,t){const r=o;function i(){const h=Sl(o);if(h===null)throw new Error("Malformed timestamp: "+r);return o=o.replace(/^[^\sa-zA-Z-]+/,""),h}function s(h,_){const g=new uc;El(h,function(G,Y){let X;switch(G){case"region":for(let fe=t.length-1;fe>=0;fe--)if(t[fe].id===Y){g.set(G,t[fe].region);break}break;case"vertical":g.alt(G,Y,["rl","lr"]);break;case"line":X=Y.split(","),g.integer(G,X[0]),g.percent(G,X[0])&&g.set("snapToLines",!1),g.alt(G,X[0],["auto"]),X.length===2&&g.alt("lineAlign",X[1],["start",so,"end"]);break;case"position":X=Y.split(","),g.percent(G,X[0]),X.length===2&&g.alt("positionAlign",X[1],["start",so,"end","line-left","line-right","auto"]);break;case"size":g.percent(G,Y);break;case"align":g.alt(G,Y,["start",so,"end","left","right"]);break}},/:/,/\s/),_.region=g.get("region",null),_.vertical=g.get("vertical","");let w=g.get("line","auto");w==="auto"&&Uo.line===-1&&(w=-1),_.line=w,_.lineAlign=g.get("lineAlign","start"),_.snapToLines=g.get("snapToLines",!0),_.size=g.get("size",100),_.align=g.get("align",so);let R=g.get("position","auto");R==="auto"&&Uo.position===50&&(R=_.align==="start"||_.align==="left"?0:_.align==="end"||_.align==="right"?100:50),_.position=R}function a(){o=o.replace(/^\s+/,"")}if(a(),e.startTime=i(),a(),o.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+r);o=o.slice(3),a(),e.endTime=i(),a(),s(o,e)}function xl(o){return o.replace(/<br(?: \/)?>/gi,`
|
|
|
`)}class hc{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new lc,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 r(){let s=t.buffer,a=0;for(s=xl(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 i(s){El(s,function(a,h){},/:/)}try{let s="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;s=r();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=r(),t.state){case"HEADER":/:/.test(s)?i(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 No(0,0,""),t.state="CUE",s.indexOf("-->")===-1){t.cue.id=s;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{cc(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 fc=/\r\n|\n\r|\n|\r/g,$o=function(e,t,r=0){return e.slice(r,r+t.length)===t},dc=function(e){let t=parseInt(e.slice(-3));const r=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),s=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!N(t)||!N(r)||!N(i)||!N(s))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*r,t+=60*1e3*i,t+=60*60*1e3*s,t};function zo(o,e,t){return da(o.toString())+da(e.toString())+da(t)}const pc=function(e,t,r){let i=e[t],s=e[i.prevCC];if(!s||!s.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(a=s)!=null&&a.new;){var a;e.ccOffset+=i.start-s.start,i.new=!1,i=s,s=e[i.prevCC]}e.presentationOffset=r};function mc(o,e,t,r,i,s,a){const h=new hc,_=_e(new Uint8Array(o)).trim().replace(fc,`
|
|
|
`).split(`
|
|
|
`),g=[],w=e?Nr(e.baseTime,e.timescale):0;let R="00:00.000",G=0,Y=0,X,fe=!0;h.oncue=function(ce){const Ee=t[r];let Re=t.ccOffset;const Te=(G-w)/9e4;if(Ee!=null&&Ee.new&&(Y!==void 0?Re=t.ccOffset=Ee.start:pc(t,r,Te)),Te){if(!e){X=new Error("Missing initPTS for VTT MPEGTS");return}Re=Te-t.presentationOffset}const Ge=ce.endTime-ce.startTime,Ke=ni((ce.startTime+Re-Y)*9e4,i*9e4)/9e4;ce.startTime=Math.max(Ke,0),ce.endTime=Math.max(Ke+Ge,0);const ct=ce.text.trim();ce.text=decodeURIComponent(encodeURIComponent(ct)),ce.id||(ce.id=zo(ce.startTime,ce.endTime,ct)),ce.endTime>0&&g.push(ce)},h.onparsingerror=function(ce){X=ce},h.onflush=function(){if(X){a(X);return}s(g)},_.forEach(ce=>{if(fe)if($o(ce,"X-TIMESTAMP-MAP=")){fe=!1,ce.slice(16).split(",").forEach(Ee=>{$o(Ee,"LOCAL:")?R=Ee.slice(6):$o(Ee,"MPEGTS:")&&(G=parseInt(Ee.slice(7)))});try{Y=dc(R)/1e3}catch(Ee){X=Ee}return}else ce===""&&(fe=!1);h.parse(ce+`
|
|
|
`)}),h.flush()}const Ho="stpp.ttml.im1t",wl=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Al=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,gc={left:"start",center:"center",right:"end",start:"start",end:"end"};function Cl(o,e,t,r){const i=ze(new Uint8Array(o),["mdat"]);if(i.length===0){r(new Error("Could not parse IMSC1 mdat"));return}const s=i.map(h=>_e(h)),a=dr(e.baseTime,1,e.timescale);try{s.forEach(h=>t(_c(h,a)))}catch(h){r(h)}}function _c(o,e){const i=new DOMParser().parseFromString(o,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const s={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},a=Object.keys(s).reduce((R,G)=>(R[G]=i.getAttribute(`ttp:${G}`)||s[G],R),{}),h=i.getAttribute("xml:space")!=="preserve",_=Tl(jo(i,"styling","style")),g=Tl(jo(i,"layout","region")),w=jo(i,"body","[begin]");return[].map.call(w,R=>{const G=Dl(R,h);if(!G||!R.hasAttribute("begin"))return null;const Y=Go(R.getAttribute("begin"),a),X=Go(R.getAttribute("dur"),a);let fe=Go(R.getAttribute("end"),a);if(Y===null)throw Ll(R);if(fe===null){if(X===null)throw Ll(R);fe=Y+X}const ce=new No(Y-e,fe-e,G);ce.id=zo(ce.startTime,ce.endTime,ce.text);const Ee=g[R.getAttribute("region")],Re=_[R.getAttribute("style")],Te=vc(Ee,Re,_),{textAlign:Ge}=Te;if(Ge){const Ke=gc[Ge];Ke&&(ce.lineAlign=Ke),ce.align=Ge}return c(ce,Te),ce}).filter(R=>R!==null)}function jo(o,e,t){const r=o.getElementsByTagName(e)[0];return r?[].slice.call(r.querySelectorAll(t)):[]}function Tl(o){return o.reduce((e,t)=>{const r=t.getAttribute("xml:id");return r&&(e[r]=t),e},{})}function Dl(o,e){return[].slice.call(o.childNodes).reduce((t,r,i)=>{var s;return r.nodeName==="br"&&i?t+`
|
|
|
`:(s=r.childNodes)!=null&&s.length?Dl(r,e):e?t+r.textContent.trim().replace(/\s+/g," "):t+r.textContent},"")}function vc(o,e,t){const r="http://www.w3.org/ns/ttml#styling";let i=null;const s=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],a=o!=null&&o.hasAttribute("style")?o.getAttribute("style"):null;return a&&t.hasOwnProperty(a)&&(i=t[a]),s.reduce((h,_)=>{const g=Wo(e,r,_)||Wo(o,r,_)||Wo(i,r,_);return g&&(h[_]=g),h},{})}function Wo(o,e,t){return o&&o.hasAttributeNS(e,t)?o.getAttributeNS(e,t):null}function Ll(o){return new Error(`Could not parse ttml timestamp ${o}`)}function Go(o,e){if(!o)return null;let t=Sl(o);return t===null&&(wl.test(o)?t=yc(o,e):Al.test(o)&&(t=bc(o,e))),t}function yc(o,e){const t=wl.exec(o),r=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+r/e.frameRate}function bc(o,e){const t=Al.exec(o),r=Number(t[1]);switch(t[2]){case"h":return r*3600;case"m":return r*60;case"ms":return r*1e3;case"f":return r/e.frameRate;case"t":return r/e.tickRate}return r}class ao{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,r){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=r,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=Il(),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(d.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(d.MANIFEST_LOADING,this.onManifestLoading,this),e.on(d.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(d.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(d.FRAG_LOADING,this.onFragLoading,this),e.on(d.FRAG_LOADED,this.onFragLoaded,this),e.on(d.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(d.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(d.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(d.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(d.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(d.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(d.MANIFEST_LOADING,this.onManifestLoading,this),e.off(d.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(d.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(d.FRAG_LOADING,this.onFragLoading,this),e.off(d.FRAG_LOADED,this.onFragLoaded,this),e.off(d.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(d.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(d.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(d.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(d.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new ao(this,"textTrack1"),t=new ao(this,"textTrack2"),r=new ao(this,"textTrack3"),i=new ao(this,"textTrack4");this.cea608Parser1=new bl(1,e,t),this.cea608Parser2=new bl(3,r,i)}addCues(e,t,r,i,s){let a=!1;for(let h=s.length;h--;){const _=s[h],g=Ec(_[0],_[1],t,r);if(g>=0&&(_[0]=Math.min(_[0],t),_[1]=Math.max(_[1],r),a=!0,g/(r-t)>.5))return}if(a||s.push([t,r]),this.config.renderTextTracksNatively){const h=this.captionsTracks[e];this.Cues.newCue(h,t,r,i)}else{const h=this.Cues.newCue(null,t,r,i);this.hls.trigger(d.CUES_PARSED,{type:"captions",cues:h,track:e})}}onInitPtsFound(e,{frag:t,id:r,initPTS:i,timescale:s}){const{unparsedVttFrags:a}=this;r===b.MAIN&&(this.initPTS[t.cc]={baseTime:i,timescale:s}),a.length&&(this.unparsedVttFrags=[],a.forEach(h=>{this.onFragLoaded(d.FRAG_LOADED,h)}))}getExistingTrack(e,t){const{media:r}=this;if(r)for(let i=0;i<r.textTracks.length;i++){const s=r.textTracks[i];if(kl(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:r,media:i}=this,{label:s,languageCode:a}=t[e],h=this.getExistingTrack(s,a);if(h)r[e]=h,ks(r[e]),hl(r[e],i);else{const _=this.createTextTrack("captions",s,a);_&&(_[e]=!0,r[e]=_)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const r=t.label,i={_id:e,label:r,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(d.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(e,t,r){const i=this.media;if(i)return i.addTextTrack(e,t,r)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const r=!!t.transferMedia;if(this.media=null,r)return;const{captionsTracks:i}=this;Object.keys(i).forEach(s=>{ks(i[s]),delete i[s]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Il(),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 r=0;r<t.length;r++)ks(t[r])}onSubtitleTracksUpdated(e,t){const r=t.subtitleTracks||[],i=r.some(s=>s.textCodec===Ho);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(Qo(this.tracks,r)){this.tracks=r;return}if(this.textTracks=[],this.tracks=r,this.config.renderTextTracksNatively){const a=this.media,h=a?ro(a.textTracks):null;if(this.tracks.forEach((_,g)=>{let w;if(h){let R=null;for(let G=0;G<h.length;G++)if(h[G]&&kl(h[G],_)){R=h[G],h[G]=null;break}R&&(w=R)}if(w)ks(w);else{const R=Rl(_);w=this.createTextTrack(R,_.name,_.lang),w&&(w.mode="disabled")}w&&this.textTracks.push(w)}),h!=null&&h.length){const _=h.filter(g=>g!==null).map(g=>g.label);_.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${_.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(d.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:a})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(r=>{const i=/(?:CC|SERVICE)([1-4])/.exec(r.instreamId);if(!i)return;const s=`textTrack${i[1]}`,a=this.captionsProperties[s];a&&(a.label=r.name,r.lang&&(a.languageCode=r.lang),a.media=r)})}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===b.MAIN){var r,i;const{cea608Parser1:s,cea608Parser2:a,lastSn:h}=this,{cc:_,sn:g}=t.frag,w=(r=(i=t.part)==null?void 0:i.index)!=null?r:-1;s&&a&&(g!==h+1||g===h&&w!==this.lastPartIndex+1||_!==this.lastCc)&&(s.reset(),a.reset()),this.lastCc=_,this.lastSn=g,this.lastPartIndex=w}}onFragLoaded(e,t){const{frag:r,payload:i}=t;if(r.type===b.SUBTITLE)if(i.byteLength){const s=r.decryptdata,a="stats"in t;if(s==null||!s.encrypted||a){const h=this.tracks[r.level],_=this.vttCCs;_[r.cc]||(_[r.cc]={start:r.start,prevCC:this.prevCC,new:!0},this.prevCC=r.cc),h&&h.textCodec===Ho?this._parseIMSC1(r,i):this._parseVTTs(t)}}else this.hls.trigger(d.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const r=this.hls;Cl(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),r.trigger(d.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{r.logger.log(`Failed to parse IMSC1: ${i}`),r.trigger(d.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:r,payload:i}=e,{initPTS:s,unparsedVttFrags:a}=this,h=s.length-1;if(!s[r.cc]&&h===-1){a.push(e);return}const _=this.hls,g=(t=r.initSegment)!=null&&t.data?gt(r.initSegment.data,new Uint8Array(i)).buffer:i;mc(g,this.initPTS[r.cc],this.vttCCs,r.cc,r.start,w=>{this._appendCues(w,r.level),_.trigger(d.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},w=>{const R=w.message==="Missing initPTS for VTT MPEGTS";R?a.push(e):this._fallbackToIMSC1(r,i),_.logger.log(`Failed to parse VTT cue: ${w}`),!(R&&h>r.cc)&&_.trigger(d.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:w})})}_fallbackToIMSC1(e,t){const r=this.tracks[e.level];r.textCodec||Cl(t,this.initPTS[e.cc],()=>{r.textCodec=Ho,this._parseIMSC1(e,t)},()=>{r.textCodec="wvtt"})}_appendCues(e,t){const r=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(s=>fl(i,s))}else{const i=this.tracks[t];if(!i)return;const s=i.default?"default":"subtitles"+t;r.trigger(d.CUES_PARSED,{type:"subtitles",cues:e,track:s})}}onFragDecrypted(e,t){const{frag:r}=t;r.type===b.SUBTITLE&&this.onFragLoaded(d.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:r,samples:i}=t;if(!(r.type===b.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let s=0;s<i.length;s++){const a=i[s].bytes;if(a){this.cea608Parser1||this.initCea608Parsers();const h=this.extractCea608Data(a);this.cea608Parser1.addData(i[s].pts,h[0]),this.cea608Parser2.addData(i[s].pts,h[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:r,endOffsetSubtitles:i,type:s}){const{media:a}=this;if(!(!a||a.currentTime<r)){if(!s||s==="video"){const{captionsTracks:h}=this;Object.keys(h).forEach(_=>Po(h[_],t,r))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:h}=this;Object.keys(h).forEach(_=>Po(h[_],t,i))}}}extractCea608Data(e){const t=[[],[]],r=e[0]&31;let i=2;for(let s=0;s<r;s++){const a=e[i++],h=127&e[i++],_=127&e[i++];if(h===0&&_===0)continue;if((4&a)!==0){const w=3&a;(w===0||w===1)&&(t[w].push(h),t[w].push(_))}}return t}}function Rl(o){return o.characteristics&&/transcribes-spoken-dialog/gi.test(o.characteristics)&&/describes-music-and-sound/gi.test(o.characteristics)?"captions":"subtitles"}function kl(o,e){return!!o&&o.kind===Rl(e)&&Do(e,o)}function Ec(o,e,t,r){return Math.min(e,r)-Math.max(o,t)}function Il(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const xc=/\s/,wc={newCue(o,e,t,r){const i=[];let s,a,h,_,g;const w=self.VTTCue||self.TextTrackCue;for(let G=0;G<r.rows.length;G++)if(s=r.rows[G],h=!0,_=0,g="",!s.isEmpty()){var R;for(let fe=0;fe<s.chars.length;fe++)xc.test(s.chars[fe].uchar)&&h?_++:(g+=s.chars[fe].uchar,h=!1);s.cueStartTime=e,e===t&&(t+=1e-4),_>=16?_--:_++;const Y=xl(g.trim()),X=zo(e,t,Y);o!=null&&(R=o.cues)!=null&&R.getCueById(X)||(a=new w(e,t,Y),a.id=X,a.line=G+1,a.align="left",a.position=10+Math.min(80,Math.floor(_*8/32)*10),i.push(a))}return o&&i.length&&(i.sort((G,Y)=>G.line==="auto"||Y.line==="auto"?0:G.line>8&&Y.line>8?Y.line-G.line:G.line-Y.line),i.forEach(G=>fl(o,G))),i}};function Ac(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(o){}return!1}const Cc=/(\d+)-(\d+)\/(\d+)/;class Ol{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||Rc,this.controller=new self.AbortController,this.stats=new M}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,r){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const s=Tc(e,this.controller.signal),a=e.responseType==="arraybuffer",h=a?"byteLength":"length",{maxTimeToFirstByteMs:_,maxLoadTimeMs:g}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=r,this.request=this.fetchSetup(e,s),self.clearTimeout(this.requestTimeout),t.timeout=_&&N(_)?_:g,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},t.timeout),(us(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(R=>{var G;this.response=this.loader=R;const Y=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=g,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},g-(Y-i.loading.start)),!R.ok){const{status:fe,statusText:ce}=R;throw new kc(ce||"fetch, bad network response",fe,R)}i.loading.first=Y,i.total=Lc(R.headers)||i.total;const X=(G=this.callbacks)==null?void 0:G.onProgress;return X&&N(t.highWaterMark)?this.loadProgressively(R,i,e,t.highWaterMark,X):a?R.arrayBuffer():e.responseType==="json"?R.json():R.text()}).then(R=>{var G,Y;const X=this.response;if(!X)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const fe=R[h];fe&&(i.loaded=i.total=fe);const ce={url:X.url,data:R,code:X.status},Ee=(G=this.callbacks)==null?void 0:G.onProgress;Ee&&!N(t.highWaterMark)&&Ee(i,e,R,X),(Y=this.callbacks)==null||Y.onSuccess(ce,i,e,X)}).catch(R=>{var G;if(self.clearTimeout(this.requestTimeout),i.aborted)return;const Y=R&&R.code||0,X=R?R.message:null;(G=this.callbacks)==null||G.onError({code:Y,text:X},e,R?R.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,r,i=0,s){const a=new js,h=e.body.getReader(),_=()=>h.read().then(g=>{if(g.done)return a.dataLength&&s(t,r,a.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const w=g.value,R=w.length;return t.loaded+=R,R<i||a.dataLength?(a.push(w),a.dataLength>=i&&s(t,r,a.flush().buffer,e)):s(t,r,w.buffer,e),_()}).catch(()=>Promise.reject());return _()}}function Tc(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 Dc(o){const e=Cc.exec(o);if(e)return parseInt(e[2])-parseInt(e[1])+1}function Lc(o){const e=o.get("Content-Range");if(e){const r=Dc(e);if(N(r))return r}const t=o.get("Content-Length");if(t)return parseInt(t)}function Rc(o,e){return new self.Request(o.url,e)}class kc extends Error{constructor(e,t,r){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=r}}const Ic=/^age:\s*[\d.]+\s*$/im;class Pl{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 M,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,r){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=r,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const r=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const s=this.xhrSetup;s?Promise.resolve().then(()=>{if(!(this.loader!==r||this.stats.aborted))return s(r,t.url)}).catch(a=>{if(!(this.loader!==r||this.stats.aborted))return r.open("GET",t.url,!0),s(r,t.url)}).then(()=>{this.loader!==r||this.stats.aborted||this.openAndSendXhr(r,t,e)}).catch(a=>{var h;(h=this.callbacks)==null||h.onError({code:r.status,text:a.message},t,r,i)}):this.openAndSendXhr(r,t,e)}openAndSendXhr(e,t,r){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:s,maxLoadTimeMs:a}=r.loadPolicy;if(i)for(const h in i)e.setRequestHeader(h,i[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),r.timeout=s&&N(s)?s:a,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:r}=this;if(!e||!t)return;const i=t.readyState,s=this.config;if(!r.aborted&&i>=2&&(r.loading.first===0&&(r.loading.first=Math.max(self.performance.now(),r.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-(r.loading.first-r.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const g=t.status,w=t.responseType==="text"?t.responseText:null;if(g>=200&&g<300){const X=w!=null?w:t.response;if(X!=null){var a,h;r.loading.end=Math.max(self.performance.now(),r.loading.first);const fe=t.responseType==="arraybuffer"?X.byteLength:X.length;r.loaded=r.total=fe,r.bwEstimate=r.total*8e3/(r.loading.end-r.loading.first);const ce=(a=this.callbacks)==null?void 0:a.onProgress;ce&&ce(r,e,X,t);const Ee={url:t.responseURL,data:X,code:g};(h=this.callbacks)==null||h.onSuccess(Ee,r,e,t);return}}const R=s.loadPolicy.errorRetry,G=r.retry,Y={url:e.url,data:void 0,code:g};if(Xi(R,G,!1,Y))this.retry(R);else{var _;z.error(`${g} while loading ${e.url}`),(_=this.callbacks)==null||_.onError({code:g,text:t.statusText},e,t,r)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Xi(e,t,!0))this.retry(e);else{var r;z.warn(`timeout while loading ${(r=this.context)==null?void 0:r.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:r}=this;this.retryDelay=mi(e,r.retry),r.retry++,z.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${r.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&&Ic.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},Pc=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,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:Pl,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:ci,bufferController:eu,capLevelController:Ro,errorController:rr,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:Zt,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,certLoadPolicy:{default: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:Yu,subtitleTrackController:zu,timelineController:Sc,audioStreamController:Ds,audioTrackController:Xl,emeController:Rs,cmcdController:Mu,contentSteeringController:Bu,interstitialsController:qu});function Mc(){return{cueHandler:wc,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function Fc(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 r=Ko(o),i=["manifest","level","frag"],s=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(a=>{const h=`${a==="level"?"playlist":a}LoadPolicy`,_=e[h]===void 0,g=[];s.forEach(w=>{const R=`${a}Loading${w}`,G=e[R];if(G!==void 0&&_){g.push(R);const Y=r[h].default;switch(e[h]={default:Y},w){case"TimeOut":Y.maxLoadTimeMs=G,Y.maxTimeToFirstByteMs=G;break;case"MaxRetry":Y.errorRetry.maxNumRetry=G,Y.timeoutRetry.maxNumRetry=G;break;case"RetryDelay":Y.errorRetry.retryDelayMs=G,Y.timeoutRetry.retryDelayMs=G;break;case"MaxRetryTimeout":Y.errorRetry.maxRetryDelayMs=G,Y.timeoutRetry.maxRetryDelayMs=G;break}}}),g.length&&t.warn(`hls.js config: "${g.join('", "')}" setting(s) are deprecated, use "${h}": ${sr(e[h])}`)}),u(u({},r),e)}function Ko(o){return o&&typeof o=="object"?Array.isArray(o)?o.map(Ko):Object.keys(o).reduce((e,t)=>(e[t]=Ko(o[t]),e),{}):o}function Bc(o,e){const t=o.loader;t!==Ol&&t!==Pl?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),o.progressive=!1):Ac()&&(o.loader=Ol,o.progressive=!0,o.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const oo=2,Nc=.1,Uc=.05,$c=100;class zc extends Ni{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 r;(r=this.media)!=null&&r.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var r;this.ended=((r=this.media)==null?void 0:r.currentTime)||1,this.hls.trigger(d.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(d.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(d.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(d.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(d.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($c),this.mediaSource=t.mediaSource;const r=this.media=t.media;Hn(r,"playing",this.onMediaPlaying),Hn(r,"waiting",this.onMediaWaiting),Hn(r,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:r}=this;r&&(kn(r,"playing",this.onMediaPlaying),kn(r,"waiting",this.onMediaWaiting),kn(r,"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 r,i;const s=(r=this.hls)==null?void 0:r.config;if(!s)return;const{media:a,stalled:h}=this;if(!a)return;const{seeking:_}=a,g=this.seeking&&!_,w=!this.seeking&&_,R=a.paused&&!_||a.ended||a.playbackRate===0;if(this.seeking=_,e!==t){t&&(this.ended=0),this.moved=!0,_||(this.nudgeRetry=0,s.nudgeOnVideoHole&&!R&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(w||g){g&&this.stallResolved(e);return}if(R){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&a.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(d.MEDIA_ENDED,{stalled:!1}));return}if(!tr.getBuffered(a).length){this.nudgeRetry=0;return}const G=tr.bufferInfo(a,e,0),Y=G.nextStart||0,X=this.fragmentTracker;if(_&&X&&this.hls){const ct=Ml(this.hls.inFlightFragments,e),qe=G.len>oo,it=!Y||ct||Y-e>oo&&!X.getPartialFragment(e);if(qe||it)return;this.moved=!1}const fe=(i=this.hls)==null?void 0:i.latestLevelDetails;if(!this.moved&&this.stalled!==null&&X){if(!(G.len>0)&&!Y)return;const qe=Math.max(Y,G.start||0)-e,ht=!!(fe!=null&&fe.live)?fe.targetduration*2:oo,Xe=X.getPartialFragment(e);if(qe>0&&(qe<=ht||Xe)){a.paused||this._trySkipBufferHole(Xe);return}}const ce=s.detectStallWithCurrentTimeMs,Ee=self.performance.now(),Re=this.waiting;if(h===null){Re>0&&Ee-Re<ce?this.stalled=Re:this.stalled=Ee;return}const Te=Ee-h;if(!_&&(Te>=ce||Re)&&this.hls){var Ge;if(((Ge=this.mediaSource)==null?void 0:Ge.readyState)==="ended"&&!(fe!=null&&fe.live)&&Math.abs(e-((fe==null?void 0:fe.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(d.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(G),!this.media||!this.hls)return}const Ke=tr.bufferInfo(a,e,s.maxBufferHole);this._tryFixBufferStall(Ke,Te)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const r=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(r)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(d.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var r;const i=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(r=this.buffered.audio)!=null&&r.length&&i&&i.length>1&&e>i.end(0)){const s=tr.bufferedInfo(tr.timeRangesToArray(this.buffered.audio),e,0);if(s.len>1&&t>=s.start){const a=tr.timeRangesToArray(i),h=tr.bufferedInfo(a,t,0).bufferedIndex;if(h>-1&&h<a.length-1){const _=tr.bufferedInfo(a,e,0).bufferedIndex,g=a[h].end,w=a[h+1].start;if((_===-1||_>h)&&w-g<1&&e-g<2){const R=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${g} -> ${w} buffered index: ${_}`);this.warn(R.message),this.media.currentTime+=1e-6;const G=this.fragmentTracker.getPartialFragment(e)||void 0,Y=tr.bufferInfo(this.media,e,0);this.hls.trigger(d.ERROR,{type:I.MEDIA_ERROR,details:A.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:R,reason:R.message,frag:G,buffer:Y.len,bufferInfo:Y})}}}}}_tryFixBufferStall(e,t){var r,i;const{fragmentTracker:s,media:a}=this,h=(r=this.hls)==null?void 0:r.config;if(!a||!s||!h)return;const _=a.currentTime,g=(i=this.hls)==null?void 0:i.latestLevelDetails,w=s.getPartialFragment(_);if((w||g!=null&&g.live&&_<g.fragmentStart)&&(this._trySkipBufferHole(w)||!this.media))return;const R=e.buffered;(R&&R.length>1&&e.len>h.maxBufferHole||e.nextStart&&e.nextStart-_<h.maxBufferHole)&&(t>h.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}_reportStall(e){const{hls:t,media:r,stallReported:i,stalled:s}=this;if(!i&&s!==null&&r&&t){this.stallReported=!0;const a=new Error(`Playback stalling at @${r.currentTime} due to low buffer (${sr(e)})`);this.warn(a.message),t.trigger(d.ERROR,{type:I.MEDIA_ERROR,details:A.BUFFER_STALLED_ERROR,fatal:!1,error:a,buffer:e.len,bufferInfo:e,stalled:{start:s}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:r,media:i}=this,s=(t=this.hls)==null?void 0:t.config;if(!i||!r||!s)return 0;const a=i.currentTime,h=tr.bufferInfo(i,a,0),_=a<h.start?h.start:h.nextStart;if(_&&this.hls){const w=h.len<=s.maxBufferHole,R=h.len>0&&h.len<1&&i.readyState<3,G=_-a;if(G>0&&(w||R)){if(G>s.maxBufferHole){let X=!1;if(a===0){const fe=r.getAppendedFrag(0,b.MAIN);fe&&_<fe.end&&(X=!0)}if(!X){const fe=e||r.getAppendedFrag(a,b.MAIN);if(fe){var g;if(!((g=this.hls.loadLevelObj)!=null&&g.details)||Ml(this.hls.inFlightFragments,_))return 0;let Ee=!1,Re=fe.end;for(;Re<_;){const Te=r.getPartialFragment(Re);if(Te)Re+=Te.duration;else{Ee=!0;break}}if(Ee)return 0}}}const Y=Math.max(_+Uc,a+Nc);if(this.warn(`skipping hole, adjusting currentTime from ${a} to ${Y}`),this.moved=!0,i.currentTime=Y,!(e!=null&&e.gap)){const X=new Error(`fragment loaded with buffer holes, seeking from ${a} to ${Y}`);this.hls.trigger(d.ERROR,{type:I.MEDIA_ERROR,details:A.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:X,reason:X.message,frag:e||void 0,buffer:h.len,bufferInfo:h})}return Y}}return 0}_tryNudgeBuffer(e){const{hls:t,media:r,nudgeRetry:i}=this,s=t==null?void 0:t.config;if(!r||!s)return 0;const a=r.currentTime;if(this.nudgeRetry++,i<s.nudgeMaxRetry){const h=a+(i+1)*s.nudgeOffset,_=new Error(`Nudging 'currentTime' from ${a} to ${h}`);this.warn(_.message),r.currentTime=h,t.trigger(d.ERROR,{type:I.MEDIA_ERROR,details:A.BUFFER_NUDGE_ON_STALL,error:_,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(d.ERROR,{type:I.MEDIA_ERROR,details:A.BUFFER_STALLED_ERROR,error:h,fatal:!0,buffer:e.len,bufferInfo:e})}}}function Ml(o,e){const t=Fl(o.main);if(t&&t.start<=e)return t;const r=Fl(o.audio);return r&&r.start<=e?r:null}function Fl(o){if(!o)return null;switch(o.state){case ft.IDLE:case ft.STOPPED:case ft.ENDED:case ft.ERROR:return null}return o.frag}const Hc=.25;function Vo(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Bl(o,e,t,r,i){let s=new o(e,t,"");try{s.value=r,i&&(s.type=i)}catch(a){s=new o(e,t,sr(i?u({type:i},r):r))}return s}const lo=(()=>{const o=Vo();try{o&&new o(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function jc(o){return Uint8Array.from(o.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class Wc{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(d.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(d.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(d.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(d.MANIFEST_LOADING,this.onManifestLoading,this),e.on(d.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(d.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(d.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(d.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(d.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(d.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(d.MANIFEST_LOADING,this.onManifestLoading,this),e.off(d.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(d.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(d.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(d.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}onMediaAttaching(e,t){var r;this.media=t.media,((r=t.overrides)==null?void 0:r.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&&ks(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 r=e[t];if(r.kind==="metadata"&&r.label==="id3")return hl(r,this.media),r}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:r,enableID3MetadataCues:i}}}=this;if(!r&&!i)return;const{samples:s}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const a=Vo();if(a)for(let h=0;h<s.length;h++){const _=s[h].type;if(_===Se.emsg&&!r||!i)continue;const g=Qs(s[h].data);if(g){const w=s[h].pts;let R=w+s[h].duration;R>lo&&(R=lo),R-w<=0&&(R=w+Hc);for(let Y=0;Y<g.length;Y++){const X=g[Y];if(!Ka(X)){this.updateId3CueEnds(w,_);const fe=Bl(a,w,R,X,_);fe&&this.id3Track.addCue(fe)}}}}}updateId3CueEnds(e,t){var r;const i=(r=this.id3Track)==null?void 0:r.cues;if(i)for(let s=i.length;s--;){const a=i[s];a.type===t&&a.startTime<e&&a.endTime===lo&&(a.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:r,type:i}){const{id3Track:s,hls:a}=this;if(!a)return;const{config:{enableEmsgMetadataCues:h,enableID3MetadataCues:_}}=a;if(s&&(h||_)){let g;i==="audio"?g=w=>w.type===Se.audioId3&&_:i==="video"?g=w=>w.type===Se.emsg&&h:g=w=>w.type===Se.audioId3&&_||w.type===Se.emsg&&h,Po(s,t,r,g)}}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:r}=this,{dateRanges:i}=e,s=Object.keys(i);let a=this.dateRangeCuesAppended;if(r&&t){var h;if((h=r.cues)!=null&&h.length){const w=Object.keys(a).filter(R=>!s.includes(R));for(let R=w.length;R--;){const G=w[R],Y=a[G].cues;delete a[G],Object.keys(Y).forEach(X=>{try{const fe=Y[X];fe.removeEventListener("enter",this.onEventCueEnter),r.removeCue(fe)}catch(fe){}})}}else a=this.dateRangeCuesAppended={}}const _=e.fragments[e.fragments.length-1];if(s.length===0||!N(_==null?void 0:_.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const g=Vo();for(let w=0;w<s.length;w++){const R=s[w],G=i[R],Y=G.startTime,X=a[R],fe=(X==null?void 0:X.cues)||{};let ce=(X==null?void 0:X.durationKnown)||!1,Ee=lo;const{duration:Re,endDate:Te}=G;if(Te&&Re!==null)Ee=Y+Re,ce=!0;else if(G.endOnNext&&!ce){const Ke=s.reduce((ct,qe)=>{if(qe!==G.id){const it=i[qe];if(it.class===G.class&&it.startDate>G.startDate&&(!ct||G.startDate<ct.startDate))return it}return ct},null);Ke&&(Ee=Ke.startTime,ce=!0)}const Ge=Object.keys(G.attr);for(let Ke=0;Ke<Ge.length;Ke++){const ct=Ge[Ke];if(!ts(ct))continue;const qe=fe[ct];if(qe)ce&&!X.durationKnown?qe.endTime=Ee:Math.abs(qe.startTime-Y)>.01&&(qe.startTime=Y,qe.endTime=Ee);else if(g){let it=G.attr[ct];wt(ct)&&(it=jc(it));const Xe=Bl(g,Y,Ee,{key:ct,data:it},Se.dateRange);Xe&&(Xe.id=R,this.id3Track.addCue(Xe),fe[ct]=Xe,this.hls.config.interstitialsController&&(ct==="X-ASSET-LIST"||ct==="X-ASSET-URL")&&Xe.addEventListener("enter",this.onEventCueEnter))}}a[R]={cues:fe,dateRange:G,durationKnown:ce}}}}class Gc{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,r=this.levelDetails;if(!t||!r)return;this.currentTime=t.currentTime;const i=this.computeLatency();if(i===null)return;this._latency=i;const{lowLatencyMode:s,maxLiveSyncPlaybackRate:a}=this.config;if(!s||a===1||!r.live)return;const h=this.targetLatency;if(h===null)return;const _=i-h,g=Math.min(this.maxLatency,h+r.targetduration);if(_<g&&_>.05&&this.forwardBufferLength>1){const R=Math.min(2,Math.max(1,a)),G=Math.round(2/(1+Math.exp(-.75*_-this.edgeStalled))*20)/20,Y=Math.min(R,Math.max(1,G));this.changeMediaPlaybackRate(t,Y)}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:r,targetduration:i}=e,{liveSyncDuration:s,liveSyncDurationCount:a,lowLatencyMode:h}=this.config,_=this.hls.userConfig;let g=h&&r||t;(this._targetLatencyUpdated||_.liveSyncDuration||_.liveSyncDurationCount||g===0)&&(g=s!==void 0?s:a*i);const w=i;return g+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,w)}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 r=this.levelDetails;if(r===null)return null;const i=r.edge,s=e-t-this.edgeStalled,a=i-r.totalduration,h=i-(this.config.lowLatencyMode&&r.partTarget||r.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 r=e.buffered.length;return(r?e.buffered.end(r-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(d.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(d.MANIFEST_LOADING,this.onManifestLoading,this),e.on(d.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(d.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(d.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(d.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(d.MANIFEST_LOADING,this.onManifestLoading,this),e.off(d.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(d.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 r;t.details===A.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(r=this.levelDetails)!=null&&r.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var r,i;e.playbackRate!==t&&((r=this.hls)==null||r.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(i=this.targetLatency)==null?void 0:i.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class Kc extends To{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(d.MANIFEST_LOADING,this.onManifestLoading,this),e.on(d.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(d.LEVEL_LOADED,this.onLevelLoaded,this),e.on(d.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(d.FRAG_BUFFERED,this.onFragBuffered,this),e.on(d.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(d.MANIFEST_LOADING,this.onManifestLoading,this),e.off(d.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(d.LEVEL_LOADED,this.onLevelLoaded,this),e.off(d.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(d.FRAG_BUFFERED,this.onFragBuffered,this),e.off(d.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 r=this.hls.config.preferManagedMediaSource,i=[],s={},a={};let h=!1,_=!1,g=!1;t.levels.forEach(w=>{var R;const G=w.attrs;let{audioCodec:Y,videoCodec:X}=w;Y&&(w.audioCodec=Y=we(Y,r)||void 0),((R=X)==null?void 0:R.indexOf("avc1"))===0&&(X=w.videoCodec=er(X));const{width:fe,height:ce,unknownCodecs:Ee}=w;let Re=Ee?Ee.length:0;if(Ee)for(let St=Re;St--;){const Pt=Ee[St];this.isAudioSupported(Pt)?(w.audioCodec=Y=Y?`${Y},${Pt}`:Pt,Re--,Kt.audio[Y.substring(0,4)]=2):this.isVideoSupported(Pt)&&(w.videoCodec=X=X?`${X},${Pt}`:Pt,Re--,Kt.video[X.substring(0,4)]=2)}if(h||(h=!!(fe&&ce)),_||(_=!!X),g||(g=!!Y),Re||Y&&!this.isAudioSupported(Y)||X&&!this.isVideoSupported(X)){this.log(`Some or all CODECS not supported "${G.CODECS}"`);return}const{CODECS:Te,"FRAME-RATE":Ge,"HDCP-LEVEL":Ke,"PATHWAY-ID":ct,RESOLUTION:qe,"VIDEO-RANGE":it}=G,Xe=`${`${ct||"."}-`}${w.bitrate}-${qe}-${Ge}-${Te}-${it}-${Ke}`;if(s[Xe])if(s[Xe].uri!==w.url&&!w.attrs["PATHWAY-ID"]){const St=a[Xe]+=1;w.attrs["PATHWAY-ID"]=new Array(St+1).join(".");const Pt=this.createLevel(w);s[Xe]=Pt,i.push(Pt)}else s[Xe].addGroupId("audio",G.AUDIO),s[Xe].addGroupId("text",G.SUBTITLES);else{const St=this.createLevel(w);s[Xe]=St,a[Xe]=1,i.push(St)}}),this.filterAndSortMediaOptions(i,t,h,_,g)}createLevel(e){const t=new Ri(e),r=e.supplemental;if(r!=null&&r.videoCodec&&!this.isVideoSupported(r.videoCodec)){const i=new Error(`SUPPLEMENTAL-CODECS not supported "${r.videoCodec}"`);this.log(i.message),t.supportedResult=$r(i,[])}return t}isAudioSupported(e){return Pe(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Pe(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,r,i,s){let a=[],h=[],_=e;if((r||i)&&s&&(_=_.filter(({videoCodec:ce,videoRange:Ee,width:Re,height:Te})=>(!!ce||!!(Re&&Te))&&di(Ee))),_.length===0){Promise.resolve().then(()=>{if(this.hls){let ce="no level with compatible codecs found in manifest",Ee=ce;t.levels.length&&(Ee=`one or more CODECS in variant not supported: ${sr(t.levels.map(Te=>Te.attrs.CODECS).filter((Te,Ge,Ke)=>Ke.indexOf(Te)===Ge))}`,this.warn(Ee),ce+=` (${Ee})`);const Re=new Error(ce);this.hls.trigger(d.ERROR,{type:I.MEDIA_ERROR,details:A.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:Re,reason:Ee})}});return}t.audioTracks&&(a=t.audioTracks.filter(ce=>!ce.audioCodec||this.isAudioSupported(ce.audioCodec)),Nl(a)),t.subtitles&&(h=t.subtitles,Nl(h));const g=_.slice(0);_.sort((ce,Ee)=>{if(ce.attrs["HDCP-LEVEL"]!==Ee.attrs["HDCP-LEVEL"])return(ce.attrs["HDCP-LEVEL"]||"")>(Ee.attrs["HDCP-LEVEL"]||"")?1:-1;if(r&&ce.height!==Ee.height)return ce.height-Ee.height;if(ce.frameRate!==Ee.frameRate)return ce.frameRate-Ee.frameRate;if(ce.videoRange!==Ee.videoRange)return Rr.indexOf(ce.videoRange)-Rr.indexOf(Ee.videoRange);if(ce.videoCodec!==Ee.videoCodec){const Re=ge(ce.videoCodec),Te=ge(Ee.videoCodec);if(Re!==Te)return Te-Re}if(ce.uri===Ee.uri&&ce.codecSet!==Ee.codecSet){const Re=ye(ce.codecSet),Te=ye(Ee.codecSet);if(Re!==Te)return Te-Re}return ce.averageBitrate!==Ee.averageBitrate?ce.averageBitrate-Ee.averageBitrate:0});let w=g[0];if(this.steering&&(_=this.steering.filterParsedLevels(_),_.length!==g.length)){for(let ce=0;ce<g.length;ce++)if(g[ce].pathwayId===_[0].pathwayId){w=g[ce];break}}this._levels=_;for(let ce=0;ce<_.length;ce++)if(_[ce]===w){var R;this._firstLevel=ce;const Ee=w.bitrate,Re=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${_.length} level(s) found, first bitrate: ${Ee}`),((R=this.hls.userConfig)==null?void 0:R.abrEwmaDefaultEstimate)===void 0){const Te=Math.min(Ee,this.hls.config.abrEwmaDefaultEstimateMax);Te>Re&&Re===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=Te)}break}const G=s&&!i,Y=this.hls.config,X=!!(Y.audioStreamController&&Y.audioTrackController),fe={levels:_,audioTracks:a,subtitleTracks:h,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:s,video:i,altAudio:X&&!G&&a.some(ce=>!!ce.url)};this.hls.trigger(d.MANIFEST_PARSED,fe)}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 w=new Error("invalid level idx"),R=e<0;if(this.hls.trigger(d.ERROR,{type:I.OTHER_ERROR,details:A.LEVEL_SWITCH_ERROR,level:e,fatal:R,error:w,reason:w.message}),R)return;e=Math.min(e,t.length-1)}const r=this.currentLevelIndex,i=this.currentLevel,s=i?i.attrs["PATHWAY-ID"]:void 0,a=t[e],h=a.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=a,r===e&&i&&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 ${r}${s?" with Pathway "+s:""}`);const _={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(d.LEVEL_SWITCHING,_);const g=a.details;if(!g||g.live){const w=this.switchParams(a.uri,i==null?void 0:i.details,g);this.loadPlaylist(w)}}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(),r=e.filter(i=>t.indexOf(i)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=r}}onError(e,t){t.fatal||!t.context||t.context.type===U.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===b.MAIN){const r=t.elementaryStreams;if(!Object.keys(r).some(s=>!!r[s]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var r;const{level:i,details:s}=t,a=t.levelInfo;if(!a){var h;this.warn(`Invalid level index ${i}`),(h=t.deliveryDirectives)!=null&&h.skip&&(s.deltaUpdateFailed=!0);return}if(a===this.currentLevel||t.withoutMultiVariant){a.fragmentError===0&&(a.loadError=0);let _=a.details;_===t.details&&_.advanced&&(_=void 0),this.playlistLoaded(i,t,_)}else(r=t.deliveryDirectives)!=null&&r.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 r=this.getUrlWithDirectives(e.uri,t),i=this.currentLevelIndex,s=e.attrs["PATHWAY-ID"],a=e.details,h=a==null?void 0:a.age;this.log(`Loading level index ${i}${(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:""):""} ${r}`),this.hls.trigger(d.LEVEL_LOADING,{url:r,level:i,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const r=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));Hs(r),this._levels=r,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const i=r.length-1;this._firstLevel=Math.min(this._firstLevel,i),this._startLevel&&(this._startLevel=Math.min(this._startLevel,i)),this.hls.trigger(d.LEVELS_UPDATED,{levels:r})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:r}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(d.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:r}))}}function Nl(o){const e={};o.forEach(t=>{const r=t.groupId||"";t.id=e[r]=e[r]||0,e[r]++})}function Ul(){return self.SourceBuffer||self.WebKitSourceBuffer}function $l(){if(!ie())return!1;const e=Ul();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function Vc(){if(!$l())return!1;const o=ie();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(he(e,"video")))||["mp4a.40.2","fLaC"].some(e=>o.isTypeSupported(he(e,"audio"))))}function qc(){var o;const e=Ul();return typeof(e==null||(o=e.prototype)==null?void 0:o.changeType)=="function"}const Yc=100;class Zc extends bs{constructor(e,t,r){super(e,t,r,"stream-controller",b.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const i=this.media,s=i?i.currentTime:null;if(s===null||!N(s)||(this.log(`Media seeked to ${s.toFixed(3)}`),!this.getBufferedFrag(s)))return;const a=this.getFwdBufferInfoAtPos(i,s,b.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(d.MANIFEST_PARSED,this.onManifestParsed,this),e.on(d.LEVEL_LOADING,this.onLevelLoading,this),e.on(d.LEVEL_LOADED,this.onLevelLoaded,this),e.on(d.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(d.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(d.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(d.BUFFER_CREATED,this.onBufferCreated,this),e.on(d.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(d.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(d.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(d.MANIFEST_PARSED,this.onManifestParsed,this),e.off(d.LEVEL_LOADED,this.onLevelLoaded,this),e.off(d.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(d.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(d.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(d.BUFFER_CREATED,this.onBufferCreated,this),e.off(d.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(d.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(d.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:r,hls:i}=this;if(this.stopLoad(),this.setInterval(Yc),this.level=-1,!this.startFragRequested){let s=i.startLevel;s===-1&&(i.config.testBandwidth&&this.levels.length>1?(s=0,this.bitrateTest=!0):s=i.firstAutoLevel),i.nextLoadLevel=s,this.level=i.loadLevel,this._hasEnoughToStart=!!t}r>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r),this.state=ft.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=ft.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case ft.WAITING_LEVEL:{const{levels:t,level:r}=this,i=t==null?void 0:t[r],s=i==null?void 0:i.details;if(s&&(!s.live||this.levelLastLoaded===i&&!this.waitForLive(i))){if(this.waitForCdnTuneIn(s))break;this.state=ft.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=ft.IDLE;break}break}case ft.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),r=this.retryDate;if(!r||t>=r||(e=this.media)!=null&&e.seeking){const{levels:i,level:s}=this,a=i==null?void 0:i[s];this.resetStartWhenNotLoaded(a||null),this.state=ft.IDLE}}break}this.state===ft.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:r,media:i}=this;if(t===null||!i&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const s=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(r!=null&&r[s]))return;const a=r[s],h=this.getMainFwdBufferInfo();if(h===null)return;const _=this.getLevelDetails();if(_&&this._streamEnded(h,_)){const fe={};this.altAudio===2&&(fe.type="video"),this.hls.trigger(d.BUFFER_EOS,fe),this.state=ft.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 g=a.details;if(!g||this.state===ft.WAITING_LEVEL||this.waitForLive(a)){this.level=s,this.state=ft.WAITING_LEVEL,this.startFragRequested=!1;return}const w=h.len,R=this.getMaxBufferLength(a.maxBitrate);if(w>=R)return;this.backtrackFragment&&this.backtrackFragment.start>h.end&&(this.backtrackFragment=null);const G=this.backtrackFragment?this.backtrackFragment.start:h.end;let Y=this.getNextFragment(G,g);if(this.couldBacktrack&&!this.fragPrevious&&Y&&de(Y)&&this.fragmentTracker.getState(Y)!==Fr.OK){var X;const ce=((X=this.backtrackFragment)!=null?X:Y).sn-g.startSN,Ee=g.fragments[ce-1];Ee&&Y.cc===Ee.cc&&(Y=Ee,this.fragmentTracker.removeFragment(Ee))}else this.backtrackFragment&&h.len&&(this.backtrackFragment=null);if(Y&&this.isLoopLoading(Y,G)){if(!Y.gap){const ce=this.audioOnly&&!this.altAudio?D.AUDIO:D.VIDEO,Ee=(ce===D.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;Ee&&this.afterBufferFlushed(Ee,ce,b.MAIN)}Y=this.getNextFragmentLoopLoading(Y,g,h,b.MAIN,R)}Y&&(Y.initSegment&&!Y.initSegment.data&&!this.bitrateTest&&(Y=Y.initSegment),this.loadFragment(Y,a,G))}loadFragment(e,t,r){const i=this.fragmentTracker.getState(e);i===Fr.NOT_LOADED||i===Fr.PARTIAL?de(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,r):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,b.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 r;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.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,_=e[h],g=this.fragLastKbps;g&&this.fragCurrent?r=this.fragCurrent.duration*_.maxBitrate/(1e3*g)+1:r=0}else r=0;const a=this.getBufferedFrag(t.currentTime+r);if(a){const h=this.followingBufferedFrag(a);if(h){this.abortCurrentFrag();const _=h.maxStartPTS?h.maxStartPTS:h.start,g=h.duration,w=Math.max(a.end,_+Math.min(Math.max(g-this.config.maxFragLookUpTolerance,g*(this.couldBacktrack?.5:.125)),g*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(w,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 ft.KEY_LOADING:case ft.FRAG_LOADING:case ft.FRAG_LOADING_WAITING_RETRY:case ft.PARSING:case ft.PARSED:this.state=ft.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 r=t.media;Hn(r,"playing",this.onMediaPlaying),Hn(r,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:r}=this;r&&(kn(r,"playing",this.onMediaPlaying),kn(r,"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(d.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 r=!1,i=!1;t.levels.forEach(s=>{const a=s.audioCodec;a&&(r=r||a.indexOf("mp4a.40.2")!==-1,i=i||a.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=r&&i&&!qc(),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:r}=this;if(!r||this.state!==ft.IDLE)return;const i=t.levelInfo;(!i.details||i.details.live&&(this.levelLastLoaded!==i||i.details.expired)||this.waitForCdnTuneIn(i.details))&&(this.state=ft.WAITING_LEVEL)}onLevelLoaded(e,t){var r;const{levels:i,startFragRequested:s}=this,a=t.level,h=t.details,_=h.totalduration;if(!i){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:${_}`);const g=t.levelInfo,w=this.fragCurrent;w&&(this.state===ft.FRAG_LOADING||this.state===ft.FRAG_LOADING_WAITING_RETRY)&&w.level!==t.level&&w.loader&&this.abortCurrentFrag();let R=0;if(h.live||(r=g.details)!=null&&r.live){var G;if(this.checkLiveUpdate(h),h.deltaUpdateFailed)return;R=this.alignPlaylists(h,g.details,(G=this.levelLastLoaded)==null?void 0:G.details)}if(g.details=h,this.levelLastLoaded=g,s||this.setStartPosition(h,R),this.hls.trigger(d.LEVEL_UPDATED,{details:h,level:a}),this.state===ft.WAITING_LEVEL){if(this.waitForCdnTuneIn(h))return;this.state=ft.IDLE}s&&h.live&&this.synchronizeToLiveEdge(h),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:r}=this;if(!r)return;const i=this.hls.liveSyncPosition,s=this.getLoadPosition(),a=e.fragmentStart,h=e.edge,_=s>=a-t.maxFragLookUpTolerance&&s<=h;if(i!==null&&r.duration>i&&(s<i||!_)){const g=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!_&&r.readyState<4||s<h-g)&&(this._hasEnoughToStart||(this.nextLoadPosition=i),r.readyState&&(this.warn(`Playback: ${s.toFixed(3)} is located too far from the end of live sliding playlist: ${h}, reset currentTime to : ${i.toFixed(3)}`),r.currentTime=i))}}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:i,payload:s}=e,{levels:a}=this;if(!a){this.warn(`Levels were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);return}const h=a[r.level];if(!h){this.warn(`Level ${r.level} not found on progress`);return}const _=h.details;if(!_){this.warn(`Dropping fragment ${r.sn} of level ${r.level} after level details were reset`),this.fragmentTracker.removeFragment(r);return}const g=h.videoCodec,w=_.PTSKnown||!_.live,R=(t=r.initSegment)==null?void 0:t.data,G=this._getAudioCodec(h),Y=this.transmuxer=this.transmuxer||new ua(this.hls,b.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),X=i?i.index:-1,fe=X!==-1,ce=new Ki(r.level,r.sn,r.stats.chunkCount,s.byteLength,X,fe),Ee=this.initPTS[r.cc];Y.push(s,R,G,g,r,i,_.totalduration,w,ce,Ee)}onAudioTrackSwitching(e,t){const r=this.hls,i=this.altAudio===2;if(Tr(t.url,r))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(i){this.fragmentTracker.removeAllFragments(),r.once(d.BUFFER_FLUSHED,()=>{var a;(a=this.hls)==null||a.trigger(d.AUDIO_TRACK_SWITCHED,t)}),r.trigger(d.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}r.trigger(d.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const r=Tr(t.url,this.hls);if(r){const i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=r?2:0,this.tick()}onBufferCreated(e,t){const r=t.tracks;let i,s,a=!1;for(const h in r){const _=r[h];if(_.id==="main"){if(s=h,i=_,h==="video"){const g=r[h];g&&(this.videoBuffer=g.buffer)}}else a=!0}a&&i?(this.log(`Alternate track found, use ${s}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:r,part:i}=t,s=r.type===b.MAIN;if(s){if(this.fragContextChanged(r)){this.warn(`Fragment ${r.sn}${i?" p: "+i.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}`),this.state===ft.PARSED&&(this.state=ft.IDLE);return}const h=i?i.stats:r.stats;this.fragLastKbps=Math.round(8*h.total/(h.buffering.end-h.loading.first)),de(r)&&(this.fragPrevious=r),this.fragBufferedComplete(r,i)}const a=this.media;a&&(!this._hasEnoughToStart&&tr.getBuffered(a).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),s&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var r;if(t.fatal){this.state=ft.ERROR;return}switch(t.details){case A.FRAG_GAP:case A.FRAG_PARSING_ERROR:case A.FRAG_DECRYPT_ERROR:case A.FRAG_LOAD_ERROR:case A.FRAG_LOAD_TIMEOUT:case A.KEY_LOAD_ERROR:case A.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(b.MAIN,t);break;case A.LEVEL_LOAD_ERROR:case A.LEVEL_LOAD_TIMEOUT:case A.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===ft.WAITING_LEVEL&&((r=t.context)==null?void 0:r.type)===U.LEVEL&&(this.state=ft.IDLE);break;case A.BUFFER_ADD_CODEC_ERROR:case A.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.resetLoadingState();break;case A.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case A.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=ft.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==D.AUDIO||!this.altAudio){const r=(t===D.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;r&&(this.afterBufferFlushed(r,t,b.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 r=this.startPosition;if(r>=0&&t<r){if(e.seeking){this.log(`could not seek to ${r}, already seeking at ${t}`);return}const i=this.timelineOffset;i&&r&&(r+=i);const s=this.getLevelDetails(),a=tr.getBuffered(e),h=a.length?a.start(0):0,_=h-r,g=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);_>0&&(_<g||this.loadingParts&&_<2*((s==null?void 0:s.partTarget)||0))&&(this.log(`adjusting start position by ${_} to match buffer start`),r+=_,this.startPosition=r),t<r&&(this.log(`seek to target start position ${r} from current time ${t} buffer start ${h}`),e.currentTime=r)}}_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(r=>{const{hls:i}=this,s=r==null?void 0:r.frag;if(!s||this.fragContextChanged(s))return;t.fragmentError=0,this.state=ft.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(),i.trigger(d.FRAG_LOADED,r),s.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const r=this.playlistType,{hls:i}=this,{remuxResult:s,chunkMeta:a}=e,h=this.getCurrentContext(a);if(!h){this.resetWhenMissingContext(a);return}const{frag:_,part:g,level:w}=h,{video:R,text:G,id3:Y,initSegment:X}=s,{details:fe}=w,ce=this.altAudio?void 0:s.audio;if(this.fragContextChanged(_)){this.fragmentTracker.removeFragment(_);return}if(this.state=ft.PARSING,X){if(X!=null&&X.tracks){const Te=_.initSegment||_;this._bufferInitSegment(w,X.tracks,Te,a),i.trigger(d.FRAG_PARSING_INIT_SEGMENT,{frag:Te,id:r,tracks:X.tracks})}const Ee=X.initPTS,Re=X.timescale;N(Ee)&&(this.initPTS[_.cc]={baseTime:Ee,timescale:Re},i.trigger(d.INIT_PTS_FOUND,{frag:_,id:r,initPTS:Ee,timescale:Re}))}if(R&&fe){!ce&&R.type==="audiovideo"&&this.logMuxedErr(_);const Ee=fe.fragments[_.sn-1-fe.startSN],Re=_.sn===fe.startSN,Te=!Ee||_.cc>Ee.cc;if(s.independent!==!1){const{startPTS:Ge,endPTS:Ke,startDTS:ct,endDTS:qe}=R;if(g)g.elementaryStreams[R.type]={startPTS:Ge,endPTS:Ke,startDTS:ct,endDTS:qe};else if(R.firstKeyFrame&&R.independent&&a.id===1&&!Te&&(this.couldBacktrack=!0),R.dropped&&R.independent){const it=this.getMainFwdBufferInfo(),ht=(it?it.end:this.getLoadPosition())+this.config.maxBufferHole,Xe=R.firstKeyFramePTS?R.firstKeyFramePTS:Ge;if(!Re&&ht<Xe-this.config.maxBufferHole&&!Te){this.backtrack(_);return}else Te&&(_.gap=!0);_.setElementaryStreamInfo(R.type,_.start,Ke,_.start,qe,!0)}else Re&&Ge-(fe.appliedTimelineOffset||0)>oo&&(_.gap=!0);_.setElementaryStreamInfo(R.type,Ge,Ke,ct,qe),this.backtrackFragment&&(this.backtrackFragment=_),this.bufferFragmentData(R,_,g,a,Re||Te)}else if(Re||Te)_.gap=!0;else{this.backtrack(_);return}}if(ce){const{startPTS:Ee,endPTS:Re,startDTS:Te,endDTS:Ge}=ce;g&&(g.elementaryStreams[D.AUDIO]={startPTS:Ee,endPTS:Re,startDTS:Te,endDTS:Ge}),_.setElementaryStreamInfo(D.AUDIO,Ee,Re,Te,Ge),this.bufferFragmentData(ce,_,g,a)}if(fe&&Y!=null&&(t=Y.samples)!=null&&t.length){const Ee={id:r,frag:_,details:fe,samples:Y.samples};i.trigger(d.FRAG_PARSING_METADATA,Ee)}if(fe&&G){const Ee={id:r,frag:_,details:fe,samples:G.samples};i.trigger(d.FRAG_PARSING_USERDATA,Ee)}}logMuxedErr(e){this.warn(`${de(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,r,i){if(this.state!==ft.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(r));const{audio:s,video:a,audiovideo:h}=t;if(s){let g=Ft(s.codec,e.audioCodec);g==="mp4a"&&(g="mp4a.40.5");const w=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){g&&(g.indexOf("mp4a.40.5")!==-1?g="mp4a.40.2":g="mp4a.40.5");const R=s.metadata;R&&"channelCount"in R&&(R.channelCount||1)!==1&&w.indexOf("firefox")===-1&&(g="mp4a.40.5")}g&&g.indexOf("mp4a.40.5")!==-1&&w.indexOf("android")!==-1&&s.container!=="audio/mpeg"&&(g="mp4a.40.2",this.log(`Android: force audio codec to ${g}`)),e.audioCodec&&e.audioCodec!==g&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${g}"`),s.levelCodec=g,s.id=b.MAIN,this.log(`Init audio buffer, container:${s.container}, codecs[selected/level/parsed]=[${g||""}/${e.audioCodec||""}/${s.codec}]`),delete t.audiovideo}if(a){a.levelCodec=e.videoCodec,a.id=b.MAIN;const g=a.codec;if((g==null?void 0:g.length)===4)switch(g){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||""}/${g}]${a.codec!==g?" 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 _=Object.keys(t);if(_.length){if(this.hls.trigger(d.BUFFER_CODECS,t),!this.hls)return;_.forEach(g=>{const R=t[g].initSegment;R!=null&&R.byteLength&&this.hls.trigger(d.BUFFER_APPENDING,{type:g,data:R,frag:r,part:null,chunkMeta:i,parent:r.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,b.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,r=e==null?void 0:e[t];return r?this.getMaxBufferLength(r.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=ft.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const r=e.currentTime;if(tr.isBuffered(e,r)?t=this.getAppendedFrag(r):tr.isBuffered(e,r+.1)&&(t=this.getAppendedFrag(r+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,s=t.level;(!i||t.sn!==i.sn||i.level!==s)&&(this.fragPlaying=t,this.hls.trigger(d.FRAG_CHANGED,{frag:t}),(!i||i.level!==s)&&this.hls.trigger(d.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 N(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(N(t)){const r=this.getLevelDetails(),i=this.currentFrag||(r?hr(null,r.fragments,t):null);if(i){const s=i.programDateTime;if(s!==null){const a=s+(t-i.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 Xc{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const r in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[r].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=A.KEY_LOAD_ERROR,r,i,s){return new bi({type:I.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:s,error:r,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:r,cc:i}=e;for(let s=0;s<t.length;s++){const a=t[s];if(i<=a.cc&&(r==="initSegment"||a.sn==="initSegment"||r<a.sn)){this.emeController.selectKeySystemFormat(a).then(h=>{a.setKeyFormat(h)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var r,i;t&&e.setKeyFormat(t);const s=e.decryptdata;if(!s){const g=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,A.KEY_LOAD_ERROR,g))}const a=s.uri;if(!a)return Promise.reject(this.createKeyLoadError(e,A.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${a}"`)));let h=this.keyUriToKeyInfo[a];if((r=h)!=null&&r.decryptdata.key)return s.key=h.decryptdata.key,Promise.resolve({frag:e,keyInfo:h});if((i=h)!=null&&i.keyLoadPromise){var _;switch((_=h.mediaKeySessionContext)==null?void 0:_.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return h.keyLoadPromise.then(g=>(s.key=g.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,A.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${s.method}"`)))}}loadKeyEME(e,t){const r={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(r);if(i)return(e.keyLoadPromise=i.then(s=>(e.mediaKeySessionContext=s,r))).catch(s=>{throw e.keyLoadPromise=null,s})}return Promise.resolve(r)}loadKeyHTTP(e,t){const r=this.config,i=r.loader,s=new i(r);return t.keyLoader=e.loader=s,e.keyLoadPromise=new Promise((a,h)=>{const _={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},g=r.keyLoadPolicy.default,w={loadPolicy:g,timeout:g.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},R={onSuccess:(G,Y,X,fe)=>{const{frag:ce,keyInfo:Ee,url:Re}=X;if(!ce.decryptdata||Ee!==this.keyUriToKeyInfo[Re])return h(this.createKeyLoadError(ce,A.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),fe));Ee.decryptdata.key=ce.decryptdata.key=new Uint8Array(G.data),ce.keyLoader=null,Ee.loader=null,a({frag:ce,keyInfo:Ee})},onError:(G,Y,X,fe)=>{this.resetLoader(Y),h(this.createKeyLoadError(t,A.KEY_LOAD_ERROR,new Error(`HTTP Error ${G.code} loading key ${G.text}`),X,u({url:_.url,data:void 0},G)))},onTimeout:(G,Y,X)=>{this.resetLoader(Y),h(this.createKeyLoadError(t,A.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),X))},onAbort:(G,Y,X)=>{this.resetLoader(Y),h(this.createKeyLoadError(t,A.INTERNAL_ABORTED,new Error("key loading aborted"),X))}};s.load(_,w,R)})}resetLoader(e){const{frag:t,keyInfo:r,url:i}=e,s=r.loader;t.keyLoader===s&&(t.keyLoader=null,r.loader=null),delete this.keyUriToKeyInfo[i],s&&s.destroy()}}function zl(o){const{type:e}=o;switch(e){case U.AUDIO_TRACK:return b.AUDIO;case U.SUBTITLE_TRACK:return b.SUBTITLE;default:return b.MAIN}}function qo(o,e){let t=o.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Qc{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(d.MANIFEST_LOADING,this.onManifestLoading,this),e.on(d.LEVEL_LOADING,this.onLevelLoading,this),e.on(d.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(d.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(d.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(d.MANIFEST_LOADING,this.onManifestLoading,this),e.off(d.LEVEL_LOADING,this.onLevelLoading,this),e.off(d.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(d.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(d.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,r=t.pLoader,i=t.loader,s=r||i,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:r}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:U.MANIFEST,url:r,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:r,level:i,pathwayId:s,url:a,deliveryDirectives:h,levelInfo:_}=t;this.load({id:r,level:i,pathwayId:s,responseType:"text",type:U.LEVEL,url:a,deliveryDirectives:h,levelOrTrack:_})}onAudioTrackLoading(e,t){const{id:r,groupId:i,url:s,deliveryDirectives:a,track:h}=t;this.load({id:r,groupId:i,level:null,responseType:"text",type:U.AUDIO_TRACK,url:s,deliveryDirectives:a,levelOrTrack:h})}onSubtitleTrackLoading(e,t){const{id:r,groupId:i,url:s,deliveryDirectives:a,track:h}=t;this.load({id:r,groupId:i,level:null,responseType:"text",type:U.SUBTITLE_TRACK,url:s,deliveryDirectives:a,levelOrTrack:h})}onLevelsUpdated(e,t){const r=this.loaders[U.LEVEL];if(r){const i=r.context;i&&!t.levels.some(s=>s===i.levelOrTrack)&&(r.abort(),delete this.loaders[U.LEVEL])}}load(e){var t;const r=this.hls.config;let i=this.getInternalLoader(e);if(i){const g=this.hls.logger,w=i.context;if(w&&w.levelOrTrack===e.levelOrTrack&&(w.url===e.url||w.deliveryDirectives&&!e.deliveryDirectives)){w.url===e.url?g.log(`[playlist-loader]: ignore ${e.url} ongoing request`):g.log(`[playlist-loader]: ignore ${e.url} in favor of ${w.url}`);return}g.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let s;if(e.type===U.MANIFEST?s=r.manifestLoadPolicy.default:s=c({},r.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),N((t=e.deliveryDirectives)==null?void 0:t.part)){let g;if(e.type===U.LEVEL&&e.level!==null?g=this.hls.levels[e.level].details:e.type===U.AUDIO_TRACK&&e.id!==null?g=this.hls.audioTracks[e.id].details:e.type===U.SUBTITLE_TRACK&&e.id!==null&&(g=this.hls.subtitleTracks[e.id].details),g){const w=g.partTarget,R=g.targetduration;if(w&&R){const G=Math.max(w*3,R*.8)*1e3;s=c({},s,{maxTimeToFirstByteMs:Math.min(G,s.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(G,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},_={onSuccess:(g,w,R,G)=>{const Y=this.getInternalLoader(R);this.resetInternalLoader(R.type);const X=g.data;if(X.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(g,R,new Error("no EXTM3U delimiter"),G||null,w);return}w.parsing.start=performance.now(),yi.isMediaPlaylist(X)||R.type!==U.MANIFEST?this.handleTrackOrLevelPlaylist(g,w,R,G||null,Y):this.handleMasterPlaylist(g,w,R,G)},onError:(g,w,R,G)=>{this.handleNetworkError(w,R,!1,g,G)},onTimeout:(g,w,R)=>{this.handleNetworkError(w,R,!0,void 0,g)}};i.load(e,h,_)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:r}=this.hls;(e||r)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,r,i){const s=this.hls,a=e.data,h=qo(e,r),_=yi.parseMasterPlaylist(a,h);if(_.playlistParsingError){this.handleManifestParsingError(e,r,_.playlistParsingError,i,t);return}const{contentSteering:g,levels:w,sessionData:R,sessionKeys:G,startTimeOffset:Y,variableList:X}=_;this.variableList=X;const{AUDIO:fe=[],SUBTITLES:ce,"CLOSED-CAPTIONS":Ee}=yi.parseMasterPlaylistMedia(a,h,_);fe.length&&!fe.some(Te=>!Te.url)&&w[0].audioCodec&&!w[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),fe.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new _r({}),bitrate:0,url:""})),s.trigger(d.MANIFEST_LOADED,{levels:w,audioTracks:fe,subtitles:ce,captions:Ee,contentSteering:g,url:h,stats:t,networkDetails:i,sessionData:R,sessionKeys:G,startTimeOffset:Y,variableList:X})}handleTrackOrLevelPlaylist(e,t,r,i,s){const a=this.hls,{id:h,level:_,type:g}=r,w=qo(e,r),R=N(_)?_:N(h)?h:0,G=zl(r),Y=yi.parseLevelPlaylist(e.data,w,R,G,0,this.variableList);if(g===U.MANIFEST){const X={attrs:new _r({}),bitrate:0,details:Y,name:"",url:w};Y.requestScheduled=t.loading.start+is(Y,0),a.trigger(d.MANIFEST_LOADED,{levels:[X],audioTracks:[],url:w,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),r.levelDetails=Y,this.handlePlaylistLoaded(Y,e,t,r,i,s)}handleManifestParsingError(e,t,r,i,s){this.hls.trigger(d.ERROR,{type:I.NETWORK_ERROR,details:A.MANIFEST_PARSING_ERROR,fatal:t.type===U.MANIFEST,url:e.url,err:r,error:r,reason:r.message,response:e,context:t,networkDetails:i,stats:s})}handleNetworkError(e,t,r=!1,i,s){let a=`A network ${r?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===U.LEVEL?a+=`: ${e.level} id: ${e.id}`:(e.type===U.AUDIO_TRACK||e.type===U.SUBTITLE_TRACK)&&(a+=` id: ${e.id} group-id: "${e.groupId}"`);const h=new Error(a);this.hls.logger.warn(`[playlist-loader]: ${a}`);let _=A.UNKNOWN,g=!1;const w=this.getInternalLoader(e);switch(e.type){case U.MANIFEST:_=r?A.MANIFEST_LOAD_TIMEOUT:A.MANIFEST_LOAD_ERROR,g=!0;break;case U.LEVEL:_=r?A.LEVEL_LOAD_TIMEOUT:A.LEVEL_LOAD_ERROR,g=!1;break;case U.AUDIO_TRACK:_=r?A.AUDIO_TRACK_LOAD_TIMEOUT:A.AUDIO_TRACK_LOAD_ERROR,g=!1;break;case U.SUBTITLE_TRACK:_=r?A.SUBTITLE_TRACK_LOAD_TIMEOUT:A.SUBTITLE_LOAD_ERROR,g=!1;break}w&&this.resetInternalLoader(e.type);const R={type:I.NETWORK_ERROR,details:_,fatal:g,url:e.url,loader:w,context:e,error:h,networkDetails:t,stats:s};if(i){const G=(t==null?void 0:t.url)||e.url;R.response=u({url:G,data:void 0},i)}this.hls.trigger(d.ERROR,R)}handlePlaylistLoaded(e,t,r,i,s,a){const h=this.hls,{type:_,level:g,id:w,groupId:R,deliveryDirectives:G}=i,Y=qo(t,i),X=zl(i),fe=typeof i.level=="number"&&X===b.MAIN?g:void 0;if(!e.fragments.length){const Ee=e.playlistParsingError=new Error("No Segments found in Playlist");h.trigger(d.ERROR,{type:I.NETWORK_ERROR,details:A.LEVEL_EMPTY_ERROR,fatal:!1,url:Y,error:Ee,reason:Ee.message,response:t,context:i,level:fe,parent:X,networkDetails:s,stats:r});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const ce=e.playlistParsingError;if(ce){if(this.hls.logger.warn(ce),!h.config.ignorePlaylistParsingErrors){h.trigger(d.ERROR,{type:I.NETWORK_ERROR,details:A.LEVEL_PARSING_ERROR,fatal:!1,url:Y,error:ce,reason:ce.message,response:t,context:i,level:fe,parent:X,networkDetails:s,stats:r});return}e.playlistParsingError=null}switch(e.live&&a&&(a.getCacheAge&&(e.ageHeader=a.getCacheAge()||0),(!a.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),_){case U.MANIFEST:case U.LEVEL:h.trigger(d.LEVEL_LOADED,{details:e,levelInfo:i.levelOrTrack||h.levels[0],level:fe||0,id:w||0,stats:r,networkDetails:s,deliveryDirectives:G,withoutMultiVariant:_===U.MANIFEST});break;case U.AUDIO_TRACK:h.trigger(d.AUDIO_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:w||0,groupId:R||"",stats:r,networkDetails:s,deliveryDirectives:G});break;case U.SUBTITLE_TRACK:h.trigger(d.SUBTITLE_TRACK_LOADED,{details:e,track:i.levelOrTrack,id:w||0,groupId:R||"",stats:r,networkDetails:s,deliveryDirectives:G});break}}}class Jn{static get version(){return Un}static isMSESupported(){return $l()}static isSupported(){return Vc()}static getMediaSource(){return ie()}static get Events(){return d}static get MetadataSchema(){return Se}static get ErrorTypes(){return I}static get ErrorDetails(){return A}static get DefaultConfig(){return Jn.defaultConfig?Jn.defaultConfig:Pc}static set DefaultConfig(e){Jn.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 Ss,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),r=this.config=Fc(Jn.DefaultConfig,e,t);this.userConfig=e,r.progressive&&Bc(r,t);const{abrController:i,bufferController:s,capLevelController:a,errorController:h,fpsController:_}=r,g=new h(this),w=this.abrController=new i(this),R=new En(this),G=r.interstitialsController,Y=G?this.interstitialsController=new G(this,Jn):null,X=this.bufferController=new s(this,R),fe=this.capLevelController=new a(this),ce=new _(this),Ee=new Qc(this),Re=r.contentSteeringController,Te=Re?new Re(this):null,Ge=this.levelController=new Kc(this,Te),Ke=new Wc(this),ct=new Xc(this.config),qe=this.streamController=new Zc(this,R,ct),it=this.gapController=new zc(this,R);fe.setStreamController(qe),ce.setStreamController(qe);const ht=[Ee,Ge,qe];Y&&ht.splice(1,0,Y),Te&&ht.splice(1,0,Te),this.networkControllers=ht;const Xe=[w,X,it,fe,ce,Ke,R];this.audioTrackController=this.createController(r.audioTrackController,ht);const St=r.audioStreamController;St&&ht.push(this.audioStreamController=new St(this,R,ct)),this.subtitleTrackController=this.createController(r.subtitleTrackController,ht);const Pt=r.subtitleStreamController;Pt&&ht.push(this.subtititleStreamController=new Pt(this,R,ct)),this.createController(r.timelineController,Xe),ct.emeController=this.emeController=this.createController(r.emeController,Xe),this.cmcdController=this.createController(r.cmcdController,Xe),this.latencyController=this.createController(Gc,Xe),this.coreComponents=Xe,ht.push(g);const Sr=g.onErrorOut;typeof Sr=="function"&&this.on(d.ERROR,Sr,g),this.on(d.MANIFEST_LOADED,Ee.onManifestLoaded,Ee)}createController(e,t){if(e){const r=new e(this);return t&&t.push(r),r}return null}on(e,t,r=this){this._emitter.on(e,t,r)}once(e,t,r=this){this._emitter.once(e,t,r)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,r=this,i){this._emitter.off(e,t,r,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,r){return this._emitter.emit(e,t,r)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(r){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+r.message+'". Here is a stacktrace:',r),!this.triggeringException){this.triggeringException=!0;const i=e===d.ERROR;this.trigger(d.ERROR,{type:I.OTHER_ERROR,details:A.INTERNAL_EXCEPTION,fatal:i,event:e,error:r}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(d.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(d.ERROR,{type:I.OTHER_ERROR,details:A.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,r=t?e.media:e,i=t?e:{media:r};this._media=r,this.trigger(d.MEDIA_ATTACHING,i)}detachMedia(){this.logger.log("detachMedia"),this.trigger(d.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(d.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,r=this._url,i=this._url=K.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${i}`),t&&r&&(r!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(d.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 r=0;r<this.networkControllers.length&&(this.networkControllers[r].startLoad(e,t),!(!this.started||!this.networkControllers));r++);}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={[b.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[b.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[b.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=Wa()),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){Hr(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 r=e.length;for(let i=0;i<r;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:r}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,r)for(let s=i;s--;){const a=e[s].attrs["HDCP-LEVEL"];if(a&&a<=r)return s}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const r=ui(t);return Ot(e,r,navigator.mediaCapabilities)}}Jn.defaultConfig=void 0}}]);
|
|
|
}()); |