|
|
!(function(){var bu=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[9716],{70557:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return S}});var R=y(60499),N=y(59301),K={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"},P=K,A=y(7657),d=function(w,f){return N.createElement(A.Z,(0,R.Z)({},w,{ref:f,icon:P}))},U=N.forwardRef(d),S=U},84105:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return S}});var R=y(60499),N=y(59301),K={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"},P=K,A=y(7657),d=function(w,f){return N.createElement(A.Z,(0,R.Z)({},w,{ref:f,icon:P}))},U=N.forwardRef(d),S=U},73331:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return S}});var R=y(60499),N=y(59301),K={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"},P=K,A=y(7657),d=function(w,f){return N.createElement(A.Z,(0,R.Z)({},w,{ref:f,icon:P}))},U=N.forwardRef(d),S=U},15277:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return S}});var R=y(60499),N=y(59301),K={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"},P=K,A=y(7657),d=function(w,f){return N.createElement(A.Z,(0,R.Z)({},w,{ref:f,icon:P}))},U=N.forwardRef(d),S=U},47472:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return S}});var R=y(60499),N=y(59301),K={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"},P=K,A=y(7657),d=function(w,f){return N.createElement(A.Z,(0,R.Z)({},w,{ref:f,icon:P}))},U=N.forwardRef(d),S=U},87395:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return S}});var R=y(60499),N=y(59301),K={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"},P=K,A=y(7657),d=function(w,f){return N.createElement(A.Z,(0,R.Z)({},w,{ref:f,icon:P}))},U=N.forwardRef(d),S=U},68196:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return ft}});var R=y(85899),N=y(72190),K=y(42244),P=y(43403),A=y(92310),d=y.n(A),U=y(29301),S=y(76846),s=y(96452),w=y(6089),f=y(80402),u=y(34280),l=y(49658),c=y(59301),m=y(60499),C=y(77900),M=y(8654);function k(Pe){var Te=Pe.prefixCls,Se=Pe.align,ze=Pe.arrow,Je=Pe.arrowPos,rt=ze||{},de=rt.className,Le=rt.content,We=Je.x,Ge=We===void 0?0:We,Xe=Je.y,gt=Xe===void 0?0:Xe,Ct=c.useRef();if(!Se||!Se.points)return null;var ht={position:"absolute"};if(Se.autoArrow!==!1){var dt=Se.points[0],vt=Se.points[1],Pt=dt[0],Tt=dt[1],xt=vt[0],Ke=vt[1];Pt===xt||!["t","b"].includes(Pt)?ht.top=gt:Pt==="t"?ht.top=0:ht.bottom=0,Tt===Ke||!["l","r"].includes(Tt)?ht.left=Ge:Tt==="l"?ht.left=0:ht.right=0}return c.createElement("div",{ref:Ct,className:d()("".concat(Te,"-arrow"),de),style:ht},Le)}function E(Pe){var Te=Pe.prefixCls,Se=Pe.open,ze=Pe.zIndex,Je=Pe.mask,rt=Pe.motion;return Je?c.createElement(C.default,(0,m.Z)({},rt,{motionAppear:!0,visible:Se,removeOnLeave:!0}),function(de){var Le=de.className;return c.createElement("div",{style:{zIndex:ze},className:d()("".concat(Te,"-mask"),Le)})}):null}var T=c.memo(function(Pe){var Te=Pe.children;return Te},function(Pe,Te){return Te.cache}),I=T,F=c.forwardRef(function(Pe,Te){var Se=Pe.popup,ze=Pe.className,Je=Pe.prefixCls,rt=Pe.style,de=Pe.target,Le=Pe.onVisibleChanged,We=Pe.open,Ge=Pe.keepDom,Xe=Pe.fresh,gt=Pe.onClick,Ct=Pe.mask,ht=Pe.arrow,dt=Pe.arrowPos,vt=Pe.align,Pt=Pe.motion,Tt=Pe.maskMotion,xt=Pe.forceRender,Ke=Pe.getPopupContainer,St=Pe.autoDestroy,_t=Pe.portal,lt=Pe.zIndex,At=Pe.onMouseEnter,$=Pe.onMouseLeave,q=Pe.onPointerEnter,Be=Pe.onPointerDownCapture,oe=Pe.ready,ge=Pe.offsetX,Lt=Pe.offsetY,Re=Pe.offsetR,Me=Pe.offsetB,$e=Pe.onAlign,he=Pe.onPrepare,fe=Pe.stretch,Ee=Pe.targetWidth,Ie=Pe.targetHeight,se=typeof Se=="function"?Se():Se,ot=We||Ge,ve=(Ke==null?void 0:Ke.length)>0,Rt=c.useState(!Ke||!ve),Bt=(0,N.Z)(Rt,2),zt=Bt[0],Cr=Bt[1];if((0,u.Z)(function(){!zt&&ve&&de&&Cr(!0)},[zt,ve,de]),!zt)return null;var ar="auto",qt={left:"-1000vw",top:"-1000vh",right:ar,bottom:ar};if(oe||!We){var Dr,Hr=vt.points,pr=vt.dynamicInset||((Dr=vt._experimental)===null||Dr===void 0?void 0:Dr.dynamicInset),gr=pr&&Hr[0][1]==="r",Mt=pr&&Hr[0][0]==="b";gr?(qt.right=Re,qt.left=ar):(qt.left=ge,qt.right=ar),Mt?(qt.bottom=Me,qt.top=ar):(qt.top=Lt,qt.bottom=ar)}var yt={};return fe&&(fe.includes("height")&&Ie?yt.height=Ie:fe.includes("minHeight")&&Ie&&(yt.minHeight=Ie),fe.includes("width")&&Ee?yt.width=Ee:fe.includes("minWidth")&&Ee&&(yt.minWidth=Ee)),We||(yt.pointerEvents="none"),c.createElement(_t,{open:xt||ot,getContainer:Ke&&function(){return Ke(de)},autoDestroy:St},c.createElement(E,{prefixCls:Je,open:We,zIndex:lt,mask:Ct,motion:Tt}),c.createElement(U.Z,{onResize:$e,disabled:!We},function(bt){return c.createElement(C.default,(0,m.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:xt,leavedClassName:"".concat(Je,"-hidden")},Pt,{onAppearPrepare:he,onEnterPrepare:he,visible:We,onVisibleChanged:function(cr){var xr;Pt==null||(xr=Pt.onVisibleChanged)===null||xr===void 0||xr.call(Pt,cr),Le(cr)}}),function(Vt,cr){var xr=Vt.className,Yr=Vt.style,Zr=d()(Je,xr,ze);return c.createElement("div",{ref:(0,M.sQ)(bt,Te,cr),className:Zr,style:(0,R.Z)((0,R.Z)((0,R.Z)((0,R.Z)({"--arrow-x":"".concat(dt.x||0,"px"),"--arrow-y":"".concat(dt.y||0,"px")},qt),yt),Yr),{},{boxSizing:"border-box",zIndex:lt},rt),onMouseEnter:At,onMouseLeave:$,onPointerEnter:q,onClick:gt,onPointerDownCapture:Be},ht&&c.createElement(k,{prefixCls:Je,arrow:ht,arrowPos:dt,align:vt}),c.createElement(I,{cache:!We&&!Xe},se))})}))}),H=F,W=c.forwardRef(function(Pe,Te){var Se=Pe.children,ze=Pe.getTriggerDOMNode,Je=(0,M.Yr)(Se),rt=c.useCallback(function(Le){(0,M.mH)(Te,ze?ze(Le):Le)},[ze]),de=(0,M.x1)(rt,(0,M.C4)(Se));return Je?c.cloneElement(Se,{ref:de}):Se}),z=W,ie=c.createContext(null),re=ie;function _e(Pe){return Pe?Array.isArray(Pe)?Pe:[Pe]:[]}function Ae(Pe,Te,Se,ze){return c.useMemo(function(){var Je=_e(Se!=null?Se:Te),rt=_e(ze!=null?ze:Te),de=new Set(Je),Le=new Set(rt);return Pe&&(de.has("hover")&&(de.delete("hover"),de.add("click")),Le.has("hover")&&(Le.delete("hover"),Le.add("click"))),[de,Le]},[Pe,Te,Se,ze])}var ce=y(29194);function J(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Se=arguments.length>2?arguments[2]:void 0;return Se?Pe[0]===Te[0]:Pe[0]===Te[0]&&Pe[1]===Te[1]}function ae(Pe,Te,Se,ze){for(var Je=Se.points,rt=Object.keys(Pe),de=0;de<rt.length;de+=1){var Le,We=rt[de];if(J((Le=Pe[We])===null||Le===void 0?void 0:Le.points,Je,ze))return"".concat(Te,"-placement-").concat(We)}return""}function G(Pe,Te,Se,ze){return Te||(Se?{motionName:"".concat(Pe,"-").concat(Se)}:ze?{motionName:ze}:null)}function X(Pe){return Pe.ownerDocument.defaultView}function Z(Pe){for(var Te=[],Se=Pe==null?void 0:Pe.parentElement,ze=["hidden","scroll","clip","auto"];Se;){var Je=X(Se).getComputedStyle(Se),rt=Je.overflowX,de=Je.overflowY,Le=Je.overflow;[rt,de,Le].some(function(We){return ze.includes(We)})&&Te.push(Se),Se=Se.parentElement}return Te}function B(Pe){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Pe)?Te:Pe}function O(Pe){return B(parseFloat(Pe),0)}function ne(Pe,Te){var Se=(0,R.Z)({},Pe);return(Te||[]).forEach(function(ze){if(!(ze instanceof HTMLBodyElement||ze instanceof HTMLHtmlElement)){var Je=X(ze).getComputedStyle(ze),rt=Je.overflow,de=Je.overflowClipMargin,Le=Je.borderTopWidth,We=Je.borderBottomWidth,Ge=Je.borderLeftWidth,Xe=Je.borderRightWidth,gt=ze.getBoundingClientRect(),Ct=ze.offsetHeight,ht=ze.clientHeight,dt=ze.offsetWidth,vt=ze.clientWidth,Pt=O(Le),Tt=O(We),xt=O(Ge),Ke=O(Xe),St=B(Math.round(gt.width/dt*1e3)/1e3),_t=B(Math.round(gt.height/Ct*1e3)/1e3),lt=(dt-vt-xt-Ke)*St,At=(Ct-ht-Pt-Tt)*_t,$=Pt*_t,q=Tt*_t,Be=xt*St,oe=Ke*St,ge=0,Lt=0;if(rt==="clip"){var Re=O(de);ge=Re*St,Lt=Re*_t}var Me=gt.x+Be-ge,$e=gt.y+$-Lt,he=Me+gt.width+2*ge-Be-oe-lt,fe=$e+gt.height+2*Lt-$-q-At;Se.left=Math.max(Se.left,Me),Se.top=Math.max(Se.top,$e),Se.right=Math.min(Se.right,he),Se.bottom=Math.min(Se.bottom,fe)}}),Se}function me(Pe){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Se="".concat(Te),ze=Se.match(/^(.*)\%$/);return ze?Pe*(parseFloat(ze[1])/100):parseFloat(Se)}function Oe(Pe,Te){var Se=Te||[],ze=(0,N.Z)(Se,2),Je=ze[0],rt=ze[1];return[me(Pe.width,Je),me(Pe.height,rt)]}function He(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Pe[0],Pe[1]]}function ut(Pe,Te){var Se=Te[0],ze=Te[1],Je,rt;return Se==="t"?rt=Pe.y:Se==="b"?rt=Pe.y+Pe.height:rt=Pe.y+Pe.height/2,ze==="l"?Je=Pe.x:ze==="r"?Je=Pe.x+Pe.width:Je=Pe.x+Pe.width/2,{x:Je,y:rt}}function Fe(Pe,Te){var Se={t:"b",b:"t",l:"r",r:"l"};return Pe.map(function(ze,Je){return Je===Te?Se[ze]||"c":ze}).join("")}function it(Pe,Te,Se,ze,Je,rt,de){var Le=c.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Je[ze]||{}}),We=(0,N.Z)(Le,2),Ge=We[0],Xe=We[1],gt=c.useRef(0),Ct=c.useMemo(function(){return Te?Z(Te):[]},[Te]),ht=c.useRef({}),dt=function(){ht.current={}};Pe||dt();var vt=(0,w.Z)(function(){if(Te&&Se&&Pe){let gi=function(ns,Li){var qi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ci,Hi=ot.x+ns,Fn=ot.y+Li,Vn=Hi+Mt,qn=Fn+gr,Bi=Math.max(Hi,qi.left),Kt=Math.max(Fn,qi.top),sr=Math.min(Vn,qi.right),Mr=Math.min(qn,qi.bottom);return Math.max(0,(sr-Bi)*(Mr-Kt))},Mn=function(){Gi=ot.y+Kr,Ei=Gi+gr,ur=ot.x+Pr,Or=ur+Mt};var xt,Ke,St,_t,lt=Te,At=lt.ownerDocument,$=X(lt),q=$.getComputedStyle(lt),Be=q.position,oe=lt.style.left,ge=lt.style.top,Lt=lt.style.right,Re=lt.style.bottom,Me=lt.style.overflow,$e=(0,R.Z)((0,R.Z)({},Je[ze]),rt),he=At.createElement("div");(xt=lt.parentElement)===null||xt===void 0||xt.appendChild(he),he.style.left="".concat(lt.offsetLeft,"px"),he.style.top="".concat(lt.offsetTop,"px"),he.style.position=Be,he.style.height="".concat(lt.offsetHeight,"px"),he.style.width="".concat(lt.offsetWidth,"px"),lt.style.left="0",lt.style.top="0",lt.style.right="auto",lt.style.bottom="auto",lt.style.overflow="hidden";var fe;if(Array.isArray(Se))fe={x:Se[0],y:Se[1],width:0,height:0};else{var Ee,Ie,se=Se.getBoundingClientRect();se.x=(Ee=se.x)!==null&&Ee!==void 0?Ee:se.left,se.y=(Ie=se.y)!==null&&Ie!==void 0?Ie:se.top,fe={x:se.x,y:se.y,width:se.width,height:se.height}}var ot=lt.getBoundingClientRect(),ve=$.getComputedStyle(lt),Rt=ve.height,Bt=ve.width;ot.x=(Ke=ot.x)!==null&&Ke!==void 0?Ke:ot.left,ot.y=(St=ot.y)!==null&&St!==void 0?St:ot.top;var zt=At.documentElement,Cr=zt.clientWidth,ar=zt.clientHeight,qt=zt.scrollWidth,Dr=zt.scrollHeight,Hr=zt.scrollTop,pr=zt.scrollLeft,gr=ot.height,Mt=ot.width,yt=fe.height,bt=fe.width,Vt={left:0,top:0,right:Cr,bottom:ar},cr={left:-pr,top:-Hr,right:qt-pr,bottom:Dr-Hr},xr=$e.htmlRegion,Yr="visible",Zr="visibleFirst";xr!=="scroll"&&xr!==Zr&&(xr=Yr);var ni=xr===Zr,Jr=ne(cr,Ct),_r=ne(Vt,Ct),ci=xr===Yr?_r:Jr,Rr=ni?_r:ci;lt.style.left="auto",lt.style.top="auto",lt.style.right="0",lt.style.bottom="0";var bi=lt.getBoundingClientRect();lt.style.left=oe,lt.style.top=ge,lt.style.right=Lt,lt.style.bottom=Re,lt.style.overflow=Me,(_t=lt.parentElement)===null||_t===void 0||_t.removeChild(he);var fi=B(Math.round(Mt/parseFloat(Bt)*1e3)/1e3),br=B(Math.round(gr/parseFloat(Rt)*1e3)/1e3);if(fi===0||br===0||(0,S.Sh)(Se)&&!(0,ce.Z)(Se))return;var Ar=$e.offset,Lr=$e.targetOffset,Nr=Oe(ot,Ar),Sr=(0,N.Z)(Nr,2),ir=Sr[0],di=Sr[1],Ur=Oe(fe,Lr),pi=(0,N.Z)(Ur,2),Ji=pi[0],es=pi[1];fe.x-=Ji,fe.y-=es;var Ci=$e.points||[],$i=(0,N.Z)(Ci,2),ms=$i[0],ts=$i[1],si=He(ts),Ir=He(ms),ti=ut(fe,si),mn=ut(ot,Ir),Ai=(0,R.Z)({},$e),Pr=ti.x-mn.x+ir,Kr=ti.y-mn.y+di,ai=gi(Pr,Kr),gn=gi(Pr,Kr,_r),Si=ut(fe,["t","l"]),_n=ut(ot,["t","l"]),vn=ut(fe,["b","r"]),Pi=ut(ot,["b","r"]),en=$e.overflow||{},ct=en.adjustX,fr=en.adjustY,Vr=en.shiftX,yn=en.shiftY,bn=function(Li){return typeof Li=="boolean"?Li:Li>=0},Gi,Ei,ur,Or;Mn();var Ti=bn(fr),ei=Ir[0]===si[0];if(Ti&&Ir[0]==="t"&&(Ei>Rr.bottom||ht.current.bt)){var $r=Kr;ei?$r-=gr-yt:$r=Si.y-Pi.y-di;var Gn=gi(Pr,$r),Ki=gi(Pr,$r,_r);Gn>ai||Gn===ai&&(!ni||Ki>=gn)?(ht.current.bt=!0,Kr=$r,di=-di,Ai.points=[Fe(Ir,0),Fe(si,0)]):ht.current.bt=!1}if(Ti&&Ir[0]==="b"&&(Gi<Rr.top||ht.current.tb)){var hi=Kr;ei?hi+=gr-yt:hi=vn.y-_n.y-di;var Yt=gi(Pr,hi),oi=gi(Pr,hi,_r);Yt>ai||Yt===ai&&(!ni||oi>=gn)?(ht.current.tb=!0,Kr=hi,di=-di,Ai.points=[Fe(Ir,0),Fe(si,0)]):ht.current.tb=!1}var Qr=bn(ct),Oi=Ir[1]===si[1];if(Qr&&Ir[1]==="l"&&(Or>Rr.right||ht.current.rl)){var Sn=Pr;Oi?Sn-=Mt-bt:Sn=Si.x-Pi.x-ir;var En=gi(Sn,Kr),Kn=gi(Sn,Kr,_r);En>ai||En===ai&&(!ni||Kn>=gn)?(ht.current.rl=!0,Pr=Sn,ir=-ir,Ai.points=[Fe(Ir,1),Fe(si,1)]):ht.current.rl=!1}if(Qr&&Ir[1]==="r"&&(ur<Rr.left||ht.current.lr)){var xn=Pr;Oi?xn+=Mt-bt:xn=vn.x-_n.x-ir;var Xr=gi(xn,Kr),tn=gi(xn,Kr,_r);Xr>ai||Xr===ai&&(!ni||tn>=gn)?(ht.current.lr=!0,Pr=xn,ir=-ir,Ai.points=[Fe(Ir,1),Fe(si,1)]):ht.current.lr=!1}Mn();var Di=Vr===!0?0:Vr;typeof Di=="number"&&(ur<_r.left&&(Pr-=ur-_r.left-ir,fe.x+bt<_r.left+Di&&(Pr+=fe.x-_r.left+bt-Di)),Or>_r.right&&(Pr-=Or-_r.right-ir,fe.x>_r.right-Di&&(Pr+=fe.x-_r.right+Di)));var Vi=yn===!0?0:yn;typeof Vi=="number"&&(Gi<_r.top&&(Kr-=Gi-_r.top-di,fe.y+yt<_r.top+Vi&&(Kr+=fe.y-_r.top+yt-Vi)),Ei>_r.bottom&&(Kr-=Ei-_r.bottom-di,fe.y>_r.bottom-Vi&&(Kr+=fe.y-_r.bottom+Vi)));var Mi=ot.x+Pr,Ri=Mi+Mt,mr=ot.y+Kr,wn=mr+gr,rn=fe.x,nn=rn+bt,li=fe.y,nr=li+yt,rs=Math.max(Mi,rn),Ft=Math.min(Ri,nn),ui=(rs+Ft)/2,In=ui-Mi,Pn=Math.max(mr,li),mi=Math.min(wn,nr),zi=(Pn+mi)/2,or=zi-mr;de==null||de(Te,Ai);var Fi=bi.right-ot.x-(Pr+ot.width),On=bi.bottom-ot.y-(Kr+ot.height);fi===1&&(Pr=Math.floor(Pr),Fi=Math.floor(Fi)),br===1&&(Kr=Math.floor(Kr),On=Math.floor(On));var is={ready:!0,offsetX:Pr/fi,offsetY:Kr/br,offsetR:Fi/fi,offsetB:On/br,arrowX:In/fi,arrowY:or/br,scaleX:fi,scaleY:br,align:Ai};Xe(is)}}),Pt=function(){gt.current+=1;var Ke=gt.current;Promise.resolve().then(function(){gt.current===Ke&&vt()})},Tt=function(){Xe(function(Ke){return(0,R.Z)((0,R.Z)({},Ke),{},{ready:!1})})};return(0,u.Z)(Tt,[ze]),(0,u.Z)(function(){Pe||Tt()},[Pe]),[Ge.ready,Ge.offsetX,Ge.offsetY,Ge.offsetR,Ge.offsetB,Ge.arrowX,Ge.arrowY,Ge.scaleX,Ge.scaleY,Ge.align,Pt]}var st=y(77654);function et(Pe,Te,Se,ze,Je){(0,u.Z)(function(){if(Pe&&Te&&Se){let gt=function(){ze(),Je()};var rt=Te,de=Se,Le=Z(rt),We=Z(de),Ge=X(de),Xe=new Set([Ge].concat((0,st.Z)(Le),(0,st.Z)(We)));return Xe.forEach(function(Ct){Ct.addEventListener("scroll",gt,{passive:!0})}),Ge.addEventListener("resize",gt,{passive:!0}),ze(),function(){Xe.forEach(function(Ct){Ct.removeEventListener("scroll",gt),Ge.removeEventListener("resize",gt)})}}},[Pe,Te,Se])}var Nt=y(48736);function tt(Pe,Te,Se,ze,Je,rt,de,Le){var We=c.useRef(Pe);We.current=Pe;var Ge=c.useRef(!1);c.useEffect(function(){if(Te&&ze&&(!Je||rt)){var gt=function(){Ge.current=!1},Ct=function(St){var _t;We.current&&!de(((_t=St.composedPath)===null||_t===void 0||(_t=_t.call(St))===null||_t===void 0?void 0:_t[0])||St.target)&&!Ge.current&&Le(!1)},ht=X(ze);ht.addEventListener("pointerdown",gt,!0),ht.addEventListener("mousedown",Ct,!0),ht.addEventListener("contextmenu",Ct,!0);var dt=(0,s.A)(Se);if(dt&&(dt.addEventListener("mousedown",Ct,!0),dt.addEventListener("contextmenu",Ct,!0)),0)var vt,Pt,Tt,xt;return function(){ht.removeEventListener("pointerdown",gt,!0),ht.removeEventListener("mousedown",Ct,!0),ht.removeEventListener("contextmenu",Ct,!0),dt&&(dt.removeEventListener("mousedown",Ct,!0),dt.removeEventListener("contextmenu",Ct,!0))}}},[Te,Se,ze,Je,rt]);function Xe(){Ge.current=!0}return Xe}var kt=["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 Ne(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P.Z,Te=c.forwardRef(function(Se,ze){var Je=Se.prefixCls,rt=Je===void 0?"rc-trigger-popup":Je,de=Se.children,Le=Se.action,We=Le===void 0?"hover":Le,Ge=Se.showAction,Xe=Se.hideAction,gt=Se.popupVisible,Ct=Se.defaultPopupVisible,ht=Se.onPopupVisibleChange,dt=Se.afterPopupVisibleChange,vt=Se.mouseEnterDelay,Pt=Se.mouseLeaveDelay,Tt=Pt===void 0?.1:Pt,xt=Se.focusDelay,Ke=Se.blurDelay,St=Se.mask,_t=Se.maskClosable,lt=_t===void 0?!0:_t,At=Se.getPopupContainer,$=Se.forceRender,q=Se.autoDestroy,Be=Se.destroyPopupOnHide,oe=Se.popup,ge=Se.popupClassName,Lt=Se.popupStyle,Re=Se.popupPlacement,Me=Se.builtinPlacements,$e=Me===void 0?{}:Me,he=Se.popupAlign,fe=Se.zIndex,Ee=Se.stretch,Ie=Se.getPopupClassNameFromAlign,se=Se.fresh,ot=Se.alignPoint,ve=Se.onPopupClick,Rt=Se.onPopupAlign,Bt=Se.arrow,zt=Se.popupMotion,Cr=Se.maskMotion,ar=Se.popupTransitionName,qt=Se.popupAnimation,Dr=Se.maskTransitionName,Hr=Se.maskAnimation,pr=Se.className,gr=Se.getTriggerDOMNode,Mt=(0,K.Z)(Se,kt),yt=q||Be||!1,bt=c.useState(!1),Vt=(0,N.Z)(bt,2),cr=Vt[0],xr=Vt[1];(0,u.Z)(function(){xr((0,l.Z)())},[]);var Yr=c.useRef({}),Zr=c.useContext(re),ni=c.useMemo(function(){return{registerSubPopup:function(sr,Mr){Yr.current[sr]=Mr,Zr==null||Zr.registerSubPopup(sr,Mr)}}},[Zr]),Jr=(0,f.Z)(),_r=c.useState(null),ci=(0,N.Z)(_r,2),Rr=ci[0],bi=ci[1],fi=c.useRef(null),br=(0,w.Z)(function(Kt){fi.current=Kt,(0,S.Sh)(Kt)&&Rr!==Kt&&bi(Kt),Zr==null||Zr.registerSubPopup(Jr,Kt)}),Ar=c.useState(null),Lr=(0,N.Z)(Ar,2),Nr=Lr[0],Sr=Lr[1],ir=c.useRef(null),di=(0,w.Z)(function(Kt){(0,S.Sh)(Kt)&&Nr!==Kt&&(Sr(Kt),ir.current=Kt)}),Ur=c.Children.only(de),pi=(Ur==null?void 0:Ur.props)||{},Ji={},es=(0,w.Z)(function(Kt){var sr,Mr,dr=Nr;return(dr==null?void 0:dr.contains(Kt))||((sr=(0,s.A)(dr))===null||sr===void 0?void 0:sr.host)===Kt||Kt===dr||(Rr==null?void 0:Rr.contains(Kt))||((Mr=(0,s.A)(Rr))===null||Mr===void 0?void 0:Mr.host)===Kt||Kt===Rr||Object.values(Yr.current).some(function(yr){return(yr==null?void 0:yr.contains(Kt))||Kt===yr})}),Ci=G(rt,zt,qt,ar),$i=G(rt,Cr,Hr,Dr),ms=c.useState(Ct||!1),ts=(0,N.Z)(ms,2),si=ts[0],Ir=ts[1],ti=gt!=null?gt:si,mn=(0,w.Z)(function(Kt){gt===void 0&&Ir(Kt)});(0,u.Z)(function(){Ir(gt||!1)},[gt]);var Ai=c.useRef(ti);Ai.current=ti;var Pr=c.useRef([]);Pr.current=[];var Kr=(0,w.Z)(function(Kt){var sr;mn(Kt),((sr=Pr.current[Pr.current.length-1])!==null&&sr!==void 0?sr:ti)!==Kt&&(Pr.current.push(Kt),ht==null||ht(Kt))}),ai=c.useRef(),gn=function(){clearTimeout(ai.current)},Si=function(sr){var Mr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;gn(),Mr===0?Kr(sr):ai.current=setTimeout(function(){Kr(sr)},Mr*1e3)};c.useEffect(function(){return gn},[]);var _n=c.useState(!1),vn=(0,N.Z)(_n,2),Pi=vn[0],en=vn[1];(0,u.Z)(function(Kt){(!Kt||ti)&&en(!0)},[ti]);var ct=c.useState(null),fr=(0,N.Z)(ct,2),Vr=fr[0],yn=fr[1],bn=c.useState(null),Gi=(0,N.Z)(bn,2),Ei=Gi[0],ur=Gi[1],Or=function(sr){ur([sr.clientX,sr.clientY])},Ti=it(ti,Rr,ot&&Ei!==null?Ei:Nr,Re,$e,he,Rt),ei=(0,N.Z)(Ti,11),$r=ei[0],Gn=ei[1],Ki=ei[2],hi=ei[3],Yt=ei[4],oi=ei[5],Qr=ei[6],Oi=ei[7],Sn=ei[8],En=ei[9],Kn=ei[10],xn=Ae(cr,We,Ge,Xe),Xr=(0,N.Z)(xn,2),tn=Xr[0],Di=Xr[1],Vi=tn.has("click"),Mi=Di.has("click")||Di.has("contextMenu"),Ri=(0,w.Z)(function(){Pi||Kn()}),mr=function(){Ai.current&&ot&&Mi&&Si(!1)};et(ti,Nr,Rr,Ri,mr),(0,u.Z)(function(){Ri()},[Ei,Re]),(0,u.Z)(function(){ti&&!($e!=null&&$e[Re])&&Ri()},[JSON.stringify(he)]);var wn=c.useMemo(function(){var Kt=ae($e,rt,En,ot);return d()(Kt,Ie==null?void 0:Ie(En))},[En,Ie,$e,rt,ot]);c.useImperativeHandle(ze,function(){return{nativeElement:ir.current,popupElement:fi.current,forceAlign:Ri}});var rn=c.useState(0),nn=(0,N.Z)(rn,2),li=nn[0],nr=nn[1],rs=c.useState(0),Ft=(0,N.Z)(rs,2),ui=Ft[0],In=Ft[1],Pn=function(){if(Ee&&Nr){var sr=Nr.getBoundingClientRect();nr(sr.width),In(sr.height)}},mi=function(){Pn(),Ri()},zi=function(sr){en(!1),Kn(),dt==null||dt(sr)},or=function(){return new Promise(function(sr){Pn(),yn(function(){return sr})})};(0,u.Z)(function(){Vr&&(Kn(),Vr(),yn(null))},[Vr]);function Fi(Kt,sr,Mr,dr){Ji[Kt]=function(yr){var sn;dr==null||dr(yr),Si(sr,Mr);for(var Yi=arguments.length,an=new Array(Yi>1?Yi-1:0),Bn=1;Bn<Yi;Bn++)an[Bn-1]=arguments[Bn];(sn=pi[Kt])===null||sn===void 0||sn.call.apply(sn,[pi,yr].concat(an))}}(Vi||Mi)&&(Ji.onClick=function(Kt){var sr;Ai.current&&Mi?Si(!1):!Ai.current&&Vi&&(Or(Kt),Si(!0));for(var Mr=arguments.length,dr=new Array(Mr>1?Mr-1:0),yr=1;yr<Mr;yr++)dr[yr-1]=arguments[yr];(sr=pi.onClick)===null||sr===void 0||sr.call.apply(sr,[pi,Kt].concat(dr))});var On=tt(ti,Mi,Nr,Rr,St,lt,es,Si),is=tn.has("hover"),gi=Di.has("hover"),Mn,ns;is&&(Fi("onMouseEnter",!0,vt,function(Kt){Or(Kt)}),Fi("onPointerEnter",!0,vt,function(Kt){Or(Kt)}),Mn=function(sr){(ti||Pi)&&Rr!==null&&Rr!==void 0&&Rr.contains(sr.target)&&Si(!0,vt)},ot&&(Ji.onMouseMove=function(Kt){var sr;(sr=pi.onMouseMove)===null||sr===void 0||sr.call(pi,Kt)})),gi&&(Fi("onMouseLeave",!1,Tt),Fi("onPointerLeave",!1,Tt),ns=function(){Si(!1,Tt)}),tn.has("focus")&&Fi("onFocus",!0,xt),Di.has("focus")&&Fi("onBlur",!1,Ke),tn.has("contextMenu")&&(Ji.onContextMenu=function(Kt){var sr;Ai.current&&Di.has("contextMenu")?Si(!1):(Or(Kt),Si(!0)),Kt.preventDefault();for(var Mr=arguments.length,dr=new Array(Mr>1?Mr-1:0),yr=1;yr<Mr;yr++)dr[yr-1]=arguments[yr];(sr=pi.onContextMenu)===null||sr===void 0||sr.call.apply(sr,[pi,Kt].concat(dr))}),pr&&(Ji.className=d()(pi.className,pr));var Li=c.useRef(!1);Li.current||(Li.current=$||ti||Pi);var qi=(0,R.Z)((0,R.Z)({},pi),Ji),Hi={},Fn=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Fn.forEach(function(Kt){Mt[Kt]&&(Hi[Kt]=function(){for(var sr,Mr=arguments.length,dr=new Array(Mr),yr=0;yr<Mr;yr++)dr[yr]=arguments[yr];(sr=qi[Kt])===null||sr===void 0||sr.call.apply(sr,[qi].concat(dr)),Mt[Kt].apply(Mt,dr)})});var Vn=c.cloneElement(Ur,(0,R.Z)((0,R.Z)({},qi),Hi)),qn={x:oi,y:Qr},Bi=Bt?(0,R.Z)({},Bt!==!0?Bt:{}):null;return c.createElement(c.Fragment,null,c.createElement(U.Z,{disabled:!ti,ref:di,onResize:mi},c.createElement(z,{getTriggerDOMNode:gr},Vn)),Li.current&&c.createElement(re.Provider,{value:ni},c.createElement(H,{portal:Pe,ref:br,prefixCls:rt,popup:oe,className:d()(ge,wn),style:Lt,target:Nr,onMouseEnter:Mn,onMouseLeave:ns,onPointerEnter:Mn,zIndex:fe,open:ti,keepDom:Pi,fresh:se,onClick:ve,onPointerDownCapture:On,mask:St,motion:Ci,maskMotion:$i,onVisibleChanged:zi,onPrepare:or,forceRender:$,autoDestroy:yt,getPopupContainer:At,align:En,arrow:Bi,arrowPos:qn,ready:$r,offsetX:Gn,offsetY:Ki,offsetR:hi,offsetB:Yt,onAlign:Ri,stretch:Ee,targetWidth:li/Oi,targetHeight:ui/Sn})))});return Te}var ft=Ne(P.Z)},46214:function(){"use strict"},55797:function(Ot,ke){"use strict";ke.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"}},90736:function(Ot,ke,y){"use strict";var R=y(59301),N=y(4977),K=y(7939),P=Object.defineProperty,A=Object.defineProperties,d=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,w=(c,m,C)=>m in c?P(c,m,{enumerable:!0,configurable:!0,writable:!0,value:C}):c[m]=C,f=(c,m)=>{for(var C in m||(m={}))S.call(m,C)&&w(c,C,m[C]);if(U)for(var C of U(m))s.call(m,C)&&w(c,C,m[C]);return c},u=(c,m)=>A(c,d(m));const l=({img:c,buttonProps:m={},styles:C={},customText:M,ButtonText:k,ButtonClick:E,Buttonclass:T,ButtonTwo:I,imgStyles:F,loading:H=!1,className:W=""})=>R.createElement("section",{className:`tc animated fadeIn ${W}`,style:f({color:"#999",margin:"100px auto",visibility:H?"hidden":"visible"},C)},R.createElement("img",{src:c||N,style:u(f({},F),{pointerEvents:"none",userSelect:"none"})}),R.createElement("p",{className:"mt20 font14"},M||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),k&&R.createElement(K.ZP,f({className:T,onClick:E},m),k),I&&I);ke.Z=l},86974:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return T}});var R=y(59301),N={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",showClose:"showClose___edZQA",embed:"embed___hvpEJ"},K=y(7939),P=y(70557),A=y(34728),d=y(25399),U=y(76406),S=y(84849),s=y(90736),w=y(14185),f=y(52078),u=y(59301),l=Object.defineProperty,c=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,M=(I,F,H)=>F in I?l(I,F,{enumerable:!0,configurable:!0,writable:!0,value:H}):I[F]=H,k=(I,F)=>{for(var H in F||(F={}))m.call(F,H)&&M(I,H,F[H]);if(c)for(var H of c(F))C.call(F,H)&&M(I,H,F[H]);return I},E=(I,F,H)=>new Promise((W,z)=>{var ie=Ae=>{try{_e(H.next(Ae))}catch(ce){z(ce)}},re=Ae=>{try{_e(H.throw(Ae))}catch(ce){z(ce)}},_e=Ae=>Ae.done?W(Ae.value):Promise.resolve(Ae.value).then(ie,re);_e((H=H.apply(I,F)).next())}),T=({editOffice:I="view",data:F,issaver:H,onSaver:W,theme:z,type:ie,filename:re,monacoEditor:_e,className:Ae,style:ce,close:J,onClose:ae,hasMask:G,disabledDownload:X,onImgDimensions:Z,showNodata:B,recordInfo:O})=>{const[ne,me]=(0,R.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[Oe,He]=(0,R.useState)(""),[ut,Fe]=(0,R.useState)(),it=window.ENV==="build"?"/react/build":"",st=location.host.startsWith("localhost")?w.Z.PROXY_SERVER:w.Z.API_SERVER,Nt=10*(1024*1024),tt=(0,R.useRef)();F!=null&&F.startsWith("/api")&&ie!=="txt"&&(F=w.Z.API_SERVER+F);const kt=ze=>ze.substring(ze.lastIndexOf("/")+1).split(".").pop();re&&_e&&(_e.filename=re),(0,R.useEffect)(()=>{var ze,Je;const rt=(Je=(ze=document.cookie)==null?void 0:ze.replace(/\s/g,""))==null?void 0:Je.split(";");rt==null||rt.map(de=>{let Le=de.split("=");Le[0]==="_educoder_session"&&He(Le[1])})},[]),(0,R.useEffect)(()=>{ie==="office"&&(F.indexOf("bigfilescdn.")>-1||F.indexOf("bigfiles1")>-1?Fe({url:F,fileType:kt(F),model:F.indexOf("model=edit")?"edit":"view"}):F.indexOf("coze")>-1?Fe({url:F,fileType:"doc",model:"view"}):ft())},[ie,F]);function Ne(ze){return E(this,null,function*(){ze.data.type==="pdfdata"&&(W(ze.data.data),window.removeEventListener("message",Ne,!1)),console.log("mess---:",ze.data)})}const ft=()=>E(void 0,null,function*(){console.log("data:",F);let ze=F;F.startsWith("http")||(ze=location.origin+ze);let Je=new URL(ze).pathname.split("/").pop();const rt=yield(0,S.gJ)({attachment_id:Je});rt.url=st+rt.url,Fe(rt)}),Pe=()=>{if(F.startsWith("http")||F.startsWith("blob:")){Te();return}(0,U.Sv)(re||"educoder",F,re)},Te=()=>{O&&(0,f.fc)({id:O==null?void 0:O.id,watch_type:1,course_id:O==null?void 0:O.course_id}),(0,U.Nd)(re||"educoder",decodeURIComponent(F))};(0,R.useEffect)(()=>(window.addEventListener("message",Se),()=>{window.removeEventListener("message",Se)}),[]);const Se=ze=>{var Je;((Je=ze==null?void 0:ze.data)==null?void 0:Je.type)==="closePop"&&ae()};return u.createElement("div",{style:k({},ce||{}),className:`${G&&N.bgBlack} ${ie?N.wrp:"hide"}`},!!ie&&J&&u.createElement("div",{id:"closePop",className:N.close,ref:tt},!!Z&&u.createElement(d.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>tt.current},u.createElement("span",{onClick:()=>{ae(),Z()}},u.createElement("i",{className:"icon-yulanpizhu"}))),!X&&window.parent===window&&u.createElement(d.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>tt.current},u.createElement("span",{onClick:Te},u.createElement("i",{className:"icon-quxiaozhiding"}))),H&&u.createElement(d.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>tt.current},u.createElement("span",{className:"",onClick:()=>{const ze=document.getElementById("pdfiframe");window.addEventListener("message",Ne,!1),setTimeout(()=>{ze.contentWindow.postMessage("getData","*")},300)}},u.createElement("i",{className:"icon-baocun"}))),u.createElement(d.Z,{title:"\u5173\u95ED",getPopupContainer:()=>tt.current},u.createElement("span",{className:"",onClick:()=>{ae()}},u.createElement("i",{className:"icon-guanbi1"})))),u.createElement("div",{className:`${N[Ae]} ${Ae} ${N.monaco} ${ie==="txt"?"show":"hide"}`},ie==="txt"&&u.createElement(u.Fragment,null,u.createElement(A.ZP,k({},_e)))),ie==="audio"&&u.createElement("audio",{controls:!0,src:`${(F==null?void 0:F.indexOf("http://"))>-1||(F==null?void 0:F.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${F}`,autoPlay:!0}),ie==="video"&&u.createElement(u.Fragment,null,(F==null?void 0:F.indexOf("http"))>-1?u.createElement("video",{controls:!0,src:`${F}`,autoPlay:!0}):u.createElement("video",{controls:!0,src:`data:video/mp4;base64,${F}`,autoPlay:!0})),ie==="office"&&ut&&u.createElement("iframe",{src:`${it}/office.html?key=${ut.key}&url=${btoa(ut.url)}&callbackUrl=${st+(ut.callbackUrl||"")}&fileType=${ut.fileType}&title=${ut.title||""}&model=${I}&officeServer=${w.Z.ONLYOFFICE}&disabledDownload=${!!X}`}),ie==="html"&&u.createElement("iframe",{src:F+"&disposition=inline"}),ie==="pdf"&&u.createElement("iframe",{id:"pdfiframe",src:`${it}/js/pdf/index.html?filename=${re||"educoder.pdf"}&url=${encodeURIComponent(F)}&disabledDownload=${!!X}&model=${I}`}),ie==="image"&&u.createElement("img",{src:`${(F==null?void 0:F.indexOf("http://"))>-1||(F==null?void 0:F.indexOf("https://"))>-1?"":"data:image/png;base64,"}${F}`}),(ie==="other"||ie==="download")&&u.createElement(u.Fragment,null,B?u.createElement(s.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:u.createElement(K.ZP,{icon:u.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Pe,disabled:X},"\u4E0B\u8F7D")}):u.createElement(K.ZP,{type:"primary",size:"middle",onClick:Pe,disabled:X},u.createElement(P.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")),ie==="flowChart"&&u.createElement("div",{className:"embed"},u.createElement("iframe",{src:`/drawio/src/main/webapp/viewer.html?id=${F||""}&gapi=0&od=0&db=0&gh=0&gl=0`,width:"100%",height:"100%",frameBorder:"0"})))}},35883:function(Ot,ke,y){"use strict";y.d(ke,{z:function(){return _e},Z:function(){return Ae}});var R=y(59301),N=y(46214),K=y(20047),P=y(64018),A=y(16471),d=y(14185),U=y(76406),S=y(15342),s=y(44104),w=y(7939),f=y(1012),u=y(86974),l=y(59301),m=({html:ce})=>{const J=(0,R.useRef)(null),ae=(0,R.useRef)(null),G=`.markdown-body p {
|
|
|
margin: 0 0 16px 0 !important;
|
|
|
line-height: 28px;
|
|
|
white-space: pre-wrap;
|
|
|
}
|
|
|
|
|
|
ol,
|
|
|
ul,
|
|
|
li {
|
|
|
list-style-type: none
|
|
|
}
|
|
|
|
|
|
ol,
|
|
|
ul,
|
|
|
dl {
|
|
|
margin-bottom: 0px;
|
|
|
}
|
|
|
|
|
|
.markdown-body {
|
|
|
-ms-text-size-adjust: 100%;
|
|
|
-webkit-text-size-adjust: 100%;
|
|
|
color: #333;
|
|
|
overflow: hidden;
|
|
|
font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif;
|
|
|
word-break: break-word;
|
|
|
font-size: 16px;
|
|
|
line-height: 1.6;
|
|
|
white-space: normal;
|
|
|
word-wrap: break-word;
|
|
|
position: relative;
|
|
|
}
|
|
|
|
|
|
.markdown-body ul>li {
|
|
|
list-style-type: disc;
|
|
|
}
|
|
|
|
|
|
.markdown-body ol>li {
|
|
|
list-style-type: decimal;
|
|
|
}
|
|
|
|
|
|
.markdown-body a {
|
|
|
background: transparent;
|
|
|
}
|
|
|
|
|
|
.markdown-body a:active,
|
|
|
.markdown-body a:hover {
|
|
|
outline: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body strong {
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
|
|
|
.markdown-body h1 {
|
|
|
font-size: 2em;
|
|
|
margin: 0.67em 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body img {
|
|
|
border: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body hr {
|
|
|
-moz-box-sizing: content-box;
|
|
|
box-sizing: content-box;
|
|
|
height: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body pre {
|
|
|
overflow: auto;
|
|
|
}
|
|
|
|
|
|
.markdown-body code,
|
|
|
.markdown-body kbd,
|
|
|
.markdown-body pre {
|
|
|
font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
|
|
|
font-size: 1em;
|
|
|
}
|
|
|
|
|
|
.markdown-body input {
|
|
|
color: inherit;
|
|
|
font: inherit;
|
|
|
margin: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body html input[disabled] {
|
|
|
cursor: default;
|
|
|
}
|
|
|
|
|
|
.markdown-body input {
|
|
|
line-height: normal;
|
|
|
}
|
|
|
|
|
|
.markdown-body input[type="checkbox"] {
|
|
|
-moz-box-sizing: border-box;
|
|
|
box-sizing: border-box;
|
|
|
padding: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body table {
|
|
|
border-collapse: collapse;
|
|
|
border-spacing: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body td,
|
|
|
.markdown-body th {
|
|
|
padding: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body * {
|
|
|
-moz-box-sizing: border-box;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
|
|
|
.markdown-body input {
|
|
|
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
|
|
}
|
|
|
|
|
|
.markdown-body a {
|
|
|
color: #4183c4;
|
|
|
text-decoration: none;
|
|
|
}
|
|
|
|
|
|
.markdown-body a:hover,
|
|
|
.markdown-body a:active {
|
|
|
text-decoration: underline;
|
|
|
}
|
|
|
|
|
|
.markdown-body hr {
|
|
|
height: 0;
|
|
|
margin: 15px 0;
|
|
|
overflow: hidden;
|
|
|
background: transparent;
|
|
|
border: 0;
|
|
|
border-bottom: 1px solid #ddd;
|
|
|
}
|
|
|
|
|
|
.markdown-body hr:before {
|
|
|
display: table;
|
|
|
content: "";
|
|
|
}
|
|
|
|
|
|
.markdown-body hr:after {
|
|
|
display: table;
|
|
|
clear: both;
|
|
|
content: "";
|
|
|
}
|
|
|
|
|
|
.markdown-body h1,
|
|
|
.markdown-body h2,
|
|
|
.markdown-body h3,
|
|
|
.markdown-body h4,
|
|
|
.markdown-body h5,
|
|
|
.markdown-body h6 {
|
|
|
margin-top: 15px;
|
|
|
margin-bottom: 15px;
|
|
|
line-height: 1.1;
|
|
|
}
|
|
|
|
|
|
.markdown-body h1 {
|
|
|
font-size: 30px;
|
|
|
}
|
|
|
|
|
|
.markdown-body h2 {
|
|
|
font-size: 21px;
|
|
|
}
|
|
|
|
|
|
.markdown-body h3 {
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
|
|
|
.markdown-body h4 {
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
|
|
|
.markdown-body h5 {
|
|
|
font-size: 12px;
|
|
|
}
|
|
|
|
|
|
.markdown-body h6 {
|
|
|
font-size: 11px;
|
|
|
}
|
|
|
|
|
|
.markdown-body blockquote {
|
|
|
margin: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body ul,
|
|
|
.markdown-body ol {
|
|
|
padding: 0;
|
|
|
margin-top: 0;
|
|
|
margin-bottom: 0;
|
|
|
}
|
|
|
|
|
|
ul.linenums,
|
|
|
ol.linenums {
|
|
|
padding: 16px 0 0 56px !important;
|
|
|
}
|
|
|
|
|
|
.markdown-body ul,
|
|
|
.markdown-body ol {
|
|
|
padding-left: 2em;
|
|
|
}
|
|
|
|
|
|
|
|
|
.markdown-body ol ol,
|
|
|
.markdown-body ul ol {
|
|
|
list-style-type: lower-roman;
|
|
|
}
|
|
|
|
|
|
.markdown-body ul ul ol,
|
|
|
.markdown-body ul ol ol,
|
|
|
.markdown-body ol ul ol,
|
|
|
.markdown-body ol ol ol {
|
|
|
list-style-type: lower-alpha;
|
|
|
}
|
|
|
|
|
|
.markdown-body dd {
|
|
|
margin-left: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body code {
|
|
|
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
|
font-size: 12px;
|
|
|
}
|
|
|
|
|
|
.markdown-body pre {
|
|
|
margin-top: 0;
|
|
|
margin-bottom: 0;
|
|
|
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
|
}
|
|
|
|
|
|
.markdown-body .octicon {
|
|
|
font: normal normal 16px octicons-anchor;
|
|
|
line-height: 1;
|
|
|
display: inline-block;
|
|
|
text-decoration: none;
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
-moz-osx-font-smoothing: grayscale;
|
|
|
-webkit-user-select: none;
|
|
|
-moz-user-select: none;
|
|
|
-ms-user-select: none;
|
|
|
user-select: none;
|
|
|
}
|
|
|
|
|
|
.markdown-body .octicon-link:before {
|
|
|
content: '\f05c';
|
|
|
}
|
|
|
|
|
|
.markdown-body>*:first-child {
|
|
|
margin-top: 0 !important;
|
|
|
}
|
|
|
|
|
|
.markdown-body>*:last-child {
|
|
|
margin-bottom: 0 !important;
|
|
|
}
|
|
|
|
|
|
.markdown-body .anchor {
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
display: block;
|
|
|
padding-right: 6px;
|
|
|
padding-left: 30px;
|
|
|
margin-left: -30px;
|
|
|
}
|
|
|
|
|
|
.markdown-body .anchor:focus {
|
|
|
outline: none;
|
|
|
}
|
|
|
|
|
|
.markdown-body h1,
|
|
|
.markdown-body h2,
|
|
|
.markdown-body h3,
|
|
|
.markdown-body h4,
|
|
|
.markdown-body h5,
|
|
|
.markdown-body h6 {
|
|
|
position: relative;
|
|
|
margin-top: 1em;
|
|
|
margin-bottom: 16px;
|
|
|
font-weight: bold;
|
|
|
line-height: 1.4;
|
|
|
}
|
|
|
|
|
|
.markdown-body h1 .octicon-link,
|
|
|
.markdown-body h2 .octicon-link,
|
|
|
.markdown-body h3 .octicon-link,
|
|
|
.markdown-body h4 .octicon-link,
|
|
|
.markdown-body h5 .octicon-link,
|
|
|
.markdown-body h6 .octicon-link {
|
|
|
display: none;
|
|
|
color: #000;
|
|
|
vertical-align: middle;
|
|
|
}
|
|
|
|
|
|
.markdown-body h1:hover .anchor,
|
|
|
.markdown-body h2:hover .anchor,
|
|
|
.markdown-body h3:hover .anchor,
|
|
|
.markdown-body h4:hover .anchor,
|
|
|
.markdown-body h5:hover .anchor,
|
|
|
.markdown-body h6:hover .anchor {
|
|
|
padding-left: 8px;
|
|
|
margin-left: -30px;
|
|
|
text-decoration: none;
|
|
|
}
|
|
|
|
|
|
.markdown-body h1:hover .anchor .octicon-link,
|
|
|
.markdown-body h2:hover .anchor .octicon-link,
|
|
|
.markdown-body h3:hover .anchor .octicon-link,
|
|
|
.markdown-body h4:hover .anchor .octicon-link,
|
|
|
.markdown-body h5:hover .anchor .octicon-link,
|
|
|
.markdown-body h6:hover .anchor .octicon-link {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
|
|
|
.markdown-body h1 {
|
|
|
padding-bottom: 0.3em;
|
|
|
font-size: 2.25em;
|
|
|
line-height: 1.2;
|
|
|
border-bottom: 1px solid #eee;
|
|
|
}
|
|
|
|
|
|
.markdown-body h1 .anchor {
|
|
|
line-height: 1;
|
|
|
}
|
|
|
|
|
|
.markdown-body h2 {
|
|
|
padding-bottom: 0.3em;
|
|
|
font-size: 1.75em;
|
|
|
line-height: 1.225;
|
|
|
border-bottom: 1px solid #eee;
|
|
|
}
|
|
|
|
|
|
.markdown-body h2 .anchor {
|
|
|
line-height: 1;
|
|
|
}
|
|
|
|
|
|
.markdown-body h3 {
|
|
|
font-size: 1.5em;
|
|
|
line-height: 1.43;
|
|
|
}
|
|
|
|
|
|
.markdown-body h3 .anchor {
|
|
|
line-height: 1.2;
|
|
|
}
|
|
|
|
|
|
.markdown-body h4 {
|
|
|
font-size: 1.25em;
|
|
|
}
|
|
|
|
|
|
.markdown-body h4 .anchor {
|
|
|
line-height: 1.2;
|
|
|
}
|
|
|
|
|
|
.markdown-body h5 {
|
|
|
font-size: 1em;
|
|
|
}
|
|
|
|
|
|
.markdown-body h5 .anchor {
|
|
|
line-height: 1.1;
|
|
|
}
|
|
|
|
|
|
.markdown-body h6 {
|
|
|
font-size: 1em;
|
|
|
color: #777;
|
|
|
}
|
|
|
|
|
|
.markdown-body h6 .anchor {
|
|
|
line-height: 1.1;
|
|
|
}
|
|
|
|
|
|
.markdown-body p,
|
|
|
.markdown-body blockquote,
|
|
|
.markdown-body ul,
|
|
|
.markdown-body ol,
|
|
|
.markdown-body dl,
|
|
|
.markdown-body table,
|
|
|
.markdown-body pre {
|
|
|
margin-top: 0;
|
|
|
margin-bottom: 16px;
|
|
|
}
|
|
|
|
|
|
.markdown-body ul ul,
|
|
|
.markdown-body ul ol,
|
|
|
.markdown-body ol ol,
|
|
|
.markdown-body ol ul {
|
|
|
margin-top: 0;
|
|
|
margin-bottom: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body li>p {
|
|
|
margin-top: 16px;
|
|
|
}
|
|
|
|
|
|
.markdown-body dl {
|
|
|
padding: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body dl dt {
|
|
|
padding: 0;
|
|
|
margin-top: 16px;
|
|
|
font-size: 1em;
|
|
|
font-style: italic;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
|
|
|
.markdown-body dl dd {
|
|
|
padding: 0 16px;
|
|
|
margin-bottom: 16px;
|
|
|
}
|
|
|
|
|
|
.markdown-body blockquote {
|
|
|
padding: 0 15px;
|
|
|
color: #777;
|
|
|
border-left: 4px solid #ddd;
|
|
|
}
|
|
|
|
|
|
.markdown-body blockquote> :first-child {
|
|
|
margin-top: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body blockquote> :last-child {
|
|
|
margin-bottom: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body table {
|
|
|
display: block;
|
|
|
width: 100%;
|
|
|
overflow: auto;
|
|
|
word-break: normal;
|
|
|
word-break: keep-all;
|
|
|
}
|
|
|
|
|
|
.markdown-body table th {
|
|
|
font-weight: bold;
|
|
|
text-align: revert;
|
|
|
}
|
|
|
|
|
|
.markdown-body table th,
|
|
|
.markdown-body table td {
|
|
|
padding: 6px 13px;
|
|
|
border: 1px solid #ddd;
|
|
|
}
|
|
|
|
|
|
.markdown-body table tr {
|
|
|
background-color: #fff;
|
|
|
border-top: 1px solid #ccc;
|
|
|
}
|
|
|
|
|
|
.markdown-body table tr:nth-child(2n) {
|
|
|
background-color: #f8f8f8;
|
|
|
}
|
|
|
|
|
|
.markdown-body img {
|
|
|
max-width: 100%;
|
|
|
-moz-box-sizing: border-box;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
|
|
|
.markdown-body code {
|
|
|
padding: 0;
|
|
|
padding-top: 0.2em;
|
|
|
padding-bottom: 0.2em;
|
|
|
margin: 0;
|
|
|
font-size: 85%;
|
|
|
background-color: rgba(0, 0, 0, 0.04);
|
|
|
border-radius: 3px;
|
|
|
}
|
|
|
|
|
|
.markdown-body code:has(.katex) {
|
|
|
background-color: transparent;
|
|
|
}
|
|
|
|
|
|
.markdown-body code:before,
|
|
|
.markdown-body code:after {
|
|
|
letter-spacing: -0.2em;
|
|
|
content: "\\00a0";
|
|
|
}
|
|
|
|
|
|
.markdown-body pre>code {
|
|
|
padding: 0;
|
|
|
margin: 0;
|
|
|
font-size: 100%;
|
|
|
word-break: normal;
|
|
|
white-space: pre;
|
|
|
background: transparent;
|
|
|
border: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body .highlight {
|
|
|
margin-bottom: 16px;
|
|
|
}
|
|
|
|
|
|
.markdown-body .highlight pre,
|
|
|
.markdown-body pre {
|
|
|
padding: 16px;
|
|
|
overflow: auto;
|
|
|
font-size: 85%;
|
|
|
line-height: 1.45;
|
|
|
background-color: #f7f7f7;
|
|
|
border-radius: 3px;
|
|
|
}
|
|
|
|
|
|
.markdown-body .highlight pre {
|
|
|
margin-bottom: 0;
|
|
|
word-break: normal;
|
|
|
}
|
|
|
|
|
|
.markdown-body pre {
|
|
|
word-wrap: normal;
|
|
|
}
|
|
|
|
|
|
.markdown-body pre code {
|
|
|
display: inline;
|
|
|
max-width: initial;
|
|
|
padding: 0;
|
|
|
margin: 0;
|
|
|
overflow: initial;
|
|
|
line-height: inherit;
|
|
|
word-wrap: normal;
|
|
|
background-color: transparent;
|
|
|
border: 0;
|
|
|
}
|
|
|
|
|
|
.markdown-body pre code:before,
|
|
|
.markdown-body pre code:after {
|
|
|
content: normal;
|
|
|
}
|
|
|
|
|
|
.markdown-body kbd {
|
|
|
display: inline-block;
|
|
|
padding: 3px 5px;
|
|
|
font-size: 11px;
|
|
|
line-height: 10px;
|
|
|
color: #555;
|
|
|
vertical-align: middle;
|
|
|
background-color: #fcfcfc;
|
|
|
border: solid 1px #ccc;
|
|
|
border-bottom-color: #bbb;
|
|
|
border-radius: 3px;
|
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-c {
|
|
|
color: #969896;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-c1,
|
|
|
.markdown-body .pl-mdh,
|
|
|
.markdown-body .pl-mm,
|
|
|
.markdown-body .pl-mp,
|
|
|
.markdown-body .pl-mr,
|
|
|
.markdown-body .pl-s1 .pl-v,
|
|
|
.markdown-body .pl-s3,
|
|
|
.markdown-body .pl-sc,
|
|
|
.markdown-body .pl-sv {
|
|
|
color: #0086b3;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-e,
|
|
|
.markdown-body .pl-en {
|
|
|
color: #795da3;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-s1 .pl-s2,
|
|
|
.markdown-body .pl-smi,
|
|
|
.markdown-body .pl-smp,
|
|
|
.markdown-body .pl-stj,
|
|
|
.markdown-body .pl-vo,
|
|
|
.markdown-body .pl-vpf {
|
|
|
color: #333;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-ent {
|
|
|
color: #63a35c;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-k,
|
|
|
.markdown-body .pl-s,
|
|
|
.markdown-body .pl-st {
|
|
|
color: #a71d5d;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-pds,
|
|
|
.markdown-body .pl-s1,
|
|
|
.markdown-body .pl-s1 .pl-pse .pl-s2,
|
|
|
.markdown-body .pl-sr,
|
|
|
.markdown-body .pl-sr .pl-cce,
|
|
|
.markdown-body .pl-sr .pl-sra,
|
|
|
.markdown-body .pl-sr .pl-sre,
|
|
|
.markdown-body .pl-src {
|
|
|
color: #df5000;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-mo,
|
|
|
.markdown-body .pl-v {
|
|
|
color: #1d3e81;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-id {
|
|
|
color: #b52a1d;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-ii {
|
|
|
background-color: #b52a1d;
|
|
|
color: #f8f8f8;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-sr .pl-cce {
|
|
|
color: #63a35c;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-ml {
|
|
|
color: #693a17;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-mh,
|
|
|
.markdown-body .pl-mh .pl-en,
|
|
|
.markdown-body .pl-ms {
|
|
|
color: #1d3e81;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-mq {
|
|
|
color: #008080;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-mi {
|
|
|
color: #333;
|
|
|
font-style: italic;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-mb {
|
|
|
color: #333;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-md,
|
|
|
.markdown-body .pl-mdhf {
|
|
|
background-color: #ffecec;
|
|
|
color: #bd2c00;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-mdht,
|
|
|
.markdown-body .pl-mi1 {
|
|
|
background-color: #eaffea;
|
|
|
color: #55a532;
|
|
|
}
|
|
|
|
|
|
.markdown-body .pl-mdr {
|
|
|
color: #795da3;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
|
|
|
.markdown-body kbd {
|
|
|
display: inline-block;
|
|
|
padding: 3px 5px;
|
|
|
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
|
line-height: 10px;
|
|
|
color: #555;
|
|
|
vertical-align: middle;
|
|
|
background-color: #fcfcfc;
|
|
|
border: solid 1px #ccc;
|
|
|
border-bottom-color: #bbb;
|
|
|
border-radius: 3px;
|
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
|
}
|
|
|
|
|
|
.markdown-body .task-list-item {
|
|
|
list-style-type: none;
|
|
|
}
|
|
|
|
|
|
.markdown-body .task-list-item+.task-list-item {
|
|
|
margin-top: 3px;
|
|
|
}
|
|
|
|
|
|
.markdown-body .task-list-item input {
|
|
|
float: left;
|
|
|
margin: 0.3em 0 0.25em -1.6em;
|
|
|
vertical-align: middle;
|
|
|
}
|
|
|
|
|
|
.markdown-body :checked+.radio-label {
|
|
|
z-index: 1;
|
|
|
position: relative;
|
|
|
border-color: #4183c4;
|
|
|
}
|
|
|
|
|
|
|
|
|
/*! Pretty printing styles. Used with prettify.js. */
|
|
|
/* SPAN elements with the classes below are added by prettyprint. */
|
|
|
.pln {
|
|
|
color: #000
|
|
|
}
|
|
|
|
|
|
/* plain text */
|
|
|
|
|
|
@media screen {
|
|
|
.str {
|
|
|
color: #080
|
|
|
}
|
|
|
|
|
|
/* string content */
|
|
|
.kwd {
|
|
|
color: #008
|
|
|
}
|
|
|
|
|
|
/* a keyword */
|
|
|
.com {
|
|
|
color: #800
|
|
|
}
|
|
|
|
|
|
/* a comment */
|
|
|
.typ {
|
|
|
color: #606
|
|
|
}
|
|
|
|
|
|
/* a type name */
|
|
|
.lit {
|
|
|
color: #066
|
|
|
}
|
|
|
|
|
|
/* a literal value */
|
|
|
/* punctuation, lisp open bracket, lisp close bracket */
|
|
|
.pun,
|
|
|
.opn,
|
|
|
.clo {
|
|
|
color: #660
|
|
|
}
|
|
|
|
|
|
.tag {
|
|
|
color: #008
|
|
|
}
|
|
|
|
|
|
/* a markup tag name */
|
|
|
.atn {
|
|
|
color: #606
|
|
|
}
|
|
|
|
|
|
/* a markup attribute name */
|
|
|
.atv {
|
|
|
color: #080
|
|
|
}
|
|
|
|
|
|
/* a markup attribute value */
|
|
|
.dec,
|
|
|
.var {
|
|
|
color: #606
|
|
|
}
|
|
|
|
|
|
/* a declaration; a variable name */
|
|
|
.fun {
|
|
|
color: red
|
|
|
}
|
|
|
|
|
|
/* a function name */
|
|
|
}
|
|
|
|
|
|
/* Use higher contrast and text-weight for printable form. */
|
|
|
@media print,
|
|
|
projection {
|
|
|
.str {
|
|
|
color: #060
|
|
|
}
|
|
|
|
|
|
.kwd {
|
|
|
color: #006;
|
|
|
font-weight: bold
|
|
|
}
|
|
|
|
|
|
.com {
|
|
|
color: #600;
|
|
|
font-style: italic
|
|
|
}
|
|
|
|
|
|
.typ {
|
|
|
color: #404;
|
|
|
font-weight: bold
|
|
|
}
|
|
|
|
|
|
.lit {
|
|
|
color: #044
|
|
|
}
|
|
|
|
|
|
.pun,
|
|
|
.opn,
|
|
|
.clo {
|
|
|
color: #440
|
|
|
}
|
|
|
|
|
|
.tag {
|
|
|
color: #006;
|
|
|
font-weight: bold
|
|
|
}
|
|
|
|
|
|
.atn {
|
|
|
color: #404
|
|
|
}
|
|
|
|
|
|
.atv {
|
|
|
color: #060
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* Put a border around prettyprinted code snippets. */
|
|
|
pre.prettyprint {
|
|
|
padding: 2px;
|
|
|
/* border: 1px solid #888 */
|
|
|
}
|
|
|
|
|
|
/* Specify class=linenums on a pre to get line numbering */
|
|
|
ol.linenums {
|
|
|
margin-top: 0;
|
|
|
margin-bottom: 0
|
|
|
}
|
|
|
|
|
|
/* IE indents via margin-left */
|
|
|
li.L0,
|
|
|
li.L1,
|
|
|
li.L2,
|
|
|
li.L3,
|
|
|
li.L5,
|
|
|
li.L6,
|
|
|
li.L7,
|
|
|
li.L8 {
|
|
|
list-style-type: none
|
|
|
}
|
|
|
|
|
|
/* Alternate shading for lines */
|
|
|
li.L1,
|
|
|
li.L3,
|
|
|
li.L5,
|
|
|
li.L7,
|
|
|
li.L9 {
|
|
|
background: #eee
|
|
|
}
|
|
|
|
|
|
.markdown-body p,
|
|
|
.markdown-body blockquote,
|
|
|
.markdown-body ul,
|
|
|
.markdown-body ol,
|
|
|
.markdown-body dl,
|
|
|
.markdown-body table,
|
|
|
.markdown-body pre {
|
|
|
margin-top: 0;
|
|
|
margin-bottom: 16px;
|
|
|
}`;return(0,R.useEffect)(()=>{const X=J.current.attachShadow({mode:"open"});ae.current=document.createElement("div"),ae.current.className="markdown-body",ae.current.innerHTML=ce,X.appendChild(ae.current);const Z=document.createElement("style");return Z.textContent=G,X.appendChild(Z),()=>{X.innerHTML=""}},[]),(0,R.useEffect)(()=>{ae.current&&(ae.current.innerHTML=ce)},[ce]),l.createElement("div",{ref:J})};function C(ce){const J=["onabort","onanimationend","onanimationiteration","onanimationstart","onauxclick","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncopy","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onvolumechange","onwaiting","onwheel"],ae=new RegExp(`\\b(${J.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi"),G=/<meta\s+http-equiv\s*=\s*["']?refresh["']?[^>]*>/gi;return ce.replace(ae,"").replace(G,"").trim()}var M={mdBody:"mdBody___raKXb",button:"button___Ch5Pc",previewFlowChart:"previewFlowChart___vY1dq"},k=Object.defineProperty,E=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,F=(ce,J,ae)=>J in ce?k(ce,J,{enumerable:!0,configurable:!0,writable:!0,value:ae}):ce[J]=ae,H=(ce,J)=>{for(var ae in J||(J={}))T.call(J,ae)&&F(ce,ae,J[ae]);if(E)for(var ae of E(J))I.call(J,ae)&&F(ce,ae,J[ae]);return ce};const W="@\u2581\u2581@",z="@\u2581@",ie=/<pre[^>]*>/g;function re(ce){let J=document.createElement("div");return J.innerHTML=ce,J.childNodes.length===0?"":J.childNodes[0].nodeValue}const _e=(ce,J)=>{ce=ce||"";const ae=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,G=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,X=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Z=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return J?ce.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(ae,(B,O,ne,me,Oe,He,ut)=>{const Fe=O||me||He,it=ne||Oe||ut||"?";return d.Z.API_SERVER+"/api/attachments/"+Fe+it+"&t="+(0,U.Jn)(Fe,Date.now())+(B.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(ce=ce.replace(Z,(B,O,ne,me,Oe,He,ut)=>{const Fe=O||me||He,it=ne||Oe||ut||"?";return d.Z.API_SERVER+"/attachments/download/"+Fe+it+"&t="+(0,U.Jn)(Fe,Date.now())+(B.indexOf(")")>-1?")":"&")}).replace(ae,(B,O,ne,me,Oe,He,ut)=>{const Fe=O||me||He,it=ne||Oe||ut||"?";return d.Z.API_SERVER+"/api/attachments/"+Fe+it+"&t="+(0,U.Jn)(Fe,Date.now())+(B.indexOf(")")>-1?")":"&")}).replace(G,(B,O,ne,me,Oe)=>{const He=O||me,ut=ne||Oe||"";return'"'+d.Z.API_SERVER+"/api/attachments/"+He+ut+He+ut+"&t="+(0,U.Jn)(He,Date.now())}).replace(X,(B,O,ne,me,Oe)=>{const He=O||me,ut=ne||Oe||"";return"("+d.Z.API_SERVER+"/files/uploads/"+He+ut+He+ut+"&t="+(0,U.Jn)(He,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,`
|
|
|
`),ce)};var Ae=({value:ce="",edit:J=!1,className:ae,showTextOnly:G,showLines:X,style:Z={},stylesPrev:B={},highlightKeywords:O,showProgramFill:ne,isProgramFill:me,disabledFill:Oe=!1,programFillValue:He,openEditor:ut=()=>{},onFillChange:Fe=et=>{},onFillBlur:it=()=>{},onFillFocus:st=()=>{}})=>{let et=C(String(ce||""));const Nt=(0,R.useRef)(),tt=(0,R.useRef)(),[kt,Ne]=(0,R.useState)(""),[ft,Pe]=(0,R.useState)("office"),[Te,Se]=(0,R.useState)([]),ze=(0,R.useRef)("a"+(0,f.Z)()),Je={},rt=Ke=>/<style[\s\S]*?>/i.test(Ke||""),de=(Ke,St,_t)=>{const lt=document.createElement(Ke===z?"input":"textarea");lt.style.width="100%",lt.style.height=Ke===z?"40px":"151px",lt.rows=5,lt.spellcheck=!1,lt.name="edu-program-fill",lt.placeholder="\u8BF7\u8F93\u5165",lt.dataset.id=St;const At=Object.keys(Je).length;return Je[At]=lt,`<span class="edu-program-fill-wrap ${Ke===z?"":"show"}" style="width:${Ke===z?"600px":"100%"}" title=${_t||""}><span>${lt.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Le(Ke){return Ke=Ke.replace(/!\[.*?\]\(.*?\)/g,""),Ke=Ke.replace(/\[.*?\]\(.*?\)/g,""),Ke=Ke.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),Ke=Ke.replace(/<embed.*?>/g,""),Ke=Ke.replace(/<img.*?>/g,""),Ke=Ke.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),Ke=Ke.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),Ke=Ke.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),Ke=Ke.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),Ke}const We=Ke=>!G&&rt(et)?Ke:Ke.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(St,_t){let lt=_t.replace(/(\n|\r)/g,"").split("}"),At=[];return lt.map($=>{$!=""&&At.push(`.${ze.current} ${$}`)}),`<style>${At.join("}")}</style>`}),Ge=(0,R.useMemo)(()=>{(0,K.Iy)();try{const lt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,At=/\"\/api\/attachments\/|\"\/attachments\/download\//g,$=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,q=/\(\/attachments\/download\//g;et=et.replace(q,"("+d.Z.API_SERVER+"/attachments/download/").replace(lt,"("+d.Z.API_SERVER+"/api/attachments/").replace(At,'"'+d.Z.API_SERVER+"/api/attachments/").replace($,'"'+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,`
|
|
|
`),Nt.current.style.display="none"}catch(lt){}if(ne){let lt=-1;return et=et.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(At,$,q){var Be;return++lt,de(At,lt,(Be=He==null?void 0:He[lt])==null?void 0:Be.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${We(et||"")}</pre>`}let Ke=We(et);Ke=(0,K.ZP)(Ke);const St=(0,K.ez)();et.match(/\[TOC\]/)&&(Ke=Ke.replace("<p>[TOC]</p>",(0,K.Qv)()),(0,K.Iy)()),Ke=Ke.replace(/(__special_katext_id_\d+__)/g,(lt,At)=>{const{type:$,expression:q}=St[At];return(0,S.renderToString)(re(q)||"",{displayMode:$==="block",throwOnError:!1,output:"html"})}),Ke=Ke.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,K.AL)();const _t=document.createElement("div");if(_t.innerHTML=Ke,G)return _t.innerText;if(O){const lt=O.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return ht(_t,lt),_t.innerHTML}return setTimeout(()=>Pt(),500),_t.innerHTML},[et,O]);(0,R.useEffect)(()=>{dt.current&&dt.current.querySelectorAll(["input","textarea"]).forEach(St=>{St.oninput=Xe,St.onblur=gt,St.onfocus=Ct})},[Te]),(0,R.useEffect)(()=>{var Ke,St,_t,lt,At;if(He!=null&&He.length)try{const $=dt.current.querySelectorAll(".edu-program-fill-score"),q=dt.current.querySelectorAll('[name="edu-program-fill"]');for(const[Be,oe]of q.entries())oe.value=((Ke=He==null?void 0:He[Be])==null?void 0:Ke.value)||"",((St=He==null?void 0:He[Be])==null?void 0:St.type)==="warning"?oe.className="program-fill-warning":((_t=He==null?void 0:He[Be])==null?void 0:_t.type)==="success"?oe.className="program-fill-success":oe.className="";for(const[Be,oe]of $.entries())oe.innerHTML=(lt=He==null?void 0:He[Be])!=null&<.score?`${(At=He==null?void 0:He[Be])==null?void 0:At.score}\u5206`:"";Se(He)}catch($){console.log($,"error")}},[He]);const Xe=Ke=>{Te[Ke.target.dataset.id]=Te[Ke.target.dataset.id]||{},Te[Ke.target.dataset.id].value=Ke.target.value,Se([...Te]),Fe(Te,Ke.target.dataset.id)},gt=Ke=>{Te[Ke.target.dataset.id]=Te[Ke.target.dataset.id]||{},Te[Ke.target.dataset.id].value=Ke.target.value,Se([...Te]),it(Te,Ke.target.dataset.id)},Ct=Ke=>{Te[Ke.target.dataset.id]=Te[Ke.target.dataset.id]||{},Te[Ke.target.dataset.id].value=Ke.target.value,Se([...Te]),st(Te,Ke.target.dataset.id)};function ht(Ke,St){return Ke.childNodes.forEach(_t=>{var lt;if(_t.childNodes.length>0)ht(_t,St);else if(_t.nodeName!=="IMG")if(_t.innerHTML)_t.innerHTML=(lt=_t.innerHTML)==null?void 0:lt.replace(new RegExp(St,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const At=document.createElement("span");At.innerHTML=_t.textContent.replace(new RegExp(St,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),_t.replaceWith(At)}})}const dt=(0,R.useRef)();K.jb.WebkitLineClamp=X,X&&(Z=H(H({},Z),K.jb));function vt(Ke){let St=Ke.target;if(St.tagName.toUpperCase()==="A"){let _t=St.getAttribute("href");if(_t.indexOf("office")>-1)Ke.preventDefault(),Ne(_t),Pe("office");else if(_t.indexOf("application/pdf")>-1)Ke.preventDefault(),Ne(_t),Pe("pdf");else if(_t.indexOf("text/html")>-1)Ke.preventDefault(),Ne(_t),Pe("html");else if(_t.startsWith("#")){Ke.preventDefault();let lt=document.getElementById(_t.replace("#",""));lt&<.scrollIntoView(!0)}}}const Pt=()=>{var Ke;const St=(Ke=dt.current)==null?void 0:Ke.querySelectorAll("video");St==null||St.forEach(_t=>{if(_t.oncontextmenu=()=>!1,_t.src.indexOf(".m3u8")>-1&&!_t.canPlayType("application/vnd.apple.mpegurl")){if(A.ZP.isSupported()){var lt=new A.ZP;lt.loadSource(_t.src),lt.attachMedia(_t)}}})};(0,R.useEffect)(()=>{if(dt.current&&Ge&&Ge.match(ie)&&window.PR.prettyPrint(),dt.current)return dt.current.addEventListener("click",vt),()=>{var Ke;(Ke=dt.current)==null||Ke.removeEventListener("click",vt),(0,K.AL)(),(0,K.Iy)()}},[Ge,dt.current,vt]);const Tt=Ke=>{Ke.target.nodeName==="IMG"&&Ke.target.className.indexOf("draw-flowchart")>-1?(Nt.current.style.zIndex=1,Nt.current.style.display="flex",Nt.current.style.width=Ke.target.clientWidth+"px",Nt.current.style.height=Ke.target.clientHeight+"px",Nt.current.style.top=Ke.target.offsetTop+"px",Nt.current.style.left=Ke.target.offsetLeft+"px",Ke.target.id&&(tt.current=Ke.target.id)):Nt.current.style.display="none"},xt=()=>{Nt.current.style.display="none"};return(0,R.useEffect)(()=>{var Ke;const St=_t=>{_t.preventDefault(),_t.clipboardData.setData("text",window.getSelection().toString())};return(Ke=dt.current)==null||Ke.addEventListener("copy",St),()=>{var _t;(_t=dt.current)==null||_t.removeEventListener("copy",St)}},[dt.current]),R.createElement("div",{style:{position:"relative"},onMouseLeave:xt},G&&R.createElement("div",{ref:dt,className:`${M.mdBody} `},Ge),!G&&!rt(Ge)&&R.createElement("div",{ref:dt,style:H({},Z),onMouseOver:Tt,className:`${ae||""} ${Oe?"disabled-fill":""} markdown-body ${M.mdBody} ${ze.current}`,dangerouslySetInnerHTML:{__html:Ge}}),!G&&rt(Ge)&&R.createElement(m,{html:Ge}),R.createElement("div",{ref:Nt,className:`${M.button} ${J?"":M.previewFlowChart}`},R.createElement(s.Z,null,R.createElement(w.ZP,{onClick:()=>{J?ut(tt.current):(Ne(tt.current),Pe("flowChart"))}},J?"\u7F16\u8F91":"\u9884\u89C8"))),R.createElement(u.Z,{close:!0,data:kt,type:kt!=null&&kt.length?ft:"",style:H({},B),onClose:()=>Ne("")}))}},28010:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return P}});var R=y(44283),N={ldsRing:"ldsRing___mpBZC",idsRingWrapper:"idsRingWrapper___Of9_n",ldsring:"ldsring___o0w2t"},K=y(59301),P=({message:A,className:d,children:U,style:S={}})=>K.createElement("div",{className:`custom-spinner ${N.idsRingWrapper} ${d}`},K.createElement("div",{className:N.ldsRing},K.createElement("div",null),K.createElement("div",null),K.createElement("div",null),K.createElement("div",null)),A?K.createElement("p",{style:S},A):null,U,K.createElement(R.Outlet,null))},16102:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return d}});var R=y(59301),N={flex_box_center:"flex_box_center___Gc4dd",flex_space_between:"flex_space_between___K2f1v",flex_box_vertical_center:"flex_box_vertical_center___pupRp",flex_box_center_end:"flex_box_center_end___UDLRC",flex_box_column:"flex_box_column___a5uDo",result:"result___gu5zt",title:"title___xrnx2",left:"left___IAxp9",leftNode:"leftNode___HL8fG",right:"right___ZXYmw",rightNode:"rightNode___jYL5_"},K=y(92310),P=y.n(K),d=({className:U,style:S={},leftNode:s,leftTitle:w="\u81EA\u6D4B\u8F93\u5165",rightNode:f,rightTitle:u="\u8FD0\u884C\u7ED3\u679C"})=>R.createElement("div",{className:P()(N.result,U),style:S},R.createElement("div",{className:N.left},R.createElement("div",{className:N.title},R.createElement("i",{style:{color:"#08CF76"},className:"iconfont iconfont icon-zidingyiceshiyongli font14 mr5"}),R.createElement("span",null,w)),R.createElement("div",{className:N.leftNode},s)),R.createElement("div",{className:N.right},R.createElement("div",{className:N.title},R.createElement("i",{style:{color:"#00DFFF"},className:"iconfont iconfont icon-daimazhihangjieguo font14 mr5"}),R.createElement("span",null,u)),R.createElement("div",{className:N.rightNode},f)))},34728:function(Ot,ke,y){"use strict";y.d(ke,{SV:function(){return Nt},ZP:function(){return et}});var R=y(59301),N=y(76374);const K={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},P={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 S=y(53184),s=y.n(S),w=(tt,kt,Ne)=>new Promise((ft,Pe)=>{var Te=Je=>{try{ze(Ne.next(Je))}catch(rt){Pe(rt)}},Se=Je=>{try{ze(Ne.throw(Je))}catch(rt){Pe(rt)}},ze=Je=>Je.done?ft(Je.value):Promise.resolve(Je.value).then(Te,Se);ze((Ne=Ne.apply(tt,kt)).next())});const f={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"]}},u=(tt,kt,Ne,ft)=>{const Pe=kt.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:Ne.lineNumber,endColumn:Ne.column});return Array.from(new Set(Pe.match(/\b\w{2,}\b/g)||[])).map(Se=>({label:Se,kind:tt.languages.CompletionItemKind.Text,insertText:Se,range:ft}))},l=(tt,kt,Ne,ft)=>{tt.languages.registerCompletionItemProvider(kt,{provideCompletionItems(Pe,Te){const Se=Pe.getWordUntilPosition(Te),ze={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},Je=Pe.getLineContent(Te.lineNumber).substring(Se.startColumn-2,Se.endColumn);return{suggestions:[...u(tt,Pe,Te,ze),...Ne.map(de=>({label:de,kind:tt.languages.CompletionItemKind.Keyword,documentation:de,insertText:de,insertTextRules:tt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ze})),...ft.map(de=>({label:de.label,kind:tt.languages.CompletionItemKind.Snippet,documentation:de.content,insertText:Je.startsWith("#")?de.content.replace(/#/,""):de.content,insertTextRules:tt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ze}))]}}})};var c=tt=>{f.languages.forEach(kt=>{tt.languages.registerDocumentFormattingEditProvider(kt,{provideDocumentFormattingEdits(Ne){return w(this,null,function*(){const ft=s()(Ne.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:Ne.getFullModelRange(),text:ft}]})}})}),l(tt,"java",P.keywords,P.quickKey),l(tt,"cpp",A.keywords,A.quickKey),l(tt,"c",K.keywords,[]),l(tt,"python",d.keywords,d.quickKey),l(tt,"scala",U.keywords,U.quickKey)};const m="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var C=Object.defineProperty,M=(tt,kt,Ne)=>kt in tt?C(tt,kt,{enumerable:!0,configurable:!0,writable:!0,value:Ne}):tt[kt]=Ne,k=(tt,kt,Ne)=>M(tt,typeof kt!="symbol"?kt+"":kt,Ne);const E=class Su{constructor(kt,Ne,ft){this.placeholder=kt,this.editor=Ne,this.monaco=ft,Ne.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Su.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)}};k(E,"ID","editor.widget.placeholderHint");var I=E,F=y(96236),H=y(6767),W=y(25399),z=y(78267),ie=y(33156),re=y(56102),_e=Object.defineProperty,Ae=Object.defineProperties,ce=Object.getOwnPropertyDescriptors,J=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,X=(tt,kt,Ne)=>kt in tt?_e(tt,kt,{enumerable:!0,configurable:!0,writable:!0,value:Ne}):tt[kt]=Ne,Z=(tt,kt)=>{for(var Ne in kt||(kt={}))ae.call(kt,Ne)&&X(tt,Ne,kt[Ne]);if(J)for(var Ne of J(kt))G.call(kt,Ne)&&X(tt,Ne,kt[Ne]);return tt},B=(tt,kt)=>Ae(tt,ce(kt)),O=(tt,kt)=>{var Ne={};for(var ft in tt)ae.call(tt,ft)&&kt.indexOf(ft)<0&&(Ne[ft]=tt[ft]);if(tt!=null&&J)for(var ft of J(tt))kt.indexOf(ft)<0&&G.call(tt,ft)&&(Ne[ft]=tt[ft]);return Ne},ne=(tt,kt,Ne)=>new Promise((ft,Pe)=>{var Te=Je=>{try{ze(Ne.next(Je))}catch(rt){Pe(rt)}},Se=Je=>{try{ze(Ne.throw(Je))}catch(rt){Pe(rt)}},ze=Je=>Je.done?ft(Je.value):Promise.resolve(Je.value).then(Te,Se);ze((Ne=Ne.apply(tt,kt)).next())});function me(tt){return/^\d+$/.test(tt)?`${tt}px`:tt}function Oe(){}let He=!1;const ut={"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 Fe(tt=[]){let kt=tt;if(Array.isArray(tt)){for(let Ne=0;Ne<tt.length;Ne++){let ft=ut[tt[Ne]];if(ft)return ft}return kt[0]}return ut[kt]||kt}let it=null;const st=()=>ne(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(tt){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",tt)}});var et=tt=>{var kt=tt,{width:Ne="100%",height:ft="100%",value:Pe,language:Te="javascript",style:Se={},options:ze={},overrideServices:Je={},theme:rt="vs-dark",onEditBlur:de,isCopy:Le=!1,onSave:We,autoHeight:Ge=!1,forbidCopy:Xe=!1,forbidCopyTips:gt,onChange:Ct=Oe,editorDidMount:ht=Oe,onFocus:dt=Oe,onBreakPoint:vt=Oe,breakPointValue:Pt=[],filename:Tt="educoder.txt",errorLine:xt,errorContent:Ke="",highlightLine:St,openBreakPoint:_t=!1,placeholder:lt="",showMiniMap:At=!0}=kt,$=O(kt,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","forbidCopyTips","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const q=(0,R.useRef)(),Be=(0,R.useRef)({}),oe=(0,R.useRef)(),ge=(0,R.useRef)(),Lt=(0,R.useRef)([]),Re=(0,R.useRef)(!1),Me=(0,R.useRef)(),$e=(0,R.useRef)(),he=(0,R.useRef)(!1),[fe,Ee]=(0,R.useState)(!1);function Ie(){let yt;return q.current&&(yt=new N.Z(bt=>{for(let Vt of bt)(Vt.target.offsetHeight>0||Vt.target.offsetWidth>0)&&Be.current.instance.layout()}),yt.observe(q.current)),yt}function se(){H.ZP.warning({content:decodeURIComponent(gt||m),key:"monaco-editor-tip"})}const ot=()=>{let yt=Be.current.instance;if(Pe!=null&&yt&&fe){const bt=yt.getModel();bt&&Pe!==bt.getValue()&&(He=!0,bt.setValue(Pe),yt.layout(),He=!1)}};(0,R.useEffect)(()=>{const yt=ie.Z.subscribe("formatDocument",bt=>{var Vt;let cr=Be.current.instance;(Vt=cr==null?void 0:cr.getAction)==null||Vt.call(cr,"editor.action.formatDocument").run()});return window.updateMonacoValue=bt=>{Ct(bt)},yt},[]),(0,R.useEffect)(()=>{var yt;let bt=Be.current.instance;ge.current&&clearTimeout(ge.current),ge.current=setTimeout(()=>{ot()},500),Pe&&(Pe!=null&&Pe.length)&&((yt=bt==null?void 0:bt.updateOptions)==null||yt.call(bt,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Pe.split(/\r\n|\r|\n/g).length))+3,5)}))},[Pe,fe,Be.current]),(0,R.useEffect)(()=>{if(xt&&Be.current&&Be.current.instance){let bt=Be.current.instance;bt.changeViewZones(function(Vt){var cr=document.createElement("div");cr.style.padding="10px 20px",cr.style.width="calc(100% - 20px)",cr.className="my-error-line-wrp",cr.innerHTML=Ke,Vt.addZone({afterLineNumber:xt||11,heightInLines:3,domNode:cr})});var yt={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}};bt.addOverlayWidget(yt),bt.revealPositionInCenter({lineNumber:20,column:1})}},[xt,Be.current,fe]);const ve=(yt="",bt)=>{if(!yt||yt.trim()==="")return!0;const cr=Be.current.instance.getModel().getLineTokens(bt);let xr=!1;for(let Yr=0;Yr<2;Yr++)cr.getStandardTokenType(Yr)===1&&(xr=!0);return xr};(0,R.useEffect)(()=>{var yt;const bt=(yt=Be.current)==null?void 0:yt.instance;if(bt&&fe&&Xe){const Vt=bt.onDidBlurEditorWidget(()=>{he.current=!1}),cr=bt.onDidFocusEditorText(()=>{he.current=!0});return()=>{Vt.dispose(),cr.dispose()}}},[Be.current,fe,Xe]),(0,R.useEffect)(()=>{var yt;if((yt=Be.current)!=null&&yt.instance&&fe&&_t){let bt=Be.current.instance,Vt=bt.getModel();if(!Vt)return;(()=>{var br;let Ar=[],Lr=[];const Nr=Vt.getAllDecorations();for(let ir of Nr)ir.options.className==="highlighted-line"&&(Ar.push((br=ir==null?void 0:ir.range)==null?void 0:br.startLineNumber),Lr.push(ir==null?void 0:ir.id));if(St===Ar[0])return;Vt.deltaDecorations(Lr,[]);const Sr=Vt.getLineCount();St&&St<=Sr&&(bt.deltaDecorations([],[{range:new it.Range(St,1,St,Vt.getLineMaxColumn(St)),options:{isWholeLine:!0,className:"highlighted-line"}}]),bt.revealLineInCenter(St))})();const xr=(br=!1)=>{var Ar;let Lr=[],Nr=[];const Sr=Vt.getAllDecorations();for(let ir of Sr)ir.options.linesDecorationsClassName==="breakpoints-select"&&(Lr.push((Ar=ir==null?void 0:ir.range)==null?void 0:Ar.startLineNumber),Nr.push(ir==null?void 0:ir.id));if(br)return{lines:Lr,ids:Nr};vt(Lr)},Yr=br=>ne(void 0,null,function*(){let Ar={range:new it.Range(br,1,br,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield Vt.deltaDecorations([],[Ar]),xr()}),Zr=br=>ne(void 0,null,function*(){let Ar=[];const Lr=bt.getLineDecorations(br);for(let Nr of Lr)Nr.options.linesDecorationsClassName==="breakpoints-select"&&Ar.push(Nr.id);yield Vt.deltaDecorations(Ar,[]),xr()}),ni=br=>{let Ar=bt.getLineDecorations(br);for(let Lr of Ar)if(Lr.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,z.isEqual)(Pt,xr(!0).lines)){Vt.deltaDecorations(xr(!0).ids,[]);const br=Pt.map(Ar=>({range:new it.Range(Ar,1,Ar,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));Vt.deltaDecorations([],br)}const Jr=bt.onDidChangeModelContent(br=>{let Ar=bt.getPosition();if(Ar){let Lr=Ar.lineNumber;clearTimeout($e.current),$e.current=setTimeout(()=>{ve(Vt.getLineContent(Lr),Lr)?Zr(Lr):ni(Lr)?(Zr(Lr),Yr(Lr)):xr()},100)}}),_r=bt.onMouseDown(br=>{var Ar,Lr,Nr;if(br.target.detail&&((Nr=(Lr=(Ar=br.target)==null?void 0:Ar.element)==null?void 0:Lr.className)!=null&&Nr.includes("line-numbers"))){let Sr=br.target.position.lineNumber;if(ve(Vt.getLineContent(Sr),Sr))return;ni(Sr)?Zr(Sr):Yr(Sr)}}),ci=br=>{let Ar={range:new it.Range(br,1,br,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Lt.current=bt.deltaDecorations(Lt.current,[Ar])},Rr=()=>{Lt.current=bt.deltaDecorations(Lt.current,[])},bi=bt.onMouseMove(br=>{var Ar,Lr,Nr;if(Rr(),br.target.detail&&((Nr=(Lr=(Ar=br.target)==null?void 0:Ar.element)==null?void 0:Lr.className)!=null&&Nr.includes("line-numbers"))){let Sr=br.target.position.lineNumber;if(ve(Vt.getLineContent(Sr),Sr))return;ci(Sr)}}),fi=bt.onMouseLeave(()=>{Rr()});return()=>{Jr.dispose(),_r.dispose(),bi.dispose(),fi.dispose()}}},[Be.current,fe,Pt,St,_t,Te]),(0,R.useEffect)(()=>{var yt;(yt=Be.current)!=null&&yt.instance&&_t&&Be.current.instance.setPosition({lineNumber:0,column:0})},[St]);function Rt(){let yt=Be.current.instance;if(yt){const bt=yt.getSelection(),Vt=Be.current.pastePos||{},cr=new it.Range(Vt.startLineNumber||bt.endLineNumber,Vt.startColumn||bt.endColumn,Vt.endLineNumber||bt.endLineNumber,Vt.endColumn||bt.endColumn);setTimeout(()=>{yt.executeEdits("",[{range:cr,text:""}])},300)}}function Bt(yt){(window.navigator.platform.match("Mac")?yt.metaKey:yt.ctrlKey)&&yt.keyCode==83&&(yt.preventDefault(),We())}const zt=()=>{if(Ge&&Be.current.instance){const yt=Be.current.instance.getContentHeight();gr(yt<ft?ft:yt)}else gr(ft)};function Cr(yt){var bt=document.createEvent("MouseEvents");bt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),yt.dispatchEvent(bt)}const ar=yt=>{if(!he.current)return;const{keyCode:bt,ctrlKey:Vt,metaKey:cr,target:xr,type:Yr}=yt;return(Yr==="paste"||(bt===67||bt===86)&&(cr||Vt))&&xr.nodeName==="TEXTAREA"&&(se(),yt.preventDefault()),!1};function qt(yt,bt){var Vt=window.URL||window.webkitURL||window,cr=new Blob([bt]),xr=document.createElementNS("http://www.w3.org/1999/xhtml","a");xr.href=Vt.createObjectURL(cr),xr.download=yt,Cr(xr)}(0,R.useEffect)(()=>{zt()},[zt]),(0,R.useEffect)(()=>{q.current&&!fe&&Promise.all([y.e(8909),y.e(5977)]).then(y.bind(y,71448)).then(yt=>{try{it=yt,Be.current.instance=it.editor.create(q.current,{value:Pe,language:Fe(Te),theme:rt,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:At||!1}},Je);const bt=Be.current.instance;let xr=[...F.BH._menuItems].find(Jr=>Jr[0]._debugName=="EditorContext")[1],Yr=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Zr=(Jr,_r)=>{var ci,Rr;let bi=Jr._first;do _r.includes((Rr=(ci=bi.element)==null?void 0:ci.command)==null?void 0:Rr.id)&&Jr._remove(bi);while(bi=bi.next)};if(ht(bt,it),setTimeout(()=>{zt(),Be.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{qt(Tt||"educoder.txt",bt.getValue())}})},500),Be.current.subscription=bt.onDidChangeModelContent(Jr=>{Re.current?clearTimeout(Me.current):(zt(),Ct(bt.getValue(),Jr)),Me.current=setTimeout(()=>{Re.current=!1},500)}),window.Monaco||c(it,Fe(Te)),Xe&&(Zr(xr,Yr),q.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",ar),window.removeEventListener("paste",ar),window.addEventListener("keydown",ar),window.addEventListener("paste",ar)),window.Monaco=it,de&&bt.onDidBlurEditorWidget(()=>{de(bt.getValue())}),dt&&bt.onDidFocusEditorText(()=>{Xe&&st(),dt(bt.getValue())}),Xe){st();try{bt.onDidPaste(Jr=>{const _r=bt.getSelection(),ci=Be.current.pastePos||{},Rr=new it.Range(ci.startLineNumber||_r.endLineNumber,ci.startColumn||_r.endColumn,ci.endLineNumber||_r.endLineNumber,ci.endColumn||_r.endColumn);bt.executeEdits("",[{range:Jr.range,text:""}])})}catch(Jr){}}let ni=Ie();return lt&&typeof lt=="string"&&new I(lt,bt,it),Ee(!0),()=>{const Jr=Be.current.instance;Jr.dispose();const _r=Jr.getModel();_r&&_r.dispose(),Be.current.subscription&&Be.current.subscription.dispose(),ni.unobserve(q.current)}}catch(bt){}})},[]),(0,R.useEffect)(()=>{if(Be.current.instance&&fe)return document.addEventListener("keydown",Bt,!1),()=>{document.removeEventListener("keydown",Bt)}},[We,fe]),(0,R.useEffect)(()=>{let yt=Be.current.instance;if(yt&&fe){let bt=Fe(Te);it.editor.setModelLanguage(yt.getModel(),bt)}},[Te,fe]),(0,R.useEffect)(()=>{Be.current.instance&&fe&&it.editor.setTheme(rt)},[rt,fe]),(0,R.useEffect)(()=>{let yt=Be.current.instance;oe.current=ze,yt&&fe&&(yt.updateOptions(Z({},ze)),setTimeout(()=>{yt.getModel().updateOptions(Z({},ze))},200))},[JSON.stringify(ze),fe]),(0,R.useEffect)(()=>{let yt=Be.current.instance;yt&&fe&&yt.layout()},[Ne,ft,fe]);const[Dr,Hr]=(0,R.useState)(me(Ne)),[pr,gr]=(0,R.useState)(me(ft)),Mt=B(Z({},Se),{width:Dr,height:pr,position:"relative"});return R.createElement("div",{className:"my-monaco-editor",ref:q,style:Mt,onFocus:()=>{Xe&&st()}},Le&&R.createElement(re.CopyToClipboard,{text:Pe,onCopy:()=>H.ZP.success("\u590D\u5236\u6210\u529F")},R.createElement(W.Z,{title:"\u590D\u5236\u4EE3\u7801"},R.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},R.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function Nt({width:tt="100%",height:kt="100%",original:Ne,modified:ft,language:Pe,options:Te={}}){const Se=(0,R.useRef)(),[ze,Je]=(0,R.useState)(null);function rt(Ge){let Xe;return Se.current&&(Xe=new N.Z(gt=>{for(let Ct of gt)(Ct.target.offsetHeight>0||Ct.target.offsetWidth>0)&&Ge.layout()}),Xe.observe(Se.current)),Xe}(0,R.useEffect)(()=>(Se.current&&Promise.all([y.e(8909),y.e(9404)]).then(y.bind(y,2550)).then(Ge=>{it=Ge;const Xe=it.editor.createDiffEditor(Se.current,B(Z({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},Te),{wordWrap:!0}));Je(Xe);let gt=rt(Xe);return()=>{Xe.dispose();const Ct=Xe.getModel();Ct&&Ct.dispose(),gt.unobserve(Se.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,R.useEffect)(()=>{ze&&ze.setModel({original:it.editor.createModel(Ne,Pe),modified:it.editor.createModel(ft,Pe)})},[Ne,ft,Pe,ze]);const de=me(tt),Le=me(kt),We={width:de,height:Le};return R.createElement("div",{className:"my-diff-editor",ref:Se,style:We})}},96598:function(Ot,ke,y){"use strict";y.r(ke),y.d(ke,{default:function(){return l}});var R=y(59301),N=y(55797),K=y(14185),P=y(44283),A=y(29787),d=y(80266),U=y(44795),S=y(34728),s=y(24334),w=y(66649),f=y.n(w),u=(c,m,C)=>new Promise((M,k)=>{var E=F=>{try{I(C.next(F))}catch(H){k(H)}},T=F=>{try{I(C.throw(F))}catch(H){k(H)}},I=F=>F.done?M(F.value):Promise.resolve(F.value).then(E,T);I((C=C.apply(c,m)).next())}),l=()=>{const{submitId:c,id:m}=(0,P.useParams)(),[C,M]=(0,R.useState)(void 0);console.log((0,P.useLocation)(),33);const k=(0,P.useLocation)();function E(){var ne;P.history.push(`/problems/${m}/oj/${(ne=k==null?void 0:k.query)==null?void 0:ne.backId}?tab=1`)}(0,R.useEffect)(()=>((0,P.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),(0,P.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),()=>{(0,P.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),(0,P.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}),[]),(0,R.useEffect)(()=>{document.title="\u5728\u7EBF\u5237\u9898"}),(0,R.useEffect)(()=>{c&&function(){return u(this,null,function*(){const me=yield(0,d.X6)(c);M(me.data)})}()},[c]);const{status:T,created_at:I,code:F,name:H,language:W,pass_sets_count:z,set_count:ie,error_msg:re,output:_e,input:Ae,expected_output:ce,execute_memory:J,user:ae,execute_time:G,input_file_url:X,output_file_url:Z,is_file:B,expected_output_file_url:O}=C||{};return R.createElement(A.Z,{spinning:!C,delay:500},R.createElement("div",{className:"record-detail-info"},C?R.createElement(R.Fragment,null,R.createElement("header",{className:N.Z.header},R.createElement("div",null,R.createElement("img",{src:`${K.Z.IMG_SERVER}/images/${ae.image_url}`,alt:"user",width:30}),R.createElement("span",null,ae.name)),R.createElement("h2",null," ",H," "),R.createElement("button",{className:"ant-btn",onClick:E,style:{border:"1px solid #bacffe",color:"#3061d0"}},"\u8FD4\u56DE\u8BE5\u9898")),R.createElement("div",{className:"record-detail-body"},R.createElement("h2",null," \u63D0\u4EA4\u8BB0\u5F55 "),R.createElement("ul",{className:"record-info"},R.createElement("li",null," \u72B6\u6001\uFF1A",R.createElement("span",{className:T===0?"c-green":"c-red"},U.Im[T])," "),R.createElement("li",null," \u63D0\u4EA4\u65F6\u95F4\uFF1A",R.createElement("span",null,f()(I).format("YYYY-MM-DD HH:mm:ss"))," "),R.createElement("li",null," \u8BED\u8A00\uFF1A",R.createElement("span",null,W)," "),R.createElement("li",null," \u6267\u884C\u7528\u65F6\uFF1A",R.createElement("span",null,G*1e3,"ms")," "),R.createElement("li",null," ",`${z} / ${ie} \u4E2A\u901A\u8FC7\u7684\u6D4B\u8BD5\u7528\u4F8B`," ")),(0,U.gZ)({status:T,error_msg:re,execute_time:G,output:_e,input:Ae,expected_output:ce,input_file_url:X,output_file_url:Z,is_file:B,expected_output_file_url:O}),R.createElement("h2",null," \u63D0\u4EA4\u7684\u5185\u5BB9 "),R.createElement(S.ZP,{height:"200px",width:"100%",language:W==null?void 0:W.toLocaleLowerCase(),value:s.Base64.decode(F),options:{readOnly:!0}}))):null))}},44795:function(Ot,ke,y){"use strict";y.d(ke,{Im:function(){return re},ZP:function(){return G},gZ:function(){return J}});var R=y(59301),N=y(37568),K=y(7939),P=y(84105),A=y(87395),d=y(76726),U=y(24334),S=y(28010),s=y(35883),w=y(76406),f=y(16102),u=y(34376),l=y(92310),c=y.n(l),m=y(59301),C=Object.defineProperty,M=Object.defineProperties,k=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,F=(X,Z,B)=>Z in X?C(X,Z,{enumerable:!0,configurable:!0,writable:!0,value:B}):X[Z]=B,H=(X,Z)=>{for(var B in Z||(Z={}))T.call(Z,B)&&F(X,B,Z[B]);if(E)for(var B of E(Z))I.call(Z,B)&&F(X,B,Z[B]);return X},W=(X,Z)=>M(X,k(Z));const{TextArea:z}=N.default,ie={visible:!1,tabIndex:"0"},re={[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 _e=(X=>(X[X.SET_VISIBLE=0]="SET_VISIBLE",X[X.SET_TABINDEX=1]="SET_TABINDEX",X))(_e||{});function Ae(X,Z){switch(Z.type){case 0:return W(H({},X),{visible:Z.payload});case 1:return W(H({},X),{tabIndex:Z.payload});default:throw new Error}}function ce({value:X,className:Z}){const[B,O]=(0,R.useState)(!1),ne=(0,R.useRef)(),me=(0,R.useRef)();return(0,R.useEffect)(()=>{B&&(me.current.reset(),me.current.write((0,w.pp)(X||"")))},[X,B]),(0,R.useEffect)(()=>{var Oe,He,ut,Fe;if(ne.current){me.current=new u.Terminal({fontSize:14,disableStdin:!0}),me.current.open(ne.current);const it=ne.current.offsetWidth-14,st=((Fe=(ut=(He=(Oe=me.current)==null?void 0:Oe._core)==null?void 0:He._renderService)==null?void 0:ut.dimensions)==null?void 0:Fe.actualCellWidth)||9.5,et=Math.ceil(it/st);me.current.resize(et,8),O(!0)}},[]),m.createElement("div",{ref:ne,className:c()("XtermText-valueRef",Z)})}function J(X){const{status:Z,error_msg:B,output:O,input:ne,expected_output:me,is_file:Oe,input_file_url:He,output_file_url:ut,expected_output_file_url:Fe}=X;let it=null;const st={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(Z){case d.h.NOMATCH:it=m.createElement(m.Fragment,null,m.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!Oe&&m.createElement(ce,{className:"mb10",value:ne}),Oe&&m.createElement("div",{style:st},m.createElement("a",{onClick:()=>(0,w.LR)(He,ne)},ne)),m.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!Oe&&m.createElement(ce,{className:"mb10",value:O&&U.Base64.decode(O)||""}),Oe&&m.createElement("div",{style:st},m.createElement("a",{onClick:()=>(0,w.LR)(ut,O)},O)),m.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!Oe&&m.createElement(ce,{className:"mb10",value:me&&U.Base64.decode(me)||""}),Oe&&m.createElement("div",{style:st},m.createElement("a",{onClick:()=>(0,w.LR)(Fe,me)},me)));break;case d.h.EXECUTEFAILURE:it=m.createElement(m.Fragment,null,m.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!Oe&&m.createElement(s.Z,{value:ne,style:st}),Oe&&m.createElement("div",{style:st},m.createElement("a",{onClick:()=>(0,w.LR)(He,ne)},ne)),m.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),m.createElement("pre",{className:"error"},U.Base64.decode(B)));break;case d.h.COMPILEFAILURE:it=m.createElement(m.Fragment,null,m.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!Oe&&m.createElement(s.Z,{value:ne,style:st}),Oe&&m.createElement("div",{style:st},m.createElement("a",{onClick:()=>(0,w.LR)(He,ne)},ne)),m.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),m.createElement("pre",{className:"error"},U.Base64.decode(B)));break;case d.h.PODFAILURE:it=m.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case d.h.TIMEOUT:it=m.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return m.createElement(m.Fragment,null," ",it," ")}function ae(X){const{status:Z,error_msg:B,execute_time:O,output:ne,input:me,expected_output:Oe,is_file:He,input_file_url:ut,output_file_url:Fe,expected_output_file_url:it}=X;let st=null;switch(Z){case d.h.OK:st=m.createElement(m.Fragment,null,m.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",O,"\u79D2"),m.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),m.createElement("pre",null,U.Base64.decode(ne)));break;case d.h.NOMATCH:st=m.createElement(m.Fragment,null,m.createElement("p",null,"\u8F93\u5165\uFF1A",m.createElement("pre",null,me)),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:st=m.createElement(m.Fragment,null,m.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",m.createElement("pre",null,me)),m.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),m.createElement("pre",{className:"error"},U.Base64.decode(B)));break;case d.h.COMPILEFAILURE:st=m.createElement(m.Fragment,null,m.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",m.createElement("pre",null,me)),m.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),m.createElement("pre",{className:"error"},U.Base64.decode(B)));break;case d.h.PODFAILURE:st=m.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case d.h.TIMEOUT:st=m.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return m.createElement(m.Fragment,null," ",st," ")}var G=({id:X,is_file:Z,input:B,debuging:O,submitting:ne,executingMessage:me,debugResult:Oe,onChangeInput:He,onDebugCode:ut,onSubmitCode:Fe})=>{const[it,st]=(0,R.useReducer)(Ae,ie),{visible:et,tabIndex:Nt}=it;(0,R.useEffect)(()=>{st({type:0,payload:!1})},[X]);function tt(Pe){let Te=Pe.target.id;st({type:1,payload:Te})}function kt(){st({type:0,payload:!et})}const Ne=(0,R.useMemo)(()=>{if(Oe){const{status:Pe}=Oe;return m.createElement(m.Fragment,null,ae(Oe))}return null},[Oe]);function ft(){st({type:0,payload:!0}),st({type:1,payload:"1"}),ut()}return m.createElement("div",{className:"test-case-panel"},m.createElement("div",{className:`test-case-panel-body ${et?"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:Z?"":B,onChange:He}),rightNode:O?m.createElement(S.Z,{message:"\u4EE3\u7801\u6267\u884C\u4E2D..."}):Oe?Ne: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 ${et?"up":""}`,onClick:kt},et?m.createElement(P.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(K.ZP,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),m.createElement(K.ZP,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),m.createElement(K.ZP,{className:"btn-green",type:"ghost",loading:O,onClick:ft},"\u8C03\u8BD5\u4EE3\u7801"),m.createElement(K.ZP,{type:"primary",className:"custom-ant-disabled",loading:ne,disabled:ne,onClick:()=>{st({type:0,payload:!1}),Fe()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},76726:function(Ot,ke,y){"use strict";y.d(ke,{h:function(){return R}});var R=(N=>(N[N.NOMATCH=-1]="NOMATCH",N[N.OK=0]="OK",N[N.TIMEOUT=2]="TIMEOUT",N[N.PODFAILURE=3]="PODFAILURE",N[N.COMPILEFAILURE=4]="COMPILEFAILURE",N[N.EXECUTEFAILURE=5]="EXECUTEFAILURE",N[N.HIDE_COMPILE_STATUS=11]="HIDE_COMPILE_STATUS",N))(R||{})},80266:function(Ot,ke,y){"use strict";y.d(ke,{H7:function(){return s},KC:function(){return c},M3:function(){return k},MK:function(){return S},MU:function(){return P},Rg:function(){return I},WH:function(){return m},X6:function(){return d},bM:function(){return K},bx:function(){return C},dd:function(){return u},de:function(){return H},fi:function(){return w},fu:function(){return N},gu:function(){return M},n4:function(){return f},qe:function(){return T},rL:function(){return F},rX:function(){return U},uc:function(){return W},vl:function(){return l},wO:function(){return E},zO:function(){return A}});var R=y(49317);function N(z){return(0,R.U2)(`mypractices/${z}.json`,{hidePopLogin:!0})}function K(z,ie){return(0,R.v_)(`mypractices/${z}/code_submit.json`,ie)}function P(z,ie){return(0,R.v_)(`mypractices/${z}/code_debug.json`,ie)}function A(z,ie){return ie.language&&(ie.language=encodeURIComponent(ie.language)),(0,R.U2)(`mypractices/${z}/submit_records.json`,ie)}function d(z){return(0,R.U2)("mypractices/record_detail.json",{id:z})}function U(z,ie){return(0,R.U2)(`mypractices/${z}/result.json`,{mode:ie})}function S(z,ie){return(0,R.v_)(`mypractices/${z}/add_notes.json`,ie)}function s(z,ie){return(0,R.v_)(`mypractices/${z}/restore_initial_code.json`,ie)}function w(z,ie){return(0,R.v_)(`mypractices/${z}/sync_code.json`,ie)}function f(z,ie){return(0,R.v_)(`mypractices/${z}/update_code.json`,ie)}function u(z){return(0,R.v_)(`mypractices/${z}/initial_codes.json`)}function l(z,ie){return(0,R.v_)(`discusses/${z}/plus.json`,ie)}function c(z){return(0,R.U2)("practices/practices_list.json",z)}function m(z,ie){return(0,R.U2)(`practices/${z}/question_solution_articles`,ie)}function C(z,ie){return(0,R.v_)(`practices/${z}/question_solution_articles`,ie)}function M(z,ie){return(0,R.gz)(`practices/${z}/question_solution_articles/${ie==null?void 0:ie.active}`,ie)}function k(z,ie){return(0,R.U2)(`practices/${z}/question_solution_articles/${ie==null?void 0:ie.active}/edit`,ie)}function E(z,ie){return(0,R.U2)(`practices/${z}/question_solution_articles/${ie==null?void 0:ie.active}`,ie)}function T(z,ie){return(0,R.v_)(`practices/${z}/question_solution_articles/${ie==null?void 0:ie.active}/set_authority_or_excellent`,ie)}function I(z,ie){return(0,R.v_)(`practices/${z}/question_solution_articles/${ie==null?void 0:ie.active}/praise_or_treads`,ie)}function F(z,ie){return(0,R.v_)(`practices/${z}/question_solution_articles/${ie==null?void 0:ie.active}/hide`)}function H(z,ie){return(0,R.IV)(`practices/${z}/question_solution_articles/${ie==null?void 0:ie.active}`,ie)}function W(z,ie){return(0,R.v_)(`mypractices/${z}/update_practice_time_sum`,ie)}},20047:function(Ot,ke,y){"use strict";y.d(ke,{AL:function(){return I},Iy:function(){return f},Qv:function(){return c},ez:function(){return T},jb:function(){return u}});var R=y(32834),N=y.n(R),K=y(11690),P=y.n(K);let A=1;function d(ie,re){const _e=ie.match(/^(\s+)(?:```)/);if(_e===null)return re;const Ae=_e[1];return re.split(`
|
|
|
`).map(ce=>{const J=ce.match(/^\s+/);if(J===null)return ce;const[ae]=J;return ae.length>=Ae.length?ce.slice(Ae.length):ce}).join(`
|
|
|
`)}let U=[],S=["<ul>"];const s=new(N()).Renderer,w=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function f(){U.length=0,S=["<ul>"]}const u={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function l(ie,re,_e,Ae){if(re>=ie.length||ie[re].level<=_e)return re;var ce=ie[re];Ae.push("<li><a href='#"+A+ce.anchor+"'>"+ce.text+"</a>"),re++;var J=[];return re=l(ie,re,ce.level,J),J.length>0&&(Ae.push("<ul>"),J.forEach(function(ae){Ae.push(ae)}),Ae.push("</ul>")),Ae.push("</li>"),re=l(ie,re,_e,Ae),re}function c(){return l(U,0,0,S),S.push("</ul>"),S.join("")}const m={heading(ie){const re=w.exec(ie);if(A+=1,re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},fences(ie){const re=this.rules.block.fences.exec(ie);if(re){const _e=re[0];let Ae=d(_e,re[3]||"");const ce=re[2]?re[2].trim():re[2];if(["latex","katex","math"].indexOf(ce)>=0){const J=k(),ae=Ae;Ae=J,E[J]={type:"block",expression:ae}}return{type:"code",raw:_e,lang:ce,text:Ae}}}},C=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let M=0;const k=()=>`__special_katext_id_${M++}__`;let E={};function T(){return E}function I(){M=0,E={}}function F(ie){return ie=ie.replace(C,(re,_e)=>{const Ae=k();return E[Ae]={type:"inline",expression:_e},Ae}),ie}const H=s.listitem;s.listitem=function(ie){return H(F(ie))};const W=s.paragraph;s.paragraph=function(ie){return W(F(ie))};const z=s.tablecell;s.tablecell=function(ie,re){return z(F(ie),re)},s.code=function(ie,re,_e){const Ae=(re||"").match(/\S*/)[0];return Ae?["latex","katex","math"].indexOf(Ae)>=0?`<p class='editormd-tex'>${ie}</p>`:`<pre class="prettyprint linenums"><code class="language-${re}">${_e?ie:(0,K.escape)(ie,!0)}</code></pre>
|
|
|
`:'<pre class="prettyprint linenums"><code>'+(_e?ie:(0,K.escape)(ie,!0))+"</code></pre>"},s.heading=function(ie,re,_e){let Ae=this.options.headerPrefix+_e.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return U.push({anchor:Ae,level:re,text:ie}),"<h"+re+' id="'+A+Ae+'">'+ie+"</h"+re+">"},N().setOptions({silent:!0,gfm:!0,pedantic:!1}),N().use({tokenizer:m,renderer:s}),ke.ZP=N()},29509:function(Ot,ke,y){"use strict";y.d(ke,{o2:function(){return A},yT:function(){return d}});var R=y(77654),N=y(34998);const K=N.i.map(U=>`${U}-inverse`),P=["success","processing","error","default","warning"];function A(U){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,R.Z)(K),(0,R.Z)(N.i)).includes(U):N.i.includes(U)}function d(U){return P.includes(U)}},99402:function(Ot,ke,y){"use strict";y.d(ke,{T:function(){return N},n:function(){return R}});function R(K){return["small","middle","large"].includes(K)}function N(K){return K?typeof K=="number"&&!Number.isNaN(K):!1}},86013:function(Ot,ke,y){"use strict";var R=y(59301),N=y(19248);const K=P=>{let A;return typeof P=="object"&&(P!=null&&P.clearIcon)?A=P:P&&(A={clearIcon:R.createElement(N.Z,null)}),A};ke.Z=K},52838:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return d}});var R=y(37645);function N(U,S,s,w){if(w===!1)return{adjustX:!1,adjustY:!1};const f=w&&typeof w=="object"?w:{},u={};switch(U){case"top":case"bottom":u.shiftX=S.arrowOffsetHorizontal*2+s,u.shiftY=!0,u.adjustY=!0;break;case"left":case"right":u.shiftY=S.arrowOffsetVertical*2+s,u.shiftX=!0,u.adjustX=!0;break}const l=Object.assign(Object.assign({},u),f);return l.shiftX||(l.adjustX=!0),l.shiftY||(l.adjustY=!0),l}const K={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"]}},P={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:S,autoAdjustOverflow:s,arrowPointAtCenter:w,offset:f,borderRadius:u,visibleFirst:l}=U,c=S/2,m={};return Object.keys(K).forEach(C=>{const M=w&&P[C]||K[C],k=Object.assign(Object.assign({},M),{offset:[0,0],dynamicInset:!0});switch(m[C]=k,A.has(C)&&(k.autoArrow=!1),C){case"top":case"topLeft":case"topRight":k.offset[1]=-c-f;break;case"bottom":case"bottomLeft":case"bottomRight":k.offset[1]=c+f;break;case"left":case"leftTop":case"leftBottom":k.offset[0]=-c-f;break;case"right":case"rightTop":case"rightBottom":k.offset[0]=c+f;break}const E=(0,R.wZ)({contentRadius:u,limitVerticalRadius:!0});if(w)switch(C){case"topLeft":case"bottomLeft":k.offset[0]=-E.arrowOffsetHorizontal-c;break;case"topRight":case"bottomRight":k.offset[0]=E.arrowOffsetHorizontal+c;break;case"leftTop":case"rightTop":k.offset[1]=-E.arrowOffsetHorizontal*2+c;break;case"leftBottom":case"rightBottom":k.offset[1]=E.arrowOffsetHorizontal*2-c;break}k.overflow=N(C,E,S,s),l&&(k.htmlRegion="visibleFirst")}),m}},82855:function(Ot,ke,y){"use strict";y.d(ke,{F:function(){return A},Z:function(){return P}});var R=y(92310),N=y.n(R);const K=null;function P(d,U,S){return N()({[`${d}-status-success`]:U==="success",[`${d}-status-warning`]:U==="warning",[`${d}-status-error`]:U==="error",[`${d}-status-validating`]:U==="validating",[`${d}-has-feedback`]:S})}const A=(d,U)=>U||d},24971:function(Ot,ke,y){"use strict";var R=y(59301),N=y(56553),K=y(48755);const P=function(A,d){let U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;var S,s;const{variant:w,[A]:f}=R.useContext(K.E_),u=R.useContext(N.pg),l=f==null?void 0:f.variant;let c;typeof d!="undefined"?c=d:U===!1?c="borderless":c=(s=(S=u!=null?u:l)!==null&&S!==void 0?S:w)!==null&&s!==void 0?s:"outlined";const m=K.tr.includes(c);return[c,m]};ke.Z=P},49397:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return I}});var R=y(59301),N=y(92310),K=y.n(N),P=y(36901),A=y(8654),d=y(62487),U=y(86013),S=y(82855),s=y(48755),w=y(2171),f=y(83397),u=y(31756),l=y(56553),c=y(24971),m=y(70045),C=y(23826),M=y(53075);function k(F){return!!(F.prefix||F.suffix||F.allowClear||F.showCount)}var E=function(F,H){var W={};for(var z in F)Object.prototype.hasOwnProperty.call(F,z)&&H.indexOf(z)<0&&(W[z]=F[z]);if(F!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,z=Object.getOwnPropertySymbols(F);ie<z.length;ie++)H.indexOf(z[ie])<0&&Object.prototype.propertyIsEnumerable.call(F,z[ie])&&(W[z[ie]]=F[z[ie]]);return W},I=(0,R.forwardRef)((F,H)=>{const{prefixCls:W,bordered:z=!0,status:ie,size:re,disabled:_e,onBlur:Ae,onFocus:ce,suffix:J,allowClear:ae,addonAfter:G,addonBefore:X,className:Z,style:B,styles:O,rootClassName:ne,onChange:me,classNames:Oe,variant:He}=F,ut=E(F,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:Fe,direction:it,allowClear:st,autoComplete:et,className:Nt,style:tt,classNames:kt,styles:Ne}=(0,s.dj)("input"),ft=Fe("input",W),Pe=(0,R.useRef)(null),Te=(0,f.Z)(ft),[Se,ze,Je]=(0,M.TI)(ft,ne),[rt]=(0,M.ZP)(ft,Te),{compactSize:de,compactItemClassnames:Le}=(0,m.ri)(ft,it),We=(0,u.Z)(q=>{var Be;return(Be=re!=null?re:de)!==null&&Be!==void 0?Be:q}),Ge=R.useContext(w.Z),Xe=_e!=null?_e:Ge,{status:gt,hasFeedback:Ct,feedbackIcon:ht}=(0,R.useContext)(l.aM),dt=(0,S.F)(gt,ie),vt=k(F)||!!Ct,Pt=(0,R.useRef)(vt),Tt=(0,C.Z)(Pe,!0),xt=q=>{Tt(),Ae==null||Ae(q)},Ke=q=>{Tt(),ce==null||ce(q)},St=q=>{Tt(),me==null||me(q)},_t=(Ct||J)&&R.createElement(R.Fragment,null,J,Ct&&ht),lt=(0,U.Z)(ae!=null?ae:st),[At,$]=(0,c.Z)("input",He,z);return Se(rt(R.createElement(P.default,Object.assign({ref:(0,A.sQ)(H,Pe),prefixCls:ft,autoComplete:et},ut,{disabled:Xe,onBlur:xt,onFocus:Ke,style:Object.assign(Object.assign({},tt),B),styles:Object.assign(Object.assign({},Ne),O),suffix:_t,allowClear:lt,className:K()(Z,ne,Je,Te,Le,Nt),onChange:St,addonBefore:X&&R.createElement(d.Z,{form:!0,space:!0},X),addonAfter:G&&R.createElement(d.Z,{form:!0,space:!0},G),classNames:Object.assign(Object.assign(Object.assign({},Oe),kt),{input:K()({[`${ft}-sm`]:We==="small",[`${ft}-lg`]:We==="large",[`${ft}-rtl`]:it==="rtl"},Oe==null?void 0:Oe.input,kt.input,ze),variant:K()({[`${ft}-${At}`]:$},(0,S.Z)(ft,dt)),affixWrapper:K()({[`${ft}-affix-wrapper-sm`]:We==="small",[`${ft}-affix-wrapper-lg`]:We==="large",[`${ft}-affix-wrapper-rtl`]:it==="rtl"},ze),wrapper:K()({[`${ft}-group-rtl`]:it==="rtl"},ze),groupWrapper:K()({[`${ft}-group-wrapper-sm`]:We==="small",[`${ft}-group-wrapper-lg`]:We==="large",[`${ft}-group-wrapper-rtl`]:it==="rtl",[`${ft}-group-wrapper-${At}`]:$},(0,S.Z)(`${ft}-group-wrapper`,dt,Ct),ze)})}))))})},79809:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return H}});var R=y(59301),N=y(92310),K=y.n(N),P=y(22711),A=y(86013),d=y(82855),U=y(48755),S=y(2171),s=y(83397),w=y(31756),f=y(56553),u=y(24971),l=y(70045),c=y(30292),m=y(53075),C=y(16931),M=y(51636),k=y(64910);const E=W=>{const{componentCls:z,paddingLG:ie}=W,re=`${z}-textarea`;return{[`textarea${z}`]:{maxWidth:"100%",height:"auto",minHeight:W.controlHeight,lineHeight:W.lineHeight,verticalAlign:"bottom",transition:`all ${W.motionDurationSlow}`,resize:"vertical",[`&${z}-mouse-active`]:{transition:`all ${W.motionDurationSlow}, height 0s, width 0s`}},[`${z}-textarea-affix-wrapper-resize-dirty`]:{width:"auto"},[re]:{position:"relative","&-show-count":{[`> ${z}`]:{height:"100%"},[`${z}-data-count`]:{position:"absolute",bottom:W.calc(W.fontSize).mul(W.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:W.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},[`
|
|
|
&-allow-clear > ${z},
|
|
|
&-affix-wrapper${re}-has-feedback ${z}
|
|
|
`]:{paddingInlineEnd:ie},[`&-affix-wrapper${z}-affix-wrapper`]:{padding:0,[`> textarea${z}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:W.calc(W.controlHeight).sub(W.calc(W.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},[`${z}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${z}-clear-icon`]:{position:"absolute",insetInlineEnd:W.paddingInline,insetBlockStart:W.paddingXS},[`${re}-suffix`]:{position:"absolute",top:0,insetInlineEnd:W.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},[`&-affix-wrapper${z}-affix-wrapper-sm`]:{[`${z}-suffix`]:{[`${z}-clear-icon`]:{insetInlineEnd:W.paddingInlineSM}}}}}};var T=(0,C.I$)(["Input","TextArea"],W=>{const z=(0,M.mergeToken)(W,(0,k.e)(W));return[E(z)]},k.T,{resetFont:!1}),I=function(W,z){var ie={};for(var re in W)Object.prototype.hasOwnProperty.call(W,re)&&z.indexOf(re)<0&&(ie[re]=W[re]);if(W!=null&&typeof Object.getOwnPropertySymbols=="function")for(var _e=0,re=Object.getOwnPropertySymbols(W);_e<re.length;_e++)z.indexOf(re[_e])<0&&Object.prototype.propertyIsEnumerable.call(W,re[_e])&&(ie[re[_e]]=W[re[_e]]);return ie},H=(0,R.forwardRef)((W,z)=>{var ie;const{prefixCls:re,bordered:_e=!0,size:Ae,disabled:ce,status:J,allowClear:ae,classNames:G,rootClassName:X,className:Z,style:B,styles:O,variant:ne,showCount:me,onMouseDown:Oe,onResize:He}=W,ut=I(W,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","style","styles","variant","showCount","onMouseDown","onResize"]),{getPrefixCls:Fe,direction:it,allowClear:st,autoComplete:et,className:Nt,style:tt,classNames:kt,styles:Ne}=(0,U.dj)("textArea"),ft=R.useContext(S.Z),Pe=ce!=null?ce:ft,{status:Te,hasFeedback:Se,feedbackIcon:ze}=R.useContext(f.aM),Je=(0,d.F)(Te,J),rt=R.useRef(null);R.useImperativeHandle(z,()=>{var $;return{resizableTextArea:($=rt.current)===null||$===void 0?void 0:$.resizableTextArea,focus:q=>{var Be,oe;(0,c.nH)((oe=(Be=rt.current)===null||Be===void 0?void 0:Be.resizableTextArea)===null||oe===void 0?void 0:oe.textArea,q)},blur:()=>{var q;return(q=rt.current)===null||q===void 0?void 0:q.blur()}}});const de=Fe("input",re),Le=(0,s.Z)(de),[We,Ge,Xe]=(0,m.TI)(de,X),[gt]=T(de,Le),{compactSize:Ct,compactItemClassnames:ht}=(0,l.ri)(de,it),dt=(0,w.Z)($=>{var q;return(q=Ae!=null?Ae:Ct)!==null&&q!==void 0?q:$}),[vt,Pt]=(0,u.Z)("textArea",ne,_e),Tt=(0,A.Z)(ae!=null?ae:st),[xt,Ke]=R.useState(!1),[St,_t]=R.useState(!1),lt=$=>{Ke(!0),Oe==null||Oe($);const q=()=>{Ke(!1),document.removeEventListener("mouseup",q)};document.addEventListener("mouseup",q)},At=$=>{var q,Be;if(He==null||He($),xt&&typeof getComputedStyle=="function"){const oe=(Be=(q=rt.current)===null||q===void 0?void 0:q.nativeElement)===null||Be===void 0?void 0:Be.querySelector("textarea");oe&&getComputedStyle(oe).resize==="both"&&_t(!0)}};return We(gt(R.createElement(P.default,Object.assign({autoComplete:et},ut,{style:Object.assign(Object.assign({},tt),B),styles:Object.assign(Object.assign({},Ne),O),disabled:Pe,allowClear:Tt,className:K()(Xe,Le,Z,X,ht,Nt,St&&`${de}-textarea-affix-wrapper-resize-dirty`),classNames:Object.assign(Object.assign(Object.assign({},G),kt),{textarea:K()({[`${de}-sm`]:dt==="small",[`${de}-lg`]:dt==="large"},Ge,G==null?void 0:G.textarea,kt.textarea,xt&&`${de}-mouse-active`),variant:K()({[`${de}-${vt}`]:Pt},(0,d.Z)(de,Je)),affixWrapper:K()(`${de}-textarea-affix-wrapper`,{[`${de}-affix-wrapper-rtl`]:it==="rtl",[`${de}-affix-wrapper-sm`]:dt==="small",[`${de}-affix-wrapper-lg`]:dt==="large",[`${de}-textarea-show-count`]:me||((ie=W.count)===null||ie===void 0?void 0:ie.show)},Ge)}),prefixCls:de,suffix:Se&&R.createElement("span",{className:`${de}-textarea-suffix`},ze),showCount:me,ref:rt,onResize:At,onMouseDown:lt}))))})},23826:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return N}});var R=y(59301);function N(K,P){const A=(0,R.useRef)([]),d=()=>{A.current.push(setTimeout(()=>{var U,S,s,w;!((U=K.current)===null||U===void 0)&&U.input&&((S=K.current)===null||S===void 0?void 0:S.input.getAttribute("type"))==="password"&&(!((s=K.current)===null||s===void 0)&&s.input.hasAttribute("value"))&&((w=K.current)===null||w===void 0||w.input.removeAttribute("value"))}))};return(0,R.useEffect)(()=>(P&&d(),()=>A.current.forEach(U=>{U&&clearTimeout(U)})),[]),d}},37568:function(Ot,ke,y){"use strict";y.d(ke,{default:function(){return kt}});var R=y(59301),N=y(92310),K=y.n(N),P=y(48755),A=y(56553),d=y(53075),S=Ne=>{const{getPrefixCls:ft,direction:Pe}=(0,R.useContext)(P.E_),{prefixCls:Te,className:Se}=Ne,ze=ft("input-group",Te),Je=ft("input"),[rt,de,Le]=(0,d.ZP)(Je),We=K()(ze,Le,{[`${ze}-lg`]:Ne.size==="large",[`${ze}-sm`]:Ne.size==="small",[`${ze}-compact`]:Ne.compact,[`${ze}-rtl`]:Pe==="rtl"},de,Se),Ge=(0,R.useContext)(A.aM),Xe=(0,R.useMemo)(()=>Object.assign(Object.assign({},Ge),{isFormItemInput:!1}),[Ge]);return rt(R.createElement("span",{className:We,style:Ne.style,onMouseEnter:Ne.onMouseEnter,onMouseLeave:Ne.onMouseLeave,onFocus:Ne.onFocus,onBlur:Ne.onBlur},R.createElement(A.aM.Provider,{value:Xe},Ne.children)))},s=y(49397),w=y(77654),f=y(6089),u=y(26112),l=y(82855),c=y(31756),m=y(16931),C=y(51636),M=y(64910);const k=Ne=>{const{componentCls:ft,paddingXS:Pe}=Ne;return{[ft]:{display:"inline-flex",alignItems:"center",flexWrap:"nowrap",columnGap:Pe,"&-rtl":{direction:"rtl"},[`${ft}-input`]:{textAlign:"center",paddingInline:Ne.paddingXXS},[`&${ft}-sm ${ft}-input`]:{paddingInline:Ne.calc(Ne.paddingXXS).div(2).equal()},[`&${ft}-lg ${ft}-input`]:{paddingInline:Ne.paddingXS}}}};var E=(0,m.I$)(["Input","OTP"],Ne=>{const ft=(0,C.mergeToken)(Ne,(0,M.e)(Ne));return[k(ft)]},M.T),T=y(16089),I=function(Ne,ft){var Pe={};for(var Te in Ne)Object.prototype.hasOwnProperty.call(Ne,Te)&&ft.indexOf(Te)<0&&(Pe[Te]=Ne[Te]);if(Ne!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Se=0,Te=Object.getOwnPropertySymbols(Ne);Se<Te.length;Se++)ft.indexOf(Te[Se])<0&&Object.prototype.propertyIsEnumerable.call(Ne,Te[Se])&&(Pe[Te[Se]]=Ne[Te[Se]]);return Pe},H=R.forwardRef((Ne,ft)=>{const{value:Pe,onChange:Te,onActiveChange:Se,index:ze,mask:Je}=Ne,rt=I(Ne,["value","onChange","onActiveChange","index","mask"]),de=Pe&&typeof Je=="string"?Je:Pe,Le=Ct=>{Te(ze,Ct.target.value)},We=R.useRef(null);R.useImperativeHandle(ft,()=>We.current);const Ge=()=>{(0,T.Z)(()=>{var Ct;const ht=(Ct=We.current)===null||Ct===void 0?void 0:Ct.input;document.activeElement===ht&&ht&&ht.select()})},Xe=Ct=>{const{key:ht,ctrlKey:dt,metaKey:vt}=Ct;ht==="ArrowLeft"?Se(ze-1):ht==="ArrowRight"?Se(ze+1):ht==="z"&&(dt||vt)&&Ct.preventDefault(),Ge()},gt=Ct=>{Ct.key==="Backspace"&&!Pe&&Se(ze-1),Ge()};return R.createElement(s.Z,Object.assign({type:Je===!0?"password":"text"},rt,{ref:We,value:de,onInput:Le,onFocus:Ge,onKeyDown:Xe,onKeyUp:gt,onMouseDown:Ge,onMouseUp:Ge}))}),W=function(Ne,ft){var Pe={};for(var Te in Ne)Object.prototype.hasOwnProperty.call(Ne,Te)&&ft.indexOf(Te)<0&&(Pe[Te]=Ne[Te]);if(Ne!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Se=0,Te=Object.getOwnPropertySymbols(Ne);Se<Te.length;Se++)ft.indexOf(Te[Se])<0&&Object.prototype.propertyIsEnumerable.call(Ne,Te[Se])&&(Pe[Te[Se]]=Ne[Te[Se]]);return Pe};function z(Ne){return(Ne||"").split("")}const ie=Ne=>{const{index:ft,prefixCls:Pe,separator:Te}=Ne,Se=typeof Te=="function"?Te(ft):Te;return Se?R.createElement("span",{className:`${Pe}-separator`},Se):null};var _e=R.forwardRef((Ne,ft)=>{const{prefixCls:Pe,length:Te=6,size:Se,defaultValue:ze,value:Je,onChange:rt,formatter:de,separator:Le,variant:We,disabled:Ge,status:Xe,autoFocus:gt,mask:Ct,type:ht,onInput:dt,inputMode:vt}=Ne,Pt=W(Ne,["prefixCls","length","size","defaultValue","value","onChange","formatter","separator","variant","disabled","status","autoFocus","mask","type","onInput","inputMode"]),{getPrefixCls:Tt,direction:xt}=R.useContext(P.E_),Ke=Tt("otp",Pe),St=(0,u.Z)(Pt,{aria:!0,data:!0,attr:!0}),[_t,lt,At]=E(Ke),$=(0,c.Z)(ot=>Se!=null?Se:ot),q=R.useContext(A.aM),Be=(0,l.F)(q.status,Xe),oe=R.useMemo(()=>Object.assign(Object.assign({},q),{status:Be,hasFeedback:!1,feedbackIcon:null}),[q,Be]),ge=R.useRef(null),Lt=R.useRef({});R.useImperativeHandle(ft,()=>({focus:()=>{var ot;(ot=Lt.current[0])===null||ot===void 0||ot.focus()},blur:()=>{var ot;for(let ve=0;ve<Te;ve+=1)(ot=Lt.current[ve])===null||ot===void 0||ot.blur()},nativeElement:ge.current}));const Re=ot=>de?de(ot):ot,[Me,$e]=R.useState(()=>z(Re(ze||"")));R.useEffect(()=>{Je!==void 0&&$e(z(Je))},[Je]);const he=(0,f.Z)(ot=>{$e(ot),dt&&dt(ot),rt&&ot.length===Te&&ot.every(ve=>ve)&&ot.some((ve,Rt)=>Me[Rt]!==ve)&&rt(ot.join(""))}),fe=(0,f.Z)((ot,ve)=>{let Rt=(0,w.Z)(Me);for(let zt=0;zt<ot;zt+=1)Rt[zt]||(Rt[zt]="");ve.length<=1?Rt[ot]=ve:Rt=Rt.slice(0,ot).concat(z(ve)),Rt=Rt.slice(0,Te);for(let zt=Rt.length-1;zt>=0&&!Rt[zt];zt-=1)Rt.pop();const Bt=Re(Rt.map(zt=>zt||" ").join(""));return Rt=z(Bt).map((zt,Cr)=>zt===" "&&!Rt[Cr]?Rt[Cr]:zt),Rt}),Ee=(ot,ve)=>{var Rt;const Bt=fe(ot,ve),zt=Math.min(ot+ve.length,Te-1);zt!==ot&&Bt[ot]!==void 0&&((Rt=Lt.current[zt])===null||Rt===void 0||Rt.focus()),he(Bt)},Ie=ot=>{var ve;(ve=Lt.current[ot])===null||ve===void 0||ve.focus()},se={variant:We,disabled:Ge,status:Be,mask:Ct,type:ht,inputMode:vt};return _t(R.createElement("div",Object.assign({},St,{ref:ge,className:K()(Ke,{[`${Ke}-sm`]:$==="small",[`${Ke}-lg`]:$==="large",[`${Ke}-rtl`]:xt==="rtl"},At,lt)}),R.createElement(A.aM.Provider,{value:oe},Array.from({length:Te}).map((ot,ve)=>{const Rt=`otp-${ve}`,Bt=Me[ve]||"";return R.createElement(R.Fragment,{key:Rt},R.createElement(H,Object.assign({ref:zt=>{Lt.current[ve]=zt},index:ve,size:$,htmlSize:1,className:`${Ke}-input`,onChange:Ee,value:Bt,onActiveChange:Ie,autoFocus:ve===0&>},se)),ve<Te-1&&R.createElement(ie,{separator:Le,index:ve,prefixCls:Ke}))}))))}),Ae=y(73331),ce=y(15277),J=y(2738),ae=y(8654),G=y(2171),X=y(23826),Z=function(Ne,ft){var Pe={};for(var Te in Ne)Object.prototype.hasOwnProperty.call(Ne,Te)&&ft.indexOf(Te)<0&&(Pe[Te]=Ne[Te]);if(Ne!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Se=0,Te=Object.getOwnPropertySymbols(Ne);Se<Te.length;Se++)ft.indexOf(Te[Se])<0&&Object.prototype.propertyIsEnumerable.call(Ne,Te[Se])&&(Pe[Te[Se]]=Ne[Te[Se]]);return Pe};const B=Ne=>Ne?R.createElement(ce.Z,null):R.createElement(Ae.Z,null),O={click:"onClick",hover:"onMouseOver"};var me=R.forwardRef((Ne,ft)=>{const{disabled:Pe,action:Te="click",visibilityToggle:Se=!0,iconRender:ze=B}=Ne,Je=R.useContext(G.Z),rt=Pe!=null?Pe:Je,de=typeof Se=="object"&&Se.visible!==void 0,[Le,We]=(0,R.useState)(()=>de?Se.visible:!1),Ge=(0,R.useRef)(null);R.useEffect(()=>{de&&We(Se.visible)},[de,Se]);const Xe=(0,X.Z)(Ge),gt=()=>{var $;if(rt)return;Le&&Xe();const q=!Le;We(q),typeof Se=="object"&&(($=Se.onVisibleChange)===null||$===void 0||$.call(Se,q))},Ct=$=>{const q=O[Te]||"",Be=ze(Le),oe={[q]:gt,className:`${$}-icon`,key:"passwordIcon",onMouseDown:ge=>{ge.preventDefault()},onMouseUp:ge=>{ge.preventDefault()}};return R.cloneElement(R.isValidElement(Be)?Be:R.createElement("span",null,Be),oe)},{className:ht,prefixCls:dt,inputPrefixCls:vt,size:Pt}=Ne,Tt=Z(Ne,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:xt}=R.useContext(P.E_),Ke=xt("input",vt),St=xt("input-password",dt),_t=Se&&Ct(St),lt=K()(St,ht,{[`${St}-${Pt}`]:!!Pt}),At=Object.assign(Object.assign({},(0,J.Z)(Tt,["suffix","iconRender","visibilityToggle"])),{type:Le?"text":"password",className:lt,prefixCls:Ke,suffix:_t});return Pt&&(At.size=Pt),R.createElement(s.Z,Object.assign({ref:(0,ae.sQ)(ft,Ge)},At))}),Oe=y(47472),He=y(22703),ut=y(7939),Fe=y(70045),it=function(Ne,ft){var Pe={};for(var Te in Ne)Object.prototype.hasOwnProperty.call(Ne,Te)&&ft.indexOf(Te)<0&&(Pe[Te]=Ne[Te]);if(Ne!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Se=0,Te=Object.getOwnPropertySymbols(Ne);Se<Te.length;Se++)ft.indexOf(Te[Se])<0&&Object.prototype.propertyIsEnumerable.call(Ne,Te[Se])&&(Pe[Te[Se]]=Ne[Te[Se]]);return Pe},et=R.forwardRef((Ne,ft)=>{const{prefixCls:Pe,inputPrefixCls:Te,className:Se,size:ze,suffix:Je,enterButton:rt=!1,addonAfter:de,loading:Le,disabled:We,onSearch:Ge,onChange:Xe,onCompositionStart:gt,onCompositionEnd:Ct}=Ne,ht=it(Ne,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:dt,direction:vt}=R.useContext(P.E_),Pt=R.useRef(!1),Tt=dt("input-search",Pe),xt=dt("input",Te),{compactSize:Ke}=(0,Fe.ri)(Tt,vt),St=(0,c.Z)(Ee=>{var Ie;return(Ie=ze!=null?ze:Ke)!==null&&Ie!==void 0?Ie:Ee}),_t=R.useRef(null),lt=Ee=>{Ee!=null&&Ee.target&&Ee.type==="click"&&Ge&&Ge(Ee.target.value,Ee,{source:"clear"}),Xe==null||Xe(Ee)},At=Ee=>{var Ie;document.activeElement===((Ie=_t.current)===null||Ie===void 0?void 0:Ie.input)&&Ee.preventDefault()},$=Ee=>{var Ie,se;Ge&&Ge((se=(Ie=_t.current)===null||Ie===void 0?void 0:Ie.input)===null||se===void 0?void 0:se.value,Ee,{source:"input"})},q=Ee=>{Pt.current||Le||$(Ee)},Be=typeof rt=="boolean"?R.createElement(Oe.Z,null):null,oe=`${Tt}-button`;let ge;const Lt=rt||{},Re=Lt.type&&Lt.type.__ANT_BUTTON===!0;Re||Lt.type==="button"?ge=(0,He.Tm)(Lt,Object.assign({onMouseDown:At,onClick:Ee=>{var Ie,se;(se=(Ie=Lt==null?void 0:Lt.props)===null||Ie===void 0?void 0:Ie.onClick)===null||se===void 0||se.call(Ie,Ee),$(Ee)},key:"enterButton"},Re?{className:oe,size:St}:{})):ge=R.createElement(ut.ZP,{className:oe,type:rt?"primary":void 0,size:St,disabled:We,key:"enterButton",onMouseDown:At,onClick:$,loading:Le,icon:Be},rt),de&&(ge=[ge,(0,He.Tm)(de,{key:"addonAfter"})]);const Me=K()(Tt,{[`${Tt}-rtl`]:vt==="rtl",[`${Tt}-${St}`]:!!St,[`${Tt}-with-button`]:!!rt},Se),$e=Object.assign(Object.assign({},ht),{className:Me,prefixCls:xt,type:"search"}),he=Ee=>{Pt.current=!0,gt==null||gt(Ee)},fe=Ee=>{Pt.current=!1,Ct==null||Ct(Ee)};return R.createElement(s.Z,Object.assign({ref:(0,ae.sQ)(_t,ft),onPressEnter:q},$e,{size:St,onCompositionStart:he,onCompositionEnd:fe,addonAfter:ge,suffix:Je,onChange:lt,disabled:We}))}),Nt=y(79809);const tt=s.Z;tt.Group=S,tt.Search=et,tt.TextArea=Nt.Z,tt.Password=me,tt.OTP=_e;var kt=tt},53075:function(Ot,ke,y){"use strict";y.d(ke,{TI:function(){return T},ik:function(){return u},nz:function(){return S},s7:function(){return l},x0:function(){return f}});var R=y(36237),N=y(63356),K=y(56119),P=y(16931),A=y(51636),d=y(64910),U=y(39082);const S=I=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:I,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),s=I=>({borderColor:I.activeBorderColor,boxShadow:I.activeShadow,outline:0,backgroundColor:I.activeBg}),w=I=>{const{paddingBlockLG:F,lineHeightLG:H,borderRadiusLG:W,paddingInlineLG:z}=I;return{padding:`${(0,R.unit)(F)} ${(0,R.unit)(z)}`,fontSize:I.inputFontSizeLG,lineHeight:H,borderRadius:W}},f=I=>({padding:`${(0,R.unit)(I.paddingBlockSM)} ${(0,R.unit)(I.paddingInlineSM)}`,fontSize:I.inputFontSizeSM,borderRadius:I.borderRadiusSM}),u=I=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${(0,R.unit)(I.paddingBlock)} ${(0,R.unit)(I.paddingInline)}`,color:I.colorText,fontSize:I.inputFontSize,lineHeight:I.lineHeight,borderRadius:I.borderRadius,transition:`all ${I.motionDurationMid}`},S(I.colorTextPlaceholder)),{"&-lg":Object.assign({},w(I)),"&-sm":Object.assign({},f(I)),"&-rtl, &-textarea-rtl":{direction:"rtl"}}),l=I=>{const{componentCls:F,antCls:H}=I;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:I.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${F}, &-lg > ${F}-group-addon`]:Object.assign({},w(I)),[`&-sm ${F}, &-sm > ${F}-group-addon`]:Object.assign({},f(I)),[`&-lg ${H}-select-single ${H}-select-selector`]:{height:I.controlHeightLG},[`&-sm ${H}-select-single ${H}-select-selector`]:{height:I.controlHeightSM},[`> ${F}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${F}-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 ${(0,R.unit)(I.paddingInline)}`,color:I.colorText,fontWeight:"normal",fontSize:I.inputFontSize,textAlign:"center",borderRadius:I.borderRadius,transition:`all ${I.motionDurationSlow}`,lineHeight:1,[`${H}-select`]:{margin:`${(0,R.unit)(I.calc(I.paddingBlock).add(1).mul(-1).equal())} ${(0,R.unit)(I.calc(I.paddingInline).mul(-1).equal())}`,[`&${H}-select-single:not(${H}-select-customize-input):not(${H}-pagination-size-changer)`]:{[`${H}-select-selector`]:{backgroundColor:"inherit",border:`${(0,R.unit)(I.lineWidth)} ${I.lineType} transparent`,boxShadow:"none"}}},[`${H}-cascader-picker`]:{margin:`-9px ${(0,R.unit)(I.calc(I.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${H}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[F]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${F}-search-with-button &`]:{zIndex:0}}},[`> ${F}:first-child, ${F}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${H}-select ${H}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${F}-affix-wrapper`]:{[`&:not(:first-child) ${F}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${F}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${F}:last-child, ${F}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${H}-select ${H}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${F}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${F}-search &`]:{borderStartStartRadius:I.borderRadius,borderEndStartRadius:I.borderRadius}},[`&:not(:first-child), ${F}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${F}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,N.dF)()),{[`${F}-group-addon, ${F}-group-wrap, > ${F}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:I.lineWidth,"&:hover, &:focus":{zIndex:1}}},"& > *":{display:"inline-flex",float:"none",verticalAlign:"top",borderRadius:0},[`
|
|
|
& > ${F}-affix-wrapper,
|
|
|
& > ${F}-number-affix-wrapper,
|
|
|
& > ${H}-picker-range
|
|
|
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:I.calc(I.lineWidth).mul(-1).equal(),borderInlineEndWidth:I.lineWidth},[F]:{float:"none"},[`& > ${H}-select > ${H}-select-selector,
|
|
|
& > ${H}-select-auto-complete ${F},
|
|
|
& > ${H}-cascader-picker ${F},
|
|
|
& > ${F}-group-wrapper ${F}`]:{borderInlineEndWidth:I.lineWidth,borderRadius:0,"&:hover, &:focus":{zIndex:1}},[`& > ${H}-select-focused`]:{zIndex:1},[`& > ${H}-select > ${H}-select-arrow`]:{zIndex:1},[`& > *:first-child,
|
|
|
& > ${H}-select:first-child > ${H}-select-selector,
|
|
|
& > ${H}-select-auto-complete:first-child ${F},
|
|
|
& > ${H}-cascader-picker:first-child ${F}`]:{borderStartStartRadius:I.borderRadius,borderEndStartRadius:I.borderRadius},[`& > *:last-child,
|
|
|
& > ${H}-select:last-child > ${H}-select-selector,
|
|
|
& > ${H}-cascader-picker:last-child ${F},
|
|
|
& > ${H}-cascader-picker-focused:last-child ${F}`]:{borderInlineEndWidth:I.lineWidth,borderStartEndRadius:I.borderRadius,borderEndEndRadius:I.borderRadius},[`& > ${H}-select-auto-complete ${F}`]:{verticalAlign:"top"},[`${F}-group-wrapper + ${F}-group-wrapper`]:{marginInlineStart:I.calc(I.lineWidth).mul(-1).equal(),[`${F}-affix-wrapper`]:{borderRadius:0}},[`${F}-group-wrapper:not(:last-child)`]:{[`&${F}-search > ${F}-group`]:{[`& > ${F}-group-addon > ${F}-search-button`]:{borderRadius:0},[`& > ${F}`]:{borderStartStartRadius:I.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:I.borderRadius}}}})}},c=I=>{const{componentCls:F,controlHeightSM:H,lineWidth:W,calc:z}=I,re=z(H).sub(z(W).mul(2)).sub(16).div(2).equal();return{[F]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,N.Wf)(I)),u(I)),(0,U.qG)(I)),(0,U.H8)(I)),(0,U.Mu)(I)),(0,U.vc)(I)),{'&[type="color"]':{height:I.controlHeight,[`&${F}-lg`]:{height:I.controlHeightLG},[`&${F}-sm`]:{height:H,paddingTop:re,paddingBottom:re}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{appearance:"none"}})}},m=I=>{const{componentCls:F}=I;return{[`${F}-clear-icon`]:{margin:0,padding:0,lineHeight:0,color:I.colorTextQuaternary,fontSize:I.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${I.motionDurationSlow}`,border:"none",outline:"none",backgroundColor:"transparent","&:hover":{color:I.colorTextTertiary},"&:active":{color:I.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${(0,R.unit)(I.inputAffixPadding)}`}}}},C=I=>{const{componentCls:F,inputAffixPadding:H,colorTextDescription:W,motionDurationSlow:z,colorIcon:ie,colorIconHover:re,iconCls:_e}=I,Ae=`${F}-affix-wrapper`,ce=`${F}-affix-wrapper-disabled`;return{[Ae]:Object.assign(Object.assign(Object.assign(Object.assign({},u(I)),{display:"inline-flex",[`&:not(${F}-disabled):hover`]:{zIndex:1,[`${F}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${F}`]:{padding:0},[`> input${F}, > textarea${F}`]:{fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[F]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:I.paddingXS}},"&-show-count-suffix":{color:W},"&-show-count-has-suffix":{marginInlineEnd:I.paddingXXS},"&-prefix":{marginInlineEnd:H},"&-suffix":{marginInlineStart:H}}}),m(I)),{[`${_e}${F}-password-icon`]:{color:ie,cursor:"pointer",transition:`all ${z}`,"&:hover":{color:re}}}),[`${F}-underlined`]:{borderRadius:0},[ce]:{[`${_e}${F}-password-icon`]:{color:ie,cursor:"not-allowed","&:hover":{color:ie}}}}},M=I=>{const{componentCls:F,borderRadiusLG:H,borderRadiusSM:W}=I;return{[`${F}-group`]:Object.assign(Object.assign(Object.assign({},(0,N.Wf)(I)),l(I)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${F}-group-addon`]:{borderRadius:H,fontSize:I.inputFontSizeLG}},"&-sm":{[`${F}-group-addon`]:{borderRadius:W}}},(0,U.ir)(I)),(0,U.S5)(I)),{[`&:not(${F}-compact-first-item):not(${F}-compact-last-item)${F}-compact-item`]:{[`${F}, ${F}-group-addon`]:{borderRadius:0}},[`&:not(${F}-compact-last-item)${F}-compact-first-item`]:{[`${F}, ${F}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${F}-compact-first-item)${F}-compact-last-item`]:{[`${F}, ${F}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${F}-compact-last-item)${F}-compact-item`]:{[`${F}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${F}-compact-first-item)${F}-compact-item`]:{[`${F}-affix-wrapper`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},k=I=>{const{componentCls:F,antCls:H}=I,W=`${F}-search`;return{[W]:{[F]:{"&:hover, &:focus":{[`+ ${F}-group-addon ${W}-button:not(${H}-btn-primary)`]:{borderInlineStartColor:I.colorPrimaryHover}}},[`${F}-affix-wrapper`]:{height:I.controlHeight,borderRadius:0},[`${F}-lg`]:{lineHeight:I.calc(I.lineHeightLG).sub(2e-4).equal()},[`> ${F}-group`]:{[`> ${F}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${W}-button`]:{marginInlineEnd:-1,borderStartStartRadius:0,borderEndStartRadius:0,boxShadow:"none"},[`${W}-button:not(${H}-btn-primary)`]:{color:I.colorTextDescription,"&:hover":{color:I.colorPrimaryHover},"&:active":{color:I.colorPrimaryActive},[`&${H}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${W}-button`]:{height:I.controlHeight,"&:hover, &:focus":{zIndex:1}},"&-large":{[`${F}-affix-wrapper, ${W}-button`]:{height:I.controlHeightLG}},"&-small":{[`${F}-affix-wrapper, ${W}-button`]:{height:I.controlHeightSM}},"&-rtl":{direction:"rtl"},[`&${F}-compact-item`]:{[`&:not(${F}-compact-last-item)`]:{[`${F}-group-addon`]:{[`${F}-search-button`]:{marginInlineEnd:I.calc(I.lineWidth).mul(-1).equal(),borderRadius:0}}},[`&:not(${F}-compact-first-item)`]:{[`${F},${F}-affix-wrapper`]:{borderRadius:0}},[`> ${F}-group-addon ${F}-search-button,
|
|
|
> ${F},
|
|
|
${F}-affix-wrapper`]:{"&:hover, &:focus, &:active":{zIndex:2}},[`> ${F}-affix-wrapper-focused`]:{zIndex:2}}}}},E=I=>{const{componentCls:F}=I;return{[`${F}-out-of-range`]:{[`&, & input, & textarea, ${F}-show-count-suffix, ${F}-data-count`]:{color:I.colorError}}}},T=(0,P.I$)(["Input","Shared"],I=>{const F=(0,A.mergeToken)(I,(0,d.e)(I));return[c(F),C(F)]},d.T,{resetFont:!1});ke.ZP=(0,P.I$)(["Input","Component"],I=>{const F=(0,A.mergeToken)(I,(0,d.e)(I));return[M(F),k(F),E(F),(0,K.c)(F)]},d.T,{resetFont:!1})},64910:function(Ot,ke,y){"use strict";y.d(ke,{T:function(){return K},e:function(){return N}});var R=y(51636);function N(P){return(0,R.mergeToken)(P,{inputAffixPadding:P.paddingXXS})}const K=P=>{const{controlHeight:A,fontSize:d,lineHeight:U,lineWidth:S,controlHeightSM:s,controlHeightLG:w,fontSizeLG:f,lineHeightLG:u,paddingSM:l,controlPaddingHorizontalSM:c,controlPaddingHorizontal:m,colorFillAlter:C,colorPrimaryHover:M,colorPrimary:k,controlOutlineWidth:E,controlOutline:T,colorErrorOutline:I,colorWarningOutline:F,colorBgContainer:H,inputFontSize:W,inputFontSizeLG:z,inputFontSizeSM:ie}=P,re=W||d,_e=ie||re,Ae=z||f,ce=Math.round((A-re*U)/2*10)/10-S,J=Math.round((s-_e*U)/2*10)/10-S,ae=Math.ceil((w-Ae*u)/2*10)/10-S;return{paddingBlock:Math.max(ce,0),paddingBlockSM:Math.max(J,0),paddingBlockLG:Math.max(ae,0),paddingInline:l-S,paddingInlineSM:c-S,paddingInlineLG:m-S,addonBg:C,activeBorderColor:k,hoverBorderColor:M,activeShadow:`0 0 0 ${E}px ${T}`,errorActiveShadow:`0 0 0 ${E}px ${I}`,warningActiveShadow:`0 0 0 ${E}px ${F}`,hoverBg:H,activeBg:H,inputFontSize:re,inputFontSizeLG:Ae,inputFontSizeSM:_e}}},39082:function(Ot,ke,y){"use strict";y.d(ke,{$U:function(){return A},H8:function(){return l},Mu:function(){return w},S5:function(){return m},Xy:function(){return P},ir:function(){return s},qG:function(){return U},vc:function(){return k}});var R=y(36237),N=y(51636);const K=E=>({borderColor:E.hoverBorderColor,backgroundColor:E.hoverBg}),P=E=>({color:E.colorTextDisabled,backgroundColor:E.colorBgContainerDisabled,borderColor:E.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":Object.assign({},K((0,N.mergeToken)(E,{hoverBorderColor:E.colorBorder,hoverBg:E.colorBgContainerDisabled})))}),A=(E,T)=>({background:E.colorBgContainer,borderWidth:E.lineWidth,borderStyle:E.lineType,borderColor:T.borderColor,"&:hover":{borderColor:T.hoverBorderColor,backgroundColor:E.hoverBg},"&:focus, &:focus-within":{borderColor:T.activeBorderColor,boxShadow:T.activeShadow,outline:0,backgroundColor:E.activeBg}}),d=(E,T)=>({[`&${E.componentCls}-status-${T.status}:not(${E.componentCls}-disabled)`]:Object.assign(Object.assign({},A(E,T)),{[`${E.componentCls}-prefix, ${E.componentCls}-suffix`]:{color:T.affixColor}}),[`&${E.componentCls}-status-${T.status}${E.componentCls}-disabled`]:{borderColor:T.borderColor}}),U=(E,T)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},A(E,{borderColor:E.colorBorder,hoverBorderColor:E.hoverBorderColor,activeBorderColor:E.activeBorderColor,activeShadow:E.activeShadow})),{[`&${E.componentCls}-disabled, &[disabled]`]:Object.assign({},P(E))}),d(E,{status:"error",borderColor:E.colorError,hoverBorderColor:E.colorErrorBorderHover,activeBorderColor:E.colorError,activeShadow:E.errorActiveShadow,affixColor:E.colorError})),d(E,{status:"warning",borderColor:E.colorWarning,hoverBorderColor:E.colorWarningBorderHover,activeBorderColor:E.colorWarning,activeShadow:E.warningActiveShadow,affixColor:E.colorWarning})),T)}),S=(E,T)=>({[`&${E.componentCls}-group-wrapper-status-${T.status}`]:{[`${E.componentCls}-group-addon`]:{borderColor:T.addonBorderColor,color:T.addonColor}}}),s=E=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${E.componentCls}-group`]:{"&-addon":{background:E.addonBg,border:`${(0,R.unit)(E.lineWidth)} ${E.lineType} ${E.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},S(E,{status:"error",addonBorderColor:E.colorError,addonColor:E.colorErrorText})),S(E,{status:"warning",addonBorderColor:E.colorWarning,addonColor:E.colorWarningText})),{[`&${E.componentCls}-group-wrapper-disabled`]:{[`${E.componentCls}-group-addon`]:Object.assign({},P(E))}})}),w=(E,T)=>{const{componentCls:I}=E;return{"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${I}-disabled, &[disabled]`]:{color:E.colorTextDisabled,cursor:"not-allowed"},[`&${I}-status-error`]:{"&, & input, & textarea":{color:E.colorError}},[`&${I}-status-warning`]:{"&, & input, & textarea":{color:E.colorWarning}}},T)}},f=(E,T)=>{var I;return{background:T.bg,borderWidth:E.lineWidth,borderStyle:E.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:(I=T==null?void 0:T.inputColor)!==null&&I!==void 0?I:"unset"},"&:hover":{background:T.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:T.activeBorderColor,backgroundColor:E.activeBg}}},u=(E,T)=>({[`&${E.componentCls}-status-${T.status}:not(${E.componentCls}-disabled)`]:Object.assign(Object.assign({},f(E,T)),{[`${E.componentCls}-prefix, ${E.componentCls}-suffix`]:{color:T.affixColor}})}),l=(E,T)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},f(E,{bg:E.colorFillTertiary,hoverBg:E.colorFillSecondary,activeBorderColor:E.activeBorderColor})),{[`&${E.componentCls}-disabled, &[disabled]`]:Object.assign({},P(E))}),u(E,{status:"error",bg:E.colorErrorBg,hoverBg:E.colorErrorBgHover,activeBorderColor:E.colorError,inputColor:E.colorErrorText,affixColor:E.colorError})),u(E,{status:"warning",bg:E.colorWarningBg,hoverBg:E.colorWarningBgHover,activeBorderColor:E.colorWarning,inputColor:E.colorWarningText,affixColor:E.colorWarning})),T)}),c=(E,T)=>({[`&${E.componentCls}-group-wrapper-status-${T.status}`]:{[`${E.componentCls}-group-addon`]:{background:T.addonBg,color:T.addonColor}}}),m=E=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${E.componentCls}-group`]:{"&-addon":{background:E.colorFillTertiary},[`${E.componentCls}-filled:not(:focus):not(:focus-within)`]:{"&:not(:first-child)":{borderInlineStart:`${(0,R.unit)(E.lineWidth)} ${E.lineType} ${E.colorSplit}`},"&:not(:last-child)":{borderInlineEnd:`${(0,R.unit)(E.lineWidth)} ${E.lineType} ${E.colorSplit}`}}}},c(E,{status:"error",addonBg:E.colorErrorBg,addonColor:E.colorErrorText})),c(E,{status:"warning",addonBg:E.colorWarningBg,addonColor:E.colorWarningText})),{[`&${E.componentCls}-group-wrapper-disabled`]:{[`${E.componentCls}-group`]:{"&-addon":{background:E.colorFillTertiary,color:E.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${(0,R.unit)(E.lineWidth)} ${E.lineType} ${E.colorBorder}`,borderTop:`${(0,R.unit)(E.lineWidth)} ${E.lineType} ${E.colorBorder}`,borderBottom:`${(0,R.unit)(E.lineWidth)} ${E.lineType} ${E.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${(0,R.unit)(E.lineWidth)} ${E.lineType} ${E.colorBorder}`,borderTop:`${(0,R.unit)(E.lineWidth)} ${E.lineType} ${E.colorBorder}`,borderBottom:`${(0,R.unit)(E.lineWidth)} ${E.lineType} ${E.colorBorder}`}}}})}),C=(E,T)=>({background:E.colorBgContainer,borderWidth:`${(0,R.unit)(E.lineWidth)} 0`,borderStyle:`${E.lineType} none`,borderColor:`transparent transparent ${T.borderColor} transparent`,borderRadius:0,"&:hover":{borderColor:`transparent transparent ${T.borderColor} transparent`,backgroundColor:E.hoverBg},"&:focus, &:focus-within":{borderColor:`transparent transparent ${T.borderColor} transparent`,outline:0,backgroundColor:E.activeBg}}),M=(E,T)=>({[`&${E.componentCls}-status-${T.status}:not(${E.componentCls}-disabled)`]:Object.assign(Object.assign({},C(E,T)),{[`${E.componentCls}-prefix, ${E.componentCls}-suffix`]:{color:T.affixColor}}),[`&${E.componentCls}-status-${T.status}${E.componentCls}-disabled`]:{borderColor:`transparent transparent ${T.borderColor} transparent`}}),k=(E,T)=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},C(E,{borderColor:E.colorBorder,hoverBorderColor:E.hoverBorderColor,activeBorderColor:E.activeBorderColor,activeShadow:E.activeShadow})),{[`&${E.componentCls}-disabled, &[disabled]`]:{color:E.colorTextDisabled,boxShadow:"none",cursor:"not-allowed","&:hover":{borderColor:`transparent transparent ${E.colorBorder} transparent`}},"input[disabled], textarea[disabled]":{cursor:"not-allowed"}}),M(E,{status:"error",borderColor:E.colorError,hoverBorderColor:E.colorErrorBorderHover,activeBorderColor:E.colorError,activeShadow:E.errorActiveShadow,affixColor:E.colorError})),M(E,{status:"warning",borderColor:E.colorWarning,hoverBorderColor:E.colorWarningBorderHover,activeBorderColor:E.colorWarning,activeShadow:E.warningActiveShadow,affixColor:E.colorWarning})),T)})},44104:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return C}});var R=y(59301),N=y(92310),K=y.n(N),P=y(11592),A=y(99402),d=y(48755),U=y(70045);const S=R.createContext({latestIndex:0}),s=S.Provider;var f=M=>{let{className:k,index:E,children:T,split:I,style:F}=M;const{latestIndex:H}=R.useContext(S);return T==null?null:R.createElement(R.Fragment,null,R.createElement("div",{className:k,style:F},T),E<H&&I&&R.createElement("span",{className:`${k}-split`},I))},u=y(31547),l=function(M,k){var E={};for(var T in M)Object.prototype.hasOwnProperty.call(M,T)&&k.indexOf(T)<0&&(E[T]=M[T]);if(M!=null&&typeof Object.getOwnPropertySymbols=="function")for(var I=0,T=Object.getOwnPropertySymbols(M);I<T.length;I++)k.indexOf(T[I])<0&&Object.prototype.propertyIsEnumerable.call(M,T[I])&&(E[T[I]]=M[T[I]]);return E};const m=R.forwardRef((M,k)=>{var E;const{getPrefixCls:T,direction:I,size:F,className:H,style:W,classNames:z,styles:ie}=(0,d.dj)("space"),{size:re=F!=null?F:"small",align:_e,className:Ae,rootClassName:ce,children:J,direction:ae="horizontal",prefixCls:G,split:X,style:Z,wrap:B=!1,classNames:O,styles:ne}=M,me=l(M,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[Oe,He]=Array.isArray(re)?re:[re,re],ut=(0,A.n)(He),Fe=(0,A.n)(Oe),it=(0,A.T)(He),st=(0,A.T)(Oe),et=(0,P.Z)(J,{keepEmpty:!0}),Nt=_e===void 0&&ae==="horizontal"?"center":_e,tt=T("space",G),[kt,Ne,ft]=(0,u.Z)(tt),Pe=K()(tt,H,Ne,`${tt}-${ae}`,{[`${tt}-rtl`]:I==="rtl",[`${tt}-align-${Nt}`]:Nt,[`${tt}-gap-row-${He}`]:ut,[`${tt}-gap-col-${Oe}`]:Fe},Ae,ce,ft),Te=K()(`${tt}-item`,(E=O==null?void 0:O.item)!==null&&E!==void 0?E:z.item);let Se=0;const ze=et.map((de,Le)=>{var We;de!=null&&(Se=Le);const Ge=(de==null?void 0:de.key)||`${Te}-${Le}`;return R.createElement(f,{className:Te,key:Ge,index:Le,split:X,style:(We=ne==null?void 0:ne.item)!==null&&We!==void 0?We:ie.item},de)}),Je=R.useMemo(()=>({latestIndex:Se}),[Se]);if(et.length===0)return null;const rt={};return B&&(rt.flexWrap="wrap"),!Fe&&st&&(rt.columnGap=Oe),!ut&&it&&(rt.rowGap=He),kt(R.createElement("div",Object.assign({ref:k,className:Pe,style:Object.assign(Object.assign(Object.assign({},rt),W),Z)},me),R.createElement(s,{value:Je},ze)))});m.Compact=U.ZP;var C=m},37645:function(Ot,ke,y){"use strict";y.d(ke,{ZP:function(){return d},qN:function(){return K},wZ:function(){return P}});var R=y(36237),N=y(36305);const K=8;function P(U){const{contentRadius:S,limitVerticalRadius:s}=U,w=S>12?S+2:12;return{arrowOffsetHorizontal:w,arrowOffsetVertical:s?K:w}}function A(U,S){return U?S:{}}function d(U,S,s){const{componentCls:w,boxShadowPopoverArrow:f,arrowOffsetVertical:u,arrowOffsetHorizontal:l}=U,{arrowDistance:c=0,arrowPlacement:m={left:!0,right:!0,top:!0,bottom:!0}}=s||{};return{[w]:Object.assign(Object.assign(Object.assign(Object.assign({[`${w}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,N.W)(U,S,f)),{"&:before":{background:S}})]},A(!!m.top,{[[`&-placement-top > ${w}-arrow`,`&-placement-topLeft > ${w}-arrow`,`&-placement-topRight > ${w}-arrow`].join(",")]:{bottom:c,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${w}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":l,[`> ${w}-arrow`]:{left:{_skip_check_:!0,value:l}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${(0,R.unit)(l)})`,[`> ${w}-arrow`]:{right:{_skip_check_:!0,value:l}}}})),A(!!m.bottom,{[[`&-placement-bottom > ${w}-arrow`,`&-placement-bottomLeft > ${w}-arrow`,`&-placement-bottomRight > ${w}-arrow`].join(",")]:{top:c,transform:"translateY(-100%)"},[`&-placement-bottom > ${w}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":l,[`> ${w}-arrow`]:{left:{_skip_check_:!0,value:l}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${(0,R.unit)(l)})`,[`> ${w}-arrow`]:{right:{_skip_check_:!0,value:l}}}})),A(!!m.left,{[[`&-placement-left > ${w}-arrow`,`&-placement-leftTop > ${w}-arrow`,`&-placement-leftBottom > ${w}-arrow`].join(",")]:{right:{_skip_check_:!0,value:c},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${w}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${w}-arrow`]:{top:u},[`&-placement-leftBottom > ${w}-arrow`]:{bottom:u}})),A(!!m.right,{[[`&-placement-right > ${w}-arrow`,`&-placement-rightTop > ${w}-arrow`,`&-placement-rightBottom > ${w}-arrow`].join(",")]:{left:{_skip_check_:!0,value:c},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${w}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${w}-arrow`]:{top:u},[`&-placement-rightBottom > ${w}-arrow`]:{bottom:u}}))}}},36305:function(Ot,ke,y){"use strict";y.d(ke,{W:function(){return K},w:function(){return N}});var R=y(36237);function N(P){const{sizePopupArrow:A,borderRadiusXS:d,borderRadiusOuter:U}=P,S=A/2,s=0,w=S,f=U*1/Math.sqrt(2),u=S-U*(1-1/Math.sqrt(2)),l=S-d*(1/Math.sqrt(2)),c=U*(Math.sqrt(2)-1)+d*(1/Math.sqrt(2)),m=2*S-l,C=c,M=2*S-f,k=u,E=2*S-s,T=w,I=S*Math.sqrt(2)+U*(Math.sqrt(2)-2),F=U*(Math.sqrt(2)-1),H=`polygon(${F}px 100%, 50% ${F}px, ${2*S-F}px 100%, ${F}px 100%)`,W=`path('M ${s} ${w} A ${U} ${U} 0 0 0 ${f} ${u} L ${l} ${c} A ${d} ${d} 0 0 1 ${m} ${C} L ${M} ${k} A ${U} ${U} 0 0 0 ${E} ${T} Z')`;return{arrowShadowWidth:I,arrowPath:W,arrowPolygon:H}}const K=(P,A,d)=>{const{sizePopupArrow:U,arrowPolygon:S,arrowPath:s,arrowShadowWidth:w,borderRadiusXS:f,calc:u}=P;return{pointerEvents:"none",width:U,height:U,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:U,height:u(U).div(2).equal(),background:A,clipPath:{_multi_value_:!0,value:[S,s]},content:'""'},"&::after":{content:'""',position:"absolute",width:w,height:w,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${(0,R.unit)(f)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:d,zIndex:0,background:"transparent"}}}},93427:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return N}});var R=y(34998);function N(K,P){return R.i.reduce((A,d)=>{const U=K[`${d}1`],S=K[`${d}3`],s=K[`${d}6`],w=K[`${d}7`];return Object.assign(Object.assign({},A),P(d,{lightColor:U,lightBorderColor:S,darkColor:s,textColor:w}))},{})}},25399:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return G}});var R=y(59301),N=y(92310),K=y.n(N),P=y(29125),A=y(18929),d=y(62487),U=y(75030),S=y(86641),s=y(52838),w=y(22703),f=y(32383),u=y(55743),l=y(57700),c=y(48755),m=y(36237),C=y(63356),M=y(34925),k=y(37645),E=y(36305),T=y(93427),I=y(51636),F=y(16931);const H=X=>{const{calc:Z,componentCls:B,tooltipMaxWidth:O,tooltipColor:ne,tooltipBg:me,tooltipBorderRadius:Oe,zIndexPopup:He,controlHeight:ut,boxShadowSecondary:Fe,paddingSM:it,paddingXS:st,arrowOffsetHorizontal:et,sizePopupArrow:Nt}=X,tt=Z(Oe).add(Nt).add(et).equal(),kt=Z(Oe).mul(2).add(Nt).equal();return[{[B]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,C.Wf)(X)),{position:"absolute",zIndex:He,display:"block",width:"max-content",maxWidth:O,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":me,[`${B}-inner`]:{minWidth:kt,minHeight:ut,padding:`${(0,m.unit)(X.calc(it).div(2).equal())} ${(0,m.unit)(st)}`,color:ne,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:me,borderRadius:Oe,boxShadow:Fe,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:tt},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${B}-inner`]:{borderRadius:X.min(Oe,k.qN)}},[`${B}-content`]:{position:"relative"}}),(0,T.Z)(X,(Ne,ft)=>{let{darkColor:Pe}=ft;return{[`&${B}-${Ne}`]:{[`${B}-inner`]:{backgroundColor:Pe},[`${B}-arrow`]:{"--antd-arrow-background-color":Pe}}}})),{"&-rtl":{direction:"rtl"}})},(0,k.ZP)(X,"var(--antd-arrow-background-color)"),{[`${B}-pure`]:{position:"relative",maxWidth:"none",margin:X.sizePopupArrow}}]},W=X=>Object.assign(Object.assign({zIndexPopup:X.zIndexPopupBase+70},(0,k.wZ)({contentRadius:X.borderRadius,limitVerticalRadius:!0})),(0,E.w)((0,I.mergeToken)(X,{borderRadiusOuter:Math.min(X.borderRadiusOuter,4)})));var z=function(X){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return(0,F.I$)("Tooltip",O=>{const{borderRadius:ne,colorTextLightSolid:me,colorBgSpotlight:Oe}=O,He=(0,I.mergeToken)(O,{tooltipMaxWidth:250,tooltipColor:me,tooltipBorderRadius:ne,tooltipBg:Oe});return[H(He),(0,M._y)(O,"zoom-big-fast")]},W,{resetStyle:!1,injectStyle:Z})(X)},ie=y(29509);function re(X,Z){const B=(0,ie.o2)(Z),O=K()({[`${X}-${Z}`]:Z&&B}),ne={},me={};return Z&&!B&&(ne.background=Z,me["--antd-arrow-background-color"]=Z),{className:O,overlayStyle:ne,arrowStyle:me}}var Ae=X=>{const{prefixCls:Z,className:B,placement:O="top",title:ne,color:me,overlayInnerStyle:Oe}=X,{getPrefixCls:He}=R.useContext(c.E_),ut=He("tooltip",Z),[Fe,it,st]=z(ut),et=re(ut,me),Nt=et.arrowStyle,tt=Object.assign(Object.assign({},Oe),et.overlayStyle),kt=K()(it,st,ut,`${ut}-pure`,`${ut}-placement-${O}`,B,et.className);return Fe(R.createElement("div",{className:kt,style:Nt},R.createElement("div",{className:`${ut}-arrow`}),R.createElement(P.G,Object.assign({},X,{className:it,prefixCls:ut,overlayInnerStyle:tt}),ne)))},ce=function(X,Z){var B={};for(var O in X)Object.prototype.hasOwnProperty.call(X,O)&&Z.indexOf(O)<0&&(B[O]=X[O]);if(X!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ne=0,O=Object.getOwnPropertySymbols(X);ne<O.length;ne++)Z.indexOf(O[ne])<0&&Object.prototype.propertyIsEnumerable.call(X,O[ne])&&(B[O[ne]]=X[O[ne]]);return B};const ae=R.forwardRef((X,Z)=>{var B,O;const{prefixCls:ne,openClassName:me,getTooltipContainer:Oe,color:He,overlayInnerStyle:ut,children:Fe,afterOpenChange:it,afterVisibleChange:st,destroyTooltipOnHide:et,arrow:Nt=!0,title:tt,overlay:kt,builtinPlacements:Ne,arrowPointAtCenter:ft=!1,autoAdjustOverflow:Pe=!0,motion:Te,getPopupContainer:Se,placement:ze="top",mouseEnterDelay:Je=.1,mouseLeaveDelay:rt=.1,overlayStyle:de,rootClassName:Le,overlayClassName:We,styles:Ge,classNames:Xe}=X,gt=ce(X,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),Ct=!!Nt,[,ht]=(0,l.ZP)(),{getPopupContainer:dt,getPrefixCls:vt,direction:Pt,className:Tt,style:xt,classNames:Ke,styles:St}=(0,c.dj)("tooltip"),_t=(0,f.ln)("Tooltip"),lt=R.useRef(null),At=()=>{var pr;(pr=lt.current)===null||pr===void 0||pr.forceAlign()};R.useImperativeHandle(Z,()=>{var pr,gr;return{forceAlign:At,forcePopupAlign:()=>{_t.deprecated(!1,"forcePopupAlign","forceAlign"),At()},nativeElement:(pr=lt.current)===null||pr===void 0?void 0:pr.nativeElement,popupElement:(gr=lt.current)===null||gr===void 0?void 0:gr.popupElement}});const[$,q]=(0,A.Z)(!1,{value:(B=X.open)!==null&&B!==void 0?B:X.visible,defaultValue:(O=X.defaultOpen)!==null&&O!==void 0?O:X.defaultVisible}),Be=!tt&&!kt&&tt!==0,oe=pr=>{var gr,Mt;q(Be?!1:pr),Be||((gr=X.onOpenChange)===null||gr===void 0||gr.call(X,pr),(Mt=X.onVisibleChange)===null||Mt===void 0||Mt.call(X,pr))},ge=R.useMemo(()=>{var pr,gr;let Mt=ft;return typeof Nt=="object"&&(Mt=(gr=(pr=Nt.pointAtCenter)!==null&&pr!==void 0?pr:Nt.arrowPointAtCenter)!==null&&gr!==void 0?gr:ft),Ne||(0,s.Z)({arrowPointAtCenter:Mt,autoAdjustOverflow:Pe,arrowWidth:Ct?ht.sizePopupArrow:0,borderRadius:ht.borderRadius,offset:ht.marginXXS,visibleFirst:!0})},[ft,Nt,Ne,ht]),Lt=R.useMemo(()=>tt===0?tt:kt||tt||"",[kt,tt]),Re=R.createElement(d.Z,{space:!0},typeof Lt=="function"?Lt():Lt),Me=vt("tooltip",ne),$e=vt(),he=X["data-popover-inject"];let fe=$;!("open"in X)&&!("visible"in X)&&Be&&(fe=!1);const Ee=R.isValidElement(Fe)&&!(0,w.M2)(Fe)?Fe:R.createElement("span",null,Fe),Ie=Ee.props,se=!Ie.className||typeof Ie.className=="string"?K()(Ie.className,me||`${Me}-open`):Ie.className,[ot,ve,Rt]=z(Me,!he),Bt=re(Me,He),zt=Bt.arrowStyle,Cr=K()(We,{[`${Me}-rtl`]:Pt==="rtl"},Bt.className,Le,ve,Rt,Tt,Ke.root,Xe==null?void 0:Xe.root),ar=K()(Ke.body,Xe==null?void 0:Xe.body),[qt,Dr]=(0,U.Cn)("Tooltip",gt.zIndex),Hr=R.createElement(P.Z,Object.assign({},gt,{zIndex:qt,showArrow:Ct,placement:ze,mouseEnterDelay:Je,mouseLeaveDelay:rt,prefixCls:Me,classNames:{root:Cr,body:ar},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},zt),St.root),xt),de),Ge==null?void 0:Ge.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},St.body),ut),Ge==null?void 0:Ge.body),Bt.overlayStyle)},getTooltipContainer:Se||Oe||dt,ref:lt,builtinPlacements:ge,overlay:Re,visible:fe,onVisibleChange:oe,afterVisibleChange:it!=null?it:st,arrowContent:R.createElement("span",{className:`${Me}-arrow-content`}),motion:{motionName:(0,S.m)($e,"zoom-big-fast",X.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!et}),fe?(0,w.Tm)(Ee,{className:se}):Ee);return ot(R.createElement(u.Z.Provider,{value:Dr},Hr))});ae._InternalPanelDoNotUseOrYouWillBeFired=Ae;var G=ae},64018:function(){var Ot,ke,y,R=!1,N,K;window.PR_SHOULD_USE_CONTINUATION=!0;var P,A;(function(){var d=window,U=["break,continue,do,else,for,if,return,while"],S=[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"],s=[S,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],w=[s,"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=[s,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[s,"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",c=[s,"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",C=[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"],M=[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"],E=[w,u,f,c,m,C,M,k],T=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,I="str",F="kwd",H="com",W="typ",z="lit",ie="pun",re="pln",_e="tag",Ae="dec",ce="src",J="atn",ae="atv",G="nocode",X="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function Z(Te){for(var Se=0,ze=!1,Je=!1,rt=0,de=Te.length;rt<de;++rt){var Le=Te[rt];if(Le.ignoreCase)Je=!0;else if(/[a-z]/i.test(Le.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ze=!0,Je=!1;break}}var We={b:8,t:9,n:10,v:11,f:12,r:13};function Ge(dt){var vt=dt.charCodeAt(0);if(vt!==92)return vt;var Pt=dt.charAt(1);return vt=We[Pt],vt||("0"<=Pt&&Pt<="7"?parseInt(dt.substring(1),8):Pt==="u"||Pt==="x"?parseInt(dt.substring(2),16):dt.charCodeAt(1))}function Xe(dt){if(dt<32)return(dt<16?"\\x0":"\\x")+dt.toString(16);var vt=String.fromCharCode(dt);return vt==="\\"||vt==="-"||vt==="]"||vt==="^"?"\\"+vt:vt}function gt(dt){var vt=dt.substring(1,dt.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")),Pt=[],Tt=vt[0]==="^",xt=["["];Tt&&xt.push("^");for(var Ke=Tt?1:0,St=vt.length;Ke<St;++Ke){var _t=vt[Ke];if(/\\[bdsw]/i.test(_t))xt.push(_t);else{var lt=Ge(_t),At;Ke+2<St&&vt[Ke+1]==="-"?(At=Ge(vt[Ke+2]),Ke+=2):At=lt,Pt.push([lt,At]),At<65||lt>122||(At<65||lt>90||Pt.push([Math.max(65,lt)|32,Math.min(At,90)|32]),At<97||lt>122||Pt.push([Math.max(97,lt)&-33,Math.min(At,122)&-33]))}}Pt.sort(function(oe,ge){return oe[0]-ge[0]||ge[1]-oe[1]});for(var $=[],q=[],Ke=0;Ke<Pt.length;++Ke){var Be=Pt[Ke];Be[0]<=q[1]+1?q[1]=Math.max(q[1],Be[1]):$.push(q=Be)}for(var Ke=0;Ke<$.length;++Ke){var Be=$[Ke];xt.push(Xe(Be[0])),Be[1]>Be[0]&&(Be[1]+1>Be[0]&&xt.push("-"),xt.push(Xe(Be[1])))}return xt.push("]"),xt.join("")}function Ct(dt){for(var vt=dt.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")),Pt=vt.length,Tt=[],xt=0,Ke=0;xt<Pt;++xt){var St=vt[xt];if(St==="(")++Ke;else if(St.charAt(0)==="\\"){var _t=+St.substring(1);_t&&(_t<=Ke?Tt[_t]=-1:vt[xt]=Xe(_t))}}for(var xt=1;xt<Tt.length;++xt)Tt[xt]===-1&&(Tt[xt]=++Se);for(var xt=0,Ke=0;xt<Pt;++xt){var St=vt[xt];if(St==="(")++Ke,Tt[Ke]||(vt[xt]="(?:");else if(St.charAt(0)==="\\"){var _t=+St.substring(1);_t&&_t<=Ke&&(vt[xt]="\\"+Tt[_t])}}for(var xt=0;xt<Pt;++xt)vt[xt]==="^"&&vt[xt+1]!=="^"&&(vt[xt]="");if(dt.ignoreCase&&ze)for(var xt=0;xt<Pt;++xt){var St=vt[xt],lt=St.charAt(0);St.length>=2&<==="["?vt[xt]=gt(St):lt!=="\\"&&(vt[xt]=St.replace(/[a-zA-Z]/g,function(q){var Be=q.charCodeAt(0);return"["+String.fromCharCode(Be&-33,Be|32)+"]"}))}return vt.join("")}for(var ht=[],rt=0,de=Te.length;rt<de;++rt){var Le=Te[rt];if(Le.global||Le.multiline)throw new Error(""+Le);ht.push("(?:"+Ct(Le)+")")}return new RegExp(ht.join("|"),Je?"gi":"g")}function B(Te,Se){var ze=/(?:^|\s)nocode(?:\s|$)/,Je=[],rt=0,de=[],Le=0;function We(Ge){var Xe=Ge.nodeType;if(Xe==1){if(ze.test(Ge.className))return;for(var gt=Ge.firstChild;gt;gt=gt.nextSibling)We(gt);var Ct=Ge.nodeName.toLowerCase();(Ct==="br"||Ct==="li")&&(Je[Le]=`
|
|
|
`,de[Le<<1]=rt++,de[Le++<<1|1]=Ge)}else if(Xe==3||Xe==4){var ht=Ge.nodeValue;ht.length&&(Se?ht=ht.replace(/\r\n?/g,`
|
|
|
`):ht=ht.replace(/[ \t\r\n]+/g," "),Je[Le]=ht,de[Le<<1]=rt,rt+=ht.length,de[Le++<<1|1]=Ge)}}return We(Te),{sourceCode:Je.join("").replace(/\n$/,""),spans:de}}function O(Te,Se,ze,Je,rt){if(ze){var de={sourceNode:Te,pre:1,langExtension:null,numberLines:null,sourceCode:ze,spans:null,basePos:Se,decorations:null};Je(de),rt.push.apply(rt,de.decorations)}}var ne=/\S/;function me(Te){for(var Se=void 0,ze=Te.firstChild;ze;ze=ze.nextSibling){var Je=ze.nodeType;Se=Je===1?Se?Te:ze:Je===3&&ne.test(ze.nodeValue)?Te:Se}return Se===Te?void 0:Se}function Oe(Te,Se){var ze={},Je;(function(){for(var Le=Te.concat(Se),We=[],Ge={},Xe=0,gt=Le.length;Xe<gt;++Xe){var Ct=Le[Xe],ht=Ct[3];if(ht)for(var dt=ht.length;--dt>=0;)ze[ht.charAt(dt)]=Ct;var vt=Ct[1],Pt=""+vt;Ge.hasOwnProperty(Pt)||(We.push(vt),Ge[Pt]=null)}We.push(/[\0-\uffff]/),Je=Z(We)})();var rt=Se.length,de=function(Le){for(var We=Le.sourceCode,Ge=Le.basePos,Xe=Le.sourceNode,gt=[Ge,re],Ct=0,ht=We.match(Je)||[],dt={},vt=0,Pt=ht.length;vt<Pt;++vt){var Tt=ht[vt],xt=dt[Tt],Ke=void 0,St;if(typeof xt=="string")St=!1;else{var _t=ze[Tt.charAt(0)];if(_t)Ke=Tt.match(_t[1]),xt=_t[0];else{for(var lt=0;lt<rt;++lt)if(_t=Se[lt],Ke=Tt.match(_t[1]),Ke){xt=_t[0];break}Ke||(xt=re)}St=xt.length>=5&&xt.substring(0,5)==="lang-",St&&!(Ke&&typeof Ke[1]=="string")&&(St=!1,xt=ce),St||(dt[Tt]=xt)}var At=Ct;if(Ct+=Tt.length,!St)gt.push(Ge+At,xt);else{var $=Ke[1],q=Tt.indexOf($),Be=q+$.length;Ke[2]&&(Be=Tt.length-Ke[2].length,q=Be-$.length);var oe=xt.substring(5);O(Xe,Ge+At,Tt.substring(0,q),de,gt),O(Xe,Ge+At+q,$,Nt(oe,$),gt),O(Xe,Ge+At+Be,Tt.substring(Be),de,gt)}}Le.decorations=gt};return de}function He(Te){var Se=[],ze=[];Te.tripleQuotedStrings?Se.push([I,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Te.multiLineStrings?Se.push([I,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Se.push([I,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Te.verbatimStrings&&ze.push([I,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Je=Te.hashComments;Je&&(Te.cStyleComments?(Je>1?Se.push([H,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Se.push([H,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ze.push([I,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Se.push([H,/^#[^\r\n]*/,null,"#"])),Te.cStyleComments&&(ze.push([H,/^\/\/[^\r\n]*/,null]),ze.push([H,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var rt=Te.regexLiterals;if(rt){var de=rt>1?"":`
|
|
|
\r`,Le=de?".":"[\\S\\s]",We="/(?=[^/*"+de+"])(?:[^/\\x5B\\x5C"+de+"]|\\x5C"+Le+"|\\x5B(?:[^\\x5C\\x5D"+de+"]|\\x5C"+Le+")*(?:\\x5D|$))+/";ze.push(["lang-regex",RegExp("^"+X+"("+We+")")])}var Ge=Te.types;Ge&&ze.push([W,Ge]);var Xe=(""+Te.keywords).replace(/^ | $/g,"");Xe.length&&ze.push([F,new RegExp("^(?:"+Xe.replace(/[\s,]+/g,"|")+")\\b"),null]),Se.push([re,/^\s+/,null,` \r
|
|
|
\xA0`]);var gt="^.[^\\s\\w.$@'\"`/\\\\]*";return Te.regexLiterals&&(gt+="(?!s*/)"),ze.push([z,/^@[a-z_$][a-z_$@0-9]*/i,null],[W,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[re,/^[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"],[re,/^\\[\s\S]?/,null],[ie,new RegExp(gt),null]),Oe(Se,ze)}var ut=He({keywords:E,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Fe(Te,Se,ze){for(var Je=/(?:^|\s)nocode(?:\s|$)/,rt=/\r\n?|\n/,de=Te.ownerDocument,Le=de.createElement("li");Te.firstChild;)Le.appendChild(Te.firstChild);var We=[Le];function Ge(vt){var Pt=vt.nodeType;if(Pt==1&&!Je.test(vt.className))if(vt.nodeName==="br")Xe(vt),vt.parentNode&&vt.parentNode.removeChild(vt);else for(var Tt=vt.firstChild;Tt;Tt=Tt.nextSibling)Ge(Tt);else if((Pt==3||Pt==4)&&ze){var xt=vt.nodeValue,Ke=xt.match(rt);if(Ke){var St=xt.substring(0,Ke.index);vt.nodeValue=St;var _t=xt.substring(Ke.index+Ke[0].length);if(_t){var lt=vt.parentNode;lt.insertBefore(de.createTextNode(_t),vt.nextSibling)}Xe(vt),St||vt.parentNode.removeChild(vt)}}}function Xe(vt){for(;!vt.nextSibling;)if(vt=vt.parentNode,!vt)return;function Pt(Ke,St){var _t=St?Ke.cloneNode(!1):Ke,lt=Ke.parentNode;if(lt){var At=Pt(lt,1),$=Ke.nextSibling;At.appendChild(_t);for(var q=$;q;q=$)$=q.nextSibling,At.appendChild(q)}return _t}for(var Tt=Pt(vt.nextSibling,0),xt;(xt=Tt.parentNode)&&xt.nodeType===1;)Tt=xt;We.push(Tt)}for(var gt=0;gt<We.length;++gt)Ge(We[gt]);Se===(Se|0)&&We[0].setAttribute("value",Se);var Ct=de.createElement("ol");Ct.className="linenums";for(var ht=Math.max(0,Se-1|0)||0,gt=0,dt=We.length;gt<dt;++gt)Le=We[gt],Le.className="L"+(gt+ht)%10,Le.firstChild||Le.appendChild(de.createTextNode("\xA0")),Ct.appendChild(Le);Te.appendChild(Ct)}function it(Te){var Se=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Se=Se&&+Se[1]<=8;var ze=/\n/g,Je=Te.sourceCode,rt=Je.length,de=0,Le=Te.spans,We=Le.length,Ge=0,Xe=Te.decorations,gt=Xe.length,Ct=0;Xe[gt]=rt;var ht,dt;for(dt=ht=0;dt<gt;)Xe[dt]!==Xe[dt+2]?(Xe[ht++]=Xe[dt++],Xe[ht++]=Xe[dt++]):dt+=2;for(gt=ht,dt=ht=0;dt<gt;){for(var vt=Xe[dt],Pt=Xe[dt+1],Tt=dt+2;Tt+2<=gt&&Xe[Tt+1]===Pt;)Tt+=2;Xe[ht++]=vt,Xe[ht++]=Pt,dt=Tt}gt=Xe.length=ht;var xt=Te.sourceNode,Ke="";xt&&(Ke=xt.style.display,xt.style.display="none");try{for(var St=null;Ge<We;){var _t=Le[Ge],lt=Le[Ge+2]||rt,At=Xe[Ct+2]||rt,Tt=Math.min(lt,At),$=Le[Ge+1],q;if($.nodeType!==1&&(q=Je.substring(de,Tt))){Se&&(q=q.replace(ze,"\r")),$.nodeValue=q;var Be=$.ownerDocument,oe=Be.createElement("span");oe.className=Xe[Ct+1];var ge=$.parentNode;ge.replaceChild(oe,$),oe.appendChild($),de<lt&&(Le[Ge+1]=$=Be.createTextNode(Je.substring(Tt,lt)),ge.insertBefore($,oe.nextSibling))}de=Tt,de>=lt&&(Ge+=2),de>=At&&(Ct+=2)}}finally{xt&&(xt.style.display=Ke)}}var st={};function et(Te,Se){for(var ze=Se.length;--ze>=0;){var Je=Se[ze];st.hasOwnProperty(Je)?d.console&&console.warn("cannot override language handler %s",Je):st[Je]=Te}}function Nt(Te,Se){return Te&&st.hasOwnProperty(Te)||(Te=/^\s*</.test(Se)?"default-markup":"default-code"),st[Te]}et(ut,["default-code"]),et(Oe([],[[re,/^[^<?]+/],[Ae,/^<!\w[^>]*(?:>|$)/],[H,/^<\!--[\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"]),et(Oe([[re,/^[\s]+/,null,` \r
|
|
|
`],[ae,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[_e,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[J,/^(?!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"]),et(Oe([],[[ae,/^[\s\S]+/]]),["uq.val"]),et(He({keywords:w,hashComments:!0,cStyleComments:!0,types:T}),["c","cc","cpp","cxx","cyc","m"]),et(He({keywords:"null,true,false"}),["json"]),et(He({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:T}),["cs"]),et(He({keywords:f,cStyleComments:!0}),["java"]),et(He({keywords:k,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),et(He({keywords:C,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),et(He({keywords:m,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),et(He({keywords:M,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),et(He({keywords:c,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),et(He({keywords:l,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),et(Oe([],[[I,/^[\s\S]+/]]),["regex"]);function tt(Te){var Se=Te.langExtension;try{var ze=B(Te.sourceNode,Te.pre),Je=ze.sourceCode;Te.sourceCode=Je,Te.spans=ze.spans,Te.basePos=0,Nt(Se,Je)(Te),it(Te)}catch(rt){d.console&&console.log(rt&&rt.stack||rt)}}function kt(Te,Se,ze){var Je=ze||!1,rt=Se||null,de=document.createElement("div");de.innerHTML="<pre>"+Te+"</pre>",de=de.firstChild,Je&&Fe(de,Je,!0);var Le={langExtension:rt,numberLines:Je,sourceNode:de,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return tt(Le),de.innerHTML}function Ne(Te,Se){var ze=Se||document.body,Je=ze.ownerDocument||document;function rt(_t){return ze.getElementsByTagName(_t)}for(var de=[rt("pre"),rt("code"),rt("xmp")],Le=[],We=0;We<de.length;++We)for(var Ge=0,Xe=de[We].length;Ge<Xe;++Ge)Le.push(de[We][Ge]);de=null;var gt=Date;gt.now||(gt={now:function(){return+new Date}});var Ct=0,ht=/\blang(?:uage)?-([\w.]+)(?!\S)/,dt=/\bprettyprint\b/,vt=/\bprettyprinted\b/,Pt=/pre|xmp/i,Tt=/^code$/i,xt=/^(?:pre|code|xmp)$/i,Ke={};function St(){for(var _t=d.PR_SHOULD_USE_CONTINUATION?gt.now()+250:1/0;Ct<Le.length&>.now()<_t;Ct++){for(var lt=Le[Ct],At=Ke,$=lt;$=$.previousSibling;){var q=$.nodeType,Be=(q===7||q===8)&&$.nodeValue;if(Be?!/^\??prettify\b/.test(Be):q!==3||/\S/.test($.nodeValue))break;if(Be){At={},Be.replace(/\b(\w+)=([\w:.%+-]+)/g,function(ve,Rt,Bt){At[Rt]=Bt});break}}var oe=lt.className;if((At!==Ke||dt.test(oe))&&!vt.test(oe)){for(var ge=!1,Lt=lt.parentNode;Lt;Lt=Lt.parentNode){var Re=Lt.tagName;if(xt.test(Re)&&Lt.className&&dt.test(Lt.className)){ge=!0;break}}if(!ge){lt.className+=" prettyprinted";var Me=At.lang;if(!Me){Me=oe.match(ht);var $e;!Me&&($e=me(lt))&&Tt.test($e.tagName)&&(Me=$e.className.match(ht)),Me&&(Me=Me[1])}var he;if(Pt.test(lt.tagName))he=1;else{var fe=lt.currentStyle,Ee=Je.defaultView,Ie=fe?fe.whiteSpace:Ee&&Ee.getComputedStyle?Ee.getComputedStyle(lt,null).getPropertyValue("white-space"):0;he=Ie&&Ie.substring(0,3)==="pre"}var se=At.linenums;(se=se==="true"||+se)||(se=oe.match(/\blinenums\b(?::(\d+))?/),se=se?se[1]&&se[1].length?+se[1]:!0:!1),se&&Fe(lt,se,he);var ot={langExtension:Me,sourceNode:lt,numberLines:se,pre:he,sourceCode:null,basePos:null,spans:null,decorations:null};tt(ot)}}}Ct<Le.length?d.setTimeout(St,250):typeof Te=="function"&&Te()}St()}var ft=d.PR={createSimpleLexer:Oe,registerLangHandler:et,sourceDecorator:He,PR_ATTRIB_NAME:J,PR_ATTRIB_VALUE:ae,PR_COMMENT:H,PR_DECLARATION:Ae,PR_KEYWORD:F,PR_LITERAL:z,PR_NOCODE:G,PR_PLAIN:re,PR_PUNCTUATION:ie,PR_SOURCE:ce,PR_STRING:I,PR_TAG:_e,PR_TYPE:W,prettyPrintOne:R?d.prettyPrintOne=kt:P=kt,prettyPrint:A=R?d.prettyPrint=Ne:A=Ne},Pe=d.define;typeof Pe=="function"&&Pe.amd&&Pe("google-code-prettify",[],function(){return ft})})()},25769:function(Ot,ke,y){"use strict";var R=y(98040),N={"text/plain":"Text","text/html":"Url",default:"Text"},K="Copy to clipboard: #{key}, Enter";function P(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 S,s,w,f,u,l,c=!1;U||(U={}),S=U.debug||!1;try{w=R(),f=document.createRange(),u=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(C){if(C.stopPropagation(),U.format)if(C.preventDefault(),typeof C.clipboardData=="undefined"){S&&console.warn("unable to use e.clipboardData"),S&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var M=N[U.format]||N.default;window.clipboardData.setData(M,d)}else C.clipboardData.clearData(),C.clipboardData.setData(U.format,d);U.onCopy&&(C.preventDefault(),U.onCopy(C.clipboardData))}),document.body.appendChild(l),f.selectNodeContents(l),u.addRange(f);var m=document.execCommand("copy");if(!m)throw new Error("copy command was unsuccessful");c=!0}catch(C){S&&console.error("unable to copy using execCommand: ",C),S&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(U.format||"text",d),U.onCopy&&U.onCopy(window.clipboardData),c=!0}catch(M){S&&console.error("unable to copy using clipboardData: ",M),S&&console.error("falling back to prompt"),s=P("message"in U?U.message:K),window.prompt(s,d)}}finally{u&&(typeof u.removeRange=="function"?u.removeRange(f):u.removeAllRanges()),l&&document.body.removeChild(l),w()}return c}Ot.exports=A},24334:function(Ot,ke,y){var R,N;(function(K,P){Ot.exports=P(K)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof y.g!="undefined"?y.g:this,function(K){"use strict";K=K||{};var P=K.Base64,A="2.6.4",d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",U=function(J){for(var ae={},G=0,X=J.length;G<X;G++)ae[J.charAt(G)]=G;return ae}(d),S=String.fromCharCode,s=function(J){if(J.length<2){var ae=J.charCodeAt(0);return ae<128?J:ae<2048?S(192|ae>>>6)+S(128|ae&63):S(224|ae>>>12&15)+S(128|ae>>>6&63)+S(128|ae&63)}else{var ae=65536+(J.charCodeAt(0)-55296)*1024+(J.charCodeAt(1)-56320);return S(240|ae>>>18&7)+S(128|ae>>>12&63)+S(128|ae>>>6&63)+S(128|ae&63)}},w=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,f=function(J){return J.replace(w,s)},u=function(J){var ae=[0,2,1][J.length%3],G=J.charCodeAt(0)<<16|(J.length>1?J.charCodeAt(1):0)<<8|(J.length>2?J.charCodeAt(2):0),X=[d.charAt(G>>>18),d.charAt(G>>>12&63),ae>=2?"=":d.charAt(G>>>6&63),ae>=1?"=":d.charAt(G&63)];return X.join("")},l=K.btoa&&typeof K.btoa=="function"?function(J){return K.btoa(J)}:function(J){if(J.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return J.replace(/[\s\S]{1,3}/g,u)},c=function(J){return l(f(String(J)))},m=function(J){return J.replace(/[+\/]/g,function(ae){return ae=="+"?"-":"_"}).replace(/=/g,"")},C=function(J,ae){return ae?m(c(J)):c(J)},M=function(J){return C(J,!0)},k;K.Uint8Array&&(k=function(J,ae){for(var G="",X=0,Z=J.length;X<Z;X+=3){var B=J[X],O=J[X+1],ne=J[X+2],me=B<<16|O<<8|ne;G+=d.charAt(me>>>18)+d.charAt(me>>>12&63)+(typeof O!="undefined"?d.charAt(me>>>6&63):"=")+(typeof ne!="undefined"?d.charAt(me&63):"=")}return ae?m(G):G});var E=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,T=function(J){switch(J.length){case 4:var ae=(7&J.charCodeAt(0))<<18|(63&J.charCodeAt(1))<<12|(63&J.charCodeAt(2))<<6|63&J.charCodeAt(3),G=ae-65536;return S((G>>>10)+55296)+S((G&1023)+56320);case 3:return S((15&J.charCodeAt(0))<<12|(63&J.charCodeAt(1))<<6|63&J.charCodeAt(2));default:return S((31&J.charCodeAt(0))<<6|63&J.charCodeAt(1))}},I=function(J){return J.replace(E,T)},F=function(J){var ae=J.length,G=ae%4,X=(ae>0?U[J.charAt(0)]<<18:0)|(ae>1?U[J.charAt(1)]<<12:0)|(ae>2?U[J.charAt(2)]<<6:0)|(ae>3?U[J.charAt(3)]:0),Z=[S(X>>>16),S(X>>>8&255),S(X&255)];return Z.length-=[0,0,2,1][G],Z.join("")},H=K.atob&&typeof K.atob=="function"?function(J){return K.atob(J)}:function(J){return J.replace(/\S{1,4}/g,F)},W=function(J){return H(String(J).replace(/[^A-Za-z0-9\+\/]/g,""))},z=function(J){return I(H(J))},ie=function(J){return String(J).replace(/[-_]/g,function(ae){return ae=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},re=function(J){return z(ie(J))},_e;K.Uint8Array&&(_e=function(J){return Uint8Array.from(W(ie(J)),function(ae){return ae.charCodeAt(0)})});var Ae=function(){var J=K.Base64;return K.Base64=P,J};if(K.Base64={VERSION:A,atob:W,btoa:l,fromBase64:re,toBase64:C,utob:f,encode:C,encodeURI:M,btou:I,decode:re,noConflict:Ae,fromUint8Array:k,toUint8Array:_e},typeof Object.defineProperty=="function"){var ce=function(J){return{value:J,enumerable:!1,writable:!0,configurable:!0}};K.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",ce(function(){return re(this)})),Object.defineProperty(String.prototype,"toBase64",ce(function(J){return C(this,J)})),Object.defineProperty(String.prototype,"toBase64URI",ce(function(){return C(this,!0)}))}}return K.Meteor&&(Base64=K.Base64),Ot.exports?Ot.exports.Base64=K.Base64:(R=[],N=function(){return K.Base64}.apply(ke,R),N!==void 0&&(Ot.exports=N)),{Base64:K.Base64}})},53184:function(Ot,ke,y){"use strict";var R,N;function K(P,A,d){var U=function(S,s){return P.js_beautify(S,s)};return U.js=P.js_beautify,U.css=A.css_beautify,U.html=d.html_beautify,U.js_beautify=P.js_beautify,U.css_beautify=A.css_beautify,U.html_beautify=d.html_beautify,U}R=[y(58553),y(87804),y(40998)],N=function(P,A,d){return K(P,A,d)}.apply(ke,R),N!==void 0&&(Ot.exports=N)},87804:function(Ot,ke){var y,R;(function(){var N;(function(){"use strict";var P=[,,function(S){function s(u){this.__parent=u,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=[]}s.prototype.clone_empty=function(){var u=new s(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},s.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},s.prototype.has_match=function(u){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(u))return!0;return!1},s.prototype.set_indent=function(u,l){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},s.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)},s.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},s.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},s.prototype.is_empty=function(){return this.__items.length===0},s.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},s.prototype.push=function(u){this.__items.push(u);var l=u.lastIndexOf(`
|
|
|
`);l!==-1?this.__character_count=u.length-l:this.__character_count+=u.length},s.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},s.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},s.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},s.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},s.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function w(u,l){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),l=l||"",u.indent_level>0&&(l=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}w.prototype.get_indent_size=function(u,l){var c=this.__base_string_length;return l=l||0,u<0&&(c=0),c+=u*this.__indent_size,c+=l,c},w.prototype.get_indent_string=function(u,l){var c=this.__base_string;return l=l||0,u<0&&(u=0,c=""),l+=u*this.__indent_size,this.__ensure_cache(l),c+=this.__cache[l],c},w.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},w.prototype.__add_column=function(){var u=this.__cache.length,l=0,c="";this.__indent_size&&u>=this.__indent_size&&(l=Math.floor(u/this.__indent_size),u-=l*this.__indent_size,c=new Array(l+1).join(this.__indent_string)),u&&(c+=new Array(u+1).join(" ")),this.__cache.push(c)};function f(u,l){this.__indent_cache=new w(u,l),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new s(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(u,l){return this.__indent_cache.get_indent_string(u,l)},f.prototype.get_indent_size=function(u,l){return this.__indent_cache.get_indent_size(u,l)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(u){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 c=this.__lines.join(`
|
|
|
`);return u!==`
|
|
|
`&&(c=c.replace(/[\n]/g,u)),c},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(u,l){return u=u||0,l=l||0,this.next_line.set_indent(u,l),this.__lines.length>1?(this.current_line.set_indent(u,l),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(u){for(var l=0;l<u.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),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(u){for(var l=this.__lines.length;u<l;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&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(u,l){for(var c=this.__lines.length-2;c>=0;){var m=this.__lines[c];if(m.is_empty())break;if(m.item(0).indexOf(u)!==0&&m.item(-1)!==l){this.__lines.splice(c+1,0,new s(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},S.exports.Output=f},,,,function(S){function s(u,l){this.raw_options=w(u,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"])}s.prototype._get_array=function(u,l){var c=this.raw_options[u],m=l||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(m=c.concat()):typeof c=="string"&&(m=c.split(/[^a-zA-Z0-9_\/\-]+/)),m},s.prototype._get_boolean=function(u,l){var c=this.raw_options[u],m=c===void 0?!!l:!!c;return m},s.prototype._get_characters=function(u,l){var c=this.raw_options[u],m=l||"";return typeof c=="string"&&(m=c.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),m},s.prototype._get_number=function(u,l){var c=this.raw_options[u];l=parseInt(l,10),isNaN(l)&&(l=0);var m=parseInt(c,10);return isNaN(m)&&(m=l),m},s.prototype._get_selection=function(u,l,c){var m=this._get_selection_list(u,l,c);if(m.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
|
|
|
`+l+`
|
|
|
You passed in: '`+this.raw_options[u]+"'");return m[0]},s.prototype._get_selection_list=function(u,l,c){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[l[0]],!this._is_valid_selection(c,l))throw new Error("Invalid Default Value!");var m=this._get_array(u,c);if(!this._is_valid_selection(m,l))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
|
|
|
`+l+`
|
|
|
You passed in: '`+this.raw_options[u]+"'");return m},s.prototype._is_valid_selection=function(u,l){return u.length&&l.length&&!u.some(function(c){return l.indexOf(c)===-1})};function w(u,l){var c={};u=f(u);var m;for(m in u)m!==l&&(c[m]=u[m]);if(l&&u[l])for(m in u[l])c[m]=u[l][m];return c}function f(u){var l={},c;for(c in u){var m=c.replace(/-/g,"_");l[m]=u[c]}return l}S.exports.Options=s,S.exports.normalizeOpts=f,S.exports.mergeOpts=w},,function(S){var s=RegExp.prototype.hasOwnProperty("sticky");function w(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}w.prototype.restart=function(){this.__position=0},w.prototype.back=function(){this.__position>0&&(this.__position-=1)},w.prototype.hasNext=function(){return this.__position<this.__input_length},w.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},w.prototype.peek=function(f){var u=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(u=this.__input.charAt(f)),u},w.prototype.__match=function(f,u){f.lastIndex=u;var l=f.exec(this.__input);return l&&!(s&&f.sticky)&&l.index!==u&&(l=null),l},w.prototype.test=function(f,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(f,u):!1},w.prototype.testChar=function(f,u){var l=this.peek(u);return f.lastIndex=0,l!==null&&f.test(l)},w.prototype.match=function(f){var u=this.__match(f,this.__position);return u?this.__position+=u[0].length:u=null,u},w.prototype.read=function(f,u,l){var c="",m;return f&&(m=this.match(f),m&&(c+=m[0])),u&&(m||!f)&&(c+=this.readUntil(u,l)),c},w.prototype.readUntil=function(f,u){var l="",c=this.__position;f.lastIndex=this.__position;var m=f.exec(this.__input);return m?(c=m.index,u&&(c+=m[0].length)):c=this.__input_length,l=this.__input.substring(this.__position,c),this.__position=c,l},w.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},w.prototype.get_regexp=function(f,u){var l=null,c="g";return u&&s&&(c="y"),typeof f=="string"&&f!==""?l=new RegExp(f,c):f&&(l=new RegExp(f.source,c)),l},w.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},w.prototype.peekUntilAfter=function(f){var u=this.__position,l=this.readUntilAfter(f);return this.__position=u,l},w.prototype.lookBack=function(f){var u=this.__position-1;return u>=f.length&&this.__input.substring(u-f.length,u).toLowerCase()===f},S.exports.InputScanner=w},,,,,function(S){function s(w,f){w=typeof w=="string"?w:w.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(w+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(w+/\sbeautify\signore:end\s/.source+f,"g")}s.prototype.get_directives=function(w){if(!w.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(w);u;)f[u[1]]=u[2],u=this.__directive_pattern.exec(w);return f},s.prototype.readIgnored=function(w){return w.readUntilAfter(this.__directives_end_ignore_pattern)},S.exports.Directives=s},,function(S,s,w){var f=w(16).Beautifier,u=w(17).Options;function l(c,m){var C=new f(c,m);return C.beautify()}S.exports=l,S.exports.defaultOptions=function(){return new u}},function(S,s,w){var f=w(17).Options,u=w(2).Output,l=w(8).InputScanner,c=w(13).Directives,m=new c(/\/\*/,/\*\//),C=/\r\n|[\r\n]/,M=/\r\n|[\r\n]/g,k=/\s/,E=/(?:\s|\n)+/g,T=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,I=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function F(H,W){this._source_text=H||"",this._options=new f(W),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"]}F.prototype.eatString=function(H){var W="";for(this._ch=this._input.next();this._ch;){if(W+=this._ch,this._ch==="\\")W+=this._input.next();else if(H.indexOf(this._ch)!==-1||this._ch===`
|
|
|
`)break;this._ch=this._input.next()}return W},F.prototype.eatWhitespace=function(H){for(var W=k.test(this._input.peek()),z=0;k.test(this._input.peek());)this._ch=this._input.next(),H&&this._ch===`
|
|
|
`&&(z===0||z<this._options.max_preserve_newlines)&&(z++,this._output.add_new_line(!0));return W},F.prototype.foundNestedPseudoClass=function(){for(var H=0,W=1,z=this._input.peek(W);z;){if(z==="{")return!0;if(z==="(")H+=1;else if(z===")"){if(H===0)return!1;H-=1}else if(z===";"||z==="}")return!1;W++,z=this._input.peek(W)}return!1},F.prototype.print_string=function(H){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(H)},F.prototype.preserveSingleSpace=function(H){H&&(this._output.space_before_token=!0)},F.prototype.indent=function(){this._indentLevel++},F.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},F.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var H=this._source_text,W=this._options.eol;W==="auto"&&(W=`
|
|
|
`,H&&C.test(H||"")&&(W=H.match(C)[0])),H=H.replace(M,`
|
|
|
`);var z=H.match(/^[\t ]*/)[0];this._output=new u(this._options,z),this._input=new l(H),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var ie=0,re=!1,_e=!1,Ae=!1,ce=!1,J=!1,ae=this._ch,G=!1,X,Z,B;X=this._input.read(E),Z=X!=="",B=ae,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),ae=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var O=this._input.read(T),ne=m.get_directives(O);ne&&ne.ignore==="start"&&(O+=m.readIgnored(this._input)),this.print_string(O),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(I)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(Z),this.print_string(this._ch);var me=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);me.match(/[ :]$/)&&(me=this.eatString(": ").replace(/\s+$/,""),this.print_string(me),this._output.space_before_token=!0),ie===0&&me.indexOf(":")!==-1&&(_e=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(Z),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?(_e=!0,this.indent()):Oe in this.NESTED_AT_RULE?(this._nestedLevel+=1,Oe in this.CONDITIONAL_GROUP_RULE&&(Ae=!0)):ie===0&&!_e&&(ce=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(Z),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")_e&&(_e=!1,this.outdent()),ce=!1,Ae?(Ae=!1,re=this._indentLevel>=this._nestedLevel):re=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&re&&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)):(B==="("?this._output.space_before_token=!1:B!==","&&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(),B==="{"&&this._output.trim(!0),_e&&(this.outdent(),_e=!1),this.print_string(this._ch),re=!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 He=0;He<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;He++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[He])){G=!0;break}(re||Ae)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!ce&&ie===0?(this.print_string(":"),_e||(_e=!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 ut=B==='"'||B==="'";this.preserveSingleSpace(ut||Z),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")G=!1,ie===0?(_e&&(this.outdent(),_e=!1),ce=!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(Z||Fe),this.print_string(this._ch),_e&&B==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),J=!0):(this.eatWhitespace(),ie++,this.indent())}else if(this._ch===")")ie&&(ie--,this.outdent()),J&&this._input.peek()===";"&&this._options.selector_separator_newline&&(J=!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&&(!_e||J)&&ie===0&&!ce?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!_e&&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(Z),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 it=B==='"'||B==="'";this.preserveSingleSpace(it||Z),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
|
`&&G&&this._output.add_new_line()}var st=this._output.get_code(W);return st},S.exports.Beautifier=F},function(S,s,w){var f=w(6).Options;function u(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 c=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||c;var m=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var C=0;C<m.length;C++)m[C]!=="expand"?this.brace_style="collapse":this.brace_style=m[C]}u.prototype=new f,S.exports.Options=u}],A={};function d(S){var s=A[S];if(s!==void 0)return s.exports;var w=A[S]={exports:{}};return P[S](w,w.exports,d),w.exports}var U=d(15);N=U})();var K=N;y=[],R=function(){return{css_beautify:K}}.apply(ke,y),R!==void 0&&(Ot.exports=R)})()},40998:function(Ot,ke,y){var R,N;(function(){var K;(function(){"use strict";var U=[,,function(f){function u(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=[]}u.prototype.clone_empty=function(){var m=new u(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},u.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},u.prototype.has_match=function(m){for(var C=this.__items.length-1;C>=0;C--)if(this.__items[C].match(m))return!0;return!1},u.prototype.set_indent=function(m,C){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=C||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},u.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)},u.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},u.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},u.prototype.is_empty=function(){return this.__items.length===0},u.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},u.prototype.push=function(m){this.__items.push(m);var C=m.lastIndexOf(`
|
|
|
`);C!==-1?this.__character_count=m.length-C:this.__character_count+=m.length},u.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},u.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},u.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},u.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},u.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,C){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)),C=C||"",m.indent_level>0&&(C=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=C,this.__base_string_length=C.length}l.prototype.get_indent_size=function(m,C){var M=this.__base_string_length;return C=C||0,m<0&&(M=0),M+=m*this.__indent_size,M+=C,M},l.prototype.get_indent_string=function(m,C){var M=this.__base_string;return C=C||0,m<0&&(m=0,M=""),C+=m*this.__indent_size,this.__ensure_cache(C),M+=this.__cache[C],M},l.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},l.prototype.__add_column=function(){var m=this.__cache.length,C=0,M="";this.__indent_size&&m>=this.__indent_size&&(C=Math.floor(m/this.__indent_size),m-=C*this.__indent_size,M=new Array(C+1).join(this.__indent_string)),m&&(M+=new Array(m+1).join(" ")),this.__cache.push(M)};function c(m,C){this.__indent_cache=new l(m,C),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 u(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(m,C){return this.__indent_cache.get_indent_string(m,C)},c.prototype.get_indent_size=function(m,C){return this.__indent_cache.get_indent_size(m,C)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(m){this.trim(!0);var C=this.current_line.pop();C&&(C[C.length-1]===`
|
|
|
`&&(C=C.replace(/\n+$/g,"")),this.current_line.push(C)),this._end_with_newline&&this.__add_outputline();var M=this.__lines.join(`
|
|
|
`);return m!==`
|
|
|
`&&(M=M.replace(/[\n]/g,m)),M},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(m,C){return m=m||0,C=C||0,this.next_line.set_indent(m,C),this.__lines.length>1?(this.current_line.set_indent(m,C),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(m){for(var C=0;C<m.newlines;C++)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},c.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()},c.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(" "))},c.prototype.remove_indent=function(m){for(var C=this.__lines.length;m<C;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},c.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},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(m,C){for(var M=this.__lines.length-2;M>=0;){var k=this.__lines[M];if(k.is_empty())break;if(k.item(0).indexOf(m)!==0&&k.item(-1)!==C){this.__lines.splice(M+1,0,new u(this)),this.previous_line=this.__lines[this.__lines.length-2];break}M--}},f.exports.Output=c},function(f){function u(l,c,m,C){this.type=l,this.text=c,this.comments_before=null,this.newlines=m||0,this.whitespace_before=C||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}f.exports.Token=u},,,function(f){function u(m,C){this.raw_options=l(m,C),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"])}u.prototype._get_array=function(m,C){var M=this.raw_options[m],k=C||[];return typeof M=="object"?M!==null&&typeof M.concat=="function"&&(k=M.concat()):typeof M=="string"&&(k=M.split(/[^a-zA-Z0-9_\/\-]+/)),k},u.prototype._get_boolean=function(m,C){var M=this.raw_options[m],k=M===void 0?!!C:!!M;return k},u.prototype._get_characters=function(m,C){var M=this.raw_options[m],k=C||"";return typeof M=="string"&&(k=M.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),k},u.prototype._get_number=function(m,C){var M=this.raw_options[m];C=parseInt(C,10),isNaN(C)&&(C=0);var k=parseInt(M,10);return isNaN(k)&&(k=C),k},u.prototype._get_selection=function(m,C,M){var k=this._get_selection_list(m,C,M);if(k.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
|
`+C+`
|
|
|
You passed in: '`+this.raw_options[m]+"'");return k[0]},u.prototype._get_selection_list=function(m,C,M){if(!C||C.length===0)throw new Error("Selection list cannot be empty.");if(M=M||[C[0]],!this._is_valid_selection(M,C))throw new Error("Invalid Default Value!");var k=this._get_array(m,M);if(!this._is_valid_selection(k,C))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
|
`+C+`
|
|
|
You passed in: '`+this.raw_options[m]+"'");return k},u.prototype._is_valid_selection=function(m,C){return m.length&&C.length&&!m.some(function(M){return C.indexOf(M)===-1})};function l(m,C){var M={};m=c(m);var k;for(k in m)k!==C&&(M[k]=m[k]);if(C&&m[C])for(k in m[C])M[k]=m[C][k];return M}function c(m){var C={},M;for(M in m){var k=M.replace(/-/g,"_");C[k]=m[M]}return C}f.exports.Options=u,f.exports.normalizeOpts=c,f.exports.mergeOpts=l},,function(f){var u=RegExp.prototype.hasOwnProperty("sticky");function l(c){this.__input=c||"",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 c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},l.prototype.peek=function(c){var m=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(m=this.__input.charAt(c)),m},l.prototype.__match=function(c,m){c.lastIndex=m;var C=c.exec(this.__input);return C&&!(u&&c.sticky)&&C.index!==m&&(C=null),C},l.prototype.test=function(c,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(c,m):!1},l.prototype.testChar=function(c,m){var C=this.peek(m);return c.lastIndex=0,C!==null&&c.test(C)},l.prototype.match=function(c){var m=this.__match(c,this.__position);return m?this.__position+=m[0].length:m=null,m},l.prototype.read=function(c,m,C){var M="",k;return c&&(k=this.match(c),k&&(M+=k[0])),m&&(k||!c)&&(M+=this.readUntil(m,C)),M},l.prototype.readUntil=function(c,m){var C="",M=this.__position;c.lastIndex=this.__position;var k=c.exec(this.__input);return k?(M=k.index,m&&(M+=k[0].length)):M=this.__input_length,C=this.__input.substring(this.__position,M),this.__position=M,C},l.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},l.prototype.get_regexp=function(c,m){var C=null,M="g";return m&&u&&(M="y"),typeof c=="string"&&c!==""?C=new RegExp(c,M):c&&(C=new RegExp(c.source,M)),C},l.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},l.prototype.peekUntilAfter=function(c){var m=this.__position,C=this.readUntilAfter(c);return this.__position=m,C},l.prototype.lookBack=function(c){var m=this.__position-1;return m>=c.length&&this.__input.substring(m-c.length,m).toLowerCase()===c},f.exports.InputScanner=l},function(f,u,l){var c=l(8).InputScanner,m=l(3).Token,C=l(10).TokenStream,M=l(11).WhitespacePattern,k={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},E=function(T,I){this._input=new c(T),this._options=I||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new M(this._input)};E.prototype.tokenize=function(){this._input.restart(),this.__tokens=new C,this._reset();for(var T,I=new m(k.START,""),F=null,H=[],W=new C;I.type!==k.EOF;){for(T=this._get_next_token(I,F);this._is_comment(T);)W.add(T),T=this._get_next_token(I,F);W.isEmpty()||(T.comments_before=W,W=new C),T.parent=F,this._is_opening(T)?(H.push(F),F=T):F&&this._is_closing(T,F)&&(T.opened=F,F.closed=T,F=H.pop(),T.parent=F),T.previous=I,I.next=T,this.__tokens.add(T),I=T}return this.__tokens},E.prototype._is_first_token=function(){return this.__tokens.isEmpty()},E.prototype._reset=function(){},E.prototype._get_next_token=function(T,I){this._readWhitespace();var F=this._input.read(/.+/g);return F?this._create_token(k.RAW,F):this._create_token(k.EOF,"")},E.prototype._is_comment=function(T){return!1},E.prototype._is_opening=function(T){return!1},E.prototype._is_closing=function(T,I){return!1},E.prototype._create_token=function(T,I){var F=new m(T,I,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return F},E.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},f.exports.Tokenizer=E,f.exports.TOKEN=k},function(f){function u(l){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=l}u.prototype.restart=function(){this.__position=0},u.prototype.isEmpty=function(){return this.__tokens_length===0},u.prototype.hasNext=function(){return this.__position<this.__tokens_length},u.prototype.next=function(){var l=null;return this.hasNext()&&(l=this.__tokens[this.__position],this.__position+=1),l},u.prototype.peek=function(l){var c=null;return l=l||0,l+=this.__position,l>=0&&l<this.__tokens_length&&(c=this.__tokens[l]),c},u.prototype.add=function(l){this.__parent_token&&(l.parent=this.__parent_token),this.__tokens.push(l),this.__tokens_length+=1},f.exports.TokenStream=u},function(f,u,l){var c=l(12).Pattern;function m(C,M){c.call(this,C,M),M?this._line_regexp=this._input.get_regexp(M._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new c,m.prototype.__set_whitespace_patterns=function(C,M){C+="\\t ",M+="\\n\\r",this._match_pattern=this._input.get_regexp("["+C+M+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+M+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var C=this._input.read(this._match_pattern);if(C===" ")this.whitespace_before_token=" ";else if(C){var M=this.__split(this._newline_regexp,C);this.newline_count=M.length-1,this.whitespace_before_token=M[this.newline_count]}return C},m.prototype.matching=function(C,M){var k=this._create();return k.__set_whitespace_patterns(C,M),k._update(),k},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(C,M){C.lastIndex=0;for(var k=0,E=[],T=C.exec(M);T;)E.push(M.substring(k,T.index)),k=T.index+T[0].length,T=C.exec(M);return k<M.length?E.push(M.substring(k,M.length)):E.push(""),E},f.exports.WhitespacePattern=m},function(f){function u(l,c){this._input=l,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,c&&(this._starting_pattern=this._input.get_regexp(c._starting_pattern,!0),this._match_pattern=this._input.get_regexp(c._match_pattern,!0),this._until_pattern=this._input.get_regexp(c._until_pattern),this._until_after=c._until_after)}u.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},u.prototype.read_match=function(){return this._input.match(this._match_pattern)},u.prototype.until_after=function(l){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(l),c._update(),c},u.prototype.until=function(l){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(l),c._update(),c},u.prototype.starting_with=function(l){var c=this._create();return c._starting_pattern=this._input.get_regexp(l,!0),c._update(),c},u.prototype.matching=function(l){var c=this._create();return c._match_pattern=this._input.get_regexp(l,!0),c._update(),c},u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){},f.exports.Pattern=u},function(f){function u(l,c){l=typeof l=="string"?l:l.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(l+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(l+/\sbeautify\signore:end\s/.source+c,"g")}u.prototype.get_directives=function(l){if(!l.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(l);m;)c[m[1]]=m[2],m=this.__directive_pattern.exec(l);return c},u.prototype.readIgnored=function(l){return l.readUntilAfter(this.__directives_end_ignore_pattern)},f.exports.Directives=u},function(f,u,l){var c=l(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function C(M,k){c.call(this,M,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 E=new c(M);this.__patterns={handlebars_comment:E.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:E.starting_with(/{{{/).until_after(/}}}/),handlebars:E.starting_with(/{{/).until_after(/}}/),php:E.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:E.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:E.starting_with(/{%/).until_after(/%}/),django_value:E.starting_with(/{{/).until_after(/}}/),django_comment:E.starting_with(/{#/).until_after(/#}/),smarty:E.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:E.starting_with(/{\*/).until_after(/\*}/),smarty_literal:E.starting_with(/{literal}/).until_after(/{\/literal}/)}}C.prototype=new c,C.prototype._create=function(){return new C(this._input,this)},C.prototype._update=function(){this.__set_templated_pattern()},C.prototype.disable=function(M){var k=this._create();return k._disabled[M]=!0,k._update(),k},C.prototype.read_options=function(M){var k=this._create();for(var E in m)k._disabled[E]=M.templating.indexOf(E)===-1;return k._update(),k},C.prototype.exclude=function(M){var k=this._create();return k._excluded[M]=!0,k._update(),k},C.prototype.read=function(){var M="";this._match_pattern?M=this._input.read(this._starting_pattern):M=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),M+=k,k=this._read_template();return this._until_after&&(M+=this._input.readUntilAfter(this._until_pattern)),M},C.prototype.__set_templated_pattern=function(){var M=[];this._disabled.php||M.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||M.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||M.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||M.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(M.push(this.__patterns.django._starting_pattern.source),M.push(this.__patterns.django_value._starting_pattern.source),M.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||M.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&M.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+M.join("|")+")")},C.prototype._read_template=function(){var M="",k=this._input.peek();if(k==="<"){var E=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&E==="?"&&(M=M||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&E==="%"&&(M=M||this.__patterns.erb.read())}else k==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(M=M||this.__patterns.handlebars_comment.read(),M=M||this.__patterns.handlebars_unescaped.read(),M=M||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(M=M||this.__patterns.django_value.read()),this._excluded.django||(M=M||this.__patterns.django_comment.read(),M=M||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(M=M||this.__patterns.smarty_comment.read(),M=M||this.__patterns.smarty_literal.read(),M=M||this.__patterns.smarty.read()));return M},f.exports.TemplatablePattern=C},,,,function(f,u,l){var c=l(19).Beautifier,m=l(20).Options;function C(M,k,E,T){var I=new c(M,k,E,T);return I.beautify()}f.exports=C,f.exports.defaultOptions=function(){return new m}},function(f,u,l){var c=l(20).Options,m=l(2).Output,C=l(21).Tokenizer,M=l(21).TOKEN,k=/\r\n|[\r\n]/,E=/\r\n|[\r\n]/g,T=function(ce,J){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=ce.max_preserve_newlines,this.preserve_newlines=ce.preserve_newlines,this._output=new m(ce,J)};T.prototype.current_line_has_match=function(ce){return this._output.current_line.has_match(ce)},T.prototype.set_space_before_token=function(ce,J){this._output.space_before_token=ce,this._output.non_breaking_space=J},T.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},T.prototype.add_raw_token=function(ce){this._output.add_raw_token(ce)},T.prototype.print_preserved_newlines=function(ce){var J=0;ce.type!==M.TEXT&&ce.previous.type!==M.TEXT&&(J=ce.newlines?1:0),this.preserve_newlines&&(J=ce.newlines<this.max_preserve_newlines+1?ce.newlines:this.max_preserve_newlines+1);for(var ae=0;ae<J;ae++)this.print_newline(ae>0);return J!==0},T.prototype.traverse_whitespace=function(ce){return ce.whitespace_before||ce.newlines?(this.print_preserved_newlines(ce)||(this._output.space_before_token=!0),!0):!1},T.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},T.prototype.print_newline=function(ce){this._output.add_new_line(ce)},T.prototype.print_token=function(ce){ce.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(ce.text))},T.prototype.indent=function(){this.indent_level++},T.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},T.prototype.get_full_indent=function(ce){return ce=this.indent_level+(ce||0),ce<1?"":this._output.get_indent_string(ce)};var I=function(ce){for(var J=null,ae=ce.next;ae.type!==M.EOF&&ce.closed!==ae;){if(ae.type===M.ATTRIBUTE&&ae.text==="type"){ae.next&&ae.next.type===M.EQUALS&&ae.next.next&&ae.next.next.type===M.VALUE&&(J=ae.next.next.text);break}ae=ae.next}return J},F=function(ce,J){var ae=null,G=null;return J.closed?(ce==="script"?ae="text/javascript":ce==="style"&&(ae="text/css"),ae=I(J)||ae,ae.search("text/css")>-1?G="css":ae.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?G="javascript":ae.search(/(text|application|dojo)\/(x-)?(html)/)>-1?G="html":ae.search(/test\/null/)>-1&&(G="null"),G):null};function H(ce,J){return J.indexOf(ce)!==-1}function W(ce,J,ae){this.parent=ce||null,this.tag=J?J.tag_name:"",this.indent_level=ae||0,this.parser_token=J||null}function z(ce){this._printer=ce,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(ce){var J=new W(this._current_frame,ce,this._printer.indent_level);this._current_frame=J},z.prototype._try_pop_frame=function(ce){var J=null;return ce&&(J=ce.parser_token,this._printer.indent_level=ce.indent_level,this._current_frame=ce.parent),J},z.prototype._get_frame=function(ce,J){for(var ae=this._current_frame;ae&&ce.indexOf(ae.tag)===-1;){if(J&&J.indexOf(ae.tag)!==-1){ae=null;break}ae=ae.parent}return ae},z.prototype.try_pop=function(ce,J){var ae=this._get_frame([ce],J);return this._try_pop_frame(ae)},z.prototype.indent_to_tag=function(ce){var J=this._get_frame(ce);J&&(this._printer.indent_level=J.indent_level)};function ie(ce,J,ae,G){this._source_text=ce||"",J=J||{},this._js_beautify=ae,this._css_beautify=G,this._tag_stack=null;var X=new c(J,"html");this._options=X,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 ce=this._source_text,J=this._options.eol;this._options.eol==="auto"&&(J=`
|
|
|
`,ce&&k.test(ce)&&(J=ce.match(k)[0])),ce=ce.replace(E,`
|
|
|
`);var ae=ce.match(/^[\t ]*/)[0],G={text:"",type:""},X=new re(this._options),Z=new T(this._options,ae),B=new C(ce,this._options).tokenize();this._tag_stack=new z(Z);for(var O=null,ne=B.next();ne.type!==M.EOF;)ne.type===M.TAG_OPEN||ne.type===M.COMMENT?(O=this._handle_tag_open(Z,ne,X,G,B),X=O):ne.type===M.ATTRIBUTE||ne.type===M.EQUALS||ne.type===M.VALUE||ne.type===M.TEXT&&!X.tag_complete?O=this._handle_inside_tag(Z,ne,X,G):ne.type===M.TAG_CLOSE?O=this._handle_tag_close(Z,ne,X):ne.type===M.TEXT?O=this._handle_text(Z,ne,X):ne.type===M.CONTROL_FLOW_OPEN?O=this._handle_control_flow_open(Z,ne):ne.type===M.CONTROL_FLOW_CLOSE?O=this._handle_control_flow_close(Z,ne):Z.add_raw_token(ne),G=O,ne=B.next();var me=Z._output.get_code(J);return me},ie.prototype._handle_control_flow_open=function(ce,J){var ae={text:J.text,type:J.type};return ce.set_space_before_token(J.newlines||J.whitespace_before!=="",!0),J.newlines?ce.print_preserved_newlines(J):ce.set_space_before_token(J.newlines||J.whitespace_before!=="",!0),ce.print_token(J),ce.indent(),ae},ie.prototype._handle_control_flow_close=function(ce,J){var ae={text:J.text,type:J.type};return ce.deindent(),J.newlines?ce.print_preserved_newlines(J):ce.set_space_before_token(J.newlines||J.whitespace_before!=="",!0),ce.print_token(J),ae},ie.prototype._handle_tag_close=function(ce,J,ae){var G={text:J.text,type:J.type};return ce.alignment_size=0,ae.tag_complete=!0,ce.set_space_before_token(J.newlines||J.whitespace_before!=="",!0),ae.is_unformatted?ce.add_raw_token(J):(ae.tag_start_char==="<"&&(ce.set_space_before_token(J.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&ae.has_wrapped_attrs&&ce.print_newline(!1)),ce.print_token(J)),ae.indent_content&&!(ae.is_unformatted||ae.is_content_unformatted)&&(ce.indent(),ae.indent_content=!1),!ae.is_inline_element&&!(ae.is_unformatted||ae.is_content_unformatted)&&ce.set_wrap_point(),G},ie.prototype._handle_inside_tag=function(ce,J,ae,G){var X=ae.has_wrapped_attrs,Z={text:J.text,type:J.type};return ce.set_space_before_token(J.newlines||J.whitespace_before!=="",!0),ae.is_unformatted?ce.add_raw_token(J):ae.tag_start_char==="{"&&J.type===M.TEXT?ce.print_preserved_newlines(J)?(J.newlines=0,ce.add_raw_token(J)):ce.print_token(J):(J.type===M.ATTRIBUTE?ce.set_space_before_token(!0):(J.type===M.EQUALS||J.type===M.VALUE&&J.previous.type===M.EQUALS)&&ce.set_space_before_token(!1),J.type===M.ATTRIBUTE&&ae.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(ce.traverse_whitespace(J),X=X||J.newlines!==0),this._is_wrap_attributes_force&&ae.attr_count>=this._options.wrap_attributes_min_attrs&&(G.type!==M.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(ce.print_newline(!1),X=!0)),ce.print_token(J),X=X||ce.previous_token_wrapped(),ae.has_wrapped_attrs=X),Z},ie.prototype._handle_text=function(ce,J,ae){var G={text:J.text,type:"TK_CONTENT"};return ae.custom_beautifier_name?this._print_custom_beatifier_text(ce,J,ae):ae.is_unformatted||ae.is_content_unformatted?ce.add_raw_token(J):(ce.traverse_whitespace(J),ce.print_token(J)),G},ie.prototype._print_custom_beatifier_text=function(ce,J,ae){var G=this;if(J.text!==""){var X=J.text,Z,B=1,O="",ne="";ae.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?Z=this._js_beautify:ae.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?Z=this._css_beautify:ae.custom_beautifier_name==="html"&&(Z=function(it,st){var et=new ie(it,st,G._js_beautify,G._css_beautify);return et.beautify()}),this._options.indent_scripts==="keep"?B=0:this._options.indent_scripts==="separate"&&(B=-ce.indent_level);var me=ce.get_full_indent(B);if(X=X.replace(/\n[ \t]*$/,""),ae.custom_beautifier_name!=="html"&&X[0]==="<"&&X.match(/^(<!--|<!\[CDATA\[)/)){var Oe=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(X);if(!Oe){ce.add_raw_token(J);return}O=me+Oe[1]+`
|
|
|
`,X=Oe[4],Oe[5]&&(ne=me+Oe[5]),X=X.replace(/\n[ \t]*$/,""),(Oe[2]||Oe[3].indexOf(`
|
|
|
`)!==-1)&&(Oe=Oe[3].match(/[ \t]+$/),Oe&&(J.whitespace_before=Oe[0]))}if(X)if(Z){var He=function(){this.eol=`
|
|
|
`};He.prototype=this._options.raw_options;var ut=new He;X=Z(me+X,ut)}else{var Fe=J.whitespace_before;Fe&&(X=X.replace(new RegExp(`
|
|
|
(`+Fe+")?","g"),`
|
|
|
`)),X=me+X.replace(/\n/g,`
|
|
|
`+me)}O&&(X?X=O+X+`
|
|
|
`+ne:X=O+ne),ce.print_newline(!1),X&&(J.text=X,J.whitespace_before="",J.newlines=0,ce.add_raw_token(J),ce.print_newline(!0))}},ie.prototype._handle_tag_open=function(ce,J,ae,G,X){var Z=this._get_tag_open_token(J);if((ae.is_unformatted||ae.is_content_unformatted)&&!ae.is_empty_element&&J.type===M.TAG_OPEN&&!Z.is_start_tag?(ce.add_raw_token(J),Z.start_tag_token=this._tag_stack.try_pop(Z.tag_name)):(ce.traverse_whitespace(J),this._set_tag_position(ce,J,Z,ae,G),Z.is_inline_element||ce.set_wrap_point(),ce.print_token(J)),Z.is_start_tag&&this._is_wrap_attributes_force){var B=0,O;do O=X.peek(B),O.type===M.ATTRIBUTE&&(Z.attr_count+=1),B+=1;while(O.type!==M.EOF&&O.type!==M.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(Z.alignment_size=J.text.length+1),!Z.tag_complete&&!Z.is_unformatted&&(ce.alignment_size=Z.alignment_size),Z};var re=function(ce,J,ae){if(this.parent=J||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="",!ae)this.tag_complete=!0;else{var G;this.tag_start_char=ae.text[0],this.text=ae.text,this.tag_start_char==="<"?(G=ae.text.match(/^<([^\s>]*)/),this.tag_check=G?G[1]:""):(G=ae.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=G?G[1]:"",(ae.text.startsWith("{{#>")||ae.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&ae.next!==null?this.tag_check=ae.next.text.split(" ")[0]:this.tag_check=ae.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),ae.type===M.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||ae.closed&&ae.closed.text==="/>";var X=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(X=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!ce.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(X)))}};ie.prototype._get_tag_open_token=function(ce){var J=new re(this._options,this._tag_stack.get_parser_token(),ce);return J.alignment_size=this._options.wrap_attributes_indent_size,J.is_end_tag=J.is_end_tag||H(J.tag_check,this._options.void_elements),J.is_empty_element=J.tag_complete||J.is_start_tag&&J.is_end_tag,J.is_unformatted=!J.tag_complete&&H(J.tag_check,this._options.unformatted),J.is_content_unformatted=!J.is_empty_element&&H(J.tag_check,this._options.content_unformatted),J.is_inline_element=H(J.tag_name,this._options.inline)||this._options.inline_custom_elements&&J.tag_name.includes("-")||J.tag_start_char==="{",J},ie.prototype._set_tag_position=function(ce,J,ae,G,X){if(ae.is_empty_element||(ae.is_end_tag?ae.start_tag_token=this._tag_stack.try_pop(ae.tag_name):(this._do_optional_end_element(ae)&&(ae.is_inline_element||ce.print_newline(!1)),this._tag_stack.record_tag(ae),(ae.tag_name==="script"||ae.tag_name==="style")&&!(ae.is_unformatted||ae.is_content_unformatted)&&(ae.custom_beautifier_name=F(ae.tag_check,J)))),H(ae.tag_check,this._options.extra_liners)&&(ce.print_newline(!1),ce._output.just_added_blankline()||ce.print_newline(!0)),ae.is_empty_element){if(ae.tag_start_char==="{"&&ae.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),ae.indent_content=!0;var Z=ce.current_line_has_match(/{{#if/);Z||ce.print_newline(!1)}ae.tag_name==="!--"&&X.type===M.TAG_CLOSE&&G.is_end_tag&&ae.text.indexOf(`
|
|
|
`)===-1||(ae.is_inline_element||ae.is_unformatted||ce.print_newline(!1),this._calcluate_parent_multiline(ce,ae))}else if(ae.is_end_tag){var B=!1;B=ae.start_tag_token&&ae.start_tag_token.multiline_content,B=B||!ae.is_inline_element&&!(G.is_inline_element||G.is_unformatted)&&!(X.type===M.TAG_CLOSE&&ae.start_tag_token===G)&&X.type!=="TK_CONTENT",(ae.is_content_unformatted||ae.is_unformatted)&&(B=!1),B&&ce.print_newline(!1)}else ae.indent_content=!ae.custom_beautifier_name,ae.tag_start_char==="<"&&(ae.tag_name==="html"?ae.indent_content=this._options.indent_inner_html:ae.tag_name==="head"?ae.indent_content=this._options.indent_head_inner_html:ae.tag_name==="body"&&(ae.indent_content=this._options.indent_body_inner_html)),!(ae.is_inline_element||ae.is_unformatted)&&(X.type!=="TK_CONTENT"||ae.is_content_unformatted)&&ce.print_newline(!1),this._calcluate_parent_multiline(ce,ae)},ie.prototype._calcluate_parent_multiline=function(ce,J){J.parent&&ce._output.just_added_newline()&&!((J.is_inline_element||J.is_unformatted)&&J.parent.is_inline_element)&&(J.parent.multiline_content=!0)};var _e=["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"],Ae=["a","audio","del","ins","map","noscript","video"];ie.prototype._do_optional_end_element=function(ce){var J=null;if(!(ce.is_empty_element||!ce.is_start_tag||!ce.parent)){if(ce.tag_name==="body")J=J||this._tag_stack.try_pop("head");else if(ce.tag_name==="li")J=J||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(ce.tag_name==="dd"||ce.tag_name==="dt")J=J||this._tag_stack.try_pop("dt",["dl"]),J=J||this._tag_stack.try_pop("dd",["dl"]);else if(ce.parent.tag_name==="p"&&_e.indexOf(ce.tag_name)!==-1){var ae=ce.parent.parent;(!ae||Ae.indexOf(ae.tag_name)===-1)&&(J=J||this._tag_stack.try_pop("p"))}else ce.tag_name==="rp"||ce.tag_name==="rt"?(J=J||this._tag_stack.try_pop("rt",["ruby","rtc"]),J=J||this._tag_stack.try_pop("rp",["ruby","rtc"])):ce.tag_name==="optgroup"?J=J||this._tag_stack.try_pop("optgroup",["select"]):ce.tag_name==="option"?J=J||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):ce.tag_name==="colgroup"?J=J||this._tag_stack.try_pop("caption",["table"]):ce.tag_name==="thead"?(J=J||this._tag_stack.try_pop("caption",["table"]),J=J||this._tag_stack.try_pop("colgroup",["table"])):ce.tag_name==="tbody"||ce.tag_name==="tfoot"?(J=J||this._tag_stack.try_pop("caption",["table"]),J=J||this._tag_stack.try_pop("colgroup",["table"]),J=J||this._tag_stack.try_pop("thead",["table"]),J=J||this._tag_stack.try_pop("tbody",["table"])):ce.tag_name==="tr"?(J=J||this._tag_stack.try_pop("caption",["table"]),J=J||this._tag_stack.try_pop("colgroup",["table"]),J=J||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(ce.tag_name==="th"||ce.tag_name==="td")&&(J=J||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),J=J||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return ce.parent=this._tag_stack.get_parser_token(),J}},f.exports.Beautifier=ie},function(f,u,l){var c=l(6).Options;function m(C){c.call(this,C,"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 c,f.exports.Options=m},function(f,u,l){var c=l(9).Tokenizer,m=l(9).TOKEN,C=l(13).Directives,M=l(14).TemplatablePattern,k=l(12).Pattern,E={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},T=new C(/<\!--/,/-->/),I=function(F,H){c.call(this,F,H),this._current_tag_name="";var W=new M(this._input).read_options(this._options),z=new k(this._input);if(this.__patterns={word:W.until(/[\n\r\t <]/),word_control_flow_close_excluded:W.until(/[\n\r\t <}]/),single_quote:W.until_after(/'/),double_quote:W.until_after(/"/),attribute:W.until(/[\n\r\t =>]|\/>/),element_name:W.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)}};I.prototype=new c,I.prototype._is_comment=function(F){return!1},I.prototype._is_opening=function(F){return F.type===E.TAG_OPEN||F.type===E.CONTROL_FLOW_OPEN},I.prototype._is_closing=function(F,H){return F.type===E.TAG_CLOSE&&H&&((F.text===">"||F.text==="/>")&&H.text[0]==="<"||F.text==="}}"&&H.text[0]==="{"&&H.text[1]==="{")||F.type===E.CONTROL_FLOW_CLOSE&&F.text==="}"&&H.text.endsWith("{")},I.prototype._reset=function(){this._current_tag_name=""},I.prototype._get_next_token=function(F,H){var W=null;this._readWhitespace();var z=this._input.peek();return z===null?this._create_token(E.EOF,""):(W=W||this._read_open_handlebars(z,H),W=W||this._read_attribute(z,F,H),W=W||this._read_close(z,H),W=W||this._read_script_and_style(z,F),W=W||this._read_control_flows(z,H),W=W||this._read_raw_content(z,F,H),W=W||this._read_content_word(z,H),W=W||this._read_comment_or_cdata(z),W=W||this._read_processing(z),W=W||this._read_open(z,H),W=W||this._create_token(E.UNKNOWN,this._input.next()),W)},I.prototype._read_comment_or_cdata=function(F){var H=null,W=null,z=null;if(F==="<"){var ie=this._input.peek(1);ie==="!"&&(W=this.__patterns.comment.read(),W?(z=T.get_directives(W),z&&z.ignore==="start"&&(W+=T.readIgnored(this._input))):W=this.__patterns.cdata.read()),W&&(H=this._create_token(E.COMMENT,W),H.directives=z)}return H},I.prototype._read_processing=function(F){var H=null,W=null,z=null;if(F==="<"){var ie=this._input.peek(1);(ie==="!"||ie==="?")&&(W=this.__patterns.conditional_comment.read(),W=W||this.__patterns.processing.read()),W&&(H=this._create_token(E.COMMENT,W),H.directives=z)}return H},I.prototype._read_open=function(F,H){var W=null,z=null;return(!H||H.type===E.CONTROL_FLOW_OPEN)&&F==="<"&&(W=this._input.next(),this._input.peek()==="/"&&(W+=this._input.next()),W+=this.__patterns.element_name.read(),z=this._create_token(E.TAG_OPEN,W)),z},I.prototype._read_open_handlebars=function(F,H){var W=null,z=null;return(!H||H.type===E.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&F==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(W=this.__patterns.handlebars_comment.read(),W=W||this.__patterns.handlebars.read(),z=this._create_token(E.COMMENT,W)):(W=this.__patterns.handlebars_open.read(),z=this._create_token(E.TAG_OPEN,W))),z},I.prototype._read_control_flows=function(F,H){var W="",z=null;if(!this._options.templating.includes("angular"))return z;if(F==="@"){if(W=this.__patterns.angular_control_flow_start.read(),W==="")return z;for(var ie=W.endsWith("(")?1:0,re=0;!(W.endsWith("{")&&ie===re);){var _e=this._input.next();if(_e===null)break;_e==="("?ie++:_e===")"&&re++,W+=_e}z=this._create_token(E.CONTROL_FLOW_OPEN,W)}else F==="}"&&H&&H.type===E.CONTROL_FLOW_OPEN&&(W=this._input.next(),z=this._create_token(E.CONTROL_FLOW_CLOSE,W));return z},I.prototype._read_close=function(F,H){var W=null,z=null;return H&&H.type===E.TAG_OPEN&&(H.text[0]==="<"&&(F===">"||F==="/"&&this._input.peek(1)===">")?(W=this._input.next(),F==="/"&&(W+=this._input.next()),z=this._create_token(E.TAG_CLOSE,W)):H.text[0]==="{"&&F==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),z=this._create_token(E.TAG_CLOSE,"}}"))),z},I.prototype._read_attribute=function(F,H,W){var z=null,ie="";if(W&&W.text[0]==="<")if(F==="=")z=this._create_token(E.EQUALS,this._input.next());else if(F==='"'||F==="'"){var re=this._input.next();F==='"'?re+=this.__patterns.double_quote.read():re+=this.__patterns.single_quote.read(),z=this._create_token(E.VALUE,re)}else ie=this.__patterns.attribute.read(),ie&&(H.type===E.EQUALS?z=this._create_token(E.VALUE,ie):z=this._create_token(E.ATTRIBUTE,ie));return z},I.prototype._is_content_unformatted=function(F){return this._options.void_elements.indexOf(F)===-1&&(this._options.content_unformatted.indexOf(F)!==-1||this._options.unformatted.indexOf(F)!==-1)},I.prototype._read_raw_content=function(F,H,W){var z="";if(W&&W.text[0]==="{")z=this.__patterns.handlebars_raw_close.read();else if(H.type===E.TAG_CLOSE&&H.opened.text[0]==="<"&&H.text[0]!=="/"){var ie=H.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(E.TEXT,z):null},I.prototype._read_script_and_style=function(F,H){if(H.type===E.TAG_CLOSE&&H.opened.text[0]==="<"&&H.text[0]!=="/"){var W=H.opened.text.substr(1).toLowerCase();if(W==="script"||W==="style"){var z=this._read_comment_or_cdata(F);if(z)return z.type=E.TEXT,z;var ie=this._input.readUntil(new RegExp("</"+W+"[\\n\\r\\t ]*?>","ig"));if(ie)return this._create_token(E.TEXT,ie)}}return null},I.prototype._read_content_word=function(F,H){var W="";return this._options.unformatted_content_delimiter&&F===this._options.unformatted_content_delimiter[0]&&(W=this.__patterns.unformatted_content_delimiter.read()),W||(W=H&&H.type===E.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),W?this._create_token(E.TEXT,W):null},f.exports.Tokenizer=I,f.exports.TOKEN=E}],S={};function s(f){var u=S[f];if(u!==void 0)return u.exports;var l=S[f]={exports:{}};return U[f](l,l.exports,s),l.exports}var w=s(18);K=w})();var P=K;if(1)R=[y,y(58553),y(87804)],N=function(U){var S=y(58553),s=y(87804);return{html_beautify:function(w,f){return P(w,f,S.js_beautify,s.css_beautify)}}}.apply(ke,R),N!==void 0&&(Ot.exports=N);else var A,d})()},58553:function(Ot,ke){var y,R;(function(){var N;(function(){"use strict";var P=[function(S,s,w){var f=w(1).Beautifier,u=w(5).Options;function l(c,m){var C=new f(c,m);return C.beautify()}S.exports=l,S.exports.defaultOptions=function(){return new u}},function(S,s,w){var f=w(2).Output,u=w(3).Token,l=w(4),c=w(5).Options,m=w(7).Tokenizer,C=w(7).line_starters,M=w(7).positionable_operators,k=w(7).TOKEN;function E(O,ne){return ne.indexOf(O)!==-1}function T(O){return O.replace(/^\s+/g,"")}function I(O){for(var ne={},me=0;me<O.length;me++)ne[O[me].replace(/-/g,"_")]=O[me];return ne}function F(O,ne){return O&&O.type===k.RESERVED&&O.text===ne}function H(O,ne){return O&&O.type===k.RESERVED&&E(O.text,ne)}var W=["case","return","do","if","throw","else","await","break","continue","async"],z=["before-newline","after-newline","preserve-newline"],ie=I(z),re=[ie.before_newline,ie.preserve_newline],_e={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function Ae(O,ne){ne.multiline_frame||ne.mode===_e.ForInitializer||ne.mode===_e.Conditional||O.remove_indent(ne.start_line_index)}function ce(O){O=O.replace(l.allLineBreaks,`
|
|
|
`);for(var ne=[],me=O.indexOf(`
|
|
|
`);me!==-1;)ne.push(O.substring(0,me)),O=O.substring(me+1),me=O.indexOf(`
|
|
|
`);return O.length&&ne.push(O),ne}function J(O){return O===_e.ArrayLiteral}function ae(O){return E(O,[_e.Expression,_e.ForInitializer,_e.Conditional])}function G(O,ne){for(var me=0;me<O.length;me++){var Oe=O[me].trim();if(Oe.charAt(0)!==ne)return!1}return!0}function X(O,ne){for(var me=0,Oe=O.length,He;me<Oe;me++)if(He=O[me],He&&He.indexOf(ne)!==0)return!1;return!0}function Z(O,ne){ne=ne||{},this._source_text=O||"",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 c(ne)}Z.prototype.create_flags=function(O,ne){var me=0;O&&(me=O.indentation_level,!this._output.just_added_newline()&&O.line_indent_level>me&&(me=O.line_indent_level));var Oe={mode:ne,parent:O,last_token:O?O.last_token:new u(k.START_BLOCK,""),last_word:O?O.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:me,alignment:0,line_indent_level:O?O.line_indent_level:me,start_line_index:this._output.get_line_number(),ternary_depth:0};return Oe},Z.prototype._reset=function(O){var ne=O.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(_e.BlockStatement);var me=new m(O,this._options);return this._tokens=me.tokenize(),O},Z.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O,ne=this._reset(this._source_text),me=this._options.eol;this._options.eol==="auto"&&(me=`
|
|
|
`,ne&&l.lineBreak.test(ne||"")&&(me=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 O=this._output.get_code(me),O},Z.prototype.handle_token=function(O,ne){O.type===k.START_EXPR?this.handle_start_expr(O):O.type===k.END_EXPR?this.handle_end_expr(O):O.type===k.START_BLOCK?this.handle_start_block(O):O.type===k.END_BLOCK?this.handle_end_block(O):O.type===k.WORD?this.handle_word(O):O.type===k.RESERVED?this.handle_word(O):O.type===k.SEMICOLON?this.handle_semicolon(O):O.type===k.STRING?this.handle_string(O):O.type===k.EQUALS?this.handle_equals(O):O.type===k.OPERATOR?this.handle_operator(O):O.type===k.COMMA?this.handle_comma(O):O.type===k.BLOCK_COMMENT?this.handle_block_comment(O,ne):O.type===k.COMMENT?this.handle_comment(O,ne):O.type===k.DOT?this.handle_dot(O):O.type===k.EOF?this.handle_eof(O):O.type===k.UNKNOWN?this.handle_unknown(O,ne):this.handle_unknown(O,ne)},Z.prototype.handle_whitespace_and_comments=function(O,ne){var me=O.newlines,Oe=this._options.keep_array_indentation&&J(this._flags.mode);if(O.comments_before)for(var He=O.comments_before.next();He;)this.handle_whitespace_and_comments(He,ne),this.handle_token(He,ne),He=O.comments_before.next();if(Oe)for(var ut=0;ut<me;ut+=1)this.print_newline(ut>0,ne);else if(this._options.max_preserve_newlines&&me>this._options.max_preserve_newlines&&(me=this._options.max_preserve_newlines),this._options.preserve_newlines&&me>1){this.print_newline(!1,ne);for(var Fe=1;Fe<me;Fe+=1)this.print_newline(!0,ne)}};var B=["async","break","continue","return","throw","yield"];Z.prototype.allow_wrap_or_preserved_newline=function(O,ne){if(ne=ne===void 0?!1:ne,!this._output.just_added_newline()){var me=this._options.preserve_newlines&&O.newlines||ne,Oe=E(this._flags.last_token.text,M)||E(O.text,M);if(Oe){var He=E(this._flags.last_token.text,M)&&E(this._options.operator_position,re)||E(O.text,M);me=me&&He}if(me)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(H(this._flags.last_token,B))return;this._output.set_wrap_point()}}},Z.prototype.print_newline=function(O,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 me=this._tokens.peek();this._flags.mode===_e.Statement&&!(this._flags.if_block&&F(me,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(O)&&(this._flags.multiline_frame=!0)},Z.prototype.print_token_line_indentation=function(O){this._output.just_added_newline()&&(this._options.keep_array_indentation&&O.newlines&&(O.text==="["||J(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(O.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))},Z.prototype.print_token=function(O){if(this._output.raw){this._output.add_raw_token(O);return}if(this._options.comma_first&&O.previous&&O.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(O),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(O),this._output.non_breaking_space=!0,this._output.add_token(O.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},Z.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Z.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))},Z.prototype.set_mode=function(O){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,O),this._flags=this.create_flags(this._previous_flags,O),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Z.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===_e.Statement&&Ae(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Z.prototype.start_of_object_property=function(){return this._flags.parent.mode===_e.ObjectLiteral&&this._flags.mode===_e.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||H(this._flags.last_token,["get","set"]))},Z.prototype.start_of_statement=function(O){var ne=!1;return ne=ne||H(this._flags.last_token,["var","let","const"])&&O.type===k.WORD,ne=ne||F(this._flags.last_token,"do"),ne=ne||!(this._flags.parent.mode===_e.ObjectLiteral&&this._flags.mode===_e.Statement)&&H(this._flags.last_token,B)&&!O.newlines,ne=ne||F(this._flags.last_token,"else")&&!(F(O,"if")&&!O.comments_before),ne=ne||this._flags.last_token.type===k.END_EXPR&&(this._previous_flags.mode===_e.ForInitializer||this._previous_flags.mode===_e.Conditional),ne=ne||this._flags.last_token.type===k.WORD&&this._flags.mode===_e.BlockStatement&&!this._flags.in_case&&!(O.text==="--"||O.text==="++")&&this._last_last_text!=="function"&&O.type!==k.WORD&&O.type!==k.RESERVED,ne=ne||this._flags.mode===_e.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||H(this._flags.last_token,["get","set"])),ne?(this.set_mode(_e.Statement),this.indent(),this.handle_whitespace_and_comments(O,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O,H(O,["do","for","if","while"])),!0):!1},Z.prototype.handle_start_expr=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O);var ne=_e.Expression;if(O.text==="["){if(this._flags.last_token.type===k.WORD||this._flags.last_token.text===")"){H(this._flags.last_token,C)&&(this._output.space_before_token=!0),this.print_token(O),this.set_mode(ne),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}ne=_e.ArrayLiteral,J(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()),E(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=_e.ForInitializer):E(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,ne=_e.Conditional):E(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&O.whitespace_before===""?this._output.space_before_token=!1:(E(this._flags.last_token.text,C)||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(O);else if(this._flags.last_token.type===k.WORD){this._output.space_before_token=!1;var me=this._tokens.peek(-3);if(this._options.space_after_named_function&&me){var Oe=this._tokens.peek(-4);H(me,["async","function"])||me.text==="*"&&H(Oe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===_e.ObjectLiteral?(me.text==="{"||me.text===","||me.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(O);(this._flags.last_token.type===k.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(E(this._last_last_text,["function","yield"])||this._flags.mode===_e.ObjectLiteral&&E(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(O,O.newlines),this.print_token(O),this.set_mode(ne),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Z.prototype.handle_end_expr=function(O){for(;this._flags.mode===_e.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(O,O.text==="]"&&J(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(O),this.restore_mode(),Ae(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===_e.Conditional&&(this._previous_flags.mode=_e.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},Z.prototype.handle_start_block=function(O){this.handle_whitespace_and_comments(O);var ne=this._tokens.peek(),me=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===k.END_EXPR?(this.set_mode(_e.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(_e.BlockStatement):me&&(E(me.text,[":",","])&&E(ne.type,[k.STRING,k.WORD,k.RESERVED])||E(ne.text,["get","set","..."])&&E(me.type,[k.WORD,k.RESERVED]))?E(this._last_last_text,["class","interface"])&&!E(me.text,[":",","])?this.set_mode(_e.BlockStatement):this.set_mode(_e.ObjectLiteral):this._flags.last_token.type===k.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(_e.BlockStatement):E(this._flags.last_token.type,[k.EQUALS,k.START_EXPR,k.COMMA,k.OPERATOR])||H(this._flags.last_token,["return","throw","import","default"])?this.set_mode(_e.ObjectLiteral):this.set_mode(_e.BlockStatement),this._flags.last_token&&H(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var Oe=!ne.comments_before&&ne.text==="}",He=Oe&&this._flags.last_word==="function"&&this._flags.last_token.type===k.END_EXPR;if(this._options.brace_preserve_inline){var ut=0,Fe=null;this._flags.inline_frame=!0;do if(ut+=1,Fe=this._tokens.peek(ut-1),Fe.newlines){this._flags.inline_frame=!1;break}while(Fe.type!==k.EOF&&!(Fe.type===k.END_BLOCK&&Fe.opened===O))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==k.OPERATOR&&(He||this._flags.last_token.type===k.EQUALS||H(this._flags.last_token,W)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(J(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(O),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&&(E(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(O),this.indent(),!Oe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},Z.prototype.handle_end_block=function(O){for(this.handle_whitespace_and_comments(O);this._flags.mode===_e.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||(J(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(O)},Z.prototype.handle_word=function(O){if(O.type===k.RESERVED){if(E(O.text,["set","get"])&&this._flags.mode!==_e.ObjectLiteral)O.type=k.WORD;else if(O.text==="import"&&E(this._tokens.peek().text,["(","."]))O.type=k.WORD;else if(E(O.text,["as","from"])&&!this._flags.import_block)O.type=k.WORD;else if(this._flags.mode===_e.ObjectLiteral){var ne=this._tokens.peek();ne.text===":"&&(O.type=k.WORD)}}if(this.start_of_statement(O)?H(this._flags.last_token,["var","let","const"])&&O.type===k.WORD&&(this._flags.declaration_statement=!0):O.newlines&&!ae(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||!H(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(O),this.print_newline()):this.handle_whitespace_and_comments(O),this._flags.do_block&&!this._flags.do_while)if(F(O,"while")){this._output.space_before_token=!0,this.print_token(O),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&&F(O,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===_e.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&H(O,["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(O),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()&&!(E(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===_e.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(O),F(O,"function")){(E(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(E(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===k.OPERATOR))&&!this._output.just_added_blankline()&&!O.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===k.RESERVED||this._flags.last_token.type===k.WORD?H(this._flags.last_token,["get","set","new","export"])||H(this._flags.last_token,B)?this._output.space_before_token=!0:F(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&&(ae(this._flags.mode)||J(this._flags.mode))||this.print_newline(),this.print_token(O),this._flags.last_word=O.text;return}var me="NONE";if(this._flags.last_token.type===k.END_BLOCK?this._previous_flags.inline_frame?me="SPACE":H(O,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines?me="NEWLINE":(me="SPACE",this._output.space_before_token=!0):me="NEWLINE":this._flags.last_token.type===k.SEMICOLON&&this._flags.mode===_e.BlockStatement?me="NEWLINE":this._flags.last_token.type===k.SEMICOLON&&ae(this._flags.mode)?me="SPACE":this._flags.last_token.type===k.STRING?me="NEWLINE":this._flags.last_token.type===k.RESERVED||this._flags.last_token.type===k.WORD||this._flags.last_token.text==="*"&&(E(this._last_last_text,["function","yield"])||this._flags.mode===_e.ObjectLiteral&&E(this._last_last_text,["{",","]))?me="SPACE":this._flags.last_token.type===k.START_BLOCK?this._flags.inline_frame?me="SPACE":me="NEWLINE":this._flags.last_token.type===k.END_EXPR&&(this._output.space_before_token=!0,me="NEWLINE"),H(O,C)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?me="SPACE":me="NEWLINE"),H(O,["else","catch","finally"]))if((!(this._flags.last_token.type===k.END_BLOCK&&this._previous_flags.mode===_e.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.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 me==="NEWLINE"?H(this._flags.last_token,W)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&H(O,["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||!H(O,["var","let","const"]))&&this._flags.last_token.text!==":"&&(F(O,"if")&&F(O.previous,"else")?this._output.space_before_token=!0:this.print_newline()):H(O,C)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&J(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():me==="SPACE"&&(this._output.space_before_token=!0);O.previous&&(O.previous.type===k.WORD||O.previous.type===k.RESERVED)&&(this._output.space_before_token=!0),this.print_token(O),this._flags.last_word=O.text,O.type===k.RESERVED&&(O.text==="do"?this._flags.do_block=!0:O.text==="if"?this._flags.if_block=!0:O.text==="import"?this._flags.import_block=!0:this._flags.import_block&&F(O,"from")&&(this._flags.import_block=!1))},Z.prototype.handle_semicolon=function(O){this.start_of_statement(O)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(O);for(var ne=this._tokens.peek();this._flags.mode===_e.Statement&&!(this._flags.if_block&&F(ne,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(O)},Z.prototype.handle_string=function(O){O.text.startsWith("`")&&O.newlines===0&&O.whitespace_before===""&&(O.previous.text===")"||this._flags.last_token.type===k.WORD)||(this.start_of_statement(O)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(O),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(O):O.text.startsWith("`")&&this._flags.last_token.type===k.END_EXPR&&(O.previous.text==="]"||O.previous.text===")")&&O.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(O)},Z.prototype.handle_equals=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0},Z.prototype.handle_comma=function(O){this.handle_whitespace_and_comments(O,!0),this.print_token(O),this._output.space_before_token=!0,this._flags.declaration_statement?(ae(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(O)):this._flags.mode===_e.ObjectLiteral||this._flags.mode===_e.Statement&&this._flags.parent.mode===_e.ObjectLiteral?(this._flags.mode===_e.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(O)},Z.prototype.handle_operator=function(O){var ne=O.text==="*"&&(H(this._flags.last_token,["function","yield"])||E(this._flags.last_token.type,[k.START_BLOCK,k.COMMA,k.END_BLOCK,k.SEMICOLON])),me=E(O.text,["-","+"])&&(E(this._flags.last_token.type,[k.START_BLOCK,k.START_EXPR,k.EQUALS,k.OPERATOR])||E(this._flags.last_token.text,C)||this._flags.last_token.text===",");if(!this.start_of_statement(O)){var Oe=!ne;this.handle_whitespace_and_comments(O,Oe)}if(O.text==="*"&&this._flags.last_token.type===k.DOT){this.print_token(O);return}if(O.text==="::"){this.print_token(O);return}if(E(O.text,["-","+"])&&this.start_of_object_property()){this.print_token(O);return}if(this._flags.last_token.type===k.OPERATOR&&E(this._options.operator_position,re)&&this.allow_wrap_or_preserved_newline(O),O.text===":"&&this._flags.in_case){this.print_token(O),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 He=!0,ut=!0,Fe=!1;if(O.text===":"?this._flags.ternary_depth===0?He=!1:(this._flags.ternary_depth-=1,Fe=!0):O.text==="?"&&(this._flags.ternary_depth+=1),!me&&!ne&&this._options.preserve_newlines&&E(O.text,M)){var it=O.text===":",st=it&&Fe,et=it&&!Fe;switch(this._options.operator_position){case ie.before_newline:this._output.space_before_token=!et,this.print_token(O),(!it||st)&&this.allow_wrap_or_preserved_newline(O),this._output.space_before_token=!0;return;case ie.after_newline:this._output.space_before_token=!0,!it||st?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(O):this._output.space_before_token=!1,this.print_token(O),this._output.space_before_token=!0;return;case ie.preserve_newline:et||this.allow_wrap_or_preserved_newline(O),He=!(this._output.just_added_newline()||et),this._output.space_before_token=He,this.print_token(O),this._output.space_before_token=!0;return}}if(ne){this.allow_wrap_or_preserved_newline(O),He=!1;var Nt=this._tokens.peek();ut=Nt&&E(Nt.type,[k.WORD,k.RESERVED])}else if(O.text==="...")this.allow_wrap_or_preserved_newline(O),He=this._flags.last_token.type===k.START_BLOCK,ut=!1;else if(E(O.text,["--","++","!","~"])||me){if((this._flags.last_token.type===k.COMMA||this._flags.last_token.type===k.START_EXPR)&&this.allow_wrap_or_preserved_newline(O),He=!1,ut=!1,O.newlines&&(O.text==="--"||O.text==="++"||O.text==="~")){var tt=H(this._flags.last_token,W)&&O.newlines;tt&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(tt,!0)}this._flags.last_token.text===";"&&ae(this._flags.mode)&&(He=!0),this._flags.last_token.type===k.RESERVED?He=!0:this._flags.last_token.type===k.END_EXPR?He=!(this._flags.last_token.text==="]"&&(O.text==="--"||O.text==="++")):this._flags.last_token.type===k.OPERATOR&&(He=E(O.text,["--","-","++","+"])&&E(this._flags.last_token.text,["--","-","++","+"]),E(O.text,["+","-"])&&E(this._flags.last_token.text,["--","++"])&&(ut=!0)),(this._flags.mode===_e.BlockStatement&&!this._flags.inline_frame||this._flags.mode===_e.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||He,this.print_token(O),this._output.space_before_token=ut},Z.prototype.handle_block_comment=function(O,ne){if(this._output.raw){this._output.add_raw_token(O),O.directives&&O.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(O.directives){this.print_newline(!1,ne),this.print_token(O),O.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!l.newline.test(O.text)&&!O.newlines){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0;return}else this.print_block_commment(O,ne)},Z.prototype.print_block_commment=function(O,ne){var me=ce(O.text),Oe,He=!1,ut=!1,Fe=O.whitespace_before,it=Fe.length;if(this.print_newline(!1,ne),this.print_token_line_indentation(O),this._output.add_token(me[0]),this.print_newline(!1,ne),me.length>1){for(me=me.slice(1),He=G(me,"*"),ut=X(me,Fe),He&&(this._flags.alignment=1),Oe=0;Oe<me.length;Oe++)He?(this.print_token_line_indentation(O),this._output.add_token(T(me[Oe]))):ut&&me[Oe]?(this.print_token_line_indentation(O),this._output.add_token(me[Oe].substring(it))):(this._output.current_line.set_indent(-1),this._output.add_token(me[Oe])),this.print_newline(!1,ne);this._flags.alignment=0}},Z.prototype.handle_comment=function(O,ne){O.newlines?this.print_newline(!1,ne):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(O),this.print_newline(!1,ne)},Z.prototype.handle_dot=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),H(this._flags.last_token,W)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(O,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(O)},Z.prototype.handle_unknown=function(O,ne){this.print_token(O),O.text[O.text.length-1]===`
|
|
|
`&&this.print_newline(!1,ne)},Z.prototype.handle_eof=function(O){for(;this._flags.mode===_e.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O)},S.exports.Beautifier=Z},function(S){function s(u){this.__parent=u,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=[]}s.prototype.clone_empty=function(){var u=new s(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},s.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},s.prototype.has_match=function(u){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(u))return!0;return!1},s.prototype.set_indent=function(u,l){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},s.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)},s.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},s.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},s.prototype.is_empty=function(){return this.__items.length===0},s.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},s.prototype.push=function(u){this.__items.push(u);var l=u.lastIndexOf(`
|
|
|
`);l!==-1?this.__character_count=u.length-l:this.__character_count+=u.length},s.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},s.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},s.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},s.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},s.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function w(u,l){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),l=l||"",u.indent_level>0&&(l=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}w.prototype.get_indent_size=function(u,l){var c=this.__base_string_length;return l=l||0,u<0&&(c=0),c+=u*this.__indent_size,c+=l,c},w.prototype.get_indent_string=function(u,l){var c=this.__base_string;return l=l||0,u<0&&(u=0,c=""),l+=u*this.__indent_size,this.__ensure_cache(l),c+=this.__cache[l],c},w.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},w.prototype.__add_column=function(){var u=this.__cache.length,l=0,c="";this.__indent_size&&u>=this.__indent_size&&(l=Math.floor(u/this.__indent_size),u-=l*this.__indent_size,c=new Array(l+1).join(this.__indent_string)),u&&(c+=new Array(u+1).join(" ")),this.__cache.push(c)};function f(u,l){this.__indent_cache=new w(u,l),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new s(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(u,l){return this.__indent_cache.get_indent_string(u,l)},f.prototype.get_indent_size=function(u,l){return this.__indent_cache.get_indent_size(u,l)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(u){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 c=this.__lines.join(`
|
|
|
`);return u!==`
|
|
|
`&&(c=c.replace(/[\n]/g,u)),c},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(u,l){return u=u||0,l=l||0,this.next_line.set_indent(u,l),this.__lines.length>1?(this.current_line.set_indent(u,l),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(u){for(var l=0;l<u.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),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(u){for(var l=this.__lines.length;u<l;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&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(u,l){for(var c=this.__lines.length-2;c>=0;){var m=this.__lines[c];if(m.is_empty())break;if(m.item(0).indexOf(u)!==0&&m.item(-1)!==l){this.__lines.splice(c+1,0,new s(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},S.exports.Output=f},function(S){function s(w,f,u,l){this.type=w,this.text=f,this.comments_before=null,this.newlines=u||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}S.exports.Token=s},function(S,s){var w="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",u="\\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",c="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",m="(?:"+c+"|["+w+u+"])",C="(?:"+c+"|["+f+u+l+"])*";s.identifier=new RegExp(m+C,"g"),s.identifierStart=new RegExp(m),s.identifierMatch=new RegExp("(?:"+c+"|["+f+u+l+"])+");var M=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;s.newline=/[\n\r\u2028\u2029]/,s.lineBreak=new RegExp(`\r
|
|
|
|`+s.newline.source),s.allLineBreaks=new RegExp(s.lineBreak.source,"g")},function(S,s,w){var f=w(6).Options,u=["before-newline","after-newline","preserve-newline"];function l(c){f.call(this,c,"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 C=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var M=0;M<C.length;M++)C[M]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=C[M];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",u),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}l.prototype=new f,S.exports.Options=l},function(S){function s(u,l){this.raw_options=w(u,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"])}s.prototype._get_array=function(u,l){var c=this.raw_options[u],m=l||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(m=c.concat()):typeof c=="string"&&(m=c.split(/[^a-zA-Z0-9_\/\-]+/)),m},s.prototype._get_boolean=function(u,l){var c=this.raw_options[u],m=c===void 0?!!l:!!c;return m},s.prototype._get_characters=function(u,l){var c=this.raw_options[u],m=l||"";return typeof c=="string"&&(m=c.replace(/\\r/,"\r").replace(/\\n/,`
|
|
|
`).replace(/\\t/," ")),m},s.prototype._get_number=function(u,l){var c=this.raw_options[u];l=parseInt(l,10),isNaN(l)&&(l=0);var m=parseInt(c,10);return isNaN(m)&&(m=l),m},s.prototype._get_selection=function(u,l,c){var m=this._get_selection_list(u,l,c);if(m.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
|
|
|
`+l+`
|
|
|
You passed in: '`+this.raw_options[u]+"'");return m[0]},s.prototype._get_selection_list=function(u,l,c){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[l[0]],!this._is_valid_selection(c,l))throw new Error("Invalid Default Value!");var m=this._get_array(u,c);if(!this._is_valid_selection(m,l))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
|
|
|
`+l+`
|
|
|
You passed in: '`+this.raw_options[u]+"'");return m},s.prototype._is_valid_selection=function(u,l){return u.length&&l.length&&!u.some(function(c){return l.indexOf(c)===-1})};function w(u,l){var c={};u=f(u);var m;for(m in u)m!==l&&(c[m]=u[m]);if(l&&u[l])for(m in u[l])c[m]=u[l][m];return c}function f(u){var l={},c;for(c in u){var m=c.replace(/-/g,"_");l[m]=u[c]}return l}S.exports.Options=s,S.exports.normalizeOpts=f,S.exports.mergeOpts=w},function(S,s,w){var f=w(8).InputScanner,u=w(9).Tokenizer,l=w(9).TOKEN,c=w(13).Directives,m=w(4),C=w(12).Pattern,M=w(14).TemplatablePattern;function k(G,X){return X.indexOf(G)!==-1}var E={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},T=new c(/\/\*/,/\*\//),I=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,F=/[0-9]/,H=/[^\d\.]/,W=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),z=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";z=z.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),z="\\?\\.(?!\\d) "+z,z=z.replace(/ /g,"|");var ie=new RegExp(z),re="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),_e=re.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),Ae=new RegExp("^(?:"+_e.join("|")+")$"),ce,J=function(G,X){u.call(this,G,X),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var Z=new C(this._input),B=new M(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(m.identifier).matching(m.identifierMatch),number:Z.matching(I),punct:Z.matching(ie),comment:Z.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:Z.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:Z.matching(/<!--/),html_comment_end:Z.matching(/-->/),include:Z.starting_with(/#include/).until_after(m.lineBreak),shebang:Z.starting_with(/#!/).until_after(m.lineBreak),xml:Z.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:B.until(/['\\\n\r\u2028\u2029]/),double_quote:B.until(/["\\\n\r\u2028\u2029]/),template_text:B.until(/[`\\$]/),template_expression:B.until(/[`}\\]/)}};J.prototype=new u,J.prototype._is_comment=function(G){return G.type===E.COMMENT||G.type===E.BLOCK_COMMENT||G.type===E.UNKNOWN},J.prototype._is_opening=function(G){return G.type===E.START_BLOCK||G.type===E.START_EXPR},J.prototype._is_closing=function(G,X){return(G.type===E.END_BLOCK||G.type===E.END_EXPR)&&X&&(G.text==="]"&&X.text==="["||G.text===")"&&X.text==="("||G.text==="}"&&X.text==="{")},J.prototype._reset=function(){ce=!1},J.prototype._get_next_token=function(G,X){var Z=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(E.EOF,""):(Z=Z||this._read_non_javascript(B),Z=Z||this._read_string(B),Z=Z||this._read_pair(B,this._input.peek(1)),Z=Z||this._read_word(G),Z=Z||this._read_singles(B),Z=Z||this._read_comment(B),Z=Z||this._read_regexp(B,G),Z=Z||this._read_xml(B,G),Z=Z||this._read_punctuation(),Z=Z||this._create_token(E.UNKNOWN,this._input.next()),Z)},J.prototype._read_word=function(G){var X;if(X=this.__patterns.identifier.read(),X!=="")return X=X.replace(m.allLineBreaks,`
|
|
|
`),!(G.type===E.DOT||G.type===E.RESERVED&&(G.text==="set"||G.text==="get"))&&Ae.test(X)?(X==="in"||X==="of")&&(G.type===E.WORD||G.type===E.STRING)?this._create_token(E.OPERATOR,X):this._create_token(E.RESERVED,X):this._create_token(E.WORD,X);if(X=this.__patterns.number.read(),X!=="")return this._create_token(E.WORD,X)},J.prototype._read_singles=function(G){var X=null;return G==="("||G==="["?X=this._create_token(E.START_EXPR,G):G===")"||G==="]"?X=this._create_token(E.END_EXPR,G):G==="{"?X=this._create_token(E.START_BLOCK,G):G==="}"?X=this._create_token(E.END_BLOCK,G):G===";"?X=this._create_token(E.SEMICOLON,G):G==="."&&H.test(this._input.peek(1))?X=this._create_token(E.DOT,G):G===","&&(X=this._create_token(E.COMMA,G)),X&&this._input.next(),X},J.prototype._read_pair=function(G,X){var Z=null;return G==="#"&&X==="{"&&(Z=this._create_token(E.START_BLOCK,G+X)),Z&&(this._input.next(),this._input.next()),Z},J.prototype._read_punctuation=function(){var G=this.__patterns.punct.read();if(G!=="")return G==="="?this._create_token(E.EQUALS,G):G==="?."?this._create_token(E.DOT,G):this._create_token(E.OPERATOR,G)},J.prototype._read_non_javascript=function(G){var X="";if(G==="#"){if(this._is_first_token()&&(X=this.__patterns.shebang.read(),X))return this._create_token(E.UNKNOWN,X.trim()+`
|
|
|
`);if(X=this.__patterns.include.read(),X)return this._create_token(E.UNKNOWN,X.trim()+`
|
|
|
`);G=this._input.next();var Z="#";if(this._input.hasNext()&&this._input.testChar(F)){do G=this._input.next(),Z+=G;while(this._input.hasNext()&&G!=="#"&&G!=="=");return G==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(Z+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(Z+="{}",this._input.next(),this._input.next())),this._create_token(E.WORD,Z)}this._input.back()}else if(G==="<"&&this._is_first_token()){if(X=this.__patterns.html_comment_start.read(),X){for(;this._input.hasNext()&&!this._input.testChar(m.newline);)X+=this._input.next();return ce=!0,this._create_token(E.COMMENT,X)}}else if(ce&&G==="-"&&(X=this.__patterns.html_comment_end.read(),X))return ce=!1,this._create_token(E.COMMENT,X);return null},J.prototype._read_comment=function(G){var X=null;if(G==="/"){var Z="";if(this._input.peek(1)==="*"){Z=this.__patterns.block_comment.read();var B=T.get_directives(Z);B&&B.ignore==="start"&&(Z+=T.readIgnored(this._input)),Z=Z.replace(m.allLineBreaks,`
|
|
|
`),X=this._create_token(E.BLOCK_COMMENT,Z),X.directives=B}else this._input.peek(1)==="/"&&(Z=this.__patterns.comment.read(),X=this._create_token(E.COMMENT,Z))}return X},J.prototype._read_string=function(G){if(G==="`"||G==="'"||G==='"'){var X=this._input.next();return this.has_char_escapes=!1,G==="`"?X+=this._read_string_recursive("`",!0,"${"):X+=this._read_string_recursive(G),this.has_char_escapes&&this._options.unescape_strings&&(X=ae(X)),this._input.peek()===G&&(X+=this._input.next()),X=X.replace(m.allLineBreaks,`
|
|
|
`),this._create_token(E.STRING,X)}return null},J.prototype._allow_regexp_or_xml=function(G){return G.type===E.RESERVED&&k(G.text,["return","case","throw","else","do","typeof","yield"])||G.type===E.END_EXPR&&G.text===")"&&G.opened.previous.type===E.RESERVED&&k(G.opened.previous.text,["if","while","for"])||k(G.type,[E.COMMENT,E.START_EXPR,E.START_BLOCK,E.START,E.END_BLOCK,E.OPERATOR,E.EQUALS,E.EOF,E.SEMICOLON,E.COMMA])},J.prototype._read_regexp=function(G,X){if(G==="/"&&this._allow_regexp_or_xml(X)){for(var Z=this._input.next(),B=!1,O=!1;this._input.hasNext()&&(B||O||this._input.peek()!==G)&&!this._input.testChar(m.newline);)Z+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?O=!0:this._input.peek()==="]"&&(O=!1)),this._input.next();return this._input.peek()===G&&(Z+=this._input.next(),Z+=this._input.read(m.identifier)),this._create_token(E.STRING,Z)}return null},J.prototype._read_xml=function(G,X){if(this._options.e4x&&G==="<"&&this._allow_regexp_or_xml(X)){var Z="",B=this.__patterns.xml.read_match();if(B){for(var O=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),ne=O.indexOf("{")===0,me=0;B;){var Oe=!!B[1],He=B[2],ut=!!B[B.length-1]||He.slice(0,8)==="![CDATA[";if(!ut&&(He===O||ne&&He.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Oe?--me:++me),Z+=B[0],me<=0)break;B=this.__patterns.xml.read_match()}return B||(Z+=this._input.match(/[\s\S]*/g)[0]),Z=Z.replace(m.allLineBreaks,`
|
|
|
`),this._create_token(E.STRING,Z)}}return null};function ae(G){for(var X="",Z=0,B=new f(G),O=null;B.hasNext();)if(O=B.match(/([\s]|[^\\]|\\\\)+/g),O&&(X+=O[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")O=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")O=B.match(/u([0-9A-Fa-f]{4})/g),O||(O=B.match(/u\{([0-9A-Fa-f]+)\}/g));else{X+="\\",B.hasNext()&&(X+=B.next());continue}if(!O||(Z=parseInt(O[1],16),Z>126&&Z<=255&&O[0].indexOf("x")===0))return G;Z>=0&&Z<32||Z>1114111?X+="\\"+O[0]:Z===34||Z===39||Z===92?X+="\\"+String.fromCharCode(Z):X+=String.fromCharCode(Z)}return X}J.prototype._read_string_recursive=function(G,X,Z){var B,O;G==="'"?O=this.__patterns.single_quote:G==='"'?O=this.__patterns.double_quote:G==="`"?O=this.__patterns.template_text:G==="}"&&(O=this.__patterns.template_expression);for(var ne=O.read(),me="";this._input.hasNext();){if(me=this._input.next(),me===G||!X&&m.newline.test(me)){this._input.back();break}else me==="\\"&&this._input.hasNext()?(B=this._input.peek(),B==="x"||B==="u"?this.has_char_escapes=!0:B==="\r"&&this._input.peek(1)===`
|
|
|
`&&this._input.next(),me+=this._input.next()):Z&&(Z==="${"&&me==="$"&&this._input.peek()==="{"&&(me+=this._input.next()),Z===me&&(G==="`"?me+=this._read_string_recursive("}",X,"`"):me+=this._read_string_recursive("`",X,"${"),this._input.hasNext()&&(me+=this._input.next())));me+=O.read(),ne+=me}return ne},S.exports.Tokenizer=J,S.exports.TOKEN=E,S.exports.positionable_operators=W.slice(),S.exports.line_starters=re.slice()},function(S){var s=RegExp.prototype.hasOwnProperty("sticky");function w(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}w.prototype.restart=function(){this.__position=0},w.prototype.back=function(){this.__position>0&&(this.__position-=1)},w.prototype.hasNext=function(){return this.__position<this.__input_length},w.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},w.prototype.peek=function(f){var u=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(u=this.__input.charAt(f)),u},w.prototype.__match=function(f,u){f.lastIndex=u;var l=f.exec(this.__input);return l&&!(s&&f.sticky)&&l.index!==u&&(l=null),l},w.prototype.test=function(f,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(f,u):!1},w.prototype.testChar=function(f,u){var l=this.peek(u);return f.lastIndex=0,l!==null&&f.test(l)},w.prototype.match=function(f){var u=this.__match(f,this.__position);return u?this.__position+=u[0].length:u=null,u},w.prototype.read=function(f,u,l){var c="",m;return f&&(m=this.match(f),m&&(c+=m[0])),u&&(m||!f)&&(c+=this.readUntil(u,l)),c},w.prototype.readUntil=function(f,u){var l="",c=this.__position;f.lastIndex=this.__position;var m=f.exec(this.__input);return m?(c=m.index,u&&(c+=m[0].length)):c=this.__input_length,l=this.__input.substring(this.__position,c),this.__position=c,l},w.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},w.prototype.get_regexp=function(f,u){var l=null,c="g";return u&&s&&(c="y"),typeof f=="string"&&f!==""?l=new RegExp(f,c):f&&(l=new RegExp(f.source,c)),l},w.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},w.prototype.peekUntilAfter=function(f){var u=this.__position,l=this.readUntilAfter(f);return this.__position=u,l},w.prototype.lookBack=function(f){var u=this.__position-1;return u>=f.length&&this.__input.substring(u-f.length,u).toLowerCase()===f},S.exports.InputScanner=w},function(S,s,w){var f=w(8).InputScanner,u=w(3).Token,l=w(10).TokenStream,c=w(11).WhitespacePattern,m={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},C=function(M,k){this._input=new f(M),this._options=k||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new c(this._input)};C.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var M,k=new u(m.START,""),E=null,T=[],I=new l;k.type!==m.EOF;){for(M=this._get_next_token(k,E);this._is_comment(M);)I.add(M),M=this._get_next_token(k,E);I.isEmpty()||(M.comments_before=I,I=new l),M.parent=E,this._is_opening(M)?(T.push(E),E=M):E&&this._is_closing(M,E)&&(M.opened=E,E.closed=M,E=T.pop(),M.parent=E),M.previous=k,k.next=M,this.__tokens.add(M),k=M}return this.__tokens},C.prototype._is_first_token=function(){return this.__tokens.isEmpty()},C.prototype._reset=function(){},C.prototype._get_next_token=function(M,k){this._readWhitespace();var E=this._input.read(/.+/g);return E?this._create_token(m.RAW,E):this._create_token(m.EOF,"")},C.prototype._is_comment=function(M){return!1},C.prototype._is_opening=function(M){return!1},C.prototype._is_closing=function(M,k){return!1},C.prototype._create_token=function(M,k){var E=new u(M,k,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return E},C.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},S.exports.Tokenizer=C,S.exports.TOKEN=m},function(S){function s(w){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=w}s.prototype.restart=function(){this.__position=0},s.prototype.isEmpty=function(){return this.__tokens_length===0},s.prototype.hasNext=function(){return this.__position<this.__tokens_length},s.prototype.next=function(){var w=null;return this.hasNext()&&(w=this.__tokens[this.__position],this.__position+=1),w},s.prototype.peek=function(w){var f=null;return w=w||0,w+=this.__position,w>=0&&w<this.__tokens_length&&(f=this.__tokens[w]),f},s.prototype.add=function(w){this.__parent_token&&(w.parent=this.__parent_token),this.__tokens.push(w),this.__tokens_length+=1},S.exports.TokenStream=s},function(S,s,w){var f=w(12).Pattern;function u(l,c){f.call(this,l,c),c?this._line_regexp=this._input.get_regexp(c._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}u.prototype=new f,u.prototype.__set_whitespace_patterns=function(l,c){l+="\\t ",c+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+c+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+c+"]")},u.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 c=this.__split(this._newline_regexp,l);this.newline_count=c.length-1,this.whitespace_before_token=c[this.newline_count]}return l},u.prototype.matching=function(l,c){var m=this._create();return m.__set_whitespace_patterns(l,c),m._update(),m},u.prototype._create=function(){return new u(this._input,this)},u.prototype.__split=function(l,c){l.lastIndex=0;for(var m=0,C=[],M=l.exec(c);M;)C.push(c.substring(m,M.index)),m=M.index+M[0].length,M=l.exec(c);return m<c.length?C.push(c.substring(m,c.length)):C.push(""),C},S.exports.WhitespacePattern=u},function(S){function s(w,f){this._input=w,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)}s.prototype.read=function(){var w=this._input.read(this._starting_pattern);return(!this._starting_pattern||w)&&(w+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),w},s.prototype.read_match=function(){return this._input.match(this._match_pattern)},s.prototype.until_after=function(w){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(w),f._update(),f},s.prototype.until=function(w){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(w),f._update(),f},s.prototype.starting_with=function(w){var f=this._create();return f._starting_pattern=this._input.get_regexp(w,!0),f._update(),f},s.prototype.matching=function(w){var f=this._create();return f._match_pattern=this._input.get_regexp(w,!0),f._update(),f},s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){},S.exports.Pattern=s},function(S){function s(w,f){w=typeof w=="string"?w:w.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(w+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(w+/\sbeautify\signore:end\s/.source+f,"g")}s.prototype.get_directives=function(w){if(!w.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(w);u;)f[u[1]]=u[2],u=this.__directive_pattern.exec(w);return f},s.prototype.readIgnored=function(w){return w.readUntilAfter(this.__directives_end_ignore_pattern)},S.exports.Directives=s},function(S,s,w){var f=w(12).Pattern,u={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function l(c,m){f.call(this,c,m),this.__template_pattern=null,this._disabled=Object.assign({},u),this._excluded=Object.assign({},u),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 C=new f(c);this.__patterns={handlebars_comment:C.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:C.starting_with(/{{{/).until_after(/}}}/),handlebars:C.starting_with(/{{/).until_after(/}}/),php:C.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:C.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:C.starting_with(/{%/).until_after(/%}/),django_value:C.starting_with(/{{/).until_after(/}}/),django_comment:C.starting_with(/{#/).until_after(/#}/),smarty:C.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:C.starting_with(/{\*/).until_after(/\*}/),smarty_literal:C.starting_with(/{literal}/).until_after(/{\/literal}/)}}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(c){var m=this._create();return m._disabled[c]=!0,m._update(),m},l.prototype.read_options=function(c){var m=this._create();for(var C in u)m._disabled[C]=c.templating.indexOf(C)===-1;return m._update(),m},l.prototype.exclude=function(c){var m=this._create();return m._excluded[c]=!0,m._update(),m},l.prototype.read=function(){var c="";this._match_pattern?c=this._input.read(this._starting_pattern):c=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),c+=m,m=this._read_template();return this._until_after&&(c+=this._input.readUntilAfter(this._until_pattern)),c},l.prototype.__set_templated_pattern=function(){var c=[];this._disabled.php||c.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||c.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||c.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||c.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(c.push(this.__patterns.django._starting_pattern.source),c.push(this.__patterns.django_value._starting_pattern.source),c.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||c.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&c.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+c.join("|")+")")},l.prototype._read_template=function(){var c="",m=this._input.peek();if(m==="<"){var C=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&C==="?"&&(c=c||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&C==="%"&&(c=c||this.__patterns.erb.read())}else m==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(c=c||this.__patterns.handlebars_comment.read(),c=c||this.__patterns.handlebars_unescaped.read(),c=c||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(c=c||this.__patterns.django_value.read()),this._excluded.django||(c=c||this.__patterns.django_comment.read(),c=c||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(c=c||this.__patterns.smarty_comment.read(),c=c||this.__patterns.smarty_literal.read(),c=c||this.__patterns.smarty.read()));return c},S.exports.TemplatablePattern=l}],A={};function d(S){var s=A[S];if(s!==void 0)return s.exports;var w=A[S]={exports:{}};return P[S](w,w.exports,d),w.exports}var U=d(0);N=U})();var K=N;y=[],R=function(){return{js_beautify:K}}.apply(ke,y),R!==void 0&&(Ot.exports=R)})()},15342:function(Ot){(function(y,R){Ot.exports=R()})(typeof self!="undefined"?self:this,function(){return function(ke){var y={};function R(N){if(y[N])return y[N].exports;var K=y[N]={i:N,l:!1,exports:{}};return ke[N].call(K.exports,K,K.exports,R),K.l=!0,K.exports}return R.m=ke,R.c=y,R.d=function(N,K,P){R.o(N,K)||Object.defineProperty(N,K,{enumerable:!0,get:P})},R.r=function(N){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})},R.t=function(N,K){if(K&1&&(N=R(N)),K&8||K&4&&typeof N=="object"&&N&&N.__esModule)return N;var P=Object.create(null);if(R.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:N}),K&2&&typeof N!="string")for(var A in N)R.d(P,A,function(d){return N[d]}.bind(null,A));return P},R.n=function(N){var K=N&&N.__esModule?function(){return N.default}:function(){return N};return R.d(K,"a",K),K},R.o=function(N,K){return Object.prototype.hasOwnProperty.call(N,K)},R.p="",R(R.s=1)}([function(ke,y,R){},function(ke,y,R){"use strict";R.r(y);var N=R(0),K=function(){function te(p,v,b){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=p,this.start=v,this.end=b}return te.range=function(v,b){return b?!v||!v.loc||!b.loc||v.loc.lexer!==b.loc.lexer?null:new te(v.loc.lexer,v.loc.start,b.loc.end):v&&v.loc},te}(),P=function(){function te(v,b){this.text=void 0,this.loc=void 0,this.text=v,this.loc=b}var p=te.prototype;return p.range=function(b,L){return new te(L,K.range(this,b))},te}(),A=function te(p,v){this.position=void 0;var b="KaTeX parse error: "+p,L,V=v&&v.loc;if(V&&V.start<=V.end){var ee=V.lexer.input;L=V.start;var pe=V.end;L===ee.length?b+=" at end of input: ":b+=" at position "+(L+1)+": ";var ye=ee.slice(L,pe).replace(/[^]/g,"$&\u0332"),De;L>15?De="\u2026"+ee.slice(L-15,L):De=ee.slice(0,L);var je;pe+15<ee.length?je=ee.slice(pe,pe+15)+"\u2026":je=ee.slice(pe),b+=De+ye+je}var Qe=new Error(b);return Qe.name="ParseError",Qe.__proto__=te.prototype,Qe.position=L,Qe};A.prototype.__proto__=Error.prototype;var d=A,U=function(p,v){return p.indexOf(v)!==-1},S=function(p,v){return p===void 0?v:p},s=/([A-Z])/g,w=function(p){return p.replace(s,"-$1").toLowerCase()},f={"&":"&",">":">","<":"<",'"':""","'":"'"},u=/[&><"']/g;function l(te){return String(te).replace(u,function(p){return f[p]})}var c=function te(p){return p.type==="ordgroup"||p.type==="color"?p.body.length===1?te(p.body[0]):p:p.type==="font"?te(p.body):p},m=function(p){var v=c(p);return v.type==="mathord"||v.type==="textord"||v.type==="atom"},C=function(p){if(!p)throw new Error("Expected non-null, but got "+String(p));return p},M=function(p){var v=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(p);return v!=null?v[1]:"_relative"},k={contains:U,deflt:S,escape:l,hyphenate:w,getBaseElem:c,isCharacterBox:m,protocolFromUrl:M},E=function(){function te(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=te.prototype;return p.reportNonstrict=function(b,L,V){var ee=this.strict;if(typeof ee=="function"&&(ee=ee(b,L,V)),!(!ee||ee==="ignore")){if(ee===!0||ee==="error")throw new d("LaTeX-incompatible input and strict mode is set to 'error': "+(L+" ["+b+"]"),V);ee==="warn"?typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(L+" ["+b+"]")):typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+ee+"': "+L+" ["+b+"]"))}},p.useStrictBehavior=function(b,L,V){var ee=this.strict;if(typeof ee=="function")try{ee=ee(b,L,V)}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': "+(L+" ["+b+"]")),!1):(typeof console!="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+ee+"': "+L+" ["+b+"]")),!1)},p.isTrusted=function(b){b.url&&!b.protocol&&(b.protocol=k.protocolFromUrl(b.url));var L=typeof this.trust=="function"?this.trust(b):this.trust;return!!L},te}(),T=function(){function te(v,b,L){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=v,this.size=b,this.cramped=L}var p=te.prototype;return p.sup=function(){return Ae[ce[this.id]]},p.sub=function(){return Ae[J[this.id]]},p.fracNum=function(){return Ae[ae[this.id]]},p.fracDen=function(){return Ae[G[this.id]]},p.cramp=function(){return Ae[X[this.id]]},p.text=function(){return Ae[Z[this.id]]},p.isTight=function(){return this.size>=2},te}(),I=0,F=1,H=2,W=3,z=4,ie=5,re=6,_e=7,Ae=[new T(I,0,!1),new T(F,0,!0),new T(H,1,!1),new T(W,1,!0),new T(z,2,!1),new T(ie,2,!0),new T(re,3,!1),new T(_e,3,!0)],ce=[z,ie,z,ie,re,_e,re,_e],J=[ie,ie,ie,ie,_e,_e,_e,_e],ae=[H,W,z,ie,re,_e,re,_e],G=[W,W,ie,ie,_e,_e,_e,_e],X=[F,F,W,W,ie,ie,_e,_e],Z=[I,F,H,W,H,W,H,W],B={DISPLAY:Ae[I],TEXT:Ae[H],SCRIPT:Ae[z],SCRIPTSCRIPT:Ae[re]},O=[{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(te){for(var p=0;p<O.length;p++)for(var v=O[p],b=0;b<v.blocks.length;b++){var L=v.blocks[b];if(te>=L[0]&&te<=L[1])return v.name}return null}var me=[];O.forEach(function(te){return te.blocks.forEach(function(p){return me.push.apply(me,p)})});function Oe(te){for(var p=0;p<me.length;p+=2)if(te>=me[p]&&te<=me[p+1])return!0;return!1}var He=80,ut=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"},it=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"},st=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"},et=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"},Nt=function(p,v,b){var L=b-54-v-p;return"M702 "+(p+v)+"H400000"+(40+p)+`
|
|
|
H742v`+L+`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"},tt=function(p,v,b){v=1e3*v;var L="";switch(p){case"sqrtMain":L=ut(v,He);break;case"sqrtSize1":L=Fe(v,He);break;case"sqrtSize2":L=it(v,He);break;case"sqrtSize3":L=st(v,He);break;case"sqrtSize4":L=et(v,He);break;case"sqrtTall":L=Nt(v,He,b)}return L},kt={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`},Ne=function(){function te(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=te.prototype;return p.hasClass=function(b){return k.contains(this.classes,b)},p.toNode=function(){for(var b=document.createDocumentFragment(),L=0;L<this.children.length;L++)b.appendChild(this.children[L].toNode());return b},p.toMarkup=function(){for(var b="",L=0;L<this.children.length;L++)b+=this.children[L].toMarkup();return b},p.toText=function(){var b=function(V){return V.toText()};return this.children.map(b).join("")},te}(),ft=function(p){return p.filter(function(v){return v}).join(" ")},Pe=function(p,v,b){if(this.classes=p||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=b||{},v){v.style.isTight()&&this.classes.push("mtight");var L=v.getColor();L&&(this.style.color=L)}},Te=function(p){var v=document.createElement(p);v.className=ft(this.classes);for(var b in this.style)this.style.hasOwnProperty(b)&&(v.style[b]=this.style[b]);for(var L in this.attributes)this.attributes.hasOwnProperty(L)&&v.setAttribute(L,this.attributes[L]);for(var V=0;V<this.children.length;V++)v.appendChild(this.children[V].toNode());return v},Se=function(p){var v="<"+p;this.classes.length&&(v+=' class="'+k.escape(ft(this.classes))+'"');var b="";for(var L in this.style)this.style.hasOwnProperty(L)&&(b+=k.hyphenate(L)+":"+this.style[L]+";");b&&(v+=' style="'+k.escape(b)+'"');for(var V in this.attributes)this.attributes.hasOwnProperty(V)&&(v+=" "+V+'="'+k.escape(this.attributes[V])+'"');v+=">";for(var ee=0;ee<this.children.length;ee++)v+=this.children[ee].toMarkup();return v+="</"+p+">",v},ze=function(){function te(v,b,L,V){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,Pe.call(this,v,L,V),this.children=b||[]}var p=te.prototype;return p.setAttribute=function(b,L){this.attributes[b]=L},p.hasClass=function(b){return k.contains(this.classes,b)},p.toNode=function(){return Te.call(this,"span")},p.toMarkup=function(){return Se.call(this,"span")},te}(),Je=function(){function te(v,b,L,V){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,Pe.call(this,b,V),this.children=L||[],this.setAttribute("href",v)}var p=te.prototype;return p.setAttribute=function(b,L){this.attributes[b]=L},p.hasClass=function(b){return k.contains(this.classes,b)},p.toNode=function(){return Te.call(this,"a")},p.toMarkup=function(){return Se.call(this,"a")},te}(),rt=function(){function te(v,b,L){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=b,this.src=v,this.classes=["mord"],this.style=L}var p=te.prototype;return p.hasClass=function(b){return k.contains(this.classes,b)},p.toNode=function(){var b=document.createElement("img");b.src=this.src,b.alt=this.alt,b.className="mord";for(var L in this.style)this.style.hasOwnProperty(L)&&(b.style[L]=this.style[L]);return b},p.toMarkup=function(){var b="<img src='"+this.src+" 'alt='"+this.alt+"' ",L="";for(var V in this.style)this.style.hasOwnProperty(V)&&(L+=k.hyphenate(V)+":"+this.style[V]+";");return L&&(b+=' style="'+k.escape(L)+'"'),b+="'/>",b},te}(),de={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"},Le=function(){function te(v,b,L,V,ee,pe,ye,De){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=b||0,this.depth=L||0,this.italic=V||0,this.skew=ee||0,this.width=pe||0,this.classes=ye||[],this.style=De||{},this.maxFontSize=0;var je=ne(this.text.charCodeAt(0));je&&this.classes.push(je+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=de[this.text])}var p=te.prototype;return p.hasClass=function(b){return k.contains(this.classes,b)},p.toNode=function(){var b=document.createTextNode(this.text),L=null;this.italic>0&&(L=document.createElement("span"),L.style.marginRight=this.italic+"em"),this.classes.length>0&&(L=L||document.createElement("span"),L.className=ft(this.classes));for(var V in this.style)this.style.hasOwnProperty(V)&&(L=L||document.createElement("span"),L.style[V]=this.style[V]);return L?(L.appendChild(b),L):b},p.toMarkup=function(){var b=!1,L="<span";this.classes.length&&(b=!0,L+=' class="',L+=k.escape(ft(this.classes)),L+='"');var V="";this.italic>0&&(V+="margin-right:"+this.italic+"em;");for(var ee in this.style)this.style.hasOwnProperty(ee)&&(V+=k.hyphenate(ee)+":"+this.style[ee]+";");V&&(b=!0,L+=' style="'+k.escape(V)+'"');var pe=k.escape(this.text);return b?(L+=">",L+=pe,L+="</span>",L):pe},te}(),We=function(){function te(v,b){this.children=void 0,this.attributes=void 0,this.children=v||[],this.attributes=b||{}}var p=te.prototype;return p.toNode=function(){var b="http://www.w3.org/2000/svg",L=document.createElementNS(b,"svg");for(var V in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,V)&&L.setAttribute(V,this.attributes[V]);for(var ee=0;ee<this.children.length;ee++)L.appendChild(this.children[ee].toNode());return L},p.toMarkup=function(){var b="<svg";for(var L in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,L)&&(b+=" "+L+"='"+this.attributes[L]+"'");b+=">";for(var V=0;V<this.children.length;V++)b+=this.children[V].toMarkup();return b+="</svg>",b},te}(),Ge=function(){function te(v,b){this.pathName=void 0,this.alternate=void 0,this.pathName=v,this.alternate=b}var p=te.prototype;return p.toNode=function(){var b="http://www.w3.org/2000/svg",L=document.createElementNS(b,"path");return this.alternate?L.setAttribute("d",this.alternate):L.setAttribute("d",kt[this.pathName]),L},p.toMarkup=function(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+kt[this.pathName]+"'/>"},te}(),Xe=function(){function te(v){this.attributes=void 0,this.attributes=v||{}}var p=te.prototype;return p.toNode=function(){var b="http://www.w3.org/2000/svg",L=document.createElementNS(b,"line");for(var V in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,V)&&L.setAttribute(V,this.attributes[V]);return L},p.toMarkup=function(){var b="<line";for(var L in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,L)&&(b+=" "+L+"='"+this.attributes[L]+"'");return b+="/>",b},te}();function gt(te){if(te instanceof Le)return te;throw new Error("Expected symbolNode but got "+String(te)+".")}function Ct(te){if(te instanceof ze)return te;throw new Error("Expected span<HtmlDomNode> but got "+String(te)+".")}var ht={"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]}},dt={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]},vt={\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 Pt(te,p){ht[te]=p}function Tt(te,p,v){if(!ht[p])throw new Error("Font metrics not found for font: "+p+".");var b=te.charCodeAt(0),L=ht[p][b];if(!L&&te[0]in vt&&(b=vt[te[0]].charCodeAt(0),L=ht[p][b]),!L&&v==="text"&&Oe(b)&&(L=ht[p][77]),L)return{depth:L[0],height:L[1],italic:L[2],skew:L[3],width:L[4]}}var xt={};function Ke(te){var p;if(te>=5?p=0:te>=3?p=1:p=2,!xt[p]){var v=xt[p]={cssEmPerMu:dt.quad[p]/18};for(var b in dt)dt.hasOwnProperty(b)&&(v[b]=dt[b][p])}return xt[p]}var St={bin:1,close:1,inner:1,open:1,punct:1,rel:1},_t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},lt={math:{},text:{}},At=lt;function $(te,p,v,b,L,V){lt[te][L]={font:p,group:v,replace:b},V&&b&&(lt[te][b]=lt[te][L])}var q="math",Be="text",oe="main",ge="ams",Lt="accent-token",Re="bin",Me="close",$e="inner",he="mathord",fe="op-token",Ee="open",Ie="punct",se="rel",ot="spacing",ve="textord";$(q,oe,se,"\u2261","\\equiv",!0),$(q,oe,se,"\u227A","\\prec",!0),$(q,oe,se,"\u227B","\\succ",!0),$(q,oe,se,"\u223C","\\sim",!0),$(q,oe,se,"\u22A5","\\perp"),$(q,oe,se,"\u2AAF","\\preceq",!0),$(q,oe,se,"\u2AB0","\\succeq",!0),$(q,oe,se,"\u2243","\\simeq",!0),$(q,oe,se,"\u2223","\\mid",!0),$(q,oe,se,"\u226A","\\ll",!0),$(q,oe,se,"\u226B","\\gg",!0),$(q,oe,se,"\u224D","\\asymp",!0),$(q,oe,se,"\u2225","\\parallel"),$(q,oe,se,"\u22C8","\\bowtie",!0),$(q,oe,se,"\u2323","\\smile",!0),$(q,oe,se,"\u2291","\\sqsubseteq",!0),$(q,oe,se,"\u2292","\\sqsupseteq",!0),$(q,oe,se,"\u2250","\\doteq",!0),$(q,oe,se,"\u2322","\\frown",!0),$(q,oe,se,"\u220B","\\ni",!0),$(q,oe,se,"\u221D","\\propto",!0),$(q,oe,se,"\u22A2","\\vdash",!0),$(q,oe,se,"\u22A3","\\dashv",!0),$(q,oe,se,"\u220B","\\owns"),$(q,oe,Ie,".","\\ldotp"),$(q,oe,Ie,"\u22C5","\\cdotp"),$(q,oe,ve,"#","\\#"),$(Be,oe,ve,"#","\\#"),$(q,oe,ve,"&","\\&"),$(Be,oe,ve,"&","\\&"),$(q,oe,ve,"\u2135","\\aleph",!0),$(q,oe,ve,"\u2200","\\forall",!0),$(q,oe,ve,"\u210F","\\hbar",!0),$(q,oe,ve,"\u2203","\\exists",!0),$(q,oe,ve,"\u2207","\\nabla",!0),$(q,oe,ve,"\u266D","\\flat",!0),$(q,oe,ve,"\u2113","\\ell",!0),$(q,oe,ve,"\u266E","\\natural",!0),$(q,oe,ve,"\u2663","\\clubsuit",!0),$(q,oe,ve,"\u2118","\\wp",!0),$(q,oe,ve,"\u266F","\\sharp",!0),$(q,oe,ve,"\u2662","\\diamondsuit",!0),$(q,oe,ve,"\u211C","\\Re",!0),$(q,oe,ve,"\u2661","\\heartsuit",!0),$(q,oe,ve,"\u2111","\\Im",!0),$(q,oe,ve,"\u2660","\\spadesuit",!0),$(Be,oe,ve,"\xA7","\\S",!0),$(Be,oe,ve,"\xB6","\\P",!0),$(q,oe,ve,"\u2020","\\dag"),$(Be,oe,ve,"\u2020","\\dag"),$(Be,oe,ve,"\u2020","\\textdagger"),$(q,oe,ve,"\u2021","\\ddag"),$(Be,oe,ve,"\u2021","\\ddag"),$(Be,oe,ve,"\u2021","\\textdaggerdbl"),$(q,oe,Me,"\u23B1","\\rmoustache",!0),$(q,oe,Ee,"\u23B0","\\lmoustache",!0),$(q,oe,Me,"\u27EF","\\rgroup",!0),$(q,oe,Ee,"\u27EE","\\lgroup",!0),$(q,oe,Re,"\u2213","\\mp",!0),$(q,oe,Re,"\u2296","\\ominus",!0),$(q,oe,Re,"\u228E","\\uplus",!0),$(q,oe,Re,"\u2293","\\sqcap",!0),$(q,oe,Re,"\u2217","\\ast"),$(q,oe,Re,"\u2294","\\sqcup",!0),$(q,oe,Re,"\u25EF","\\bigcirc"),$(q,oe,Re,"\u2219","\\bullet"),$(q,oe,Re,"\u2021","\\ddagger"),$(q,oe,Re,"\u2240","\\wr",!0),$(q,oe,Re,"\u2A3F","\\amalg"),$(q,oe,Re,"&","\\And"),$(q,oe,se,"\u27F5","\\longleftarrow",!0),$(q,oe,se,"\u21D0","\\Leftarrow",!0),$(q,oe,se,"\u27F8","\\Longleftarrow",!0),$(q,oe,se,"\u27F6","\\longrightarrow",!0),$(q,oe,se,"\u21D2","\\Rightarrow",!0),$(q,oe,se,"\u27F9","\\Longrightarrow",!0),$(q,oe,se,"\u2194","\\leftrightarrow",!0),$(q,oe,se,"\u27F7","\\longleftrightarrow",!0),$(q,oe,se,"\u21D4","\\Leftrightarrow",!0),$(q,oe,se,"\u27FA","\\Longleftrightarrow",!0),$(q,oe,se,"\u21A6","\\mapsto",!0),$(q,oe,se,"\u27FC","\\longmapsto",!0),$(q,oe,se,"\u2197","\\nearrow",!0),$(q,oe,se,"\u21A9","\\hookleftarrow",!0),$(q,oe,se,"\u21AA","\\hookrightarrow",!0),$(q,oe,se,"\u2198","\\searrow",!0),$(q,oe,se,"\u21BC","\\leftharpoonup",!0),$(q,oe,se,"\u21C0","\\rightharpoonup",!0),$(q,oe,se,"\u2199","\\swarrow",!0),$(q,oe,se,"\u21BD","\\leftharpoondown",!0),$(q,oe,se,"\u21C1","\\rightharpoondown",!0),$(q,oe,se,"\u2196","\\nwarrow",!0),$(q,oe,se,"\u21CC","\\rightleftharpoons",!0),$(q,ge,se,"\u226E","\\nless",!0),$(q,ge,se,"\uE010","\\@nleqslant"),$(q,ge,se,"\uE011","\\@nleqq"),$(q,ge,se,"\u2A87","\\lneq",!0),$(q,ge,se,"\u2268","\\lneqq",!0),$(q,ge,se,"\uE00C","\\@lvertneqq"),$(q,ge,se,"\u22E6","\\lnsim",!0),$(q,ge,se,"\u2A89","\\lnapprox",!0),$(q,ge,se,"\u2280","\\nprec",!0),$(q,ge,se,"\u22E0","\\npreceq",!0),$(q,ge,se,"\u22E8","\\precnsim",!0),$(q,ge,se,"\u2AB9","\\precnapprox",!0),$(q,ge,se,"\u2241","\\nsim",!0),$(q,ge,se,"\uE006","\\@nshortmid"),$(q,ge,se,"\u2224","\\nmid",!0),$(q,ge,se,"\u22AC","\\nvdash",!0),$(q,ge,se,"\u22AD","\\nvDash",!0),$(q,ge,se,"\u22EA","\\ntriangleleft"),$(q,ge,se,"\u22EC","\\ntrianglelefteq",!0),$(q,ge,se,"\u228A","\\subsetneq",!0),$(q,ge,se,"\uE01A","\\@varsubsetneq"),$(q,ge,se,"\u2ACB","\\subsetneqq",!0),$(q,ge,se,"\uE017","\\@varsubsetneqq"),$(q,ge,se,"\u226F","\\ngtr",!0),$(q,ge,se,"\uE00F","\\@ngeqslant"),$(q,ge,se,"\uE00E","\\@ngeqq"),$(q,ge,se,"\u2A88","\\gneq",!0),$(q,ge,se,"\u2269","\\gneqq",!0),$(q,ge,se,"\uE00D","\\@gvertneqq"),$(q,ge,se,"\u22E7","\\gnsim",!0),$(q,ge,se,"\u2A8A","\\gnapprox",!0),$(q,ge,se,"\u2281","\\nsucc",!0),$(q,ge,se,"\u22E1","\\nsucceq",!0),$(q,ge,se,"\u22E9","\\succnsim",!0),$(q,ge,se,"\u2ABA","\\succnapprox",!0),$(q,ge,se,"\u2246","\\ncong",!0),$(q,ge,se,"\uE007","\\@nshortparallel"),$(q,ge,se,"\u2226","\\nparallel",!0),$(q,ge,se,"\u22AF","\\nVDash",!0),$(q,ge,se,"\u22EB","\\ntriangleright"),$(q,ge,se,"\u22ED","\\ntrianglerighteq",!0),$(q,ge,se,"\uE018","\\@nsupseteqq"),$(q,ge,se,"\u228B","\\supsetneq",!0),$(q,ge,se,"\uE01B","\\@varsupsetneq"),$(q,ge,se,"\u2ACC","\\supsetneqq",!0),$(q,ge,se,"\uE019","\\@varsupsetneqq"),$(q,ge,se,"\u22AE","\\nVdash",!0),$(q,ge,se,"\u2AB5","\\precneqq",!0),$(q,ge,se,"\u2AB6","\\succneqq",!0),$(q,ge,se,"\uE016","\\@nsubseteqq"),$(q,ge,Re,"\u22B4","\\unlhd"),$(q,ge,Re,"\u22B5","\\unrhd"),$(q,ge,se,"\u219A","\\nleftarrow",!0),$(q,ge,se,"\u219B","\\nrightarrow",!0),$(q,ge,se,"\u21CD","\\nLeftarrow",!0),$(q,ge,se,"\u21CF","\\nRightarrow",!0),$(q,ge,se,"\u21AE","\\nleftrightarrow",!0),$(q,ge,se,"\u21CE","\\nLeftrightarrow",!0),$(q,ge,se,"\u25B3","\\vartriangle"),$(q,ge,ve,"\u210F","\\hslash"),$(q,ge,ve,"\u25BD","\\triangledown"),$(q,ge,ve,"\u25CA","\\lozenge"),$(q,ge,ve,"\u24C8","\\circledS"),$(q,ge,ve,"\xAE","\\circledR"),$(Be,ge,ve,"\xAE","\\circledR"),$(q,ge,ve,"\u2221","\\measuredangle",!0),$(q,ge,ve,"\u2204","\\nexists"),$(q,ge,ve,"\u2127","\\mho"),$(q,ge,ve,"\u2132","\\Finv",!0),$(q,ge,ve,"\u2141","\\Game",!0),$(q,ge,ve,"\u2035","\\backprime"),$(q,ge,ve,"\u25B2","\\blacktriangle"),$(q,ge,ve,"\u25BC","\\blacktriangledown"),$(q,ge,ve,"\u25A0","\\blacksquare"),$(q,ge,ve,"\u29EB","\\blacklozenge"),$(q,ge,ve,"\u2605","\\bigstar"),$(q,ge,ve,"\u2222","\\sphericalangle",!0),$(q,ge,ve,"\u2201","\\complement",!0),$(q,ge,ve,"\xF0","\\eth",!0),$(q,ge,ve,"\u2571","\\diagup"),$(q,ge,ve,"\u2572","\\diagdown"),$(q,ge,ve,"\u25A1","\\square"),$(q,ge,ve,"\u25A1","\\Box"),$(q,ge,ve,"\u25CA","\\Diamond"),$(q,ge,ve,"\xA5","\\yen",!0),$(Be,ge,ve,"\xA5","\\yen",!0),$(q,ge,ve,"\u2713","\\checkmark",!0),$(Be,ge,ve,"\u2713","\\checkmark"),$(q,ge,ve,"\u2136","\\beth",!0),$(q,ge,ve,"\u2138","\\daleth",!0),$(q,ge,ve,"\u2137","\\gimel",!0),$(q,ge,ve,"\u03DD","\\digamma",!0),$(q,ge,ve,"\u03F0","\\varkappa"),$(q,ge,Ee,"\u250C","\\ulcorner",!0),$(q,ge,Me,"\u2510","\\urcorner",!0),$(q,ge,Ee,"\u2514","\\llcorner",!0),$(q,ge,Me,"\u2518","\\lrcorner",!0),$(q,ge,se,"\u2266","\\leqq",!0),$(q,ge,se,"\u2A7D","\\leqslant",!0),$(q,ge,se,"\u2A95","\\eqslantless",!0),$(q,ge,se,"\u2272","\\lesssim",!0),$(q,ge,se,"\u2A85","\\lessapprox",!0),$(q,ge,se,"\u224A","\\approxeq",!0),$(q,ge,Re,"\u22D6","\\lessdot"),$(q,ge,se,"\u22D8","\\lll",!0),$(q,ge,se,"\u2276","\\lessgtr",!0),$(q,ge,se,"\u22DA","\\lesseqgtr",!0),$(q,ge,se,"\u2A8B","\\lesseqqgtr",!0),$(q,ge,se,"\u2251","\\doteqdot"),$(q,ge,se,"\u2253","\\risingdotseq",!0),$(q,ge,se,"\u2252","\\fallingdotseq",!0),$(q,ge,se,"\u223D","\\backsim",!0),$(q,ge,se,"\u22CD","\\backsimeq",!0),$(q,ge,se,"\u2AC5","\\subseteqq",!0),$(q,ge,se,"\u22D0","\\Subset",!0),$(q,ge,se,"\u228F","\\sqsubset",!0),$(q,ge,se,"\u227C","\\preccurlyeq",!0),$(q,ge,se,"\u22DE","\\curlyeqprec",!0),$(q,ge,se,"\u227E","\\precsim",!0),$(q,ge,se,"\u2AB7","\\precapprox",!0),$(q,ge,se,"\u22B2","\\vartriangleleft"),$(q,ge,se,"\u22B4","\\trianglelefteq"),$(q,ge,se,"\u22A8","\\vDash",!0),$(q,ge,se,"\u22AA","\\Vvdash",!0),$(q,ge,se,"\u2323","\\smallsmile"),$(q,ge,se,"\u2322","\\smallfrown"),$(q,ge,se,"\u224F","\\bumpeq",!0),$(q,ge,se,"\u224E","\\Bumpeq",!0),$(q,ge,se,"\u2267","\\geqq",!0),$(q,ge,se,"\u2A7E","\\geqslant",!0),$(q,ge,se,"\u2A96","\\eqslantgtr",!0),$(q,ge,se,"\u2273","\\gtrsim",!0),$(q,ge,se,"\u2A86","\\gtrapprox",!0),$(q,ge,Re,"\u22D7","\\gtrdot"),$(q,ge,se,"\u22D9","\\ggg",!0),$(q,ge,se,"\u2277","\\gtrless",!0),$(q,ge,se,"\u22DB","\\gtreqless",!0),$(q,ge,se,"\u2A8C","\\gtreqqless",!0),$(q,ge,se,"\u2256","\\eqcirc",!0),$(q,ge,se,"\u2257","\\circeq",!0),$(q,ge,se,"\u225C","\\triangleq",!0),$(q,ge,se,"\u223C","\\thicksim"),$(q,ge,se,"\u2248","\\thickapprox"),$(q,ge,se,"\u2AC6","\\supseteqq",!0),$(q,ge,se,"\u22D1","\\Supset",!0),$(q,ge,se,"\u2290","\\sqsupset",!0),$(q,ge,se,"\u227D","\\succcurlyeq",!0),$(q,ge,se,"\u22DF","\\curlyeqsucc",!0),$(q,ge,se,"\u227F","\\succsim",!0),$(q,ge,se,"\u2AB8","\\succapprox",!0),$(q,ge,se,"\u22B3","\\vartriangleright"),$(q,ge,se,"\u22B5","\\trianglerighteq"),$(q,ge,se,"\u22A9","\\Vdash",!0),$(q,ge,se,"\u2223","\\shortmid"),$(q,ge,se,"\u2225","\\shortparallel"),$(q,ge,se,"\u226C","\\between",!0),$(q,ge,se,"\u22D4","\\pitchfork",!0),$(q,ge,se,"\u221D","\\varpropto"),$(q,ge,se,"\u25C0","\\blacktriangleleft"),$(q,ge,se,"\u2234","\\therefore",!0),$(q,ge,se,"\u220D","\\backepsilon"),$(q,ge,se,"\u25B6","\\blacktriangleright"),$(q,ge,se,"\u2235","\\because",!0),$(q,ge,se,"\u22D8","\\llless"),$(q,ge,se,"\u22D9","\\gggtr"),$(q,ge,Re,"\u22B2","\\lhd"),$(q,ge,Re,"\u22B3","\\rhd"),$(q,ge,se,"\u2242","\\eqsim",!0),$(q,oe,se,"\u22C8","\\Join"),$(q,ge,se,"\u2251","\\Doteq",!0),$(q,ge,Re,"\u2214","\\dotplus",!0),$(q,ge,Re,"\u2216","\\smallsetminus"),$(q,ge,Re,"\u22D2","\\Cap",!0),$(q,ge,Re,"\u22D3","\\Cup",!0),$(q,ge,Re,"\u2A5E","\\doublebarwedge",!0),$(q,ge,Re,"\u229F","\\boxminus",!0),$(q,ge,Re,"\u229E","\\boxplus",!0),$(q,ge,Re,"\u22C7","\\divideontimes",!0),$(q,ge,Re,"\u22C9","\\ltimes",!0),$(q,ge,Re,"\u22CA","\\rtimes",!0),$(q,ge,Re,"\u22CB","\\leftthreetimes",!0),$(q,ge,Re,"\u22CC","\\rightthreetimes",!0),$(q,ge,Re,"\u22CF","\\curlywedge",!0),$(q,ge,Re,"\u22CE","\\curlyvee",!0),$(q,ge,Re,"\u229D","\\circleddash",!0),$(q,ge,Re,"\u229B","\\circledast",!0),$(q,ge,Re,"\u22C5","\\centerdot"),$(q,ge,Re,"\u22BA","\\intercal",!0),$(q,ge,Re,"\u22D2","\\doublecap"),$(q,ge,Re,"\u22D3","\\doublecup"),$(q,ge,Re,"\u22A0","\\boxtimes",!0),$(q,ge,se,"\u21E2","\\dashrightarrow",!0),$(q,ge,se,"\u21E0","\\dashleftarrow",!0),$(q,ge,se,"\u21C7","\\leftleftarrows",!0),$(q,ge,se,"\u21C6","\\leftrightarrows",!0),$(q,ge,se,"\u21DA","\\Lleftarrow",!0),$(q,ge,se,"\u219E","\\twoheadleftarrow",!0),$(q,ge,se,"\u21A2","\\leftarrowtail",!0),$(q,ge,se,"\u21AB","\\looparrowleft",!0),$(q,ge,se,"\u21CB","\\leftrightharpoons",!0),$(q,ge,se,"\u21B6","\\curvearrowleft",!0),$(q,ge,se,"\u21BA","\\circlearrowleft",!0),$(q,ge,se,"\u21B0","\\Lsh",!0),$(q,ge,se,"\u21C8","\\upuparrows",!0),$(q,ge,se,"\u21BF","\\upharpoonleft",!0),$(q,ge,se,"\u21C3","\\downharpoonleft",!0),$(q,ge,se,"\u22B8","\\multimap",!0),$(q,ge,se,"\u21AD","\\leftrightsquigarrow",!0),$(q,ge,se,"\u21C9","\\rightrightarrows",!0),$(q,ge,se,"\u21C4","\\rightleftarrows",!0),$(q,ge,se,"\u21A0","\\twoheadrightarrow",!0),$(q,ge,se,"\u21A3","\\rightarrowtail",!0),$(q,ge,se,"\u21AC","\\looparrowright",!0),$(q,ge,se,"\u21B7","\\curvearrowright",!0),$(q,ge,se,"\u21BB","\\circlearrowright",!0),$(q,ge,se,"\u21B1","\\Rsh",!0),$(q,ge,se,"\u21CA","\\downdownarrows",!0),$(q,ge,se,"\u21BE","\\upharpoonright",!0),$(q,ge,se,"\u21C2","\\downharpoonright",!0),$(q,ge,se,"\u21DD","\\rightsquigarrow",!0),$(q,ge,se,"\u21DD","\\leadsto"),$(q,ge,se,"\u21DB","\\Rrightarrow",!0),$(q,ge,se,"\u21BE","\\restriction"),$(q,oe,ve,"\u2018","`"),$(q,oe,ve,"$","\\$"),$(Be,oe,ve,"$","\\$"),$(Be,oe,ve,"$","\\textdollar"),$(q,oe,ve,"%","\\%"),$(Be,oe,ve,"%","\\%"),$(q,oe,ve,"_","\\_"),$(Be,oe,ve,"_","\\_"),$(Be,oe,ve,"_","\\textunderscore"),$(q,oe,ve,"\u2220","\\angle",!0),$(q,oe,ve,"\u221E","\\infty",!0),$(q,oe,ve,"\u2032","\\prime"),$(q,oe,ve,"\u25B3","\\triangle"),$(q,oe,ve,"\u0393","\\Gamma",!0),$(q,oe,ve,"\u0394","\\Delta",!0),$(q,oe,ve,"\u0398","\\Theta",!0),$(q,oe,ve,"\u039B","\\Lambda",!0),$(q,oe,ve,"\u039E","\\Xi",!0),$(q,oe,ve,"\u03A0","\\Pi",!0),$(q,oe,ve,"\u03A3","\\Sigma",!0),$(q,oe,ve,"\u03A5","\\Upsilon",!0),$(q,oe,ve,"\u03A6","\\Phi",!0),$(q,oe,ve,"\u03A8","\\Psi",!0),$(q,oe,ve,"\u03A9","\\Omega",!0),$(q,oe,ve,"A","\u0391"),$(q,oe,ve,"B","\u0392"),$(q,oe,ve,"E","\u0395"),$(q,oe,ve,"Z","\u0396"),$(q,oe,ve,"H","\u0397"),$(q,oe,ve,"I","\u0399"),$(q,oe,ve,"K","\u039A"),$(q,oe,ve,"M","\u039C"),$(q,oe,ve,"N","\u039D"),$(q,oe,ve,"O","\u039F"),$(q,oe,ve,"P","\u03A1"),$(q,oe,ve,"T","\u03A4"),$(q,oe,ve,"X","\u03A7"),$(q,oe,ve,"\xAC","\\neg",!0),$(q,oe,ve,"\xAC","\\lnot"),$(q,oe,ve,"\u22A4","\\top"),$(q,oe,ve,"\u22A5","\\bot"),$(q,oe,ve,"\u2205","\\emptyset"),$(q,ge,ve,"\u2205","\\varnothing"),$(q,oe,he,"\u03B1","\\alpha",!0),$(q,oe,he,"\u03B2","\\beta",!0),$(q,oe,he,"\u03B3","\\gamma",!0),$(q,oe,he,"\u03B4","\\delta",!0),$(q,oe,he,"\u03F5","\\epsilon",!0),$(q,oe,he,"\u03B6","\\zeta",!0),$(q,oe,he,"\u03B7","\\eta",!0),$(q,oe,he,"\u03B8","\\theta",!0),$(q,oe,he,"\u03B9","\\iota",!0),$(q,oe,he,"\u03BA","\\kappa",!0),$(q,oe,he,"\u03BB","\\lambda",!0),$(q,oe,he,"\u03BC","\\mu",!0),$(q,oe,he,"\u03BD","\\nu",!0),$(q,oe,he,"\u03BE","\\xi",!0),$(q,oe,he,"\u03BF","\\omicron",!0),$(q,oe,he,"\u03C0","\\pi",!0),$(q,oe,he,"\u03C1","\\rho",!0),$(q,oe,he,"\u03C3","\\sigma",!0),$(q,oe,he,"\u03C4","\\tau",!0),$(q,oe,he,"\u03C5","\\upsilon",!0),$(q,oe,he,"\u03D5","\\phi",!0),$(q,oe,he,"\u03C7","\\chi",!0),$(q,oe,he,"\u03C8","\\psi",!0),$(q,oe,he,"\u03C9","\\omega",!0),$(q,oe,he,"\u03B5","\\varepsilon",!0),$(q,oe,he,"\u03D1","\\vartheta",!0),$(q,oe,he,"\u03D6","\\varpi",!0),$(q,oe,he,"\u03F1","\\varrho",!0),$(q,oe,he,"\u03C2","\\varsigma",!0),$(q,oe,he,"\u03C6","\\varphi",!0),$(q,oe,Re,"\u2217","*"),$(q,oe,Re,"+","+"),$(q,oe,Re,"\u2212","-"),$(q,oe,Re,"\u22C5","\\cdot",!0),$(q,oe,Re,"\u2218","\\circ"),$(q,oe,Re,"\xF7","\\div",!0),$(q,oe,Re,"\xB1","\\pm",!0),$(q,oe,Re,"\xD7","\\times",!0),$(q,oe,Re,"\u2229","\\cap",!0),$(q,oe,Re,"\u222A","\\cup",!0),$(q,oe,Re,"\u2216","\\setminus"),$(q,oe,Re,"\u2227","\\land"),$(q,oe,Re,"\u2228","\\lor"),$(q,oe,Re,"\u2227","\\wedge",!0),$(q,oe,Re,"\u2228","\\vee",!0),$(q,oe,ve,"\u221A","\\surd"),$(q,oe,Ee,"(","("),$(q,oe,Ee,"[","["),$(q,oe,Ee,"\u27E8","\\langle",!0),$(q,oe,Ee,"\u2223","\\lvert"),$(q,oe,Ee,"\u2225","\\lVert"),$(q,oe,Me,")",")"),$(q,oe,Me,"]","]"),$(q,oe,Me,"?","?"),$(q,oe,Me,"!","!"),$(q,oe,Me,"\u27E9","\\rangle",!0),$(q,oe,Me,"\u2223","\\rvert"),$(q,oe,Me,"\u2225","\\rVert"),$(q,oe,se,"=","="),$(q,oe,se,"<","<"),$(q,oe,se,">",">"),$(q,oe,se,":",":"),$(q,oe,se,"\u2248","\\approx",!0),$(q,oe,se,"\u2245","\\cong",!0),$(q,oe,se,"\u2265","\\ge"),$(q,oe,se,"\u2265","\\geq",!0),$(q,oe,se,"\u2190","\\gets"),$(q,oe,se,">","\\gt"),$(q,oe,se,"\u2208","\\in",!0),$(q,oe,se,"\uE020","\\@not"),$(q,oe,se,"\u2282","\\subset",!0),$(q,oe,se,"\u2283","\\supset",!0),$(q,oe,se,"\u2286","\\subseteq",!0),$(q,oe,se,"\u2287","\\supseteq",!0),$(q,ge,se,"\u2288","\\nsubseteq",!0),$(q,ge,se,"\u2289","\\nsupseteq",!0),$(q,oe,se,"\u22A8","\\models"),$(q,oe,se,"\u2190","\\leftarrow",!0),$(q,oe,se,"\u2264","\\le"),$(q,oe,se,"\u2264","\\leq",!0),$(q,oe,se,"<","\\lt"),$(q,oe,se,"\u2192","\\rightarrow",!0),$(q,oe,se,"\u2192","\\to"),$(q,ge,se,"\u2271","\\ngeq",!0),$(q,ge,se,"\u2270","\\nleq",!0),$(q,oe,ot,"\xA0","\\ "),$(q,oe,ot,"\xA0","~"),$(q,oe,ot,"\xA0","\\space"),$(q,oe,ot,"\xA0","\\nobreakspace"),$(Be,oe,ot,"\xA0","\\ "),$(Be,oe,ot,"\xA0","~"),$(Be,oe,ot,"\xA0","\\space"),$(Be,oe,ot,"\xA0","\\nobreakspace"),$(q,oe,ot,null,"\\nobreak"),$(q,oe,ot,null,"\\allowbreak"),$(q,oe,Ie,",",","),$(q,oe,Ie,";",";"),$(q,ge,Re,"\u22BC","\\barwedge",!0),$(q,ge,Re,"\u22BB","\\veebar",!0),$(q,oe,Re,"\u2299","\\odot",!0),$(q,oe,Re,"\u2295","\\oplus",!0),$(q,oe,Re,"\u2297","\\otimes",!0),$(q,oe,ve,"\u2202","\\partial",!0),$(q,oe,Re,"\u2298","\\oslash",!0),$(q,ge,Re,"\u229A","\\circledcirc",!0),$(q,ge,Re,"\u22A1","\\boxdot",!0),$(q,oe,Re,"\u25B3","\\bigtriangleup"),$(q,oe,Re,"\u25BD","\\bigtriangledown"),$(q,oe,Re,"\u2020","\\dagger"),$(q,oe,Re,"\u22C4","\\diamond"),$(q,oe,Re,"\u22C6","\\star"),$(q,oe,Re,"\u25C3","\\triangleleft"),$(q,oe,Re,"\u25B9","\\triangleright"),$(q,oe,Ee,"{","\\{"),$(Be,oe,ve,"{","\\{"),$(Be,oe,ve,"{","\\textbraceleft"),$(q,oe,Me,"}","\\}"),$(Be,oe,ve,"}","\\}"),$(Be,oe,ve,"}","\\textbraceright"),$(q,oe,Ee,"{","\\lbrace"),$(q,oe,Me,"}","\\rbrace"),$(q,oe,Ee,"[","\\lbrack"),$(Be,oe,ve,"[","\\lbrack"),$(q,oe,Me,"]","\\rbrack"),$(Be,oe,ve,"]","\\rbrack"),$(q,oe,Ee,"(","\\lparen"),$(q,oe,Me,")","\\rparen"),$(Be,oe,ve,"<","\\textless"),$(Be,oe,ve,">","\\textgreater"),$(q,oe,Ee,"\u230A","\\lfloor",!0),$(q,oe,Me,"\u230B","\\rfloor",!0),$(q,oe,Ee,"\u2308","\\lceil",!0),$(q,oe,Me,"\u2309","\\rceil",!0),$(q,oe,ve,"\\","\\backslash"),$(q,oe,ve,"\u2223","|"),$(q,oe,ve,"\u2223","\\vert"),$(Be,oe,ve,"|","\\textbar"),$(q,oe,ve,"\u2225","\\|"),$(q,oe,ve,"\u2225","\\Vert"),$(Be,oe,ve,"\u2225","\\textbardbl"),$(Be,oe,ve,"~","\\textasciitilde"),$(Be,oe,ve,"\\","\\textbackslash"),$(Be,oe,ve,"^","\\textasciicircum"),$(q,oe,se,"\u2191","\\uparrow",!0),$(q,oe,se,"\u21D1","\\Uparrow",!0),$(q,oe,se,"\u2193","\\downarrow",!0),$(q,oe,se,"\u21D3","\\Downarrow",!0),$(q,oe,se,"\u2195","\\updownarrow",!0),$(q,oe,se,"\u21D5","\\Updownarrow",!0),$(q,oe,fe,"\u2210","\\coprod"),$(q,oe,fe,"\u22C1","\\bigvee"),$(q,oe,fe,"\u22C0","\\bigwedge"),$(q,oe,fe,"\u2A04","\\biguplus"),$(q,oe,fe,"\u22C2","\\bigcap"),$(q,oe,fe,"\u22C3","\\bigcup"),$(q,oe,fe,"\u222B","\\int"),$(q,oe,fe,"\u222B","\\intop"),$(q,oe,fe,"\u222C","\\iint"),$(q,oe,fe,"\u222D","\\iiint"),$(q,oe,fe,"\u220F","\\prod"),$(q,oe,fe,"\u2211","\\sum"),$(q,oe,fe,"\u2A02","\\bigotimes"),$(q,oe,fe,"\u2A01","\\bigoplus"),$(q,oe,fe,"\u2A00","\\bigodot"),$(q,oe,fe,"\u222E","\\oint"),$(q,oe,fe,"\u222F","\\oiint"),$(q,oe,fe,"\u2230","\\oiiint"),$(q,oe,fe,"\u2A06","\\bigsqcup"),$(q,oe,fe,"\u222B","\\smallint"),$(Be,oe,$e,"\u2026","\\textellipsis"),$(q,oe,$e,"\u2026","\\mathellipsis"),$(Be,oe,$e,"\u2026","\\ldots",!0),$(q,oe,$e,"\u2026","\\ldots",!0),$(q,oe,$e,"\u22EF","\\@cdots",!0),$(q,oe,$e,"\u22F1","\\ddots",!0),$(q,oe,ve,"\u22EE","\\varvdots"),$(q,oe,Lt,"\u02CA","\\acute"),$(q,oe,Lt,"\u02CB","\\grave"),$(q,oe,Lt,"\xA8","\\ddot"),$(q,oe,Lt,"~","\\tilde"),$(q,oe,Lt,"\u02C9","\\bar"),$(q,oe,Lt,"\u02D8","\\breve"),$(q,oe,Lt,"\u02C7","\\check"),$(q,oe,Lt,"^","\\hat"),$(q,oe,Lt,"\u20D7","\\vec"),$(q,oe,Lt,"\u02D9","\\dot"),$(q,oe,Lt,"\u02DA","\\mathring"),$(q,oe,he,"\u0131","\\imath",!0),$(q,oe,he,"\u0237","\\jmath",!0),$(Be,oe,ve,"\u0131","\\i",!0),$(Be,oe,ve,"\u0237","\\j",!0),$(Be,oe,ve,"\xDF","\\ss",!0),$(Be,oe,ve,"\xE6","\\ae",!0),$(Be,oe,ve,"\xE6","\\ae",!0),$(Be,oe,ve,"\u0153","\\oe",!0),$(Be,oe,ve,"\xF8","\\o",!0),$(Be,oe,ve,"\xC6","\\AE",!0),$(Be,oe,ve,"\u0152","\\OE",!0),$(Be,oe,ve,"\xD8","\\O",!0),$(Be,oe,Lt,"\u02CA","\\'"),$(Be,oe,Lt,"\u02CB","\\`"),$(Be,oe,Lt,"\u02C6","\\^"),$(Be,oe,Lt,"\u02DC","\\~"),$(Be,oe,Lt,"\u02C9","\\="),$(Be,oe,Lt,"\u02D8","\\u"),$(Be,oe,Lt,"\u02D9","\\."),$(Be,oe,Lt,"\u02DA","\\r"),$(Be,oe,Lt,"\u02C7","\\v"),$(Be,oe,Lt,"\xA8",'\\"'),$(Be,oe,Lt,"\u02DD","\\H"),$(Be,oe,Lt,"\u25EF","\\textcircled");var Rt={"--":!0,"---":!0,"``":!0,"''":!0};$(Be,oe,ve,"\u2013","--"),$(Be,oe,ve,"\u2013","\\textendash"),$(Be,oe,ve,"\u2014","---"),$(Be,oe,ve,"\u2014","\\textemdash"),$(Be,oe,ve,"\u2018","`"),$(Be,oe,ve,"\u2018","\\textquoteleft"),$(Be,oe,ve,"\u2019","'"),$(Be,oe,ve,"\u2019","\\textquoteright"),$(Be,oe,ve,"\u201C","``"),$(Be,oe,ve,"\u201C","\\textquotedblleft"),$(Be,oe,ve,"\u201D","''"),$(Be,oe,ve,"\u201D","\\textquotedblright"),$(q,oe,ve,"\xB0","\\degree",!0),$(Be,oe,ve,"\xB0","\\degree"),$(Be,oe,ve,"\xB0","\\textdegree",!0),$(q,oe,he,"\xA3","\\pounds"),$(q,oe,he,"\xA3","\\mathsterling",!0),$(Be,oe,he,"\xA3","\\pounds"),$(Be,oe,he,"\xA3","\\textsterling",!0),$(q,ge,ve,"\u2720","\\maltese"),$(Be,ge,ve,"\u2720","\\maltese"),$(Be,oe,ot,"\xA0","\\ "),$(Be,oe,ot,"\xA0"," "),$(Be,oe,ot,"\xA0","~");for(var Bt='0123456789/@."',zt=0;zt<Bt.length;zt++){var Cr=Bt.charAt(zt);$(q,oe,ve,Cr,Cr)}for(var ar='0123456789!@*()-=+[]<>|";:?/.,',qt=0;qt<ar.length;qt++){var Dr=ar.charAt(qt);$(Be,oe,ve,Dr,Dr)}for(var Hr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",pr=0;pr<Hr.length;pr++){var gr=Hr.charAt(pr);$(q,oe,he,gr,gr),$(Be,oe,ve,gr,gr)}$(q,ge,ve,"C","\u2102"),$(Be,ge,ve,"C","\u2102"),$(q,ge,ve,"H","\u210D"),$(Be,ge,ve,"H","\u210D"),$(q,ge,ve,"N","\u2115"),$(Be,ge,ve,"N","\u2115"),$(q,ge,ve,"P","\u2119"),$(Be,ge,ve,"P","\u2119"),$(q,ge,ve,"Q","\u211A"),$(Be,ge,ve,"Q","\u211A"),$(q,ge,ve,"R","\u211D"),$(Be,ge,ve,"R","\u211D"),$(q,ge,ve,"Z","\u2124"),$(Be,ge,ve,"Z","\u2124"),$(q,oe,he,"h","\u210E"),$(Be,oe,he,"h","\u210E");for(var Mt="",yt=0;yt<Hr.length;yt++){var bt=Hr.charAt(yt);Mt=String.fromCharCode(55349,56320+yt),$(q,oe,he,bt,Mt),$(Be,oe,ve,bt,Mt),Mt=String.fromCharCode(55349,56372+yt),$(q,oe,he,bt,Mt),$(Be,oe,ve,bt,Mt),Mt=String.fromCharCode(55349,56424+yt),$(q,oe,he,bt,Mt),$(Be,oe,ve,bt,Mt),Mt=String.fromCharCode(55349,56580+yt),$(q,oe,he,bt,Mt),$(Be,oe,ve,bt,Mt),Mt=String.fromCharCode(55349,56736+yt),$(q,oe,he,bt,Mt),$(Be,oe,ve,bt,Mt),Mt=String.fromCharCode(55349,56788+yt),$(q,oe,he,bt,Mt),$(Be,oe,ve,bt,Mt),Mt=String.fromCharCode(55349,56840+yt),$(q,oe,he,bt,Mt),$(Be,oe,ve,bt,Mt),Mt=String.fromCharCode(55349,56944+yt),$(q,oe,he,bt,Mt),$(Be,oe,ve,bt,Mt),yt<26&&(Mt=String.fromCharCode(55349,56632+yt),$(q,oe,he,bt,Mt),$(Be,oe,ve,bt,Mt),Mt=String.fromCharCode(55349,56476+yt),$(q,oe,he,bt,Mt),$(Be,oe,ve,bt,Mt))}Mt="\u{1D55C}",$(q,oe,he,"k",Mt),$(Be,oe,ve,"k",Mt);for(var Vt=0;Vt<10;Vt++){var cr=Vt.toString();Mt=String.fromCharCode(55349,57294+Vt),$(q,oe,he,cr,Mt),$(Be,oe,ve,cr,Mt),Mt=String.fromCharCode(55349,57314+Vt),$(q,oe,he,cr,Mt),$(Be,oe,ve,cr,Mt),Mt=String.fromCharCode(55349,57324+Vt),$(q,oe,he,cr,Mt),$(Be,oe,ve,cr,Mt),Mt=String.fromCharCode(55349,57334+Vt),$(q,oe,he,cr,Mt),$(Be,oe,ve,cr,Mt)}for(var xr="\xC7\xD0\xDE\xE7\xFE",Yr=0;Yr<xr.length;Yr++){var Zr=xr.charAt(Yr);$(q,oe,he,Zr,Zr),$(Be,oe,ve,Zr,Zr)}$(Be,oe,ve,"\xF0","\xF0"),$(Be,oe,ve,"\u2013","\u2013"),$(Be,oe,ve,"\u2014","\u2014"),$(Be,oe,ve,"\u2018","\u2018"),$(Be,oe,ve,"\u2019","\u2019"),$(Be,oe,ve,"\u201C","\u201C"),$(Be,oe,ve,"\u201D","\u201D");var ni=[["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"]],Jr=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],_r=function(p,v){var b=p.charCodeAt(0),L=p.charCodeAt(1),V=(b-55296)*1024+(L-56320)+65536,ee=v==="math"?0:1;if(119808<=V&&V<120484){var pe=Math.floor((V-119808)/26);return[ni[pe][2],ni[pe][ee]]}else if(120782<=V&&V<=120831){var ye=Math.floor((V-120782)/10);return[Jr[ye][2],Jr[ye][ee]]}else{if(V===120485||V===120486)return[ni[0][2],ni[0][ee]];if(120486<V&&V<120782)return["",""];throw new d("Unsupported character: "+p)}},ci=[[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]],Rr=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],bi=function(p,v){return v.size<2?p:ci[p-1][v.size-1]},fi=function(){function te(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||te.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=Rr[this.size-1],this.maxSize=v.maxSize,this.minRuleThickness=v.minRuleThickness,this._fontMetrics=void 0}var p=te.prototype;return p.extend=function(b){var L={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 V in b)b.hasOwnProperty(V)&&(L[V]=b[V]);return new te(L)},p.havingStyle=function(b){return this.style===b?this:this.extend({style:b,size:bi(this.textSize,b)})},p.havingCrampedStyle=function(){return this.havingStyle(this.style.cramp())},p.havingSize=function(b){return this.size===b&&this.textSize===b?this:this.extend({style:this.style.text(),size:b,textSize:b,sizeMultiplier:Rr[b-1]})},p.havingBaseStyle=function(b){b=b||this.style.text();var L=bi(te.BASESIZE,b);return this.size===L&&this.textSize===te.BASESIZE&&this.style===b?this:this.extend({style:b,size:L})},p.havingBaseSizing=function(){var b;switch(this.style.id){case 4:case 5:b=3;break;case 6:case 7:b=1;break;default:b=6}return this.extend({style:this.style.text(),size:b})},p.withColor=function(b){return this.extend({color:b})},p.withPhantom=function(){return this.extend({phantom:!0})},p.withFont=function(b){return this.extend({font:b})},p.withTextFontFamily=function(b){return this.extend({fontFamily:b,font:""})},p.withTextFontWeight=function(b){return this.extend({fontWeight:b,font:""})},p.withTextFontShape=function(b){return this.extend({fontShape:b,font:""})},p.sizingClasses=function(b){return b.size!==this.size?["sizing","reset-size"+b.size,"size"+this.size]:[]},p.baseSizingClasses=function(){return this.size!==te.BASESIZE?["sizing","reset-size"+this.size,"size"+te.BASESIZE]:[]},p.fontMetrics=function(){return this._fontMetrics||(this._fontMetrics=Ke(this.size)),this._fontMetrics},p.getColor=function(){return this.phantom?"transparent":this.color},te}();fi.BASESIZE=6;var br=fi,Ar={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},Lr={ex:!0,em:!0,mu:!0},Nr=function(p){return typeof p!="string"&&(p=p.unit),p in Ar||p in Lr||p==="ex"},Sr=function(p,v){var b;if(p.unit in Ar)b=Ar[p.unit]/v.fontMetrics().ptPerEm/v.sizeMultiplier;else if(p.unit==="mu")b=v.fontMetrics().cssEmPerMu;else{var L;if(v.style.isTight()?L=v.havingStyle(v.style.text()):L=v,p.unit==="ex")b=L.fontMetrics().xHeight;else if(p.unit==="em")b=L.fontMetrics().quad;else throw new d("Invalid unit: '"+p.unit+"'");L!==v&&(b*=L.sizeMultiplier/v.sizeMultiplier)}return Math.min(p.number*b,v.maxSize)},ir=["\\imath","\u0131","\\jmath","\u0237","\\pounds","\\mathsterling","\\textsterling","\xA3"],di=function(p,v,b){return At[b][p]&&At[b][p].replace&&(p=At[b][p].replace),{value:p,metrics:Tt(p,v,b)}},Ur=function(p,v,b,L,V){var ee=di(p,v,b),pe=ee.metrics;p=ee.value;var ye;if(pe){var De=pe.italic;(b==="text"||L&&L.font==="mathit")&&(De=0),ye=new Le(p,pe.height,pe.depth,De,pe.skew,pe.width,V)}else typeof console!="undefined"&&console.warn("No character metrics "+("for '"+p+"' in style '"+v+"' and mode '"+b+"'")),ye=new Le(p,0,0,0,0,0,V);if(L){ye.maxFontSize=L.sizeMultiplier,L.style.isTight()&&ye.classes.push("mtight");var je=L.getColor();je&&(ye.style.color=je)}return ye},pi=function(p,v,b,L){return L===void 0&&(L=[]),b.font==="boldsymbol"&&di(p,"Main-Bold",v).metrics?Ur(p,"Main-Bold",v,b,L.concat(["mathbf"])):p==="\\"||At[v][p].font==="main"?Ur(p,"Main-Regular",v,b,L):Ur(p,"AMS-Regular",v,b,L.concat(["amsrm"]))},Ji=function(p,v,b,L){return/[0-9]/.test(p.charAt(0))||k.contains(ir,p)?{fontName:"Main-Italic",fontClass:"mathit"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},es=function(p,v,b,L){return k.contains(ir,p)?{fontName:"Main-Italic",fontClass:"mathit"}:/[0-9]/.test(p.charAt(0))?{fontName:"Caligraphic-Regular",fontClass:"mathcal"}:{fontName:"Math-Italic",fontClass:"mathdefault"}},Ci=function(p,v,b,L){return di(p,"Math-BoldItalic",v).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},$i=function(p,v,b){var L=p.mode,V=p.text,ee=["mord"],pe=L==="math"||L==="text"&&v.font,ye=pe?v.font:v.fontFamily;if(V.charCodeAt(0)===55349){var De=_r(V,L),je=De[0],Qe=De[1];return Ur(V,je,L,v,ee.concat(Qe))}else if(ye){var mt,Dt;if(ye==="boldsymbol"||ye==="mathnormal"){var It=ye==="boldsymbol"?Ci(V,L,v,ee):es(V,L,v,ee);mt=It.fontName,Dt=[It.fontClass]}else k.contains(ir,V)?(mt="Main-Italic",Dt=["mathit"]):pe?(mt=vn[ye].fontName,Dt=[ye]):(mt=_n(ye,v.fontWeight,v.fontShape),Dt=[ye,v.fontWeight,v.fontShape]);if(di(V,mt,L).metrics)return Ur(V,mt,L,v,ee.concat(Dt));if(Rt.hasOwnProperty(V)&&mt.substr(0,10)==="Typewriter"){for(var $t=[],Qt=0;Qt<V.length;Qt++)$t.push(Ur(V[Qt],mt,L,v,ee.concat(Dt)));return Pr($t)}}if(b==="mathord"){var er=Ji(V,L,v,ee);return Ur(V,er.fontName,L,v,ee.concat([er.fontClass]))}else if(b==="textord"){var lr=At[L][V]&&At[L][V].font;if(lr==="ams"){var vr=_n("amsrm",v.fontWeight,v.fontShape);return Ur(V,vr,L,v,ee.concat("amsrm",v.fontWeight,v.fontShape))}else if(lr==="main"||!lr){var jr=_n("textrm",v.fontWeight,v.fontShape);return Ur(V,jr,L,v,ee.concat(v.fontWeight,v.fontShape))}else{var Fr=_n(lr,v.fontWeight,v.fontShape);return Ur(V,Fr,L,v,ee.concat(Fr,v.fontWeight,v.fontShape))}}else throw new Error("unexpected type: "+b+" in makeOrd")},ms=function(p,v){if(ft(p.classes)!==ft(v.classes)||p.skew!==v.skew||p.maxFontSize!==v.maxFontSize)return!1;for(var b in p.style)if(p.style.hasOwnProperty(b)&&p.style[b]!==v.style[b])return!1;for(var L in v.style)if(v.style.hasOwnProperty(L)&&p.style[L]!==v.style[L])return!1;return!0},ts=function(p){for(var v=0;v<p.length-1;v++){var b=p[v],L=p[v+1];b instanceof Le&&L instanceof Le&&ms(b,L)&&(b.text+=L.text,b.height=Math.max(b.height,L.height),b.depth=Math.max(b.depth,L.depth),b.italic=L.italic,p.splice(v+1,1),v--)}return p},si=function(p){for(var v=0,b=0,L=0,V=0;V<p.children.length;V++){var ee=p.children[V];ee.height>v&&(v=ee.height),ee.depth>b&&(b=ee.depth),ee.maxFontSize>L&&(L=ee.maxFontSize)}p.height=v,p.depth=b,p.maxFontSize=L},Ir=function(p,v,b,L){var V=new ze(p,v,b,L);return si(V),V},ti=function(p,v,b,L){return new ze(p,v,b,L)},mn=function(p,v,b){var L=Ir([p],[],v);return L.height=Math.max(b||v.fontMetrics().defaultRuleThickness,v.minRuleThickness),L.style.borderBottomWidth=L.height+"em",L.maxFontSize=1,L},Ai=function(p,v,b,L){var V=new Je(p,v,b,L);return si(V),V},Pr=function(p){var v=new Ne(p);return si(v),v},Kr=function(p,v){return p instanceof Ne?Ir([],[p],v):p},ai=function(p){if(p.positionType==="individualShift"){for(var v=p.children,b=[v[0]],L=-v[0].shift-v[0].elem.depth,V=L,ee=1;ee<v.length;ee++){var pe=-v[ee].shift-V-v[ee].elem.depth,ye=pe-(v[ee-1].elem.height+v[ee-1].elem.depth);V=V+pe,b.push({type:"kern",size:ye}),b.push(v[ee])}return{children:b,depth:L}}var De;if(p.positionType==="top"){for(var je=p.positionData,Qe=0;Qe<p.children.length;Qe++){var mt=p.children[Qe];je-=mt.type==="kern"?mt.size:mt.elem.height+mt.elem.depth}De=je}else if(p.positionType==="bottom")De=-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")De=-Dt.elem.depth-p.positionData;else if(p.positionType==="firstBaseline")De=-Dt.elem.depth;else throw new Error("Invalid positionType "+p.positionType+".")}return{children:p.children,depth:De}},gn=function(p,v){for(var b=ai(p),L=b.children,V=b.depth,ee=0,pe=0;pe<L.length;pe++){var ye=L[pe];if(ye.type==="elem"){var De=ye.elem;ee=Math.max(ee,De.maxFontSize,De.height)}}ee+=2;var je=Ir(["pstrut"],[]);je.style.height=ee+"em";for(var Qe=[],mt=V,Dt=V,It=V,$t=0;$t<L.length;$t++){var Qt=L[$t];if(Qt.type==="kern")It+=Qt.size;else{var er=Qt.elem,lr=Qt.wrapperClasses||[],vr=Qt.wrapperStyle||{},jr=Ir(lr,[je,er],void 0,vr);jr.style.top=-ee-It-er.depth+"em",Qt.marginLeft&&(jr.style.marginLeft=Qt.marginLeft),Qt.marginRight&&(jr.style.marginRight=Qt.marginRight),Qe.push(jr),It+=er.height+er.depth}mt=Math.min(mt,It),Dt=Math.max(Dt,It)}var Fr=Ir(["vlist"],Qe);Fr.style.height=Dt+"em";var Wr;if(mt<0){var Gr=Ir([],[]),zr=Ir(["vlist"],[Gr]);zr.style.height=-mt+"em";var yi=Ir(["vlist-s"],[new Le("\u200B")]);Wr=[Ir(["vlist-r"],[Fr,yi]),Ir(["vlist-r"],[zr])]}else Wr=[Ir(["vlist-r"],[Fr])];var qr=Ir(["vlist-t"],Wr);return Wr.length===2&&qr.classes.push("vlist-t2"),qr.height=Dt,qr.depth=-mt,qr},Si=function(p,v){var b=Ir(["mspace"],[],v),L=Sr(p,v);return b.style.marginRight=L+"em",b},_n=function(p,v,b){var L="";switch(p){case"amsrm":L="AMS";break;case"textrm":L="Main";break;case"textsf":L="SansSerif";break;case"texttt":L="Typewriter";break;default:L=p}var V;return v==="textbf"&&b==="textit"?V="BoldItalic":v==="textbf"?V="Bold":v==="textit"?V="Italic":V="Regular",L+"-"+V},vn={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"}},Pi={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},en=function(p,v){var b=Pi[p],L=b[0],V=b[1],ee=b[2],pe=new Ge(L),ye=new We([pe],{width:V+"em",height:ee+"em",style:"width:"+V+"em",viewBox:"0 0 "+1e3*V+" "+1e3*ee,preserveAspectRatio:"xMinYMin"}),De=ti(["overlay"],[ye],v);return De.height=ee,De.style.height=ee+"em",De.style.width=V+"em",De},ct={fontMap:vn,makeSymbol:Ur,mathsym:pi,makeSpan:Ir,makeSvgSpan:ti,makeLineSpan:mn,makeAnchor:Ai,makeFragment:Pr,wrapFragment:Kr,makeVList:gn,makeOrd:$i,makeGlue:Si,staticSvg:en,svgData:Pi,tryCombineChars:ts};function fr(te,p){var v=Vr(te,p);if(!v)throw new Error("Expected node of type "+p+", but got "+(te?"node of type "+te.type:String(te)));return v}function Vr(te,p){return te&&te.type===p?te:null}function yn(te,p){var v=bn(te,p);if(!v)throw new Error('Expected node of type "atom" and family "'+p+'", but got '+(te?te.type==="atom"?"atom of family "+te.family:"node of type "+te.type:String(te)));return v}function bn(te,p){return te&&te.type==="atom"&&te.family===p?te:null}function Gi(te){var p=Ei(te);if(!p)throw new Error("Expected node of symbol group type, but got "+(te?"node of type "+te.type:String(te)));return p}function Ei(te){return te&&(te.type==="atom"||_t.hasOwnProperty(te.type))?te:null}var ur={number:3,unit:"mu"},Or={number:4,unit:"mu"},Ti={number:5,unit:"mu"},ei={mord:{mop:ur,mbin:Or,mrel:Ti,minner:ur},mop:{mord:ur,mop:ur,mrel:Ti,minner:ur},mbin:{mord:Or,mop:Or,mopen:Or,minner:Or},mrel:{mord:Ti,mop:Ti,mopen:Ti,minner:Ti},mopen:{},mclose:{mop:ur,mbin:Or,mrel:Ti,minner:ur},mpunct:{mord:ur,mop:ur,mrel:Ti,mopen:ur,mclose:ur,mpunct:ur,minner:ur},minner:{mord:ur,mop:ur,mbin:Or,mrel:Ti,mopen:ur,mpunct:ur,minner:ur}},$r={mord:{mop:ur},mop:{mord:ur,mop:ur},mbin:{},mrel:{},mopen:{},mclose:{mop:ur},mpunct:{},minner:{mop:ur}},Gn={},Ki={},hi={};function Yt(te){for(var p=te.type,v=te.names,b=te.props,L=te.handler,V=te.htmlBuilder,ee=te.mathmlBuilder,pe={type:p,numArgs:b.numArgs,argTypes:b.argTypes,greediness:b.greediness===void 0?1:b.greediness,allowedInText:!!b.allowedInText,allowedInMath:b.allowedInMath===void 0?!0:b.allowedInMath,numOptionalArgs:b.numOptionalArgs||0,infix:!!b.infix,handler:L},ye=0;ye<v.length;++ye)Gn[v[ye]]=pe;p&&(V&&(Ki[p]=V),ee&&(hi[p]=ee))}function oi(te){var p=te.type,v=te.htmlBuilder,b=te.mathmlBuilder;Yt({type:p,names:[],props:{numArgs:0},handler:function(){throw new Error("Should never be called.")},htmlBuilder:v,mathmlBuilder:b})}var Qr=function(p){var v=Vr(p,"ordgroup");return v?v.body:[p]},Oi=ct.makeSpan,Sn=["leftmost","mbin","mopen","mrel","mop","mpunct"],En=["rightmost","mrel","mclose","mpunct"],Kn={display:B.DISPLAY,text:B.TEXT,script:B.SCRIPT,scriptscript:B.SCRIPTSCRIPT},xn={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Xr=function(p,v,b,L){L===void 0&&(L=[null,null]);for(var V=[],ee=0;ee<p.length;ee++){var pe=mr(p[ee],v);if(pe instanceof Ne){var ye=pe.children;V.push.apply(V,ye)}else V.push(pe)}if(!b)return V;var De=v;if(p.length===1){var je=Vr(p[0],"sizing")||Vr(p[0],"styling");je&&(je.type==="sizing"?De=v.havingSize(je.size):je.type==="styling"&&(De=v.havingStyle(Kn[je.style])))}var Qe=Oi([L[0]||"leftmost"],[],v),mt=Oi([L[1]||"rightmost"],[],v);return tn(V,function(Dt,It){var $t=It.classes[0],Qt=Dt.classes[0];$t==="mbin"&&k.contains(En,Qt)?It.classes[0]="mord":Qt==="mbin"&&k.contains(Sn,$t)&&(Dt.classes[0]="mord")},{node:Qe},mt),tn(V,function(Dt,It){var $t=Mi(It),Qt=Mi(Dt),er=$t&&Qt?Dt.hasClass("mtight")?$r[$t][Qt]:ei[$t][Qt]:null;if(er)return ct.makeGlue(er,De)},{node:Qe},mt),V},tn=function te(p,v,b,L){L&&p.push(L);for(var V=0;V<p.length;V++){var ee=p[V],pe=Di(ee);if(pe){te(pe.children,v,b);continue}if(ee.classes[0]!=="mspace"){var ye=v(ee,b.node);ye&&(b.insertAfter?b.insertAfter(ye):(p.unshift(ye),V++)),b.node=ee,b.insertAfter=function(De){return function(je){p.splice(De+1,0,je),V++}}(V)}}L&&p.pop()},Di=function(p){return p instanceof Ne||p instanceof Je?p:null},Vi=function te(p,v){var b=Di(p);if(b){var L=b.children;if(L.length){if(v==="right")return te(L[L.length-1],"right");if(v==="left")return te(L[0],"left")}}return p},Mi=function(p,v){return p?(v&&(p=Vi(p,v)),xn[p.classes[0]]||null):null},Ri=function(p,v){var b=["nulldelimiter"].concat(p.baseSizingClasses());return Oi(v.concat(b))},mr=function(p,v,b){if(!p)return Oi();if(Ki[p.type]){var L=Ki[p.type](p,v);if(b&&v.size!==b.size){L=Oi(v.sizingClasses(b),[L],v);var V=v.sizeMultiplier/b.sizeMultiplier;L.height*=V,L.depth*=V}return L}else throw new d("Got group of unknown type: '"+p.type+"'")};function wn(te,p){var v=Oi(["base"],te,p),b=Oi(["strut"]);return b.style.height=v.height+v.depth+"em",b.style.verticalAlign=-v.depth+"em",v.children.unshift(b),v}function rn(te,p){var v=null;te.length===1&&te[0].type==="tag"&&(v=te[0].tag,te=te[0].body);for(var b=Xr(te,p,!0),L=[],V=[],ee=0;ee<b.length;ee++)if(V.push(b[ee]),b[ee].hasClass("mbin")||b[ee].hasClass("mrel")||b[ee].hasClass("allowbreak")){for(var pe=!1;ee<b.length-1&&b[ee+1].hasClass("mspace")&&!b[ee+1].hasClass("newline");)ee++,V.push(b[ee]),b[ee].hasClass("nobreak")&&(pe=!0);pe||(L.push(wn(V,p)),V=[])}else b[ee].hasClass("newline")&&(V.pop(),V.length>0&&(L.push(wn(V,p)),V=[]),L.push(b[ee]));V.length>0&&L.push(wn(V,p));var ye;v&&(ye=wn(Xr(v,p,!0)),ye.classes=["tag"],L.push(ye));var De=Oi(["katex-html"],L);if(De.setAttribute("aria-hidden","true"),ye){var je=ye.children[0];je.style.height=De.height+De.depth+"em",je.style.verticalAlign=-De.depth+"em"}return De}function nn(te){return new Ne(te)}var li=function(){function te(v,b){this.type=void 0,this.attributes=void 0,this.children=void 0,this.type=v,this.attributes={},this.children=b||[]}var p=te.prototype;return p.setAttribute=function(b,L){this.attributes[b]=L},p.getAttribute=function(b){return this.attributes[b]},p.toNode=function(){var b=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var L in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,L)&&b.setAttribute(L,this.attributes[L]);for(var V=0;V<this.children.length;V++)b.appendChild(this.children[V].toNode());return b},p.toMarkup=function(){var b="<"+this.type;for(var L in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,L)&&(b+=" "+L+'="',b+=k.escape(this.attributes[L]),b+='"');b+=">";for(var V=0;V<this.children.length;V++)b+=this.children[V].toMarkup();return b+="</"+this.type+">",b},p.toText=function(){return this.children.map(function(b){return b.toText()}).join("")},te}(),nr=function(){function te(v){this.text=void 0,this.text=v}var p=te.prototype;return p.toNode=function(){return document.createTextNode(this.text)},p.toMarkup=function(){return k.escape(this.toText())},p.toText=function(){return this.text},te}(),rs=function(){function te(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=te.prototype;return p.toNode=function(){if(this.character)return document.createTextNode(this.character);var b=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return b.setAttribute("width",this.width+"em"),b},p.toMarkup=function(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+this.width+'em"/>'},p.toText=function(){return this.character?this.character:" "},te}(),Ft={MathNode:li,TextNode:nr,SpaceNode:rs,newDocumentFragment:nn},ui=function(p,v,b){return At[v][p]&&At[v][p].replace&&p.charCodeAt(0)!==55349&&!(Rt.hasOwnProperty(p)&&b&&(b.fontFamily&&b.fontFamily.substr(4,2)==="tt"||b.font&&b.font.substr(4,2)==="tt"))&&(p=At[v][p].replace),new Ft.TextNode(p)},In=function(p){return p.length===1?p[0]:new Ft.MathNode("mrow",p)},Pn=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 b=v.font;if(!b||b==="mathnormal")return null;var L=p.mode;if(b==="mathit")return"italic";if(b==="boldsymbol")return"bold-italic";if(b==="mathbf")return"bold";if(b==="mathbb")return"double-struck";if(b==="mathfrak")return"fraktur";if(b==="mathscr"||b==="mathcal")return"script";if(b==="mathsf")return"sans-serif";if(b==="mathtt")return"monospace";var V=p.text;if(k.contains(["\\imath","\\jmath"],V))return null;At[L][V]&&At[L][V].replace&&(V=At[L][V].replace);var ee=ct.fontMap[b].fontName;return Tt(V,ee,L)?ct.fontMap[b].variant:null},mi=function(p,v,b){if(p.length===1){var L=or(p[0],v);return b&&L instanceof li&&L.type==="mo"&&(L.setAttribute("lspace","0em"),L.setAttribute("rspace","0em")),[L]}for(var V=[],ee,pe=0;pe<p.length;pe++){var ye=or(p[pe],v);if(ye instanceof li&&ee instanceof li){if(ye.type==="mtext"&&ee.type==="mtext"&&ye.getAttribute("mathvariant")===ee.getAttribute("mathvariant")){var De;(De=ee.children).push.apply(De,ye.children);continue}else if(ye.type==="mn"&&ee.type==="mn"){var je;(je=ee.children).push.apply(je,ye.children);continue}else if(ye.type==="mi"&&ye.children.length===1&&ee.type==="mn"){var Qe=ye.children[0];if(Qe instanceof nr&&Qe.text==="."){var mt;(mt=ee.children).push.apply(mt,ye.children);continue}}else if(ee.type==="mi"&&ee.children.length===1){var Dt=ee.children[0];if(Dt instanceof nr&&Dt.text==="\u0338"&&(ye.type==="mo"||ye.type==="mi"||ye.type==="mn")){var It=ye.children[0];It instanceof nr&&It.text.length>0&&(It.text=It.text.slice(0,1)+"\u0338"+It.text.slice(1),V.pop())}}}V.push(ye),ee=ye}return V},zi=function(p,v,b){return In(mi(p,v,b))},or=function(p,v){if(!p)return new Ft.MathNode("mrow");if(hi[p.type]){var b=hi[p.type](p,v);return b}else throw new d("Got group of unknown type: '"+p.type+"'")};function Fi(te,p,v,b){var L=mi(te,v),V;L.length===1&&L[0]instanceof li&&k.contains(["mrow","mtable"],L[0].type)?V=L[0]:V=new Ft.MathNode("mrow",L);var ee=new Ft.MathNode("annotation",[new Ft.TextNode(p)]);ee.setAttribute("encoding","application/x-tex");var pe=new Ft.MathNode("semantics",[V,ee]),ye=new Ft.MathNode("math",[pe]);ye.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML");var De=b?"katex":"katex-mathml";return ct.makeSpan([De],[ye])}var On=function(p){return new br({style:p.displayMode?B.DISPLAY:B.TEXT,maxSize:p.maxSize,minRuleThickness:p.minRuleThickness})},is=function(p,v){if(v.displayMode){var b=["katex-display"];v.leqno&&b.push("leqno"),v.fleqn&&b.push("fleqn"),p=ct.makeSpan(b,[p])}return p},gi=function(p,v,b){var L=On(b),V;if(b.output==="mathml")return Fi(p,v,L,!0);if(b.output==="html"){var ee=rn(p,L);V=ct.makeSpan(["katex"],[ee])}else{var pe=Fi(p,v,L,!1),ye=rn(p,L);V=ct.makeSpan(["katex"],[pe,ye])}return is(V,b)},Mn=function(p,v,b){var L=On(b),V=rn(p,L),ee=ct.makeSpan(["katex"],[V]);return is(ee,b)},ns=gi,Li={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"},qi=function(p){var v=new Ft.MathNode("mo",[new Ft.TextNode(Li[p.substr(1)])]);return v.setAttribute("stretchy","true"),v},Hi={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]},Fn=function(p){return p.type==="ordgroup"?p.body.length:1},Vn=function(p,v){function b(){var ye=4e5,De=p.label.substr(1);if(k.contains(["widehat","widecheck","widetilde","utilde"],De)){var je=p,Qe=Fn(je.base),mt,Dt,It;if(Qe>5)De==="widehat"||De==="widecheck"?(mt=420,ye=2364,It=.42,Dt=De+"4"):(mt=312,ye=2340,It=.34,Dt="tilde4");else{var $t=[1,1,2,2,3,3][Qe];De==="widehat"||De==="widecheck"?(ye=[0,1062,2364,2364,2364][$t],mt=[0,239,300,360,420][$t],It=[0,.24,.3,.3,.36,.42][$t],Dt=De+$t):(ye=[0,600,1033,2339,2340][$t],mt=[0,260,286,306,312][$t],It=[0,.26,.286,.3,.306,.34][$t],Dt="tilde"+$t)}var Qt=new Ge(Dt),er=new We([Qt],{width:"100%",height:It+"em",viewBox:"0 0 "+ye+" "+mt,preserveAspectRatio:"none"});return{span:ct.makeSvgSpan([],[er],v),minWidth:0,height:It}}else{var lr=[],vr=Hi[De],jr=vr[0],Fr=vr[1],Wr=vr[2],Gr=Wr/1e3,zr=jr.length,yi,qr;if(zr===1){var Ve=vr[3];yi=["hide-tail"],qr=[Ve]}else if(zr===2)yi=["halfarrow-left","halfarrow-right"],qr=["xMinYMin","xMaxYMin"];else if(zr===3)yi=["brace-left","brace-center","brace-right"],qr=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
|
`+zr+" children.");for(var Ni=0;Ni<zr;Ni++){var hn=new Ge(jr[Ni]),Zi=new We([hn],{width:"400em",height:Gr+"em",viewBox:"0 0 "+ye+" "+Wr,preserveAspectRatio:qr[Ni]+" slice"}),ri=ct.makeSvgSpan([yi[Ni]],[Zi],v);if(zr===1)return{span:ri,minWidth:Fr,height:Gr};ri.style.height=Gr+"em",lr.push(ri)}return{span:ct.makeSpan(["stretchy"],lr,v),minWidth:Fr,height:Gr}}}var L=b(),V=L.span,ee=L.minWidth,pe=L.height;return V.height=pe,V.style.height=pe+"em",ee>0&&(V.style.minWidth=ee+"em"),V},qn=function(p,v,b,L){var V,ee=p.height+p.depth+2*b;if(/fbox|color/.test(v)){if(V=ct.makeSpan(["stretchy",v],[],L),v==="fbox"){var pe=L.color&&L.getColor();pe&&(V.style.borderColor=pe)}}else{var ye=[];/^[bx]cancel$/.test(v)&&ye.push(new Xe({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(v)&&ye.push(new Xe({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var De=new We(ye,{width:"100%",height:ee+"em"});V=ct.makeSvgSpan([],[De],L)}return V.height=ee,V.style.height=ee+"em",V},Bi={encloseSpan:qn,mathMLnode:qi,svgSpan:Vn},Kt=function(p,v){var b,L,V=Vr(p,"supsub"),ee;V?(L=fr(V.base,"accent"),b=L.base,V.base=b,ee=Ct(mr(V,v)),V.base=L):(L=fr(p,"accent"),b=L.base);var pe=mr(b,v.havingCrampedStyle()),ye=L.isShifty&&k.isCharacterBox(b),De=0;if(ye){var je=k.getBaseElem(b),Qe=mr(je,v.havingCrampedStyle());De=gt(Qe).skew}var mt=Math.min(pe.height,v.fontMetrics().xHeight),Dt;if(L.isStretchy)Dt=Bi.svgSpan(L,v),Dt=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:pe},{type:"elem",elem:Dt,wrapperClasses:["svg-align"],wrapperStyle:De>0?{width:"calc(100% - "+2*De+"em)",marginLeft:2*De+"em"}:void 0}]},v);else{var It,$t;L.label==="\\vec"?(It=ct.staticSvg("vec",v),$t=ct.svgData.vec[1]):(It=ct.makeOrd({mode:L.mode,text:L.label},v,"textord"),It=gt(It),It.italic=0,$t=It.width),Dt=ct.makeSpan(["accent-body"],[It]);var Qt=L.label==="\\textcircled";Qt&&(Dt.classes.push("accent-full"),mt=pe.height);var er=De;Qt||(er-=$t/2),Dt.style.left=er+"em",L.label==="\\textcircled"&&(Dt.style.top=".2em"),Dt=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:pe},{type:"kern",size:-mt},{type:"elem",elem:Dt}]},v)}var lr=ct.makeSpan(["mord","accent"],[Dt],v);return ee?(ee.children[0]=lr,ee.height=Math.max(lr.height,ee.height),ee.classes[0]="mord",ee):lr},sr=function(p,v){var b=p.isStretchy?Bi.mathMLnode(p.label):new Ft.MathNode("mo",[ui(p.label,p.mode)]),L=new Ft.MathNode("mover",[or(p.base,v),b]);return L.setAttribute("accent","true"),L},Mr=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(function(te){return"\\"+te}).join("|"));Yt({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 b=v[0],L=!Mr.test(p.funcName),V=!L||p.funcName==="\\widehat"||p.funcName==="\\widetilde"||p.funcName==="\\widecheck";return{type:"accent",mode:p.parser.mode,label:p.funcName,isStretchy:L,isShifty:V,base:b}},htmlBuilder:Kt,mathmlBuilder:sr}),Yt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!1},handler:function(p,v){var b=v[0];return{type:"accent",mode:p.parser.mode,label:p.funcName,isStretchy:!1,isShifty:!0,base:b}},htmlBuilder:Kt,mathmlBuilder:sr}),Yt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(p,v){var b=p.parser,L=p.funcName,V=v[0];return{type:"accentUnder",mode:b.mode,label:L,base:V}},htmlBuilder:function(p,v){var b=mr(p.base,v),L=Bi.svgSpan(p,v),V=p.label==="\\utilde"?.12:0,ee=ct.makeVList({positionType:"bottom",positionData:L.height+V,children:[{type:"elem",elem:L,wrapperClasses:["svg-align"]},{type:"kern",size:V},{type:"elem",elem:b}]},v);return ct.makeSpan(["mord","accentunder"],[ee],v)},mathmlBuilder:function(p,v){var b=Bi.mathMLnode(p.label),L=new Ft.MathNode("munder",[or(p.base,v),b]);return L.setAttribute("accentunder","true"),L}});var dr=function(p){var v=new Ft.MathNode("mpadded",p?[p]:[]);return v.setAttribute("width","+0.6em"),v.setAttribute("lspace","0.3em"),v};Yt({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,b){var L=p.parser,V=p.funcName;return{type:"xArrow",mode:L.mode,label:V,body:v[0],below:b[0]}},htmlBuilder:function(p,v){var b=v.style,L=v.havingStyle(b.sup()),V=ct.wrapFragment(mr(p.body,L,v),v);V.classes.push("x-arrow-pad");var ee;p.below&&(L=v.havingStyle(b.sub()),ee=ct.wrapFragment(mr(p.below,L,v),v),ee.classes.push("x-arrow-pad"));var pe=Bi.svgSpan(p,v),ye=-v.fontMetrics().axisHeight+.5*pe.height,De=-v.fontMetrics().axisHeight-.5*pe.height-.111;(V.depth>.25||p.label==="\\xleftequilibrium")&&(De-=V.depth);var je;if(ee){var Qe=-v.fontMetrics().axisHeight+ee.height+.5*pe.height+.111;je=ct.makeVList({positionType:"individualShift",children:[{type:"elem",elem:V,shift:De},{type:"elem",elem:pe,shift:ye},{type:"elem",elem:ee,shift:Qe}]},v)}else je=ct.makeVList({positionType:"individualShift",children:[{type:"elem",elem:V,shift:De},{type:"elem",elem:pe,shift:ye}]},v);return je.children[0].children[0].children[1].classes.push("svg-align"),ct.makeSpan(["mrel","x-arrow"],[je],v)},mathmlBuilder:function(p,v){var b=Bi.mathMLnode(p.label),L;if(p.body){var V=dr(or(p.body,v));if(p.below){var ee=dr(or(p.below,v));L=new Ft.MathNode("munderover",[b,ee,V])}else L=new Ft.MathNode("mover",[b,V])}else if(p.below){var pe=dr(or(p.below,v));L=new Ft.MathNode("munder",[b,pe])}else L=dr(),L=new Ft.MathNode("mover",[b,L]);return L}}),Yt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){for(var b=p.parser,L=fr(v[0],"ordgroup"),V=L.body,ee="",pe=0;pe<V.length;pe++){var ye=fr(V[pe],"textord");ee+=ye.text}var De=parseInt(ee);if(isNaN(De))throw new d("\\@char has non-numeric argument "+ee);return{type:"textord",mode:b.mode,text:String.fromCharCode(De)}}});var yr=function(p,v){var b=Xr(p.body,v.withColor(p.color),!1);return ct.makeFragment(b)},sn=function(p,v){var b=mi(p.body,v.withColor(p.color)),L=new Ft.MathNode("mstyle",b);return L.setAttribute("mathcolor",p.color),L};Yt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","original"]},handler:function(p,v){var b=p.parser,L=fr(v[0],"color-token").color,V=v[1];return{type:"color",mode:b.mode,color:L,body:Qr(V)}},htmlBuilder:yr,mathmlBuilder:sn}),Yt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,greediness:3,argTypes:["color"]},handler:function(p,v){var b=p.parser,L=p.breakOnTokenText,V=fr(v[0],"color-token").color;b.gullet.macros.set("\\current@color",V);var ee=b.parseExpression(!0,L);return{type:"color",mode:b.mode,color:V,body:ee}},htmlBuilder:yr,mathmlBuilder:sn}),Yt({type:"cr",names:["\\cr","\\newline"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler:function(p,v,b){var L=p.parser,V=p.funcName,ee=b[0],pe=V==="\\cr",ye=!1;return pe||(L.settings.displayMode&&L.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode")?ye=!1:ye=!0),{type:"cr",mode:L.mode,newLine:ye,newRow:pe,size:ee&&fr(ee,"size").value}},htmlBuilder:function(p,v){if(p.newRow)throw new d("\\cr valid only within a tabular/array environment");var b=ct.makeSpan(["mspace"],[],v);return p.newLine&&(b.classes.push("newline"),p.size&&(b.style.marginTop=Sr(p.size,v)+"em")),b},mathmlBuilder:function(p,v){var b=new Ft.MathNode("mspace");return p.newLine&&(b.setAttribute("linebreak","newline"),p.size&&b.setAttribute("height",Sr(p.size,v)+"em")),b}});var Yi=function(p,v,b){var L=At.math[p]&&At.math[p].replace,V=Tt(L||p,v,b);if(!V)throw new Error("Unsupported symbol "+p+" and font size "+v+".");return V},an=function(p,v,b,L){var V=b.havingBaseStyle(v),ee=ct.makeSpan(L.concat(V.sizingClasses(b)),[p],b),pe=V.sizeMultiplier/b.sizeMultiplier;return ee.height*=pe,ee.depth*=pe,ee.maxFontSize=V.sizeMultiplier,ee},Bn=function(p,v,b){var L=v.havingBaseStyle(b),V=(1-v.sizeMultiplier/L.sizeMultiplier)*v.fontMetrics().axisHeight;p.classes.push("delimcenter"),p.style.top=V+"em",p.height-=V,p.depth+=V},So=function(p,v,b,L,V,ee){var pe=ct.makeSymbol(p,"Main-Regular",V,L),ye=an(pe,v,L,ee);return b&&Bn(ye,L,v),ye},Eo=function(p,v,b,L){return ct.makeSymbol(p,"Size"+v+"-Regular",b,L)},Aa=function(p,v,b,L,V,ee){var pe=Eo(p,v,V,L),ye=an(ct.makeSpan(["delimsizing","size"+v],[pe],L),B.TEXT,L,ee);return b&&Bn(ye,L,B.TEXT),ye},Cn=function(p,v,b){var L;v==="Size1-Regular"?L="delim-size1":L="delim-size4";var V=ct.makeSpan(["delimsizinginner",L],[ct.makeSpan([],[ct.makeSymbol(p,v,b)])]);return{type:"elem",elem:V}},on={type:"kern",size:-.005},An=function(p,v,b,L,V,ee){var pe,ye,De,je;pe=De=je=p,ye=null;var Qe="Size1-Regular";p==="\\uparrow"?De=je="\u23D0":p==="\\Uparrow"?De=je="\u2016":p==="\\downarrow"?pe=De="\u23D0":p==="\\Downarrow"?pe=De="\u2016":p==="\\updownarrow"?(pe="\\uparrow",De="\u23D0",je="\\downarrow"):p==="\\Updownarrow"?(pe="\\Uparrow",De="\u2016",je="\\Downarrow"):p==="["||p==="\\lbrack"?(pe="\u23A1",De="\u23A2",je="\u23A3",Qe="Size4-Regular"):p==="]"||p==="\\rbrack"?(pe="\u23A4",De="\u23A5",je="\u23A6",Qe="Size4-Regular"):p==="\\lfloor"||p==="\u230A"?(De=pe="\u23A2",je="\u23A3",Qe="Size4-Regular"):p==="\\lceil"||p==="\u2308"?(pe="\u23A1",De=je="\u23A2",Qe="Size4-Regular"):p==="\\rfloor"||p==="\u230B"?(De=pe="\u23A5",je="\u23A6",Qe="Size4-Regular"):p==="\\rceil"||p==="\u2309"?(pe="\u23A4",De=je="\u23A5",Qe="Size4-Regular"):p==="("||p==="\\lparen"?(pe="\u239B",De="\u239C",je="\u239D",Qe="Size4-Regular"):p===")"||p==="\\rparen"?(pe="\u239E",De="\u239F",je="\u23A0",Qe="Size4-Regular"):p==="\\{"||p==="\\lbrace"?(pe="\u23A7",ye="\u23A8",je="\u23A9",De="\u23AA",Qe="Size4-Regular"):p==="\\}"||p==="\\rbrace"?(pe="\u23AB",ye="\u23AC",je="\u23AD",De="\u23AA",Qe="Size4-Regular"):p==="\\lgroup"||p==="\u27EE"?(pe="\u23A7",je="\u23A9",De="\u23AA",Qe="Size4-Regular"):p==="\\rgroup"||p==="\u27EF"?(pe="\u23AB",je="\u23AD",De="\u23AA",Qe="Size4-Regular"):p==="\\lmoustache"||p==="\u23B0"?(pe="\u23A7",je="\u23AD",De="\u23AA",Qe="Size4-Regular"):(p==="\\rmoustache"||p==="\u23B1")&&(pe="\u23AB",je="\u23A9",De="\u23AA",Qe="Size4-Regular");var mt=Yi(pe,Qe,V),Dt=mt.height+mt.depth,It=Yi(De,Qe,V),$t=It.height+It.depth,Qt=Yi(je,Qe,V),er=Qt.height+Qt.depth,lr=0,vr=1;if(ye!==null){var jr=Yi(ye,Qe,V);lr=jr.height+jr.depth,vr=2}var Fr=Dt+er+lr,Wr=Math.max(0,Math.ceil((v-Fr)/(vr*$t))),Gr=Fr+Wr*vr*$t,zr=L.fontMetrics().axisHeight;b&&(zr*=L.sizeMultiplier);var yi=Gr/2-zr,qr=(Wr+1)*.005-$t,Ve=[];if(Ve.push(Cn(je,Qe,V)),ye===null)for(var Ni=0;Ni<Wr;Ni++)Ve.push(on),Ve.push(Cn(De,Qe,V));else{for(var hn=0;hn<Wr;hn++)Ve.push(on),Ve.push(Cn(De,Qe,V));Ve.push({type:"kern",size:qr}),Ve.push(Cn(De,Qe,V)),Ve.push(on),Ve.push(Cn(ye,Qe,V));for(var Zi=0;Zi<Wr;Zi++)Ve.push(on),Ve.push(Cn(De,Qe,V))}Ve.push({type:"kern",size:qr}),Ve.push(Cn(De,Qe,V)),Ve.push(on),Ve.push(Cn(pe,Qe,V));var ri=L.havingBaseStyle(B.TEXT),$n=ct.makeVList({positionType:"bottom",positionData:yi,children:Ve},ri);return an(ct.makeSpan(["delimsizing","mult"],[$n],ri),B.TEXT,L,ee)},qs=80,Rs=.08,Ys=function(p,v,b,L,V){var ee=tt(p,L,b),pe=new Ge(p,ee),ye=new We([pe],{width:"400em",height:v+"em",viewBox:"0 0 400000 "+b,preserveAspectRatio:"xMinYMin slice"});return ct.makeSvgSpan(["hide-tail"],[ye],V)},Ta=function(p,v){var b=v.havingBaseSizing(),L=Qs("\\surd",p*b.sizeMultiplier,Xs,b),V=b.sizeMultiplier,ee=Math.max(0,v.minRuleThickness-v.fontMetrics().sqrtRuleThickness),pe,ye=0,De=0,je=0,Qe;return L.type==="small"?(je=1e3+1e3*ee+qs,p<1?V=1:p<1.4&&(V=.7),ye=(1+ee+Rs)/V,De=(1+ee)/V,pe=Ys("sqrtMain",ye,je,ee,v),pe.style.minWidth="0.853em",Qe=.833/V):L.type==="large"?(je=(1e3+qs)*ks[L.size],De=(ks[L.size]+ee)/V,ye=(ks[L.size]+ee+Rs)/V,pe=Ys("sqrtSize"+L.size,ye,je,ee,v),pe.style.minWidth="1.02em",Qe=1/V):(ye=p+ee+Rs,De=p+ee,je=Math.floor(1e3*p+ee)+qs,pe=Ys("sqrtTall",ye,je,ee,v),pe.style.minWidth="0.742em",Qe=1.056),pe.height=De,pe.style.height=ye+"em",{span:pe,advanceWidth:Qe,ruleWidth:(v.fontMetrics().sqrtRuleThickness+ee)*V}},Zs=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],xo=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],Ls=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],ks=[0,1.2,1.8,2.4,3],ln=function(p,v,b,L,V){if(p==="<"||p==="\\lt"||p==="\u27E8"?p="\\langle":(p===">"||p==="\\gt"||p==="\u27E9")&&(p="\\rangle"),k.contains(Zs,p)||k.contains(Ls,p))return Aa(p,v,!1,b,L,V);if(k.contains(xo,p))return An(p,ks[v],!1,b,L,V);throw new d("Illegal delimiter: '"+p+"'")},Da=[{type:"small",style:B.SCRIPTSCRIPT},{type:"small",style:B.SCRIPT},{type:"small",style:B.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],wo=[{type:"small",style:B.SCRIPTSCRIPT},{type:"small",style:B.SCRIPT},{type:"small",style:B.TEXT},{type:"stack"}],Xs=[{type:"small",style:B.SCRIPTSCRIPT},{type:"small",style:B.SCRIPT},{type:"small",style:B.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Ra=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.")},Qs=function(p,v,b,L){for(var V=Math.min(2,3-L.style.size),ee=V;ee<b.length&&b[ee].type!=="stack";ee++){var pe=Yi(p,Ra(b[ee]),"math"),ye=pe.height+pe.depth;if(b[ee].type==="small"){var De=L.havingBaseStyle(b[ee].style);ye*=De.sizeMultiplier}if(ye>v)return b[ee]}return b[b.length-1]},Js=function(p,v,b,L,V,ee){p==="<"||p==="\\lt"||p==="\u27E8"?p="\\langle":(p===">"||p==="\\gt"||p==="\u27E9")&&(p="\\rangle");var pe;k.contains(Ls,p)?pe=Da:k.contains(Zs,p)?pe=Xs:pe=wo;var ye=Qs(p,v,pe,L);return ye.type==="small"?So(p,ye.style,b,L,V,ee):ye.type==="large"?Aa(p,ye.size,b,L,V,ee):An(p,v,b,L,V,ee)},Co=function(p,v,b,L,V,ee){var pe=L.fontMetrics().axisHeight*L.sizeMultiplier,ye=901,De=5/L.fontMetrics().ptPerEm,je=Math.max(v-pe,b+pe),Qe=Math.max(je/500*ye,2*je-De);return Js(p,Qe,!0,L,V,ee)},un={sqrtImage:Ta,sizedDelim:ln,customSizedDelim:Js,leftRightDelim:Co},ea={"\\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}},La=["(","\\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 ji(te,p){var v=Ei(te);if(v&&k.contains(La,v.text))return v;throw new d("Invalid delimiter: '"+(v?v.text:JSON.stringify(te))+"' after '"+p.funcName+"'",te)}Yt({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 b=ji(v[0],p);return{type:"delimsizing",mode:p.parser.mode,size:ea[p.funcName].size,mclass:ea[p.funcName].mclass,delim:b.text}},htmlBuilder:function(p,v){return p.delim==="."?ct.makeSpan([p.mclass]):un.sizedDelim(p.delim,p.size,v,p.mode,[p.mclass])},mathmlBuilder:function(p){var v=[];p.delim!=="."&&v.push(ui(p.delim,p.mode));var b=new Ft.MathNode("mo",v);return p.mclass==="mopen"||p.mclass==="mclose"?b.setAttribute("fence","true"):b.setAttribute("fence","false"),b}});function ta(te){if(!te.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Yt({type:"leftright-right",names:["\\right"],props:{numArgs:1},handler:function(p,v){var b=p.parser.gullet.macros.get("\\current@color");if(b&&typeof b!="string")throw new d("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:p.parser.mode,delim:ji(v[0],p).text,color:b}}}),Yt({type:"leftright",names:["\\left"],props:{numArgs:1},handler:function(p,v){var b=ji(v[0],p),L=p.parser;++L.leftrightDepth;var V=L.parseExpression(!1);--L.leftrightDepth,L.expect("\\right",!1);var ee=fr(L.parseFunction(),"leftright-right");return{type:"leftright",mode:L.mode,body:V,left:b.text,right:ee.delim,rightColor:ee.color}},htmlBuilder:function(p,v){ta(p);for(var b=Xr(p.body,v,!0,["mopen","mclose"]),L=0,V=0,ee=!1,pe=0;pe<b.length;pe++)b[pe].isMiddle?ee=!0:(L=Math.max(b[pe].height,L),V=Math.max(b[pe].depth,V));L*=v.sizeMultiplier,V*=v.sizeMultiplier;var ye;if(p.left==="."?ye=Ri(v,["mopen"]):ye=un.leftRightDelim(p.left,L,V,v,p.mode,["mopen"]),b.unshift(ye),ee)for(var De=1;De<b.length;De++){var je=b[De],Qe=je.isMiddle;Qe&&(b[De]=un.leftRightDelim(Qe.delim,L,V,Qe.options,p.mode,[]))}var mt;if(p.right===".")mt=Ri(v,["mclose"]);else{var Dt=p.rightColor?v.withColor(p.rightColor):v;mt=un.leftRightDelim(p.right,L,V,Dt,p.mode,["mclose"])}return b.push(mt),ct.makeSpan(["minner"],b,v)},mathmlBuilder:function(p,v){ta(p);var b=mi(p.body,v);if(p.left!=="."){var L=new Ft.MathNode("mo",[ui(p.left,p.mode)]);L.setAttribute("fence","true"),b.unshift(L)}if(p.right!=="."){var V=new Ft.MathNode("mo",[ui(p.right,p.mode)]);V.setAttribute("fence","true"),p.rightColor&&V.setAttribute("mathcolor",p.rightColor),b.push(V)}return In(b)}}),Yt({type:"middle",names:["\\middle"],props:{numArgs:1},handler:function(p,v){var b=ji(v[0],p);if(!p.parser.leftrightDepth)throw new d("\\middle without preceding \\left",b);return{type:"middle",mode:p.parser.mode,delim:b.text}},htmlBuilder:function(p,v){var b;if(p.delim===".")b=Ri(v,[]);else{b=un.sizedDelim(p.delim,1,v,p.mode,[]);var L={delim:p.delim,options:v};b.isMiddle=L}return b},mathmlBuilder:function(p,v){var b=p.delim==="\\vert"||p.delim==="|"?ui("|","text"):ui(p.delim,p.mode),L=new Ft.MathNode("mo",[b]);return L.setAttribute("fence","true"),L.setAttribute("lspace","0.05em"),L.setAttribute("rspace","0.05em"),L}});var gs=function(p,v){var b=ct.wrapFragment(mr(p.body,v),v),L=p.label.substr(1),V=v.sizeMultiplier,ee,pe=0,ye=k.isCharacterBox(p.body);if(L==="sout")ee=ct.makeSpan(["stretchy","sout"]),ee.height=v.fontMetrics().defaultRuleThickness/V,pe=-.5*v.fontMetrics().xHeight;else{/cancel/.test(L)?ye||b.classes.push("cancel-pad"):b.classes.push("boxpad");var De=0,je=0;/box/.test(L)?(je=Math.max(v.fontMetrics().fboxrule,v.minRuleThickness),De=v.fontMetrics().fboxsep+(L==="colorbox"?0:je)):De=ye?.2:0,ee=Bi.encloseSpan(b,L,De,v),/fbox|boxed|fcolorbox/.test(L)&&(ee.style.borderStyle="solid",ee.style.borderWidth=je+"em"),pe=b.depth+De,p.backgroundColor&&(ee.style.backgroundColor=p.backgroundColor,p.borderColor&&(ee.style.borderColor=p.borderColor))}var Qe;return p.backgroundColor?Qe=ct.makeVList({positionType:"individualShift",children:[{type:"elem",elem:ee,shift:pe},{type:"elem",elem:b,shift:0}]},v):Qe=ct.makeVList({positionType:"individualShift",children:[{type:"elem",elem:b,shift:0},{type:"elem",elem:ee,shift:pe,wrapperClasses:/cancel/.test(L)?["svg-align"]:[]}]},v),/cancel/.test(L)&&(Qe.height=b.height,Qe.depth=b.depth),/cancel/.test(L)&&!ye?ct.makeSpan(["mord","cancel-lap"],[Qe],v):ct.makeSpan(["mord"],[Qe],v)},Is=function(p,v){var b=0,L=new Ft.MathNode(p.label.indexOf("colorbox")>-1?"mpadded":"menclose",[or(p.body,v)]);switch(p.label){case"\\cancel":L.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":L.setAttribute("notation","downdiagonalstrike");break;case"\\sout":L.setAttribute("notation","horizontalstrike");break;case"\\fbox":L.setAttribute("notation","box");break;case"\\fcolorbox":case"\\colorbox":if(b=v.fontMetrics().fboxsep*v.fontMetrics().ptPerEm,L.setAttribute("width","+"+2*b+"pt"),L.setAttribute("height","+"+2*b+"pt"),L.setAttribute("lspace",b+"pt"),L.setAttribute("voffset",b+"pt"),p.label==="\\fcolorbox"){var V=Math.max(v.fontMetrics().fboxrule,v.minRuleThickness);L.setAttribute("style","border: "+V+"em solid "+String(p.borderColor))}break;case"\\xcancel":L.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return p.backgroundColor&&L.setAttribute("mathbackground",p.backgroundColor),L};Yt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,greediness:3,argTypes:["color","text"]},handler:function(p,v,b){var L=p.parser,V=p.funcName,ee=fr(v[0],"color-token").color,pe=v[1];return{type:"enclose",mode:L.mode,label:V,backgroundColor:ee,body:pe}},htmlBuilder:gs,mathmlBuilder:Is}),Yt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,greediness:3,argTypes:["color","color","text"]},handler:function(p,v,b){var L=p.parser,V=p.funcName,ee=fr(v[0],"color-token").color,pe=fr(v[1],"color-token").color,ye=v[2];return{type:"enclose",mode:L.mode,label:V,backgroundColor:pe,borderColor:ee,body:ye}},htmlBuilder:gs,mathmlBuilder:Is}),Yt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:function(p,v){var b=p.parser;return{type:"enclose",mode:b.mode,label:"\\fbox",body:v[0]}}}),Yt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout"],props:{numArgs:1},handler:function(p,v,b){var L=p.parser,V=p.funcName,ee=v[0];return{type:"enclose",mode:L.mode,label:V,body:ee}},htmlBuilder:gs,mathmlBuilder:Is});var ka={};function Nn(te){for(var p=te.type,v=te.names,b=te.props,L=te.handler,V=te.htmlBuilder,ee=te.mathmlBuilder,pe={type:p,numArgs:b.numArgs||0,greediness:1,allowedInText:!1,numOptionalArgs:0,handler:L},ye=0;ye<v.length;++ye)ka[v[ye]]=pe;V&&(Ki[p]=V),ee&&(hi[p]=ee)}function Ia(te){var p=[];te.consumeSpaces();for(var v=te.fetch().text;v==="\\hline"||v==="\\hdashline";)te.consume(),p.push(v==="\\hdashline"),te.consumeSpaces(),v=te.fetch().text;return p}function Yn(te,p,v){var b=p.hskipBeforeAndAfter,L=p.addJot,V=p.cols,ee=p.arraystretch,pe=p.colSeparationType;if(te.gullet.beginGroup(),te.gullet.macros.set("\\\\","\\cr"),!ee){var ye=te.gullet.expandMacroAsText("\\arraystretch");if(ye==null)ee=1;else if(ee=parseFloat(ye),!ee||ee<0)throw new d("Invalid \\arraystretch: "+ye)}te.gullet.beginGroup();var De=[],je=[De],Qe=[],mt=[];for(mt.push(Ia(te));;){var Dt=te.parseExpression(!1,"\\cr");te.gullet.endGroup(),te.gullet.beginGroup(),Dt={type:"ordgroup",mode:te.mode,body:Dt},v&&(Dt={type:"styling",mode:te.mode,style:v,body:[Dt]}),De.push(Dt);var It=te.fetch().text;if(It==="&")te.consume();else if(It==="\\end"){De.length===1&&Dt.type==="styling"&&Dt.body[0].body.length===0&&je.pop(),mt.length<je.length+1&&mt.push([]);break}else if(It==="\\cr"){var $t=fr(te.parseFunction(),"cr");Qe.push($t.size),mt.push(Ia(te)),De=[],je.push(De)}else throw new d("Expected & or \\\\ or \\cr or \\end",te.nextToken)}return te.gullet.endGroup(),te.gullet.endGroup(),{type:"array",mode:te.mode,addJot:L,arraystretch:ee,body:je,cols:V,rowGaps:Qe,hskipBeforeAndAfter:b,hLinesBeforeRow:mt,colSeparationType:pe}}function Ps(te){return te.substr(0,1)==="d"?"display":"text"}var Tn=function(p,v){var b,L,V=p.body.length,ee=p.hLinesBeforeRow,pe=0,ye=new Array(V),De=[],je=Math.max(v.fontMetrics().arrayRuleWidth,v.minRuleThickness),Qe=1/v.fontMetrics().ptPerEm,mt=5*Qe;if(p.colSeparationType&&p.colSeparationType==="small"){var Dt=v.havingStyle(B.SCRIPT).sizeMultiplier;mt=.2778*(Dt/v.sizeMultiplier)}var It=12*Qe,$t=3*Qe,Qt=p.arraystretch*It,er=.7*Qt,lr=.3*Qt,vr=0;function jr(xs){for(var Hs=0;Hs<xs.length;++Hs)Hs>0&&(vr+=.25),De.push({pos:vr,isDashed:xs[Hs]})}for(jr(ee[0]),b=0;b<p.body.length;++b){var Fr=p.body[b],Wr=er,Gr=lr;pe<Fr.length&&(pe=Fr.length);var zr=new Array(Fr.length);for(L=0;L<Fr.length;++L){var yi=mr(Fr[L],v);Gr<yi.depth&&(Gr=yi.depth),Wr<yi.height&&(Wr=yi.height),zr[L]=yi}var qr=p.rowGaps[b],Ve=0;qr&&(Ve=Sr(qr,v),Ve>0&&(Ve+=lr,Gr<Ve&&(Gr=Ve),Ve=0)),p.addJot&&(Gr+=$t),zr.height=Wr,zr.depth=Gr,vr+=Wr,zr.pos=vr,vr+=Gr+Ve,ye[b]=zr,jr(ee[b+1])}var Ni=vr/2+v.fontMetrics().axisHeight,hn=p.cols||[],Zi=[],ri,$n;for(L=0,$n=0;L<pe||$n<hn.length;++L,++$n){for(var fn=hn[$n]||{},io=!0;fn.type==="separator";){if(io||(ri=ct.makeSpan(["arraycolsep"],[]),ri.style.width=v.fontMetrics().doubleRuleSep+"em",Zi.push(ri)),fn.separator==="|"||fn.separator===":"){var Bo=fn.separator==="|"?"solid":"dashed",cs=ct.makeSpan(["vertical-separator"],[],v);cs.style.height=vr+"em",cs.style.borderRightWidth=je+"em",cs.style.borderRightStyle=Bo,cs.style.margin="0 -"+je/2+"em",cs.style.verticalAlign=-(vr-Ni)+"em",Zi.push(cs)}else throw new d("Invalid separator type: "+fn.separator);$n++,fn=hn[$n]||{},io=!1}if(!(L>=pe)){var hs=void 0;(L>0||p.hskipBeforeAndAfter)&&(hs=k.deflt(fn.pregap,mt),hs!==0&&(ri=ct.makeSpan(["arraycolsep"],[]),ri.style.width=hs+"em",Zi.push(ri)));var Xi=[];for(b=0;b<V;++b){var fs=ye[b],Es=fs[L];if(Es){var $s=fs.pos-Ni;Es.depth=fs.depth,Es.height=fs.height,Xi.push({type:"elem",elem:Es,shift:$s})}}Xi=ct.makeVList({positionType:"individualShift",children:Xi},v),Xi=ct.makeSpan(["col-align-"+(fn.align||"c")],[Xi]),Zi.push(Xi),(L<pe-1||p.hskipBeforeAndAfter)&&(hs=k.deflt(fn.postgap,mt),hs!==0&&(ri=ct.makeSpan(["arraycolsep"],[]),ri.style.width=hs+"em",Zi.push(ri)))}}if(ye=ct.makeSpan(["mtable"],Zi),De.length>0){for(var Ui=ct.makeLineSpan("hline",v,je),No=ct.makeLineSpan("hdashline",v,je),zs=[{type:"elem",elem:ye,shift:0}];De.length>0;){var ba=De.pop(),no=ba.pos-Ni;ba.isDashed?zs.push({type:"elem",elem:No,shift:no}):zs.push({type:"elem",elem:Ui,shift:no})}ye=ct.makeVList({positionType:"individualShift",children:zs},v)}return ct.makeSpan(["mord"],[ye],v)},ra={c:"center ",l:"left ",r:"right "},Dn=function(p,v){var b=new Ft.MathNode("mtable",p.body.map(function(vr){return new Ft.MathNode("mtr",vr.map(function(jr){return new Ft.MathNode("mtd",[or(jr,v)])}))})),L=p.arraystretch===.5?.1:.16+p.arraystretch-1+(p.addJot?.09:0);b.setAttribute("rowspacing",L+"em");var V="",ee="";if(p.cols){var pe=p.cols,ye="",De=!1,je=0,Qe=pe.length;pe[0].type==="separator"&&(V+="top ",je=1),pe[pe.length-1].type==="separator"&&(V+="bottom ",Qe-=1);for(var mt=je;mt<Qe;mt++)pe[mt].type==="align"?(ee+=ra[pe[mt].align],De&&(ye+="none "),De=!0):pe[mt].type==="separator"&&De&&(ye+=pe[mt].separator==="|"?"solid ":"dashed ",De=!1);b.setAttribute("columnalign",ee.trim()),/[sd]/.test(ye)&&b.setAttribute("columnlines",ye.trim())}if(p.colSeparationType==="align"){for(var Dt=p.cols||[],It="",$t=1;$t<Dt.length;$t++)It+=$t%2?"0em ":"1em ";b.setAttribute("columnspacing",It.trim())}else p.colSeparationType==="alignat"?b.setAttribute("columnspacing","0em"):p.colSeparationType==="small"?b.setAttribute("columnspacing","0.2778em"):b.setAttribute("columnspacing","1em");var Qt="",er=p.hLinesBeforeRow;V+=er[0].length>0?"left ":"",V+=er[er.length-1].length>0?"right ":"";for(var lr=1;lr<er.length-1;lr++)Qt+=er[lr].length===0?"none ":er[lr][0]?"dashed ":"solid ";return/[sd]/.test(Qt)&&b.setAttribute("rowlines",Qt.trim()),V!==""&&(b=new Ft.MathNode("menclose",[b]),b.setAttribute("notation",V.trim())),p.arraystretch&&p.arraystretch<1&&(b=new Ft.MathNode("mstyle",[b]),b.setAttribute("scriptlevel","1")),b},ia=function(p,v){var b=[],L=Yn(p.parser,{cols:b,addJot:!0},"display"),V,ee=0,pe={type:"ordgroup",mode:p.mode,body:[]},ye=Vr(v[0],"ordgroup");if(ye){for(var De="",je=0;je<ye.body.length;je++){var Qe=fr(ye.body[je],"textord");De+=Qe.text}V=Number(De),ee=V*2}var mt=!ee;L.body.forEach(function(Qt){for(var er=1;er<Qt.length;er+=2){var lr=fr(Qt[er],"styling"),vr=fr(lr.body[0],"ordgroup");vr.body.unshift(pe)}if(mt)ee<Qt.length&&(ee=Qt.length);else{var jr=Qt.length/2;if(V<jr)throw new d("Too many math in a row: "+("expected "+V+", but got "+jr),Qt[0])}});for(var Dt=0;Dt<ee;++Dt){var It="r",$t=0;Dt%2===1?It="l":Dt>0&&mt&&($t=1),b[Dt]={type:"align",align:It,pregap:$t,postgap:0}}return L.colSeparationType=mt?"align":"alignat",L};Nn({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(p,v){var b=Ei(v[0]),L=b?[v[0]]:fr(v[0],"ordgroup").body,V=L.map(function(pe){var ye=Gi(pe),De=ye.text;if("lcr".indexOf(De)!==-1)return{type:"align",align:De};if(De==="|")return{type:"separator",separator:"|"};if(De===":")return{type:"separator",separator:":"};throw new d("Unknown column alignment: "+De,pe)}),ee={cols:V,hskipBeforeAndAfter:!0};return Yn(p.parser,ee,Ps(p.envName))},htmlBuilder:Tn,mathmlBuilder:Dn}),Nn({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],b={hskipBeforeAndAfter:!1},L=Yn(p.parser,b,Ps(p.envName));return v?{type:"leftright",mode:p.mode,body:[L],left:v[0],right:v[1],rightColor:void 0}:L},htmlBuilder:Tn,mathmlBuilder:Dn}),Nn({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(p){var v={arraystretch:.5},b=Yn(p.parser,v,"script");return b.colSeparationType="small",b},htmlBuilder:Tn,mathmlBuilder:Dn}),Nn({type:"array",names:["subarray"],props:{numArgs:1},handler:function(p,v){var b=Ei(v[0]),L=b?[v[0]]:fr(v[0],"ordgroup").body,V=L.map(function(pe){var ye=Gi(pe),De=ye.text;if("lc".indexOf(De)!==-1)return{type:"align",align:De};throw new d("Unknown column alignment: "+De,pe)});if(V.length>1)throw new d("{subarray} can contain only one column");var ee={cols:V,hskipBeforeAndAfter:!1,arraystretch:.5};if(ee=Yn(p.parser,ee,"script"),ee.body[0].length>1)throw new d("{subarray} can contain only one column");return ee},htmlBuilder:Tn,mathmlBuilder:Dn}),Nn({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}]},b=Yn(p.parser,v,Ps(p.envName));return{type:"leftright",mode:p.mode,body:[b],left:"\\{",right:".",rightColor:void 0}},htmlBuilder:Tn,mathmlBuilder:Dn}),Nn({type:"array",names:["aligned"],props:{numArgs:0},handler:ia,htmlBuilder:Tn,mathmlBuilder:Dn}),Nn({type:"array",names:["gathered"],props:{numArgs:0},handler:function(p){var v={cols:[{type:"align",align:"c"}],addJot:!0};return Yn(p.parser,v,"display")},htmlBuilder:Tn,mathmlBuilder:Dn}),Nn({type:"array",names:["alignedat"],props:{numArgs:1},handler:ia,htmlBuilder:Tn,mathmlBuilder:Dn}),Yt({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 Pa=ka,na=Pa;Yt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler:function(p,v){var b=p.parser,L=p.funcName,V=v[0];if(V.type!=="ordgroup")throw new d("Invalid environment name",V);for(var ee="",pe=0;pe<V.body.length;++pe)ee+=fr(V.body[pe],"textord").text;if(L==="\\begin"){if(!na.hasOwnProperty(ee))throw new d("No such environment: "+ee,V);var ye=na[ee],De=b.parseArguments("\\begin{"+ee+"}",ye),je=De.args,Qe=De.optArgs,mt={mode:b.mode,envName:ee,parser:b},Dt=ye.handler(mt,je,Qe);b.expect("\\end",!1);var It=b.nextToken,$t=fr(b.parseFunction(),"environment");if($t.name!==ee)throw new d("Mismatch: \\begin{"+ee+"} matched by \\end{"+$t.name+"}",It);return Dt}return{type:"environment",mode:b.mode,name:ee,nameGroup:V}}});var Oa=ct.makeSpan;function Ma(te,p){var v=Xr(te.body,p,!0);return Oa([te.mclass],v,p)}function sa(te,p){var v,b=mi(te.body,p);return te.mclass==="minner"?Ft.newDocumentFragment(b):(te.mclass==="mord"?te.isCharacterBox?(v=b[0],v.type="mi"):v=new Ft.MathNode("mi",b):(te.isCharacterBox?(v=b[0],v.type="mo"):v=new Ft.MathNode("mo",b),te.mclass==="mbin"?(v.attributes.lspace="0.22em",v.attributes.rspace="0.22em"):te.mclass==="mpunct"?(v.attributes.lspace="0em",v.attributes.rspace="0.17em"):(te.mclass==="mopen"||te.mclass==="mclose")&&(v.attributes.lspace="0em",v.attributes.rspace="0em")),v)}Yt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1},handler:function(p,v){var b=p.parser,L=p.funcName,V=v[0];return{type:"mclass",mode:b.mode,mclass:"m"+L.substr(5),body:Qr(V),isCharacterBox:k.isCharacterBox(V)}},htmlBuilder:Ma,mathmlBuilder:sa});var Zn=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"};Yt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:function(p,v){var b=p.parser;return{type:"mclass",mode:b.mode,mclass:Zn(v[0]),body:[v[1]],isCharacterBox:k.isCharacterBox(v[1])}}}),Yt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler:function(p,v){var b=p.parser,L=p.funcName,V=v[1],ee=v[0],pe;L!=="\\stackrel"?pe=Zn(V):pe="mrel";var ye={type:"op",mode:V.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:L!=="\\stackrel",body:Qr(V)},De={type:"supsub",mode:ee.mode,base:ye,sup:L==="\\underset"?null:ee,sub:L==="\\underset"?ee:null};return{type:"mclass",mode:b.mode,mclass:pe,body:[De],isCharacterBox:k.isCharacterBox(De)}},htmlBuilder:Ma,mathmlBuilder:sa});var Fa=function(p,v){var b=p.font,L=v.withFont(b);return mr(p.body,L)},aa=function(p,v){var b=p.font,L=v.withFont(b);return or(p.body,L)},oa={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Yt({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 b=p.parser,L=p.funcName,V=v[0],ee=L;return ee in oa&&(ee=oa[ee]),{type:"font",mode:b.mode,font:ee.slice(1),body:V}},htmlBuilder:Fa,mathmlBuilder:aa}),Yt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1,greediness:2},handler:function(p,v){var b=p.parser,L=v[0],V=k.isCharacterBox(L);return{type:"mclass",mode:b.mode,mclass:Zn(L),body:[{type:"font",mode:b.mode,font:"boldsymbol",body:L}],isCharacterBox:V}}}),Yt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it"],props:{numArgs:0,allowedInText:!0},handler:function(p,v){var b=p.parser,L=p.funcName,V=p.breakOnTokenText,ee=b.mode,pe=b.parseExpression(!0,V),ye="math"+L.slice(1);return{type:"font",mode:ee,font:ye,body:{type:"ordgroup",mode:b.mode,body:pe}}},htmlBuilder:Fa,mathmlBuilder:aa});var Ba=function(p,v){var b=v;return p==="display"?b=b.id>=B.SCRIPT.id?b.text():B.DISPLAY:p==="text"&&b.size===B.DISPLAY.size?b=B.TEXT:p==="script"?b=B.SCRIPT:p==="scriptscript"&&(b=B.SCRIPTSCRIPT),b},Os=function(p,v){var b=Ba(p.size,v.style),L=b.fracNum(),V=b.fracDen(),ee;ee=v.havingStyle(L);var pe=mr(p.numer,ee,v);if(p.continued){var ye=8.5/v.fontMetrics().ptPerEm,De=3.5/v.fontMetrics().ptPerEm;pe.height=pe.height<ye?ye:pe.height,pe.depth=pe.depth<De?De:pe.depth}ee=v.havingStyle(V);var je=mr(p.denom,ee,v),Qe,mt,Dt;p.hasBarLine?(p.barSize?(mt=Sr(p.barSize,v),Qe=ct.makeLineSpan("frac-line",v,mt)):Qe=ct.makeLineSpan("frac-line",v),mt=Qe.height,Dt=Qe.height):(Qe=null,mt=0,Dt=v.fontMetrics().defaultRuleThickness);var It,$t,Qt;b.size===B.DISPLAY.size||p.size==="display"?(It=v.fontMetrics().num1,mt>0?$t=3*Dt:$t=7*Dt,Qt=v.fontMetrics().denom1):(mt>0?(It=v.fontMetrics().num2,$t=Dt):(It=v.fontMetrics().num3,$t=3*Dt),Qt=v.fontMetrics().denom2);var er;if(Qe){var vr=v.fontMetrics().axisHeight;It-pe.depth-(vr+.5*mt)<$t&&(It+=$t-(It-pe.depth-(vr+.5*mt))),vr-.5*mt-(je.height-Qt)<$t&&(Qt+=$t-(vr-.5*mt-(je.height-Qt)));var jr=-(vr-.5*mt);er=ct.makeVList({positionType:"individualShift",children:[{type:"elem",elem:je,shift:Qt},{type:"elem",elem:Qe,shift:jr},{type:"elem",elem:pe,shift:-It}]},v)}else{var lr=It-pe.depth-(je.height-Qt);lr<$t&&(It+=.5*($t-lr),Qt+=.5*($t-lr)),er=ct.makeVList({positionType:"individualShift",children:[{type:"elem",elem:je,shift:Qt},{type:"elem",elem:pe,shift:-It}]},v)}ee=v.havingStyle(b),er.height*=ee.sizeMultiplier/v.sizeMultiplier,er.depth*=ee.sizeMultiplier/v.sizeMultiplier;var Fr;b.size===B.DISPLAY.size?Fr=v.fontMetrics().delim1:Fr=v.fontMetrics().delim2;var Wr,Gr;return p.leftDelim==null?Wr=Ri(v,["mopen"]):Wr=un.customSizedDelim(p.leftDelim,Fr,!0,v.havingStyle(b),p.mode,["mopen"]),p.continued?Gr=ct.makeSpan([]):p.rightDelim==null?Gr=Ri(v,["mclose"]):Gr=un.customSizedDelim(p.rightDelim,Fr,!0,v.havingStyle(b),p.mode,["mclose"]),ct.makeSpan(["mord"].concat(ee.sizingClasses(v)),[Wr,ct.makeSpan(["mfrac"],[er]),Gr],v)},ss=function(p,v){var b=new Ft.MathNode("mfrac",[or(p.numer,v),or(p.denom,v)]);if(!p.hasBarLine)b.setAttribute("linethickness","0px");else if(p.barSize){var L=Sr(p.barSize,v);b.setAttribute("linethickness",L+"em")}var V=Ba(p.size,v.style);if(V.size!==v.style.size){b=new Ft.MathNode("mstyle",[b]);var ee=V.size===B.DISPLAY.size?"true":"false";b.setAttribute("displaystyle",ee),b.setAttribute("scriptlevel","0")}if(p.leftDelim!=null||p.rightDelim!=null){var pe=[];if(p.leftDelim!=null){var ye=new Ft.MathNode("mo",[new Ft.TextNode(p.leftDelim.replace("\\",""))]);ye.setAttribute("fence","true"),pe.push(ye)}if(pe.push(b),p.rightDelim!=null){var De=new Ft.MathNode("mo",[new Ft.TextNode(p.rightDelim.replace("\\",""))]);De.setAttribute("fence","true"),pe.push(De)}return In(pe)}return b};Yt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,greediness:2},handler:function(p,v){var b=p.parser,L=p.funcName,V=v[0],ee=v[1],pe,ye=null,De=null,je="auto";switch(L){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":pe=!0;break;case"\\\\atopfrac":pe=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":pe=!1,ye="(",De=")";break;case"\\\\bracefrac":pe=!1,ye="\\{",De="\\}";break;case"\\\\brackfrac":pe=!1,ye="[",De="]";break;default:throw new Error("Unrecognized genfrac command")}switch(L){case"\\cfrac":case"\\dfrac":case"\\dbinom":je="display";break;case"\\tfrac":case"\\tbinom":je="text";break}return{type:"genfrac",mode:b.mode,continued:L==="\\cfrac",numer:V,denom:ee,hasBarLine:pe,leftDelim:ye,rightDelim:De,size:je,barSize:null}},htmlBuilder:Os,mathmlBuilder:ss}),Yt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler:function(p){var v=p.parser,b=p.funcName,L=p.token,V;switch(b){case"\\over":V="\\frac";break;case"\\choose":V="\\binom";break;case"\\atop":V="\\\\atopfrac";break;case"\\brace":V="\\\\bracefrac";break;case"\\brack":V="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:v.mode,replaceWith:V,token:L}}});var _i=["display","text","script","scriptscript"],xi=function(p){var v=null;return p.length>0&&(v=p,v=v==="."?null:v),v};Yt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,greediness:6,argTypes:["math","math","size","text","math","math"]},handler:function(p,v){var b=p.parser,L=v[4],V=v[5],ee=Vr(v[0],"atom");ee&&(ee=yn(v[0],"open"));var pe=ee?xi(ee.text):null,ye=Vr(v[1],"atom");ye&&(ye=yn(v[1],"close"));var De=ye?xi(ye.text):null,je=fr(v[2],"size"),Qe,mt=null;je.isBlank?Qe=!0:(mt=je.value,Qe=mt.number>0);var Dt="auto",It=Vr(v[3],"ordgroup");if(It){if(It.body.length>0){var $t=fr(It.body[0],"textord");Dt=_i[Number($t.text)]}}else It=fr(v[3],"textord"),Dt=_i[Number(It.text)];return{type:"genfrac",mode:b.mode,numer:L,denom:V,continued:!1,hasBarLine:Qe,barSize:mt,leftDelim:pe,rightDelim:De,size:Dt}},htmlBuilder:Os,mathmlBuilder:ss}),Yt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(p,v){var b=p.parser,L=p.funcName,V=p.token;return{type:"infix",mode:b.mode,replaceWith:"\\\\abovefrac",size:fr(v[0],"size").value,token:V}}}),Yt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(p,v){var b=p.parser,L=p.funcName,V=v[0],ee=C(fr(v[1],"infix").size),pe=v[2],ye=ee.number>0;return{type:"genfrac",mode:b.mode,numer:V,denom:pe,continued:!1,hasBarLine:ye,barSize:ee,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Os,mathmlBuilder:ss});var Na=function(p,v){var b=v.style,L,V,ee=Vr(p,"supsub");ee?(L=ee.sup?mr(ee.sup,v.havingStyle(b.sup()),v):mr(ee.sub,v.havingStyle(b.sub()),v),V=fr(ee.base,"horizBrace")):V=fr(p,"horizBrace");var pe=mr(V.base,v.havingBaseStyle(B.DISPLAY)),ye=Bi.svgSpan(V,v),De;if(V.isOver?(De=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:pe},{type:"kern",size:.1},{type:"elem",elem:ye}]},v),De.children[0].children[0].children[1].classes.push("svg-align")):(De=ct.makeVList({positionType:"bottom",positionData:pe.depth+.1+ye.height,children:[{type:"elem",elem:ye},{type:"kern",size:.1},{type:"elem",elem:pe}]},v),De.children[0].children[0].children[0].classes.push("svg-align")),L){var je=ct.makeSpan(["mord",V.isOver?"mover":"munder"],[De],v);V.isOver?De=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:je},{type:"kern",size:.2},{type:"elem",elem:L}]},v):De=ct.makeVList({positionType:"bottom",positionData:je.depth+.2+L.height+L.depth,children:[{type:"elem",elem:L},{type:"kern",size:.2},{type:"elem",elem:je}]},v)}return ct.makeSpan(["mord",V.isOver?"mover":"munder"],[De],v)},Et=function(p,v){var b=Bi.mathMLnode(p.label);return new Ft.MathNode(p.isOver?"mover":"munder",[or(p.base,v),b])};Yt({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(p,v){var b=p.parser,L=p.funcName;return{type:"horizBrace",mode:b.mode,label:L,isOver:/^\\over/.test(L),base:v[0]}},htmlBuilder:Na,mathmlBuilder:Et}),Yt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(p,v){var b=p.parser,L=v[1],V=fr(v[0],"url").url;return b.settings.isTrusted({command:"\\href",url:V})?{type:"href",mode:b.mode,href:V,body:Qr(L)}:b.formatUnsupportedCmd("\\href")},htmlBuilder:function(p,v){var b=Xr(p.body,v,!1);return ct.makeAnchor(p.href,[],b,v)},mathmlBuilder:function(p,v){var b=zi(p.body,v);return b instanceof li||(b=new li("mrow",[b])),b.setAttribute("href",p.href),b}}),Yt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(p,v){var b=p.parser,L=fr(v[0],"url").url;if(!b.settings.isTrusted({command:"\\url",url:L}))return b.formatUnsupportedCmd("\\url");for(var V=[],ee=0;ee<L.length;ee++){var pe=L[ee];pe==="~"&&(pe="\\textasciitilde"),V.push({type:"textord",mode:"text",text:pe})}var ye={type:"text",mode:b.mode,font:"\\texttt",body:V};return{type:"href",mode:b.mode,href:L,body:Qr(ye)}}}),Yt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:function(p,v){var b=p.parser;return{type:"htmlmathml",mode:b.mode,html:Qr(v[0]),mathml:Qr(v[1])}},htmlBuilder:function(p,v){var b=Xr(p.html,v,!1);return ct.makeFragment(b)},mathmlBuilder:function(p,v){return zi(p.mathml,v)}});var _s=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 b={number:+(v[1]+v[2]),unit:v[3]};if(!Nr(b))throw new d("Invalid unit: '"+b.unit+"' in \\includegraphics.");return b};Yt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:function(p,v,b){var L=p.parser,V={number:0,unit:"em"},ee={number:.9,unit:"em"},pe={number:0,unit:"em"},ye="";if(b[0])for(var De=fr(b[0],"raw").string,je=De.split(","),Qe=0;Qe<je.length;Qe++){var mt=je[Qe].split("=");if(mt.length===2){var Dt=mt[1].trim();switch(mt[0].trim()){case"alt":ye=Dt;break;case"width":V=_s(Dt);break;case"height":ee=_s(Dt);break;case"totalheight":pe=_s(Dt);break;default:throw new d("Invalid key: '"+mt[0]+"' in \\includegraphics.")}}}var It=fr(v[0],"url").url;return ye===""&&(ye=It,ye=ye.replace(/^.*[\\/]/,""),ye=ye.substring(0,ye.lastIndexOf("."))),L.settings.isTrusted({command:"\\includegraphics",url:It})?{type:"includegraphics",mode:L.mode,alt:ye,width:V,height:ee,totalheight:pe,src:It}:L.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:function(p,v){var b=Sr(p.height,v),L=0;p.totalheight.number>0&&(L=Sr(p.totalheight,v)-b,L=Number(L.toFixed(2)));var V=0;p.width.number>0&&(V=Sr(p.width,v));var ee={height:b+L+"em"};V>0&&(ee.width=V+"em"),L>0&&(ee.verticalAlign=-L+"em");var pe=new rt(p.src,p.alt,ee);return pe.height=b,pe.depth=L,pe},mathmlBuilder:function(p,v){var b=new Ft.MathNode("mglyph",[]);b.setAttribute("alt",p.alt);var L=Sr(p.height,v),V=0;if(p.totalheight.number>0&&(V=Sr(p.totalheight,v)-L,V=V.toFixed(2),b.setAttribute("valign","-"+V+"em")),b.setAttribute("height",L+V+"em"),p.width.number>0){var ee=Sr(p.width,v);b.setAttribute("width",ee+"em")}return b.setAttribute("src",p.src),b}}),Yt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],allowedInText:!0},handler:function(p,v){var b=p.parser,L=p.funcName,V=fr(v[0],"size");if(b.settings.strict){var ee=L[1]==="m",pe=V.value.unit==="mu";ee?(pe||b.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+L+" supports only mu units, "+("not "+V.value.unit+" units")),b.mode!=="math"&&b.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+L+" works only in math mode")):pe&&b.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+L+" doesn't support mu units")}return{type:"kern",mode:b.mode,dimension:V.value}},htmlBuilder:function(p,v){return ct.makeGlue(p.dimension,v)},mathmlBuilder:function(p,v){var b=Sr(p.dimension,v);return new Ft.SpaceNode(b)}}),Yt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var b=p.parser,L=p.funcName,V=v[0];return{type:"lap",mode:b.mode,alignment:L.slice(5),body:V}},htmlBuilder:function(p,v){var b;p.alignment==="clap"?(b=ct.makeSpan([],[mr(p.body,v)]),b=ct.makeSpan(["inner"],[b],v)):b=ct.makeSpan(["inner"],[mr(p.body,v)]);var L=ct.makeSpan(["fix"],[]),V=ct.makeSpan([p.alignment],[b,L],v),ee=ct.makeSpan(["strut"]);return ee.style.height=V.height+V.depth+"em",ee.style.verticalAlign=-V.depth+"em",V.children.unshift(ee),V=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:V}]},v),ct.makeSpan(["mord"],[V],v)},mathmlBuilder:function(p,v){var b=new Ft.MathNode("mpadded",[or(p.body,v)]);if(p.alignment!=="rlap"){var L=p.alignment==="llap"?"-1":"-0.5";b.setAttribute("lspace",L+"width")}return b.setAttribute("width","0px"),b}}),Yt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(p,v){var b=p.funcName,L=p.parser,V=L.mode;L.switchMode("math");var ee=b==="\\("?"\\)":"$",pe=L.parseExpression(!1,ee);return L.expect(ee),L.switchMode(V),{type:"styling",mode:L.mode,style:"text",body:pe}}}),Yt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(p,v){throw new d("Mismatched "+p.funcName)}});var la=function(p,v){switch(v.style.size){case B.DISPLAY.size:return p.display;case B.TEXT.size:return p.text;case B.SCRIPT.size:return p.script;case B.SCRIPTSCRIPT.size:return p.scriptscript;default:return p.text}};Yt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4},handler:function(p,v){var b=p.parser;return{type:"mathchoice",mode:b.mode,display:Qr(v[0]),text:Qr(v[1]),script:Qr(v[2]),scriptscript:Qr(v[3])}},htmlBuilder:function(p,v){var b=la(p,v),L=Xr(b,v,!1);return ct.makeFragment(L)},mathmlBuilder:function(p,v){var b=la(p,v);return zi(b,v)}});var ua=function(p,v,b,L,V,ee,pe){p=ct.makeSpan([],[p]);var ye,De;if(v){var je=mr(v,L.havingStyle(V.sup()),L);De={elem:je,kern:Math.max(L.fontMetrics().bigOpSpacing1,L.fontMetrics().bigOpSpacing3-je.depth)}}if(b){var Qe=mr(b,L.havingStyle(V.sub()),L);ye={elem:Qe,kern:Math.max(L.fontMetrics().bigOpSpacing2,L.fontMetrics().bigOpSpacing4-Qe.height)}}var mt;if(De&&ye){var Dt=L.fontMetrics().bigOpSpacing5+ye.elem.height+ye.elem.depth+ye.kern+p.depth+pe;mt=ct.makeVList({positionType:"bottom",positionData:Dt,children:[{type:"kern",size:L.fontMetrics().bigOpSpacing5},{type:"elem",elem:ye.elem,marginLeft:-ee+"em"},{type:"kern",size:ye.kern},{type:"elem",elem:p},{type:"kern",size:De.kern},{type:"elem",elem:De.elem,marginLeft:ee+"em"},{type:"kern",size:L.fontMetrics().bigOpSpacing5}]},L)}else if(ye){var It=p.height-pe;mt=ct.makeVList({positionType:"top",positionData:It,children:[{type:"kern",size:L.fontMetrics().bigOpSpacing5},{type:"elem",elem:ye.elem,marginLeft:-ee+"em"},{type:"kern",size:ye.kern},{type:"elem",elem:p}]},L)}else if(De){var $t=p.depth+pe;mt=ct.makeVList({positionType:"bottom",positionData:$t,children:[{type:"elem",elem:p},{type:"kern",size:De.kern},{type:"elem",elem:De.elem,marginLeft:ee+"em"},{type:"kern",size:L.fontMetrics().bigOpSpacing5}]},L)}else return p;return ct.makeSpan(["mop","op-limits"],[mt],L)},Ua=["\\smallint"],Un=function(p,v){var b,L,V=!1,ee,pe=Vr(p,"supsub");pe?(b=pe.sup,L=pe.sub,ee=fr(pe.base,"op"),V=!0):ee=fr(p,"op");var ye=v.style,De=!1;ye.size===B.DISPLAY.size&&ee.symbol&&!k.contains(Ua,ee.name)&&(De=!0);var je;if(ee.symbol){var Qe=De?"Size2-Regular":"Size1-Regular",mt="";if((ee.name==="\\oiint"||ee.name==="\\oiiint")&&(mt=ee.name.substr(1),ee.name=mt==="oiint"?"\\iint":"\\iiint"),je=ct.makeSymbol(ee.name,Qe,"math",v,["mop","op-symbol",De?"large-op":"small-op"]),mt.length>0){var Dt=je.italic,It=ct.staticSvg(mt+"Size"+(De?"2":"1"),v);je=ct.makeVList({positionType:"individualShift",children:[{type:"elem",elem:je,shift:0},{type:"elem",elem:It,shift:De?.08:0}]},v),ee.name="\\"+mt,je.classes.unshift("mop"),je.italic=Dt}}else if(ee.body){var $t=Xr(ee.body,v,!0);$t.length===1&&$t[0]instanceof Le?(je=$t[0],je.classes[0]="mop"):je=ct.makeSpan(["mop"],ct.tryCombineChars($t),v)}else{for(var Qt=[],er=1;er<ee.name.length;er++)Qt.push(ct.mathsym(ee.name[er],ee.mode,v));je=ct.makeSpan(["mop"],Qt,v)}var lr=0,vr=0;return(je instanceof Le||ee.name==="\\oiint"||ee.name==="\\oiiint")&&!ee.suppressBaseShift&&(lr=(je.height-je.depth)/2-v.fontMetrics().axisHeight,vr=je.italic),V?ua(je,b,L,v,ye,vr,lr):(lr&&(je.style.position="relative",je.style.top=lr+"em"),je)},as=function(p,v){var b;if(p.symbol)b=new li("mo",[ui(p.name,p.mode)]),k.contains(Ua,p.name)&&b.setAttribute("largeop","false");else if(p.body)b=new li("mo",mi(p.body,v));else{b=new li("mi",[new nr(p.name.slice(1))]);var L=new li("mo",[ui("\u2061","text")]);p.parentIsSupSub?b=new li("mo",[b,L]):b=nn([b,L])}return b},Ao={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};Yt({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 b=p.parser,L=p.funcName,V=L;return V.length===1&&(V=Ao[V]),{type:"op",mode:b.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:V}},htmlBuilder:Un,mathmlBuilder:as}),Yt({type:"op",names:["\\mathop"],props:{numArgs:1},handler:function(p,v){var b=p.parser,L=v[0];return{type:"op",mode:b.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Qr(L)}},htmlBuilder:Un,mathmlBuilder:as});var To={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};Yt({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,b=p.funcName;return{type:"op",mode:v.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:b}},htmlBuilder:Un,mathmlBuilder:as}),Yt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler:function(p){var v=p.parser,b=p.funcName;return{type:"op",mode:v.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:b}},htmlBuilder:Un,mathmlBuilder:as}),Yt({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,b=p.funcName,L=b;return L.length===1&&(L=To[L]),{type:"op",mode:v.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:L}},htmlBuilder:Un,mathmlBuilder:as});var Ms=function(p,v){var b,L,V=!1,ee,pe=Vr(p,"supsub");pe?(b=pe.sup,L=pe.sub,ee=fr(pe.base,"operatorname"),V=!0):ee=fr(p,"operatorname");var ye;if(ee.body.length>0){for(var De=ee.body.map(function(Dt){var It=Dt.text;return typeof It=="string"?{type:"textord",mode:Dt.mode,text:It}:Dt}),je=Xr(De,v.withFont("mathrm"),!0),Qe=0;Qe<je.length;Qe++){var mt=je[Qe];mt instanceof Le&&(mt.text=mt.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}ye=ct.makeSpan(["mop"],je,v)}else ye=ct.makeSpan(["mop"],[],v);return V?ua(ye,b,L,v,v.style,0,0):ye},vs=function(p,v){for(var b=mi(p.body,v.withFont("mathrm")),L=!0,V=0;V<b.length;V++){var ee=b[V];if(!(ee instanceof Ft.SpaceNode))if(ee instanceof Ft.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 Ft.TextNode?pe.text=pe.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):L=!1;break}default:L=!1}else L=!1}if(L){var ye=b.map(function(Qe){return Qe.toText()}).join("");b=[new Ft.TextNode(ye)]}var De=new Ft.MathNode("mi",b);De.setAttribute("mathvariant","normal");var je=new Ft.MathNode("mo",[ui("\u2061","text")]);return p.parentIsSupSub?new Ft.MathNode("mo",[De,je]):Ft.newDocumentFragment([De,je])};Yt({type:"operatorname",names:["\\operatorname","\\operatorname*"],props:{numArgs:1},handler:function(p,v){var b=p.parser,L=p.funcName,V=v[0];return{type:"operatorname",mode:b.mode,body:Qr(V),alwaysHandleSupSub:L==="\\operatorname*",limits:!1,parentIsSupSub:!1}},htmlBuilder:Ms,mathmlBuilder:vs}),oi({type:"ordgroup",htmlBuilder:function(p,v){return p.semisimple?ct.makeFragment(Xr(p.body,v,!1)):ct.makeSpan(["mord"],Xr(p.body,v,!0),v)},mathmlBuilder:function(p,v){return zi(p.body,v,!0)}}),Yt({type:"overline",names:["\\overline"],props:{numArgs:1},handler:function(p,v){var b=p.parser,L=v[0];return{type:"overline",mode:b.mode,body:L}},htmlBuilder:function(p,v){var b=mr(p.body,v.havingCrampedStyle()),L=ct.makeLineSpan("overline-line",v),V=v.fontMetrics().defaultRuleThickness,ee=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:b},{type:"kern",size:3*V},{type:"elem",elem:L},{type:"kern",size:V}]},v);return ct.makeSpan(["mord","overline"],[ee],v)},mathmlBuilder:function(p,v){var b=new Ft.MathNode("mo",[new Ft.TextNode("\u203E")]);b.setAttribute("stretchy","true");var L=new Ft.MathNode("mover",[or(p.body,v),b]);return L.setAttribute("accent","true"),L}}),Yt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var b=p.parser,L=v[0];return{type:"phantom",mode:b.mode,body:Qr(L)}},htmlBuilder:function(p,v){var b=Xr(p.body,v.withPhantom(),!1);return ct.makeFragment(b)},mathmlBuilder:function(p,v){var b=mi(p.body,v);return new Ft.MathNode("mphantom",b)}}),Yt({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var b=p.parser,L=v[0];return{type:"hphantom",mode:b.mode,body:L}},htmlBuilder:function(p,v){var b=ct.makeSpan([],[mr(p.body,v.withPhantom())]);if(b.height=0,b.depth=0,b.children)for(var L=0;L<b.children.length;L++)b.children[L].height=0,b.children[L].depth=0;return b=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:b}]},v),ct.makeSpan(["mord"],[b],v)},mathmlBuilder:function(p,v){var b=mi(Qr(p.body),v),L=new Ft.MathNode("mphantom",b),V=new Ft.MathNode("mpadded",[L]);return V.setAttribute("height","0px"),V.setAttribute("depth","0px"),V}}),Yt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var b=p.parser,L=v[0];return{type:"vphantom",mode:b.mode,body:L}},htmlBuilder:function(p,v){var b=ct.makeSpan(["inner"],[mr(p.body,v.withPhantom())]),L=ct.makeSpan(["fix"],[]);return ct.makeSpan(["mord","rlap"],[b,L],v)},mathmlBuilder:function(p,v){var b=mi(Qr(p.body),v),L=new Ft.MathNode("mphantom",b),V=new Ft.MathNode("mpadded",[L]);return V.setAttribute("width","0px"),V}}),Yt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler:function(p,v){var b=p.parser,L=fr(v[0],"size").value,V=v[1];return{type:"raisebox",mode:b.mode,dy:L,body:V}},htmlBuilder:function(p,v){var b=mr(p.body,v),L=Sr(p.dy,v);return ct.makeVList({positionType:"shift",positionData:-L,children:[{type:"elem",elem:b}]},v)},mathmlBuilder:function(p,v){var b=new Ft.MathNode("mpadded",[or(p.body,v)]),L=p.dy.number+p.dy.unit;return b.setAttribute("voffset",L),b}}),Yt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler:function(p,v,b){var L=p.parser,V=b[0],ee=fr(v[0],"size"),pe=fr(v[1],"size");return{type:"rule",mode:L.mode,shift:V&&fr(V,"size").value,width:ee.value,height:pe.value}},htmlBuilder:function(p,v){var b=ct.makeSpan(["mord","rule"],[],v),L=Sr(p.width,v),V=Sr(p.height,v),ee=p.shift?Sr(p.shift,v):0;return b.style.borderRightWidth=L+"em",b.style.borderTopWidth=V+"em",b.style.bottom=ee+"em",b.width=L,b.height=V+ee,b.depth=-ee,b.maxFontSize=V*1.125*v.sizeMultiplier,b},mathmlBuilder:function(p,v){var b=Sr(p.width,v),L=Sr(p.height,v),V=p.shift?Sr(p.shift,v):0,ee=v.color&&v.getColor()||"black",pe=new Ft.MathNode("mspace");pe.setAttribute("mathbackground",ee),pe.setAttribute("width",b+"em"),pe.setAttribute("height",L+"em");var ye=new Ft.MathNode("mpadded",[pe]);return V>=0?ye.setAttribute("height","+"+V+"em"):(ye.setAttribute("height",V+"em"),ye.setAttribute("depth","+"+-V+"em")),ye.setAttribute("voffset",V+"em"),ye}});function Xn(te,p,v){for(var b=Xr(te,p,!1),L=p.sizeMultiplier/v.sizeMultiplier,V=0;V<b.length;V++){var ee=b[V].classes.indexOf("sizing");ee<0?Array.prototype.push.apply(b[V].classes,p.sizingClasses(v)):b[V].classes[ee+1]==="reset-size"+p.size&&(b[V].classes[ee+1]="reset-size"+v.size),b[V].height*=L,b[V].depth*=L}return ct.makeFragment(b)}var $a=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],Do=function(p,v){var b=v.havingSize(p.size);return Xn(p.body,b,v)};Yt({type:"sizing",names:$a,props:{numArgs:0,allowedInText:!0},handler:function(p,v){var b=p.breakOnTokenText,L=p.funcName,V=p.parser,ee=V.parseExpression(!1,b);return{type:"sizing",mode:V.mode,size:$a.indexOf(L)+1,body:ee}},htmlBuilder:Do,mathmlBuilder:function(p,v){var b=v.havingSize(p.size),L=mi(p.body,b),V=new Ft.MathNode("mstyle",L);return V.setAttribute("mathsize",b.sizeMultiplier+"em"),V}}),Yt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(p,v,b){var L=p.parser,V=!1,ee=!1,pe=b[0]&&fr(b[0],"ordgroup");if(pe)for(var ye="",De=0;De<pe.body.length;++De){var je=pe.body[De];if(ye=je.text,ye==="t")V=!0;else if(ye==="b")ee=!0;else{V=!1,ee=!1;break}}else V=!0,ee=!0;var Qe=v[0];return{type:"smash",mode:L.mode,body:Qe,smashHeight:V,smashDepth:ee}},htmlBuilder:function(p,v){var b=ct.makeSpan([],[mr(p.body,v)]);if(!p.smashHeight&&!p.smashDepth)return b;if(p.smashHeight&&(b.height=0,b.children))for(var L=0;L<b.children.length;L++)b.children[L].height=0;if(p.smashDepth&&(b.depth=0,b.children))for(var V=0;V<b.children.length;V++)b.children[V].depth=0;var ee=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:b}]},v);return ct.makeSpan(["mord"],[ee],v)},mathmlBuilder:function(p,v){var b=new Ft.MathNode("mpadded",[or(p.body,v)]);return p.smashHeight&&b.setAttribute("height","0px"),p.smashDepth&&b.setAttribute("depth","0px"),b}}),Yt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler:function(p,v,b){var L=p.parser,V=b[0],ee=v[0];return{type:"sqrt",mode:L.mode,body:ee,index:V}},htmlBuilder:function(p,v){var b=mr(p.body,v.havingCrampedStyle());b.height===0&&(b.height=v.fontMetrics().xHeight),b=ct.wrapFragment(b,v);var L=v.fontMetrics(),V=L.defaultRuleThickness,ee=V;v.style.id<B.TEXT.id&&(ee=v.fontMetrics().xHeight);var pe=V+ee/4,ye=b.height+b.depth+pe+V,De=un.sqrtImage(ye,v),je=De.span,Qe=De.ruleWidth,mt=De.advanceWidth,Dt=je.height-Qe;Dt>b.height+b.depth+pe&&(pe=(pe+Dt-b.height-b.depth)/2);var It=je.height-b.height-pe-Qe;b.style.paddingLeft=mt+"em";var $t=ct.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:b,wrapperClasses:["svg-align"]},{type:"kern",size:-(b.height+It)},{type:"elem",elem:je},{type:"kern",size:Qe}]},v);if(p.index){var Qt=v.havingStyle(B.SCRIPTSCRIPT),er=mr(p.index,Qt,v),lr=.6*($t.height-$t.depth),vr=ct.makeVList({positionType:"shift",positionData:-lr,children:[{type:"elem",elem:er}]},v),jr=ct.makeSpan(["root"],[vr]);return ct.makeSpan(["mord","sqrt"],[jr,$t],v)}else return ct.makeSpan(["mord","sqrt"],[$t],v)},mathmlBuilder:function(p,v){var b=p.body,L=p.index;return L?new Ft.MathNode("mroot",[or(b,v),or(L,v)]):new Ft.MathNode("msqrt",[or(b,v)])}});var za={display:B.DISPLAY,text:B.TEXT,script:B.SCRIPT,scriptscript:B.SCRIPTSCRIPT};Yt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0},handler:function(p,v){var b=p.breakOnTokenText,L=p.funcName,V=p.parser,ee=V.parseExpression(!0,b),pe=L.slice(1,L.length-5);return{type:"styling",mode:V.mode,style:pe,body:ee}},htmlBuilder:function(p,v){var b=za[p.style],L=v.havingStyle(b).withFont("");return Xn(p.body,L,v)},mathmlBuilder:function(p,v){var b=za[p.style],L=v.havingStyle(b),V=mi(p.body,L),ee=new Ft.MathNode("mstyle",V),pe={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},ye=pe[p.style];return ee.setAttribute("scriptlevel",ye[0]),ee.setAttribute("displaystyle",ye[1]),ee}});var Ro=function(p,v){var b=p.base;if(b)if(b.type==="op"){var L=b.limits&&(v.style.size===B.DISPLAY.size||b.alwaysHandleSupSub);return L?Un:null}else if(b.type==="operatorname"){var V=b.alwaysHandleSupSub&&(v.style.size===B.DISPLAY.size||b.limits);return V?Ms:null}else{if(b.type==="accent")return k.isCharacterBox(b.base)?Kt:null;if(b.type==="horizBrace"){var ee=!p.sub;return ee===b.isOver?Na:null}else return null}else return null};oi({type:"supsub",htmlBuilder:function(p,v){var b=Ro(p,v);if(b)return b(p,v);var L=p.base,V=p.sup,ee=p.sub,pe=mr(L,v),ye,De,je=v.fontMetrics(),Qe=0,mt=0,Dt=L&&k.isCharacterBox(L);if(V){var It=v.havingStyle(v.style.sup());ye=mr(V,It,v),Dt||(Qe=pe.height-It.fontMetrics().supDrop*It.sizeMultiplier/v.sizeMultiplier)}if(ee){var $t=v.havingStyle(v.style.sub());De=mr(ee,$t,v),Dt||(mt=pe.depth+$t.fontMetrics().subDrop*$t.sizeMultiplier/v.sizeMultiplier)}var Qt;v.style===B.DISPLAY?Qt=je.sup1:v.style.cramped?Qt=je.sup3:Qt=je.sup2;var er=v.sizeMultiplier,lr=.5/je.ptPerEm/er+"em",vr=null;if(De){var jr=p.base&&p.base.type==="op"&&p.base.name&&(p.base.name==="\\oiint"||p.base.name==="\\oiiint");(pe instanceof Le||jr)&&(vr=-pe.italic+"em")}var Fr;if(ye&&De){Qe=Math.max(Qe,Qt,ye.depth+.25*je.xHeight),mt=Math.max(mt,je.sub2);var Wr=je.defaultRuleThickness,Gr=4*Wr;if(Qe-ye.depth-(De.height-mt)<Gr){mt=Gr-(Qe-ye.depth)+De.height;var zr=.8*je.xHeight-(Qe-ye.depth);zr>0&&(Qe+=zr,mt-=zr)}var yi=[{type:"elem",elem:De,shift:mt,marginRight:lr,marginLeft:vr},{type:"elem",elem:ye,shift:-Qe,marginRight:lr}];Fr=ct.makeVList({positionType:"individualShift",children:yi},v)}else if(De){mt=Math.max(mt,je.sub1,De.height-.8*je.xHeight);var qr=[{type:"elem",elem:De,marginLeft:vr,marginRight:lr}];Fr=ct.makeVList({positionType:"shift",positionData:mt,children:qr},v)}else if(ye)Qe=Math.max(Qe,Qt,ye.depth+.25*je.xHeight),Fr=ct.makeVList({positionType:"shift",positionData:-Qe,children:[{type:"elem",elem:ye,marginRight:lr}]},v);else throw new Error("supsub must have either sup or sub.");var Ve=Mi(pe,"right")||"mord";return ct.makeSpan([Ve],[pe,ct.makeSpan(["msupsub"],[Fr])],v)},mathmlBuilder:function(p,v){var b=!1,L,V,ee=Vr(p.base,"horizBrace");ee&&(V=!!p.sup,V===ee.isOver&&(b=!0,L=ee.isOver)),p.base&&(p.base.type==="op"||p.base.type==="operatorname")&&(p.base.parentIsSupSub=!0);var pe=[or(p.base,v)];p.sub&&pe.push(or(p.sub,v)),p.sup&&pe.push(or(p.sup,v));var ye;if(b)ye=L?"mover":"munder";else if(p.sub)if(p.sup){var Qe=p.base;Qe&&Qe.type==="op"&&Qe.limits&&v.style===B.DISPLAY||Qe&&Qe.type==="operatorname"&&Qe.alwaysHandleSupSub&&(v.style===B.DISPLAY||Qe.limits)?ye="munderover":ye="msubsup"}else{var je=p.base;je&&je.type==="op"&&je.limits&&(v.style===B.DISPLAY||je.alwaysHandleSupSub)||je&&je.type==="operatorname"&&je.alwaysHandleSupSub&&(je.limits||v.style===B.DISPLAY)?ye="munder":ye="msub"}else{var De=p.base;De&&De.type==="op"&&De.limits&&(v.style===B.DISPLAY||De.alwaysHandleSupSub)||De&&De.type==="operatorname"&&De.alwaysHandleSupSub&&(De.limits||v.style===B.DISPLAY)?ye="mover":ye="msup"}var mt=new Ft.MathNode(ye,pe);return mt}}),oi({type:"atom",htmlBuilder:function(p,v){return ct.mathsym(p.text,p.mode,v,["m"+p.family])},mathmlBuilder:function(p,v){var b=new Ft.MathNode("mo",[ui(p.text,p.mode)]);if(p.family==="bin"){var L=Pn(p,v);L==="bold-italic"&&b.setAttribute("mathvariant",L)}else p.family==="punct"?b.setAttribute("separator","true"):(p.family==="open"||p.family==="close")&&b.setAttribute("stretchy","false");return b}});var ca={mi:"italic",mn:"normal",mtext:"normal"};oi({type:"mathord",htmlBuilder:function(p,v){return ct.makeOrd(p,v,"mathord")},mathmlBuilder:function(p,v){var b=new Ft.MathNode("mi",[ui(p.text,p.mode,v)]),L=Pn(p,v)||"italic";return L!==ca[b.type]&&b.setAttribute("mathvariant",L),b}}),oi({type:"textord",htmlBuilder:function(p,v){return ct.makeOrd(p,v,"textord")},mathmlBuilder:function(p,v){var b=ui(p.text,p.mode,v),L=Pn(p,v)||"normal",V;return p.mode==="text"?V=new Ft.MathNode("mtext",[b]):/[0-9]/.test(p.text)?V=new Ft.MathNode("mn",[b]):p.text==="\\prime"?V=new Ft.MathNode("mo",[b]):V=new Ft.MathNode("mi",[b]),L!==ca[V.type]&&V.setAttribute("mathvariant",L),V}});var ys={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},os={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};oi({type:"spacing",htmlBuilder:function(p,v){if(os.hasOwnProperty(p.text)){var b=os[p.text].className||"";if(p.mode==="text"){var L=ct.makeOrd(p,v,"textord");return L.classes.push(b),L}else return ct.makeSpan(["mspace",b],[ct.mathsym(p.text,p.mode,v)],v)}else{if(ys.hasOwnProperty(p.text))return ct.makeSpan(["mspace",ys[p.text]],[],v);throw new d('Unknown type of space "'+p.text+'"')}},mathmlBuilder:function(p,v){var b;if(os.hasOwnProperty(p.text))b=new Ft.MathNode("mtext",[new Ft.TextNode("\xA0")]);else{if(ys.hasOwnProperty(p.text))return new Ft.MathNode("mspace");throw new d('Unknown type of space "'+p.text+'"')}return b}});var ls=function(){var p=new Ft.MathNode("mtd",[]);return p.setAttribute("width","50%"),p};oi({type:"tag",mathmlBuilder:function(p,v){var b=new Ft.MathNode("mtable",[new Ft.MathNode("mtr",[ls(),new Ft.MathNode("mtd",[zi(p.body,v)]),ls(),new Ft.MathNode("mtd",[zi(p.tag,v)])])]);return b.setAttribute("width","100%"),b}});var Ha={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},ha={"\\textbf":"textbf","\\textmd":"textmd"},ja={"\\textit":"textit","\\textup":"textup"},Fs=function(p,v){var b=p.font;return b?Ha[b]?v.withTextFontFamily(Ha[b]):ha[b]?v.withTextFontWeight(ha[b]):v.withTextFontShape(ja[b]):v};Yt({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 b=p.parser,L=p.funcName,V=v[0];return{type:"text",mode:b.mode,body:Qr(V),font:L}},htmlBuilder:function(p,v){var b=Fs(p,v),L=Xr(p.body,b,!0);return ct.makeSpan(["mord","text"],ct.tryCombineChars(L),b)},mathmlBuilder:function(p,v){var b=Fs(p,v);return zi(p.body,b)}}),Yt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(p,v){var b=p.parser;return{type:"underline",mode:b.mode,body:v[0]}},htmlBuilder:function(p,v){var b=mr(p.body,v),L=ct.makeLineSpan("underline-line",v),V=v.fontMetrics().defaultRuleThickness,ee=ct.makeVList({positionType:"top",positionData:b.height,children:[{type:"kern",size:V},{type:"elem",elem:L},{type:"kern",size:3*V},{type:"elem",elem:b}]},v);return ct.makeSpan(["mord","underline"],[ee],v)},mathmlBuilder:function(p,v){var b=new Ft.MathNode("mo",[new Ft.TextNode("\u203E")]);b.setAttribute("stretchy","true");var L=new Ft.MathNode("munder",[or(p.body,v),b]);return L.setAttribute("accentunder","true"),L}}),Yt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(p,v,b){throw new d("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(p,v){for(var b=Wa(p),L=[],V=v.havingStyle(v.style.text()),ee=0;ee<b.length;ee++){var pe=b[ee];pe==="~"&&(pe="\\textasciitilde"),L.push(ct.makeSymbol(pe,"Typewriter-Regular",p.mode,V,["mord","texttt"]))}return ct.makeSpan(["mord","text"].concat(V.sizingClasses(v)),ct.tryCombineChars(L),V)},mathmlBuilder:function(p,v){var b=new Ft.TextNode(Wa(p)),L=new Ft.MathNode("mtext",[b]);return L.setAttribute("mathvariant","monospace"),L}});var Wa=function(p){return p.body.replace(/ /g,p.star?"\u2423":"\xA0")},Bs=Gn,bs=Bs,fa=`[ \r
|
|
|
]`,da="\\\\[a-zA-Z@]+",Ga="\\\\[^\uD800-\uDFFF]",Lo=""+da+fa+"*",Ka=new RegExp("^("+da+")"+fa+"*$"),pa="[\u0300-\u036F]",ko=new RegExp(pa+"+$"),ma="("+fa+"+)|([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(pa+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(pa+"*")+"|\\\\verb\\*([^]).*?\\3|\\\\verb([^*a-zA-Z]).*?\\4|\\\\operatorname\\*"+("|"+Lo)+("|"+Ga+")"),Va=function(){function te(v,b){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=v,this.settings=b,this.tokenRegex=new RegExp(ma,"g"),this.catcodes={"%":14}}var p=te.prototype;return p.setCatcode=function(b,L){this.catcodes[b]=L},p.lex=function(){var b=this.input,L=this.tokenRegex.lastIndex;if(L===b.length)return new P("EOF",new K(this,L,L));var V=this.tokenRegex.exec(b);if(V===null||V.index!==L)throw new d("Unexpected character: '"+b[L]+"'",new P(b[L],new K(this,L,L+1)));var ee=V[2]||" ";if(this.catcodes[ee]===14){var pe=b.indexOf(`
|
|
|
`,this.tokenRegex.lastIndex);return pe===-1?(this.tokenRegex.lastIndex=b.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 ye=ee.match(Ka);return ye&&(ee=ye[1]),new P(ee,new K(this,L,this.tokenRegex.lastIndex))},te}(),Io=function(){function te(v,b){v===void 0&&(v={}),b===void 0&&(b={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=b,this.builtins=v,this.undefStack=[]}var p=te.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 b=this.undefStack.pop();for(var L in b)b.hasOwnProperty(L)&&(b[L]===void 0?delete this.current[L]:this.current[L]=b[L])},p.has=function(b){return this.current.hasOwnProperty(b)||this.builtins.hasOwnProperty(b)},p.get=function(b){return this.current.hasOwnProperty(b)?this.current[b]:this.builtins[b]},p.set=function(b,L,V){if(V===void 0&&(V=!1),V){for(var ee=0;ee<this.undefStack.length;ee++)delete this.undefStack[ee][b];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][b]=L)}else{var pe=this.undefStack[this.undefStack.length-1];pe&&!pe.hasOwnProperty(b)&&(pe[b]=this.current[b])}this.current[b]=L},te}(),qa={},Po=qa;function we(te,p){qa[te]=p}we("\\@firstoftwo",function(te){var p=te.consumeArgs(2);return{tokens:p[0],numArgs:0}}),we("\\@secondoftwo",function(te){var p=te.consumeArgs(2);return{tokens:p[1],numArgs:0}}),we("\\@ifnextchar",function(te){var p=te.consumeArgs(3),v=te.future();return p[0].length===1&&p[0][0].text===v.text?{tokens:p[1],numArgs:0}:{tokens:p[2],numArgs:0}}),we("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),we("\\TextOrMath",function(te){var p=te.consumeArgs(2);return te.mode==="text"?{tokens:p[0],numArgs:0}:{tokens:p[1],numArgs:0}});var Ya={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};we("\\char",function(te){var p=te.popToken(),v,b="";if(p.text==="'")v=8,p=te.popToken();else if(p.text==='"')v=16,p=te.popToken();else if(p.text==="`")if(p=te.popToken(),p.text[0]==="\\")b=p.text.charCodeAt(1);else{if(p.text==="EOF")throw new d("\\char` missing argument");b=p.text.charCodeAt(0)}else v=10;if(v){if(b=Ya[p.text],b==null||b>=v)throw new d("Invalid base-"+v+" digit "+p.text);for(var L;(L=Ya[te.future().text])!=null&&L<v;)b*=v,b+=L,te.popToken()}return"\\@char{"+b+"}"});var ga=function(p,v){var b=p.consumeArgs(1)[0];if(b.length!==1)throw new d("\\gdef's first argument must be a macro name");var L=b[0].text,V=0;for(b=p.consumeArgs(1)[0];b.length===1&&b[0].text==="#";){if(b=p.consumeArgs(1)[0],b.length!==1)throw new d('Invalid argument number length "'+b.length+'"');if(!/^[1-9]$/.test(b[0].text))throw new d('Invalid argument number "'+b[0].text+'"');if(V++,parseInt(b[0].text)!==V)throw new d('Argument number "'+b[0].text+'" out of order');b=p.consumeArgs(1)[0]}return p.macros.set(L,{tokens:b,numArgs:V},v),""};we("\\gdef",function(te){return ga(te,!0)}),we("\\def",function(te){return ga(te,!1)}),we("\\global",function(te){var p=te.consumeArgs(1)[0];if(p.length!==1)throw new d("Invalid command after \\global");var v=p[0].text;if(v==="\\def")return ga(te,!0);throw new d("Invalid command '"+v+"' after \\global")});var _a=function(p,v,b){var L=p.consumeArgs(1)[0];if(L.length!==1)throw new d("\\newcommand's first argument must be a macro name");var V=L[0].text,ee=p.isDefined(V);if(ee&&!v)throw new d("\\newcommand{"+V+"} attempting to redefine "+(V+"; use \\renewcommand"));if(!ee&&!b)throw new d("\\renewcommand{"+V+"} when command "+V+" does not yet exist; use \\newcommand");var pe=0;if(L=p.consumeArgs(1)[0],L.length===1&&L[0].text==="["){for(var ye="",De=p.expandNextToken();De.text!=="]"&&De.text!=="EOF";)ye+=De.text,De=p.expandNextToken();if(!ye.match(/^\s*[0-9]+\s*$/))throw new d("Invalid number of arguments: "+ye);pe=parseInt(ye),L=p.consumeArgs(1)[0]}return p.macros.set(V,{tokens:L,numArgs:pe}),""};we("\\newcommand",function(te){return _a(te,!1,!0)}),we("\\renewcommand",function(te){return _a(te,!0,!1)}),we("\\providecommand",function(te){return _a(te,!0,!0)}),we("\\bgroup","{"),we("\\egroup","}"),we("\\lq","`"),we("\\rq","'"),we("\\aa","\\r a"),we("\\AA","\\r A"),we("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}"),we("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),we("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}"),we("\u212C","\\mathscr{B}"),we("\u2130","\\mathscr{E}"),we("\u2131","\\mathscr{F}"),we("\u210B","\\mathscr{H}"),we("\u2110","\\mathscr{I}"),we("\u2112","\\mathscr{L}"),we("\u2133","\\mathscr{M}"),we("\u211B","\\mathscr{R}"),we("\u212D","\\mathfrak{C}"),we("\u210C","\\mathfrak{H}"),we("\u2128","\\mathfrak{Z}"),we("\\Bbbk","\\Bbb{k}"),we("\xB7","\\cdotp"),we("\\llap","\\mathllap{\\textrm{#1}}"),we("\\rlap","\\mathrlap{\\textrm{#1}}"),we("\\clap","\\mathclap{\\textrm{#1}}"),we("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),we("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"),we("\\ne","\\neq"),we("\u2260","\\neq"),we("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"),we("\u2209","\\notin"),we("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"),we("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"),we("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}"),we("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}"),we("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}"),we("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}"),we("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}"),we("\u27C2","\\perp"),we("\u203C","\\mathclose{!\\mkern-0.8mu!}"),we("\u220C","\\notni"),we("\u231C","\\ulcorner"),we("\u231D","\\urcorner"),we("\u231E","\\llcorner"),we("\u231F","\\lrcorner"),we("\xA9","\\copyright"),we("\xAE","\\textregistered"),we("\uFE0F","\\textregistered"),we("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),we("\u22EE","\\vdots"),we("\\varGamma","\\mathit{\\Gamma}"),we("\\varDelta","\\mathit{\\Delta}"),we("\\varTheta","\\mathit{\\Theta}"),we("\\varLambda","\\mathit{\\Lambda}"),we("\\varXi","\\mathit{\\Xi}"),we("\\varPi","\\mathit{\\Pi}"),we("\\varSigma","\\mathit{\\Sigma}"),we("\\varUpsilon","\\mathit{\\Upsilon}"),we("\\varPhi","\\mathit{\\Phi}"),we("\\varPsi","\\mathit{\\Psi}"),we("\\varOmega","\\mathit{\\Omega}"),we("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),we("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu"),we("\\boxed","\\fbox{$\\displaystyle{#1}$}"),we("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),we("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),we("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var Za={",":"\\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"};we("\\dots",function(te){var p="\\dotso",v=te.expandAfterFuture().text;return v in Za?p=Za[v]:(v.substr(0,4)==="\\not"||v in At.math&&k.contains(["bin","rel"],At.math[v].group))&&(p="\\dotsb"),p});var us={")":!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};we("\\dotso",function(te){var p=te.future().text;return p in us?"\\ldots\\,":"\\ldots"}),we("\\dotsc",function(te){var p=te.future().text;return p in us&&p!==","?"\\ldots\\,":"\\ldots"}),we("\\cdots",function(te){var p=te.future().text;return p in us?"\\@cdots\\,":"\\@cdots"}),we("\\dotsb","\\cdots"),we("\\dotsm","\\cdots"),we("\\dotsi","\\!\\cdots"),we("\\dotsx","\\ldots\\,"),we("\\DOTSI","\\relax"),we("\\DOTSB","\\relax"),we("\\DOTSX","\\relax"),we("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),we("\\,","\\tmspace+{3mu}{.1667em}"),we("\\thinspace","\\,"),we("\\>","\\mskip{4mu}"),we("\\:","\\tmspace+{4mu}{.2222em}"),we("\\medspace","\\:"),we("\\;","\\tmspace+{5mu}{.2777em}"),we("\\thickspace","\\;"),we("\\!","\\tmspace-{3mu}{.1667em}"),we("\\negthinspace","\\!"),we("\\negmedspace","\\tmspace-{4mu}{.2222em}"),we("\\negthickspace","\\tmspace-{5mu}{.277em}"),we("\\enspace","\\kern.5em "),we("\\enskip","\\hskip.5em\\relax"),we("\\quad","\\hskip1em\\relax"),we("\\qquad","\\hskip2em\\relax"),we("\\tag","\\@ifstar\\tag@literal\\tag@paren"),we("\\tag@paren","\\tag@literal{({#1})}"),we("\\tag@literal",function(te){if(te.macros.get("\\df@tag"))throw new d("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),we("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),we("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),we("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),we("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),we("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),we("\\\\","\\newline"),we("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Xa=ht["Main-Regular"][84][1]-.7*ht["Main-Regular"][65][1]+"em";we("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Xa+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),we("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Xa+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),we("\\hspace","\\@ifstar\\@hspacer\\@hspace"),we("\\@hspace","\\hskip #1\\relax"),we("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),we("\\ordinarycolon",":"),we("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),we("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),we("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),we("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),we("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),we("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),we("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),we("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),we("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),we("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),we("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),we("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),we("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),we("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),we("\u2237","\\dblcolon"),we("\u2239","\\eqcolon"),we("\u2254","\\coloneqq"),we("\u2255","\\eqqcolon"),we("\u2A74","\\Coloneqq"),we("\\ratio","\\vcentcolon"),we("\\coloncolon","\\dblcolon"),we("\\colonequals","\\coloneqq"),we("\\coloncolonequals","\\Coloneqq"),we("\\equalscolon","\\eqqcolon"),we("\\equalscoloncolon","\\Eqqcolon"),we("\\colonminus","\\coloneq"),we("\\coloncolonminus","\\Coloneq"),we("\\minuscolon","\\eqcolon"),we("\\minuscoloncolon","\\Eqcolon"),we("\\coloncolonapprox","\\Colonapprox"),we("\\coloncolonsim","\\Colonsim"),we("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),we("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),we("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),we("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),we("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}"),we("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),we("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),we("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),we("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),we("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),we("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),we("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),we("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),we("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),we("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),we("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),we("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),we("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}"),we("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}"),we("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}"),we("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}"),we("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}"),we("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}"),we("\u27E6","\\llbracket"),we("\u27E7","\\rrbracket"),we("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),we("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),we("\u2983","\\lBrace"),we("\u2984","\\rBrace"),we("\\darr","\\downarrow"),we("\\dArr","\\Downarrow"),we("\\Darr","\\Downarrow"),we("\\lang","\\langle"),we("\\rang","\\rangle"),we("\\uarr","\\uparrow"),we("\\uArr","\\Uparrow"),we("\\Uarr","\\Uparrow"),we("\\N","\\mathbb{N}"),we("\\R","\\mathbb{R}"),we("\\Z","\\mathbb{Z}"),we("\\alef","\\aleph"),we("\\alefsym","\\aleph"),we("\\Alpha","\\mathrm{A}"),we("\\Beta","\\mathrm{B}"),we("\\bull","\\bullet"),we("\\Chi","\\mathrm{X}"),we("\\clubs","\\clubsuit"),we("\\cnums","\\mathbb{C}"),we("\\Complex","\\mathbb{C}"),we("\\Dagger","\\ddagger"),we("\\diamonds","\\diamondsuit"),we("\\empty","\\emptyset"),we("\\Epsilon","\\mathrm{E}"),we("\\Eta","\\mathrm{H}"),we("\\exist","\\exists"),we("\\harr","\\leftrightarrow"),we("\\hArr","\\Leftrightarrow"),we("\\Harr","\\Leftrightarrow"),we("\\hearts","\\heartsuit"),we("\\image","\\Im"),we("\\infin","\\infty"),we("\\Iota","\\mathrm{I}"),we("\\isin","\\in"),we("\\Kappa","\\mathrm{K}"),we("\\larr","\\leftarrow"),we("\\lArr","\\Leftarrow"),we("\\Larr","\\Leftarrow"),we("\\lrarr","\\leftrightarrow"),we("\\lrArr","\\Leftrightarrow"),we("\\Lrarr","\\Leftrightarrow"),we("\\Mu","\\mathrm{M}"),we("\\natnums","\\mathbb{N}"),we("\\Nu","\\mathrm{N}"),we("\\Omicron","\\mathrm{O}"),we("\\plusmn","\\pm"),we("\\rarr","\\rightarrow"),we("\\rArr","\\Rightarrow"),we("\\Rarr","\\Rightarrow"),we("\\real","\\Re"),we("\\reals","\\mathbb{R}"),we("\\Reals","\\mathbb{R}"),we("\\Rho","\\mathrm{P}"),we("\\sdot","\\cdot"),we("\\sect","\\S"),we("\\spades","\\spadesuit"),we("\\sub","\\subset"),we("\\sube","\\subseteq"),we("\\supe","\\supseteq"),we("\\Tau","\\mathrm{T}"),we("\\thetasym","\\vartheta"),we("\\weierp","\\wp"),we("\\Zeta","\\mathrm{Z}"),we("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),we("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),we("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),we("\\blue","\\textcolor{##6495ed}{#1}"),we("\\orange","\\textcolor{##ffa500}{#1}"),we("\\pink","\\textcolor{##ff00af}{#1}"),we("\\red","\\textcolor{##df0030}{#1}"),we("\\green","\\textcolor{##28ae7b}{#1}"),we("\\gray","\\textcolor{gray}{#1}"),we("\\purple","\\textcolor{##9d38bd}{#1}"),we("\\blueA","\\textcolor{##ccfaff}{#1}"),we("\\blueB","\\textcolor{##80f6ff}{#1}"),we("\\blueC","\\textcolor{##63d9ea}{#1}"),we("\\blueD","\\textcolor{##11accd}{#1}"),we("\\blueE","\\textcolor{##0c7f99}{#1}"),we("\\tealA","\\textcolor{##94fff5}{#1}"),we("\\tealB","\\textcolor{##26edd5}{#1}"),we("\\tealC","\\textcolor{##01d1c1}{#1}"),we("\\tealD","\\textcolor{##01a995}{#1}"),we("\\tealE","\\textcolor{##208170}{#1}"),we("\\greenA","\\textcolor{##b6ffb0}{#1}"),we("\\greenB","\\textcolor{##8af281}{#1}"),we("\\greenC","\\textcolor{##74cf70}{#1}"),we("\\greenD","\\textcolor{##1fab54}{#1}"),we("\\greenE","\\textcolor{##0d923f}{#1}"),we("\\goldA","\\textcolor{##ffd0a9}{#1}"),we("\\goldB","\\textcolor{##ffbb71}{#1}"),we("\\goldC","\\textcolor{##ff9c39}{#1}"),we("\\goldD","\\textcolor{##e07d10}{#1}"),we("\\goldE","\\textcolor{##a75a05}{#1}"),we("\\redA","\\textcolor{##fca9a9}{#1}"),we("\\redB","\\textcolor{##ff8482}{#1}"),we("\\redC","\\textcolor{##f9685d}{#1}"),we("\\redD","\\textcolor{##e84d39}{#1}"),we("\\redE","\\textcolor{##bc2612}{#1}"),we("\\maroonA","\\textcolor{##ffbde0}{#1}"),we("\\maroonB","\\textcolor{##ff92c6}{#1}"),we("\\maroonC","\\textcolor{##ed5fa6}{#1}"),we("\\maroonD","\\textcolor{##ca337c}{#1}"),we("\\maroonE","\\textcolor{##9e034e}{#1}"),we("\\purpleA","\\textcolor{##ddd7ff}{#1}"),we("\\purpleB","\\textcolor{##c6b9fc}{#1}"),we("\\purpleC","\\textcolor{##aa87ff}{#1}"),we("\\purpleD","\\textcolor{##7854ab}{#1}"),we("\\purpleE","\\textcolor{##543b78}{#1}"),we("\\mintA","\\textcolor{##f5f9e8}{#1}"),we("\\mintB","\\textcolor{##edf2df}{#1}"),we("\\mintC","\\textcolor{##e0e5cc}{#1}"),we("\\grayA","\\textcolor{##f6f7f7}{#1}"),we("\\grayB","\\textcolor{##f0f1f2}{#1}"),we("\\grayC","\\textcolor{##e3e5e6}{#1}"),we("\\grayD","\\textcolor{##d6d8da}{#1}"),we("\\grayE","\\textcolor{##babec2}{#1}"),we("\\grayF","\\textcolor{##888d93}{#1}"),we("\\grayG","\\textcolor{##626569}{#1}"),we("\\grayH","\\textcolor{##3b3e40}{#1}"),we("\\grayI","\\textcolor{##21242c}{#1}"),we("\\kaBlue","\\textcolor{##314453}{#1}"),we("\\kaGreen","\\textcolor{##71B307}{#1}");var va={"\\relax":!0,"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Qa=function(){function te(v,b,L){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=b,this.expansionCount=0,this.feed(v),this.macros=new Io(Po,b.macros),this.mode=L,this.stack=[]}var p=te.prototype;return p.feed=function(b){this.lexer=new Va(b,this.settings)},p.switchMode=function(b){this.mode=b},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(b){this.stack.push(b)},p.pushTokens=function(b){var L;(L=this.stack).push.apply(L,b)},p.consumeSpaces=function(){for(;;){var b=this.future();if(b.text===" ")this.stack.pop();else break}},p.consumeArgs=function(b){for(var L=[],V=0;V<b;++V){this.consumeSpaces();var ee=this.popToken();if(ee.text==="{"){for(var pe=[],ye=1;ye!==0;){var De=this.popToken();if(pe.push(De),De.text==="{")++ye;else if(De.text==="}")--ye;else if(De.text==="EOF")throw new d("End of input in macro argument",ee)}pe.pop(),pe.reverse(),L[V]=pe}else{if(ee.text==="EOF")throw new d("End of input expecting macro argument");L[V]=[ee]}}return L},p.expandOnce=function(){var b=this.popToken(),L=b.text,V=this._getExpansion(L);if(V==null)return this.pushToken(b),b;if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new d("Too many expansions: infinite loop or need to increase maxExpand setting");var ee=V.tokens;if(V.numArgs){var pe=this.consumeArgs(V.numArgs);ee=ee.slice();for(var ye=ee.length-1;ye>=0;--ye){var De=ee[ye];if(De.text==="#"){if(ye===0)throw new d("Incomplete placeholder at end of macro body",De);if(De=ee[--ye],De.text==="#")ee.splice(ye+1,1);else if(/^[1-9]$/.test(De.text)){var je;(je=ee).splice.apply(je,[ye,2].concat(pe[+De.text-1]))}else throw new d("Not a valid argument number",De)}}}return this.pushTokens(ee),ee},p.expandAfterFuture=function(){return this.expandOnce(),this.future()},p.expandNextToken=function(){for(;;){var b=this.expandOnce();if(b instanceof P)if(b.text==="\\relax")this.stack.pop();else return this.stack.pop()}throw new Error},p.expandMacro=function(b){if(this.macros.get(b)){var L=[],V=this.stack.length;for(this.pushToken(new P(b));this.stack.length>V;){var ee=this.expandOnce();ee instanceof P&&L.push(this.stack.pop())}return L}},p.expandMacroAsText=function(b){var L=this.expandMacro(b);return L&&L.map(function(V){return V.text}).join("")},p._getExpansion=function(b){var L=this.macros.get(b);if(L==null)return L;var V=typeof L=="function"?L(this):L;if(typeof V=="string"){var ee=0;if(V.indexOf("#")!==-1)for(var pe=V.replace(/##/g,"");pe.indexOf("#"+(ee+1))!==-1;)++ee;for(var ye=new Va(V,this.settings),De=[],je=ye.lex();je.text!=="EOF";)De.push(je),je=ye.lex();De.reverse();var Qe={tokens:De,numArgs:ee};return Qe}return V},p.isDefined=function(b){return this.macros.has(b)||bs.hasOwnProperty(b)||At.math.hasOwnProperty(b)||At.text.hasOwnProperty(b)||va.hasOwnProperty(b)},te}(),Ja={"\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"}},Ns={\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"},vi=function(){function te(v,b){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 Qa(v,b,this.mode),this.settings=b,this.leftrightDepth=0}var p=te.prototype;return p.expect=function(b,L){if(L===void 0&&(L=!0),this.fetch().text!==b)throw new d("Expected '"+b+"', got '"+this.fetch().text+"'",this.fetch());L&&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(b){this.mode=b,this.gullet.switchMode(b)},p.parse=function(){this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");var b=this.parseExpression(!1);return this.expect("EOF"),this.gullet.endGroup(),b},p.parseExpression=function(b,L){for(var V=[];;){this.mode==="math"&&this.consumeSpaces();var ee=this.fetch();if(te.endOfExpression.indexOf(ee.text)!==-1||L&&ee.text===L||b&&bs[ee.text]&&bs[ee.text].infix)break;var pe=this.parseAtom(L);if(!pe)break;V.push(pe)}return this.mode==="text"&&this.formLigatures(V),this.handleInfixNodes(V)},p.handleInfixNodes=function(b){for(var L=-1,V,ee=0;ee<b.length;ee++){var pe=Vr(b[ee],"infix");if(pe){if(L!==-1)throw new d("only one infix operator per group",pe.token);L=ee,V=pe.replaceWith}}if(L!==-1&&V){var ye,De,je=b.slice(0,L),Qe=b.slice(L+1);je.length===1&&je[0].type==="ordgroup"?ye=je[0]:ye={type:"ordgroup",mode:this.mode,body:je},Qe.length===1&&Qe[0].type==="ordgroup"?De=Qe[0]:De={type:"ordgroup",mode:this.mode,body:Qe};var mt;return V==="\\\\abovefrac"?mt=this.callFunction(V,[ye,b[L],De],[]):mt=this.callFunction(V,[ye,De],[]),[mt]}else return b},p.handleSupSubscript=function(b){var L=this.fetch(),V=L.text;this.consume();var ee=this.parseGroup(b,!1,te.SUPSUB_GREEDINESS,void 0,void 0,!0);if(!ee)throw new d("Expected group after '"+V+"'",L);return ee},p.formatUnsupportedCmd=function(b){for(var L=[],V=0;V<b.length;V++)L.push({type:"textord",mode:"text",text:b[V]});var ee={type:"text",mode:this.mode,body:L},pe={type:"color",mode:this.mode,color:this.settings.errorColor,body:[ee]};return pe},p.parseAtom=function(b){var L=this.parseGroup("atom",!1,null,b);if(this.mode==="text")return L;for(var V,ee;;){this.consumeSpaces();var pe=this.fetch();if(pe.text==="\\limits"||pe.text==="\\nolimits"){var ye=Vr(L,"op");if(ye){var De=pe.text==="\\limits";ye.limits=De,ye.alwaysHandleSupSub=!0}else if(ye=Vr(L,"operatorname"),ye&&ye.alwaysHandleSupSub){var je=pe.text==="\\limits";ye.limits=je}else throw new d("Limit controls must follow a math operator",pe);this.consume()}else if(pe.text==="^"){if(V)throw new d("Double superscript",pe);V=this.handleSupSubscript("superscript")}else if(pe.text==="_"){if(ee)throw new d("Double subscript",pe);ee=this.handleSupSubscript("subscript")}else if(pe.text==="'"){if(V)throw new d("Double superscript",pe);var Qe={type:"textord",mode:this.mode,text:"\\prime"},mt=[Qe];for(this.consume();this.fetch().text==="'";)mt.push(Qe),this.consume();this.fetch().text==="^"&&mt.push(this.handleSupSubscript("superscript")),V={type:"ordgroup",mode:this.mode,body:mt}}else break}return V||ee?{type:"supsub",mode:this.mode,base:L,sup:V,sub:ee}:L},p.parseFunction=function(b,L,V){var ee=this.fetch(),pe=ee.text,ye=bs[pe];if(!ye)return null;if(this.consume(),V!=null&&ye.greediness<=V)throw new d("Got function '"+pe+"' with no arguments"+(L?" as "+L:""),ee);if(this.mode==="text"&&!ye.allowedInText)throw new d("Can't use function '"+pe+"' in text mode",ee);if(this.mode==="math"&&ye.allowedInMath===!1)throw new d("Can't use function '"+pe+"' in math mode",ee);var De=this.parseArguments(pe,ye),je=De.args,Qe=De.optArgs;return this.callFunction(pe,je,Qe,ee,b)},p.callFunction=function(b,L,V,ee,pe){var ye={funcName:b,parser:this,token:ee,breakOnTokenText:pe},De=bs[b];if(De&&De.handler)return De.handler(ye,L,V);throw new d("No function handler for "+b)},p.parseArguments=function(b,L){var V=L.numArgs+L.numOptionalArgs;if(V===0)return{args:[],optArgs:[]};for(var ee=L.greediness,pe=[],ye=[],De=0;De<V;De++){var je=L.argTypes&&L.argTypes[De],Qe=De<L.numOptionalArgs,mt=De>0&&!Qe||De===0&&!Qe&&this.mode==="math",Dt=this.parseGroupOfType("argument to '"+b+"'",je,Qe,ee,mt);if(!Dt){if(Qe){ye.push(null);continue}throw new d("Expected group after '"+b+"'",this.fetch())}(Qe?ye:pe).push(Dt)}return{args:pe,optArgs:ye}},p.parseGroupOfType=function(b,L,V,ee,pe){switch(L){case"color":return pe&&this.consumeSpaces(),this.parseColorGroup(V);case"size":return pe&&this.consumeSpaces(),this.parseSizeGroup(V);case"url":return this.parseUrlGroup(V,pe);case"math":case"text":return this.parseGroup(b,V,ee,void 0,L,pe);case"hbox":{var ye=this.parseGroup(b,V,ee,void 0,"text",pe);if(!ye)return ye;var De={type:"styling",mode:ye.mode,body:[ye],style:"text"};return De}case"raw":{if(pe&&this.consumeSpaces(),V&&this.fetch().text==="{")return null;var je=this.parseStringGroup("raw",V,!0);if(je)return{type:"raw",mode:"text",string:je.text};throw new d("Expected raw group",this.fetch())}case"original":case null:case void 0:return this.parseGroup(b,V,ee,void 0,void 0,pe);default:throw new d("Unknown group type as "+b,this.fetch())}},p.consumeSpaces=function(){for(;this.fetch().text===" ";)this.consume()},p.parseStringGroup=function(b,L,V){var ee=L?"[":"{",pe=L?"]":"}",ye=this.fetch();if(ye.text!==ee){if(L)return null;if(V&&ye.text!=="EOF"&&/[^{}[\]]/.test(ye.text))return this.consume(),ye}var De=this.mode;this.mode="text",this.expect(ee);for(var je="",Qe=this.fetch(),mt=0,Dt=Qe,It;(It=this.fetch()).text!==pe||V&&mt>0;){switch(It.text){case"EOF":throw new d("Unexpected end of input in "+b,Qe.range(Dt,je));case ee:mt++;break;case pe:mt--;break}Dt=It,je+=Dt.text,this.consume()}return this.expect(pe),this.mode=De,Qe.range(Dt,je)},p.parseRegexGroup=function(b,L){var V=this.mode;this.mode="text";for(var ee=this.fetch(),pe=ee,ye="",De;(De=this.fetch()).text!=="EOF"&&b.test(ye+De.text);)pe=De,ye+=pe.text,this.consume();if(ye==="")throw new d("Invalid "+L+": '"+ee.text+"'",ee);return this.mode=V,ee.range(pe,ye)},p.parseColorGroup=function(b){var L=this.parseStringGroup("color",b);if(!L)return null;var V=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(L.text);if(!V)throw new d("Invalid color: '"+L.text+"'",L);var ee=V[0];return/^[0-9a-f]{6}$/i.test(ee)&&(ee="#"+ee),{type:"color-token",mode:this.mode,color:ee}},p.parseSizeGroup=function(b){var L,V=!1;if(!b&&this.fetch().text!=="{"?L=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):L=this.parseStringGroup("size",b),!L)return null;!b&&L.text.length===0&&(L.text="0pt",V=!0);var ee=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(L.text);if(!ee)throw new d("Invalid size: '"+L.text+"'",L);var pe={number:+(ee[1]+ee[2]),unit:ee[3]};if(!Nr(pe))throw new d("Invalid unit: '"+pe.unit+"'",L);return{type:"size",mode:this.mode,value:pe,isBlank:V}},p.parseUrlGroup=function(b,L){this.gullet.lexer.setCatcode("%",13);var V=this.parseStringGroup("url",b,!0);if(this.gullet.lexer.setCatcode("%",14),!V)return null;var ee=V.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:ee}},p.parseGroup=function(b,L,V,ee,pe,ye){var De=this.mode;pe&&this.switchMode(pe),ye&&this.consumeSpaces();var je=this.fetch(),Qe=je.text,mt;if(L?Qe==="[":Qe==="{"||Qe==="\\begingroup"){this.consume();var Dt=te.endOfGroup[Qe];this.gullet.beginGroup();var It=this.parseExpression(!1,Dt),$t=this.fetch();this.expect(Dt),this.gullet.endGroup(),mt={type:"ordgroup",mode:this.mode,loc:K.range(je,$t),body:It,semisimple:Qe==="\\begingroup"||void 0}}else if(L)mt=null;else if(mt=this.parseFunction(ee,b,V)||this.parseSymbol(),mt==null&&Qe[0]==="\\"&&!va.hasOwnProperty(Qe)){if(this.settings.throwOnError)throw new d("Undefined control sequence: "+Qe,je);mt=this.formatUnsupportedCmd(Qe),this.consume()}return pe&&this.switchMode(De),mt},p.formLigatures=function(b){for(var L=b.length-1,V=0;V<L;++V){var ee=b[V],pe=ee.text;pe==="-"&&b[V+1].text==="-"&&(V+1<L&&b[V+2].text==="-"?(b.splice(V,3,{type:"textord",mode:"text",loc:K.range(ee,b[V+2]),text:"---"}),L-=2):(b.splice(V,2,{type:"textord",mode:"text",loc:K.range(ee,b[V+1]),text:"--"}),L-=1)),(pe==="'"||pe==="`")&&b[V+1].text===pe&&(b.splice(V,2,{type:"textord",mode:"text",loc:K.range(ee,b[V+1]),text:pe+pe}),L-=1)}},p.parseSymbol=function(){var b=this.fetch(),L=b.text;if(/^\\verb[^a-zA-Z]/.test(L)){this.consume();var V=L.slice(5),ee=V.charAt(0)==="*";if(ee&&(V=V.slice(1)),V.length<2||V.charAt(0)!==V.slice(-1))throw new d(`\\verb assertion failed --
|
|
|
please report what input caused this bug`);return V=V.slice(1,-1),{type:"verb",mode:"text",body:V,star:ee}}Ns.hasOwnProperty(L[0])&&!At[this.mode][L[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+L[0]+'" used in math mode',b),L=Ns[L[0]]+L.substr(1));var pe=ko.exec(L);pe&&(L=L.substring(0,pe.index),L==="i"?L="\u0131":L==="j"&&(L="\u0237"));var ye;if(At[this.mode][L]){this.settings.strict&&this.mode==="math"&&xr.indexOf(L)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+L[0]+'" used in math mode',b);var De=At[this.mode][L].group,je=K.range(b),Qe;if(St.hasOwnProperty(De)){var mt=De;Qe={type:"atom",mode:this.mode,family:mt,loc:je,text:L}}else Qe={type:De,mode:this.mode,loc:je,text:L};ye=Qe}else if(L.charCodeAt(0)>=128)this.settings.strict&&(Oe(L.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+L[0]+'" used in math mode',b):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+L[0]+'"'+(" ("+L.charCodeAt(0)+")"),b)),ye={type:"textord",mode:"text",loc:K.range(b),text:L};else return null;if(this.consume(),pe)for(var Dt=0;Dt<pe[0].length;Dt++){var It=pe[0][Dt];if(!Ja[It])throw new d("Unknown accent ' "+It+"'",b);var $t=Ja[It][this.mode];if(!$t)throw new d("Accent "+It+" unsupported in "+this.mode+" mode",b);ye={type:"accent",mode:this.mode,loc:K.range(b),label:$t,isStretchy:!1,isShifty:!0,base:ye}}return ye},te}();vi.endOfExpression=["}","\\endgroup","\\end","\\right","&"],vi.endOfGroup={"[":"]","{":"}","\\begingroup":"\\endgroup"},vi.SUPSUB_GREEDINESS=1;var cn=function(p,v){if(!(typeof p=="string"||p instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var b=new vi(p,v);delete b.gullet.macros.current["\\df@tag"];var L=b.parse();if(b.gullet.macros.get("\\df@tag")){if(!v.displayMode)throw new d("\\tag works only in display equations");b.gullet.feed("\\df@tag"),L=[{type:"tag",mode:"text",body:L,tag:b.parse()}]}return L},Ss=cn,eo=function(p,v,b){v.textContent="";var L=ya(p,b).toNode();v.appendChild(L)};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."),eo=function(){throw new d("KaTeX doesn't work in quirks mode.")});var Us=function(p,v){var b=ya(p,v).toMarkup();return b},Oo=function(p,v){var b=new E(v);return Ss(p,b)},to=function(p,v,b){if(b.throwOnError||!(p instanceof d))throw p;var L=ct.makeSpan(["katex-error"],[new Le(v)]);return L.setAttribute("title",p.toString()),L.setAttribute("style","color:"+b.errorColor),L},ya=function(p,v){var b=new E(v);try{var L=Ss(p,b);return gi(L,p,b)}catch(V){return to(V,p,b)}},Mo=function(p,v){var b=new E(v);try{var L=Ss(p,b);return Mn(L,p,b)}catch(V){return to(V,p,b)}},ro={version:"0.11.1",render:eo,renderToString:Us,ParseError:d,__parse:Oo,__renderToDomTree:ya,__renderToHTMLTree:Mo,__setFontMetrics:Pt,__defineSymbol:$,__defineMacro:we,__domTree:{Span:ze,Anchor:Je,SymbolNode:Le,SvgNode:We,PathNode:Ge,LineNode:Xe}},Fo=y.default=ro}]).default})},32834:function(Ot){(function(ke,y){Ot.exports=y()})(this,function(){"use strict";function ke(Re,Me){for(var $e=0;$e<Me.length;$e++){var he=Me[$e];he.enumerable=he.enumerable||!1,he.configurable=!0,"value"in he&&(he.writable=!0),Object.defineProperty(Re,he.key,he)}}function y(Re,Me,$e){return Me&&ke(Re.prototype,Me),$e&&ke(Re,$e),Re}function R(Re,Me){if(Re){if(typeof Re=="string")return N(Re,Me);var $e=Object.prototype.toString.call(Re).slice(8,-1);if($e==="Object"&&Re.constructor&&($e=Re.constructor.name),$e==="Map"||$e==="Set")return Array.from(Re);if($e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test($e))return N(Re,Me)}}function N(Re,Me){(Me==null||Me>Re.length)&&(Me=Re.length);for(var $e=0,he=new Array(Me);$e<Me;$e++)he[$e]=Re[$e];return he}function K(Re,Me){var $e=typeof Symbol!="undefined"&&Re[Symbol.iterator]||Re["@@iterator"];if($e)return($e=$e.call(Re)).next.bind($e);if(Array.isArray(Re)||($e=R(Re))||Me&&Re&&typeof Re.length=="number"){$e&&(Re=$e);var he=0;return function(){return he>=Re.length?{done:!0}:{done:!1,value:Re[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 P={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(Re){P.exports.defaults=Re}P.exports={defaults:A(),getDefaults:A,changeDefaults:d};var U=/[&<>"']/,S=/[&<>"']/g,s=/[<>"']|&(?!#?\w+;)/,w=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},u=function(Me){return f[Me]};function l(Re,Me){if(Me){if(U.test(Re))return Re.replace(S,u)}else if(s.test(Re))return Re.replace(w,u);return Re}var c=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function m(Re){return Re.replace(c,function(Me,$e){return $e=$e.toLowerCase(),$e==="colon"?":":$e.charAt(0)==="#"?$e.charAt(1)==="x"?String.fromCharCode(parseInt($e.substring(2),16)):String.fromCharCode(+$e.substring(1)):""})}var C=/(^|[^\[])\^/g;function M(Re,Me){Re=Re.source||Re,Me=Me||"";var $e={replace:function(fe,Ee){return Ee=Ee.source||Ee,Ee=Ee.replace(C,"$1"),Re=Re.replace(fe,Ee),$e},getRegex:function(){return new RegExp(Re,Me)}};return $e}var k=/[^\w:]/g,E=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function T(Re,Me,$e){if(Re){var he;try{he=decodeURIComponent(m($e)).replace(k,"").toLowerCase()}catch(fe){return null}if(he.indexOf("javascript:")===0||he.indexOf("vbscript:")===0||he.indexOf("data:")===0)return null}Me&&!E.test($e)&&($e=z(Me,$e));try{$e=encodeURI($e).replace(/%25/g,"%")}catch(fe){return null}return $e}var I={},F=/^[^:]+:\/*[^/]*$/,H=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function z(Re,Me){I[" "+Re]||(F.test(Re)?I[" "+Re]=Re+"/":I[" "+Re]=Ae(Re,"/",!0)),Re=I[" "+Re];var $e=Re.indexOf(":")===-1;return Me.substring(0,2)==="//"?$e?Me:Re.replace(H,"$1")+Me:Me.charAt(0)==="/"?$e?Me:Re.replace(W,"$1")+Me:Re+Me}var ie={exec:function(){}};function re(Re){for(var Me=1,$e,he;Me<arguments.length;Me++){$e=arguments[Me];for(he in $e)Object.prototype.hasOwnProperty.call($e,he)&&(Re[he]=$e[he])}return Re}function _e(Re,Me){var $e=Re.replace(/\|/g,function(Ee,Ie,se){for(var ot=!1,ve=Ie;--ve>=0&&se[ve]==="\\";)ot=!ot;return ot?"|":" |"}),he=$e.split(/ \|/),fe=0;if(he.length>Me)he.splice(Me);else for(;he.length<Me;)he.push("");for(;fe<he.length;fe++)he[fe]=he[fe].trim().replace(/\\\|/g,"|");return he}function Ae(Re,Me,$e){var he=Re.length;if(he===0)return"";for(var fe=0;fe<he;){var Ee=Re.charAt(he-fe-1);if(Ee===Me&&!$e)fe++;else if(Ee!==Me&&$e)fe++;else break}return Re.substr(0,he-fe)}function ce(Re,Me){if(Re.indexOf(Me[1])===-1)return-1;for(var $e=Re.length,he=0,fe=0;fe<$e;fe++)if(Re[fe]==="\\")fe++;else if(Re[fe]===Me[0])he++;else if(Re[fe]===Me[1]&&(he--,he<0))return fe;return-1}function J(Re){Re&&Re.sanitize&&!Re.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 ae(Re,Me){if(Me<1)return"";for(var $e="";Me>1;)Me&1&&($e+=Re),Me>>=1,Re+=Re;return $e+Re}var G={escape:l,unescape:m,edit:M,cleanUrl:T,resolveUrl:z,noopTest:ie,merge:re,splitCells:_e,rtrim:Ae,findClosingBracket:ce,checkSanitizeDeprecation:J,repeatString:ae},X=P.exports.defaults,Z=G.rtrim,B=G.splitCells,O=G.escape,ne=G.findClosingBracket;function me(Re,Me,$e){var he=Me.href,fe=Me.title?O(Me.title):null,Ee=Re[1].replace(/\\([\[\]])/g,"$1");return Re[0].charAt(0)!=="!"?{type:"link",raw:$e,href:he,title:fe,text:Ee}:{type:"image",raw:$e,href:he,title:fe,text:O(Ee)}}function Oe(Re,Me){var $e=Re.match(/^(\s+)(?:```)/);if($e===null)return Me;var he=$e[1];return Me.split(`
|
|
|
`).map(function(fe){var Ee=fe.match(/^\s+/);if(Ee===null)return fe;var Ie=Ee[0];return Ie.length>=he.length?fe.slice(he.length):fe}).join(`
|
|
|
`)}var He=function(){function Re($e){this.options=$e||X}var Me=Re.prototype;return Me.space=function(he){var fe=this.rules.block.newline.exec(he);if(fe)return fe[0].length>1?{type:"space",raw:fe[0]}:{raw:`
|
|
|
`}},Me.code=function(he){var fe=this.rules.block.code.exec(he);if(fe){var Ee=fe[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:fe[0],codeBlockStyle:"indented",text:this.options.pedantic?Ee:Z(Ee,`
|
|
|
`)}}},Me.fences=function(he){var fe=this.rules.block.fences.exec(he);if(fe){var Ee=fe[0],Ie=Oe(Ee,fe[3]||"");return{type:"code",raw:Ee,lang:fe[2]?fe[2].trim():fe[2],text:Ie}}},Me.heading=function(he){var fe=this.rules.block.heading.exec(he);if(fe){var Ee=fe[2].trim();if(/#$/.test(Ee)){var Ie=Z(Ee,"#");(this.options.pedantic||!Ie||/ $/.test(Ie))&&(Ee=Ie.trim())}return{type:"heading",raw:fe[0],depth:fe[1].length,text:Ee}}},Me.nptable=function(he){var fe=this.rules.block.nptable.exec(he);if(fe){var Ee={type:"table",header:B(fe[1].replace(/^ *| *\| *$/g,"")),align:fe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:fe[3]?fe[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:fe[0]};if(Ee.header.length===Ee.align.length){var Ie=Ee.align.length,se;for(se=0;se<Ie;se++)/^ *-+: *$/.test(Ee.align[se])?Ee.align[se]="right":/^ *:-+: *$/.test(Ee.align[se])?Ee.align[se]="center":/^ *:-+ *$/.test(Ee.align[se])?Ee.align[se]="left":Ee.align[se]=null;for(Ie=Ee.cells.length,se=0;se<Ie;se++)Ee.cells[se]=B(Ee.cells[se],Ee.header.length);return Ee}}},Me.hr=function(he){var fe=this.rules.block.hr.exec(he);if(fe)return{type:"hr",raw:fe[0]}},Me.blockquote=function(he){var fe=this.rules.block.blockquote.exec(he);if(fe){var Ee=fe[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:fe[0],text:Ee}}},Me.list=function(he){var fe=this.rules.block.list.exec(he);if(fe){var Ee=fe[0],Ie=fe[2],se=Ie.length>1,ot={type:"list",raw:Ee,ordered:se,start:se?+Ie.slice(0,-1):"",loose:!1,items:[]},ve=fe[0].match(this.rules.block.item),Rt=!1,Bt,zt,Cr,ar,qt,Dr,Hr,pr,gr,Mt=ve.length;Cr=this.rules.block.listItemStart.exec(ve[0]);for(var yt=0;yt<Mt;yt++){if(Bt=ve[yt],Ee=Bt,this.options.pedantic||(gr=Bt.match(new RegExp("\\n\\s*\\n {0,"+(Cr[0].length-1)+"}\\S")),gr&&(qt=Bt.length-gr.index+ve.slice(yt+1).join(`
|
|
|
`).length,ot.raw=ot.raw.substring(0,ot.raw.length-qt),Bt=Bt.substring(0,gr.index),Ee=Bt,Mt=yt+1)),yt!==Mt-1){if(ar=this.rules.block.listItemStart.exec(ve[yt+1]),this.options.pedantic?ar[1].length>Cr[1].length:ar[1].length>=Cr[0].length||ar[1].length>3){ve.splice(yt,2,ve[yt]+(!this.options.pedantic&&ar[1].length<Cr[0].length&&!ve[yt].match(/\n$/)?"":`
|
|
|
`)+ve[yt+1]),yt--,Mt--;continue}else(!this.options.pedantic||this.options.smartLists?ar[2][ar[2].length-1]!==Ie[Ie.length-1]:se===(ar[2].length===1))&&(qt=ve.slice(yt+1).join(`
|
|
|
`).length,ot.raw=ot.raw.substring(0,ot.raw.length-qt),yt=Mt-1);Cr=ar}zt=Bt.length,Bt=Bt.replace(/^ *([*+-]|\d+[.)]) ?/,""),~Bt.indexOf(`
|
|
|
`)&&(zt-=Bt.length,Bt=this.options.pedantic?Bt.replace(/^ {1,4}/gm,""):Bt.replace(new RegExp("^ {1,"+zt+"}","gm"),"")),Bt=Z(Bt,`
|
|
|
`),yt!==Mt-1&&(Ee=Ee+`
|
|
|
`),Dr=Rt||/\n\n(?!\s*$)/.test(Ee),yt!==Mt-1&&(Rt=Ee.slice(-2)===`
|
|
|
|
|
|
`,Dr||(Dr=Rt)),Dr&&(ot.loose=!0),this.options.gfm&&(Hr=/^\[[ xX]\] /.test(Bt),pr=void 0,Hr&&(pr=Bt[1]!==" ",Bt=Bt.replace(/^\[[ xX]\] +/,""))),ot.items.push({type:"list_item",raw:Ee,task:Hr,checked:pr,loose:Dr,text:Bt})}return ot}},Me.html=function(he){var fe=this.rules.block.html.exec(he);if(fe)return{type:this.options.sanitize?"paragraph":"html",raw:fe[0],pre:!this.options.sanitizer&&(fe[1]==="pre"||fe[1]==="script"||fe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(fe[0]):O(fe[0]):fe[0]}},Me.def=function(he){var fe=this.rules.block.def.exec(he);if(fe){fe[3]&&(fe[3]=fe[3].substring(1,fe[3].length-1));var Ee=fe[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:Ee,raw:fe[0],href:fe[2],title:fe[3]}}},Me.table=function(he){var fe=this.rules.block.table.exec(he);if(fe){var Ee={type:"table",header:B(fe[1].replace(/^ *| *\| *$/g,"")),align:fe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:fe[3]?fe[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(Ee.header.length===Ee.align.length){Ee.raw=fe[0];var Ie=Ee.align.length,se;for(se=0;se<Ie;se++)/^ *-+: *$/.test(Ee.align[se])?Ee.align[se]="right":/^ *:-+: *$/.test(Ee.align[se])?Ee.align[se]="center":/^ *:-+ *$/.test(Ee.align[se])?Ee.align[se]="left":Ee.align[se]=null;for(Ie=Ee.cells.length,se=0;se<Ie;se++)Ee.cells[se]=B(Ee.cells[se].replace(/^ *\| *| *\| *$/g,""),Ee.header.length);return Ee}}},Me.lheading=function(he){var fe=this.rules.block.lheading.exec(he);if(fe)return{type:"heading",raw:fe[0],depth:fe[2].charAt(0)==="="?1:2,text:fe[1]}},Me.paragraph=function(he){var fe=this.rules.block.paragraph.exec(he);if(fe)return{type:"paragraph",raw:fe[0],text:fe[1].charAt(fe[1].length-1)===`
|
|
|
`?fe[1].slice(0,-1):fe[1]}},Me.text=function(he){var fe=this.rules.block.text.exec(he);if(fe)return{type:"text",raw:fe[0],text:fe[0]}},Me.escape=function(he){var fe=this.rules.inline.escape.exec(he);if(fe)return{type:"escape",raw:fe[0],text:O(fe[1])}},Me.tag=function(he,fe,Ee){var Ie=this.rules.inline.tag.exec(he);if(Ie)return!fe&&/^<a /i.test(Ie[0])?fe=!0:fe&&/^<\/a>/i.test(Ie[0])&&(fe=!1),!Ee&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ie[0])?Ee=!0:Ee&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ie[0])&&(Ee=!1),{type:this.options.sanitize?"text":"html",raw:Ie[0],inLink:fe,inRawBlock:Ee,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ie[0]):O(Ie[0]):Ie[0]}},Me.link=function(he){var fe=this.rules.inline.link.exec(he);if(fe){var Ee=fe[2].trim();if(!this.options.pedantic&&/^</.test(Ee)){if(!/>$/.test(Ee))return;var Ie=Z(Ee.slice(0,-1),"\\");if((Ee.length-Ie.length)%2===0)return}else{var se=ne(fe[2],"()");if(se>-1){var ot=fe[0].indexOf("!")===0?5:4,ve=ot+fe[1].length+se;fe[2]=fe[2].substring(0,se),fe[0]=fe[0].substring(0,ve).trim(),fe[3]=""}}var Rt=fe[2],Bt="";if(this.options.pedantic){var zt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Rt);zt&&(Rt=zt[1],Bt=zt[3])}else Bt=fe[3]?fe[3].slice(1,-1):"";return Rt=Rt.trim(),/^</.test(Rt)&&(this.options.pedantic&&!/>$/.test(Ee)?Rt=Rt.slice(1):Rt=Rt.slice(1,-1)),me(fe,{href:Rt&&Rt.replace(this.rules.inline._escapes,"$1"),title:Bt&&Bt.replace(this.rules.inline._escapes,"$1")},fe[0])}},Me.reflink=function(he,fe){var Ee;if((Ee=this.rules.inline.reflink.exec(he))||(Ee=this.rules.inline.nolink.exec(he))){var Ie=(Ee[2]||Ee[1]).replace(/\s+/g," ");if(Ie=fe[Ie.toLowerCase()],!Ie||!Ie.href){var se=Ee[0].charAt(0);return{type:"text",raw:se,text:se}}return me(Ee,Ie,Ee[0])}},Me.emStrong=function(he,fe,Ee){Ee===void 0&&(Ee="");var Ie=this.rules.inline.emStrong.lDelim.exec(he);if(Ie&&!(Ie[3]&&Ee.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 se=Ie[1]||Ie[2]||"";if(!se||se&&(Ee===""||this.rules.inline.punctuation.exec(Ee))){var ot=Ie[0].length-1,ve,Rt,Bt=ot,zt=0,Cr=Ie[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Cr.lastIndex=0,fe=fe.slice(-1*he.length+ot);(Ie=Cr.exec(fe))!=null;)if(ve=Ie[1]||Ie[2]||Ie[3]||Ie[4]||Ie[5]||Ie[6],!!ve){if(Rt=ve.length,Ie[3]||Ie[4]){Bt+=Rt;continue}else if((Ie[5]||Ie[6])&&ot%3&&!((ot+Rt)%3)){zt+=Rt;continue}if(Bt-=Rt,!(Bt>0))return Rt=Math.min(Rt,Rt+Bt+zt),Math.min(ot,Rt)%2?{type:"em",raw:he.slice(0,ot+Ie.index+Rt+1),text:he.slice(1,ot+Ie.index+Rt)}:{type:"strong",raw:he.slice(0,ot+Ie.index+Rt+1),text:he.slice(2,ot+Ie.index+Rt-1)}}}}},Me.codespan=function(he){var fe=this.rules.inline.code.exec(he);if(fe){var Ee=fe[2].replace(/\n/g," "),Ie=/[^ ]/.test(Ee),se=/^ /.test(Ee)&&/ $/.test(Ee);return Ie&&se&&(Ee=Ee.substring(1,Ee.length-1)),Ee=O(Ee,!0),{type:"codespan",raw:fe[0],text:Ee}}},Me.br=function(he){var fe=this.rules.inline.br.exec(he);if(fe)return{type:"br",raw:fe[0]}},Me.del=function(he){var fe=this.rules.inline.del.exec(he);if(fe)return{type:"del",raw:fe[0],text:fe[2]}},Me.autolink=function(he,fe){var Ee=this.rules.inline.autolink.exec(he);if(Ee){var Ie,se;return Ee[2]==="@"?(Ie=O(this.options.mangle?fe(Ee[1]):Ee[1]),se="mailto:"+Ie):(Ie=O(Ee[1]),se=Ie),{type:"link",raw:Ee[0],text:Ie,href:se,tokens:[{type:"text",raw:Ie,text:Ie}]}}},Me.url=function(he,fe){var Ee;if(Ee=this.rules.inline.url.exec(he)){var Ie,se;if(Ee[2]==="@")Ie=O(this.options.mangle?fe(Ee[0]):Ee[0]),se="mailto:"+Ie;else{var ot;do ot=Ee[0],Ee[0]=this.rules.inline._backpedal.exec(Ee[0])[0];while(ot!==Ee[0]);Ie=O(Ee[0]),Ee[1]==="www."?se="http://"+Ie:se=Ie}return{type:"link",raw:Ee[0],text:Ie,href:se,tokens:[{type:"text",raw:Ie,text:Ie}]}}},Me.inlineText=function(he,fe,Ee){var Ie=this.rules.inline.text.exec(he);if(Ie){var se;return fe?se=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ie[0]):O(Ie[0]):Ie[0]:se=O(this.options.smartypants?Ee(Ie[0]):Ie[0]),{type:"text",raw:Ie[0],text:se}}},Re}(),ut=G.noopTest,Fe=G.edit,it=G.merge,st={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:ut,table:ut,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};st._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,st._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,st.def=Fe(st.def).replace("label",st._label).replace("title",st._title).getRegex(),st.bullet=/(?:[*+-]|\d{1,9}[.)])/,st.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,st.item=Fe(st.item,"gm").replace(/bull/g,st.bullet).getRegex(),st.listItemStart=Fe(/^( *)(bull) */).replace("bull",st.bullet).getRegex(),st.list=Fe(st.list).replace(/bull/g,st.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+st.def.source+")").getRegex(),st._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",st._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,st.html=Fe(st.html,"i").replace("comment",st._comment).replace("tag",st._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),st.paragraph=Fe(st._paragraph).replace("hr",st.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",st._tag).getRegex(),st.blockquote=Fe(st.blockquote).replace("paragraph",st.paragraph).getRegex(),st.normal=it({},st),st.gfm=it({},st.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*|$)"}),st.gfm.nptable=Fe(st.gfm.nptable).replace("hr",st.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",st._tag).getRegex(),st.gfm.table=Fe(st.gfm.table).replace("hr",st.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",st._tag).getRegex(),st.pedantic=it({},st.normal,{html:Fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",st._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:ut,paragraph:Fe(st.normal._paragraph).replace("hr",st.hr).replace("heading",` *#{1,6} *[^
|
|
|
]`).replace("lheading",st.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var et={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ut,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:ut,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};et._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",et.punctuation=Fe(et.punctuation).replace(/punctuation/g,et._punctuation).getRegex(),et.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,et.escapedEmSt=/\\\*|\\_/g,et._comment=Fe(st._comment).replace("(?:-->|$)","-->").getRegex(),et.emStrong.lDelim=Fe(et.emStrong.lDelim).replace(/punct/g,et._punctuation).getRegex(),et.emStrong.rDelimAst=Fe(et.emStrong.rDelimAst,"g").replace(/punct/g,et._punctuation).getRegex(),et.emStrong.rDelimUnd=Fe(et.emStrong.rDelimUnd,"g").replace(/punct/g,et._punctuation).getRegex(),et._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,et._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,et._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])?)+(?![-_])/,et.autolink=Fe(et.autolink).replace("scheme",et._scheme).replace("email",et._email).getRegex(),et._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,et.tag=Fe(et.tag).replace("comment",et._comment).replace("attribute",et._attribute).getRegex(),et._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,et._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,et._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,et.link=Fe(et.link).replace("label",et._label).replace("href",et._href).replace("title",et._title).getRegex(),et.reflink=Fe(et.reflink).replace("label",et._label).getRegex(),et.reflinkSearch=Fe(et.reflinkSearch,"g").replace("reflink",et.reflink).replace("nolink",et.nolink).getRegex(),et.normal=it({},et),et.pedantic=it({},et.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",et._label).getRegex(),reflink:Fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",et._label).getRegex()}),et.gfm=it({},et.normal,{escape:Fe(et.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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),et.gfm.url=Fe(et.gfm.url,"i").replace("email",et.gfm._extended_email).getRegex(),et.breaks=it({},et.gfm,{br:Fe(et.br).replace("{2,}","*").getRegex(),text:Fe(et.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Nt={block:st,inline:et},tt=He,kt=P.exports.defaults,Ne=Nt.block,ft=Nt.inline,Pe=G.repeatString;function Te(Re){return Re.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 Se(Re){var Me="",$e,he,fe=Re.length;for($e=0;$e<fe;$e++)he=Re.charCodeAt($e),Math.random()>.5&&(he="x"+he.toString(16)),Me+="&#"+he+";";return Me}var ze=function(){function Re($e){this.tokens=[],this.tokens.links=Object.create(null),this.options=$e||kt,this.options.tokenizer=this.options.tokenizer||new tt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var he={block:Ne.normal,inline:ft.normal};this.options.pedantic?(he.block=Ne.pedantic,he.inline=ft.pedantic):this.options.gfm&&(he.block=Ne.gfm,this.options.breaks?he.inline=ft.breaks:he.inline=ft.gfm),this.tokenizer.rules=he}Re.lex=function(he,fe){var Ee=new Re(fe);return Ee.lex(he)},Re.lexInline=function(he,fe){var Ee=new Re(fe);return Ee.inlineTokens(he)};var Me=Re.prototype;return Me.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},Me.blockTokens=function(he,fe,Ee){fe===void 0&&(fe=[]),Ee===void 0&&(Ee=!0),this.options.pedantic&&(he=he.replace(/^ +$/gm,""));for(var Ie,se,ot,ve;he;){if(Ie=this.tokenizer.space(he)){he=he.substring(Ie.raw.length),Ie.type&&fe.push(Ie);continue}if(Ie=this.tokenizer.code(he)){he=he.substring(Ie.raw.length),ve=fe[fe.length-1],ve&&ve.type==="paragraph"?(ve.raw+=`
|
|
|
`+Ie.raw,ve.text+=`
|
|
|
`+Ie.text):fe.push(Ie);continue}if(Ie=this.tokenizer.fences(he)){he=he.substring(Ie.raw.length),fe.push(Ie);continue}if(Ie=this.tokenizer.heading(he)){he=he.substring(Ie.raw.length),fe.push(Ie);continue}if(Ie=this.tokenizer.nptable(he)){he=he.substring(Ie.raw.length),fe.push(Ie);continue}if(Ie=this.tokenizer.hr(he)){he=he.substring(Ie.raw.length),fe.push(Ie);continue}if(Ie=this.tokenizer.blockquote(he)){he=he.substring(Ie.raw.length),Ie.tokens=this.blockTokens(Ie.text,[],Ee),fe.push(Ie);continue}if(Ie=this.tokenizer.list(he)){for(he=he.substring(Ie.raw.length),ot=Ie.items.length,se=0;se<ot;se++)Ie.items[se].tokens=this.blockTokens(Ie.items[se].text,[],!1);fe.push(Ie);continue}if(Ie=this.tokenizer.html(he)){he=he.substring(Ie.raw.length),fe.push(Ie);continue}if(Ee&&(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),fe.push(Ie);continue}if(Ie=this.tokenizer.lheading(he)){he=he.substring(Ie.raw.length),fe.push(Ie);continue}if(Ee&&(Ie=this.tokenizer.paragraph(he))){he=he.substring(Ie.raw.length),fe.push(Ie);continue}if(Ie=this.tokenizer.text(he)){he=he.substring(Ie.raw.length),ve=fe[fe.length-1],ve&&ve.type==="text"?(ve.raw+=`
|
|
|
`+Ie.raw,ve.text+=`
|
|
|
`+Ie.text):fe.push(Ie);continue}if(he){var Rt="Infinite loop on byte: "+he.charCodeAt(0);if(this.options.silent){console.error(Rt);break}else throw new Error(Rt)}}return fe},Me.inline=function(he){var fe,Ee,Ie,se,ot,ve,Rt=he.length;for(fe=0;fe<Rt;fe++)switch(ve=he[fe],ve.type){case"paragraph":case"text":case"heading":{ve.tokens=[],this.inlineTokens(ve.text,ve.tokens);break}case"table":{for(ve.tokens={header:[],cells:[]},se=ve.header.length,Ee=0;Ee<se;Ee++)ve.tokens.header[Ee]=[],this.inlineTokens(ve.header[Ee],ve.tokens.header[Ee]);for(se=ve.cells.length,Ee=0;Ee<se;Ee++)for(ot=ve.cells[Ee],ve.tokens.cells[Ee]=[],Ie=0;Ie<ot.length;Ie++)ve.tokens.cells[Ee][Ie]=[],this.inlineTokens(ot[Ie],ve.tokens.cells[Ee][Ie]);break}case"blockquote":{this.inline(ve.tokens);break}case"list":{for(se=ve.items.length,Ee=0;Ee<se;Ee++)this.inline(ve.items[Ee].tokens);break}}return he},Me.inlineTokens=function(he,fe,Ee,Ie){fe===void 0&&(fe=[]),Ee===void 0&&(Ee=!1),Ie===void 0&&(Ie=!1);var se,ot,ve=he,Rt,Bt,zt;if(this.tokens.links){var Cr=Object.keys(this.tokens.links);if(Cr.length>0)for(;(Rt=this.tokenizer.rules.inline.reflinkSearch.exec(ve))!=null;)Cr.includes(Rt[0].slice(Rt[0].lastIndexOf("[")+1,-1))&&(ve=ve.slice(0,Rt.index)+"["+Pe("a",Rt[0].length-2)+"]"+ve.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Rt=this.tokenizer.rules.inline.blockSkip.exec(ve))!=null;)ve=ve.slice(0,Rt.index)+"["+Pe("a",Rt[0].length-2)+"]"+ve.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Rt=this.tokenizer.rules.inline.escapedEmSt.exec(ve))!=null;)ve=ve.slice(0,Rt.index)+"++"+ve.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;he;){if(Bt||(zt=""),Bt=!1,se=this.tokenizer.escape(he)){he=he.substring(se.raw.length),fe.push(se);continue}if(se=this.tokenizer.tag(he,Ee,Ie)){he=he.substring(se.raw.length),Ee=se.inLink,Ie=se.inRawBlock;var ar=fe[fe.length-1];ar&&se.type==="text"&&ar.type==="text"?(ar.raw+=se.raw,ar.text+=se.text):fe.push(se);continue}if(se=this.tokenizer.link(he)){he=he.substring(se.raw.length),se.type==="link"&&(se.tokens=this.inlineTokens(se.text,[],!0,Ie)),fe.push(se);continue}if(se=this.tokenizer.reflink(he,this.tokens.links)){he=he.substring(se.raw.length);var qt=fe[fe.length-1];se.type==="link"?(se.tokens=this.inlineTokens(se.text,[],!0,Ie),fe.push(se)):qt&&se.type==="text"&&qt.type==="text"?(qt.raw+=se.raw,qt.text+=se.text):fe.push(se);continue}if(se=this.tokenizer.emStrong(he,ve,zt)){he=he.substring(se.raw.length),se.tokens=this.inlineTokens(se.text,[],Ee,Ie),fe.push(se);continue}if(se=this.tokenizer.codespan(he)){he=he.substring(se.raw.length),fe.push(se);continue}if(se=this.tokenizer.br(he)){he=he.substring(se.raw.length),fe.push(se);continue}if(se=this.tokenizer.del(he)){he=he.substring(se.raw.length),se.tokens=this.inlineTokens(se.text,[],Ee,Ie),fe.push(se);continue}if(se=this.tokenizer.autolink(he,Se)){he=he.substring(se.raw.length),fe.push(se);continue}if(!Ee&&(se=this.tokenizer.url(he,Se))){he=he.substring(se.raw.length),fe.push(se);continue}if(se=this.tokenizer.inlineText(he,Ie,Te)){he=he.substring(se.raw.length),se.raw.slice(-1)!=="_"&&(zt=se.raw.slice(-1)),Bt=!0,ot=fe[fe.length-1],ot&&ot.type==="text"?(ot.raw+=se.raw,ot.text+=se.text):fe.push(se);continue}if(he){var Dr="Infinite loop on byte: "+he.charCodeAt(0);if(this.options.silent){console.error(Dr);break}else throw new Error(Dr)}}return fe},y(Re,null,[{key:"rules",get:function(){return{block:Ne,inline:ft}}}]),Re}(),Je=P.exports.defaults,rt=G.cleanUrl,de=G.escape,Le=function(){function Re($e){this.options=$e||Je}var Me=Re.prototype;return Me.code=function(he,fe,Ee){var Ie=(fe||"").match(/\S*/)[0];if(this.options.highlight){var se=this.options.highlight(he,Ie);se!=null&&se!==he&&(Ee=!0,he=se)}return he=he.replace(/\n$/,"")+`
|
|
|
`,Ie?'<pre><code class="'+this.options.langPrefix+de(Ie,!0)+'">'+(Ee?he:de(he,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(Ee?he:de(he,!0))+`</code></pre>
|
|
|
`},Me.blockquote=function(he){return`<blockquote>
|
|
|
`+he+`</blockquote>
|
|
|
`},Me.html=function(he){return he},Me.heading=function(he,fe,Ee,Ie){return this.options.headerIds?"<h"+fe+' id="'+this.options.headerPrefix+Ie.slug(Ee)+'">'+he+"</h"+fe+`>
|
|
|
`:"<h"+fe+">"+he+"</h"+fe+`>
|
|
|
`},Me.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},Me.list=function(he,fe,Ee){var Ie=fe?"ol":"ul",se=fe&&Ee!==1?' start="'+Ee+'"':"";return"<"+Ie+se+`>
|
|
|
`+he+"</"+Ie+`>
|
|
|
`},Me.listitem=function(he){return"<li>"+he+`</li>
|
|
|
`},Me.checkbox=function(he){return"<input "+(he?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Me.paragraph=function(he){return"<p>"+he+`</p>
|
|
|
`},Me.table=function(he,fe){return fe&&(fe="<tbody>"+fe+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+he+`</thead>
|
|
|
`+fe+`</table>
|
|
|
`},Me.tablerow=function(he){return`<tr>
|
|
|
`+he+`</tr>
|
|
|
`},Me.tablecell=function(he,fe){var Ee=fe.header?"th":"td",Ie=fe.align?"<"+Ee+' align="'+fe.align+'">':"<"+Ee+">";return Ie+he+"</"+Ee+`>
|
|
|
`},Me.strong=function(he){return"<strong>"+he+"</strong>"},Me.em=function(he){return"<em>"+he+"</em>"},Me.codespan=function(he){return"<code>"+he+"</code>"},Me.br=function(){return this.options.xhtml?"<br/>":"<br>"},Me.del=function(he){return"<del>"+he+"</del>"},Me.link=function(he,fe,Ee){if(he=rt(this.options.sanitize,this.options.baseUrl,he),he===null)return Ee;var Ie='<a href="'+de(he)+'"';return fe&&(Ie+=' title="'+fe+'"'),Ie+=">"+Ee+"</a>",Ie},Me.image=function(he,fe,Ee){if(he=rt(this.options.sanitize,this.options.baseUrl,he),he===null)return Ee;var Ie='<img src="'+he+'" alt="'+Ee+'"';return fe&&(Ie+=' title="'+fe+'"'),Ie+=this.options.xhtml?"/>":">",Ie},Me.text=function(he){return he},Re}(),We=function(){function Re(){}var Me=Re.prototype;return Me.strong=function(he){return he},Me.em=function(he){return he},Me.codespan=function(he){return he},Me.del=function(he){return he},Me.html=function(he){return he},Me.text=function(he){return he},Me.link=function(he,fe,Ee){return""+Ee},Me.image=function(he,fe,Ee){return""+Ee},Me.br=function(){return""},Re}(),Ge=function(){function Re(){this.seen={}}var Me=Re.prototype;return Me.serialize=function(he){return he.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},Me.getNextSafeSlug=function(he,fe){var Ee=he,Ie=0;if(this.seen.hasOwnProperty(Ee)){Ie=this.seen[he];do Ie++,Ee=he+"-"+Ie;while(this.seen.hasOwnProperty(Ee))}return fe||(this.seen[he]=Ie,this.seen[Ee]=0),Ee},Me.slug=function(he,fe){fe===void 0&&(fe={});var Ee=this.serialize(he);return this.getNextSafeSlug(Ee,fe.dryrun)},Re}(),Xe=Le,gt=We,Ct=Ge,ht=P.exports.defaults,dt=G.unescape,vt=function(){function Re($e){this.options=$e||ht,this.options.renderer=this.options.renderer||new Xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new gt,this.slugger=new Ct}Re.parse=function(he,fe){var Ee=new Re(fe);return Ee.parse(he)},Re.parseInline=function(he,fe){var Ee=new Re(fe);return Ee.parseInline(he)};var Me=Re.prototype;return Me.parse=function(he,fe){fe===void 0&&(fe=!0);var Ee="",Ie,se,ot,ve,Rt,Bt,zt,Cr,ar,qt,Dr,Hr,pr,gr,Mt,yt,bt,Vt,cr=he.length;for(Ie=0;Ie<cr;Ie++)switch(qt=he[Ie],qt.type){case"space":continue;case"hr":{Ee+=this.renderer.hr();continue}case"heading":{Ee+=this.renderer.heading(this.parseInline(qt.tokens),qt.depth,dt(this.parseInline(qt.tokens,this.textRenderer)),this.slugger);continue}case"code":{Ee+=this.renderer.code(qt.text,qt.lang,qt.escaped);continue}case"table":{for(Cr="",zt="",ve=qt.header.length,se=0;se<ve;se++)zt+=this.renderer.tablecell(this.parseInline(qt.tokens.header[se]),{header:!0,align:qt.align[se]});for(Cr+=this.renderer.tablerow(zt),ar="",ve=qt.cells.length,se=0;se<ve;se++){for(Bt=qt.tokens.cells[se],zt="",Rt=Bt.length,ot=0;ot<Rt;ot++)zt+=this.renderer.tablecell(this.parseInline(Bt[ot]),{header:!1,align:qt.align[ot]});ar+=this.renderer.tablerow(zt)}Ee+=this.renderer.table(Cr,ar);continue}case"blockquote":{ar=this.parse(qt.tokens),Ee+=this.renderer.blockquote(ar);continue}case"list":{for(Dr=qt.ordered,Hr=qt.start,pr=qt.loose,ve=qt.items.length,ar="",se=0;se<ve;se++)Mt=qt.items[se],yt=Mt.checked,bt=Mt.task,gr="",Mt.task&&(Vt=this.renderer.checkbox(yt),pr?Mt.tokens.length>0&&Mt.tokens[0].type==="text"?(Mt.tokens[0].text=Vt+" "+Mt.tokens[0].text,Mt.tokens[0].tokens&&Mt.tokens[0].tokens.length>0&&Mt.tokens[0].tokens[0].type==="text"&&(Mt.tokens[0].tokens[0].text=Vt+" "+Mt.tokens[0].tokens[0].text)):Mt.tokens.unshift({type:"text",text:Vt}):gr+=Vt),gr+=this.parse(Mt.tokens,pr),ar+=this.renderer.listitem(gr,bt,yt);Ee+=this.renderer.list(ar,Dr,Hr);continue}case"html":{Ee+=this.renderer.html(qt.text);continue}case"paragraph":{Ee+=this.renderer.paragraph(this.parseInline(qt.tokens));continue}case"text":{for(ar=qt.tokens?this.parseInline(qt.tokens):qt.text;Ie+1<cr&&he[Ie+1].type==="text";)qt=he[++Ie],ar+=`
|
|
|
`+(qt.tokens?this.parseInline(qt.tokens):qt.text);Ee+=fe?this.renderer.paragraph(ar):ar;continue}default:{var xr='Token with "'+qt.type+'" type was not found.';if(this.options.silent){console.error(xr);return}else throw new Error(xr)}}return Ee},Me.parseInline=function(he,fe){fe=fe||this.renderer;var Ee="",Ie,se,ot=he.length;for(Ie=0;Ie<ot;Ie++)switch(se=he[Ie],se.type){case"escape":{Ee+=fe.text(se.text);break}case"html":{Ee+=fe.html(se.text);break}case"link":{Ee+=fe.link(se.href,se.title,this.parseInline(se.tokens,fe));break}case"image":{Ee+=fe.image(se.href,se.title,se.text);break}case"strong":{Ee+=fe.strong(this.parseInline(se.tokens,fe));break}case"em":{Ee+=fe.em(this.parseInline(se.tokens,fe));break}case"codespan":{Ee+=fe.codespan(se.text);break}case"br":{Ee+=fe.br();break}case"del":{Ee+=fe.del(this.parseInline(se.tokens,fe));break}case"text":{Ee+=fe.text(se.text);break}default:{var ve='Token with "'+se.type+'" type was not found.';if(this.options.silent){console.error(ve);return}else throw new Error(ve)}}return Ee},Re}(),Pt=ze,Tt=vt,xt=He,Ke=Le,St=We,_t=Ge,lt=G.merge,At=G.checkSanitizeDeprecation,$=G.escape,q=P.exports.getDefaults,Be=P.exports.changeDefaults,oe=P.exports.defaults;function ge(Re,Me,$e){if(typeof Re=="undefined"||Re===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Re!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Re)+", string expected");if(typeof Me=="function"&&($e=Me,Me=null),Me=lt({},ge.defaults,Me||{}),At(Me),$e){var he=Me.highlight,fe;try{fe=Pt.lex(Re,Me)}catch(ot){return $e(ot)}var Ee=function(ve){var Rt;if(!ve)try{Me.walkTokens&&ge.walkTokens(fe,Me.walkTokens),Rt=Tt.parse(fe,Me)}catch(Bt){ve=Bt}return Me.highlight=he,ve?$e(ve):$e(null,Rt)};if(!he||he.length<3||(delete Me.highlight,!fe.length))return Ee();var Ie=0;ge.walkTokens(fe,function(ot){ot.type==="code"&&(Ie++,setTimeout(function(){he(ot.text,ot.lang,function(ve,Rt){if(ve)return Ee(ve);Rt!=null&&Rt!==ot.text&&(ot.text=Rt,ot.escaped=!0),Ie--,Ie===0&&Ee()})},0))}),Ie===0&&Ee();return}try{var se=Pt.lex(Re,Me);return Me.walkTokens&&ge.walkTokens(se,Me.walkTokens),Tt.parse(se,Me)}catch(ot){if(ot.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,Me.silent)return"<p>An error occurred:</p><pre>"+$(ot.message+"",!0)+"</pre>";throw ot}}ge.options=ge.setOptions=function(Re){return lt(ge.defaults,Re),Be(ge.defaults),ge},ge.getDefaults=q,ge.defaults=oe,ge.use=function(Re){var Me=lt({},Re);if(Re.renderer&&function(){var he=ge.defaults.renderer||new Ke,fe=function(se){var ot=he[se];he[se]=function(){for(var ve=arguments.length,Rt=new Array(ve),Bt=0;Bt<ve;Bt++)Rt[Bt]=arguments[Bt];var zt=Re.renderer[se].apply(he,Rt);return zt===!1&&(zt=ot.apply(he,Rt)),zt}};for(var Ee in Re.renderer)fe(Ee);Me.renderer=he}(),Re.tokenizer&&function(){var he=ge.defaults.tokenizer||new xt,fe=function(se){var ot=he[se];he[se]=function(){for(var ve=arguments.length,Rt=new Array(ve),Bt=0;Bt<ve;Bt++)Rt[Bt]=arguments[Bt];var zt=Re.tokenizer[se].apply(he,Rt);return zt===!1&&(zt=ot.apply(he,Rt)),zt}};for(var Ee in Re.tokenizer)fe(Ee);Me.tokenizer=he}(),Re.walkTokens){var $e=ge.defaults.walkTokens;Me.walkTokens=function(he){Re.walkTokens(he),$e&&$e(he)}}ge.setOptions(Me)},ge.walkTokens=function(Re,Me){for(var $e=K(Re),he;!(he=$e()).done;){var fe=he.value;switch(Me(fe),fe.type){case"table":{for(var Ee=K(fe.tokens.header),Ie;!(Ie=Ee()).done;){var se=Ie.value;ge.walkTokens(se,Me)}for(var ot=K(fe.tokens.cells),ve;!(ve=ot()).done;)for(var Rt=ve.value,Bt=K(Rt),zt;!(zt=Bt()).done;){var Cr=zt.value;ge.walkTokens(Cr,Me)}break}case"list":{ge.walkTokens(fe.items,Me);break}default:fe.tokens&&ge.walkTokens(fe.tokens,Me)}}},ge.parseInline=function(Re,Me){if(typeof Re=="undefined"||Re===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Re!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Re)+", string expected");Me=lt({},ge.defaults,Me||{}),At(Me);try{var $e=Pt.lexInline(Re,Me);return Me.walkTokens&&ge.walkTokens($e,Me.walkTokens),Tt.parseInline($e,Me)}catch(he){if(he.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,Me.silent)return"<p>An error occurred:</p><pre>"+$(he.message+"",!0)+"</pre>";throw he}},ge.Parser=Tt,ge.parser=Tt.parse,ge.Renderer=Ke,ge.TextRenderer=St,ge.Lexer=Pt,ge.lexer=Pt.lex,ge.Tokenizer=xt,ge.Slugger=_t,ge.parse=ge;var Lt=ge;return Lt})},11690:function(Ot){const ke=/[&<>"']/,y=/[&<>"']/g,R=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,K={"&":"&","<":"<",">":">",'"':""","'":"'"},P=z=>K[z];function A(z,ie){if(ie){if(ke.test(z))return z.replace(y,P)}else if(R.test(z))return z.replace(N,P);return z}const d=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(z){return z.replace(d,(ie,re)=>(re=re.toLowerCase(),re==="colon"?":":re.charAt(0)==="#"?re.charAt(1)==="x"?String.fromCharCode(parseInt(re.substring(2),16)):String.fromCharCode(+re.substring(1)):""))}const S=/(^|[^\[])\^/g;function s(z,ie){z=z.source||z,ie=ie||"";const re={replace:(_e,Ae)=>(Ae=Ae.source||Ae,Ae=Ae.replace(S,"$1"),z=z.replace(_e,Ae),re),getRegex:()=>new RegExp(z,ie)};return re}const w=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function u(z,ie,re){if(z){let _e;try{_e=decodeURIComponent(U(re)).replace(w,"").toLowerCase()}catch(Ae){return null}if(_e.indexOf("javascript:")===0||_e.indexOf("vbscript:")===0||_e.indexOf("data:")===0)return null}ie&&!f.test(re)&&(re=M(ie,re));try{re=encodeURI(re).replace(/%25/g,"%")}catch(_e){return null}return re}const l={},c=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,C=/^([^:]+:\/*[^/]*)[\s\S]*$/;function M(z,ie){l[" "+z]||(c.test(z)?l[" "+z]=z+"/":l[" "+z]=I(z,"/",!0)),z=l[" "+z];const re=z.indexOf(":")===-1;return ie.substring(0,2)==="//"?re?ie:z.replace(m,"$1")+ie:ie.charAt(0)==="/"?re?ie:z.replace(C,"$1")+ie:z+ie}const k={exec:function(){}};function E(z){let ie=1,re,_e;for(;ie<arguments.length;ie++){re=arguments[ie];for(_e in re)Object.prototype.hasOwnProperty.call(re,_e)&&(z[_e]=re[_e])}return z}function T(z,ie){const re=z.replace(/\|/g,(ce,J,ae)=>{let G=!1,X=J;for(;--X>=0&&ae[X]==="\\";)G=!G;return G?"|":" |"}),_e=re.split(/ \|/);let Ae=0;if(_e.length>ie)_e.splice(ie);else for(;_e.length<ie;)_e.push("");for(;Ae<_e.length;Ae++)_e[Ae]=_e[Ae].trim().replace(/\\\|/g,"|");return _e}function I(z,ie,re){const _e=z.length;if(_e===0)return"";let Ae=0;for(;Ae<_e;){const ce=z.charAt(_e-Ae-1);if(ce===ie&&!re)Ae++;else if(ce!==ie&&re)Ae++;else break}return z.substr(0,_e-Ae)}function F(z,ie){if(z.indexOf(ie[1])===-1)return-1;const re=z.length;let _e=0,Ae=0;for(;Ae<re;Ae++)if(z[Ae]==="\\")Ae++;else if(z[Ae]===ie[0])_e++;else if(z[Ae]===ie[1]&&(_e--,_e<0))return Ae;return-1}function H(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 W(z,ie){if(ie<1)return"";let re="";for(;ie>1;)ie&1&&(re+=z),ie>>=1,z+=z;return re+z}Ot.exports={escape:A,unescape:U,edit:s,cleanUrl:u,resolveUrl:M,noopTest:k,merge:E,splitCells:T,rtrim:I,findClosingBracket:F,checkSanitizeDeprecation:H,repeatString:W}},75918:function(Ot,ke,y){"use strict";y.d(ke,{Wi:function(){return d},Z0:function(){return U},aU:function(){return A},eZ:function(){return s},wY:function(){return S}});var R=y(4348),N=y(69323),K=y(13268),P=function(w,f,u,l){function c(m){return m instanceof u?m:new u(function(C){C(m)})}return new(u||(u=Promise))(function(m,C){function M(T){try{E(l.next(T))}catch(I){C(I)}}function k(T){try{E(l.throw(T))}catch(I){C(I)}}function E(T){T.done?m(T.value):c(T.value).then(M,k)}E((l=l.apply(w,f||[])).next())})};class A extends N.JT{constructor(f,u="",l="",c=!0,m){super(),this._onDidChange=this._register(new R.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=f,this._label=u,this._cssClass=l,this._enabled=c,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,u){return P(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(f))})}}class d extends N.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new R.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new R.Q5),this.onDidRun=this._onDidRun.event}run(f,u){return P(this,void 0,void 0,function*(){if(!f.enabled)return;this._onBeforeRun.fire({action:f});let l;try{yield this.runAction(f,u)}catch(c){l=c}this._onDidRun.fire({action:f,error:l})})}runAction(f,u){return P(this,void 0,void 0,function*(){yield f.run(u)})}}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 S{constructor(f,u,l,c){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=f,this.label=u,this.class=c,this._actions=l}get actions(){return this._actions}dispose(){}run(){return P(this,void 0,void 0,function*(){})}}class s extends A{constructor(){super(s.ID,K.N("submenu.empty","(empty)"),void 0,!1)}}s.ID="vs.actions.empty"},76068:function(Ot,ke,y){"use strict";y.d(ke,{ok:function(){return R}});function R(N,K){if(!N)throw new Error(K?`Assertion failed (${K})`:"Assertion Failed")}},52615:function(Ot,ke,y){"use strict";y.d(ke,{CM:function(){return A},JL:function(){return d},dT:function(){return S},fK:function(){return P},lA:function(){return U}});var R=y(4348);class N{constructor(){this._icons=new Map,this._onDidRegister=new R.Q5}add(w){const f=this._icons.get(w.id);f?w.description?f.description=w.description:console.error(`Duplicate registration of codicon ${w.id}`):(this._icons.set(w.id,w),this._onDidRegister.fire(w))}get(w){return this._icons.get(w)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const K=new N,P=K;function A(s,w){return new U(s,w)}function d(s){return s?s.replace(/\$\((.*?)\)/g,(w,f)=>` ${f} `).trim():""}class U{constructor(w,f,u){this.id=w,this.definition=f,this.description=u,K.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var S;(function(s){s.iconNameSegment="[A-Za-z0-9]+",s.iconNameExpression="[A-Za-z0-9\\-]+",s.iconModifierExpression="~[A-Za-z]+";const w=new RegExp(`^(${s.iconNameExpression})(${s.iconModifierExpression})?$`);function f(c){if(c instanceof U)return["codicon","codicon-"+c.id];const m=w.exec(c.id);if(!m)return f(U.error);let[,C,M]=m;const k=["codicon","codicon-"+C];return M&&k.push("codicon-modifier-"+M.substr(1)),k}s.asClassNameArray=f;function u(c){return f(c).join(" ")}s.asClassName=u;function l(c){return"."+f(c).join(".")}s.asCSSSelector=l})(S||(S={})),function(s){s.add=new s("add",{fontCharacter:"\\ea60"}),s.plus=new s("plus",s.add.definition),s.gistNew=new s("gist-new",s.add.definition),s.repoCreate=new s("repo-create",s.add.definition),s.lightbulb=new s("lightbulb",{fontCharacter:"\\ea61"}),s.lightBulb=new s("light-bulb",{fontCharacter:"\\ea61"}),s.repo=new s("repo",{fontCharacter:"\\ea62"}),s.repoDelete=new s("repo-delete",{fontCharacter:"\\ea62"}),s.gistFork=new s("gist-fork",{fontCharacter:"\\ea63"}),s.repoForked=new s("repo-forked",{fontCharacter:"\\ea63"}),s.gitPullRequest=new s("git-pull-request",{fontCharacter:"\\ea64"}),s.gitPullRequestAbandoned=new s("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),s.recordKeys=new s("record-keys",{fontCharacter:"\\ea65"}),s.keyboard=new s("keyboard",{fontCharacter:"\\ea65"}),s.tag=new s("tag",{fontCharacter:"\\ea66"}),s.tagAdd=new s("tag-add",{fontCharacter:"\\ea66"}),s.tagRemove=new s("tag-remove",{fontCharacter:"\\ea66"}),s.person=new s("person",{fontCharacter:"\\ea67"}),s.personFollow=new s("person-follow",{fontCharacter:"\\ea67"}),s.personOutline=new s("person-outline",{fontCharacter:"\\ea67"}),s.personFilled=new s("person-filled",{fontCharacter:"\\ea67"}),s.gitBranch=new s("git-branch",{fontCharacter:"\\ea68"}),s.gitBranchCreate=new s("git-branch-create",{fontCharacter:"\\ea68"}),s.gitBranchDelete=new s("git-branch-delete",{fontCharacter:"\\ea68"}),s.sourceControl=new s("source-control",{fontCharacter:"\\ea68"}),s.mirror=new s("mirror",{fontCharacter:"\\ea69"}),s.mirrorPublic=new s("mirror-public",{fontCharacter:"\\ea69"}),s.star=new s("star",{fontCharacter:"\\ea6a"}),s.starAdd=new s("star-add",{fontCharacter:"\\ea6a"}),s.starDelete=new s("star-delete",{fontCharacter:"\\ea6a"}),s.starEmpty=new s("star-empty",{fontCharacter:"\\ea6a"}),s.comment=new s("comment",{fontCharacter:"\\ea6b"}),s.commentAdd=new s("comment-add",{fontCharacter:"\\ea6b"}),s.alert=new s("alert",{fontCharacter:"\\ea6c"}),s.warning=new s("warning",{fontCharacter:"\\ea6c"}),s.search=new s("search",{fontCharacter:"\\ea6d"}),s.searchSave=new s("search-save",{fontCharacter:"\\ea6d"}),s.logOut=new s("log-out",{fontCharacter:"\\ea6e"}),s.signOut=new s("sign-out",{fontCharacter:"\\ea6e"}),s.logIn=new s("log-in",{fontCharacter:"\\ea6f"}),s.signIn=new s("sign-in",{fontCharacter:"\\ea6f"}),s.eye=new s("eye",{fontCharacter:"\\ea70"}),s.eyeUnwatch=new s("eye-unwatch",{fontCharacter:"\\ea70"}),s.eyeWatch=new s("eye-watch",{fontCharacter:"\\ea70"}),s.circleFilled=new s("circle-filled",{fontCharacter:"\\ea71"}),s.primitiveDot=new s("primitive-dot",{fontCharacter:"\\ea71"}),s.closeDirty=new s("close-dirty",{fontCharacter:"\\ea71"}),s.debugBreakpoint=new s("debug-breakpoint",{fontCharacter:"\\ea71"}),s.debugBreakpointDisabled=new s("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),s.debugHint=new s("debug-hint",{fontCharacter:"\\ea71"}),s.primitiveSquare=new s("primitive-square",{fontCharacter:"\\ea72"}),s.edit=new s("edit",{fontCharacter:"\\ea73"}),s.pencil=new s("pencil",{fontCharacter:"\\ea73"}),s.info=new s("info",{fontCharacter:"\\ea74"}),s.issueOpened=new s("issue-opened",{fontCharacter:"\\ea74"}),s.gistPrivate=new s("gist-private",{fontCharacter:"\\ea75"}),s.gitForkPrivate=new s("git-fork-private",{fontCharacter:"\\ea75"}),s.lock=new s("lock",{fontCharacter:"\\ea75"}),s.mirrorPrivate=new s("mirror-private",{fontCharacter:"\\ea75"}),s.close=new s("close",{fontCharacter:"\\ea76"}),s.removeClose=new s("remove-close",{fontCharacter:"\\ea76"}),s.x=new s("x",{fontCharacter:"\\ea76"}),s.repoSync=new s("repo-sync",{fontCharacter:"\\ea77"}),s.sync=new s("sync",{fontCharacter:"\\ea77"}),s.clone=new s("clone",{fontCharacter:"\\ea78"}),s.desktopDownload=new s("desktop-download",{fontCharacter:"\\ea78"}),s.beaker=new s("beaker",{fontCharacter:"\\ea79"}),s.microscope=new s("microscope",{fontCharacter:"\\ea79"}),s.vm=new s("vm",{fontCharacter:"\\ea7a"}),s.deviceDesktop=new s("device-desktop",{fontCharacter:"\\ea7a"}),s.file=new s("file",{fontCharacter:"\\ea7b"}),s.fileText=new s("file-text",{fontCharacter:"\\ea7b"}),s.more=new s("more",{fontCharacter:"\\ea7c"}),s.ellipsis=new s("ellipsis",{fontCharacter:"\\ea7c"}),s.kebabHorizontal=new s("kebab-horizontal",{fontCharacter:"\\ea7c"}),s.mailReply=new s("mail-reply",{fontCharacter:"\\ea7d"}),s.reply=new s("reply",{fontCharacter:"\\ea7d"}),s.organization=new s("organization",{fontCharacter:"\\ea7e"}),s.organizationFilled=new s("organization-filled",{fontCharacter:"\\ea7e"}),s.organizationOutline=new s("organization-outline",{fontCharacter:"\\ea7e"}),s.newFile=new s("new-file",{fontCharacter:"\\ea7f"}),s.fileAdd=new s("file-add",{fontCharacter:"\\ea7f"}),s.newFolder=new s("new-folder",{fontCharacter:"\\ea80"}),s.fileDirectoryCreate=new s("file-directory-create",{fontCharacter:"\\ea80"}),s.trash=new s("trash",{fontCharacter:"\\ea81"}),s.trashcan=new s("trashcan",{fontCharacter:"\\ea81"}),s.history=new s("history",{fontCharacter:"\\ea82"}),s.clock=new s("clock",{fontCharacter:"\\ea82"}),s.folder=new s("folder",{fontCharacter:"\\ea83"}),s.fileDirectory=new s("file-directory",{fontCharacter:"\\ea83"}),s.symbolFolder=new s("symbol-folder",{fontCharacter:"\\ea83"}),s.logoGithub=new s("logo-github",{fontCharacter:"\\ea84"}),s.markGithub=new s("mark-github",{fontCharacter:"\\ea84"}),s.github=new s("github",{fontCharacter:"\\ea84"}),s.terminal=new s("terminal",{fontCharacter:"\\ea85"}),s.console=new s("console",{fontCharacter:"\\ea85"}),s.repl=new s("repl",{fontCharacter:"\\ea85"}),s.zap=new s("zap",{fontCharacter:"\\ea86"}),s.symbolEvent=new s("symbol-event",{fontCharacter:"\\ea86"}),s.error=new s("error",{fontCharacter:"\\ea87"}),s.stop=new s("stop",{fontCharacter:"\\ea87"}),s.variable=new s("variable",{fontCharacter:"\\ea88"}),s.symbolVariable=new s("symbol-variable",{fontCharacter:"\\ea88"}),s.array=new s("array",{fontCharacter:"\\ea8a"}),s.symbolArray=new s("symbol-array",{fontCharacter:"\\ea8a"}),s.symbolModule=new s("symbol-module",{fontCharacter:"\\ea8b"}),s.symbolPackage=new s("symbol-package",{fontCharacter:"\\ea8b"}),s.symbolNamespace=new s("symbol-namespace",{fontCharacter:"\\ea8b"}),s.symbolObject=new s("symbol-object",{fontCharacter:"\\ea8b"}),s.symbolMethod=new s("symbol-method",{fontCharacter:"\\ea8c"}),s.symbolFunction=new s("symbol-function",{fontCharacter:"\\ea8c"}),s.symbolConstructor=new s("symbol-constructor",{fontCharacter:"\\ea8c"}),s.symbolBoolean=new s("symbol-boolean",{fontCharacter:"\\ea8f"}),s.symbolNull=new s("symbol-null",{fontCharacter:"\\ea8f"}),s.symbolNumeric=new s("symbol-numeric",{fontCharacter:"\\ea90"}),s.symbolNumber=new s("symbol-number",{fontCharacter:"\\ea90"}),s.symbolStructure=new s("symbol-structure",{fontCharacter:"\\ea91"}),s.symbolStruct=new s("symbol-struct",{fontCharacter:"\\ea91"}),s.symbolParameter=new s("symbol-parameter",{fontCharacter:"\\ea92"}),s.symbolTypeParameter=new s("symbol-type-parameter",{fontCharacter:"\\ea92"}),s.symbolKey=new s("symbol-key",{fontCharacter:"\\ea93"}),s.symbolText=new s("symbol-text",{fontCharacter:"\\ea93"}),s.symbolReference=new s("symbol-reference",{fontCharacter:"\\ea94"}),s.goToFile=new s("go-to-file",{fontCharacter:"\\ea94"}),s.symbolEnum=new s("symbol-enum",{fontCharacter:"\\ea95"}),s.symbolValue=new s("symbol-value",{fontCharacter:"\\ea95"}),s.symbolRuler=new s("symbol-ruler",{fontCharacter:"\\ea96"}),s.symbolUnit=new s("symbol-unit",{fontCharacter:"\\ea96"}),s.activateBreakpoints=new s("activate-breakpoints",{fontCharacter:"\\ea97"}),s.archive=new s("archive",{fontCharacter:"\\ea98"}),s.arrowBoth=new s("arrow-both",{fontCharacter:"\\ea99"}),s.arrowDown=new s("arrow-down",{fontCharacter:"\\ea9a"}),s.arrowLeft=new s("arrow-left",{fontCharacter:"\\ea9b"}),s.arrowRight=new s("arrow-right",{fontCharacter:"\\ea9c"}),s.arrowSmallDown=new s("arrow-small-down",{fontCharacter:"\\ea9d"}),s.arrowSmallLeft=new s("arrow-small-left",{fontCharacter:"\\ea9e"}),s.arrowSmallRight=new s("arrow-small-right",{fontCharacter:"\\ea9f"}),s.arrowSmallUp=new s("arrow-small-up",{fontCharacter:"\\eaa0"}),s.arrowUp=new s("arrow-up",{fontCharacter:"\\eaa1"}),s.bell=new s("bell",{fontCharacter:"\\eaa2"}),s.bold=new s("bold",{fontCharacter:"\\eaa3"}),s.book=new s("book",{fontCharacter:"\\eaa4"}),s.bookmark=new s("bookmark",{fontCharacter:"\\eaa5"}),s.debugBreakpointConditionalUnverified=new s("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),s.debugBreakpointConditional=new s("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),s.debugBreakpointConditionalDisabled=new s("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),s.debugBreakpointDataUnverified=new s("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),s.debugBreakpointData=new s("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),s.debugBreakpointDataDisabled=new s("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),s.debugBreakpointLogUnverified=new s("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),s.debugBreakpointLog=new s("debug-breakpoint-log",{fontCharacter:"\\eaab"}),s.debugBreakpointLogDisabled=new s("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),s.briefcase=new s("briefcase",{fontCharacter:"\\eaac"}),s.broadcast=new s("broadcast",{fontCharacter:"\\eaad"}),s.browser=new s("browser",{fontCharacter:"\\eaae"}),s.bug=new s("bug",{fontCharacter:"\\eaaf"}),s.calendar=new s("calendar",{fontCharacter:"\\eab0"}),s.caseSensitive=new s("case-sensitive",{fontCharacter:"\\eab1"}),s.check=new s("check",{fontCharacter:"\\eab2"}),s.checklist=new s("checklist",{fontCharacter:"\\eab3"}),s.chevronDown=new s("chevron-down",{fontCharacter:"\\eab4"}),s.dropDownButton=new s("drop-down-button",s.chevronDown.definition),s.chevronLeft=new s("chevron-left",{fontCharacter:"\\eab5"}),s.chevronRight=new s("chevron-right",{fontCharacter:"\\eab6"}),s.chevronUp=new s("chevron-up",{fontCharacter:"\\eab7"}),s.chromeClose=new s("chrome-close",{fontCharacter:"\\eab8"}),s.chromeMaximize=new s("chrome-maximize",{fontCharacter:"\\eab9"}),s.chromeMinimize=new s("chrome-minimize",{fontCharacter:"\\eaba"}),s.chromeRestore=new s("chrome-restore",{fontCharacter:"\\eabb"}),s.circleOutline=new s("circle-outline",{fontCharacter:"\\eabc"}),s.debugBreakpointUnverified=new s("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),s.circleSlash=new s("circle-slash",{fontCharacter:"\\eabd"}),s.circuitBoard=new s("circuit-board",{fontCharacter:"\\eabe"}),s.clearAll=new s("clear-all",{fontCharacter:"\\eabf"}),s.clippy=new s("clippy",{fontCharacter:"\\eac0"}),s.closeAll=new s("close-all",{fontCharacter:"\\eac1"}),s.cloudDownload=new s("cloud-download",{fontCharacter:"\\eac2"}),s.cloudUpload=new s("cloud-upload",{fontCharacter:"\\eac3"}),s.code=new s("code",{fontCharacter:"\\eac4"}),s.collapseAll=new s("collapse-all",{fontCharacter:"\\eac5"}),s.colorMode=new s("color-mode",{fontCharacter:"\\eac6"}),s.commentDiscussion=new s("comment-discussion",{fontCharacter:"\\eac7"}),s.compareChanges=new s("compare-changes",{fontCharacter:"\\eafd"}),s.creditCard=new s("credit-card",{fontCharacter:"\\eac9"}),s.dash=new s("dash",{fontCharacter:"\\eacc"}),s.dashboard=new s("dashboard",{fontCharacter:"\\eacd"}),s.database=new s("database",{fontCharacter:"\\eace"}),s.debugContinue=new s("debug-continue",{fontCharacter:"\\eacf"}),s.debugDisconnect=new s("debug-disconnect",{fontCharacter:"\\ead0"}),s.debugPause=new s("debug-pause",{fontCharacter:"\\ead1"}),s.debugRestart=new s("debug-restart",{fontCharacter:"\\ead2"}),s.debugStart=new s("debug-start",{fontCharacter:"\\ead3"}),s.debugStepInto=new s("debug-step-into",{fontCharacter:"\\ead4"}),s.debugStepOut=new s("debug-step-out",{fontCharacter:"\\ead5"}),s.debugStepOver=new s("debug-step-over",{fontCharacter:"\\ead6"}),s.debugStop=new s("debug-stop",{fontCharacter:"\\ead7"}),s.debug=new s("debug",{fontCharacter:"\\ead8"}),s.deviceCameraVideo=new s("device-camera-video",{fontCharacter:"\\ead9"}),s.deviceCamera=new s("device-camera",{fontCharacter:"\\eada"}),s.deviceMobile=new s("device-mobile",{fontCharacter:"\\eadb"}),s.diffAdded=new s("diff-added",{fontCharacter:"\\eadc"}),s.diffIgnored=new s("diff-ignored",{fontCharacter:"\\eadd"}),s.diffModified=new s("diff-modified",{fontCharacter:"\\eade"}),s.diffRemoved=new s("diff-removed",{fontCharacter:"\\eadf"}),s.diffRenamed=new s("diff-renamed",{fontCharacter:"\\eae0"}),s.diff=new s("diff",{fontCharacter:"\\eae1"}),s.discard=new s("discard",{fontCharacter:"\\eae2"}),s.editorLayout=new s("editor-layout",{fontCharacter:"\\eae3"}),s.emptyWindow=new s("empty-window",{fontCharacter:"\\eae4"}),s.exclude=new s("exclude",{fontCharacter:"\\eae5"}),s.extensions=new s("extensions",{fontCharacter:"\\eae6"}),s.eyeClosed=new s("eye-closed",{fontCharacter:"\\eae7"}),s.fileBinary=new s("file-binary",{fontCharacter:"\\eae8"}),s.fileCode=new s("file-code",{fontCharacter:"\\eae9"}),s.fileMedia=new s("file-media",{fontCharacter:"\\eaea"}),s.filePdf=new s("file-pdf",{fontCharacter:"\\eaeb"}),s.fileSubmodule=new s("file-submodule",{fontCharacter:"\\eaec"}),s.fileSymlinkDirectory=new s("file-symlink-directory",{fontCharacter:"\\eaed"}),s.fileSymlinkFile=new s("file-symlink-file",{fontCharacter:"\\eaee"}),s.fileZip=new s("file-zip",{fontCharacter:"\\eaef"}),s.files=new s("files",{fontCharacter:"\\eaf0"}),s.filter=new s("filter",{fontCharacter:"\\eaf1"}),s.flame=new s("flame",{fontCharacter:"\\eaf2"}),s.foldDown=new s("fold-down",{fontCharacter:"\\eaf3"}),s.foldUp=new s("fold-up",{fontCharacter:"\\eaf4"}),s.fold=new s("fold",{fontCharacter:"\\eaf5"}),s.folderActive=new s("folder-active",{fontCharacter:"\\eaf6"}),s.folderOpened=new s("folder-opened",{fontCharacter:"\\eaf7"}),s.gear=new s("gear",{fontCharacter:"\\eaf8"}),s.gift=new s("gift",{fontCharacter:"\\eaf9"}),s.gistSecret=new s("gist-secret",{fontCharacter:"\\eafa"}),s.gist=new s("gist",{fontCharacter:"\\eafb"}),s.gitCommit=new s("git-commit",{fontCharacter:"\\eafc"}),s.gitCompare=new s("git-compare",{fontCharacter:"\\eafd"}),s.gitMerge=new s("git-merge",{fontCharacter:"\\eafe"}),s.githubAction=new s("github-action",{fontCharacter:"\\eaff"}),s.githubAlt=new s("github-alt",{fontCharacter:"\\eb00"}),s.globe=new s("globe",{fontCharacter:"\\eb01"}),s.grabber=new s("grabber",{fontCharacter:"\\eb02"}),s.graph=new s("graph",{fontCharacter:"\\eb03"}),s.gripper=new s("gripper",{fontCharacter:"\\eb04"}),s.heart=new s("heart",{fontCharacter:"\\eb05"}),s.home=new s("home",{fontCharacter:"\\eb06"}),s.horizontalRule=new s("horizontal-rule",{fontCharacter:"\\eb07"}),s.hubot=new s("hubot",{fontCharacter:"\\eb08"}),s.inbox=new s("inbox",{fontCharacter:"\\eb09"}),s.issueClosed=new s("issue-closed",{fontCharacter:"\\eba4"}),s.issueReopened=new s("issue-reopened",{fontCharacter:"\\eb0b"}),s.issues=new s("issues",{fontCharacter:"\\eb0c"}),s.italic=new s("italic",{fontCharacter:"\\eb0d"}),s.jersey=new s("jersey",{fontCharacter:"\\eb0e"}),s.json=new s("json",{fontCharacter:"\\eb0f"}),s.kebabVertical=new s("kebab-vertical",{fontCharacter:"\\eb10"}),s.key=new s("key",{fontCharacter:"\\eb11"}),s.law=new s("law",{fontCharacter:"\\eb12"}),s.lightbulbAutofix=new s("lightbulb-autofix",{fontCharacter:"\\eb13"}),s.linkExternal=new s("link-external",{fontCharacter:"\\eb14"}),s.link=new s("link",{fontCharacter:"\\eb15"}),s.listOrdered=new s("list-ordered",{fontCharacter:"\\eb16"}),s.listUnordered=new s("list-unordered",{fontCharacter:"\\eb17"}),s.liveShare=new s("live-share",{fontCharacter:"\\eb18"}),s.loading=new s("loading",{fontCharacter:"\\eb19"}),s.location=new s("location",{fontCharacter:"\\eb1a"}),s.mailRead=new s("mail-read",{fontCharacter:"\\eb1b"}),s.mail=new s("mail",{fontCharacter:"\\eb1c"}),s.markdown=new s("markdown",{fontCharacter:"\\eb1d"}),s.megaphone=new s("megaphone",{fontCharacter:"\\eb1e"}),s.mention=new s("mention",{fontCharacter:"\\eb1f"}),s.milestone=new s("milestone",{fontCharacter:"\\eb20"}),s.mortarBoard=new s("mortar-board",{fontCharacter:"\\eb21"}),s.move=new s("move",{fontCharacter:"\\eb22"}),s.multipleWindows=new s("multiple-windows",{fontCharacter:"\\eb23"}),s.mute=new s("mute",{fontCharacter:"\\eb24"}),s.noNewline=new s("no-newline",{fontCharacter:"\\eb25"}),s.note=new s("note",{fontCharacter:"\\eb26"}),s.octoface=new s("octoface",{fontCharacter:"\\eb27"}),s.openPreview=new s("open-preview",{fontCharacter:"\\eb28"}),s.package_=new s("package",{fontCharacter:"\\eb29"}),s.paintcan=new s("paintcan",{fontCharacter:"\\eb2a"}),s.pin=new s("pin",{fontCharacter:"\\eb2b"}),s.play=new s("play",{fontCharacter:"\\eb2c"}),s.run=new s("run",{fontCharacter:"\\eb2c"}),s.plug=new s("plug",{fontCharacter:"\\eb2d"}),s.preserveCase=new s("preserve-case",{fontCharacter:"\\eb2e"}),s.preview=new s("preview",{fontCharacter:"\\eb2f"}),s.project=new s("project",{fontCharacter:"\\eb30"}),s.pulse=new s("pulse",{fontCharacter:"\\eb31"}),s.question=new s("question",{fontCharacter:"\\eb32"}),s.quote=new s("quote",{fontCharacter:"\\eb33"}),s.radioTower=new s("radio-tower",{fontCharacter:"\\eb34"}),s.reactions=new s("reactions",{fontCharacter:"\\eb35"}),s.references=new s("references",{fontCharacter:"\\eb36"}),s.refresh=new s("refresh",{fontCharacter:"\\eb37"}),s.regex=new s("regex",{fontCharacter:"\\eb38"}),s.remoteExplorer=new s("remote-explorer",{fontCharacter:"\\eb39"}),s.remote=new s("remote",{fontCharacter:"\\eb3a"}),s.remove=new s("remove",{fontCharacter:"\\eb3b"}),s.replaceAll=new s("replace-all",{fontCharacter:"\\eb3c"}),s.replace=new s("replace",{fontCharacter:"\\eb3d"}),s.repoClone=new s("repo-clone",{fontCharacter:"\\eb3e"}),s.repoForcePush=new s("repo-force-push",{fontCharacter:"\\eb3f"}),s.repoPull=new s("repo-pull",{fontCharacter:"\\eb40"}),s.repoPush=new s("repo-push",{fontCharacter:"\\eb41"}),s.report=new s("report",{fontCharacter:"\\eb42"}),s.requestChanges=new s("request-changes",{fontCharacter:"\\eb43"}),s.rocket=new s("rocket",{fontCharacter:"\\eb44"}),s.rootFolderOpened=new s("root-folder-opened",{fontCharacter:"\\eb45"}),s.rootFolder=new s("root-folder",{fontCharacter:"\\eb46"}),s.rss=new s("rss",{fontCharacter:"\\eb47"}),s.ruby=new s("ruby",{fontCharacter:"\\eb48"}),s.saveAll=new s("save-all",{fontCharacter:"\\eb49"}),s.saveAs=new s("save-as",{fontCharacter:"\\eb4a"}),s.save=new s("save",{fontCharacter:"\\eb4b"}),s.screenFull=new s("screen-full",{fontCharacter:"\\eb4c"}),s.screenNormal=new s("screen-normal",{fontCharacter:"\\eb4d"}),s.searchStop=new s("search-stop",{fontCharacter:"\\eb4e"}),s.server=new s("server",{fontCharacter:"\\eb50"}),s.settingsGear=new s("settings-gear",{fontCharacter:"\\eb51"}),s.settings=new s("settings",{fontCharacter:"\\eb52"}),s.shield=new s("shield",{fontCharacter:"\\eb53"}),s.smiley=new s("smiley",{fontCharacter:"\\eb54"}),s.sortPrecedence=new s("sort-precedence",{fontCharacter:"\\eb55"}),s.splitHorizontal=new s("split-horizontal",{fontCharacter:"\\eb56"}),s.splitVertical=new s("split-vertical",{fontCharacter:"\\eb57"}),s.squirrel=new s("squirrel",{fontCharacter:"\\eb58"}),s.starFull=new s("star-full",{fontCharacter:"\\eb59"}),s.starHalf=new s("star-half",{fontCharacter:"\\eb5a"}),s.symbolClass=new s("symbol-class",{fontCharacter:"\\eb5b"}),s.symbolColor=new s("symbol-color",{fontCharacter:"\\eb5c"}),s.symbolConstant=new s("symbol-constant",{fontCharacter:"\\eb5d"}),s.symbolEnumMember=new s("symbol-enum-member",{fontCharacter:"\\eb5e"}),s.symbolField=new s("symbol-field",{fontCharacter:"\\eb5f"}),s.symbolFile=new s("symbol-file",{fontCharacter:"\\eb60"}),s.symbolInterface=new s("symbol-interface",{fontCharacter:"\\eb61"}),s.symbolKeyword=new s("symbol-keyword",{fontCharacter:"\\eb62"}),s.symbolMisc=new s("symbol-misc",{fontCharacter:"\\eb63"}),s.symbolOperator=new s("symbol-operator",{fontCharacter:"\\eb64"}),s.symbolProperty=new s("symbol-property",{fontCharacter:"\\eb65"}),s.wrench=new s("wrench",{fontCharacter:"\\eb65"}),s.wrenchSubaction=new s("wrench-subaction",{fontCharacter:"\\eb65"}),s.symbolSnippet=new s("symbol-snippet",{fontCharacter:"\\eb66"}),s.tasklist=new s("tasklist",{fontCharacter:"\\eb67"}),s.telescope=new s("telescope",{fontCharacter:"\\eb68"}),s.textSize=new s("text-size",{fontCharacter:"\\eb69"}),s.threeBars=new s("three-bars",{fontCharacter:"\\eb6a"}),s.thumbsdown=new s("thumbsdown",{fontCharacter:"\\eb6b"}),s.thumbsup=new s("thumbsup",{fontCharacter:"\\eb6c"}),s.tools=new s("tools",{fontCharacter:"\\eb6d"}),s.triangleDown=new s("triangle-down",{fontCharacter:"\\eb6e"}),s.triangleLeft=new s("triangle-left",{fontCharacter:"\\eb6f"}),s.triangleRight=new s("triangle-right",{fontCharacter:"\\eb70"}),s.triangleUp=new s("triangle-up",{fontCharacter:"\\eb71"}),s.twitter=new s("twitter",{fontCharacter:"\\eb72"}),s.unfold=new s("unfold",{fontCharacter:"\\eb73"}),s.unlock=new s("unlock",{fontCharacter:"\\eb74"}),s.unmute=new s("unmute",{fontCharacter:"\\eb75"}),s.unverified=new s("unverified",{fontCharacter:"\\eb76"}),s.verified=new s("verified",{fontCharacter:"\\eb77"}),s.versions=new s("versions",{fontCharacter:"\\eb78"}),s.vmActive=new s("vm-active",{fontCharacter:"\\eb79"}),s.vmOutline=new s("vm-outline",{fontCharacter:"\\eb7a"}),s.vmRunning=new s("vm-running",{fontCharacter:"\\eb7b"}),s.watch=new s("watch",{fontCharacter:"\\eb7c"}),s.whitespace=new s("whitespace",{fontCharacter:"\\eb7d"}),s.wholeWord=new s("whole-word",{fontCharacter:"\\eb7e"}),s.window=new s("window",{fontCharacter:"\\eb7f"}),s.wordWrap=new s("word-wrap",{fontCharacter:"\\eb80"}),s.zoomIn=new s("zoom-in",{fontCharacter:"\\eb81"}),s.zoomOut=new s("zoom-out",{fontCharacter:"\\eb82"}),s.listFilter=new s("list-filter",{fontCharacter:"\\eb83"}),s.listFlat=new s("list-flat",{fontCharacter:"\\eb84"}),s.listSelection=new s("list-selection",{fontCharacter:"\\eb85"}),s.selection=new s("selection",{fontCharacter:"\\eb85"}),s.listTree=new s("list-tree",{fontCharacter:"\\eb86"}),s.debugBreakpointFunctionUnverified=new s("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),s.debugBreakpointFunction=new s("debug-breakpoint-function",{fontCharacter:"\\eb88"}),s.debugBreakpointFunctionDisabled=new s("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),s.debugStackframeActive=new s("debug-stackframe-active",{fontCharacter:"\\eb89"}),s.debugStackframeDot=new s("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),s.debugStackframe=new s("debug-stackframe",{fontCharacter:"\\eb8b"}),s.debugStackframeFocused=new s("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),s.debugBreakpointUnsupported=new s("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),s.symbolString=new s("symbol-string",{fontCharacter:"\\eb8d"}),s.debugReverseContinue=new s("debug-reverse-continue",{fontCharacter:"\\eb8e"}),s.debugStepBack=new s("debug-step-back",{fontCharacter:"\\eb8f"}),s.debugRestartFrame=new s("debug-restart-frame",{fontCharacter:"\\eb90"}),s.callIncoming=new s("call-incoming",{fontCharacter:"\\eb92"}),s.callOutgoing=new s("call-outgoing",{fontCharacter:"\\eb93"}),s.menu=new s("menu",{fontCharacter:"\\eb94"}),s.expandAll=new s("expand-all",{fontCharacter:"\\eb95"}),s.feedback=new s("feedback",{fontCharacter:"\\eb96"}),s.groupByRefType=new s("group-by-ref-type",{fontCharacter:"\\eb97"}),s.ungroupByRefType=new s("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),s.account=new s("account",{fontCharacter:"\\eb99"}),s.bellDot=new s("bell-dot",{fontCharacter:"\\eb9a"}),s.debugConsole=new s("debug-console",{fontCharacter:"\\eb9b"}),s.library=new s("library",{fontCharacter:"\\eb9c"}),s.output=new s("output",{fontCharacter:"\\eb9d"}),s.runAll=new s("run-all",{fontCharacter:"\\eb9e"}),s.syncIgnored=new s("sync-ignored",{fontCharacter:"\\eb9f"}),s.pinned=new s("pinned",{fontCharacter:"\\eba0"}),s.githubInverted=new s("github-inverted",{fontCharacter:"\\eba1"}),s.debugAlt=new s("debug-alt",{fontCharacter:"\\eb91"}),s.serverProcess=new s("server-process",{fontCharacter:"\\eba2"}),s.serverEnvironment=new s("server-environment",{fontCharacter:"\\eba3"}),s.pass=new s("pass",{fontCharacter:"\\eba4"}),s.stopCircle=new s("stop-circle",{fontCharacter:"\\eba5"}),s.playCircle=new s("play-circle",{fontCharacter:"\\eba6"}),s.record=new s("record",{fontCharacter:"\\eba7"}),s.debugAltSmall=new s("debug-alt-small",{fontCharacter:"\\eba8"}),s.vmConnect=new s("vm-connect",{fontCharacter:"\\eba9"}),s.cloud=new s("cloud",{fontCharacter:"\\ebaa"}),s.merge=new s("merge",{fontCharacter:"\\ebab"}),s.exportIcon=new s("export",{fontCharacter:"\\ebac"}),s.graphLeft=new s("graph-left",{fontCharacter:"\\ebad"}),s.magnet=new s("magnet",{fontCharacter:"\\ebae"}),s.notebook=new s("notebook",{fontCharacter:"\\ebaf"}),s.redo=new s("redo",{fontCharacter:"\\ebb0"}),s.checkAll=new s("check-all",{fontCharacter:"\\ebb1"}),s.pinnedDirty=new s("pinned-dirty",{fontCharacter:"\\ebb2"}),s.passFilled=new s("pass-filled",{fontCharacter:"\\ebb3"}),s.circleLargeFilled=new s("circle-large-filled",{fontCharacter:"\\ebb4"}),s.circleLargeOutline=new s("circle-large-outline",{fontCharacter:"\\ebb5"}),s.combine=new s("combine",{fontCharacter:"\\ebb6"}),s.gather=new s("gather",{fontCharacter:"\\ebb6"}),s.table=new s("table",{fontCharacter:"\\ebb7"}),s.variableGroup=new s("variable-group",{fontCharacter:"\\ebb8"}),s.typeHierarchy=new s("type-hierarchy",{fontCharacter:"\\ebb9"}),s.typeHierarchySub=new s("type-hierarchy-sub",{fontCharacter:"\\ebba"}),s.typeHierarchySuper=new s("type-hierarchy-super",{fontCharacter:"\\ebbb"}),s.gitPullRequestCreate=new s("git-pull-request-create",{fontCharacter:"\\ebbc"}),s.runAbove=new s("run-above",{fontCharacter:"\\ebbd"}),s.runBelow=new s("run-below",{fontCharacter:"\\ebbe"}),s.notebookTemplate=new s("notebook-template",{fontCharacter:"\\ebbf"}),s.debugRerun=new s("debug-rerun",{fontCharacter:"\\ebc0"}),s.workspaceTrusted=new s("workspace-trusted",{fontCharacter:"\\ebc1"}),s.workspaceUntrusted=new s("workspace-untrusted",{fontCharacter:"\\ebc2"}),s.workspaceUnspecified=new s("workspace-unspecified",{fontCharacter:"\\ebc3"}),s.terminalCmd=new s("terminal-cmd",{fontCharacter:"\\ebc4"}),s.terminalDebian=new s("terminal-debian",{fontCharacter:"\\ebc5"}),s.terminalLinux=new s("terminal-linux",{fontCharacter:"\\ebc6"}),s.terminalPowershell=new s("terminal-powershell",{fontCharacter:"\\ebc7"}),s.terminalTmux=new s("terminal-tmux",{fontCharacter:"\\ebc8"}),s.terminalUbuntu=new s("terminal-ubuntu",{fontCharacter:"\\ebc9"}),s.terminalBash=new s("terminal-bash",{fontCharacter:"\\ebca"}),s.arrowSwap=new s("arrow-swap",{fontCharacter:"\\ebcb"}),s.copy=new s("copy",{fontCharacter:"\\ebcc"}),s.personAdd=new s("person-add",{fontCharacter:"\\ebcd"}),s.filterFilled=new s("filter-filled",{fontCharacter:"\\ebce"}),s.wand=new s("wand",{fontCharacter:"\\ebcf"}),s.debugLineByLine=new s("debug-line-by-line",{fontCharacter:"\\ebd0"}),s.inspect=new s("inspect",{fontCharacter:"\\ebd1"}),s.layers=new s("layers",{fontCharacter:"\\ebd2"}),s.layersDot=new s("layers-dot",{fontCharacter:"\\ebd3"}),s.layersActive=new s("layers-active",{fontCharacter:"\\ebd4"}),s.compass=new s("compass",{fontCharacter:"\\ebd5"}),s.compassDot=new s("compass-dot",{fontCharacter:"\\ebd6"}),s.compassActive=new s("compass-active",{fontCharacter:"\\ebd7"}),s.azure=new s("azure",{fontCharacter:"\\ebd8"}),s.issueDraft=new s("issue-draft",{fontCharacter:"\\ebd9"}),s.gitPullRequestClosed=new s("git-pull-request-closed",{fontCharacter:"\\ebda"}),s.gitPullRequestDraft=new s("git-pull-request-draft",{fontCharacter:"\\ebdb"}),s.debugAll=new s("debug-all",{fontCharacter:"\\ebdc"}),s.debugCoverage=new s("debug-coverage",{fontCharacter:"\\ebdd"}),s.runErrors=new s("run-errors",{fontCharacter:"\\ebde"}),s.folderLibrary=new s("folder-library",{fontCharacter:"\\ebdf"}),s.debugContinueSmall=new s("debug-continue-small",{fontCharacter:"\\ebe0"}),s.beakerStop=new s("beaker-stop",{fontCharacter:"\\ebe1"}),s.graphLine=new s("graph-line",{fontCharacter:"\\ebe2"}),s.graphScatter=new s("graph-scatter",{fontCharacter:"\\ebe3"}),s.pieChart=new s("pie-chart",{fontCharacter:"\\ebe4"}),s.bracket=new s("bracket",s.json.definition),s.bracketDot=new s("bracket-dot",{fontCharacter:"\\ebe5"}),s.bracketError=new s("bracket-error",{fontCharacter:"\\ebe6"}),s.lockSmall=new s("lock-small",{fontCharacter:"\\ebe7"}),s.azureDevops=new s("azure-devops",{fontCharacter:"\\ebe8"}),s.verifiedFilled=new s("verified-filled",{fontCharacter:"\\ebe9"})}(U||(U={}))},79881:function(Ot,ke,y){"use strict";y.d(ke,{B8:function(){return f},Cp:function(){return P},F0:function(){return S},L6:function(){return w},VV:function(){return U},b1:function(){return s},dL:function(){return K},ri:function(){return A}});class R{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(l){setTimeout(()=>{throw l.stack?new Error(l.message+`
|
|
|
|
|
|
`+l.stack):l},0)}}emit(l){this.listeners.forEach(c=>{c(l)})}onUnexpectedError(l){this.unexpectedErrorHandler(l),this.emit(l)}onUnexpectedExternalError(l){this.unexpectedErrorHandler(l)}}const N=new R;function K(u){U(u)||N.onUnexpectedError(u)}function P(u){U(u)||N.onUnexpectedExternalError(u)}function A(u){if(u instanceof Error){let{name:l,message:c}=u;const m=u.stacktrace||u.stack;return{$isError:!0,name:l,message:c,stack:m}}return u}const d="Canceled";function U(u){return u instanceof Error&&u.name===d&&u.message===d}function S(){const u=new Error(d);return u.name=u.message,u}function s(u){return u?new Error(`Illegal argument: ${u}`):new Error("Illegal argument")}function w(u){return u?new Error(`Illegal state: ${u}`):new Error("Illegal state")}class f extends Error{constructor(l){super("NotSupported"),l&&(this.message=l)}}},4348:function(Ot,ke,y){"use strict";y.d(ke,{D0:function(){return f},E7:function(){return u},K3:function(){return w},Q5:function(){return s},ZD:function(){return l},ju:function(){return A}});var R=y(79881),N=y(69323),K=y(34502),P=y(95830),A;(function(c){c.None=()=>N.JT.None;function m(ae){return(G,X=null,Z)=>{let B=!1,O;return O=ae(ne=>{if(!B)return O?O.dispose():B=!0,G.call(X,ne)},null,Z),B&&O.dispose(),O}}c.once=m;function C(ae,G){return F((X,Z=null,B)=>ae(O=>X.call(Z,G(O)),null,B))}c.map=C;function M(ae,G){return F((X,Z=null,B)=>ae(O=>{G(O),X.call(Z,O)},null,B))}c.forEach=M;function k(ae,G){return F((X,Z=null,B)=>ae(O=>G(O)&&X.call(Z,O),null,B))}c.filter=k;function E(ae){return ae}c.signal=E;function T(...ae){return(G,X=null,Z)=>(0,N.F8)(...ae.map(B=>B(O=>G.call(X,O),null,Z)))}c.any=T;function I(ae,G,X){let Z=X;return C(ae,B=>(Z=G(Z,B),Z))}c.reduce=I;function F(ae){let G;const X=new s({onFirstListenerAdd(){G=ae(X.fire,X)},onLastListenerRemove(){G.dispose()}});return X.event}function H(ae,G,X=100,Z=!1,B){let O,ne,me,Oe=0;const He=new s({leakWarningThreshold:B,onFirstListenerAdd(){O=ae(ut=>{Oe++,ne=G(ne,ut),Z&&!me&&(He.fire(ne),ne=void 0),clearTimeout(me),me=setTimeout(()=>{const Fe=ne;ne=void 0,me=void 0,(!Z||Oe>1)&&He.fire(Fe),Oe=0},X)})},onLastListenerRemove(){O.dispose()}});return He.event}c.debounce=H;function W(ae,G=(X,Z)=>X===Z){let X=!0,Z;return k(ae,B=>{const O=X||!G(B,Z);return X=!1,Z=B,O})}c.latch=W;function z(ae,G){return[c.filter(ae,G),c.filter(ae,X=>!G(X))]}c.split=z;function ie(ae,G=!1,X=[]){let Z=X.slice(),B=ae(me=>{Z?Z.push(me):ne.fire(me)});const O=()=>{Z&&Z.forEach(me=>ne.fire(me)),Z=null},ne=new s({onFirstListenerAdd(){B||(B=ae(me=>ne.fire(me)))},onFirstListenerDidAdd(){Z&&(G?setTimeout(O):O())},onLastListenerRemove(){B&&B.dispose(),B=null}});return ne.event}c.buffer=ie;class re{constructor(G){this.event=G}map(G){return new re(C(this.event,G))}forEach(G){return new re(M(this.event,G))}filter(G){return new re(k(this.event,G))}reduce(G,X){return new re(I(this.event,G,X))}latch(){return new re(W(this.event))}debounce(G,X=100,Z=!1,B){return new re(H(this.event,G,X,Z,B))}on(G,X,Z){return this.event(G,X,Z)}once(G,X,Z){return m(this.event)(G,X,Z)}}function _e(ae){return new re(ae)}c.chain=_e;function Ae(ae,G,X=Z=>Z){const Z=(...me)=>ne.fire(X(...me)),B=()=>ae.on(G,Z),O=()=>ae.removeListener(G,Z),ne=new s({onFirstListenerAdd:B,onLastListenerRemove:O});return ne.event}c.fromNodeEventEmitter=Ae;function ce(ae,G,X=Z=>Z){const Z=(...me)=>ne.fire(X(...me)),B=()=>ae.addEventListener(G,Z),O=()=>ae.removeEventListener(G,Z),ne=new s({onFirstListenerAdd:B,onLastListenerRemove:O});return ne.event}c.fromDOMEventEmitter=ce;function J(ae){return new Promise(G=>m(ae)(G))}c.toPromise=J})(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 P.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 S{constructor(m,C=Math.random().toString(18).slice(2,5)){this.customThreshold=m,this.name=C,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(m){let C=U;if(typeof this.customThreshold=="number"&&(C=this.customThreshold),C<=0||m<C)return;this._stacks||(this._stacks=new Map);const M=new Error().stack.split(`
|
|
|
`).slice(3).join(`
|
|
|
`),k=this._stacks.get(M)||0;if(this._stacks.set(M,k+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=C*.5;let E,T=0;for(const[I,F]of this._stacks)(!E||T<F)&&(E=I,T=F);console.warn(`[${this.name}] potential listener LEAK detected, having ${m} listeners already. MOST frequent listener (${T}):`),console.warn(E)}return()=>{const E=this._stacks.get(M)||0;this._stacks.set(M,E-1)}}}class s{constructor(m){var C;this._disposed=!1,this._options=m,this._leakageMon=U>0?new S(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((C=this._options)===null||C===void 0)&&C._profName?new d(this._options._profName):void 0}get event(){return this._event||(this._event=(m,C,M)=>{var k;this._listeners||(this._listeners=new K.S);const E=this._listeners.isEmpty();E&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const T=this._listeners.push(C?[m,C]:m);E&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,m,C);const I=(k=this._leakageMon)===null||k===void 0?void 0:k.check(this._listeners.size),F=(0,N.OF)(()=>{I&&I(),this._disposed||(T(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return M instanceof N.SL?M.add(F):Array.isArray(M)&&M.push(F),F}),this._event}fire(m){var C,M;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new K.S);for(let k of this._listeners)this._deliveryQueue.push([k,m]);for((C=this._perfMon)===null||C===void 0||C.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[k,E]=this._deliveryQueue.shift();try{typeof k=="function"?k.call(void 0,E):k[0].call(k[1],E)}catch(T){(0,R.dL)(T)}}(M=this._perfMon)===null||M===void 0||M.stop()}}dispose(){var m,C,M,k,E;this._disposed||(this._disposed=!0,(m=this._listeners)===null||m===void 0||m.clear(),(C=this._deliveryQueue)===null||C===void 0||C.clear(),(k=(M=this._options)===null||M===void 0?void 0:M.onLastListenerRemove)===null||k===void 0||k.call(M),(E=this._leakageMon)===null||E===void 0||E.dispose())}}class w extends s{constructor(m){super(m),this._isPaused=0,this._eventQueue=new K.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 w{constructor(m){var C;super(m),this._delay=(C=m.delay)!==null&&C!==void 0?C:100}fire(m){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(m)}}class u{constructor(){this.buffers=[]}wrapEvent(m){return(C,M,k)=>m(E=>{const T=this.buffers[this.buffers.length-1];T?T.push(()=>C.call(M,E)):C.call(M,E)},void 0,k)}bufferEvents(m){const C=[];this.buffers.push(C);const M=m();return this.buffers.pop(),C.forEach(k=>k()),M}}class l{constructor(){this.listening=!1,this.inputEvent=A.None,this.inputEventListener=N.JT.None,this.emitter=new s({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(Ot,ke,y){"use strict";y.d(ke,{I:function(){return R}});function R(N){const K=this;let P=!1,A;return function(){return P||(P=!0,A=N.apply(K,arguments)),A}}},88226:function(Ot,ke,y){"use strict";y.d(ke,{$:function(){return R}});var R;(function(N){function K(T){return T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}N.is=K;const P=Object.freeze([]);function A(){return P}N.empty=A;function*d(T){yield T}N.single=d;function U(T){return T||P}N.from=U;function S(T){return!T||T[Symbol.iterator]().next().done===!0}N.isEmpty=S;function s(T){return T[Symbol.iterator]().next().value}N.first=s;function w(T,I){for(const F of T)if(I(F))return!0;return!1}N.some=w;function f(T,I){for(const F of T)if(I(F))return F}N.find=f;function*u(T,I){for(const F of T)I(F)&&(yield F)}N.filter=u;function*l(T,I){let F=0;for(const H of T)yield I(H,F++)}N.map=l;function*c(...T){for(const I of T)for(const F of I)yield F}N.concat=c;function*m(T){for(const I of T)for(const F of I)yield F}N.concatNested=m;function C(T,I,F){let H=F;for(const W of T)H=I(H,W);return H}N.reduce=C;function*M(T,I,F=T.length){for(I<0&&(I+=T.length),F<0?F+=T.length:F>T.length&&(F=T.length);I<F;I++)yield T[I]}N.slice=M;function k(T,I=Number.POSITIVE_INFINITY){const F=[];if(I===0)return[F,T];const H=T[Symbol.iterator]();for(let W=0;W<I;W++){const z=H.next();if(z.done)return[F,N.empty()];F.push(z.value)}return[F,{[Symbol.iterator](){return H}}]}N.consume=k;function E(T,I,F=(H,W)=>H===W){const H=T[Symbol.iterator](),W=I[Symbol.iterator]();for(;;){const z=H.next(),ie=W.next();if(z.done!==ie.done)return!1;if(z.done)return!0;if(!F(z.value,ie.value))return!1}}N.equals=E})(R||(R={}))},69323:function(Ot,ke,y){"use strict";y.d(ke,{B9:function(){return l},F8:function(){return c},JT:function(){return M},Jz:function(){return E},OF:function(){return m},SL:function(){return C},Wf:function(){return u},XK:function(){return k},dk:function(){return w}});var R=y(17845),N=y(88226);const K=!1;let P=null;function A(T){P=T}if(K){const T="__is_disposable_tracked__";A(new class{trackDisposable(I){const F=new Error("Potentially leaked disposable").stack;setTimeout(()=>{I[T]||console.log(F)},3e3)}setParent(I,F){if(I&&I!==M.None)try{I[T]=!0}catch(H){}}markAsDisposed(I){if(I&&I!==M.None)try{I[T]=!0}catch(F){}}markAsSingleton(I){}})}function d(T){return P==null||P.trackDisposable(T),T}function U(T){P==null||P.markAsDisposed(T)}function S(T,I){P==null||P.setParent(T,I)}function s(T,I){if(P)for(const F of T)P.setParent(F,I)}function w(T){return P==null||P.markAsSingleton(T),T}class f extends Error{constructor(I){super(`Encountered errors while disposing of store. Errors: [${I.join(", ")}]`),this.errors=I}}function u(T){return typeof T.dispose=="function"&&T.dispose.length===0}function l(T){if(N.$.is(T)){let I=[];for(const F of T)if(F)try{F.dispose()}catch(H){I.push(H)}if(I.length===1)throw I[0];if(I.length>1)throw new f(I);return Array.isArray(T)?[]:T}else if(T)return T.dispose(),T}function c(...T){const I=m(()=>l(T));return s(T,I),I}function m(T){const I=d({dispose:(0,R.I)(()=>{U(I),T()})});return I}class C{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(I){if(!I)return I;if(I===this)throw new Error("Cannot register a disposable on itself!");return S(I,this),this._isDisposed?C.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(I),I}}C.DISABLE_DISPOSED_WARNING=!1;class M{constructor(){this._store=new C,d(this),S(this._store,this)}dispose(){U(this),this._store.dispose()}_register(I){if(I===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(I)}}M.None=Object.freeze({dispose(){}});class k{constructor(){this._isDisposed=!1,d(this)}get value(){return this._isDisposed?void 0:this._value}set value(I){var F;this._isDisposed||I===this._value||((F=this._value)===null||F===void 0||F.dispose(),I&&S(I,this),this._value=I)}clear(){this.value=void 0}dispose(){var I;this._isDisposed=!0,U(this),(I=this._value)===null||I===void 0||I.dispose(),this._value=void 0}clearAndLeak(){const I=this._value;return this._value=void 0,I&&S(I,null),I}}class E{constructor(I){this.object=I}dispose(){}}},34502:function(Ot,ke,y){"use strict";y.d(ke,{S:function(){return N}});class R{constructor(P){this.element=P,this.next=R.Undefined,this.prev=R.Undefined}}R.Undefined=new R(void 0);class N{constructor(){this._first=R.Undefined,this._last=R.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===R.Undefined}clear(){let P=this._first;for(;P!==R.Undefined;){const A=P.next;P.prev=R.Undefined,P.next=R.Undefined,P=A}this._first=R.Undefined,this._last=R.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,A){const d=new R(P);if(this._first===R.Undefined)this._first=d,this._last=d;else if(A){const S=this._last;this._last=d,d.prev=S,S.next=d}else{const S=this._first;this._first=d,d.next=S,S.prev=d}this._size+=1;let U=!1;return()=>{U||(U=!0,this._remove(d))}}shift(){if(this._first!==R.Undefined){const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last!==R.Undefined){const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==R.Undefined&&P.next!==R.Undefined){const A=P.prev;A.next=P.next,P.next.prev=A}else P.prev===R.Undefined&&P.next===R.Undefined?(this._first=R.Undefined,this._last=R.Undefined):P.next===R.Undefined?(this._last=this._last.prev,this._last.next=R.Undefined):P.prev===R.Undefined&&(this._first=this._first.next,this._first.prev=R.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==R.Undefined;)yield P.element,P=P.next}}},23345:function(Ot,ke,y){"use strict";y.d(ke,{$L:function(){return H},ED:function(){return E},IJ:function(){return I},OS:function(){return re},WE:function(){return z},dz:function(){return T},gn:function(){return W},li:function(){return m},r:function(){return ce},tY:function(){return F},xS:function(){return ie}});var R=y(97671),N;const K="en";let P=!1,A=!1,d=!1,U=!1,S=!1,s=!1,w=!1,f,u=null,l=null,c;const m=typeof self=="object"?self:typeof y.g=="object"?y.g:{};let C;typeof m.vscode!="undefined"&&typeof m.vscode.process!="undefined"?C=m.vscode.process:typeof R!="undefined"&&(C=R);const M=typeof((N=C==null?void 0:C.versions)===null||N===void 0?void 0:N.electron)=="string"&&C.type==="renderer";if(typeof navigator=="object"&&!M)c=navigator.userAgent,P=c.indexOf("Windows")>=0,A=c.indexOf("Macintosh")>=0,w=(c.indexOf("Macintosh")>=0||c.indexOf("iPad")>=0||c.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,d=c.indexOf("Linux")>=0,s=!0,f=navigator.language,u=f;else if(typeof C=="object"){P=C.platform==="win32",A=C.platform==="darwin",d=C.platform==="linux",U=d&&!!C.env.SNAP&&!!C.env.SNAP_REVISION,f=K,u=K;const J=C.env.VSCODE_NLS_CONFIG;if(J)try{const ae=JSON.parse(J),G=ae.availableLanguages["*"];f=ae.locale,u=G||K,l=ae._translationsConfigFile}catch(ae){}S=!0}else console.error("Unable to resolve platform.");let k=0;A?k=1:P?k=3:d&&(k=2);const E=P,T=A,I=d,F=S,H=s,W=w,z=c,ie=function(){if(m.setImmediate)return m.setImmediate.bind(m);if(typeof m.postMessage=="function"&&!m.importScripts){let G=[];m.addEventListener("message",Z=>{if(Z.data&&Z.data.vscodeSetImmediateId)for(let B=0,O=G.length;B<O;B++){const ne=G[B];if(ne.id===Z.data.vscodeSetImmediateId){G.splice(B,1),ne.callback();return}}});let X=0;return Z=>{const B=++X;G.push({id:B,callback:Z}),m.postMessage({vscodeSetImmediateId:B},"*")}}if(typeof(C==null?void 0:C.nextTick)=="function")return C.nextTick.bind(C);const ae=Promise.resolve();return G=>ae.then(G)}(),re=A||w?2:P?1:3;let _e=!0,Ae=!1;function ce(){if(!Ae){Ae=!0;const J=new Uint8Array(2);J[0]=1,J[1]=2,_e=new Uint16Array(J.buffer)[0]===513}return _e}},95830:function(Ot,ke,y){"use strict";y.d(ke,{G:function(){return K}});var R=y(23345);const N=R.li.performance&&typeof R.li.performance.now=="function";class K{constructor(A){this._highResolution=N&&A,this._startTime=this._now(),this._stopTime=-1}static create(A=!0){return new K(A)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?R.li.performance.now():Date.now()}}},82983:function(Ot,ke,y){"use strict";y.d(ke,{$i:function(){return Oe},C8:function(){return st},GF:function(){return f},HO:function(){return X},IO:function(){return u},K7:function(){return it},Kw:function(){return tt},LC:function(){return m},Mh:function(){return ie},P1:function(){return re},PJ:function(){return kt},Qe:function(){return He},R1:function(){return w},RP:function(){return ne},S6:function(){return Ne},TT:function(){return E},Ut:function(){return B},V8:function(){return C},WU:function(){return K},YK:function(){return Ae},YU:function(){return P},ZG:function(){return _e},ZH:function(){return J},ab:function(){return ut},c1:function(){return et},df:function(){return H},ec:function(){return A},fi:function(){return ft},fy:function(){return d},j3:function(){return U},j_:function(){return I},m5:function(){return R},mK:function(){return F},mr:function(){return l},oH:function(){return Se},oL:function(){return S},ok:function(){return z},ow:function(){return M},qq:function(){return W},qu:function(){return k},rL:function(){return ce},uS:function(){return Nt},un:function(){return s},uq:function(){return c},vH:function(){return G},xe:function(){return Fe},zY:function(){return T}});function R(de){return!de||typeof de!="string"?!0:de.trim().length===0}const N=/{(\d+)}/g;function K(de,...Le){return Le.length===0?de:de.replace(N,function(We,Ge){const Xe=parseInt(Ge,10);return isNaN(Xe)||Xe<0||Xe>=Le.length?We:Le[Xe]})}function P(de){return de.replace(/[<>&]/g,function(Le){switch(Le){case"<":return"<";case">":return">";case"&":return"&";default:return Le}})}function A(de){return de.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function d(de,Le=" "){const We=U(de,Le);return S(We,Le)}function U(de,Le){if(!de||!Le)return de;const We=Le.length;if(We===0||de.length===0)return de;let Ge=0;for(;de.indexOf(Le,Ge)===Ge;)Ge=Ge+We;return de.substring(Ge)}function S(de,Le){if(!de||!Le)return de;const We=Le.length,Ge=de.length;if(We===0||Ge===0)return de;let Xe=Ge,gt=-1;for(;gt=de.lastIndexOf(Le,Xe-1),!(gt===-1||gt+We!==Xe);){if(gt===0)return"";Xe=gt}return de.substring(0,Xe)}function s(de){return de.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function w(de){return de.replace(/\*/g,"")}function f(de,Le,We={}){if(!de)throw new Error("Cannot create regex from empty string");Le||(de=A(de)),We.wholeWord&&(/\B/.test(de.charAt(0))||(de="\\b"+de),/\B/.test(de.charAt(de.length-1))||(de=de+"\\b"));let Ge="";return We.global&&(Ge+="g"),We.matchCase||(Ge+="i"),We.multiline&&(Ge+="m"),We.unicode&&(Ge+="u"),new RegExp(de,Ge)}function u(de){return de.source==="^"||de.source==="^$"||de.source==="$"||de.source==="^\\s*$"?!1:!!(de.exec("")&&de.lastIndex===0)}function l(de){return(de.global?"g":"")+(de.ignoreCase?"i":"")+(de.multiline?"m":"")+(de.unicode?"u":"")}function c(de){return de.split(/\r\n|\r|\n/)}function m(de){for(let Le=0,We=de.length;Le<We;Le++){const Ge=de.charCodeAt(Le);if(Ge!==32&&Ge!==9)return Le}return-1}function C(de,Le=0,We=de.length){for(let Ge=Le;Ge<We;Ge++){const Xe=de.charCodeAt(Ge);if(Xe!==32&&Xe!==9)return de.substring(Le,Ge)}return de.substring(Le,We)}function M(de,Le=de.length-1){for(let We=Le;We>=0;We--){const Ge=de.charCodeAt(We);if(Ge!==32&&Ge!==9)return We}return-1}function k(de,Le){return de<Le?-1:de>Le?1:0}function E(de,Le,We=0,Ge=de.length,Xe=0,gt=Le.length){for(;We<Ge&&Xe<gt;We++,Xe++){let dt=de.charCodeAt(We),vt=Le.charCodeAt(Xe);if(dt<vt)return-1;if(dt>vt)return 1}const Ct=Ge-We,ht=gt-Xe;return Ct<ht?-1:Ct>ht?1:0}function T(de,Le){return I(de,Le,0,de.length,0,Le.length)}function I(de,Le,We=0,Ge=de.length,Xe=0,gt=Le.length){for(;We<Ge&&Xe<gt;We++,Xe++){let dt=de.charCodeAt(We),vt=Le.charCodeAt(Xe);if(dt===vt)continue;if(dt>=128||vt>=128)return E(de.toLowerCase(),Le.toLowerCase(),We,Ge,Xe,gt);F(dt)&&(dt-=32),F(vt)&&(vt-=32);const Pt=dt-vt;if(Pt!==0)return Pt}const Ct=Ge-We,ht=gt-Xe;return Ct<ht?-1:Ct>ht?1:0}function F(de){return de>=97&&de<=122}function H(de){return de>=65&&de<=90}function W(de,Le){return de.length===Le.length&&I(de,Le)===0}function z(de,Le){const We=Le.length;return Le.length>de.length?!1:I(de,Le,0,We)===0}function ie(de,Le){let We,Ge=Math.min(de.length,Le.length);for(We=0;We<Ge;We++)if(de.charCodeAt(We)!==Le.charCodeAt(We))return We;return Ge}function re(de,Le){let We,Ge=Math.min(de.length,Le.length);const Xe=de.length-1,gt=Le.length-1;for(We=0;We<Ge;We++)if(de.charCodeAt(Xe-We)!==Le.charCodeAt(gt-We))return We;return Ge}function _e(de){return 55296<=de&&de<=56319}function Ae(de){return 56320<=de&&de<=57343}function ce(de,Le){return(de-55296<<10)+(Le-56320)+65536}function J(de,Le,We){const Ge=de.charCodeAt(We);if(_e(Ge)&&We+1<Le){const Xe=de.charCodeAt(We+1);if(Ae(Xe))return ce(Ge,Xe)}return Ge}function ae(de,Le){const We=de.charCodeAt(Le-1);if(Ae(We)&&Le>1){const Ge=de.charCodeAt(Le-2);if(_e(Ge))return ce(Ge,We)}return We}function G(de,Le){const We=Pe.getInstance(),Ge=Le,Xe=de.length,gt=J(de,Xe,Le);Le+=gt>=65536?2:1;let Ct=We.getGraphemeBreakType(gt);for(;Le<Xe;){const ht=J(de,Xe,Le),dt=We.getGraphemeBreakType(ht);if(ft(Ct,dt))break;Le+=ht>=65536?2:1,Ct=dt}return Le-Ge}function X(de,Le){const We=Pe.getInstance(),Ge=Le,Xe=ae(de,Le);Le-=Xe>=65536?2:1;let gt=We.getGraphemeBreakType(Xe);for(;Le>0;){const Ct=ae(de,Le),ht=We.getGraphemeBreakType(Ct);if(ft(ht,gt))break;Le-=Ct>=65536?2:1,gt=ht}return Ge-Le}const Z=/(?:[\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 B(de){return Z.test(de)}const O=/(?:[\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(de){return O.test(de)}const me=/^[\t\n\r\x20-\x7E]*$/;function Oe(de){return me.test(de)}const He=/[\u2028\u2029]/;function ut(de){return He.test(de)}function Fe(de){for(let Le=0,We=de.length;Le<We;Le++)if(it(de.charCodeAt(Le)))return!0;return!1}function it(de){return de=+de,de>=11904&&de<=55215||de>=63744&&de<=64255||de>=65281&&de<=65374}function st(de){return de>=127462&&de<=127487||de===8986||de===8987||de===9200||de===9203||de>=9728&&de<=10175||de===11088||de===11093||de>=127744&&de<=128591||de>=128640&&de<=128764||de>=128992&&de<=129003||de>=129280&&de<=129535||de>=129648&&de<=129750}const et="\uFEFF";function Nt(de){return!!(de&&de.length>0&&de.charCodeAt(0)===65279)}function tt(de,Le=!1){return de?(Le&&(de=de.replace(/\\./g,"")),de.toLowerCase()!==de):!1}function kt(de){return de=de%(2*26),de<26?String.fromCharCode(97+de):String.fromCharCode(65+de-26)}function Ne(de){return Pe.getInstance().getGraphemeBreakType(de)}function ft(de,Le){return de===0?Le!==5&&Le!==7:de===2&&Le===3?!1:de===4||de===2||de===3||Le===4||Le===2||Le===3?!0:!(de===8&&(Le===8||Le===9||Le===11||Le===12)||(de===11||de===9)&&(Le===9||Le===10)||(de===12||de===10)&&Le===10||Le===5||Le===13||Le===7||de===1||de===13&&Le===14||de===6&&Le===6)}class Pe{constructor(){this._data=Te()}static getInstance(){return Pe._INSTANCE||(Pe._INSTANCE=new Pe),Pe._INSTANCE}getGraphemeBreakType(Le){if(Le<32)return Le===10?3:Le===13?2:4;if(Le<127)return 0;const We=this._data,Ge=We.length/3;let Xe=1;for(;Xe<=Ge;)if(Le<We[3*Xe])Xe=2*Xe;else if(Le>We[3*Xe+1])Xe=2*Xe+1;else return We[3*Xe+2];return 0}}Pe._INSTANCE=null;function Te(){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 Se(de,Le){if(de===0)return 0;const We=ze(de,Le);if(We!==void 0)return We;const Ge=ae(Le,de);return de-=Je(Ge),de}function ze(de,Le){let We=ae(Le,de);for(de-=Je(We);rt(We)||We===65039||We===8419;){if(de===0)return;We=ae(Le,de),de-=Je(We)}if(st(We)){if(de>=0){const Ge=ae(Le,de);Ge===8205&&(de-=Je(Ge))}return de}}function Je(de){return de>=65536?2:1}function rt(de){return 127995<=de&&de<=127999}},72999:function(Ot,ke,y){"use strict";y.d(ke,{$E:function(){return m},$K:function(){return U},D8:function(){return u},HD:function(){return N},IU:function(){return C},Jp:function(){return S},Kn:function(){return K},cW:function(){return w},f6:function(){return M},hj:function(){return P},jn:function(){return A},kJ:function(){return R},mf:function(){return f},o8:function(){return d},p_:function(){return s},vE:function(){return k}});function R(E){return Array.isArray(E)}function N(E){return typeof E=="string"}function K(E){return typeof E=="object"&&E!==null&&!Array.isArray(E)&&!(E instanceof RegExp)&&!(E instanceof Date)}function P(E){return typeof E=="number"&&!isNaN(E)}function A(E){return E===!0||E===!1}function d(E){return typeof E=="undefined"}function U(E){return!S(E)}function S(E){return d(E)||E===null}function s(E,T){if(!E)throw new Error(T?`Unexpected type, expected '${T}'`:"Unexpected type")}function w(E){if(S(E))throw new Error("Assertion Failed: argument is undefined or null");return E}function f(E){return typeof E=="function"}function u(E,T){const I=Math.min(E.length,T.length);for(let F=0;F<I;F++)l(E[F],T[F])}function l(E,T){if(N(T)){if(typeof E!==T)throw new Error(`argument does not match constraint: typeof ${T}`)}else if(f(T)){try{if(E instanceof T)return}catch(I){}if(!S(E)&&E.constructor===T||T.length===1&&T.call(void 0,E)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function c(E){let T=[],I=Object.getPrototypeOf(E);for(;Object.prototype!==I;)T=T.concat(Object.getOwnPropertyNames(I)),I=Object.getPrototypeOf(I);return T}function m(E){const T=[];for(const I of c(E))typeof E[I]=="function"&&T.push(I);return T}function C(E,T){const I=H=>function(){const W=Array.prototype.slice.call(arguments,0);return T(H,W)};let F={};for(const H of E)F[H]=I(H);return F}function M(E){return E===null?void 0:E}function k(E,T="Unreachable"){throw new Error(T)}},13268:function(Ot,ke,y){"use strict";y.d(ke,{N:function(){return N}});function R(K,P){let A;return P.length===0?A=K:A=K.replace(/\{(\d+)\}/g,function(d,U){const S=U[0];return typeof P[S]!="undefined"?P[S]:d}),A}function N(K,P,...A){return R(P,A)}},96236:function(Ot,ke,y){"use strict";y.d(ke,{BH:function(){return C},NZ:function(){return M},U8:function(){return k},co:function(){return m},eH:function(){return c},vr:function(){return l}});var R=y(75918),N=y(52615),K=y(4348),P=y(88226),A=y(69323),d=y(34502),U=y(35884),S=y(90689),s=y(16925),w=y(49055),f=function(E,T,I,F){var H=arguments.length,W=H<3?T:F===null?F=Object.getOwnPropertyDescriptor(T,I):F,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(E,T,I,F);else for(var ie=E.length-1;ie>=0;ie--)(z=E[ie])&&(W=(H<3?z(W):H>3?z(T,I,W):z(T,I))||W);return H>3&&W&&Object.defineProperty(T,I,W),W},u=function(E,T){return function(I,F){T(I,F,E)}};function l(E){return E.command!==void 0}class c{constructor(T){this.id=c._idPool++,this._debugName=T}}c._idPool=0,c.CommandPalette=new c("CommandPalette"),c.EditorContext=new c("EditorContext"),c.SimpleEditorContext=new c("SimpleEditorContext"),c.EditorContextCopy=new c("EditorContextCopy"),c.EditorContextPeek=new c("EditorContextPeek"),c.MenubarEditMenu=new c("MenubarEditMenu"),c.MenubarCopy=new c("MenubarCopy"),c.MenubarGoMenu=new c("MenubarGoMenu"),c.MenubarSelectionMenu=new c("MenubarSelectionMenu"),c.InlineCompletionsActions=new c("InlineCompletionsActions");const m=(0,s.yh)("menuService"),C=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new K.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:E=>E===c.CommandPalette}}addCommand(E){return this.addCommands(P.$.single(E))}addCommands(E){for(const T of E)this._commands.set(T.id,T);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,A.OF)(()=>{let T=!1;for(const I of E)T=this._commands.delete(I.id)||T;T&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(E){return this._commands.get(E)}getCommands(){const E=new Map;return this._commands.forEach((T,I)=>E.set(I,T)),E}appendMenuItem(E,T){return this.appendMenuItems(P.$.single({id:E,item:T}))}appendMenuItems(E){const T=new Set,I=new d.S;for(const{id:F,item:H}of E){let W=this._menuItems.get(F);W||(W=new d.S,this._menuItems.set(F,W)),I.push(W.push(H)),T.add(F)}return this._onDidChangeMenu.fire(T),(0,A.OF)(()=>{if(I.size>0){for(let F of I)F();this._onDidChangeMenu.fire(T),I.clear()}})}getMenuItems(E){let T;return this._menuItems.has(E)?T=[...this._menuItems.get(E)]:T=[],E===c.CommandPalette&&this._appendImplicitItems(T),T}_appendImplicitItems(E){const T=new Set;for(const I of E)l(I)&&(T.add(I.command.id),I.alt&&T.add(I.alt.id));this._commands.forEach((I,F)=>{T.has(F)||E.push({command:I})})}};class M extends R.wY{constructor(T,I,F,H){super(`submenuitem.${T.submenu.id}`,typeof T.title=="string"?T.title:T.title.value,[],"submenu"),this.item=T,this._menuService=I,this._contextKeyService=F,this._options=H}get actions(){const T=[],I=this._menuService.createMenu(this.item.submenu,this._contextKeyService),F=I.getActions(this._options);I.dispose();for(const[,H]of F)H.length>0&&(T.push(...H),T.push(new R.Z0));return T.length&&T.pop(),T}}let k=class Eu{constructor(T,I,F,H,W){var z,ie;if(this._commandService=W,this.id=T.id,this.label=F!=null&&F.renderShortTitle&&T.shortTitle?typeof T.shortTitle=="string"?T.shortTitle:T.shortTitle.value:typeof T.title=="string"?T.title:T.title.value,this.tooltip=(ie=typeof T.tooltip=="string"?T.tooltip:(z=T.tooltip)===null||z===void 0?void 0:z.value)!==null&&ie!==void 0?ie:"",this.enabled=!T.precondition||H.contextMatchesRules(T.precondition),this.checked=void 0,T.toggled){const re=T.toggled.condition?T.toggled:{condition:T.toggled};this.checked=H.contextMatchesRules(re.condition),this.checked&&re.tooltip&&(this.tooltip=typeof re.tooltip=="string"?re.tooltip:re.tooltip.value),re.title&&(this.label=typeof re.title=="string"?re.title:re.title.value)}this.item=T,this.alt=I?new Eu(I,void 0,F,H,W):void 0,this._options=F,w.kS.isThemeIcon(T.icon)&&(this.class=N.dT.asClassName(T.icon))}dispose(){}run(...T){var I,F;let H=[];return!((I=this._options)===null||I===void 0)&&I.arg&&(H=[...H,this._options.arg]),!((F=this._options)===null||F===void 0)&&F.shouldForwardArgs&&(H=[...H,...T]),this._commandService.executeCommand(this.id,...H)}};k=f([u(3,S.i6),u(4,U.H)],k)},35884:function(Ot,ke,y){"use strict";y.d(ke,{H:function(){return U},P:function(){return S}});var R=y(4348),N=y(88226),K=y(69323),P=y(34502),A=y(72999),d=y(16925);const U=(0,d.yh)("commandService"),S=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new R.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(s,w){if(!s)throw new Error("invalid command");if(typeof s=="string"){if(!w)throw new Error("invalid command");return this.registerCommand({id:s,handler:w})}if(s.description){const m=[];for(let M of s.description.args)m.push(M.constraint);const C=s.handler;s.handler=function(M,...k){return(0,A.D8)(k,m),C(M,...k)}}const{id:f}=s;let u=this._commands.get(f);u||(u=new P.S,this._commands.set(f,u));let l=u.unshift(s),c=(0,K.OF)(()=>{l();const m=this._commands.get(f);m!=null&&m.isEmpty()&&this._commands.delete(f)});return this._onDidRegisterCommand.fire(f),c}registerCommandAlias(s,w){return S.registerCommand(s,(f,...u)=>f.get(U).executeCommand(w,...u))}getCommand(s){const w=this._commands.get(s);if(!(!w||w.isEmpty()))return N.$.first(w)}getCommands(){const s=new Map;for(const w of this._commands.keys()){const f=this.getCommand(w);f&&s.set(w,f)}return s}};S.registerCommand("noop",()=>{})},90689:function(Ot,ke,y){"use strict";y.d(ke,{Ao:function(){return U},Eq:function(){return ce},Fb:function(){return S},K8:function(){return G},i6:function(){return Ae},uy:function(){return _e}});var R=y(23345),N=y(82983),K=y(16925);let P=R.WE||"";const A=new Map;A.set("false",!1),A.set("true",!0),A.set("isMac",R.dz),A.set("isLinux",R.IJ),A.set("isWindows",R.ED),A.set("isWeb",R.$L),A.set("isMacNative",R.dz&&!R.$L),A.set("isEdge",P.indexOf("Edg/")>=0),A.set("isFirefox",P.indexOf("Firefox")>=0),A.set("isChrome",P.indexOf("Chrome")>=0),A.set("isSafari",P.indexOf("Safari")>=0);const d=Object.prototype.hasOwnProperty;class U{static has(B){return u.create(B)}static equals(B,O){return l.create(B,O)}static regex(B,O){return H.create(B,O)}static not(B){return M.create(B)}static and(...B){return ie.create(B,null)}static or(...B){return re.create(B,null,!0)}static deserialize(B,O=!1){if(B)return this._deserializeOrExpression(B,O)}static _deserializeOrExpression(B,O){let ne=B.split("||");return re.create(ne.map(me=>this._deserializeAndExpression(me,O)),null,!0)}static _deserializeAndExpression(B,O){let ne=B.split("&&");return ie.create(ne.map(me=>this._deserializeOne(me,O)),null)}static _deserializeOne(B,O){if(B=B.trim(),B.indexOf("!=")>=0){let ne=B.split("!=");return C.create(ne[0].trim(),this._deserializeValue(ne[1],O))}if(B.indexOf("==")>=0){let ne=B.split("==");return l.create(ne[0].trim(),this._deserializeValue(ne[1],O))}if(B.indexOf("=~")>=0){let ne=B.split("=~");return H.create(ne[0].trim(),this._deserializeRegexValue(ne[1],O))}if(B.indexOf(" in ")>=0){let ne=B.split(" in ");return c.create(ne[0].trim(),ne[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(B)){const ne=B.split(">=");return T.create(ne[0].trim(),ne[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(B)){const ne=B.split(">");return E.create(ne[0].trim(),ne[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(B)){const ne=B.split("<=");return F.create(ne[0].trim(),ne[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(B)){const ne=B.split("<");return I.create(ne[0].trim(),ne[1].trim())}return/^\!\s*/.test(B)?M.create(B.substr(1).trim()):u.create(B)}static _deserializeValue(B,O){if(B=B.trim(),B==="true")return!0;if(B==="false")return!1;let ne=/^'([^']*)'$/.exec(B);return ne?ne[1].trim():B}static _deserializeRegexValue(B,O){if((0,N.m5)(B)){if(O)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let ne=B.indexOf("/"),me=B.lastIndexOf("/");if(ne===me||ne<0){if(O)throw new Error(`bad regexp-value '${B}', missing /-enclosure`);return console.warn(`bad regexp-value '${B}', missing /-enclosure`),null}let Oe=B.slice(ne+1,me),He=B[me+1]==="i"?"i":"";try{return new RegExp(Oe,He)}catch(ut){if(O)throw new Error(`bad regexp-value '${B}', parse error: ${ut}`);return console.warn(`bad regexp-value '${B}', parse error: ${ut}`),null}}}function S(Z,B){const O=Z?Z.substituteConstants():void 0,ne=B?B.substituteConstants():void 0;return!O&&!ne?!0:!O||!ne?!1:O.equals(ne)}function s(Z,B){return Z.cmp(B)}class w{constructor(){this.type=0}cmp(B){return this.type-B.type}equals(B){return B.type===this.type}substituteConstants(){return this}evaluate(B){return!1}serialize(){return"false"}keys(){return[]}negate(){return f.INSTANCE}}w.INSTANCE=new w;class f{constructor(){this.type=1}cmp(B){return this.type-B.type}equals(B){return B.type===this.type}substituteConstants(){return this}evaluate(B){return!0}serialize(){return"true"}keys(){return[]}negate(){return w.INSTANCE}}f.INSTANCE=new f;class u{constructor(B,O){this.key=B,this.negated=O,this.type=2}static create(B,O=null){const ne=A.get(B);return typeof ne=="boolean"?ne?f.INSTANCE:w.INSTANCE:new u(B,O)}cmp(B){return B.type!==this.type?this.type-B.type:J(this.key,B.key)}equals(B){return B.type===this.type?this.key===B.key:!1}substituteConstants(){const B=A.get(this.key);return typeof B=="boolean"?B?f.INSTANCE:w.INSTANCE:this}evaluate(B){return!!B.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=M.create(this.key,this)),this.negated}}class l{constructor(B,O,ne){this.key=B,this.value=O,this.negated=ne,this.type=4}static create(B,O,ne=null){if(typeof O=="boolean")return O?u.create(B,ne):M.create(B,ne);const me=A.get(B);return typeof me=="boolean"?O===(me?"true":"false")?f.INSTANCE:w.INSTANCE:new l(B,O,ne)}cmp(B){return B.type!==this.type?this.type-B.type:ae(this.key,this.value,B.key,B.value)}equals(B){return B.type===this.type?this.key===B.key&&this.value===B.value:!1}substituteConstants(){const B=A.get(this.key);if(typeof B=="boolean"){const O=B?"true":"false";return this.value===O?f.INSTANCE:w.INSTANCE}return this}evaluate(B){return B.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=C.create(this.key,this.value,this)),this.negated}}class c{constructor(B,O){this.key=B,this.valueKey=O,this.type=10,this.negated=null}static create(B,O){return new c(B,O)}cmp(B){return B.type!==this.type?this.type-B.type:ae(this.key,this.valueKey,B.key,B.valueKey)}equals(B){return B.type===this.type?this.key===B.key&&this.valueKey===B.valueKey:!1}substituteConstants(){return this}evaluate(B){const O=B.getValue(this.valueKey),ne=B.getValue(this.key);return Array.isArray(O)?O.indexOf(ne)>=0:typeof ne=="string"&&typeof O=="object"&&O!==null?d.call(O,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(B){this._actual=B,this.type=11}static create(B){return new m(B)}cmp(B){return B.type!==this.type?this.type-B.type:this._actual.cmp(B._actual)}equals(B){return B.type===this.type?this._actual.equals(B._actual):!1}substituteConstants(){return this}evaluate(B){return!this._actual.evaluate(B)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class C{constructor(B,O,ne){this.key=B,this.value=O,this.negated=ne,this.type=5}static create(B,O,ne=null){if(typeof O=="boolean")return O?M.create(B,ne):u.create(B,ne);const me=A.get(B);return typeof me=="boolean"?O===(me?"true":"false")?w.INSTANCE:f.INSTANCE:new C(B,O,ne)}cmp(B){return B.type!==this.type?this.type-B.type:ae(this.key,this.value,B.key,B.value)}equals(B){return B.type===this.type?this.key===B.key&&this.value===B.value:!1}substituteConstants(){const B=A.get(this.key);if(typeof B=="boolean"){const O=B?"true":"false";return this.value===O?w.INSTANCE:f.INSTANCE}return this}evaluate(B){return B.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 M{constructor(B,O){this.key=B,this.negated=O,this.type=3}static create(B,O=null){const ne=A.get(B);return typeof ne=="boolean"?ne?w.INSTANCE:f.INSTANCE:new M(B,O)}cmp(B){return B.type!==this.type?this.type-B.type:J(this.key,B.key)}equals(B){return B.type===this.type?this.key===B.key:!1}substituteConstants(){const B=A.get(this.key);return typeof B=="boolean"?B?w.INSTANCE:f.INSTANCE:this}evaluate(B){return!B.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this)),this.negated}}function k(Z,B){if(typeof Z=="string"){const O=parseFloat(Z);isNaN(O)||(Z=O)}return typeof Z=="string"||typeof Z=="number"?B(Z):w.INSTANCE}class E{constructor(B,O,ne){this.key=B,this.value=O,this.negated=ne,this.type=12}static create(B,O,ne=null){return k(O,me=>new E(B,me,ne))}cmp(B){return B.type!==this.type?this.type-B.type:ae(this.key,this.value,B.key,B.value)}equals(B){return B.type===this.type?this.key===B.key&&this.value===B.value:!1}substituteConstants(){return this}evaluate(B){return typeof this.value=="string"?!1:parseFloat(B.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=F.create(this.key,this.value,this)),this.negated}}class T{constructor(B,O,ne){this.key=B,this.value=O,this.negated=ne,this.type=13}static create(B,O,ne=null){return k(O,me=>new T(B,me,ne))}cmp(B){return B.type!==this.type?this.type-B.type:ae(this.key,this.value,B.key,B.value)}equals(B){return B.type===this.type?this.key===B.key&&this.value===B.value:!1}substituteConstants(){return this}evaluate(B){return typeof this.value=="string"?!1:parseFloat(B.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=I.create(this.key,this.value,this)),this.negated}}class I{constructor(B,O,ne){this.key=B,this.value=O,this.negated=ne,this.type=14}static create(B,O,ne=null){return k(O,me=>new I(B,me,ne))}cmp(B){return B.type!==this.type?this.type-B.type:ae(this.key,this.value,B.key,B.value)}equals(B){return B.type===this.type?this.key===B.key&&this.value===B.value:!1}substituteConstants(){return this}evaluate(B){return typeof this.value=="string"?!1:parseFloat(B.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 F{constructor(B,O,ne){this.key=B,this.value=O,this.negated=ne,this.type=15}static create(B,O,ne=null){return k(O,me=>new F(B,me,ne))}cmp(B){return B.type!==this.type?this.type-B.type:ae(this.key,this.value,B.key,B.value)}equals(B){return B.type===this.type?this.key===B.key&&this.value===B.value:!1}substituteConstants(){return this}evaluate(B){return typeof this.value=="string"?!1:parseFloat(B.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class H{constructor(B,O){this.key=B,this.regexp=O,this.type=7,this.negated=null}static create(B,O){return new H(B,O)}cmp(B){if(B.type!==this.type)return this.type-B.type;if(this.key<B.key)return-1;if(this.key>B.key)return 1;const O=this.regexp?this.regexp.source:"",ne=B.regexp?B.regexp.source:"";return O<ne?-1:O>ne?1:0}equals(B){if(B.type===this.type){const O=this.regexp?this.regexp.source:"",ne=B.regexp?B.regexp.source:"";return this.key===B.key&&O===ne}return!1}substituteConstants(){return this}evaluate(B){let O=B.getValue(this.key);return this.regexp?this.regexp.test(O):!1}serialize(){const B=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${B}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=W.create(this)),this.negated}}class W{constructor(B){this._actual=B,this.type=8}static create(B){return new W(B)}cmp(B){return B.type!==this.type?this.type-B.type:this._actual.cmp(B._actual)}equals(B){return B.type===this.type?this._actual.equals(B._actual):!1}substituteConstants(){return this}evaluate(B){return!this._actual.evaluate(B)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function z(Z){let B=null;for(let O=0,ne=Z.length;O<ne;O++){const me=Z[O].substituteConstants();if(Z[O]!==me&&B===null){B=[];for(let Oe=0;Oe<O;Oe++)B[Oe]=Z[Oe]}B!==null&&(B[O]=me)}return B===null?Z:B}class ie{constructor(B,O){this.expr=B,this.negated=O,this.type=6}static create(B,O){return ie._normalizeArr(B,O)}cmp(B){if(B.type!==this.type)return this.type-B.type;if(this.expr.length<B.expr.length)return-1;if(this.expr.length>B.expr.length)return 1;for(let O=0,ne=this.expr.length;O<ne;O++){const me=s(this.expr[O],B.expr[O]);if(me!==0)return me}return 0}equals(B){if(B.type===this.type){if(this.expr.length!==B.expr.length)return!1;for(let O=0,ne=this.expr.length;O<ne;O++)if(!this.expr[O].equals(B.expr[O]))return!1;return!0}return!1}substituteConstants(){const B=z(this.expr);return B===this.expr?this:ie.create(B,this.negated)}evaluate(B){for(let O=0,ne=this.expr.length;O<ne;O++)if(!this.expr[O].evaluate(B))return!1;return!0}static _normalizeArr(B,O){const ne=[];let me=!1;for(const Oe of B)if(Oe){if(Oe.type===1){me=!0;continue}if(Oe.type===0)return w.INSTANCE;if(Oe.type===6){ne.push(...Oe.expr);continue}ne.push(Oe)}if(ne.length===0&&me)return f.INSTANCE;if(ne.length!==0){if(ne.length===1)return ne[0];ne.sort(s);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 He=ne.pop(),ut=ne.length===0,Fe=re.create(Oe.expr.map(it=>ie.create([it,He],null)),null,ut);Fe&&(ne.push(Fe),ne.sort(s))}return ne.length===1?ne[0]:new ie(ne,O)}}serialize(){return this.expr.map(B=>B.serialize()).join(" && ")}keys(){const B=[];for(let O of this.expr)B.push(...O.keys());return B}negate(){if(!this.negated){const B=[];for(let O of this.expr)B.push(O.negate());this.negated=re.create(B,this,!0)}return this.negated}}class re{constructor(B,O){this.expr=B,this.negated=O,this.type=9}static create(B,O,ne){return re._normalizeArr(B,O,ne)}cmp(B){if(B.type!==this.type)return this.type-B.type;if(this.expr.length<B.expr.length)return-1;if(this.expr.length>B.expr.length)return 1;for(let O=0,ne=this.expr.length;O<ne;O++){const me=s(this.expr[O],B.expr[O]);if(me!==0)return me}return 0}equals(B){if(B.type===this.type){if(this.expr.length!==B.expr.length)return!1;for(let O=0,ne=this.expr.length;O<ne;O++)if(!this.expr[O].equals(B.expr[O]))return!1;return!0}return!1}substituteConstants(){const B=z(this.expr);return B===this.expr?this:re.create(B,this.negated,!1)}evaluate(B){for(let O=0,ne=this.expr.length;O<ne;O++)if(this.expr[O].evaluate(B))return!0;return!1}static _normalizeArr(B,O,ne){let me=[],Oe=!1;if(B){for(let He=0,ut=B.length;He<ut;He++){const Fe=B[He];if(Fe){if(Fe.type===0){Oe=!0;continue}if(Fe.type===1)return f.INSTANCE;if(Fe.type===9){me=me.concat(Fe.expr);continue}me.push(Fe)}}if(me.length===0&&Oe)return w.INSTANCE;me.sort(s)}if(me.length!==0){if(me.length===1)return me[0];for(let He=1;He<me.length;He++)me[He-1].equals(me[He])&&(me.splice(He,1),He--);if(me.length===1)return me[0];if(ne){for(let He=0;He<me.length;He++)for(let ut=He+1;ut<me.length;ut++)G(me[He],me[ut])&&(me.splice(ut,1),ut--);if(me.length===1)return me[0]}return new re(me,O)}}serialize(){return this.expr.map(B=>B.serialize()).join(" || ")}keys(){const B=[];for(let O of this.expr)B.push(...O.keys());return B}negate(){if(!this.negated){let B=[];for(let O of this.expr)B.push(O.negate());for(;B.length>1;){const O=B.shift(),ne=B.shift(),me=[];for(const He of X(O))for(const ut of X(ne))me.push(ie.create([He,ut],null));const Oe=B.length===0;B.unshift(re.create(me,null,Oe))}this.negated=B[0]}return this.negated}}class _e extends u{constructor(B,O,ne){super(B,null),this._defaultValue=O,typeof ne=="object"?_e._info.push(Object.assign(Object.assign({},ne),{key:B})):ne!==!0&&_e._info.push({key:B,description:ne,type:O!=null?typeof O:void 0})}static all(){return _e._info.values()}bindTo(B){return B.createKey(this.key,this._defaultValue)}getValue(B){return B.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(B){return l.create(this.key,B)}}_e._info=[];const Ae=(0,K.yh)("contextKeyService"),ce="setContext";function J(Z,B){return Z<B?-1:Z>B?1:0}function ae(Z,B,O,ne){return Z<O?-1:Z>O?1:B<ne?-1:B>ne?1:0}function G(Z,B){if(B.type===6&&Z.type!==9&&Z.type!==6){for(const me of B.expr)if(Z.equals(me))return!0}const O=Z.negate(),ne=X(O).concat(X(B));ne.sort(s);for(let me=0;me<ne.length;me++){const He=ne[me].negate();for(let ut=me+1;ut<ne.length;ut++){const Fe=ne[ut];if(He.equals(Fe))return!0}}return!1}function X(Z){return Z.type===9?Z.expr:[Z]}},16925:function(Ot,ke,y){"use strict";y.d(ke,{I8:function(){return R},TG:function(){return N},jt:function(){return A},yh:function(){return P}});var R;(function(d){d.serviceIds=new Map,d.DI_TARGET="$di$target",d.DI_DEPENDENCIES="$di$dependencies";function U(S){return S[d.DI_DEPENDENCIES]||[]}d.getServiceDependencies=U})(R||(R={}));const N=P("instantiationService");function K(d,U,S,s){U[R.DI_TARGET]===U?U[R.DI_DEPENDENCIES].push({id:d,index:S,optional:s}):(U[R.DI_DEPENDENCIES]=[{id:d,index:S,optional:s}],U[R.DI_TARGET]=U)}function P(d){if(R.serviceIds.has(d))return R.serviceIds.get(d);const U=function(S,s,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");K(U,S,w,!1)};return U.toString=()=>d,R.serviceIds.set(d,U),U}function A(d){return function(U,S,s){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");K(d,U,s,!0)}}},44650:function(Ot,ke,y){"use strict";y.d(ke,{B:function(){return P}});var R=y(76068),N=y(72999);class K{constructor(){this.data=new Map}add(d,U){R.ok(N.HD(d)),R.ok(N.Kn(U)),R.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 P=new K},66213:function(Ot,ke,y){"use strict";y.d(ke,{e:function(){return R}});var R;(function(N){N.DARK="dark",N.LIGHT="light",N.HIGH_CONTRAST="hc"})(R||(R={}))},49055:function(Ot,ke,y){"use strict";y.d(ke,{EN:function(){return s},IP:function(){return u},Ic:function(){return m},XE:function(){return U},bB:function(){return C},kS:function(){return w},m6:function(){return f}});var R=y(52615),N=y(4348),K=y(69323),P=y(16925),A=y(44650),d=y(66213);const U=(0,P.yh)("themeService");var S;(function(M){function k(E){return E&&typeof E=="object"&&typeof E.id=="string"}M.isThemeColor=k})(S||(S={}));function s(M){return{id:M}}var w;(function(M){function k(W){return W&&typeof W=="object"&&typeof W.id=="string"&&(typeof W.color=="undefined"||S.isThemeColor(W.color))}M.isThemeIcon=k;const E=new RegExp(`^\\$\\((${R.dT.iconNameExpression}(?:${R.dT.iconModifierExpression})?)\\)$`);function T(W){const z=E.exec(W);if(!z)return;let[,ie]=z;return{id:ie}}M.fromString=T;function I(W,z){let ie=W.id;const re=ie.lastIndexOf("~");return re!==-1&&(ie=ie.substring(0,re)),z&&(ie=`${ie}~${z}`),{id:ie}}M.modify=I;function F(W,z){var ie,re;return W.id===z.id&&((ie=W.color)===null||ie===void 0?void 0:ie.id)===((re=z.color)===null||re===void 0?void 0:re.id)}M.isEqual=F;function H(W,z){return{id:W.id,color:z?s(z):void 0}}M.asThemeIcon=H,M.asClassNameArray=R.dT.asClassNameArray,M.asClassName=R.dT.asClassName,M.asCSSSelector=R.dT.asCSSSelector})(w||(w={}));function f(M){switch(M){case d.e.DARK:return"vs-dark";case d.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const u={ThemingContribution:"base.contributions.theming"};class l{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new N.Q5}onColorThemeChange(k){return this.themingParticipants.push(k),this.onThemingParticipantAddedEmitter.fire(k),(0,K.OF)(()=>{const E=this.themingParticipants.indexOf(k);this.themingParticipants.splice(E,1)})}getThemingParticipants(){return this.themingParticipants}}let c=new l;A.B.add(u.ThemingContribution,c);function m(M){return c.onColorThemeChange(M)}class C extends K.JT{constructor(k){super(),this.themeService=k,this.theme=k.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(E=>this.onThemeChange(E)))}onThemeChange(k){this.theme=k,this.updateStyles()}updateStyles(){}}},66003:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return U}});var R=y(42244),N=y(85899),K=y(43749),P=y(59301),A=["show"];function d(S,s){if(!s.max)return!0;var w=s.strategy(S);return w<=s.max}function U(S,s){return P.useMemo(function(){var w={};s&&(w.show=(0,K.Z)(s)==="object"&&s.formatter?s.formatter:!!s),w=(0,N.Z)((0,N.Z)({},w),S);var f=w,u=f.show,l=(0,R.Z)(f,A);return(0,N.Z)((0,N.Z)({},l),{},{show:!!u,showFormatter:typeof u=="function"?u:void 0,strategy:l.strategy||function(c){return c.length}})},[S,s])}},36901:function(Ot,ke,y){"use strict";y.r(ke),y.d(ke,{BaseInput:function(){return w},default:function(){return T}});var R=y(85899),N=y(60499),K=y(18642),P=y(43749),A=y(92310),d=y.n(A),U=y(59301),S=y(30292),s=U.forwardRef(function(I,F){var H,W,z,ie=I.inputElement,re=I.children,_e=I.prefixCls,Ae=I.prefix,ce=I.suffix,J=I.addonBefore,ae=I.addonAfter,G=I.className,X=I.style,Z=I.disabled,B=I.readOnly,O=I.focused,ne=I.triggerFocus,me=I.allowClear,Oe=I.value,He=I.handleReset,ut=I.hidden,Fe=I.classes,it=I.classNames,st=I.dataAttrs,et=I.styles,Nt=I.components,tt=I.onClear,kt=re!=null?re:ie,Ne=(Nt==null?void 0:Nt.affixWrapper)||"span",ft=(Nt==null?void 0:Nt.groupWrapper)||"span",Pe=(Nt==null?void 0:Nt.wrapper)||"span",Te=(Nt==null?void 0:Nt.groupAddon)||"span",Se=(0,U.useRef)(null),ze=function(St){var _t;(_t=Se.current)!==null&&_t!==void 0&&_t.contains(St.target)&&(ne==null||ne())},Je=(0,S.X3)(I),rt=(0,U.cloneElement)(kt,{value:Oe,className:d()((H=kt.props)===null||H===void 0?void 0:H.className,!Je&&(it==null?void 0:it.variant))||null}),de=(0,U.useRef)(null);if(U.useImperativeHandle(F,function(){return{nativeElement:de.current||Se.current}}),Je){var Le=null;if(me){var We=!Z&&!B&&Oe,Ge="".concat(_e,"-clear-icon"),Xe=(0,P.Z)(me)==="object"&&me!==null&&me!==void 0&&me.clearIcon?me.clearIcon:"\u2716";Le=U.createElement("button",{type:"button",tabIndex:-1,onClick:function(St){He==null||He(St),tt==null||tt()},onMouseDown:function(St){return St.preventDefault()},className:d()(Ge,(0,K.Z)((0,K.Z)({},"".concat(Ge,"-hidden"),!We),"".concat(Ge,"-has-suffix"),!!ce))},Xe)}var gt="".concat(_e,"-affix-wrapper"),Ct=d()(gt,(0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)({},"".concat(_e,"-disabled"),Z),"".concat(gt,"-disabled"),Z),"".concat(gt,"-focused"),O),"".concat(gt,"-readonly"),B),"".concat(gt,"-input-with-clear-btn"),ce&&me&&Oe),Fe==null?void 0:Fe.affixWrapper,it==null?void 0:it.affixWrapper,it==null?void 0:it.variant),ht=(ce||me)&&U.createElement("span",{className:d()("".concat(_e,"-suffix"),it==null?void 0:it.suffix),style:et==null?void 0:et.suffix},Le,ce);rt=U.createElement(Ne,(0,N.Z)({className:Ct,style:et==null?void 0:et.affixWrapper,onClick:ze},st==null?void 0:st.affixWrapper,{ref:Se}),Ae&&U.createElement("span",{className:d()("".concat(_e,"-prefix"),it==null?void 0:it.prefix),style:et==null?void 0:et.prefix},Ae),rt,ht)}if((0,S.He)(I)){var dt="".concat(_e,"-group"),vt="".concat(dt,"-addon"),Pt="".concat(dt,"-wrapper"),Tt=d()("".concat(_e,"-wrapper"),dt,Fe==null?void 0:Fe.wrapper,it==null?void 0:it.wrapper),xt=d()(Pt,(0,K.Z)({},"".concat(Pt,"-disabled"),Z),Fe==null?void 0:Fe.group,it==null?void 0:it.groupWrapper);rt=U.createElement(ft,{className:xt,ref:de},U.createElement(Pe,{className:Tt},J&&U.createElement(Te,{className:vt},J),rt,ae&&U.createElement(Te,{className:vt},ae)))}return U.cloneElement(rt,{className:d()((W=rt.props)===null||W===void 0?void 0:W.className,G)||null,style:(0,R.Z)((0,R.Z)({},(z=rt.props)===null||z===void 0?void 0:z.style),X),hidden:ut})}),w=s,f=y(77654),u=y(72190),l=y(42244),c=y(18929),m=y(2738),C=y(66003),M=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],k=(0,U.forwardRef)(function(I,F){var H=I.autoComplete,W=I.onChange,z=I.onFocus,ie=I.onBlur,re=I.onPressEnter,_e=I.onKeyDown,Ae=I.onKeyUp,ce=I.prefixCls,J=ce===void 0?"rc-input":ce,ae=I.disabled,G=I.htmlSize,X=I.className,Z=I.maxLength,B=I.suffix,O=I.showCount,ne=I.count,me=I.type,Oe=me===void 0?"text":me,He=I.classes,ut=I.classNames,Fe=I.styles,it=I.onCompositionStart,st=I.onCompositionEnd,et=(0,l.Z)(I,M),Nt=(0,U.useState)(!1),tt=(0,u.Z)(Nt,2),kt=tt[0],Ne=tt[1],ft=(0,U.useRef)(!1),Pe=(0,U.useRef)(!1),Te=(0,U.useRef)(null),Se=(0,U.useRef)(null),ze=function(Lt){Te.current&&(0,S.nH)(Te.current,Lt)},Je=(0,c.Z)(I.defaultValue,{value:I.value}),rt=(0,u.Z)(Je,2),de=rt[0],Le=rt[1],We=de==null?"":String(de),Ge=(0,U.useState)(null),Xe=(0,u.Z)(Ge,2),gt=Xe[0],Ct=Xe[1],ht=(0,C.Z)(ne,O),dt=ht.max||Z,vt=ht.strategy(We),Pt=!!dt&&vt>dt;(0,U.useImperativeHandle)(F,function(){var ge;return{focus:ze,blur:function(){var Re;(Re=Te.current)===null||Re===void 0||Re.blur()},setSelectionRange:function(Re,Me,$e){var he;(he=Te.current)===null||he===void 0||he.setSelectionRange(Re,Me,$e)},select:function(){var Re;(Re=Te.current)===null||Re===void 0||Re.select()},input:Te.current,nativeElement:((ge=Se.current)===null||ge===void 0?void 0:ge.nativeElement)||Te.current}}),(0,U.useEffect)(function(){Pe.current&&(Pe.current=!1),Ne(function(ge){return ge&&ae?!1:ge})},[ae]);var Tt=function(Lt,Re,Me){var $e=Re;if(!ft.current&&ht.exceedFormatter&&ht.max&&ht.strategy(Re)>ht.max){if($e=ht.exceedFormatter(Re,{max:ht.max}),Re!==$e){var he,fe;Ct([((he=Te.current)===null||he===void 0?void 0:he.selectionStart)||0,((fe=Te.current)===null||fe===void 0?void 0:fe.selectionEnd)||0])}}else if(Me.source==="compositionEnd")return;Le($e),Te.current&&(0,S.rJ)(Te.current,Lt,W,$e)};(0,U.useEffect)(function(){if(gt){var ge;(ge=Te.current)===null||ge===void 0||ge.setSelectionRange.apply(ge,(0,f.Z)(gt))}},[gt]);var xt=function(Lt){Tt(Lt,Lt.target.value,{source:"change"})},Ke=function(Lt){ft.current=!1,Tt(Lt,Lt.currentTarget.value,{source:"compositionEnd"}),st==null||st(Lt)},St=function(Lt){re&&Lt.key==="Enter"&&!Pe.current&&(Pe.current=!0,re(Lt)),_e==null||_e(Lt)},_t=function(Lt){Lt.key==="Enter"&&(Pe.current=!1),Ae==null||Ae(Lt)},lt=function(Lt){Ne(!0),z==null||z(Lt)},At=function(Lt){Pe.current&&(Pe.current=!1),Ne(!1),ie==null||ie(Lt)},$=function(Lt){Le(""),ze(),Te.current&&(0,S.rJ)(Te.current,Lt,W)},q=Pt&&"".concat(J,"-out-of-range"),Be=function(){var Lt=(0,m.Z)(I,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return U.createElement("input",(0,N.Z)({autoComplete:H},Lt,{onChange:xt,onFocus:lt,onBlur:At,onKeyDown:St,onKeyUp:_t,className:d()(J,(0,K.Z)({},"".concat(J,"-disabled"),ae),ut==null?void 0:ut.input),style:Fe==null?void 0:Fe.input,ref:Te,size:G,type:Oe,onCompositionStart:function(Me){ft.current=!0,it==null||it(Me)},onCompositionEnd:Ke}))},oe=function(){var Lt=Number(dt)>0;if(B||ht.show){var Re=ht.showFormatter?ht.showFormatter({value:We,count:vt,maxLength:dt}):"".concat(vt).concat(Lt?" / ".concat(dt):"");return U.createElement(U.Fragment,null,ht.show&&U.createElement("span",{className:d()("".concat(J,"-show-count-suffix"),(0,K.Z)({},"".concat(J,"-show-count-has-suffix"),!!B),ut==null?void 0:ut.count),style:(0,R.Z)({},Fe==null?void 0:Fe.count)},Re),B)}return null};return U.createElement(w,(0,N.Z)({},et,{prefixCls:J,className:d()(X,q),handleReset:$,value:We,focused:kt,triggerFocus:ze,suffix:oe(),disabled:ae,classes:He,classNames:ut,styles:Fe}),Be())}),E=k,T=E},30292:function(Ot,ke,y){"use strict";y.d(ke,{He:function(){return R},X3:function(){return N},nH:function(){return A},rJ:function(){return P}});function R(d){return!!(d.addonBefore||d.addonAfter)}function N(d){return!!(d.prefix||d.suffix||d.allowClear)}function K(d,U,S){var s=U.cloneNode(!0),w=Object.create(d,{target:{value:s},currentTarget:{value:s}});return s.value=S,typeof U.selectionStart=="number"&&typeof U.selectionEnd=="number"&&(s.selectionStart=U.selectionStart,s.selectionEnd=U.selectionEnd),s.setSelectionRange=function(){U.setSelectionRange.apply(U,arguments)},w}function P(d,U,S,s){if(S){var w=U;if(U.type==="click"){w=K(U,d,""),S(w);return}if(d.type!=="file"&&s!==void 0){w=K(U,d,s),S(w);return}S(w)}}function A(d,U){if(d){d.focus(U);var S=U||{},s=S.cursor;if(s){var w=d.value.length;switch(s){case"start":d.setSelectionRange(0,0);break;case"end":d.setSelectionRange(w,w);break;default:d.setSelectionRange(0,w)}}}}},29301:function(Ot,ke,y){"use strict";y.d(ke,{Z:function(){return ce}});var R=y(60499),N=y(59301),K=y(11592),P=y(48736),A=y(85899),d=y(43749),U=y(76846),S=y(8654),s=N.createContext(null);function w(J){var ae=J.children,G=J.onBatchResize,X=N.useRef(0),Z=N.useRef([]),B=N.useContext(s),O=N.useCallback(function(ne,me,Oe){X.current+=1;var He=X.current;Z.current.push({size:ne,element:me,data:Oe}),Promise.resolve().then(function(){He===X.current&&(G==null||G(Z.current),Z.current=[])}),B==null||B(ne,me,Oe)},[G,B]);return N.createElement(s.Provider,{value:O},ae)}var f=y(76374),u=new Map;function l(J){J.forEach(function(ae){var G,X=ae.target;(G=u.get(X))===null||G===void 0||G.forEach(function(Z){return Z(X)})})}var c=new f.Z(l),m=null,C=null;function M(J,ae){u.has(J)||(u.set(J,new Set),c.observe(J)),u.get(J).add(ae)}function k(J,ae){u.has(J)&&(u.get(J).delete(ae),u.get(J).size||(c.unobserve(J),u.delete(J)))}var E=y(38705),T=y(17212),I=y(39153),F=y(55401),H=function(J){(0,I.Z)(G,J);var ae=(0,F.Z)(G);function G(){return(0,E.Z)(this,G),ae.apply(this,arguments)}return(0,T.Z)(G,[{key:"render",value:function(){return this.props.children}}]),G}(N.Component);function W(J,ae){var G=J.children,X=J.disabled,Z=N.useRef(null),B=N.useRef(null),O=N.useContext(s),ne=typeof G=="function",me=ne?G(Z):G,Oe=N.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),He=!ne&&N.isValidElement(me)&&(0,S.Yr)(me),ut=He?(0,S.C4)(me):null,Fe=(0,S.x1)(ut,Z),it=function(){var tt;return(0,U.ZP)(Z.current)||(Z.current&&(0,d.Z)(Z.current)==="object"?(0,U.ZP)((tt=Z.current)===null||tt===void 0?void 0:tt.nativeElement):null)||(0,U.ZP)(B.current)};N.useImperativeHandle(ae,function(){return it()});var st=N.useRef(J);st.current=J;var et=N.useCallback(function(Nt){var tt=st.current,kt=tt.onResize,Ne=tt.data,ft=Nt.getBoundingClientRect(),Pe=ft.width,Te=ft.height,Se=Nt.offsetWidth,ze=Nt.offsetHeight,Je=Math.floor(Pe),rt=Math.floor(Te);if(Oe.current.width!==Je||Oe.current.height!==rt||Oe.current.offsetWidth!==Se||Oe.current.offsetHeight!==ze){var de={width:Je,height:rt,offsetWidth:Se,offsetHeight:ze};Oe.current=de;var Le=Se===Math.round(Pe)?Pe:Se,We=ze===Math.round(Te)?Te:ze,Ge=(0,A.Z)((0,A.Z)({},de),{},{offsetWidth:Le,offsetHeight:We});O==null||O(Ge,Nt,Ne),kt&&Promise.resolve().then(function(){kt(Ge,Nt)})}},[]);return N.useEffect(function(){var Nt=it();return Nt&&!X&&M(Nt,et),function(){return k(Nt,et)}},[Z.current,X]),N.createElement(H,{ref:B},He?N.cloneElement(me,{ref:Fe}):me)}var z=N.forwardRef(W),ie=z,re="rc-observer-key";function _e(J,ae){var G=J.children,X=typeof G=="function"?[G]:(0,K.Z)(G);return X.map(function(Z,B){var O=(Z==null?void 0:Z.key)||"".concat(re,"-").concat(B);return N.createElement(ie,(0,R.Z)({},J,{key:O,ref:B===0?ae:void 0}),Z)})}var Ae=N.forwardRef(_e);Ae.Collection=w;var ce=Ae},22711:function(Ot,ke,y){"use strict";y.r(ke),y.d(ke,{ResizableTextArea:function(){return Ae},default:function(){return G}});var R=y(60499),N=y(18642),K=y(85899),P=y(77654),A=y(72190),d=y(42244),U=y(92310),S=y.n(U),s=y(36901),w=y(66003),f=y(30292),u=y(18929),l=y(59301),c=y(43749),m=y(29301),C=y(34280),M=y(16089),k=`
|
|
|
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;
|
|
|
`,E=["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={},I;function F(X){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,B=X.getAttribute("id")||X.getAttribute("data-reactid")||X.getAttribute("name");if(Z&&T[B])return T[B];var O=window.getComputedStyle(X),ne=O.getPropertyValue("box-sizing")||O.getPropertyValue("-moz-box-sizing")||O.getPropertyValue("-webkit-box-sizing"),me=parseFloat(O.getPropertyValue("padding-bottom"))+parseFloat(O.getPropertyValue("padding-top")),Oe=parseFloat(O.getPropertyValue("border-bottom-width"))+parseFloat(O.getPropertyValue("border-top-width")),He=E.map(function(Fe){return"".concat(Fe,":").concat(O.getPropertyValue(Fe))}).join(";"),ut={sizingStyle:He,paddingSize:me,borderSize:Oe,boxSizing:ne};return Z&&B&&(T[B]=ut),ut}function H(X){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,O=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;I||(I=document.createElement("textarea"),I.setAttribute("tab-index","-1"),I.setAttribute("aria-hidden","true"),I.setAttribute("name","hiddenTextarea"),document.body.appendChild(I)),X.getAttribute("wrap")?I.setAttribute("wrap",X.getAttribute("wrap")):I.removeAttribute("wrap");var ne=F(X,Z),me=ne.paddingSize,Oe=ne.borderSize,He=ne.boxSizing,ut=ne.sizingStyle;I.setAttribute("style","".concat(ut,";").concat(k)),I.value=X.value||X.placeholder||"";var Fe=void 0,it=void 0,st,et=I.scrollHeight;if(He==="border-box"?et+=Oe:He==="content-box"&&(et-=me),B!==null||O!==null){I.value=" ";var Nt=I.scrollHeight-me;B!==null&&(Fe=Nt*B,He==="border-box"&&(Fe=Fe+me+Oe),et=Math.max(Fe,et)),O!==null&&(it=Nt*O,He==="border-box"&&(it=it+me+Oe),st=et>it?"":"hidden",et=Math.min(it,et))}var tt={height:et,overflowY:st,resize:"none"};return Fe&&(tt.minHeight=Fe),it&&(tt.maxHeight=it),tt}var W=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],z=0,ie=1,re=2,_e=l.forwardRef(function(X,Z){var B=X,O=B.prefixCls,ne=B.defaultValue,me=B.value,Oe=B.autoSize,He=B.onResize,ut=B.className,Fe=B.style,it=B.disabled,st=B.onChange,et=B.onInternalAutoSize,Nt=(0,d.Z)(B,W),tt=(0,u.Z)(ne,{value:me,postState:function(At){return At!=null?At:""}}),kt=(0,A.Z)(tt,2),Ne=kt[0],ft=kt[1],Pe=function(At){ft(At.target.value),st==null||st(At)},Te=l.useRef();l.useImperativeHandle(Z,function(){return{textArea:Te.current}});var Se=l.useMemo(function(){return Oe&&(0,c.Z)(Oe)==="object"?[Oe.minRows,Oe.maxRows]:[]},[Oe]),ze=(0,A.Z)(Se,2),Je=ze[0],rt=ze[1],de=!!Oe,Le=function(){try{if(document.activeElement===Te.current){var At=Te.current,$=At.selectionStart,q=At.selectionEnd,Be=At.scrollTop;Te.current.setSelectionRange($,q),Te.current.scrollTop=Be}}catch(oe){}},We=l.useState(re),Ge=(0,A.Z)(We,2),Xe=Ge[0],gt=Ge[1],Ct=l.useState(),ht=(0,A.Z)(Ct,2),dt=ht[0],vt=ht[1],Pt=function(){gt(z)};(0,C.Z)(function(){de&&Pt()},[me,Je,rt,de]),(0,C.Z)(function(){if(Xe===z)gt(ie);else if(Xe===ie){var lt=H(Te.current,!1,Je,rt);gt(re),vt(lt)}else Le()},[Xe]);var Tt=l.useRef(),xt=function(){M.Z.cancel(Tt.current)},Ke=function(At){Xe===re&&(He==null||He(At),Oe&&(xt(),Tt.current=(0,M.Z)(function(){Pt()})))};l.useEffect(function(){return xt},[]);var St=de?dt:null,_t=(0,K.Z)((0,K.Z)({},Fe),St);return(Xe===z||Xe===ie)&&(_t.overflowY="hidden",_t.overflowX="hidden"),l.createElement(m.Z,{onResize:Ke,disabled:!(Oe||He)},l.createElement("textarea",(0,R.Z)({},Nt,{ref:Te,style:_t,className:S()(O,ut,(0,N.Z)({},"".concat(O,"-disabled"),it)),disabled:it,value:Ne,onChange:Pe})))}),Ae=_e,ce=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],J=l.forwardRef(function(X,Z){var B,O=X.defaultValue,ne=X.value,me=X.onFocus,Oe=X.onBlur,He=X.onChange,ut=X.allowClear,Fe=X.maxLength,it=X.onCompositionStart,st=X.onCompositionEnd,et=X.suffix,Nt=X.prefixCls,tt=Nt===void 0?"rc-textarea":Nt,kt=X.showCount,Ne=X.count,ft=X.className,Pe=X.style,Te=X.disabled,Se=X.hidden,ze=X.classNames,Je=X.styles,rt=X.onResize,de=X.onClear,Le=X.onPressEnter,We=X.readOnly,Ge=X.autoSize,Xe=X.onKeyDown,gt=(0,d.Z)(X,ce),Ct=(0,u.Z)(O,{value:ne,defaultValue:O}),ht=(0,A.Z)(Ct,2),dt=ht[0],vt=ht[1],Pt=dt==null?"":String(dt),Tt=l.useState(!1),xt=(0,A.Z)(Tt,2),Ke=xt[0],St=xt[1],_t=l.useRef(!1),lt=l.useState(null),At=(0,A.Z)(lt,2),$=At[0],q=At[1],Be=(0,l.useRef)(null),oe=(0,l.useRef)(null),ge=function(){var bt;return(bt=oe.current)===null||bt===void 0?void 0:bt.textArea},Lt=function(){ge().focus()};(0,l.useImperativeHandle)(Z,function(){var yt;return{resizableTextArea:oe.current,focus:Lt,blur:function(){ge().blur()},nativeElement:((yt=Be.current)===null||yt===void 0?void 0:yt.nativeElement)||ge()}}),(0,l.useEffect)(function(){St(function(yt){return!Te&&yt})},[Te]);var Re=l.useState(null),Me=(0,A.Z)(Re,2),$e=Me[0],he=Me[1];l.useEffect(function(){if($e){var yt;(yt=ge()).setSelectionRange.apply(yt,(0,P.Z)($e))}},[$e]);var fe=(0,w.Z)(Ne,kt),Ee=(B=fe.max)!==null&&B!==void 0?B:Fe,Ie=Number(Ee)>0,se=fe.strategy(Pt),ot=!!Ee&&se>Ee,ve=function(bt,Vt){var cr=Vt;!_t.current&&fe.exceedFormatter&&fe.max&&fe.strategy(Vt)>fe.max&&(cr=fe.exceedFormatter(Vt,{max:fe.max}),Vt!==cr&&he([ge().selectionStart||0,ge().selectionEnd||0])),vt(cr),(0,f.rJ)(bt.currentTarget,bt,He,cr)},Rt=function(bt){_t.current=!0,it==null||it(bt)},Bt=function(bt){_t.current=!1,ve(bt,bt.currentTarget.value),st==null||st(bt)},zt=function(bt){ve(bt,bt.target.value)},Cr=function(bt){bt.key==="Enter"&&Le&&Le(bt),Xe==null||Xe(bt)},ar=function(bt){St(!0),me==null||me(bt)},qt=function(bt){St(!1),Oe==null||Oe(bt)},Dr=function(bt){vt(""),Lt(),(0,f.rJ)(ge(),bt,He)},Hr=et,pr;fe.show&&(fe.showFormatter?pr=fe.showFormatter({value:Pt,count:se,maxLength:Ee}):pr="".concat(se).concat(Ie?" / ".concat(Ee):""),Hr=l.createElement(l.Fragment,null,Hr,l.createElement("span",{className:S()("".concat(tt,"-data-count"),ze==null?void 0:ze.count),style:Je==null?void 0:Je.count},pr)));var gr=function(bt){var Vt;rt==null||rt(bt),(Vt=ge())!==null&&Vt!==void 0&&Vt.style.height&&q(!0)},Mt=!Ge&&!kt&&!ut;return l.createElement(s.BaseInput,{ref:Be,value:Pt,allowClear:ut,handleReset:Dr,suffix:Hr,prefixCls:tt,classNames:(0,K.Z)((0,K.Z)({},ze),{},{affixWrapper:S()(ze==null?void 0:ze.affixWrapper,(0,N.Z)((0,N.Z)({},"".concat(tt,"-show-count"),kt),"".concat(tt,"-textarea-allow-clear"),ut))}),disabled:Te,focused:Ke,className:S()(ft,ot&&"".concat(tt,"-out-of-range")),style:(0,K.Z)((0,K.Z)({},Pe),$&&!Mt?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof pr=="string"?pr:void 0}},hidden:Se,readOnly:We,onClear:de},l.createElement(Ae,(0,R.Z)({},gt,{autoSize:Ge,maxLength:Fe,onKeyDown:Cr,onChange:zt,onFocus:ar,onBlur:qt,onCompositionStart:Rt,onCompositionEnd:Bt,className:S()(ze==null?void 0:ze.textarea),style:(0,K.Z)((0,K.Z)({},Je==null?void 0:Je.textarea),{},{resize:Pe==null?void 0:Pe.resize}),disabled:Te,prefixCls:tt,onResize:gr,ref:oe,readOnly:We})))}),ae=J,G=ae},29125:function(Ot,ke,y){"use strict";y.d(ke,{G:function(){return P},Z:function(){return k}});var R=y(92310),N=y.n(R),K=y(59301);function P(E){var T=E.children,I=E.prefixCls,F=E.id,H=E.overlayInnerStyle,W=E.bodyClassName,z=E.className,ie=E.style;return K.createElement("div",{className:N()("".concat(I,"-content"),z),style:ie},K.createElement("div",{className:N()("".concat(I,"-inner"),W),id:F,role:"tooltip",style:H},typeof T=="function"?T():T))}var A=y(60499),d=y(85899),U=y(42244),S=y(68196),s={shiftX:64,adjustY:1},w={adjustX:1,shiftY:!0},f=[0,0],u={left:{points:["cr","cl"],overflow:w,offset:[-4,0],targetOffset:f},right:{points:["cl","cr"],overflow:w,offset:[4,0],targetOffset:f},top:{points:["bc","tc"],overflow:s,offset:[0,-4],targetOffset:f},bottom:{points:["tc","bc"],overflow:s,offset:[0,4],targetOffset:f},topLeft:{points:["bl","tl"],overflow:s,offset:[0,-4],targetOffset:f},leftTop:{points:["tr","tl"],overflow:w,offset:[-4,0],targetOffset:f},topRight:{points:["br","tr"],overflow:s,offset:[0,-4],targetOffset:f},rightTop:{points:["tl","tr"],overflow:w,offset:[4,0],targetOffset:f},bottomRight:{points:["tr","br"],overflow:s,offset:[0,4],targetOffset:f},rightBottom:{points:["bl","br"],overflow:w,offset:[4,0],targetOffset:f},bottomLeft:{points:["tl","bl"],overflow:s,offset:[0,4],targetOffset:f},leftBottom:{points:["br","bl"],overflow:w,offset:[-4,0],targetOffset:f}},l=null,c=y(80402),m=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],C=function(T,I){var F=T.overlayClassName,H=T.trigger,W=H===void 0?["hover"]:H,z=T.mouseEnterDelay,ie=z===void 0?0:z,re=T.mouseLeaveDelay,_e=re===void 0?.1:re,Ae=T.overlayStyle,ce=T.prefixCls,J=ce===void 0?"rc-tooltip":ce,ae=T.children,G=T.onVisibleChange,X=T.afterVisibleChange,Z=T.transitionName,B=T.animation,O=T.motion,ne=T.placement,me=ne===void 0?"right":ne,Oe=T.align,He=Oe===void 0?{}:Oe,ut=T.destroyTooltipOnHide,Fe=ut===void 0?!1:ut,it=T.defaultVisible,st=T.getTooltipContainer,et=T.overlayInnerStyle,Nt=T.arrowContent,tt=T.overlay,kt=T.id,Ne=T.showArrow,ft=Ne===void 0?!0:Ne,Pe=T.classNames,Te=T.styles,Se=(0,U.Z)(T,m),ze=(0,c.Z)(kt),Je=(0,K.useRef)(null);(0,K.useImperativeHandle)(I,function(){return Je.current});var rt=(0,d.Z)({},Se);"visible"in T&&(rt.popupVisible=T.visible);var de=function(){return K.createElement(P,{key:"content",prefixCls:J,id:ze,bodyClassName:Pe==null?void 0:Pe.body,overlayInnerStyle:(0,d.Z)((0,d.Z)({},et),Te==null?void 0:Te.body)},tt)},Le=function(){var Ge=K.Children.only(ae),Xe=(Ge==null?void 0:Ge.props)||{},gt=(0,d.Z)((0,d.Z)({},Xe),{},{"aria-describedby":tt?ze:null});return K.cloneElement(ae,gt)};return K.createElement(S.Z,(0,A.Z)({popupClassName:N()(F,Pe==null?void 0:Pe.root),prefixCls:J,popup:de,action:W,builtinPlacements:u,popupPlacement:me,ref:Je,popupAlign:He,getPopupContainer:st,onPopupVisibleChange:G,afterPopupVisibleChange:X,popupTransitionName:Z,popupAnimation:B,popupMotion:O,defaultPopupVisible:it,autoDestroy:Fe,mouseLeaveDelay:_e,popupStyle:(0,d.Z)((0,d.Z)({},Ae),Te==null?void 0:Te.root),mouseEnterDelay:ie,arrow:ft},rt),Le())},M=(0,K.forwardRef)(C),k=M},49658:function(Ot,ke){"use strict";ke.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var y=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(y)||/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(y==null?void 0:y.substr(0,4))}},83145:function(Ot,ke,y){"use strict";Object.defineProperty(ke,"__esModule",{value:!0}),ke.CopyToClipboard=void 0;var R=K(y(59301)),N=K(y(25769));function K(E){return E&&E.__esModule?E:{default:E}}function P(E){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?P=function(I){return typeof I}:P=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},P(E)}function A(E,T){var I=Object.keys(E);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(E);T&&(F=F.filter(function(H){return Object.getOwnPropertyDescriptor(E,H).enumerable})),I.push.apply(I,F)}return I}function d(E){for(var T=1;T<arguments.length;T++){var I=arguments[T]!=null?arguments[T]:{};T%2?A(I,!0).forEach(function(F){M(E,F,I[F])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(I)):A(I).forEach(function(F){Object.defineProperty(E,F,Object.getOwnPropertyDescriptor(I,F))})}return E}function U(E,T){if(E==null)return{};var I=S(E,T),F,H;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(E);for(H=0;H<W.length;H++)F=W[H],!(T.indexOf(F)>=0)&&Object.prototype.propertyIsEnumerable.call(E,F)&&(I[F]=E[F])}return I}function S(E,T){if(E==null)return{};var I={},F=Object.keys(E),H,W;for(W=0;W<F.length;W++)H=F[W],!(T.indexOf(H)>=0)&&(I[H]=E[H]);return I}function s(E,T){if(!(E instanceof T))throw new TypeError("Cannot call a class as a function")}function w(E,T){for(var I=0;I<T.length;I++){var F=T[I];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(E,F.key,F)}}function f(E,T,I){return T&&w(E.prototype,T),I&&w(E,I),E}function u(E,T){return T&&(P(T)==="object"||typeof T=="function")?T:c(E)}function l(E){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},l(E)}function c(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function m(E,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(T&&T.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),T&&C(E,T)}function C(E,T){return C=Object.setPrototypeOf||function(F,H){return F.__proto__=H,F},C(E,T)}function M(E,T,I){return T in E?Object.defineProperty(E,T,{value:I,enumerable:!0,configurable:!0,writable:!0}):E[T]=I,E}var k=function(E){m(T,E);function T(){var I,F;s(this,T);for(var H=arguments.length,W=new Array(H),z=0;z<H;z++)W[z]=arguments[z];return F=u(this,(I=l(T)).call.apply(I,[this].concat(W))),M(c(F),"onClick",function(ie){var re=F.props,_e=re.text,Ae=re.onCopy,ce=re.children,J=re.options,ae=R.default.Children.only(ce),G=(0,N.default)(_e,J);Ae&&Ae(_e,G),ae&&ae.props&&typeof ae.props.onClick=="function"&&ae.props.onClick(ie)}),F}return f(T,[{key:"render",value:function(){var F=this.props,H=F.text,W=F.onCopy,z=F.options,ie=F.children,re=U(F,["text","onCopy","options","children"]),_e=R.default.Children.only(ie);return R.default.cloneElement(_e,d({},re,{onClick:this.onClick}))}}]),T}(R.default.PureComponent);ke.CopyToClipboard=k,M(k,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(Ot,ke,y){"use strict";var R=y(83145),N=R.CopyToClipboard;N.CopyToClipboard=N,Ot.exports=N},76374:function(Ot,ke,y){"use strict";var R=function(){if(typeof Map!="undefined")return Map;function ce(J,ae){var G=-1;return J.some(function(X,Z){return X[0]===ae?(G=Z,!0):!1}),G}return function(){function J(){this.__entries__=[]}return Object.defineProperty(J.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),J.prototype.get=function(ae){var G=ce(this.__entries__,ae),X=this.__entries__[G];return X&&X[1]},J.prototype.set=function(ae,G){var X=ce(this.__entries__,ae);~X?this.__entries__[X][1]=G:this.__entries__.push([ae,G])},J.prototype.delete=function(ae){var G=this.__entries__,X=ce(G,ae);~X&&G.splice(X,1)},J.prototype.has=function(ae){return!!~ce(this.__entries__,ae)},J.prototype.clear=function(){this.__entries__.splice(0)},J.prototype.forEach=function(ae,G){G===void 0&&(G=null);for(var X=0,Z=this.__entries__;X<Z.length;X++){var B=Z[X];ae.call(G,B[1],B[0])}},J}()}(),N=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,K=function(){return typeof y.g!="undefined"&&y.g.Math===Math?y.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),P=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(K):function(ce){return setTimeout(function(){return ce(Date.now())},1e3/60)}}(),A=2;function d(ce,J){var ae=!1,G=!1,X=0;function Z(){ae&&(ae=!1,ce()),G&&O()}function B(){P(Z)}function O(){var ne=Date.now();if(ae){if(ne-X<A)return;G=!0}else ae=!0,G=!1,setTimeout(B,J);X=ne}return O}var U=20,S=["top","right","bottom","left","width","height","size","weight"],s=typeof MutationObserver!="undefined",w=function(){function ce(){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 ce.prototype.addObserver=function(J){~this.observers_.indexOf(J)||this.observers_.push(J),this.connected_||this.connect_()},ce.prototype.removeObserver=function(J){var ae=this.observers_,G=ae.indexOf(J);~G&&ae.splice(G,1),!ae.length&&this.connected_&&this.disconnect_()},ce.prototype.refresh=function(){var J=this.updateObservers_();J&&this.refresh()},ce.prototype.updateObservers_=function(){var J=this.observers_.filter(function(ae){return ae.gatherActive(),ae.hasActive()});return J.forEach(function(ae){return ae.broadcastActive()}),J.length>0},ce.prototype.connect_=function(){!N||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},ce.prototype.disconnect_=function(){!N||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},ce.prototype.onTransitionEnd_=function(J){var ae=J.propertyName,G=ae===void 0?"":ae,X=S.some(function(Z){return!!~G.indexOf(Z)});X&&this.refresh()},ce.getInstance=function(){return this.instance_||(this.instance_=new ce),this.instance_},ce.instance_=null,ce}(),f=function(ce,J){for(var ae=0,G=Object.keys(J);ae<G.length;ae++){var X=G[ae];Object.defineProperty(ce,X,{value:J[X],enumerable:!1,writable:!1,configurable:!0})}return ce},u=function(ce){var J=ce&&ce.ownerDocument&&ce.ownerDocument.defaultView;return J||K},l=H(0,0,0,0);function c(ce){return parseFloat(ce)||0}function m(ce){for(var J=[],ae=1;ae<arguments.length;ae++)J[ae-1]=arguments[ae];return J.reduce(function(G,X){var Z=ce["border-"+X+"-width"];return G+c(Z)},0)}function C(ce){for(var J=["top","right","bottom","left"],ae={},G=0,X=J;G<X.length;G++){var Z=X[G],B=ce["padding-"+Z];ae[Z]=c(B)}return ae}function M(ce){var J=ce.getBBox();return H(0,0,J.width,J.height)}function k(ce){var J=ce.clientWidth,ae=ce.clientHeight;if(!J&&!ae)return l;var G=u(ce).getComputedStyle(ce),X=C(G),Z=X.left+X.right,B=X.top+X.bottom,O=c(G.width),ne=c(G.height);if(G.boxSizing==="border-box"&&(Math.round(O+Z)!==J&&(O-=m(G,"left","right")+Z),Math.round(ne+B)!==ae&&(ne-=m(G,"top","bottom")+B)),!T(ce)){var me=Math.round(O+Z)-J,Oe=Math.round(ne+B)-ae;Math.abs(me)!==1&&(O-=me),Math.abs(Oe)!==1&&(ne-=Oe)}return H(X.left,X.top,O,ne)}var E=function(){return typeof SVGGraphicsElement!="undefined"?function(ce){return ce instanceof u(ce).SVGGraphicsElement}:function(ce){return ce instanceof u(ce).SVGElement&&typeof ce.getBBox=="function"}}();function T(ce){return ce===u(ce).document.documentElement}function I(ce){return N?E(ce)?M(ce):k(ce):l}function F(ce){var J=ce.x,ae=ce.y,G=ce.width,X=ce.height,Z=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,B=Object.create(Z.prototype);return f(B,{x:J,y:ae,width:G,height:X,top:ae,right:J+G,bottom:X+ae,left:J}),B}function H(ce,J,ae,G){return{x:ce,y:J,width:ae,height:G}}var W=function(){function ce(J){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=H(0,0,0,0),this.target=J}return ce.prototype.isActive=function(){var J=I(this.target);return this.contentRect_=J,J.width!==this.broadcastWidth||J.height!==this.broadcastHeight},ce.prototype.broadcastRect=function(){var J=this.contentRect_;return this.broadcastWidth=J.width,this.broadcastHeight=J.height,J},ce}(),z=function(){function ce(J,ae){var G=F(ae);f(this,{target:J,contentRect:G})}return ce}(),ie=function(){function ce(J,ae,G){if(this.activeObservations_=[],this.observations_=new R,typeof J!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=J,this.controller_=ae,this.callbackCtx_=G}return ce.prototype.observe=function(J){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(J instanceof u(J).Element))throw new TypeError('parameter 1 is not of type "Element".');var ae=this.observations_;ae.has(J)||(ae.set(J,new W(J)),this.controller_.addObserver(this),this.controller_.refresh())}},ce.prototype.unobserve=function(J){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(J instanceof u(J).Element))throw new TypeError('parameter 1 is not of type "Element".');var ae=this.observations_;ae.has(J)&&(ae.delete(J),ae.size||this.controller_.removeObserver(this))}},ce.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},ce.prototype.gatherActive=function(){var J=this;this.clearActive(),this.observations_.forEach(function(ae){ae.isActive()&&J.activeObservations_.push(ae)})},ce.prototype.broadcastActive=function(){if(this.hasActive()){var J=this.callbackCtx_,ae=this.activeObservations_.map(function(G){return new z(G.target,G.broadcastRect())});this.callback_.call(J,ae,J),this.clearActive()}},ce.prototype.clearActive=function(){this.activeObservations_.splice(0)},ce.prototype.hasActive=function(){return this.activeObservations_.length>0},ce}(),re=typeof WeakMap!="undefined"?new WeakMap:new R,_e=function(){function ce(J){if(!(this instanceof ce))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var ae=w.getInstance(),G=new ie(J,ae,this);re.set(this,G)}return ce}();["observe","unobserve","disconnect"].forEach(function(ce){_e.prototype[ce]=function(){var J;return(J=re.get(this))[ce].apply(J,arguments)}});var Ae=function(){return typeof K.ResizeObserver!="undefined"?K.ResizeObserver:_e}();ke.Z=Ae},98040:function(Ot){Ot.exports=function(){var ke=document.getSelection();if(!ke.rangeCount)return function(){};for(var y=document.activeElement,R=[],N=0;N<ke.rangeCount;N++)R.push(ke.getRangeAt(N));switch(y.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":y.blur();break;default:y=null;break}return ke.removeAllRanges(),function(){ke.type==="Caret"&&ke.removeAllRanges(),ke.rangeCount||R.forEach(function(K){ke.addRange(K)}),y&&y.focus()}}},34376:function(Ot){(function(ke,y){if(1)Ot.exports=y();else var R,N})(window,function(){return function(ke){var y={};function R(N){if(y[N])return y[N].exports;var K=y[N]={i:N,l:!1,exports:{}};return ke[N].call(K.exports,K,K.exports,R),K.l=!0,K.exports}return R.m=ke,R.c=y,R.d=function(N,K,P){R.o(N,K)||Object.defineProperty(N,K,{enumerable:!0,get:P})},R.r=function(N){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})},R.t=function(N,K){if(1&K&&(N=R(N)),8&K||4&K&&typeof N=="object"&&N&&N.__esModule)return N;var P=Object.create(null);if(R.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:N}),2&K&&typeof N!="string")for(var A in N)R.d(P,A,function(d){return N[d]}.bind(null,A));return P},R.n=function(N){var K=N&&N.__esModule?function(){return N.default}:function(){return N};return R.d(K,"a",K),K},R.o=function(N,K){return Object.prototype.hasOwnProperty.call(N,K)},R.p="",R(R.s=34)}([function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.forwardEvent=y.EventEmitter=void 0;var N=function(){function K(){this._listeners=[],this._disposed=!1}return Object.defineProperty(K.prototype,"event",{get:function(){var P=this;return this._event||(this._event=function(A){return P._listeners.push(A),{dispose:function(){if(!P._disposed){for(var d=0;d<P._listeners.length;d++)if(P._listeners[d]===A)return void P._listeners.splice(d,1)}}}}),this._event},enumerable:!1,configurable:!0}),K.prototype.fire=function(P,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,P,A)},K.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},K}();y.EventEmitter=N,y.forwardEvent=function(K,P){return K(function(A){return P.fire(A)})}},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.IUnicodeService=y.IOptionsService=y.ILogService=y.IInstantiationService=y.IDirtyRowService=y.ICharsetService=y.ICoreService=y.ICoreMouseService=y.IBufferService=void 0;var N=R(14);y.IBufferService=N.createDecorator("BufferService"),y.ICoreMouseService=N.createDecorator("CoreMouseService"),y.ICoreService=N.createDecorator("CoreService"),y.ICharsetService=N.createDecorator("CharsetService"),y.IDirtyRowService=N.createDecorator("DirtyRowService"),y.IInstantiationService=N.createDecorator("InstantiationService"),y.ILogService=N.createDecorator("LogService"),y.IOptionsService=N.createDecorator("OptionsService"),y.IUnicodeService=N.createDecorator("UnicodeService")},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.getDisposeArrayDisposable=y.disposeArray=y.Disposable=void 0;var N=function(){function P(){this._disposables=[],this._isDisposed=!1}return P.prototype.dispose=function(){this._isDisposed=!0;for(var A=0,d=this._disposables;A<d.length;A++)d[A].dispose();this._disposables.length=0},P.prototype.register=function(A){return this._disposables.push(A),A},P.prototype.unregister=function(A){var d=this._disposables.indexOf(A);d!==-1&&this._disposables.splice(d,1)},P}();function K(P){for(var A=0,d=P;A<d.length;A++)d[A].dispose();P.length=0}y.Disposable=N,y.disposeArray=K,y.getDisposeArrayDisposable=function(P){return{dispose:function(){return K(P)}}}},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.WHITESPACE_CELL_CODE=y.WHITESPACE_CELL_WIDTH=y.WHITESPACE_CELL_CHAR=y.NULL_CELL_CODE=y.NULL_CELL_WIDTH=y.NULL_CELL_CHAR=y.CHAR_DATA_CODE_INDEX=y.CHAR_DATA_WIDTH_INDEX=y.CHAR_DATA_CHAR_INDEX=y.CHAR_DATA_ATTR_INDEX=y.DEFAULT_ATTR=y.DEFAULT_COLOR=void 0,y.DEFAULT_COLOR=256,y.DEFAULT_ATTR=256|y.DEFAULT_COLOR<<9,y.CHAR_DATA_ATTR_INDEX=0,y.CHAR_DATA_CHAR_INDEX=1,y.CHAR_DATA_WIDTH_INDEX=2,y.CHAR_DATA_CODE_INDEX=3,y.NULL_CELL_CHAR="",y.NULL_CELL_WIDTH=1,y.NULL_CELL_CODE=0,y.WHITESPACE_CELL_CHAR=" ",y.WHITESPACE_CELL_WIDTH=1,y.WHITESPACE_CELL_CODE=32},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(S,s){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,f){w.__proto__=f}||function(w,f){for(var u in f)f.hasOwnProperty(u)&&(w[u]=f[u])})(S,s)},function(S,s){function w(){this.constructor=S}N(S,s),S.prototype=s===null?Object.create(s):(w.prototype=s.prototype,new w)});Object.defineProperty(y,"__esModule",{value:!0}),y.CellData=void 0;var P=R(8),A=R(3),d=R(6),U=function(S){function s(){var w=S!==null&&S.apply(this,arguments)||this;return w.content=0,w.fg=0,w.bg=0,w.extended=new d.ExtendedAttrs,w.combinedData="",w}return K(s,S),s.fromCharData=function(w){var f=new s;return f.setFromCharData(w),f},s.prototype.isCombined=function(){return 2097152&this.content},s.prototype.getWidth=function(){return this.content>>22},s.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?P.stringFromCodePoint(2097151&this.content):""},s.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},s.prototype.setFromCharData=function(w){this.fg=w[A.CHAR_DATA_ATTR_INDEX],this.bg=0;var f=!1;if(w[A.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(w[A.CHAR_DATA_CHAR_INDEX].length===2){var u=w[A.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){var l=w[A.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(u-55296)+l-56320+65536|w[A.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=w[A.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[A.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=w[A.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[A.CHAR_DATA_WIDTH_INDEX]<<22)},s.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},s}(d.AttributeData);y.CellData=U},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.ISoundService=y.ISelectionService=y.IRenderService=y.IMouseService=y.ICoreBrowserService=y.ICharSizeService=void 0;var N=R(14);y.ICharSizeService=N.createDecorator("CharSizeService"),y.ICoreBrowserService=N.createDecorator("CoreBrowserService"),y.IMouseService=N.createDecorator("MouseService"),y.IRenderService=N.createDecorator("RenderService"),y.ISelectionService=N.createDecorator("SelectionService"),y.ISoundService=N.createDecorator("SoundService")},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.ExtendedAttrs=y.AttributeData=void 0;var N=function(){function P(){this.fg=0,this.bg=0,this.extended=new K}return P.toColorRGB=function(A){return[A>>>16&255,A>>>8&255,255&A]},P.fromColorRGB=function(A){return(255&A[0])<<16|(255&A[1])<<8|255&A[2]},P.prototype.clone=function(){var A=new P;return A.fg=this.fg,A.bg=this.bg,A.extended=this.extended.clone(),A},P.prototype.isInverse=function(){return 67108864&this.fg},P.prototype.isBold=function(){return 134217728&this.fg},P.prototype.isUnderline=function(){return 268435456&this.fg},P.prototype.isBlink=function(){return 536870912&this.fg},P.prototype.isInvisible=function(){return 1073741824&this.fg},P.prototype.isItalic=function(){return 67108864&this.bg},P.prototype.isDim=function(){return 134217728&this.bg},P.prototype.getFgColorMode=function(){return 50331648&this.fg},P.prototype.getBgColorMode=function(){return 50331648&this.bg},P.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},P.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},P.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},P.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},P.prototype.isFgDefault=function(){return(50331648&this.fg)==0},P.prototype.isBgDefault=function(){return(50331648&this.bg)==0},P.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},P.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},P.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},P.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},P.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},P.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()},P.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},P.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},P.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},P.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},P.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},P}();y.AttributeData=N;var K=function(){function P(A,d){A===void 0&&(A=0),d===void 0&&(d=-1),this.underlineStyle=A,this.underlineColor=d}return P.prototype.clone=function(){return new P(this.underlineStyle,this.underlineColor)},P.prototype.isEmpty=function(){return this.underlineStyle===0},P}();y.ExtendedAttrs=K},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.addDisposableDomListener=void 0,y.addDisposableDomListener=function(N,K,P,A){N.addEventListener(K,P,A);var d=!1;return{dispose:function(){d||(d=!0,N.removeEventListener(K,P,A))}}}},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.Utf8ToUtf32=y.StringToUtf32=y.utf32ToString=y.stringFromCodePoint=void 0,y.stringFromCodePoint=function(P){return P>65535?(P-=65536,String.fromCharCode(55296+(P>>10))+String.fromCharCode(P%1024+56320)):String.fromCharCode(P)},y.utf32ToString=function(P,A,d){A===void 0&&(A=0),d===void 0&&(d=P.length);for(var U="",S=A;S<d;++S){var s=P[S];s>65535?(s-=65536,U+=String.fromCharCode(55296+(s>>10))+String.fromCharCode(s%1024+56320)):U+=String.fromCharCode(s)}return U};var N=function(){function P(){this._interim=0}return P.prototype.clear=function(){this._interim=0},P.prototype.decode=function(A,d){var U=A.length;if(!U)return 0;var S=0,s=0;this._interim&&(56320<=(u=A.charCodeAt(s++))&&u<=57343?d[S++]=1024*(this._interim-55296)+u-56320+65536:(d[S++]=this._interim,d[S++]=u),this._interim=0);for(var w=s;w<U;++w){var f=A.charCodeAt(w);if(55296<=f&&f<=56319){if(++w>=U)return this._interim=f,S;var u;56320<=(u=A.charCodeAt(w))&&u<=57343?d[S++]=1024*(f-55296)+u-56320+65536:(d[S++]=f,d[S++]=u)}else d[S++]=f}return S},P}();y.StringToUtf32=N;var K=function(){function P(){this.interim=new Uint8Array(3)}return P.prototype.clear=function(){this.interim.fill(0)},P.prototype.decode=function(A,d){var U=A.length;if(!U)return 0;var S,s,w,f,u=0,l=0,c=0;if(this.interim[0]){var m=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;for(var M=0,k=void 0;(k=63&this.interim[++M])&&M<4;)C<<=6,C|=k;for(var E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=E-M;c<T;){if(c>=U)return 0;if((192&(k=A[c++]))!=128){c--,m=!0;break}this.interim[M++]=k,C<<=6,C|=63&k}m||(E===2?C<128?c--:d[u++]=C:E===3?C<2048||C>=55296&&C<=57343||(d[u++]=C):C<65536||C>1114111||(d[u++]=C)),this.interim.fill(0)}for(var I=U-4,F=c;F<U;){for(;!(!(F<I)||128&(S=A[F])||128&(s=A[F+1])||128&(w=A[F+2])||128&(f=A[F+3]));)d[u++]=S,d[u++]=s,d[u++]=w,d[u++]=f,F+=4;if((S=A[F++])<128)d[u++]=S;else if((224&S)==192){if(F>=U)return this.interim[0]=S,u;if((192&(s=A[F++]))!=128){F--;continue}if((l=(31&S)<<6|63&s)<128){F--;continue}d[u++]=l}else if((240&S)==224){if(F>=U)return this.interim[0]=S,u;if((192&(s=A[F++]))!=128){F--;continue}if(F>=U)return this.interim[0]=S,this.interim[1]=s,u;if((192&(w=A[F++]))!=128){F--;continue}if((l=(15&S)<<12|(63&s)<<6|63&w)<2048||l>=55296&&l<=57343)continue;d[u++]=l}else if((248&S)==240){if(F>=U)return this.interim[0]=S,u;if((192&(s=A[F++]))!=128){F--;continue}if(F>=U)return this.interim[0]=S,this.interim[1]=s,u;if((192&(w=A[F++]))!=128){F--;continue}if(F>=U)return this.interim[0]=S,this.interim[1]=s,this.interim[2]=w,u;if((192&(f=A[F++]))!=128){F--;continue}if((l=(7&S)<<18|(63&s)<<12|(63&w)<<6|63&f)<65536||l>1114111)continue;d[u++]=l}}return u},P}();y.Utf8ToUtf32=K},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.CHAR_ATLAS_CELL_SPACING=y.DIM_OPACITY=y.INVERTED_DEFAULT_COLOR=void 0,y.INVERTED_DEFAULT_COLOR=257,y.DIM_OPACITY=.5,y.CHAR_ATLAS_CELL_SPACING=1},function(ke,y,R){"use strict";var N,K,P,A;function d(S){var s=S.toString(16);return s.length<2?"0"+s:s}function U(S,s){return S<s?(s+.05)/(S+.05):(S+.05)/(s+.05)}Object.defineProperty(y,"__esModule",{value:!0}),y.contrastRatio=y.toPaddedHex=y.rgba=y.rgb=y.css=y.color=y.channels=void 0,function(S){S.toCss=function(s,w,f,u){return u!==void 0?"#"+d(s)+d(w)+d(f)+d(u):"#"+d(s)+d(w)+d(f)},S.toRgba=function(s,w,f,u){return u===void 0&&(u=255),(s<<24|w<<16|f<<8|u)>>>0}}(N=y.channels||(y.channels={})),(K=y.color||(y.color={})).blend=function(S,s){var w=(255&s.rgba)/255;if(w===1)return{css:s.css,rgba:s.rgba};var f=s.rgba>>24&255,u=s.rgba>>16&255,l=s.rgba>>8&255,c=S.rgba>>24&255,m=S.rgba>>16&255,C=S.rgba>>8&255,M=c+Math.round((f-c)*w),k=m+Math.round((u-m)*w),E=C+Math.round((l-C)*w);return{css:N.toCss(M,k,E),rgba:N.toRgba(M,k,E)}},K.isOpaque=function(S){return(255&S.rgba)==255},K.ensureContrastRatio=function(S,s,w){var f=A.ensureContrastRatio(S.rgba,s.rgba,w);if(f)return A.toColor(f>>24&255,f>>16&255,f>>8&255)},K.opaque=function(S){var s=(255|S.rgba)>>>0,w=A.toChannels(s),f=w[0],u=w[1],l=w[2];return{css:N.toCss(f,u,l),rgba:s}},K.opacity=function(S,s){var w=Math.round(255*s),f=A.toChannels(S.rgba),u=f[0],l=f[1],c=f[2];return{css:N.toCss(u,l,c,w),rgba:N.toRgba(u,l,c,w)}},(y.css||(y.css={})).toColor=function(S){switch(S.length){case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(S){function s(w,f,u){var l=w/255,c=f/255,m=u/255;return .2126*(l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4))+.7152*(c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4))+.0722*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))}S.relativeLuminance=function(w){return s(w>>16&255,w>>8&255,255&w)},S.relativeLuminance2=s}(P=y.rgb||(y.rgb={})),function(S){function s(f,u,l){for(var c=f>>24&255,m=f>>16&255,C=f>>8&255,M=u>>24&255,k=u>>16&255,E=u>>8&255,T=U(P.relativeLuminance2(M,E,k),P.relativeLuminance2(c,m,C));T<l&&(M>0||k>0||E>0);)M-=Math.max(0,Math.ceil(.1*M)),k-=Math.max(0,Math.ceil(.1*k)),E-=Math.max(0,Math.ceil(.1*E)),T=U(P.relativeLuminance2(M,E,k),P.relativeLuminance2(c,m,C));return(M<<24|k<<16|E<<8|255)>>>0}function w(f,u,l){for(var c=f>>24&255,m=f>>16&255,C=f>>8&255,M=u>>24&255,k=u>>16&255,E=u>>8&255,T=U(P.relativeLuminance2(M,E,k),P.relativeLuminance2(c,m,C));T<l&&(M<255||k<255||E<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),k=Math.min(255,k+Math.ceil(.1*(255-k))),E=Math.min(255,E+Math.ceil(.1*(255-E))),T=U(P.relativeLuminance2(M,E,k),P.relativeLuminance2(c,m,C));return(M<<24|k<<16|E<<8|255)>>>0}S.ensureContrastRatio=function(f,u,l){var c=P.relativeLuminance(f>>8),m=P.relativeLuminance(u>>8);if(U(c,m)<l)return m<c?s(f,u,l):w(f,u,l)},S.reduceLuminance=s,S.increaseLuminance=w,S.toChannels=function(f){return[f>>24&255,f>>16&255,f>>8&255,255&f]},S.toColor=function(f,u,l){return{css:N.toCss(f,u,l),rgba:N.toRgba(f,u,l)}}}(A=y.rgba||(y.rgba={})),y.toPaddedHex=d,y.contrastRatio=U},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.isLinux=y.isWindows=y.isIphone=y.isIpad=y.isMac=y.isSafari=y.isFirefox=void 0;var N=typeof navigator=="undefined",K=N?"node":navigator.userAgent,P=N?"node":navigator.platform;function A(d,U){return d.indexOf(U)>=0}y.isFirefox=!!~K.indexOf("Firefox"),y.isSafari=/^((?!chrome|android).)*safari/i.test(K),y.isMac=A(["Macintosh","MacIntel","MacPPC","Mac68K"],P),y.isIpad=P==="iPad",y.isIphone=P==="iPhone",y.isWindows=A(["Windows","Win16","Win32","WinCE"],P),y.isLinux=P.indexOf("Linux")>=0},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.C1=y.C0=void 0,function(N){N.NUL="\0",N.SOH="",N.STX="",N.ETX="",N.EOT="",N.ENQ="",N.ACK="",N.BEL="\x07",N.BS="\b",N.HT=" ",N.LF=`
|
|
|
`,N.VT="\v",N.FF="\f",N.CR="\r",N.SO="",N.SI="",N.DLE="",N.DC1="",N.DC2="",N.DC3="",N.DC4="",N.NAK="",N.SYN="",N.ETB="",N.CAN="",N.EM="",N.SUB="",N.ESC="\x1B",N.FS="",N.GS="",N.RS="",N.US="",N.SP=" ",N.DEL="\x7F"}(y.C0||(y.C0={})),function(N){N.PAD="\x80",N.HOP="\x81",N.BPH="\x82",N.NBH="\x83",N.IND="\x84",N.NEL="\x85",N.SSA="\x86",N.ESA="\x87",N.HTS="\x88",N.HTJ="\x89",N.VTS="\x8A",N.PLD="\x8B",N.PLU="\x8C",N.RI="\x8D",N.SS2="\x8E",N.SS3="\x8F",N.DCS="\x90",N.PU1="\x91",N.PU2="\x92",N.STS="\x93",N.CCH="\x94",N.MW="\x95",N.SPA="\x96",N.EPA="\x97",N.SOS="\x98",N.SGCI="\x99",N.SCI="\x9A",N.CSI="\x9B",N.ST="\x9C",N.OSC="\x9D",N.PM="\x9E",N.APC="\x9F"}(y.C1||(y.C1={}))},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.BaseRenderLayer=void 0;var N=R(3),K=R(9),P=R(25),A=R(6),d=R(28),U=R(10),S=R(17),s=function(){function w(f,u,l,c,m,C,M,k){this._container=f,this._alpha=c,this._colors=m,this._rendererId=C,this._bufferService=M,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-"+u+"-layer"),this._canvas.style.zIndex=l.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return w.prototype.dispose=function(){var f;S.removeElementFromParent(this._canvas),(f=this._charAtlas)===null||f===void 0||f.dispose()},w.prototype._initCanvas=function(){this._ctx=d.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},w.prototype.onOptionsChanged=function(){},w.prototype.onBlur=function(){},w.prototype.onFocus=function(){},w.prototype.onCursorMove=function(){},w.prototype.onGridChanged=function(f,u){},w.prototype.onSelectionChanged=function(f,u,l){l===void 0&&(l=!1)},w.prototype.setColors=function(f){this._refreshCharAtlas(f)},w.prototype._setTransparency=function(f){if(f!==this._alpha){var u=this._canvas;this._alpha=f,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,u),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},w.prototype._refreshCharAtlas=function(f){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=P.acquireCharAtlas(this._optionsService.options,this._rendererId,f,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},w.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)},w.prototype._fillCells=function(f,u,l,c){this._ctx.fillRect(f*this._scaledCellWidth,u*this._scaledCellHeight,l*this._scaledCellWidth,c*this._scaledCellHeight)},w.prototype._fillBottomLineAtCells=function(f,u,l){l===void 0&&(l=1),this._ctx.fillRect(f*this._scaledCellWidth,(u+1)*this._scaledCellHeight-window.devicePixelRatio-1,l*this._scaledCellWidth,window.devicePixelRatio)},w.prototype._fillLeftLineAtCell=function(f,u,l){this._ctx.fillRect(f*this._scaledCellWidth,u*this._scaledCellHeight,window.devicePixelRatio*l,this._scaledCellHeight)},w.prototype._strokeRectAtCell=function(f,u,l,c){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(f*this._scaledCellWidth+window.devicePixelRatio/2,u*this._scaledCellHeight+window.devicePixelRatio/2,l*this._scaledCellWidth-window.devicePixelRatio,c*this._scaledCellHeight-window.devicePixelRatio)},w.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))},w.prototype._clearCells=function(f,u,l,c){this._alpha?this._ctx.clearRect(f*this._scaledCellWidth,u*this._scaledCellHeight,l*this._scaledCellWidth,c*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(f*this._scaledCellWidth,u*this._scaledCellHeight,l*this._scaledCellWidth,c*this._scaledCellHeight))},w.prototype._fillCharTrueColor=function(f,u,l){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(l),this._ctx.fillText(f.getChars(),u*this._scaledCellWidth+this._scaledCharLeft,l*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},w.prototype._drawChars=function(f,u,l){var c,m,C=this._getContrastColor(f);C||f.isFgRGB()||f.isBgRGB()?this._drawUncachedChars(f,u,l,C):(f.isInverse()?(c=f.isBgDefault()?K.INVERTED_DEFAULT_COLOR:f.getBgColor(),m=f.isFgDefault()?K.INVERTED_DEFAULT_COLOR:f.getFgColor()):(m=f.isBgDefault()?N.DEFAULT_COLOR:f.getBgColor(),c=f.isFgDefault()?N.DEFAULT_COLOR:f.getFgColor()),c+=this._optionsService.options.drawBoldTextInBrightColors&&f.isBold()&&c<8?8:0,this._currentGlyphIdentifier.chars=f.getChars()||N.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=f.getCode()||N.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=m,this._currentGlyphIdentifier.fg=c,this._currentGlyphIdentifier.bold=!!f.isBold(),this._currentGlyphIdentifier.dim=!!f.isDim(),this._currentGlyphIdentifier.italic=!!f.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,u*this._scaledCellWidth+this._scaledCharLeft,l*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(f,u,l))},w.prototype._drawUncachedChars=function(f,u,l,c){if(this._ctx.save(),this._ctx.font=this._getFont(!!f.isBold(),!!f.isItalic()),this._ctx.textBaseline="middle",f.isInverse())if(c)this._ctx.fillStyle=c.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(c)this._ctx.fillStyle=c.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 C=f.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&f.isBold()&&C<8&&(C+=8),this._ctx.fillStyle=this._colors.ansi[C].css}this._clipRow(l),f.isDim()&&(this._ctx.globalAlpha=K.DIM_OPACITY),this._ctx.fillText(f.getChars(),u*this._scaledCellWidth+this._scaledCharLeft,l*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},w.prototype._clipRow=function(f){this._ctx.beginPath(),this._ctx.rect(0,f*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},w.prototype._getFont=function(f,u){return(u?"italic":"")+" "+(f?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},w.prototype._getContrastColor=function(f){if(this._optionsService.options.minimumContrastRatio!==1){var u=this._colors.contrastCache.getColor(f.bg,f.fg);if(u!==void 0)return u||void 0;var l=f.getFgColor(),c=f.getFgColorMode(),m=f.getBgColor(),C=f.getBgColorMode(),M=!!f.isInverse(),k=!!f.isInverse();if(M){var E=l;l=m,m=E;var T=c;c=C,C=T}var I=this._resolveBackgroundRgba(C,m,M),F=this._resolveForegroundRgba(c,l,M,k),H=U.rgba.ensureContrastRatio(I,F,this._optionsService.options.minimumContrastRatio);if(H){var W={css:U.channels.toCss(H>>24&255,H>>16&255,H>>8&255),rgba:H};return this._colors.contrastCache.setColor(f.bg,f.fg,W),W}this._colors.contrastCache.setColor(f.bg,f.fg,null)}},w.prototype._resolveBackgroundRgba=function(f,u,l){switch(f){case 16777216:case 33554432:return this._colors.ansi[u].rgba;case 50331648:return u<<8;case 0:default:return l?this._colors.foreground.rgba:this._colors.background.rgba}},w.prototype._resolveForegroundRgba=function(f,u,l,c){switch(f){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&c&&u<8&&(u+=8),this._colors.ansi[u].rgba;case 50331648:return u<<8;case 0:default:return l?this._colors.background.rgba:this._colors.foreground.rgba}},w}();y.BaseRenderLayer=s},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.createDecorator=y.getServiceDependencies=y.serviceRegistry=void 0;function N(K,P,A){P.di$target===P?P.di$dependencies.push({id:K,index:A}):(P.di$dependencies=[{id:K,index:A}],P.di$target=P)}y.serviceRegistry=new Map,y.getServiceDependencies=function(K){return K.di$dependencies||[]},y.createDecorator=function(K){if(y.serviceRegistry.has(K))return y.serviceRegistry.get(K);var P=function(A,d,U){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");N(P,A,U)};return P.toString=function(){return K},y.serviceRegistry.set(K,P),P}},function(ke,y,R){"use strict";function N(K,P,A,d){if(A===void 0&&(A=0),d===void 0&&(d=K.length),A>=K.length)return K;A=(K.length+A)%K.length,d=d>=K.length?K.length:(K.length+d)%K.length;for(var U=A;U<d;++U)K[U]=P;return K}Object.defineProperty(y,"__esModule",{value:!0}),y.concat=y.fillFallback=y.fill=void 0,y.fill=function(K,P,A,d){return K.fill?K.fill(P,A,d):N(K,P,A,d)},y.fillFallback=N,y.concat=function(K,P){var A=new K.constructor(K.length+P.length);return A.set(K),A.set(P,K.length),A}},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.BufferLine=y.DEFAULT_ATTR_DATA=void 0;var N=R(8),K=R(3),P=R(4),A=R(6);y.DEFAULT_ATTR_DATA=Object.freeze(new A.AttributeData);var d=function(){function U(S,s,w){w===void 0&&(w=!1),this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*S);for(var f=s||P.CellData.fromCharData([0,K.NULL_CELL_CHAR,K.NULL_CELL_WIDTH,K.NULL_CELL_CODE]),u=0;u<S;++u)this.setCell(u,f);this.length=S}return U.prototype.get=function(S){var s=this._data[3*S+0],w=2097151&s;return[this._data[3*S+1],2097152&s?this._combined[S]:w?N.stringFromCodePoint(w):"",s>>22,2097152&s?this._combined[S].charCodeAt(this._combined[S].length-1):w]},U.prototype.set=function(S,s){this._data[3*S+1]=s[K.CHAR_DATA_ATTR_INDEX],s[K.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[S]=s[1],this._data[3*S+0]=2097152|S|s[K.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*S+0]=s[K.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[K.CHAR_DATA_WIDTH_INDEX]<<22},U.prototype.getWidth=function(S){return this._data[3*S+0]>>22},U.prototype.hasWidth=function(S){return 12582912&this._data[3*S+0]},U.prototype.getFg=function(S){return this._data[3*S+1]},U.prototype.getBg=function(S){return this._data[3*S+2]},U.prototype.hasContent=function(S){return 4194303&this._data[3*S+0]},U.prototype.getCodePoint=function(S){var s=this._data[3*S+0];return 2097152&s?this._combined[S].charCodeAt(this._combined[S].length-1):2097151&s},U.prototype.isCombined=function(S){return 2097152&this._data[3*S+0]},U.prototype.getString=function(S){var s=this._data[3*S+0];return 2097152&s?this._combined[S]:2097151&s?N.stringFromCodePoint(2097151&s):""},U.prototype.loadCell=function(S,s){var w=3*S;return s.content=this._data[w+0],s.fg=this._data[w+1],s.bg=this._data[w+2],2097152&s.content&&(s.combinedData=this._combined[S]),268435456&s.bg&&(s.extended=this._extendedAttrs[S]),s},U.prototype.setCell=function(S,s){2097152&s.content&&(this._combined[S]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[S]=s.extended),this._data[3*S+0]=s.content,this._data[3*S+1]=s.fg,this._data[3*S+2]=s.bg},U.prototype.setCellFromCodePoint=function(S,s,w,f,u,l){268435456&u&&(this._extendedAttrs[S]=l),this._data[3*S+0]=s|w<<22,this._data[3*S+1]=f,this._data[3*S+2]=u},U.prototype.addCodepointToCell=function(S,s){var w=this._data[3*S+0];2097152&w?this._combined[S]+=N.stringFromCodePoint(s):(2097151&w?(this._combined[S]=N.stringFromCodePoint(2097151&w)+N.stringFromCodePoint(s),w&=-2097152,w|=2097152):w=s|1<<22,this._data[3*S+0]=w)},U.prototype.insertCells=function(S,s,w,f){if((S%=this.length)&&this.getWidth(S-1)===2&&this.setCellFromCodePoint(S-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),s<this.length-S){for(var u=new P.CellData,l=this.length-S-s-1;l>=0;--l)this.setCell(S+s+l,this.loadCell(S+l,u));for(l=0;l<s;++l)this.setCell(S+l,w)}else for(l=S;l<this.length;++l)this.setCell(l,w);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(S,s,w,f){if(S%=this.length,s<this.length-S){for(var u=new P.CellData,l=0;l<this.length-S-s;++l)this.setCell(S+l,this.loadCell(S+s+l,u));for(l=this.length-s;l<this.length;++l)this.setCell(l,w)}else for(l=S;l<this.length;++l)this.setCell(l,w);S&&this.getWidth(S-1)===2&&this.setCellFromCodePoint(S-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(S)!==0||this.hasContent(S)||this.setCellFromCodePoint(S,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(S,s,w,f){for(S&&this.getWidth(S-1)===2&&this.setCellFromCodePoint(S-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),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodePoint(s,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);S<s&&S<this.length;)this.setCell(S++,w)},U.prototype.resize=function(S,s){if(S!==this.length){if(S>this.length){var w=new Uint32Array(3*S);this.length&&(3*S<this._data.length?w.set(this._data.subarray(0,3*S)):w.set(this._data)),this._data=w;for(var f=this.length;f<S;++f)this.setCell(f,s)}else if(S){(w=new Uint32Array(3*S)).set(this._data.subarray(0,3*S)),this._data=w;var u=Object.keys(this._combined);for(f=0;f<u.length;f++){var l=parseInt(u[f],10);l>=S&&delete this._combined[l]}}else this._data=new Uint32Array(0),this._combined={};this.length=S}},U.prototype.fill=function(S){this._combined={},this._extendedAttrs={};for(var s=0;s<this.length;++s)this.setCell(s,S)},U.prototype.copyFrom=function(S){for(var s in this.length!==S.length?this._data=new Uint32Array(S._data):this._data.set(S._data),this.length=S.length,this._combined={},S._combined)this._combined[s]=S._combined[s];for(var s in this._extendedAttrs={},S._extendedAttrs)this._extendedAttrs[s]=S._extendedAttrs[s];this.isWrapped=S.isWrapped},U.prototype.clone=function(){var S=new U(0);for(var s in S._data=new Uint32Array(this._data),S.length=this.length,this._combined)S._combined[s]=this._combined[s];for(var s in this._extendedAttrs)S._extendedAttrs[s]=this._extendedAttrs[s];return S.isWrapped=this.isWrapped,S},U.prototype.getTrimmedLength=function(){for(var S=this.length-1;S>=0;--S)if(4194303&this._data[3*S+0])return S+(this._data[3*S+0]>>22);return 0},U.prototype.copyCellsFrom=function(S,s,w,f,u){var l=S._data;if(u)for(var c=f-1;c>=0;c--)for(var m=0;m<3;m++)this._data[3*(w+c)+m]=l[3*(s+c)+m];else for(c=0;c<f;c++)for(m=0;m<3;m++)this._data[3*(w+c)+m]=l[3*(s+c)+m];var C=Object.keys(S._combined);for(m=0;m<C.length;m++){var M=parseInt(C[m],10);M>=s&&(this._combined[M-s+w]=S._combined[M])}},U.prototype.translateToString=function(S,s,w){S===void 0&&(S=!1),s===void 0&&(s=0),w===void 0&&(w=this.length),S&&(w=Math.min(w,this.getTrimmedLength()));for(var f="";s<w;){var u=this._data[3*s+0],l=2097151&u;f+=2097152&u?this._combined[s]:l?N.stringFromCodePoint(l):K.WHITESPACE_CELL_CHAR,s+=u>>22||1}return f},U}();y.BufferLine=d},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.removeElementFromParent=void 0,y.removeElementFromParent=function(){for(var N,K=[],P=0;P<arguments.length;P++)K[P]=arguments[P];for(var A=0,d=K;A<d.length;A++){var U=d[A];(N=U==null?void 0:U.parentElement)===null||N===void 0||N.removeChild(U)}}},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.tooMuchOutput=y.promptLabel=void 0,y.promptLabel="Terminal input",y.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(F,H){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(W,z){W.__proto__=z}||function(W,z){for(var ie in z)z.hasOwnProperty(ie)&&(W[ie]=z[ie])})(F,H)},function(F,H){function W(){this.constructor=F}N(F,H),F.prototype=H===null?Object.create(H):(W.prototype=H.prototype,new W)});Object.defineProperty(y,"__esModule",{value:!0}),y.InputHandler=y.WindowsOptionsReportType=void 0;var P,A=R(12),d=R(20),U=R(39),S=R(2),s=R(15),w=R(8),f=R(16),u=R(0),l=R(3),c=R(4),m=R(6),C=R(22),M=R(24),k={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function E(F,H){if(F>24)return H.setWinLines||!1;switch(F){case 1:return!!H.restoreWin;case 2:return!!H.minimizeWin;case 3:return!!H.setWinPosition;case 4:return!!H.setWinSizePixels;case 5:return!!H.raiseWin;case 6:return!!H.lowerWin;case 7:return!!H.refreshWin;case 8:return!!H.setWinSizeChars;case 9:return!!H.maximizeWin;case 10:return!!H.fullscreenWin;case 11:return!!H.getWinState;case 13:return!!H.getWinPosition;case 14:return!!H.getWinSizePixels;case 15:return!!H.getScreenSizePixels;case 16:return!!H.getCellSizePixels;case 18:return!!H.getWinSizeChars;case 19:return!!H.getScreenSizeChars;case 20:return!!H.getIconTitle;case 21:return!!H.getWinTitle;case 22:return!!H.pushTitle;case 23:return!!H.popTitle;case 24:return!!H.setWinLines}return!1}(function(F){F[F.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",F[F.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P=y.WindowsOptionsReportType||(y.WindowsOptionsReportType={}));var T=function(){function F(H,W,z,ie){this._bufferService=H,this._coreService=W,this._logService=z,this._optionsService=ie,this._data=new Uint32Array(0)}return F.prototype.hook=function(H){this._data=new Uint32Array(0)},F.prototype.put=function(H,W,z){this._data=s.concat(this._data,H.subarray(W,z))},F.prototype.unhook=function(H){if(H){var W=w.utf32ToString(this._data);switch(this._data=new Uint32Array(0),W){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",W),this._coreService.triggerDataEvent(A.C0.ESC+"P0$r"+A.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},F}(),I=function(F){function H(W,z,ie,re,_e,Ae,ce,J,ae){ae===void 0&&(ae=new U.EscapeSequenceParser);var G=F.call(this)||this;G._bufferService=W,G._charsetService=z,G._coreService=ie,G._dirtyRowService=re,G._logService=_e,G._optionsService=Ae,G._coreMouseService=ce,G._unicodeService=J,G._parser=ae,G._parseBuffer=new Uint32Array(4096),G._stringDecoder=new w.StringToUtf32,G._utf8Decoder=new w.Utf8ToUtf32,G._workCell=new c.CellData,G._windowTitle="",G._iconName="",G._windowTitleStack=[],G._iconNameStack=[],G._curAttrData=f.DEFAULT_ATTR_DATA.clone(),G._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone(),G._onRequestBell=new u.EventEmitter,G._onRequestRefreshRows=new u.EventEmitter,G._onRequestReset=new u.EventEmitter,G._onRequestScroll=new u.EventEmitter,G._onRequestSyncScrollBar=new u.EventEmitter,G._onRequestWindowsOptionsReport=new u.EventEmitter,G._onA11yChar=new u.EventEmitter,G._onA11yTab=new u.EventEmitter,G._onCursorMove=new u.EventEmitter,G._onLineFeed=new u.EventEmitter,G._onScroll=new u.EventEmitter,G._onTitleChange=new u.EventEmitter,G.register(G._parser),G._parser.setCsiHandlerFallback(function(O,ne){G._logService.debug("Unknown CSI code: ",{identifier:G._parser.identToString(O),params:ne.toArray()})}),G._parser.setEscHandlerFallback(function(O){G._logService.debug("Unknown ESC code: ",{identifier:G._parser.identToString(O)})}),G._parser.setExecuteHandlerFallback(function(O){G._logService.debug("Unknown EXECUTE code: ",{code:O})}),G._parser.setOscHandlerFallback(function(O,ne,me){G._logService.debug("Unknown OSC code: ",{identifier:O,action:ne,data:me})}),G._parser.setDcsHandlerFallback(function(O,ne,me){ne==="HOOK"&&(me=me.toArray()),G._logService.debug("Unknown DCS code: ",{identifier:G._parser.identToString(O),action:ne,payload:me})}),G._parser.setPrintHandler(function(O,ne,me){return G.print(O,ne,me)}),G._parser.setCsiHandler({final:"@"},function(O){return G.insertChars(O)}),G._parser.setCsiHandler({intermediates:" ",final:"@"},function(O){return G.scrollLeft(O)}),G._parser.setCsiHandler({final:"A"},function(O){return G.cursorUp(O)}),G._parser.setCsiHandler({intermediates:" ",final:"A"},function(O){return G.scrollRight(O)}),G._parser.setCsiHandler({final:"B"},function(O){return G.cursorDown(O)}),G._parser.setCsiHandler({final:"C"},function(O){return G.cursorForward(O)}),G._parser.setCsiHandler({final:"D"},function(O){return G.cursorBackward(O)}),G._parser.setCsiHandler({final:"E"},function(O){return G.cursorNextLine(O)}),G._parser.setCsiHandler({final:"F"},function(O){return G.cursorPrecedingLine(O)}),G._parser.setCsiHandler({final:"G"},function(O){return G.cursorCharAbsolute(O)}),G._parser.setCsiHandler({final:"H"},function(O){return G.cursorPosition(O)}),G._parser.setCsiHandler({final:"I"},function(O){return G.cursorForwardTab(O)}),G._parser.setCsiHandler({final:"J"},function(O){return G.eraseInDisplay(O)}),G._parser.setCsiHandler({prefix:"?",final:"J"},function(O){return G.eraseInDisplay(O)}),G._parser.setCsiHandler({final:"K"},function(O){return G.eraseInLine(O)}),G._parser.setCsiHandler({prefix:"?",final:"K"},function(O){return G.eraseInLine(O)}),G._parser.setCsiHandler({final:"L"},function(O){return G.insertLines(O)}),G._parser.setCsiHandler({final:"M"},function(O){return G.deleteLines(O)}),G._parser.setCsiHandler({final:"P"},function(O){return G.deleteChars(O)}),G._parser.setCsiHandler({final:"S"},function(O){return G.scrollUp(O)}),G._parser.setCsiHandler({final:"T"},function(O){return G.scrollDown(O)}),G._parser.setCsiHandler({final:"X"},function(O){return G.eraseChars(O)}),G._parser.setCsiHandler({final:"Z"},function(O){return G.cursorBackwardTab(O)}),G._parser.setCsiHandler({final:"`"},function(O){return G.charPosAbsolute(O)}),G._parser.setCsiHandler({final:"a"},function(O){return G.hPositionRelative(O)}),G._parser.setCsiHandler({final:"b"},function(O){return G.repeatPrecedingCharacter(O)}),G._parser.setCsiHandler({final:"c"},function(O){return G.sendDeviceAttributesPrimary(O)}),G._parser.setCsiHandler({prefix:">",final:"c"},function(O){return G.sendDeviceAttributesSecondary(O)}),G._parser.setCsiHandler({final:"d"},function(O){return G.linePosAbsolute(O)}),G._parser.setCsiHandler({final:"e"},function(O){return G.vPositionRelative(O)}),G._parser.setCsiHandler({final:"f"},function(O){return G.hVPosition(O)}),G._parser.setCsiHandler({final:"g"},function(O){return G.tabClear(O)}),G._parser.setCsiHandler({final:"h"},function(O){return G.setMode(O)}),G._parser.setCsiHandler({prefix:"?",final:"h"},function(O){return G.setModePrivate(O)}),G._parser.setCsiHandler({final:"l"},function(O){return G.resetMode(O)}),G._parser.setCsiHandler({prefix:"?",final:"l"},function(O){return G.resetModePrivate(O)}),G._parser.setCsiHandler({final:"m"},function(O){return G.charAttributes(O)}),G._parser.setCsiHandler({final:"n"},function(O){return G.deviceStatus(O)}),G._parser.setCsiHandler({prefix:"?",final:"n"},function(O){return G.deviceStatusPrivate(O)}),G._parser.setCsiHandler({intermediates:"!",final:"p"},function(O){return G.softReset(O)}),G._parser.setCsiHandler({intermediates:" ",final:"q"},function(O){return G.setCursorStyle(O)}),G._parser.setCsiHandler({final:"r"},function(O){return G.setScrollRegion(O)}),G._parser.setCsiHandler({final:"s"},function(O){return G.saveCursor(O)}),G._parser.setCsiHandler({final:"t"},function(O){return G.windowOptions(O)}),G._parser.setCsiHandler({final:"u"},function(O){return G.restoreCursor(O)}),G._parser.setCsiHandler({intermediates:"'",final:"}"},function(O){return G.insertColumns(O)}),G._parser.setCsiHandler({intermediates:"'",final:"~"},function(O){return G.deleteColumns(O)}),G._parser.setExecuteHandler(A.C0.BEL,function(){return G.bell()}),G._parser.setExecuteHandler(A.C0.LF,function(){return G.lineFeed()}),G._parser.setExecuteHandler(A.C0.VT,function(){return G.lineFeed()}),G._parser.setExecuteHandler(A.C0.FF,function(){return G.lineFeed()}),G._parser.setExecuteHandler(A.C0.CR,function(){return G.carriageReturn()}),G._parser.setExecuteHandler(A.C0.BS,function(){return G.backspace()}),G._parser.setExecuteHandler(A.C0.HT,function(){return G.tab()}),G._parser.setExecuteHandler(A.C0.SO,function(){return G.shiftOut()}),G._parser.setExecuteHandler(A.C0.SI,function(){return G.shiftIn()}),G._parser.setExecuteHandler(A.C1.IND,function(){return G.index()}),G._parser.setExecuteHandler(A.C1.NEL,function(){return G.nextLine()}),G._parser.setExecuteHandler(A.C1.HTS,function(){return G.tabSet()}),G._parser.setOscHandler(0,new C.OscHandler(function(O){G.setTitle(O),G.setIconName(O)})),G._parser.setOscHandler(1,new C.OscHandler(function(O){return G.setIconName(O)})),G._parser.setOscHandler(2,new C.OscHandler(function(O){return G.setTitle(O)})),G._parser.setEscHandler({final:"7"},function(){return G.saveCursor()}),G._parser.setEscHandler({final:"8"},function(){return G.restoreCursor()}),G._parser.setEscHandler({final:"D"},function(){return G.index()}),G._parser.setEscHandler({final:"E"},function(){return G.nextLine()}),G._parser.setEscHandler({final:"H"},function(){return G.tabSet()}),G._parser.setEscHandler({final:"M"},function(){return G.reverseIndex()}),G._parser.setEscHandler({final:"="},function(){return G.keypadApplicationMode()}),G._parser.setEscHandler({final:">"},function(){return G.keypadNumericMode()}),G._parser.setEscHandler({final:"c"},function(){return G.fullReset()}),G._parser.setEscHandler({final:"n"},function(){return G.setgLevel(2)}),G._parser.setEscHandler({final:"o"},function(){return G.setgLevel(3)}),G._parser.setEscHandler({final:"|"},function(){return G.setgLevel(3)}),G._parser.setEscHandler({final:"}"},function(){return G.setgLevel(2)}),G._parser.setEscHandler({final:"~"},function(){return G.setgLevel(1)}),G._parser.setEscHandler({intermediates:"%",final:"@"},function(){return G.selectDefaultCharset()}),G._parser.setEscHandler({intermediates:"%",final:"G"},function(){return G.selectDefaultCharset()});var X=function(O){Z._parser.setEscHandler({intermediates:"(",final:O},function(){return G.selectCharset("("+O)}),Z._parser.setEscHandler({intermediates:")",final:O},function(){return G.selectCharset(")"+O)}),Z._parser.setEscHandler({intermediates:"*",final:O},function(){return G.selectCharset("*"+O)}),Z._parser.setEscHandler({intermediates:"+",final:O},function(){return G.selectCharset("+"+O)}),Z._parser.setEscHandler({intermediates:"-",final:O},function(){return G.selectCharset("-"+O)}),Z._parser.setEscHandler({intermediates:".",final:O},function(){return G.selectCharset("."+O)}),Z._parser.setEscHandler({intermediates:"/",final:O},function(){return G.selectCharset("/"+O)})},Z=this;for(var B in d.CHARSETS)X(B);return G._parser.setEscHandler({intermediates:"#",final:"8"},function(){return G.screenAlignmentPattern()}),G._parser.setErrorHandler(function(O){return G._logService.error("Parsing error: ",O),O}),G._parser.setDcsHandler({intermediates:"$",final:"q"},new T(G._bufferService,G._coreService,G._logService,G._optionsService)),G}return K(H,F),Object.defineProperty(H.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),H.prototype.dispose=function(){F.prototype.dispose.call(this)},H.prototype.parse=function(W){var z=this._bufferService.buffer,ie=z.x,re=z.y;if(this._logService.debug("parsing data",W),this._parseBuffer.length<W.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(W.length,131072))),this._dirtyRowService.clearRange(),W.length>131072)for(var _e=0;_e<W.length;_e+=131072){var Ae=_e+131072<W.length?_e+131072:W.length,ce=typeof W=="string"?this._stringDecoder.decode(W.substring(_e,Ae),this._parseBuffer):this._utf8Decoder.decode(W.subarray(_e,Ae),this._parseBuffer);this._parser.parse(this._parseBuffer,ce)}else ce=typeof W=="string"?this._stringDecoder.decode(W,this._parseBuffer):this._utf8Decoder.decode(W,this._parseBuffer),this._parser.parse(this._parseBuffer,ce);(z=this._bufferService.buffer).x===ie&&z.y===re||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},H.prototype.print=function(W,z,ie){var re,_e,Ae=this._bufferService.buffer,ce=this._charsetService.charset,J=this._optionsService.options.screenReaderMode,ae=this._bufferService.cols,G=this._coreService.decPrivateModes.wraparound,X=this._coreService.modes.insertMode,Z=this._curAttrData,B=Ae.lines.get(Ae.ybase+Ae.y);this._dirtyRowService.markDirty(Ae.y),Ae.x&&ie-z>0&&B.getWidth(Ae.x-1)===2&&B.setCellFromCodePoint(Ae.x-1,0,1,Z.fg,Z.bg,Z.extended);for(var O=z;O<ie;++O){if(re=W[O],_e=this._unicodeService.wcwidth(re),re<127&&ce){var ne=ce[String.fromCharCode(re)];ne&&(re=ne.charCodeAt(0))}if(J&&this._onA11yChar.fire(w.stringFromCodePoint(re)),_e||!Ae.x){if(Ae.x+_e-1>=ae){if(G){for(;Ae.x<ae;)B.setCellFromCodePoint(Ae.x++,0,1,Z.fg,Z.bg,Z.extended);Ae.x=0,Ae.y++,Ae.y===Ae.scrollBottom+1?(Ae.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(Ae.y>=this._bufferService.rows&&(Ae.y=this._bufferService.rows-1),Ae.lines.get(Ae.ybase+Ae.y).isWrapped=!0),B=Ae.lines.get(Ae.ybase+Ae.y)}else if(Ae.x=ae-1,_e===2)continue}if(X&&(B.insertCells(Ae.x,_e,Ae.getNullCell(Z),Z),B.getWidth(ae-1)===2&&B.setCellFromCodePoint(ae-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,Z.fg,Z.bg,Z.extended)),B.setCellFromCodePoint(Ae.x++,re,_e,Z.fg,Z.bg,Z.extended),_e>0)for(;--_e;)B.setCellFromCodePoint(Ae.x++,0,0,Z.fg,Z.bg,Z.extended)}else B.getWidth(Ae.x-1)?B.addCodepointToCell(Ae.x-1,re):B.addCodepointToCell(Ae.x-2,re)}ie-z>0&&(B.loadCell(Ae.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),Ae.x<ae&&ie-z>0&&B.getWidth(Ae.x)===0&&!B.hasContent(Ae.x)&&B.setCellFromCodePoint(Ae.x,0,1,Z.fg,Z.bg,Z.extended),this._dirtyRowService.markDirty(Ae.y)},H.prototype.addCsiHandler=function(W,z){var ie=this;return W.final!=="t"||W.prefix||W.intermediates?this._parser.addCsiHandler(W,z):this._parser.addCsiHandler(W,function(re){return!E(re.params[0],ie._optionsService.options.windowOptions)||z(re)})},H.prototype.addDcsHandler=function(W,z){return this._parser.addDcsHandler(W,new M.DcsHandler(z))},H.prototype.addEscHandler=function(W,z){return this._parser.addEscHandler(W,z)},H.prototype.addOscHandler=function(W,z){return this._parser.addOscHandler(W,new C.OscHandler(z))},H.prototype.bell=function(){this._onRequestBell.fire()},H.prototype.lineFeed=function(){var W=this._bufferService.buffer;this._dirtyRowService.markDirty(W.y),this._optionsService.options.convertEol&&(W.x=0),W.y++,W.y===W.scrollBottom+1?(W.y--,this._onRequestScroll.fire(this._eraseAttrData())):W.y>=this._bufferService.rows&&(W.y=this._bufferService.rows-1),W.x>=this._bufferService.cols&&W.x--,this._dirtyRowService.markDirty(W.y),this._onLineFeed.fire()},H.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},H.prototype.backspace=function(){var W,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&&(!((W=z.lines.get(z.ybase+z.y))===null||W===void 0)&&W.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()},H.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var W=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-W)}},H.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},H.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},H.prototype._restrictCursor=function(W){W===void 0&&(W=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(W,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)},H.prototype._setCursor=function(W,z){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=W,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+z):(this._bufferService.buffer.x=W,this._bufferService.buffer.y=z),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},H.prototype._moveCursor=function(W,z){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+W,this._bufferService.buffer.y+z)},H.prototype.cursorUp=function(W){var z=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;z>=0?this._moveCursor(0,-Math.min(z,W.params[0]||1)):this._moveCursor(0,-(W.params[0]||1))},H.prototype.cursorDown=function(W){var z=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;z>=0?this._moveCursor(0,Math.min(z,W.params[0]||1)):this._moveCursor(0,W.params[0]||1)},H.prototype.cursorForward=function(W){this._moveCursor(W.params[0]||1,0)},H.prototype.cursorBackward=function(W){this._moveCursor(-(W.params[0]||1),0)},H.prototype.cursorNextLine=function(W){this.cursorDown(W),this._bufferService.buffer.x=0},H.prototype.cursorPrecedingLine=function(W){this.cursorUp(W),this._bufferService.buffer.x=0},H.prototype.cursorCharAbsolute=function(W){this._setCursor((W.params[0]||1)-1,this._bufferService.buffer.y)},H.prototype.cursorPosition=function(W){this._setCursor(W.length>=2?(W.params[1]||1)-1:0,(W.params[0]||1)-1)},H.prototype.charPosAbsolute=function(W){this._setCursor((W.params[0]||1)-1,this._bufferService.buffer.y)},H.prototype.hPositionRelative=function(W){this._moveCursor(W.params[0]||1,0)},H.prototype.linePosAbsolute=function(W){this._setCursor(this._bufferService.buffer.x,(W.params[0]||1)-1)},H.prototype.vPositionRelative=function(W){this._moveCursor(0,W.params[0]||1)},H.prototype.hVPosition=function(W){this.cursorPosition(W)},H.prototype.tabClear=function(W){var z=W.params[0];z===0?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:z===3&&(this._bufferService.buffer.tabs={})},H.prototype.cursorForwardTab=function(W){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var z=W.params[0]||1;z--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},H.prototype.cursorBackwardTab=function(W){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var z=W.params[0]||1,ie=this._bufferService.buffer;z--;)ie.x=ie.prevStop()},H.prototype._eraseInBufferLine=function(W,z,ie,re){re===void 0&&(re=!1);var _e=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+W);_e.replaceCells(z,ie,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),re&&(_e.isWrapped=!1)},H.prototype._resetBufferLine=function(W){var z=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+W);z.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1},H.prototype.eraseInDisplay=function(W){var z;switch(this._restrictCursor(),W.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))}},H.prototype.eraseInLine=function(W){switch(this._restrictCursor(),W.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)},H.prototype.insertLines=function(W){this._restrictCursor();var z=W.params[0]||1,ie=this._bufferService.buffer;if(!(ie.y>ie.scrollBottom||ie.y<ie.scrollTop)){for(var re=ie.ybase+ie.y,_e=this._bufferService.rows-1-ie.scrollBottom,Ae=this._bufferService.rows-1+ie.ybase-_e+1;z--;)ie.lines.splice(Ae-1,1),ie.lines.splice(re,0,ie.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(ie.y,ie.scrollBottom),ie.x=0}},H.prototype.deleteLines=function(W){this._restrictCursor();var z=W.params[0]||1,ie=this._bufferService.buffer;if(!(ie.y>ie.scrollBottom||ie.y<ie.scrollTop)){var re,_e=ie.ybase+ie.y;for(re=this._bufferService.rows-1-ie.scrollBottom,re=this._bufferService.rows-1+ie.ybase-re;z--;)ie.lines.splice(_e,1),ie.lines.splice(re,0,ie.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(ie.y,ie.scrollBottom),ie.x=0}},H.prototype.insertChars=function(W){this._restrictCursor();var z=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);z&&(z.insertCells(this._bufferService.buffer.x,W.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},H.prototype.deleteChars=function(W){this._restrictCursor();var z=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);z&&(z.deleteCells(this._bufferService.buffer.x,W.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},H.prototype.scrollUp=function(W){for(var z=W.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)},H.prototype.scrollDown=function(W){for(var z=W.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)},H.prototype.scrollLeft=function(W){var z=this._bufferService.buffer;if(!(z.y>z.scrollBottom||z.y<z.scrollTop)){for(var ie=W.params[0]||1,re=z.scrollTop;re<=z.scrollBottom;++re){var _e=z.lines.get(z.ybase+re);_e.deleteCells(0,ie,z.getNullCell(this._eraseAttrData()),this._eraseAttrData()),_e.isWrapped=!1}this._dirtyRowService.markRangeDirty(z.scrollTop,z.scrollBottom)}},H.prototype.scrollRight=function(W){var z=this._bufferService.buffer;if(!(z.y>z.scrollBottom||z.y<z.scrollTop)){for(var ie=W.params[0]||1,re=z.scrollTop;re<=z.scrollBottom;++re){var _e=z.lines.get(z.ybase+re);_e.insertCells(0,ie,z.getNullCell(this._eraseAttrData()),this._eraseAttrData()),_e.isWrapped=!1}this._dirtyRowService.markRangeDirty(z.scrollTop,z.scrollBottom)}},H.prototype.insertColumns=function(W){var z=this._bufferService.buffer;if(!(z.y>z.scrollBottom||z.y<z.scrollTop)){for(var ie=W.params[0]||1,re=z.scrollTop;re<=z.scrollBottom;++re){var _e=this._bufferService.buffer.lines.get(z.ybase+re);_e.insertCells(z.x,ie,z.getNullCell(this._eraseAttrData()),this._eraseAttrData()),_e.isWrapped=!1}this._dirtyRowService.markRangeDirty(z.scrollTop,z.scrollBottom)}},H.prototype.deleteColumns=function(W){var z=this._bufferService.buffer;if(!(z.y>z.scrollBottom||z.y<z.scrollTop)){for(var ie=W.params[0]||1,re=z.scrollTop;re<=z.scrollBottom;++re){var _e=z.lines.get(z.ybase+re);_e.deleteCells(z.x,ie,z.getNullCell(this._eraseAttrData()),this._eraseAttrData()),_e.isWrapped=!1}this._dirtyRowService.markRangeDirty(z.scrollTop,z.scrollBottom)}},H.prototype.eraseChars=function(W){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+(W.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},H.prototype.repeatPrecedingCharacter=function(W){if(this._parser.precedingCodepoint){for(var z=W.params[0]||1,ie=new Uint32Array(z),re=0;re<z;++re)ie[re]=this._parser.precedingCodepoint;this.print(ie,0,ie.length)}},H.prototype.sendDeviceAttributesPrimary=function(W){W.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"))},H.prototype.sendDeviceAttributesSecondary=function(W){W.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(W.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(A.C0.ESC+"[>83;40003;0c"))},H.prototype._is=function(W){return(this._optionsService.options.termName+"").indexOf(W)===0},H.prototype.setMode=function(W){for(var z=0;z<W.length;z++)switch(W.params[z]){case 4:this._coreService.modes.insertMode=!0}},H.prototype.setModePrivate=function(W){for(var z=0;z<W.length;z++)switch(W.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}},H.prototype.resetMode=function(W){for(var z=0;z<W.length;z++)switch(W.params[z]){case 4:this._coreService.modes.insertMode=!1}},H.prototype.resetModePrivate=function(W){for(var z=0;z<W.length;z++)switch(W.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(),W.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}},H.prototype._updateAttrColor=function(W,z,ie,re,_e){return z===2?(W|=50331648,W&=-16777216,W|=m.AttributeData.fromColorRGB([ie,re,_e])):z===5&&(W&=-50331904,W|=33554432|255&ie),W},H.prototype._extractColor=function(W,z,ie){var re=[0,0,-1,0,0,0],_e=0,Ae=0;do{if(re[Ae+_e]=W.params[z+Ae],W.hasSubParams(z+Ae)){var ce=W.getSubParams(z+Ae),J=0;do re[1]===5&&(_e=1),re[Ae+J+1+_e]=ce[J];while(++J<ce.length&&J+Ae+1+_e<re.length);break}if(re[1]===5&&Ae+_e>=2||re[1]===2&&Ae+_e>=5)break;re[1]&&(_e=1)}while(++Ae+z<W.length&&Ae+_e<re.length);for(J=2;J<re.length;++J)re[J]===-1&&(re[J]=0);switch(re[0]){case 38:ie.fg=this._updateAttrColor(ie.fg,re[1],re[3],re[4],re[5]);break;case 48:ie.bg=this._updateAttrColor(ie.bg,re[1],re[3],re[4],re[5]);break;case 58:ie.extended=ie.extended.clone(),ie.extended.underlineColor=this._updateAttrColor(ie.extended.underlineColor,re[1],re[3],re[4],re[5])}return Ae},H.prototype._processUnderline=function(W,z){z.extended=z.extended.clone(),(!~W||W>5)&&(W=1),z.extended.underlineStyle=W,z.fg|=268435456,W===0&&(z.fg&=-268435457),z.updateExtended()},H.prototype.charAttributes=function(W){if(W.length===1&&W.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=W.length,re=this._curAttrData,_e=0;_e<ie;_e++)(z=W.params[_e])>=30&&z<=37?(re.fg&=-50331904,re.fg|=16777216|z-30):z>=40&&z<=47?(re.bg&=-50331904,re.bg|=16777216|z-40):z>=90&&z<=97?(re.fg&=-50331904,re.fg|=16777224|z-90):z>=100&&z<=107?(re.bg&=-50331904,re.bg|=16777224|z-100):z===0?(re.fg=f.DEFAULT_ATTR_DATA.fg,re.bg=f.DEFAULT_ATTR_DATA.bg):z===1?re.fg|=134217728:z===3?re.bg|=67108864:z===4?(re.fg|=268435456,this._processUnderline(W.hasSubParams(_e)?W.getSubParams(_e)[0]:1,re)):z===5?re.fg|=536870912:z===7?re.fg|=67108864:z===8?re.fg|=1073741824:z===2?re.bg|=134217728:z===21?this._processUnderline(2,re):z===22?(re.fg&=-134217729,re.bg&=-134217729):z===23?re.bg&=-67108865:z===24?re.fg&=-268435457:z===25?re.fg&=-536870913:z===27?re.fg&=-67108865:z===28?re.fg&=-1073741825:z===39?(re.fg&=-67108864,re.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):z===49?(re.bg&=-67108864,re.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):z===38||z===48||z===58?_e+=this._extractColor(W,_e,re):z===59?(re.extended=re.extended.clone(),re.extended.underlineColor=-1,re.updateExtended()):z===100?(re.fg&=-67108864,re.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,re.bg&=-67108864,re.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",z)},H.prototype.deviceStatus=function(W){switch(W.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")}},H.prototype.deviceStatusPrivate=function(W){switch(W.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")}},H.prototype.softReset=function(W){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},H.prototype.setCursorStyle=function(W){var z=W.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},H.prototype.setScrollRegion=function(W){var z,ie=W.params[0]||1;(W.length<2||(z=W.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))},H.prototype.windowOptions=function(W){if(E(W.params[0],this._optionsService.options.windowOptions)){var z=W.length>1?W.params[1]:0;switch(W.params[0]){case 14:z!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.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())}}},H.prototype.saveCursor=function(W){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},H.prototype.restoreCursor=function(W){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()},H.prototype.setTitle=function(W){this._windowTitle=W,this._onTitleChange.fire(W)},H.prototype.setIconName=function(W){this._iconName=W},H.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},H.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},H.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},H.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,d.DEFAULT_CHARSET)},H.prototype.selectCharset=function(W){W.length===2?W[0]!=="/"&&this._charsetService.setgCharset(k[W[0]],d.CHARSETS[W[1]]||d.DEFAULT_CHARSET):this.selectDefaultCharset()},H.prototype.index=function(){this._restrictCursor();var W=this._bufferService.buffer;this._bufferService.buffer.y++,W.y===W.scrollBottom+1?(W.y--,this._onRequestScroll.fire(this._eraseAttrData())):W.y>=this._bufferService.rows&&(W.y=this._bufferService.rows-1),this._restrictCursor()},H.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},H.prototype.reverseIndex=function(){this._restrictCursor();var W=this._bufferService.buffer;if(W.y===W.scrollTop){var z=W.scrollBottom-W.scrollTop;W.lines.shiftElements(W.ybase+W.y,z,1),W.lines.set(W.ybase+W.y,W.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(W.scrollTop,W.scrollBottom)}else W.y--,this._restrictCursor()},H.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},H.prototype.reset=function(){this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone()},H.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},H.prototype.setgLevel=function(W){this._charsetService.setgLevel(W)},H.prototype.screenAlignmentPattern=function(){var W=new c.CellData;W.content=1<<22|69,W.fg=this._curAttrData.fg,W.bg=this._curAttrData.bg;var z=this._bufferService.buffer;this._setCursor(0,0);for(var ie=0;ie<this._bufferService.rows;++ie){var re=z.ybase+z.y+ie,_e=z.lines.get(re);_e&&(_e.fill(W),_e.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},H}(S.Disposable);y.InputHandler=I},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.DEFAULT_CHARSET=y.CHARSETS=void 0,y.CHARSETS={},y.DEFAULT_CHARSET=y.CHARSETS.B,y.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"},y.CHARSETS.A={"#":"\xA3"},y.CHARSETS.B=void 0,y.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},y.CHARSETS.C=y.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},y.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},y.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},y.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},y.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},y.CHARSETS.E=y.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},y.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},y.CHARSETS.H=y.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},y.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.Params=void 0;var N=function(){function K(P,A){if(P===void 0&&(P=32),A===void 0&&(A=32),this.maxLength=P,this.maxSubParamsLength=A,A>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(P),this.length=0,this._subParams=new Int32Array(A),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(P),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return K.fromArray=function(P){var A=new K;if(!P.length)return A;for(var d=P[0]instanceof Array?1:0;d<P.length;++d){var U=P[d];if(U instanceof Array)for(var S=0;S<U.length;++S)A.addSubParam(U[S]);else A.addParam(U)}return A},K.prototype.clone=function(){var P=new K(this.maxLength,this.maxSubParamsLength);return P.params.set(this.params),P.length=this.length,P._subParams.set(this._subParams),P._subParamsLength=this._subParamsLength,P._subParamsIdx.set(this._subParamsIdx),P._rejectDigits=this._rejectDigits,P._rejectSubDigits=this._rejectSubDigits,P._digitIsSub=this._digitIsSub,P},K.prototype.toArray=function(){for(var P=[],A=0;A<this.length;++A){P.push(this.params[A]);var d=this._subParamsIdx[A]>>8,U=255&this._subParamsIdx[A];U-d>0&&P.push(Array.prototype.slice.call(this._subParams,d,U))}return P},K.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},K.prototype.addParam=function(P){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(P<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=P>2147483647?2147483647:P}},K.prototype.addSubParam=function(P){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(P<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=P>2147483647?2147483647:P,this._subParamsIdx[this.length-1]++}},K.prototype.hasSubParams=function(P){return(255&this._subParamsIdx[P])-(this._subParamsIdx[P]>>8)>0},K.prototype.getSubParams=function(P){var A=this._subParamsIdx[P]>>8,d=255&this._subParamsIdx[P];return d-A>0?this._subParams.subarray(A,d):null},K.prototype.getSubParamsAll=function(){for(var P={},A=0;A<this.length;++A){var d=this._subParamsIdx[A]>>8,U=255&this._subParamsIdx[A];U-d>0&&(P[A]=this._subParams.slice(d,U))}return P},K.prototype.addDigit=function(P){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+P,2147483647):P}},K}();y.Params=N},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.OscHandler=y.OscParser=void 0;var N=R(23),K=R(8),P=function(){function d(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return d.prototype.addHandler=function(U,S){this._handlers[U]===void 0&&(this._handlers[U]=[]);var s=this._handlers[U];return s.push(S),{dispose:function(){var w=s.indexOf(S);w!==-1&&s.splice(w,1)}}},d.prototype.setHandler=function(U,S){this._handlers[U]=[S]},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 S=U.length-1;S>=0;S--)U[S].start();else this._handlerFb(this._id,"START")},d.prototype._put=function(U,S,s){var w=this._handlers[this._id];if(w)for(var f=w.length-1;f>=0;f--)w[f].put(U,S,s);else this._handlerFb(this._id,"PUT",K.utf32ToString(U,S,s))},d.prototype._end=function(U){var S=this._handlers[this._id];if(S){for(var s=S.length-1;s>=0&&S[s].end(U)===!1;s--);for(s--;s>=0;s--)S[s].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,S,s){if(this._state!==3){if(this._state===1)for(;S<s;){var w=U[S++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&s-S>0&&this._put(U,S,s)}},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}();y.OscParser=P;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,S,s){this._hitLimit||(this._data+=K.utf32ToString(U,S,s),this._data.length>N.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},d.prototype.end=function(U){var S;return this._hitLimit?S=!1:U&&(S=this._handler(this._data)),this._data="",this._hitLimit=!1,S},d}();y.OscHandler=A},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.PAYLOAD_LIMIT=void 0,y.PAYLOAD_LIMIT=1e7},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.DcsHandler=y.DcsParser=void 0;var N=R(8),K=R(21),P=R(23),A=[],d=function(){function S(){this._handlers=Object.create(null),this._active=A,this._ident=0,this._handlerFb=function(){}}return S.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},S.prototype.addHandler=function(s,w){this._handlers[s]===void 0&&(this._handlers[s]=[]);var f=this._handlers[s];return f.push(w),{dispose:function(){var u=f.indexOf(w);u!==-1&&f.splice(u,1)}}},S.prototype.setHandler=function(s,w){this._handlers[s]=[w]},S.prototype.clearHandler=function(s){this._handlers[s]&&delete this._handlers[s]},S.prototype.setHandlerFallback=function(s){this._handlerFb=s},S.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=A,this._ident=0},S.prototype.hook=function(s,w){if(this.reset(),this._ident=s,this._active=this._handlers[s]||A,this._active.length)for(var f=this._active.length-1;f>=0;f--)this._active[f].hook(w);else this._handlerFb(this._ident,"HOOK",w)},S.prototype.put=function(s,w,f){if(this._active.length)for(var u=this._active.length-1;u>=0;u--)this._active[u].put(s,w,f);else this._handlerFb(this._ident,"PUT",N.utf32ToString(s,w,f))},S.prototype.unhook=function(s){if(this._active.length){for(var w=this._active.length-1;w>=0&&this._active[w].unhook(s)===!1;w--);for(w--;w>=0;w--)this._active[w].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",s);this._active=A,this._ident=0},S}();y.DcsParser=d;var U=function(){function S(s){this._handler=s,this._data="",this._hitLimit=!1}return S.prototype.hook=function(s){this._params=s.clone(),this._data="",this._hitLimit=!1},S.prototype.put=function(s,w,f){this._hitLimit||(this._data+=N.utf32ToString(s,w,f),this._data.length>P.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},S.prototype.unhook=function(s){var w;return this._hitLimit?w=!1:s&&(w=this._handler(this._data,this._params||new K.Params)),this._params=void 0,this._data="",this._hitLimit=!1,w},S}();y.DcsHandler=U},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.removeTerminalFromCache=y.acquireCharAtlas=void 0;var N=R(26),K=R(43),P=[];y.acquireCharAtlas=function(A,d,U,S,s){for(var w=N.generateConfig(S,s,A,U),f=0;f<P.length;f++){var u=(l=P[f]).ownedBy.indexOf(d);if(u>=0){if(N.configEquals(l.config,w))return l.atlas;l.ownedBy.length===1?(l.atlas.dispose(),P.splice(f,1)):l.ownedBy.splice(u,1);break}}for(f=0;f<P.length;f++){var l=P[f];if(N.configEquals(l.config,w))return l.ownedBy.push(d),l.atlas}var c={atlas:new K.DynamicCharAtlas(document,w),config:w,ownedBy:[d]};return P.push(c),c.atlas},y.removeTerminalFromCache=function(A){for(var d=0;d<P.length;d++){var U=P[d].ownedBy.indexOf(A);if(U!==-1){P[d].ownedBy.length===1?(P[d].atlas.dispose(),P.splice(d,1)):P[d].ownedBy.splice(U,1);break}}}},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.is256Color=y.configEquals=y.generateConfig=void 0;var N=R(3);y.generateConfig=function(K,P,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:K,scaledCharHeight:P,fontFamily:A.fontFamily,fontSize:A.fontSize,fontWeight:A.fontWeight,fontWeightBold:A.fontWeightBold,allowTransparency:A.allowTransparency,colors:U}},y.configEquals=function(K,P){for(var A=0;A<K.colors.ansi.length;A++)if(K.colors.ansi[A].rgba!==P.colors.ansi[A].rgba)return!1;return K.devicePixelRatio===P.devicePixelRatio&&K.fontFamily===P.fontFamily&&K.fontSize===P.fontSize&&K.fontWeight===P.fontWeight&&K.fontWeightBold===P.fontWeightBold&&K.allowTransparency===P.allowTransparency&&K.scaledCharWidth===P.scaledCharWidth&&K.scaledCharHeight===P.scaledCharHeight&&K.colors.foreground===P.colors.foreground&&K.colors.background===P.colors.background},y.is256Color=function(K){return K<N.DEFAULT_COLOR}},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.ColorManager=y.DEFAULT_ANSI_COLORS=void 0;var N=R(10),K=R(45),P=N.css.toColor("#ffffff"),A=N.css.toColor("#000000"),d=N.css.toColor("#ffffff"),U=N.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};y.DEFAULT_ANSI_COLORS=function(){for(var w=[N.css.toColor("#2e3436"),N.css.toColor("#cc0000"),N.css.toColor("#4e9a06"),N.css.toColor("#c4a000"),N.css.toColor("#3465a4"),N.css.toColor("#75507b"),N.css.toColor("#06989a"),N.css.toColor("#d3d7cf"),N.css.toColor("#555753"),N.css.toColor("#ef2929"),N.css.toColor("#8ae234"),N.css.toColor("#fce94f"),N.css.toColor("#729fcf"),N.css.toColor("#ad7fa8"),N.css.toColor("#34e2e2"),N.css.toColor("#eeeeec")],f=[0,95,135,175,215,255],u=0;u<216;u++){var l=f[u/36%6|0],c=f[u/6%6|0],m=f[u%6];w.push({css:N.channels.toCss(l,c,m),rgba:N.channels.toRgba(l,c,m)})}for(u=0;u<24;u++){var C=8+10*u;w.push({css:N.channels.toCss(C,C,C),rgba:N.channels.toRgba(C,C,C)})}return w}();var s=function(){function w(f,u){this.allowTransparency=u;var l=f.createElement("canvas");l.width=1,l.height=1;var c=l.getContext("2d");if(!c)throw new Error("Could not get rendering context");this._ctx=c,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new K.ColorContrastCache,this.colors={foreground:P,background:A,cursor:d,cursorAccent:U,selectionTransparent:S,selectionOpaque:N.color.blend(A,S),ansi:y.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return w.prototype.onOptionsChange=function(f){f==="minimumContrastRatio"&&this._contrastCache.clear()},w.prototype.setTheme=function(f){f===void 0&&(f={}),this.colors.foreground=this._parseColor(f.foreground,P),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,S,!0),this.colors.selectionOpaque=N.color.blend(this.colors.background,this.colors.selectionTransparent),N.color.isOpaque(this.colors.selectionTransparent)&&(this.colors.selectionTransparent=N.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(f.black,y.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(f.red,y.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(f.green,y.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(f.yellow,y.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(f.blue,y.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(f.magenta,y.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(f.cyan,y.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(f.white,y.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(f.brightBlack,y.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(f.brightRed,y.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(f.brightGreen,y.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(f.brightYellow,y.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(f.brightBlue,y.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(f.brightMagenta,y.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(f.brightCyan,y.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(f.brightWhite,y.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},w.prototype._parseColor=function(f,u,l){if(l===void 0&&(l=this.allowTransparency),f===void 0)return u;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=f,typeof this._ctx.fillStyle!="string")return console.warn("Color: "+f+" is invalid using fallback "+u.css),u;this._ctx.fillRect(0,0,1,1);var c=this._ctx.getImageData(0,0,1,1).data;if(c[3]!==255){if(!l)return console.warn("Color: "+f+" is using transparency, but allowTransparency is false. Using fallback "+u.css+"."),u;var m=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(I){return Number(I)}),C=m[0],M=m[1],k=m[2],E=m[3],T=Math.round(255*E);return{rgba:N.channels.toRgba(C,M,k,T),css:f}}return{css:this._ctx.fillStyle,rgba:N.channels.toRgba(c[0],c[1],c[2],c[3])}},w}();y.ColorManager=s},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.throwIfFalsy=void 0,y.throwIfFalsy=function(N){if(!N)throw new Error("value must not be falsy");return N}},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(s,w){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,u){f.__proto__=u}||function(f,u){for(var l in u)u.hasOwnProperty(l)&&(f[l]=u[l])})(s,w)},function(s,w){function f(){this.constructor=s}N(s,w),s.prototype=w===null?Object.create(w):(f.prototype=w.prototype,new f)});Object.defineProperty(y,"__esModule",{value:!0}),y.CharacterJoinerRegistry=y.JoinedCellData=void 0;var P=R(6),A=R(3),d=R(4),U=function(s){function w(f,u,l){var c=s.call(this)||this;return c.content=0,c.combinedData="",c.fg=f.fg,c.bg=f.bg,c.combinedData=u,c._width=l,c}return K(w,s),w.prototype.isCombined=function(){return 2097152},w.prototype.getWidth=function(){return this._width},w.prototype.getChars=function(){return this.combinedData},w.prototype.getCode=function(){return 2097151},w.prototype.setFromCharData=function(f){throw new Error("not implemented")},w.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},w}(P.AttributeData);y.JoinedCellData=U;var S=function(){function s(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new d.CellData}return s.prototype.registerCharacterJoiner=function(w){var f={id:this._nextCharacterJoinerId++,handler:w};return this._characterJoiners.push(f),f.id},s.prototype.deregisterCharacterJoiner=function(w){for(var f=0;f<this._characterJoiners.length;f++)if(this._characterJoiners[f].id===w)return this._characterJoiners.splice(f,1),!0;return!1},s.prototype.getJoinedCharacters=function(w){if(this._characterJoiners.length===0)return[];var f=this._bufferService.buffer.lines.get(w);if(!f||f.length===0)return[];for(var u=[],l=f.translateToString(!0),c=0,m=0,C=0,M=f.getFg(0),k=f.getBg(0),E=0;E<f.getTrimmedLength();E++)if(f.loadCell(E,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==M||this._workCell.bg!==k){if(E-c>1)for(var T=this._getJoinedRanges(l,C,m,f,c),I=0;I<T.length;I++)u.push(T[I]);c=E,C=m,M=this._workCell.fg,k=this._workCell.bg}m+=this._workCell.getChars().length||A.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-c>1)for(T=this._getJoinedRanges(l,C,m,f,c),I=0;I<T.length;I++)u.push(T[I]);return u},s.prototype._getJoinedRanges=function(w,f,u,l,c){for(var m=w.substring(f,u),C=this._characterJoiners[0].handler(m),M=1;M<this._characterJoiners.length;M++)for(var k=this._characterJoiners[M].handler(m),E=0;E<k.length;E++)s._mergeRanges(C,k[E]);return this._stringRangesToCellRanges(C,l,c),C},s.prototype._stringRangesToCellRanges=function(w,f,u){var l=0,c=!1,m=0,C=w[l];if(C){for(var M=u;M<this._bufferService.cols;M++){var k=f.getWidth(M),E=f.getString(M).length||A.WHITESPACE_CELL_CHAR.length;if(k!==0){if(!c&&C[0]<=m&&(C[0]=M,c=!0),C[1]<=m){if(C[1]=M,!(C=w[++l]))break;C[0]<=m?(C[0]=M,c=!0):c=!1}m+=E}}C&&(C[1]=this._bufferService.cols)}},s._mergeRanges=function(w,f){for(var u=!1,l=0;l<w.length;l++){var c=w[l];if(u){if(f[1]<=c[0])return w[l-1][1]=f[1],w;if(f[1]<=c[1])return w[l-1][1]=Math.max(f[1],c[1]),w.splice(l,1),w;w.splice(l,1),l--}else{if(f[1]<=c[0])return w.splice(l,0,f),w;if(f[1]<=c[1])return c[0]=Math.min(f[0],c[0]),w;f[0]<c[1]&&(c[0]=Math.min(f[0],c[0]),u=!0)}}return u?w[w.length-1][1]=f[1]:w.push(f),w},s}();y.CharacterJoinerRegistry=S},function(ke,y,R){"use strict";function N(K,P){var A=P.getBoundingClientRect();return[K.clientX-A.left,K.clientY-A.top]}Object.defineProperty(y,"__esModule",{value:!0}),y.getRawByteCoords=y.getCoords=y.getCoordsRelativeToElement=void 0,y.getCoordsRelativeToElement=N,y.getCoords=function(K,P,A,d,U,S,s,w){if(U){var f=N(K,P);if(f)return f[0]=Math.ceil((f[0]+(w?S/2:0))/S),f[1]=Math.ceil(f[1]/s),f[0]=Math.min(Math.max(f[0],1),A+(w?1:0)),f[1]=Math.min(Math.max(f[1],1),d),f}},y.getRawByteCoords=function(K){if(K)return{x:K[0]+32,y:K[1]+32}}},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.RenderDebouncer=void 0;var N=function(){function K(P){this._renderCallback=P}return K.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},K.prototype.refresh=function(P,A,d){var U=this;this._rowCount=d,P=P!==void 0?P:0,A=A!==void 0?A:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,P):P,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,A):A,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return U._innerRefresh()}))},K.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var P=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(P,A)}},K}();y.RenderDebouncer=N},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(A,d){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,S){U.__proto__=S}||function(U,S){for(var s in S)S.hasOwnProperty(s)&&(U[s]=S[s])})(A,d)},function(A,d){function U(){this.constructor=A}N(A,d),A.prototype=d===null?Object.create(d):(U.prototype=d.prototype,new U)});Object.defineProperty(y,"__esModule",{value:!0}),y.ScreenDprMonitor=void 0;var P=function(A){function d(){var U=A!==null&&A.apply(this,arguments)||this;return U._currentDevicePixelRatio=window.devicePixelRatio,U}return K(d,A),d.prototype.setListener=function(U){var S=this;this._listener&&this.clearListener(),this._listener=U,this._outerListener=function(){S._listener&&(S._listener(window.devicePixelRatio,S._currentDevicePixelRatio),S._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}(R(2).Disposable);y.ScreenDprMonitor=P},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.clone=void 0,y.clone=function N(K,P){if(P===void 0&&(P=5),typeof K!="object")return K;var A=Array.isArray(K)?[]:{};for(var d in K)A[d]=P<=1?K[d]:K[d]?N(K[d],P-1):K[d];return A}},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.Terminal=void 0;var N=R(4),K=R(35),P=R(18),A=R(0),d=R(83),U=function(){function l(c){this._core=new K.Terminal(c),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 u(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 s(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(c,m){this._verifyIntegers(c,m),this._core.resize(c,m)},l.prototype.open=function(c){this._core.open(c)},l.prototype.attachCustomKeyEventHandler=function(c){this._core.attachCustomKeyEventHandler(c)},l.prototype.registerLinkMatcher=function(c,m,C){return this._checkProposedApi(),this._core.registerLinkMatcher(c,m,C)},l.prototype.deregisterLinkMatcher=function(c){this._checkProposedApi(),this._core.deregisterLinkMatcher(c)},l.prototype.registerLinkProvider=function(c){return this._checkProposedApi(),this._core.registerLinkProvider(c)},l.prototype.registerCharacterJoiner=function(c){return this._checkProposedApi(),this._core.registerCharacterJoiner(c)},l.prototype.deregisterCharacterJoiner=function(c){this._checkProposedApi(),this._core.deregisterCharacterJoiner(c)},l.prototype.registerMarker=function(c){return this._checkProposedApi(),this._verifyIntegers(c),this._core.addMarker(c)},l.prototype.addMarker=function(c){return this.registerMarker(c)},l.prototype.hasSelection=function(){return this._core.hasSelection()},l.prototype.select=function(c,m,C){this._verifyIntegers(c,m,C),this._core.select(c,m,C)},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(c,m){this._verifyIntegers(c,m),this._core.selectLines(c,m)},l.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},l.prototype.scrollLines=function(c){this._verifyIntegers(c),this._core.scrollLines(c)},l.prototype.scrollPages=function(c){this._verifyIntegers(c),this._core.scrollPages(c)},l.prototype.scrollToTop=function(){this._core.scrollToTop()},l.prototype.scrollToBottom=function(){this._core.scrollToBottom()},l.prototype.scrollToLine=function(c){this._verifyIntegers(c),this._core.scrollToLine(c)},l.prototype.clear=function(){this._core.clear()},l.prototype.write=function(c,m){this._core.write(c,m)},l.prototype.writeUtf8=function(c,m){this._core.write(c,m)},l.prototype.writeln=function(c,m){this._core.write(c),this._core.write(`\r
|
|
|
`,m)},l.prototype.paste=function(c){this._core.paste(c)},l.prototype.getOption=function(c){return this._core.optionsService.getOption(c)},l.prototype.setOption=function(c,m){this._core.optionsService.setOption(c,m)},l.prototype.refresh=function(c,m){this._verifyIntegers(c,m),this._core.refresh(c,m)},l.prototype.reset=function(){this._core.reset()},l.prototype.loadAddon=function(c){return this._addonManager.loadAddon(this,c)},Object.defineProperty(l,"strings",{get:function(){return P},enumerable:!1,configurable:!0}),l.prototype._verifyIntegers=function(){for(var c=[],m=0;m<arguments.length;m++)c[m]=arguments[m];for(var C=0,M=c;C<M.length;C++){var k=M[C];if(k===1/0||isNaN(k)||k%1!=0)throw new Error("This API only accepts integers")}},l}();y.Terminal=U;var S=function(){function l(c,m){this._buffer=c,this.type=m}return l.prototype.init=function(c){return this._buffer=c,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(c){var m=this._buffer.lines.get(c);if(m)return new w(m)},l.prototype.getNullCell=function(){return new N.CellData},l}(),s=function(){function l(c){var m=this;this._buffers=c,this._onBufferChange=new A.EventEmitter,this._normal=new S(this._buffers.normal,"normal"),this._alternate=new S(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}(),w=function(){function l(c){this._line=c}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(c,m){if(!(c<0||c>=this._line.length))return m?(this._line.loadCell(c,m),m):this._line.loadCell(c,new N.CellData)},l.prototype.translateToString=function(c,m,C){return this._line.translateToString(c,m,C)},l}(),f=function(){function l(c){this._core=c}return l.prototype.registerCsiHandler=function(c,m){return this._core.addCsiHandler(c,function(C){return m(C.toArray())})},l.prototype.addCsiHandler=function(c,m){return this.registerCsiHandler(c,m)},l.prototype.registerDcsHandler=function(c,m){return this._core.addDcsHandler(c,function(C,M){return m(C,M.toArray())})},l.prototype.addDcsHandler=function(c,m){return this.registerDcsHandler(c,m)},l.prototype.registerEscHandler=function(c,m){return this._core.addEscHandler(c,m)},l.prototype.addEscHandler=function(c,m){return this.registerEscHandler(c,m)},l.prototype.registerOscHandler=function(c,m){return this._core.addOscHandler(c,m)},l.prototype.addOscHandler=function(c,m){return this.registerOscHandler(c,m)},l}(),u=function(){function l(c){this._core=c}return l.prototype.register=function(c){this._core.unicodeService.register(c)},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(c){this._core.unicodeService.activeVersion=c},enumerable:!1,configurable:!0}),l}()},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(ae,G){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,Z){X.__proto__=Z}||function(X,Z){for(var B in Z)Z.hasOwnProperty(B)&&(X[B]=Z[B])})(ae,G)},function(ae,G){function X(){this.constructor=ae}N(ae,G),ae.prototype=G===null?Object.create(G):(X.prototype=G.prototype,new X)});Object.defineProperty(y,"__esModule",{value:!0}),y.Terminal=void 0;var P=R(36),A=R(37),d=R(38),U=R(12),S=R(19),s=R(40),w=R(50),f=R(51),u=R(11),l=R(7),c=R(18),m=R(54),C=R(55),M=R(56),k=R(57),E=R(59),T=R(0),I=R(16),F=R(27),H=R(60),W=R(5),z=R(61),ie=R(62),re=R(63),_e=R(64),Ae=R(65),ce=typeof window!="undefined"?window.document:null,J=function(ae){function G(X){X===void 0&&(X={});var Z=ae.call(this,X)||this;return Z.browser=u,Z._keyDownHandled=!1,Z._onCursorMove=new T.EventEmitter,Z._onKey=new T.EventEmitter,Z._onRender=new T.EventEmitter,Z._onSelectionChange=new T.EventEmitter,Z._onTitleChange=new T.EventEmitter,Z._onFocus=new T.EventEmitter,Z._onBlur=new T.EventEmitter,Z._onA11yCharEmitter=new T.EventEmitter,Z._onA11yTabEmitter=new T.EventEmitter,Z._setup(),Z.linkifier=Z._instantiationService.createInstance(w.Linkifier),Z.linkifier2=Z.register(Z._instantiationService.createInstance(re.Linkifier2)),Z.register(Z._inputHandler.onRequestBell(function(){return Z.bell()})),Z.register(Z._inputHandler.onRequestRefreshRows(function(B,O){return Z.refresh(B,O)})),Z.register(Z._inputHandler.onRequestReset(function(){return Z.reset()})),Z.register(Z._inputHandler.onRequestScroll(function(B,O){return Z.scroll(B,O||void 0)})),Z.register(Z._inputHandler.onRequestWindowsOptionsReport(function(B){return Z._reportWindowsOptions(B)})),Z.register(T.forwardEvent(Z._inputHandler.onCursorMove,Z._onCursorMove)),Z.register(T.forwardEvent(Z._inputHandler.onTitleChange,Z._onTitleChange)),Z.register(T.forwardEvent(Z._inputHandler.onA11yChar,Z._onA11yCharEmitter)),Z.register(T.forwardEvent(Z._inputHandler.onA11yTab,Z._onA11yTabEmitter)),Z.register(Z._bufferService.onResize(function(B){return Z._afterResize(B.cols,B.rows)})),Z}return K(G,ae),Object.defineProperty(G.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),G.prototype.dispose=function(){var X,Z,B;this._isDisposed||(ae.prototype.dispose.call(this),(X=this._renderService)===null||X===void 0||X.dispose(),this._customKeyEventHandler=void 0,this.write=function(){},(B=(Z=this.element)===null||Z===void 0?void 0:Z.parentNode)===null||B===void 0||B.removeChild(this.element))},G.prototype._setup=function(){ae.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(G.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),G.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},G.prototype._updateOptions=function(X){var Z,B,O,ne;switch(ae.prototype._updateOptions.call(this,X),X){case"fontFamily":case"fontSize":(Z=this._renderService)===null||Z===void 0||Z.clear(),(B=this._charSizeService)===null||B===void 0||B.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":(O=this.viewport)===null||O===void 0||O.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new M.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)}},G.prototype._onTextAreaFocus=function(X){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(U.C0.ESC+"[I"),this.updateCursorStyle(X),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},G.prototype.blur=function(){var X;return(X=this.textarea)===null||X===void 0?void 0:X.blur()},G.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()},G.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var X=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),Z=this._bufferService.buffer.y*X,B=this._bufferService.buffer.x*this._charSizeService.width;this.textarea.style.left=B+"px",this.textarea.style.top=Z+"px",this.textarea.style.width=this._charSizeService.width+"px",this.textarea.style.height=X+"px",this.textarea.style.lineHeight=X+"px",this.textarea.style.zIndex="-5"}},G.prototype._initGlobal=function(){var X=this;this._bindKeys(),this.register(l.addDisposableDomListener(this.element,"copy",function(B){X.hasSelection()&&d.copyHandler(B,X._selectionService)}));var Z=function(B){return d.handlePasteEvent(B,X.textarea,X._coreService)};this.register(l.addDisposableDomListener(this.textarea,"paste",Z)),this.register(l.addDisposableDomListener(this.element,"paste",Z)),u.isFirefox?this.register(l.addDisposableDomListener(this.element,"mousedown",function(B){B.button===2&&d.rightClickHandler(B,X.textarea,X.screenElement,X._selectionService,X.options.rightClickSelectsWord)})):this.register(l.addDisposableDomListener(this.element,"contextmenu",function(B){d.rightClickHandler(B,X.textarea,X.screenElement,X._selectionService,X.options.rightClickSelectsWord)})),u.isLinux&&this.register(l.addDisposableDomListener(this.element,"auxclick",function(B){B.button===1&&d.moveTextAreaUnderMouseCursor(B,X.textarea,X.screenElement)}))},G.prototype._bindKeys=function(){var X=this;this.register(l.addDisposableDomListener(this.textarea,"keyup",function(Z){return X._keyUp(Z)},!0)),this.register(l.addDisposableDomListener(this.textarea,"keydown",function(Z){return X._keyDown(Z)},!0)),this.register(l.addDisposableDomListener(this.textarea,"keypress",function(Z){return X._keyPress(Z)},!0)),this.register(l.addDisposableDomListener(this.textarea,"compositionstart",function(){return X._compositionHelper.compositionstart()})),this.register(l.addDisposableDomListener(this.textarea,"compositionupdate",function(Z){return X._compositionHelper.compositionupdate(Z)})),this.register(l.addDisposableDomListener(this.textarea,"compositionend",function(){return X._compositionHelper.compositionend()})),this.register(this.onRender(function(){return X._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(Z){return X._queueLinkification(Z.start,Z.end)}))},G.prototype.open=function(X){var Z=this;if(!X)throw new Error("Terminal requires a parent element.");ce.body.contains(X)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=X.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"),X.appendChild(this.element);var B=ce.createDocumentFragment();this._viewportElement=ce.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.appendChild(this._viewportElement),this._viewportScrollArea=ce.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=ce.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=ce.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),B.appendChild(this.screenElement),this.textarea=ce.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",c.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(me){return Z._onTextAreaFocus(me)})),this.register(l.addDisposableDomListener(this.textarea,"blur",function(){return Z._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);var O=this._instantiationService.createInstance(_e.CoreBrowserService,this.textarea);this._instantiationService.setService(W.ICoreBrowserService,O),this._charSizeService=this._instantiationService.createInstance(z.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(W.ICharSizeService,this._charSizeService),this._compositionView=ce.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(P.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(B),this._theme=this.options.theme||this._theme,this._colorManager=new F.ColorManager(ce,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(function(me){return Z._colorManager.onOptionsChange(me)})),this._colorManager.setTheme(this._theme);var ne=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(H.RenderService,ne,this.rows,this.screenElement)),this._instantiationService.setService(W.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange(function(me){return Z._onRender.fire(me)})),this.onResize(function(me){return Z._renderService.resize(me.cols,me.rows)}),this._soundService=this._instantiationService.createInstance(m.SoundService),this._instantiationService.setService(W.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(ie.MouseService),this._instantiationService.setService(W.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(A.Viewport,function(me,Oe){return Z.scrollLines(me,Oe)},this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(function(){return Z.viewport.syncScrollArea()})),this.register(this.viewport),this.register(this.onCursorMove(function(){Z._renderService.onCursorMove(),Z._syncTextArea()})),this.register(this.onResize(function(){return Z._renderService.onResize(Z.cols,Z.rows)})),this.register(this.onBlur(function(){return Z._renderService.onBlur()})),this.register(this.onFocus(function(){return Z._renderService.onFocus()})),this.register(this._renderService.onDimensionsChange(function(){return Z.viewport.syncScrollArea()})),this._selectionService=this.register(this._instantiationService.createInstance(f.SelectionService,this.element,this.screenElement)),this._instantiationService.setService(W.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(function(me){return Z.scrollLines(me.amount,me.suppressScrollEvent)})),this.register(this._selectionService.onSelectionChange(function(){return Z._onSelectionChange.fire()})),this.register(this._selectionService.onRequestRedraw(function(me){return Z._renderService.onSelectionChanged(me.start,me.end,me.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(me){Z.textarea.value=me,Z.textarea.focus(),Z.textarea.select()})),this.register(this.onScroll(function(){Z.viewport.syncScrollArea(),Z._selectionService.refresh()})),this.register(l.addDisposableDomListener(this._viewportElement,"scroll",function(){return Z._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(C.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return Z._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(me){return Z._selectionService.onMouseDown(me)})),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new M.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},G.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(s.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+'"')}},G.prototype._setTheme=function(X){var Z,B,O;this._theme=X,(Z=this._colorManager)===null||Z===void 0||Z.setTheme(X),(B=this._renderService)===null||B===void 0||B.setColors(this._colorManager.colors),(O=this.viewport)===null||O===void 0||O.onThemeChange(this._colorManager.colors)},G.prototype.bindMouse=function(){var X=this,Z=this,B=this.element;function O(Fe){var it,st,et=Z._mouseService.getRawByteCoords(Fe,Z.screenElement,Z.cols,Z.rows);if(!et)return!1;switch(Fe.overrideType||Fe.type){case"mousemove":st=32,Fe.buttons===void 0?(it=3,Fe.button!==void 0&&(it=Fe.button<3?Fe.button:3)):it=1&Fe.buttons?0:4&Fe.buttons?1:2&Fe.buttons?2:3;break;case"mouseup":st=0,it=Fe.button<3?Fe.button:3;break;case"mousedown":st=1,it=Fe.button<3?Fe.button:3;break;case"wheel":Fe.deltaY!==0&&(st=Fe.deltaY<0?0:1),it=4;break;default:return!1}return!(st===void 0||it===void 0||it>4)&&Z._coreMouseService.triggerMouseEvent({col:et.x-33,row:et.y-33,button:it,action:st,ctrl:Fe.ctrlKey,alt:Fe.altKey,shift:Fe.shiftKey})}var ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},me=function(Fe){return O(Fe),Fe.buttons||(X._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&X._document.removeEventListener("mousemove",ne.mousedrag)),X.cancel(Fe)},Oe=function(Fe){return O(Fe),Fe.preventDefault(),X.cancel(Fe)},He=function(Fe){Fe.buttons&&O(Fe)},ut=function(Fe){Fe.buttons||O(Fe)};this.register(this._coreMouseService.onProtocolChange(function(Fe){Fe?(X.optionsService.options.logLevel==="debug"&&X._logService.debug("Binding to mouse events:",X._coreMouseService.explainEvents(Fe)),X.element.classList.add("enable-mouse-events"),X._selectionService.disable()):(X._logService.debug("Unbinding from mouse events."),X.element.classList.remove("enable-mouse-events"),X._selectionService.enable()),8&Fe?ne.mousemove||(B.addEventListener("mousemove",ut),ne.mousemove=ut):(B.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&Fe?ne.wheel||(B.addEventListener("wheel",Oe,{passive:!1}),ne.wheel=Oe):(B.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&Fe?ne.mouseup||(ne.mouseup=me):(X._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&Fe?ne.mousedrag||(ne.mousedrag=He):(X._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(l.addDisposableDomListener(B,"mousedown",function(Fe){if(Fe.preventDefault(),X.focus(),X._coreMouseService.areMouseEventsActive&&!X._selectionService.shouldForceSelection(Fe))return O(Fe),ne.mouseup&&X._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&X._document.addEventListener("mousemove",ne.mousedrag),X.cancel(Fe)})),this.register(l.addDisposableDomListener(B,"wheel",function(Fe){if(!ne.wheel){if(!X.buffer.hasScrollback){var it=X.viewport.getLinesScrolled(Fe);if(it===0)return;for(var st=U.C0.ESC+(X._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Fe.deltaY<0?"A":"B"),et="",Nt=0;Nt<Math.abs(it);Nt++)et+=st;X._coreService.triggerDataEvent(et,!0)}}},{passive:!0})),this.register(l.addDisposableDomListener(B,"wheel",function(Fe){if(!ne.wheel)return X.viewport.onWheel(Fe)?void 0:X.cancel(Fe)},{passive:!1})),this.register(l.addDisposableDomListener(B,"touchstart",function(Fe){if(!X._coreMouseService.areMouseEventsActive)return X.viewport.onTouchStart(Fe),X.cancel(Fe)},{passive:!0})),this.register(l.addDisposableDomListener(B,"touchmove",function(Fe){if(!X._coreMouseService.areMouseEventsActive)return X.viewport.onTouchMove(Fe)?void 0:X.cancel(Fe)},{passive:!1}))},G.prototype.refresh=function(X,Z){var B;(B=this._renderService)===null||B===void 0||B.refreshRows(X,Z)},G.prototype._queueLinkification=function(X,Z){var B;(B=this.linkifier)===null||B===void 0||B.linkifyRows(X,Z)},G.prototype.updateCursorStyle=function(X){this._selectionService&&this._selectionService.shouldColumnSelect(X)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},G.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},G.prototype.scrollLines=function(X,Z){ae.prototype.scrollLines.call(this,X,Z),this.refresh(0,this.rows-1)},G.prototype.paste=function(X){d.paste(X,this.textarea,this._coreService)},G.prototype.attachCustomKeyEventHandler=function(X){this._customKeyEventHandler=X},G.prototype.registerLinkMatcher=function(X,Z,B){var O=this.linkifier.registerLinkMatcher(X,Z,B);return this.refresh(0,this.rows-1),O},G.prototype.deregisterLinkMatcher=function(X){this.linkifier.deregisterLinkMatcher(X)&&this.refresh(0,this.rows-1)},G.prototype.registerLinkProvider=function(X){return this.linkifier2.registerLinkProvider(X)},G.prototype.registerCharacterJoiner=function(X){var Z=this._renderService.registerCharacterJoiner(X);return this.refresh(0,this.rows-1),Z},G.prototype.deregisterCharacterJoiner=function(X){this._renderService.deregisterCharacterJoiner(X)&&this.refresh(0,this.rows-1)},Object.defineProperty(G.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),G.prototype.addMarker=function(X){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)},G.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},G.prototype.select=function(X,Z,B){this._selectionService.setSelection(X,Z,B)},G.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},G.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]}},G.prototype.clearSelection=function(){var X;(X=this._selectionService)===null||X===void 0||X.clearSelection()},G.prototype.selectAll=function(){var X;(X=this._selectionService)===null||X===void 0||X.selectAll()},G.prototype.selectLines=function(X,Z){var B;(B=this._selectionService)===null||B===void 0||B.selectLines(X,Z)},G.prototype._keyDown=function(X){if(this._keyDownHandled=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(!this._compositionHelper.keydown(X))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var Z=E.evaluateKeyboardEvent(X,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),Z.type===3||Z.type===2){var B=this.rows-1;return this.scrollLines(Z.type===2?-B:B),this.cancel(X,!0)}return Z.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(Z.cancel&&this.cancel(X,!0),!Z.key||(Z.key!==U.C0.ETX&&Z.key!==U.C0.CR||(this.textarea.value=""),this._onKey.fire({key:Z.key,domEvent:X}),this._showCursor(),this._coreService.triggerDataEvent(Z.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(X,!0)))},G.prototype._isThirdLevelShift=function(X,Z){var B=X.isMac&&!this.options.macOptionIsMeta&&Z.altKey&&!Z.ctrlKey&&!Z.metaKey||X.isWindows&&Z.altKey&&Z.ctrlKey&&!Z.metaKey;return Z.type==="keypress"?B:B&&(!Z.keyCode||Z.keyCode>47)},G.prototype._keyUp=function(X){this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||(function(Z){return Z.keyCode===16||Z.keyCode===17||Z.keyCode===18}(X)||this.focus(),this.updateCursorStyle(X))},G.prototype._keyPress=function(X){var Z;if(this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)Z=X.charCode;else if(X.which===null||X.which===void 0)Z=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;Z=X.which}return!(!Z||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X))&&(Z=String.fromCharCode(Z),this._onKey.fire({key:Z,domEvent:X}),this._showCursor(),this._coreService.triggerDataEvent(Z,!0),!0)},G.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},G.prototype.resize=function(X,Z){X!==this.cols||Z!==this.rows?ae.prototype.resize.call(this,X,Z):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},G.prototype._afterResize=function(X,Z){var B,O;(B=this._charSizeService)===null||B===void 0||B.measure(),(O=this.viewport)===null||O===void 0||O.syncScrollArea(!0)},G.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 X=1;X<this.rows;X++)this.buffer.lines.push(this.buffer.getBlankLine(I.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},G.prototype.reset=function(){var X,Z;this.options.rows=this.rows,this.options.cols=this.cols;var B=this._customKeyEventHandler;this._setup(),ae.prototype.reset.call(this),(X=this._selectionService)===null||X===void 0||X.reset(),this._customKeyEventHandler=B,this.refresh(0,this.rows-1),(Z=this.viewport)===null||Z===void 0||Z.syncScrollArea()},G.prototype._reportWindowsOptions=function(X){if(this._renderService)switch(X){case S.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:var Z=this._renderService.dimensions.scaledCanvasWidth.toFixed(0),B=this._renderService.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(U.C0.ESC+"[4;"+B+";"+Z+"t");break;case S.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var O=this._renderService.dimensions.scaledCellWidth.toFixed(0),ne=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(U.C0.ESC+"[6;"+ne+";"+O+"t")}},G.prototype.cancel=function(X,Z){if(this.options.cancelEvents||Z)return X.preventDefault(),X.stopPropagation(),!1},G.prototype._visualBell=function(){return!1},G.prototype._soundBell=function(){return this.options.bellStyle==="sound"},G}(Ae.CoreTerminal);y.Terminal=J},function(ke,y,R){"use strict";var N=this&&this.__decorate||function(U,S,s,w){var f,u=arguments.length,l=u<3?S:w===null?w=Object.getOwnPropertyDescriptor(S,s):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(U,S,s,w);else for(var c=U.length-1;c>=0;c--)(f=U[c])&&(l=(u<3?f(l):u>3?f(S,s,l):f(S,s))||l);return u>3&&l&&Object.defineProperty(S,s,l),l},K=this&&this.__param||function(U,S){return function(s,w){S(s,w,U)}};Object.defineProperty(y,"__esModule",{value:!0}),y.CompositionHelper=void 0;var P=R(5),A=R(1),d=function(){function U(S,s,w,f,u,l){this._textarea=S,this._compositionView=s,this._bufferService=w,this._optionsService=f,this._charSizeService=u,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(S){var s=this;this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout(function(){s._compositionPosition.end=s._textarea.value.length},0)},U.prototype.compositionend=function(){this._finalizeComposition(!0)},U.prototype.keydown=function(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)},U.prototype._finalizeComposition=function(S){var s=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){var w={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(s._isSendingComposition){s._isSendingComposition=!1;var u=void 0;u=s._isComposing?s._textarea.value.substring(w.start,w.end):s._textarea.value.substring(w.start),s._coreService.triggerDataEvent(u,!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 S=this,s=this._textarea.value;setTimeout(function(){if(!S._isComposing){var w=S._textarea.value.replace(s,"");w.length>0&&S._coreService.triggerDataEvent(w,!0)}},0)},U.prototype.updateCompositionElements=function(S){var s=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var w=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),f=this._bufferService.buffer.y*w,u=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=u+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=w+"px",this._compositionView.style.lineHeight=w+"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=u+"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"}S||setTimeout(function(){return s.updateCompositionElements(!0)},0)}},U=N([K(2,A.IBufferService),K(3,A.IOptionsService),K(4,P.ICharSizeService),K(5,A.ICoreService)],U)}();y.CompositionHelper=d},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(f,u){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var m in c)c.hasOwnProperty(m)&&(l[m]=c[m])})(f,u)},function(f,u){function l(){this.constructor=f}N(f,u),f.prototype=u===null?Object.create(u):(l.prototype=u.prototype,new l)}),P=this&&this.__decorate||function(f,u,l,c){var m,C=arguments.length,M=C<3?u:c===null?c=Object.getOwnPropertyDescriptor(u,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(f,u,l,c);else for(var k=f.length-1;k>=0;k--)(m=f[k])&&(M=(C<3?m(M):C>3?m(u,l,M):m(u,l))||M);return C>3&&M&&Object.defineProperty(u,l,M),M},A=this&&this.__param||function(f,u){return function(l,c){u(l,c,f)}};Object.defineProperty(y,"__esModule",{value:!0}),y.Viewport=void 0;var d=R(2),U=R(7),S=R(5),s=R(1),w=function(f){function u(l,c,m,C,M,k,E){var T=f.call(this)||this;return T._scrollLines=l,T._viewportElement=c,T._scrollArea=m,T._bufferService=C,T._optionsService=M,T._charSizeService=k,T._renderService=E,T.scrollBarWidth=0,T._currentRowHeight=0,T._lastRecordedBufferLength=0,T._lastRecordedViewportHeight=0,T._lastRecordedBufferHeight=0,T._lastTouchY=0,T._lastScrollTop=0,T._wheelPartialScroll=0,T._refreshAnimationFrame=null,T._ignoreNextScrollEvent=!1,T.scrollBarWidth=T._viewportElement.offsetWidth-T._scrollArea.offsetWidth||15,T.register(U.addDisposableDomListener(T._viewportElement,"scroll",T._onScroll.bind(T))),setTimeout(function(){return T.syncScrollArea()},0),T}return K(u,f),u.prototype.onThemeChange=function(l){this._viewportElement.style.backgroundColor=l.background.css},u.prototype._refresh=function(l){var c=this;if(l)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return c._innerRefresh()}))},u.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 c=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==c&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=c),this._refreshAnimationFrame=null},u.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 c=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===c&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(l)}else this._refresh(l)},u.prototype._onScroll=function(l){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var c=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(c,!0)}},u.prototype._bubbleScroll=function(l,c){var m=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(c<0&&this._viewportElement.scrollTop!==0||c>0&&m<this._lastRecordedBufferHeight)||(l.cancelable&&l.preventDefault(),!1)},u.prototype.onWheel=function(l){var c=this._getPixelsScrolled(l);return c!==0&&(this._viewportElement.scrollTop+=c,this._bubbleScroll(l,c))},u.prototype._getPixelsScrolled=function(l){if(l.deltaY===0)return 0;var c=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_LINE?c*=this._currentRowHeight:l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(c*=this._currentRowHeight*this._bufferService.rows),c},u.prototype.getLinesScrolled=function(l){if(l.deltaY===0)return 0;var c=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(c/=this._currentRowHeight+0,this._wheelPartialScroll+=c,c=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(c*=this._bufferService.rows),c},u.prototype._applyScrollModifier=function(l,c){var m=this._optionsService.options.fastScrollModifier;return m==="alt"&&c.altKey||m==="ctrl"&&c.ctrlKey||m==="shift"&&c.shiftKey?l*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:l*this._optionsService.options.scrollSensitivity},u.prototype.onTouchStart=function(l){this._lastTouchY=l.touches[0].pageY},u.prototype.onTouchMove=function(l){var c=this._lastTouchY-l.touches[0].pageY;return this._lastTouchY=l.touches[0].pageY,c!==0&&(this._viewportElement.scrollTop+=c,this._bubbleScroll(l,c))},u=P([A(3,s.IBufferService),A(4,s.IOptionsService),A(5,S.ICharSizeService),A(6,S.IRenderService)],u)}(d.Disposable);y.Viewport=w},function(ke,y,R){"use strict";function N(d){return d.replace(/\r?\n/g,"\r")}function K(d,U){return U?"\x1B[200~"+d+"\x1B[201~":d}function P(d,U,S){d=K(d=N(d),S.decPrivateModes.bracketedPasteMode),S.triggerDataEvent(d,!0),U.value=""}function A(d,U,S){var s=S.getBoundingClientRect(),w=d.clientX-s.left-10,f=d.clientY-s.top-10;U.style.width="20px",U.style.height="20px",U.style.left=w+"px",U.style.top=f+"px",U.style.zIndex="1000",U.focus()}Object.defineProperty(y,"__esModule",{value:!0}),y.rightClickHandler=y.moveTextAreaUnderMouseCursor=y.paste=y.handlePasteEvent=y.copyHandler=y.bracketTextForPaste=y.prepareTextForTerminal=void 0,y.prepareTextForTerminal=N,y.bracketTextForPaste=K,y.copyHandler=function(d,U){d.clipboardData&&d.clipboardData.setData("text/plain",U.selectionText),d.preventDefault()},y.handlePasteEvent=function(d,U,S){d.stopPropagation(),d.clipboardData&&P(d.clipboardData.getData("text/plain"),U,S)},y.paste=P,y.moveTextAreaUnderMouseCursor=A,y.rightClickHandler=function(d,U,S,s,w){A(d,U,S),w&&!s.isClickInSelection(d)&&s.selectWordAtCursor(d),U.value=s.selectionText,U.select()}},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(f,u){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var m in c)c.hasOwnProperty(m)&&(l[m]=c[m])})(f,u)},function(f,u){function l(){this.constructor=f}N(f,u),f.prototype=u===null?Object.create(u):(l.prototype=u.prototype,new l)});Object.defineProperty(y,"__esModule",{value:!0}),y.EscapeSequenceParser=y.VT500_TRANSITION_TABLE=y.TransitionTable=void 0;var P=R(2),A=R(15),d=R(21),U=R(22),S=R(24),s=function(){function f(u){this.table=new Uint8Array(u)}return f.prototype.setDefault=function(u,l){A.fill(this.table,u<<4|l)},f.prototype.add=function(u,l,c,m){this.table[l<<8|u]=c<<4|m},f.prototype.addMany=function(u,l,c,m){for(var C=0;C<u.length;C++)this.table[l<<8|u[C]]=c<<4|m},f}();y.TransitionTable=s,y.VT500_TRANSITION_TABLE=function(){var f=new s(4095),u=Array.apply(null,Array(256)).map(function(k,E){return E}),l=function(k,E){return u.slice(k,E)},c=l(32,127),m=l(0,24);m.push(25),m.push.apply(m,l(28,32));var C,M=l(0,14);for(C in f.setDefault(1,0),f.addMany(c,0,2,0),M)f.addMany([24,26,153,154],C,3,0),f.addMany(l(128,144),C,3,0),f.addMany(l(144,152),C,3,0),f.add(156,C,0,0),f.add(27,C,11,1),f.add(157,C,4,8),f.addMany([152,158,159],C,0,7),f.add(155,C,11,3),f.add(144,C,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(c,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(c,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(c,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 w=function(f){function u(l){l===void 0&&(l=y.VT500_TRANSITION_TABLE);var c=f.call(this)||this;return c._transitions=l,c.initialState=0,c.currentState=c.initialState,c._params=new d.Params,c._params.addParam(0),c._collect=0,c.precedingCodepoint=0,c._printHandlerFb=function(m,C,M){},c._executeHandlerFb=function(m){},c._csiHandlerFb=function(m,C){},c._escHandlerFb=function(m){},c._errorHandlerFb=function(m){return m},c._printHandler=c._printHandlerFb,c._executeHandlers=Object.create(null),c._csiHandlers=Object.create(null),c._escHandlers=Object.create(null),c._oscParser=new U.OscParser,c._dcsParser=new S.DcsParser,c._errorHandler=c._errorHandlerFb,c.setEscHandler({final:"\\"},function(){}),c}return K(u,f),u.prototype._identifier=function(l,c){c===void 0&&(c=[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 C=0;C<l.intermediates.length;++C){var M=l.intermediates.charCodeAt(C);if(32>M||M>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");m<<=8,m|=M}}if(l.final.length!==1)throw new Error("final must be a single byte");var k=l.final.charCodeAt(0);if(c[0]>k||k>c[1])throw new Error("final must be in range "+c[0]+" .. "+c[1]);return m<<=8,m|=k},u.prototype.identToString=function(l){for(var c=[];l;)c.push(String.fromCharCode(255&l)),l>>=8;return c.reverse().join("")},u.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},u.prototype.setPrintHandler=function(l){this._printHandler=l},u.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},u.prototype.addEscHandler=function(l,c){var m=this._identifier(l,[48,126]);this._escHandlers[m]===void 0&&(this._escHandlers[m]=[]);var C=this._escHandlers[m];return C.push(c),{dispose:function(){var M=C.indexOf(c);M!==-1&&C.splice(M,1)}}},u.prototype.setEscHandler=function(l,c){this._escHandlers[this._identifier(l,[48,126])]=[c]},u.prototype.clearEscHandler=function(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]},u.prototype.setEscHandlerFallback=function(l){this._escHandlerFb=l},u.prototype.setExecuteHandler=function(l,c){this._executeHandlers[l.charCodeAt(0)]=c},u.prototype.clearExecuteHandler=function(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]},u.prototype.setExecuteHandlerFallback=function(l){this._executeHandlerFb=l},u.prototype.addCsiHandler=function(l,c){var m=this._identifier(l);this._csiHandlers[m]===void 0&&(this._csiHandlers[m]=[]);var C=this._csiHandlers[m];return C.push(c),{dispose:function(){var M=C.indexOf(c);M!==-1&&C.splice(M,1)}}},u.prototype.setCsiHandler=function(l,c){this._csiHandlers[this._identifier(l)]=[c]},u.prototype.clearCsiHandler=function(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]},u.prototype.setCsiHandlerFallback=function(l){this._csiHandlerFb=l},u.prototype.addDcsHandler=function(l,c){return this._dcsParser.addHandler(this._identifier(l),c)},u.prototype.setDcsHandler=function(l,c){this._dcsParser.setHandler(this._identifier(l),c)},u.prototype.clearDcsHandler=function(l){this._dcsParser.clearHandler(this._identifier(l))},u.prototype.setDcsHandlerFallback=function(l){this._dcsParser.setHandlerFallback(l)},u.prototype.addOscHandler=function(l,c){return this._oscParser.addHandler(l,c)},u.prototype.setOscHandler=function(l,c){this._oscParser.setHandler(l,c)},u.prototype.clearOscHandler=function(l){this._oscParser.clearHandler(l)},u.prototype.setOscHandlerFallback=function(l){this._oscParser.setHandlerFallback(l)},u.prototype.setErrorHandler=function(l){this._errorHandler=l},u.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},u.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},u.prototype.parse=function(l,c){for(var m=0,C=0,M=this.currentState,k=this._oscParser,E=this._dcsParser,T=this._collect,I=this._params,F=this._transitions.table,H=0;H<c;++H){switch((C=F[M<<8|((m=l[H])<160?m:160)])>>4){case 2:for(var W=H+1;;++W){if(W>=c||(m=l[W])<32||m>126&&m<160){this._printHandler(l,H,W),H=W-1;break}if(++W>=c||(m=l[W])<32||m>126&&m<160){this._printHandler(l,H,W),H=W-1;break}if(++W>=c||(m=l[W])<32||m>126&&m<160){this._printHandler(l,H,W),H=W-1;break}if(++W>=c||(m=l[W])<32||m>126&&m<160){this._printHandler(l,H,W),H=W-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:H,code:m,currentState:M,collect:T,params:I,abort:!1}).abort)return;break;case 7:for(var z=this._csiHandlers[T<<8|m],ie=z?z.length-1:-1;ie>=0&&z[ie](I)===!1;ie--);ie<0&&this._csiHandlerFb(T<<8|m,I),this.precedingCodepoint=0;break;case 8:do switch(m){case 59:I.addParam(0);break;case 58:I.addSubParam(-1);break;default:I.addDigit(m-48)}while(++H<c&&(m=l[H])>47&&m<60);H--;break;case 9:T<<=8,T|=m;break;case 10:for(var re=this._escHandlers[T<<8|m],_e=re?re.length-1:-1;_e>=0&&re[_e]()===!1;_e--);_e<0&&this._escHandlerFb(T<<8|m),this.precedingCodepoint=0;break;case 11:I.reset(),I.addParam(0),T=0;break;case 12:E.hook(T<<8|m,I);break;case 13:for(var Ae=H+1;;++Ae)if(Ae>=c||(m=l[Ae])===24||m===26||m===27||m>127&&m<160){E.put(l,H,Ae),H=Ae-1;break}break;case 14:E.unhook(m!==24&&m!==26),m===27&&(C|=1),I.reset(),I.addParam(0),T=0,this.precedingCodepoint=0;break;case 4:k.start();break;case 5:for(var ce=H+1;;ce++)if(ce>=c||(m=l[ce])<32||m>127&&m<=159){k.put(l,H,ce),H=ce-1;break}break;case 6:k.end(m!==24&&m!==26),m===27&&(C|=1),I.reset(),I.addParam(0),T=0,this.precedingCodepoint=0}M=15&C}this._collect=T,this.currentState=M},u}(P.Disposable);y.EscapeSequenceParser=w},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(k,E){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,I){T.__proto__=I}||function(T,I){for(var F in I)I.hasOwnProperty(F)&&(T[F]=I[F])})(k,E)},function(k,E){function T(){this.constructor=k}N(k,E),k.prototype=E===null?Object.create(E):(T.prototype=E.prototype,new T)}),P=this&&this.__decorate||function(k,E,T,I){var F,H=arguments.length,W=H<3?E:I===null?I=Object.getOwnPropertyDescriptor(E,T):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(k,E,T,I);else for(var z=k.length-1;z>=0;z--)(F=k[z])&&(W=(H<3?F(W):H>3?F(E,T,W):F(E,T))||W);return H>3&&W&&Object.defineProperty(E,T,W),W},A=this&&this.__param||function(k,E){return function(T,I){E(T,I,k)}};Object.defineProperty(y,"__esModule",{value:!0}),y.Renderer=void 0;var d=R(41),U=R(47),S=R(48),s=R(49),w=R(29),f=R(2),u=R(5),l=R(1),c=R(25),m=R(0),C=1,M=function(k){function E(T,I,F,H,W,z,ie,re,_e){var Ae=k.call(this)||this;Ae._colors=T,Ae._screenElement=I,Ae._bufferService=W,Ae._charSizeService=z,Ae._optionsService=ie,Ae._id=C++,Ae._onRequestRedraw=new m.EventEmitter;var ce=Ae._optionsService.options.allowTransparency;return Ae._characterJoinerRegistry=new w.CharacterJoinerRegistry(Ae._bufferService),Ae._renderLayers=[new d.TextRenderLayer(Ae._screenElement,0,Ae._colors,Ae._characterJoinerRegistry,ce,Ae._id,Ae._bufferService,ie),new U.SelectionRenderLayer(Ae._screenElement,1,Ae._colors,Ae._id,Ae._bufferService,ie),new s.LinkRenderLayer(Ae._screenElement,2,Ae._colors,Ae._id,F,H,Ae._bufferService,ie),new S.CursorRenderLayer(Ae._screenElement,3,Ae._colors,Ae._id,Ae._onRequestRedraw,Ae._bufferService,ie,re,_e)],Ae.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},Ae._devicePixelRatio=window.devicePixelRatio,Ae._updateDimensions(),Ae.onOptionsChanged(),Ae}return K(E,k),Object.defineProperty(E.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),E.prototype.dispose=function(){for(var T=0,I=this._renderLayers;T<I.length;T++)I[T].dispose();k.prototype.dispose.call(this),c.removeTerminalFromCache(this._id)},E.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},E.prototype.setColors=function(T){this._colors=T;for(var I=0,F=this._renderLayers;I<F.length;I++){var H=F[I];H.setColors(this._colors),H.reset()}},E.prototype.onResize=function(T,I){this._updateDimensions();for(var F=0,H=this._renderLayers;F<H.length;F++)H[F].resize(this.dimensions);this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},E.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},E.prototype.onBlur=function(){this._runOperation(function(T){return T.onBlur()})},E.prototype.onFocus=function(){this._runOperation(function(T){return T.onFocus()})},E.prototype.onSelectionChanged=function(T,I,F){F===void 0&&(F=!1),this._runOperation(function(H){return H.onSelectionChanged(T,I,F)})},E.prototype.onCursorMove=function(){this._runOperation(function(T){return T.onCursorMove()})},E.prototype.onOptionsChanged=function(){this._runOperation(function(T){return T.onOptionsChanged()})},E.prototype.clear=function(){this._runOperation(function(T){return T.reset()})},E.prototype._runOperation=function(T){for(var I=0,F=this._renderLayers;I<F.length;I++)T(F[I])},E.prototype.renderRows=function(T,I){for(var F=0,H=this._renderLayers;F<H.length;F++)H[F].onGridChanged(T,I)},E.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)},E.prototype.registerCharacterJoiner=function(T){return this._characterJoinerRegistry.registerCharacterJoiner(T)},E.prototype.deregisterCharacterJoiner=function(T){return this._characterJoinerRegistry.deregisterCharacterJoiner(T)},E=P([A(4,l.IBufferService),A(5,u.ICharSizeService),A(6,l.IOptionsService),A(7,l.ICoreService),A(8,u.ICoreBrowserService)],E)}(f.Disposable);y.Renderer=M},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(f,u){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var m in c)c.hasOwnProperty(m)&&(l[m]=c[m])})(f,u)},function(f,u){function l(){this.constructor=f}N(f,u),f.prototype=u===null?Object.create(u):(l.prototype=u.prototype,new l)});Object.defineProperty(y,"__esModule",{value:!0}),y.TextRenderLayer=void 0;var P=R(42),A=R(13),d=R(6),U=R(3),S=R(29),s=R(4),w=function(f){function u(l,c,m,C,M,k,E,T){var I=f.call(this,l,"text",c,M,m,k,E,T)||this;return I._characterWidth=0,I._characterFont="",I._characterOverlapCache={},I._workCell=new s.CellData,I._state=new P.GridCache,I._characterJoinerRegistry=C,I}return K(u,f),u.prototype.resize=function(l){f.prototype.resize.call(this,l);var c=this._getFont(!1,!1);this._characterWidth===l.scaledCharWidth&&this._characterFont===c||(this._characterWidth=l.scaledCharWidth,this._characterFont=c,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},u.prototype.reset=function(){this._state.clear(),this._clearAll()},u.prototype._forEachCell=function(l,c,m,C){for(var M=l;M<=c;M++)for(var k=M+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.lines.get(k),T=m?m.getJoinedCharacters(k):[],I=0;I<this._bufferService.cols;I++){E.loadCell(I,this._workCell);var F=this._workCell,H=!1,W=I;if(F.getWidth()!==0){if(T.length>0&&I===T[0][0]){H=!0;var z=T.shift();F=new S.JoinedCellData(this._workCell,E.translateToString(!0,z[0],z[1]),z[1]-z[0]),W=z[1]-1}!H&&this._isOverlapping(F)&&W<E.length-1&&E.getCodePoint(W+1)===U.NULL_CELL_CODE&&(F.content&=-12582913,F.content|=2<<22),C(F,I,M),I=W}}},u.prototype._drawBackground=function(l,c){var m=this,C=this._ctx,M=this._bufferService.cols,k=0,E=0,T=null;C.save(),this._forEachCell(l,c,null,function(I,F,H){var W=null;I.isInverse()?W=I.isFgDefault()?m._colors.foreground.css:I.isFgRGB()?"rgb("+d.AttributeData.toColorRGB(I.getFgColor()).join(",")+")":m._colors.ansi[I.getFgColor()].css:I.isBgRGB()?W="rgb("+d.AttributeData.toColorRGB(I.getBgColor()).join(",")+")":I.isBgPalette()&&(W=m._colors.ansi[I.getBgColor()].css),T===null&&(k=F,E=H),H!==E?(C.fillStyle=T||"",m._fillCells(k,E,M-k,1),k=F,E=H):T!==W&&(C.fillStyle=T||"",m._fillCells(k,E,F-k,1),k=F,E=H),T=W}),T!==null&&(C.fillStyle=T,this._fillCells(k,E,M-k,1)),C.restore()},u.prototype._drawForeground=function(l,c){var m=this;this._forEachCell(l,c,this._characterJoinerRegistry,function(C,M,k){if(!C.isInvisible()&&(m._drawChars(C,M,k),C.isUnderline())){if(m._ctx.save(),C.isInverse())if(C.isBgDefault())m._ctx.fillStyle=m._colors.background.css;else if(C.isBgRGB())m._ctx.fillStyle="rgb("+d.AttributeData.toColorRGB(C.getBgColor()).join(",")+")";else{var E=C.getBgColor();m._optionsService.options.drawBoldTextInBrightColors&&C.isBold()&&E<8&&(E+=8),m._ctx.fillStyle=m._colors.ansi[E].css}else if(C.isFgDefault())m._ctx.fillStyle=m._colors.foreground.css;else if(C.isFgRGB())m._ctx.fillStyle="rgb("+d.AttributeData.toColorRGB(C.getFgColor()).join(",")+")";else{var T=C.getFgColor();m._optionsService.options.drawBoldTextInBrightColors&&C.isBold()&&T<8&&(T+=8),m._ctx.fillStyle=m._colors.ansi[T].css}m._fillBottomLineAtCells(M,k,C.getWidth()),m._ctx.restore()}})},u.prototype.onGridChanged=function(l,c){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,l,this._bufferService.cols,c-l+1),this._drawBackground(l,c),this._drawForeground(l,c))},u.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},u.prototype._isOverlapping=function(l){if(l.getWidth()!==1||l.getCode()<256)return!1;var c=l.getChars();if(this._characterOverlapCache.hasOwnProperty(c))return this._characterOverlapCache[c];this._ctx.save(),this._ctx.font=this._characterFont;var m=Math.floor(this._ctx.measureText(c).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[c]=m,m},u}(A.BaseRenderLayer);y.TextRenderLayer=w},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.GridCache=void 0;var N=function(){function K(){this.cache=[]}return K.prototype.resize=function(P,A){for(var d=0;d<P;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=P},K.prototype.clear=function(){for(var P=0;P<this.cache.length;P++)for(var A=0;A<this.cache[P].length;A++)this.cache[P][A]=void 0},K}();y.GridCache=N},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(m,C){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,k){M.__proto__=k}||function(M,k){for(var E in k)k.hasOwnProperty(E)&&(M[E]=k[E])})(m,C)},function(m,C){function M(){this.constructor=m}N(m,C),m.prototype=C===null?Object.create(C):(M.prototype=C.prototype,new M)});Object.defineProperty(y,"__esModule",{value:!0}),y.NoneCharAtlas=y.DynamicCharAtlas=y.getGlyphCacheKey=void 0;var P=R(9),A=R(44),d=R(27),U=R(46),S=R(11),s=R(28),w=R(10),f={css:"rgba(0, 0, 0, 0)",rgba:0};function u(m){return m.code<<21|m.bg<<12|m.fg<<3|(m.bold?0:4)+(m.dim?0:2)+(m.italic?0:1)}y.getGlyphCacheKey=u;var l=function(m){function C(M,k){var E=m.call(this)||this;E._config=k,E._drawToCacheCount=0,E._glyphsWaitingOnBitmap=[],E._bitmapCommitTimeout=null,E._bitmap=null,E._cacheCanvas=M.createElement("canvas"),E._cacheCanvas.width=1024,E._cacheCanvas.height=1024,E._cacheCtx=s.throwIfFalsy(E._cacheCanvas.getContext("2d",{alpha:!0}));var T=M.createElement("canvas");T.width=E._config.scaledCharWidth,T.height=E._config.scaledCharHeight,E._tmpCtx=s.throwIfFalsy(T.getContext("2d",{alpha:E._config.allowTransparency})),E._width=Math.floor(1024/E._config.scaledCharWidth),E._height=Math.floor(1024/E._config.scaledCharHeight);var I=E._width*E._height;return E._cacheMap=new U.LRUMap(I),E._cacheMap.prealloc(I),E}return K(C,m),C.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},C.prototype.beginFrame=function(){this._drawToCacheCount=0},C.prototype.draw=function(M,k,E,T){if(k.code===32)return!0;if(!this._canCache(k))return!1;var I=u(k),F=this._cacheMap.get(I);if(F!=null)return this._drawFromCache(M,F,E,T),!0;if(this._drawToCacheCount<100){var H=void 0;H=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var W=this._drawToCache(k,H);return this._cacheMap.set(I,W),this._drawFromCache(M,W,E,T),!0}return!1},C.prototype._canCache=function(M){return M.code<256},C.prototype._toCoordinateX=function(M){return M%this._width*this._config.scaledCharWidth},C.prototype._toCoordinateY=function(M){return Math.floor(M/this._width)*this._config.scaledCharHeight},C.prototype._drawFromCache=function(M,k,E,T){if(!k.isEmpty){var I=this._toCoordinateX(k.index),F=this._toCoordinateY(k.index);M.drawImage(k.inBitmap?this._bitmap:this._cacheCanvas,I,F,this._config.scaledCharWidth,this._config.scaledCharHeight,E,T,this._config.scaledCharWidth,this._config.scaledCharHeight)}},C.prototype._getColorFromAnsiIndex=function(M){return M<this._config.colors.ansi.length?this._config.colors.ansi[M]:d.DEFAULT_ANSI_COLORS[M]},C.prototype._getBackgroundColor=function(M){return this._config.allowTransparency?f:M.bg===P.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:M.bg<256?this._getColorFromAnsiIndex(M.bg):this._config.colors.background},C.prototype._getForegroundColor=function(M){return M.fg===P.INVERTED_DEFAULT_COLOR?w.color.opaque(this._config.colors.background):M.fg<256?this._getColorFromAnsiIndex(M.fg):this._config.colors.foreground},C.prototype._drawToCache=function(M,k){this._drawToCacheCount++,this._tmpCtx.save();var E=this._getBackgroundColor(M);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var T=M.bold?this._config.fontWeightBold:this._config.fontWeight,I=M.italic?"italic":"";this._tmpCtx.font=I+" "+T+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(M).css,M.dim&&(this._tmpCtx.globalAlpha=P.DIM_OPACITY),this._tmpCtx.fillText(M.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var F=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),H=!1;this._config.allowTransparency||(H=function(re,_e){for(var Ae=!0,ce=_e.rgba>>>24,J=_e.rgba>>>16&255,ae=_e.rgba>>>8&255,G=0;G<re.data.length;G+=4)re.data[G]===ce&&re.data[G+1]===J&&re.data[G+2]===ae?re.data[G+3]=0:Ae=!1;return Ae}(F,E));var W=this._toCoordinateX(k),z=this._toCoordinateY(k);this._cacheCtx.putImageData(F,W,z);var ie={index:k,isEmpty:H,inBitmap:!1};return this._addGlyphToBitmap(ie),ie},C.prototype._addGlyphToBitmap=function(M){var k=this;!("createImageBitmap"in window)||S.isFirefox||S.isSafari||(this._glyphsWaitingOnBitmap.push(M),this._bitmapCommitTimeout===null&&(this._bitmapCommitTimeout=window.setTimeout(function(){return k._generateBitmap()},100)))},C.prototype._generateBitmap=function(){var M=this,k=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(E){M._bitmap=E;for(var T=0;T<k.length;T++)k[T].inBitmap=!0}),this._bitmapCommitTimeout=null},C}(A.BaseCharAtlas);y.DynamicCharAtlas=l;var c=function(m){function C(M,k){return m.call(this)||this}return K(C,m),C.prototype.draw=function(M,k,E,T){return!1},C}(A.BaseCharAtlas);y.NoneCharAtlas=c},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.BaseCharAtlas=void 0;var N=function(){function K(){this._didWarmUp=!1}return K.prototype.dispose=function(){},K.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},K.prototype._doWarmUp=function(){},K.prototype.beginFrame=function(){},K}();y.BaseCharAtlas=N},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.ColorContrastCache=void 0;var N=function(){function K(){this._color={},this._rgba={}}return K.prototype.clear=function(){this._color={},this._rgba={}},K.prototype.setCss=function(P,A,d){this._rgba[P]||(this._rgba[P]={}),this._rgba[P][A]=d},K.prototype.getCss=function(P,A){return this._rgba[P]?this._rgba[P][A]:void 0},K.prototype.setColor=function(P,A,d){this._color[P]||(this._color[P]={}),this._color[P][A]=d},K.prototype.getColor=function(P,A){return this._color[P]?this._color[P][A]:void 0},K}();y.ColorContrastCache=N},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.LRUMap=void 0;var N=function(){function K(P){this.capacity=P,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return K.prototype._unlinkNode=function(P){var A=P.prev,d=P.next;P===this._head&&(this._head=d),P===this._tail&&(this._tail=A),A!==null&&(A.next=d),d!==null&&(d.prev=A)},K.prototype._appendNode=function(P){var A=this._tail;A!==null&&(A.next=P),P.prev=A,P.next=null,this._tail=P,this._head===null&&(this._head=P)},K.prototype.prealloc=function(P){for(var A=this._nodePool,d=0;d<P;d++)A.push({prev:null,next:null,key:null,value:null})},K.prototype.get=function(P){var A=this._map[P];return A!==void 0?(this._unlinkNode(A),this._appendNode(A),A.value):null},K.prototype.peekValue=function(P){var A=this._map[P];return A!==void 0?A.value:null},K.prototype.peek=function(){var P=this._head;return P===null?null:P.value},K.prototype.set=function(P,A){var d=this._map[P];if(d!==void 0)d=this._map[P],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=P,d.value=A,this._map[P]=d;else{var U=this._nodePool;U.length>0?((d=U.pop()).key=P,d.value=A):d={prev:null,next:null,key:P,value:A},this._map[P]=d,this.size++}this._appendNode(d)},K}();y.LRUMap=N},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(A,d){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,S){U.__proto__=S}||function(U,S){for(var s in S)S.hasOwnProperty(s)&&(U[s]=S[s])})(A,d)},function(A,d){function U(){this.constructor=A}N(A,d),A.prototype=d===null?Object.create(d):(U.prototype=d.prototype,new U)});Object.defineProperty(y,"__esModule",{value:!0}),y.SelectionRenderLayer=void 0;var P=function(A){function d(U,S,s,w,f,u){var l=A.call(this,U,"selection",S,!0,s,w,f,u)||this;return l._clearState(),l}return K(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,S,s){if(this._didStateChange(U,S,s,this._bufferService.buffer.ydisp))if(this._clearAll(),U&&S){var w=U[1]-this._bufferService.buffer.ydisp,f=S[1]-this._bufferService.buffer.ydisp,u=Math.max(w,0),l=Math.min(f,this._bufferService.rows-1);if(!(u>=this._bufferService.rows||l<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,s){var c=U[0],m=S[0]-c,C=l-u+1;this._fillCells(c,u,m,C)}else{c=w===u?U[0]:0;var M=u===l?S[0]:this._bufferService.cols;this._fillCells(c,u,M-c,1);var k=Math.max(l-u-1,0);if(this._fillCells(0,u+1,this._bufferService.cols,k),u!==l){var E=f===l?S[0]:this._bufferService.cols;this._fillCells(0,l,E,1)}}this._state.start=[U[0],U[1]],this._state.end=[S[0],S[1]],this._state.columnSelectMode=s,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},d.prototype._didStateChange=function(U,S,s,w){return!this._areCoordinatesEqual(U,this._state.start)||!this._areCoordinatesEqual(S,this._state.end)||s!==this._state.columnSelectMode||w!==this._state.ydisp},d.prototype._areCoordinatesEqual=function(U,S){return!(!U||!S)&&U[0]===S[0]&&U[1]===S[1]},d}(R(13).BaseRenderLayer);y.SelectionRenderLayer=P},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(S,s){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,f){w.__proto__=f}||function(w,f){for(var u in f)f.hasOwnProperty(u)&&(w[u]=f[u])})(S,s)},function(S,s){function w(){this.constructor=S}N(S,s),S.prototype=s===null?Object.create(s):(w.prototype=s.prototype,new w)});Object.defineProperty(y,"__esModule",{value:!0}),y.CursorRenderLayer=void 0;var P=R(13),A=R(4),d=function(S){function s(w,f,u,l,c,m,C,M,k){var E=S.call(this,w,"cursor",f,!0,u,l,m,C)||this;return E._onRequestRedraw=c,E._coreService=M,E._coreBrowserService=k,E._cell=new A.CellData,E._state={x:0,y:0,isFocused:!1,style:"",width:0},E._cursorRenderers={bar:E._renderBarCursor.bind(E),block:E._renderBlockCursor.bind(E),underline:E._renderUnderlineCursor.bind(E)},E}return K(s,S),s.prototype.resize=function(w){S.prototype.resize.call(this,w),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},s.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},s.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},s.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},s.prototype.onOptionsChanged=function(){var w,f=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new U(this._coreBrowserService.isFocused,function(){f._render(!0)})):((w=this._cursorBlinkStateManager)===null||w===void 0||w.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},s.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},s.prototype.onGridChanged=function(w,f){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},s.prototype._render=function(w){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var f=this._bufferService.buffer.ybase+this._bufferService.buffer.y,u=f-this._bufferService.buffer.ydisp;if(u<0||u>=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 c=this._optionsService.options.cursorStyle;return c&&c!=="block"?this._cursorRenderers[c](l,u,this._cell):this._renderBlurCursor(l,u,this._cell),this._ctx.restore(),this._state.x=l,this._state.y=u,this._state.isFocused=!1,this._state.style=c,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===l&&this._state.y===u&&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,u,this._cell),this._ctx.restore(),this._state.x=l,this._state.y=u,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},s.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})},s.prototype._renderBarCursor=function(w,f,u){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(w,f,this._optionsService.options.cursorWidth),this._ctx.restore()},s.prototype._renderBlockCursor=function(w,f,u){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(w,f,u.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(u,w,f),this._ctx.restore()},s.prototype._renderUnderlineCursor=function(w,f,u){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(w,f),this._ctx.restore()},s.prototype._renderBlurCursor=function(w,f,u){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(w,f,u.getWidth(),1),this._ctx.restore()},s}(P.BaseRenderLayer);y.CursorRenderLayer=d;var U=function(){function S(s,w){this._renderCallback=w,this.isCursorVisible=!0,s&&this._restartInterval()}return Object.defineProperty(S.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),S.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)},S.prototype.restartBlinkAnimation=function(){var s=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){s._renderCallback(),s._animationFrame=void 0})))},S.prototype._restartInterval=function(s){var w=this;s===void 0&&(s=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(w._animationTimeRestarted){var f=600-(Date.now()-w._animationTimeRestarted);if(w._animationTimeRestarted=void 0,f>0)return void w._restartInterval(f)}w.isCursorVisible=!1,w._animationFrame=window.requestAnimationFrame(function(){w._renderCallback(),w._animationFrame=void 0}),w._blinkInterval=window.setInterval(function(){if(w._animationTimeRestarted){var u=600-(Date.now()-w._animationTimeRestarted);return w._animationTimeRestarted=void 0,void w._restartInterval(u)}w.isCursorVisible=!w.isCursorVisible,w._animationFrame=window.requestAnimationFrame(function(){w._renderCallback(),w._animationFrame=void 0})},600)},s)},S.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)},S.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},S}()},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(S,s){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,f){w.__proto__=f}||function(w,f){for(var u in f)f.hasOwnProperty(u)&&(w[u]=f[u])})(S,s)},function(S,s){function w(){this.constructor=S}N(S,s),S.prototype=s===null?Object.create(s):(w.prototype=s.prototype,new w)});Object.defineProperty(y,"__esModule",{value:!0}),y.LinkRenderLayer=void 0;var P=R(13),A=R(9),d=R(26),U=function(S){function s(w,f,u,l,c,m,C,M){var k=S.call(this,w,"link",f,!0,u,l,C,M)||this;return c.onShowLinkUnderline(function(E){return k._onShowLinkUnderline(E)}),c.onHideLinkUnderline(function(E){return k._onHideLinkUnderline(E)}),m.onShowLinkUnderline(function(E){return k._onShowLinkUnderline(E)}),m.onHideLinkUnderline(function(E){return k._onHideLinkUnderline(E)}),k}return K(s,S),s.prototype.resize=function(w){S.prototype.resize.call(this,w),this._state=void 0},s.prototype.reset=function(){this._clearCurrentLink()},s.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var w=this._state.y2-this._state.y1-1;w>0&&this._clearCells(0,this._state.y1+1,this._state.cols,w),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},s.prototype._onShowLinkUnderline=function(w){if(w.fg===A.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:w.fg&&d.is256Color(w.fg)?this._ctx.fillStyle=this._colors.ansi[w.fg].css:this._ctx.fillStyle=this._colors.foreground.css,w.y1===w.y2)this._fillBottomLineAtCells(w.x1,w.y1,w.x2-w.x1);else{this._fillBottomLineAtCells(w.x1,w.y1,w.cols-w.x1);for(var f=w.y1+1;f<w.y2;f++)this._fillBottomLineAtCells(0,f,w.cols);this._fillBottomLineAtCells(0,w.y2,w.x2)}this._state=w},s.prototype._onHideLinkUnderline=function(w){this._clearCurrentLink()},s}(P.BaseRenderLayer);y.LinkRenderLayer=U},function(ke,y,R){"use strict";var N=this&&this.__decorate||function(S,s,w,f){var u,l=arguments.length,c=l<3?s:f===null?f=Object.getOwnPropertyDescriptor(s,w):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(S,s,w,f);else for(var m=S.length-1;m>=0;m--)(u=S[m])&&(c=(l<3?u(c):l>3?u(s,w,c):u(s,w))||c);return l>3&&c&&Object.defineProperty(s,w,c),c},K=this&&this.__param||function(S,s){return function(w,f){s(w,f,S)}};Object.defineProperty(y,"__esModule",{value:!0}),y.MouseZone=y.Linkifier=void 0;var P=R(0),A=R(1),d=function(){function S(s,w,f){this._bufferService=s,this._logService=w,this._unicodeService=f,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new P.EventEmitter,this._onHideLinkUnderline=new P.EventEmitter,this._onLinkTooltip=new P.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(S.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),S.prototype.attachToDom=function(s,w){this._element=s,this._mouseZoneManager=w},S.prototype.linkifyRows=function(s,w){var f=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=s,this._rowsToLinkify.end=w):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,s),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,w)),this._mouseZoneManager.clearAll(s,w),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return f._linkifyRows()},S._timeBeforeLatency))},S.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var s=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var w=s.ydisp+this._rowsToLinkify.start;if(!(w>=s.lines.length)){for(var f=s.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,u=Math.ceil(2e3/this._bufferService.cols),l=this._bufferService.buffer.iterator(!1,w,f,u,u);l.hasNext();)for(var c=l.next(),m=0;m<this._linkMatchers.length;m++)this._doLinkifyRow(c.range.first,c.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")},S.prototype.registerLinkMatcher=function(s,w,f){if(f===void 0&&(f={}),!w)throw new Error("handler must be defined");var u={id:this._nextLinkMatcherId++,regex:s,handler:w,matchIndex:f.matchIndex,validationCallback:f.validationCallback,hoverTooltipCallback:f.tooltipCallback,hoverLeaveCallback:f.leaveCallback,willLinkActivate:f.willLinkActivate,priority:f.priority||0};return this._addLinkMatcherToList(u),u.id},S.prototype._addLinkMatcherToList=function(s){if(this._linkMatchers.length!==0){for(var w=this._linkMatchers.length-1;w>=0;w--)if(s.priority<=this._linkMatchers[w].priority)return void this._linkMatchers.splice(w+1,0,s);this._linkMatchers.splice(0,0,s)}else this._linkMatchers.push(s)},S.prototype.deregisterLinkMatcher=function(s){for(var w=0;w<this._linkMatchers.length;w++)if(this._linkMatchers[w].id===s)return this._linkMatchers.splice(w,1),!0;return!1},S.prototype._doLinkifyRow=function(s,w,f){for(var u,l=this,c=new RegExp(f.regex.source,(f.regex.flags||"")+"g"),m=-1,C=function(){var k=u[typeof f.matchIndex!="number"?0:f.matchIndex];if(!k)return M._logService.debug("match found without corresponding matchIndex",u,f),"break";if(m=w.indexOf(k,m+1),c.lastIndex=m+k.length,m<0)return"break";var E=M._bufferService.buffer.stringIndexToBufferIndex(s,m);if(E[0]<0)return"break";var T=M._bufferService.buffer.lines.get(E[0]);if(!T)return"break";var I=T.getFg(E[1]),F=I?I>>9&511:void 0;f.validationCallback?f.validationCallback(k,function(H){l._rowsTimeoutId||H&&l._addLink(E[1],E[0]-l._bufferService.buffer.ydisp,k,f,F)}):M._addLink(E[1],E[0]-M._bufferService.buffer.ydisp,k,f,F)},M=this;(u=c.exec(w))!==null&&C()!=="break";);},S.prototype._addLink=function(s,w,f,u,l){var c=this;if(this._mouseZoneManager&&this._element){var m=this._unicodeService.getStringCellWidth(f),C=s%this._bufferService.cols,M=w+Math.floor(s/this._bufferService.cols),k=(C+m)%this._bufferService.cols,E=M+Math.floor((C+m)/this._bufferService.cols);k===0&&(k=this._bufferService.cols,E--),this._mouseZoneManager.add(new U(C+1,M+1,k+1,E+1,function(T){if(u.handler)return u.handler(T,f);var I=window.open();I?(I.opener=null,I.location.href=f):console.warn("Opening link blocked as opener could not be cleared")},function(){c._onShowLinkUnderline.fire(c._createLinkHoverEvent(C,M,k,E,l)),c._element.classList.add("xterm-cursor-pointer")},function(T){c._onLinkTooltip.fire(c._createLinkHoverEvent(C,M,k,E,l)),u.hoverTooltipCallback&&u.hoverTooltipCallback(T,f,{start:{x:C,y:M},end:{x:k,y:E}})},function(){c._onHideLinkUnderline.fire(c._createLinkHoverEvent(C,M,k,E,l)),c._element.classList.remove("xterm-cursor-pointer"),u.hoverLeaveCallback&&u.hoverLeaveCallback()},function(T){return!u.willLinkActivate||u.willLinkActivate(T,f)}))}},S.prototype._createLinkHoverEvent=function(s,w,f,u,l){return{x1:s,y1:w,x2:f,y2:u,cols:this._bufferService.cols,fg:l}},S._timeBeforeLatency=200,S=N([K(0,A.IBufferService),K(1,A.ILogService),K(2,A.IUnicodeService)],S)}();y.Linkifier=d;var U=function(S,s,w,f,u,l,c,m,C){this.x1=S,this.y1=s,this.x2=w,this.y2=f,this.clickCallback=u,this.hoverCallback=l,this.tooltipCallback=c,this.leaveCallback=m,this.willLinkActivate=C};y.MouseZone=U},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(k,E){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,I){T.__proto__=I}||function(T,I){for(var F in I)I.hasOwnProperty(F)&&(T[F]=I[F])})(k,E)},function(k,E){function T(){this.constructor=k}N(k,E),k.prototype=E===null?Object.create(E):(T.prototype=E.prototype,new T)}),P=this&&this.__decorate||function(k,E,T,I){var F,H=arguments.length,W=H<3?E:I===null?I=Object.getOwnPropertyDescriptor(E,T):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(k,E,T,I);else for(var z=k.length-1;z>=0;z--)(F=k[z])&&(W=(H<3?F(W):H>3?F(E,T,W):F(E,T))||W);return H>3&&W&&Object.defineProperty(E,T,W),W},A=this&&this.__param||function(k,E){return function(T,I){E(T,I,k)}};Object.defineProperty(y,"__esModule",{value:!0}),y.SelectionService=void 0;var d=R(11),U=R(52),S=R(4),s=R(0),w=R(5),f=R(1),u=R(30),l=R(53),c=R(2),m="\xA0",C=new RegExp(m,"g"),M=function(k){function E(T,I,F,H,W,z,ie){var re=k.call(this)||this;return re._element=T,re._screenElement=I,re._bufferService=F,re._coreService=H,re._mouseService=W,re._optionsService=z,re._renderService=ie,re._dragScrollAmount=0,re._enabled=!0,re._workCell=new S.CellData,re._mouseDownTimeStamp=0,re._onLinuxMouseSelection=re.register(new s.EventEmitter),re._onRedrawRequest=re.register(new s.EventEmitter),re._onSelectionChange=re.register(new s.EventEmitter),re._onRequestScrollLines=re.register(new s.EventEmitter),re._mouseMoveListener=function(_e){return re._onMouseMove(_e)},re._mouseUpListener=function(_e){return re._onMouseUp(_e)},re._coreService.onUserInput(function(){re.hasSelection&&re.clearSelection()}),re._trimListener=re._bufferService.buffer.lines.onTrim(function(_e){return re._onTrim(_e)}),re.register(re._bufferService.buffers.onBufferActivate(function(_e){return re._onBufferActivate(_e)})),re.enable(),re._model=new U.SelectionModel(re._bufferService),re._activeSelectionMode=0,re}return K(E,k),Object.defineProperty(E.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),E.prototype.dispose=function(){this._removeMouseDownListeners()},E.prototype.reset=function(){this.clearSelection()},E.prototype.disable=function(){this.clearSelection(),this._enabled=!1},E.prototype.enable=function(){this._enabled=!0},Object.defineProperty(E.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"hasSelection",{get:function(){var T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!T||!I)&&(T[0]!==I[0]||T[1]!==I[1])},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"selectionText",{get:function(){var T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;if(!T||!I)return"";var F=this._bufferService.buffer,H=[];if(this._activeSelectionMode===3){if(T[0]===I[0])return"";for(var W=T[1];W<=I[1];W++){var z=F.translateBufferLineToString(W,!0,T[0],I[0]);H.push(z)}}else{var ie=T[1]===I[1]?I[0]:void 0;for(H.push(F.translateBufferLineToString(T[1],!0,T[0],ie)),W=T[1]+1;W<=I[1]-1;W++){var re=F.lines.get(W);z=F.translateBufferLineToString(W,!0),re&&re.isWrapped?H[H.length-1]+=z:H.push(z)}T[1]!==I[1]&&(re=F.lines.get(I[1]),z=F.translateBufferLineToString(I[1],!0,0,I[0]),re&&re.isWrapped?H[H.length-1]+=z:H.push(z))}return H.map(function(_e){return _e.replace(C," ")}).join(d.isWindows?`\r
|
|
|
`:`
|
|
|
`)},enumerable:!1,configurable:!0}),E.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},E.prototype.refresh=function(T){var I=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return I._refresh()})),d.isLinux&&T&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},E.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})},E.prototype.isClickInSelection=function(T){var I=this._getMouseBufferCoords(T),F=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(F&&H&&I)&&this._areCoordsInSelection(I,F,H)},E.prototype._areCoordsInSelection=function(T,I,F){return T[1]>I[1]&&T[1]<F[1]||I[1]===F[1]&&T[1]===I[1]&&T[0]>=I[0]&&T[0]<F[0]||I[1]<F[1]&&T[1]===F[1]&&T[0]<F[0]||I[1]<F[1]&&T[1]===I[1]&&T[0]>=I[0]},E.prototype.selectWordAtCursor=function(T){var I=this._getMouseBufferCoords(T);I&&(this._selectWordAt(I,!1),this._model.selectionEnd=void 0,this.refresh(!0))},E.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},E.prototype.selectLines=function(T,I){this._model.clearSelection(),T=Math.max(T,0),I=Math.min(I,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,I],this.refresh(),this._onSelectionChange.fire()},E.prototype._onTrim=function(T){this._model.onTrim(T)&&this.refresh()},E.prototype._getMouseBufferCoords=function(T){var I=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(I)return I[0]--,I[1]--,I[1]+=this._bufferService.buffer.ydisp,I},E.prototype._getMouseEventScrollAmount=function(T){var I=u.getCoordsRelativeToElement(T,this._screenElement)[1],F=this._renderService.dimensions.canvasHeight;return I>=0&&I<=F?0:(I>F&&(I-=F),I=Math.min(Math.max(I,-50),50),(I/=50)/Math.abs(I)+Math.round(14*I))},E.prototype.shouldForceSelection=function(T){return d.isMac?T.altKey&&this._optionsService.options.macOptionClickForcesSelection:T.shiftKey},E.prototype.onMouseDown=function(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._onIncrementalClick(T):T.detail===1?this._onSingleClick(T):T.detail===2?this._onDoubleClick(T):T.detail===3&&this._onTripleClick(T),this._addMouseDownListeners(),this.refresh(!0)}},E.prototype._addMouseDownListeners=function(){var T=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return T._dragScroll()},50)},E.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},E.prototype._onIncrementalClick=function(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))},E.prototype._onSingleClick=function(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),this._model.selectionStart){this._model.selectionEnd=void 0;var I=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);I&&I.length!==this._model.selectionStart[0]&&I.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},E.prototype._onDoubleClick=function(T){var I=this._getMouseBufferCoords(T);I&&(this._activeSelectionMode=1,this._selectWordAt(I,!0))},E.prototype._onTripleClick=function(T){var I=this._getMouseBufferCoords(T);I&&(this._activeSelectionMode=2,this._selectLineAt(I[1]))},E.prototype.shouldColumnSelect=function(T){return T.altKey&&!(d.isMac&&this._optionsService.options.macOptionClickForcesSelection)},E.prototype._onMouseMove=function(T){if(T.stopImmediatePropagation(),this._model.selectionStart){var I=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(T),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(T),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var F=this._bufferService.buffer;if(this._model.selectionEnd[1]<F.lines.length){var H=F.lines.get(this._model.selectionEnd[1]);H&&H.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}I&&I[0]===this._model.selectionEnd[0]&&I[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}},E.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});var T=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}},E.prototype._onMouseUp=function(T){var I=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&I<500&&T.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var F=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(F&&F[0]!==void 0&&F[1]!==void 0){var H=l.moveToCellSequence(F[0]-1,F[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(H,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},E.prototype._onBufferActivate=function(T){var I=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim(function(F){return I._onTrim(F)})},E.prototype._convertViewportColToCharacterIndex=function(T,I){for(var F=I[0],H=0;I[0]>=H;H++){var W=T.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?F--:W>1&&I[0]!==H&&(F+=W-1)}return F},E.prototype.setSelection=function(T,I,F){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,I],this._model.selectionStartLength=F,this.refresh()},E.prototype._getWordAt=function(T,I,F,H){if(F===void 0&&(F=!0),H===void 0&&(H=!0),!(T[0]>=this._bufferService.cols)){var W=this._bufferService.buffer,z=W.lines.get(T[1]);if(z){var ie=W.translateBufferLineToString(T[1],!1),re=this._convertViewportColToCharacterIndex(z,T),_e=re,Ae=T[0]-re,ce=0,J=0,ae=0,G=0;if(ie.charAt(re)===" "){for(;re>0&&ie.charAt(re-1)===" ";)re--;for(;_e<ie.length&&ie.charAt(_e+1)===" ";)_e++}else{var X=T[0],Z=T[0];z.getWidth(X)===0&&(ce++,X--),z.getWidth(Z)===2&&(J++,Z++);var B=z.getString(Z).length;for(B>1&&(G+=B-1,_e+=B-1);X>0&&re>0&&!this._isCharWordSeparator(z.loadCell(X-1,this._workCell));){z.loadCell(X-1,this._workCell);var O=this._workCell.getChars().length;this._workCell.getWidth()===0?(ce++,X--):O>1&&(ae+=O-1,re-=O-1),re--,X--}for(;Z<z.length&&_e+1<ie.length&&!this._isCharWordSeparator(z.loadCell(Z+1,this._workCell));){z.loadCell(Z+1,this._workCell);var ne=this._workCell.getChars().length;this._workCell.getWidth()===2?(J++,Z++):ne>1&&(G+=ne-1,_e+=ne-1),_e++,Z++}}_e++;var me=re+Ae-ce+ae,Oe=Math.min(this._bufferService.cols,_e-re+ce+J-ae-G);if(I||ie.slice(re,_e).trim()!==""){if(F&&me===0&&z.getCodePoint(0)!==32){var He=W.lines.get(T[1]-1);if(He&&z.isWrapped&&He.getCodePoint(this._bufferService.cols-1)!==32){var ut=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(ut){var Fe=this._bufferService.cols-ut.start;me-=Fe,Oe+=Fe}}}if(H&&me+Oe===this._bufferService.cols&&z.getCodePoint(this._bufferService.cols-1)!==32){var it=W.lines.get(T[1]+1);if(it&&it.isWrapped&&it.getCodePoint(0)!==32){var st=this._getWordAt([0,T[1]+1],!1,!1,!0);st&&(Oe+=st.length)}}return{start:me,length:Oe}}}}},E.prototype._selectWordAt=function(T,I){var F=this._getWordAt(T,I);if(F){for(;F.start<0;)F.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[F.start,T[1]],this._model.selectionStartLength=F.length}},E.prototype._selectToWordAt=function(T){var I=this._getWordAt(T,!0);if(I){for(var F=T[1];I.start<0;)I.start+=this._bufferService.cols,F--;if(!this._model.areSelectionValuesReversed())for(;I.start+I.length>this._bufferService.cols;)I.length-=this._bufferService.cols,F++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?I.start:I.start+I.length,F]}},E.prototype._isCharWordSeparator=function(T){return T.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(T.getChars())>=0},E.prototype._selectLineAt=function(T){var I=this._bufferService.buffer.getWrappedRangeForLine(T);this._model.selectionStart=[0,I.first],this._model.selectionEnd=[this._bufferService.cols,I.last],this._model.selectionStartLength=0},E=P([A(2,f.IBufferService),A(3,f.ICoreService),A(4,w.IMouseService),A(5,f.IOptionsService),A(6,w.IRenderService)],E)}(c.Disposable);y.SelectionService=M},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.SelectionModel=void 0;var N=function(){function K(P){this._bufferService=P,this.isSelectAllActive=!1,this.selectionStartLength=0}return K.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(K.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){var P=this.selectionStart[0]+this.selectionStartLength;return P>this._bufferService.cols?[P%this._bufferService.cols,this.selectionStart[1]+Math.floor(P/this._bufferService.cols)]:[P,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!1,configurable:!0}),K.prototype.areSelectionValuesReversed=function(){var P=this.selectionStart,A=this.selectionEnd;return!(!P||!A)&&(P[1]>A[1]||P[1]===A[1]&&P[0]>A[0])},K.prototype.onTrim=function(P){return this.selectionStart&&(this.selectionStart[1]-=P),this.selectionEnd&&(this.selectionEnd[1]-=P),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},K}();y.SelectionModel=N},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.moveToCellSequence=void 0;var N=R(12);function K(s,w,f,u){var l=s-P(f,s),c=w-P(f,w);return S(Math.abs(l-c)-function(m,C,M){for(var k=0,E=m-P(M,m),T=C-P(M,C),I=0;I<Math.abs(E-T);I++){var F=A(m,C)==="A"?-1:1,H=M.buffer.lines.get(E+F*I);H&&H.isWrapped&&k++}return k}(s,w,f),U(A(s,w),u))}function P(s,w){for(var f=0,u=s.buffer.lines.get(w),l=u&&u.isWrapped;l&&w>=0&&w<s.rows;)f++,l=(u=s.buffer.lines.get(--w))&&u.isWrapped;return f}function A(s,w){return s>w?"A":"B"}function d(s,w,f,u,l,c){for(var m=s,C=w,M="";m!==f||C!==u;)m+=l?1:-1,l&&m>c.cols-1?(M+=c.buffer.translateBufferLineToString(C,!1,s,m),m=0,s=0,C++):!l&&m<0&&(M+=c.buffer.translateBufferLineToString(C,!1,0,s+1),s=m=c.cols-1,C--);return M+c.buffer.translateBufferLineToString(C,!1,s,m)}function U(s,w){var f=w?"O":"[";return N.C0.ESC+f+s}function S(s,w){s=Math.floor(s);for(var f="",u=0;u<s;u++)f+=w;return f}y.moveToCellSequence=function(s,w,f,u){var l,c=f.buffer.x,m=f.buffer.y;if(!f.buffer.hasScrollback)return function(M,k,E,T,I,F){return K(k,T,I,F).length===0?"":S(d(M,k,M,k-P(I,k),!1,I).length,U("D",F))}(c,m,0,w,f,u)+K(m,w,f,u)+function(M,k,E,T,I,F){var H;H=K(k,T,I,F).length>0?T-P(I,T):k;var W=T,z=function(ie,re,_e,Ae,ce,J){var ae;return ae=K(_e,Ae,ce,J).length>0?Ae-P(ce,Ae):re,ie<_e&&ae<=Ae||ie>=_e&&ae<Ae?"C":"D"}(M,k,E,T,I,F);return S(d(M,H,E,W,z==="C",I).length,U(z,F))}(c,m,s,w,f,u);if(m===w)return l=c>s?"D":"C",S(Math.abs(c-s),U(l,u));l=m>w?"D":"C";var C=Math.abs(m-w);return S(function(M,k){return k.cols-M}(m>w?s:c,f)+(C-1)*f.cols+1+((m>w?c:s)-1),U(l,u))}},function(ke,y,R){"use strict";var N=this&&this.__decorate||function(d,U,S,s){var w,f=arguments.length,u=f<3?U:s===null?s=Object.getOwnPropertyDescriptor(U,S):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(d,U,S,s);else for(var l=d.length-1;l>=0;l--)(w=d[l])&&(u=(f<3?w(u):f>3?w(U,S,u):w(U,S))||u);return f>3&&u&&Object.defineProperty(U,S,u),u},K=this&&this.__param||function(d,U){return function(S,s){U(S,s,d)}};Object.defineProperty(y,"__esModule",{value:!0}),y.SoundService=void 0;var P=R(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 S=U.createBufferSource();U.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(s){S.buffer=s,S.connect(U.destination),S.start(0)})}},d.prototype._base64ToArrayBuffer=function(U){for(var S=window.atob(U),s=S.length,w=new Uint8Array(s),f=0;f<s;f++)w[f]=S.charCodeAt(f);return w.buffer},d.prototype._removeMimeType=function(U){return U.split(",")[1]},d=N([K(0,P.IOptionsService)],d)}();y.SoundService=A},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(f,u){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var m in c)c.hasOwnProperty(m)&&(l[m]=c[m])})(f,u)},function(f,u){function l(){this.constructor=f}N(f,u),f.prototype=u===null?Object.create(u):(l.prototype=u.prototype,new l)}),P=this&&this.__decorate||function(f,u,l,c){var m,C=arguments.length,M=C<3?u:c===null?c=Object.getOwnPropertyDescriptor(u,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(f,u,l,c);else for(var k=f.length-1;k>=0;k--)(m=f[k])&&(M=(C<3?m(M):C>3?m(u,l,M):m(u,l))||M);return C>3&&M&&Object.defineProperty(u,l,M),M},A=this&&this.__param||function(f,u){return function(l,c){u(l,c,f)}};Object.defineProperty(y,"__esModule",{value:!0}),y.MouseZoneManager=void 0;var d=R(2),U=R(7),S=R(5),s=R(1),w=function(f){function u(l,c,m,C,M,k){var E=f.call(this)||this;return E._element=l,E._screenElement=c,E._bufferService=m,E._mouseService=C,E._selectionService=M,E._optionsService=k,E._zones=[],E._areZonesActive=!1,E._lastHoverCoords=[void 0,void 0],E._initialSelectionLength=0,E.register(U.addDisposableDomListener(E._element,"mousedown",function(T){return E._onMouseDown(T)})),E._mouseMoveListener=function(T){return E._onMouseMove(T)},E._mouseLeaveListener=function(T){return E._onMouseLeave(T)},E._clickListener=function(T){return E._onClick(T)},E}return K(u,f),u.prototype.dispose=function(){f.prototype.dispose.call(this),this._deactivate()},u.prototype.add=function(l){this._zones.push(l),this._zones.length===1&&this._activate()},u.prototype.clearAll=function(l,c){if(this._zones.length!==0){l&&c||(l=0,c=this._bufferService.rows-1);for(var m=0;m<this._zones.length;m++){var C=this._zones[m];(C.y1>l&&C.y1<=c+1||C.y2>l&&C.y2<=c+1||C.y1<l&&C.y2>c+1)&&(this._currentZone&&this._currentZone===C&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(m--,1))}this._zones.length===0&&this._deactivate()}},u.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))},u.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))},u.prototype._onMouseMove=function(l){this._lastHoverCoords[0]===l.pageX&&this._lastHoverCoords[1]===l.pageY||(this._onHover(l),this._lastHoverCoords=[l.pageX,l.pageY])},u.prototype._onHover=function(l){var c=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 c._onTooltip(l)},this._optionsService.options.linkTooltipHoverDuration)))},u.prototype._onTooltip=function(l){this._tooltipTimeout=void 0;var c=this._findZoneEventAt(l);c&&c.tooltipCallback&&c.tooltipCallback(l)},u.prototype._onMouseDown=function(l){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var c=this._findZoneEventAt(l);c!=null&&c.willLinkActivate(l)&&(l.preventDefault(),l.stopImmediatePropagation())}},u.prototype._onMouseLeave=function(l){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},u.prototype._onClick=function(l){var c=this._findZoneEventAt(l),m=this._getSelectionLength();c&&m===this._initialSelectionLength&&(c.clickCallback(l),l.preventDefault(),l.stopImmediatePropagation())},u.prototype._getSelectionLength=function(){var l=this._selectionService.selectionText;return l?l.length:0},u.prototype._findZoneEventAt=function(l){var c=this._mouseService.getCoords(l,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(c)for(var m=c[0],C=c[1],M=0;M<this._zones.length;M++){var k=this._zones[M];if(k.y1===k.y2){if(C===k.y1&&m>=k.x1&&m<k.x2)return k}else if(C===k.y1&&m>=k.x1||C===k.y2&&m<k.x2||C>k.y1&&C<k.y2)return k}},u=P([A(2,s.IBufferService),A(3,S.IMouseService),A(4,S.ISelectionService),A(5,s.IOptionsService)],u)}(d.Disposable);y.MouseZoneManager=w},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(u,l){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,m){c.__proto__=m}||function(c,m){for(var C in m)m.hasOwnProperty(C)&&(c[C]=m[C])})(u,l)},function(u,l){function c(){this.constructor=u}N(u,l),u.prototype=l===null?Object.create(l):(c.prototype=l.prototype,new c)});Object.defineProperty(y,"__esModule",{value:!0}),y.AccessibilityManager=void 0;var P=R(18),A=R(11),d=R(31),U=R(7),S=R(2),s=R(32),w=R(17),f=function(u){function l(c,m){var C=u.call(this)||this;C._terminal=c,C._renderService=m,C._liveRegionLineCount=0,C._charsToConsume=[],C._charsToAnnounce="",C._accessibilityTreeRoot=document.createElement("div"),C._accessibilityTreeRoot.classList.add("xterm-accessibility"),C._rowContainer=document.createElement("div"),C._rowContainer.classList.add("xterm-accessibility-tree"),C._rowContainer.setAttribute("role","list"),C._rowElements=[];for(var M=0;M<C._terminal.rows;M++)C._rowElements[M]=C._createAccessibilityTreeNode(),C._rowContainer.appendChild(C._rowElements[M]);if(C._topBoundaryFocusListener=function(k){return C._onBoundaryFocus(k,0)},C._bottomBoundaryFocusListener=function(k){return C._onBoundaryFocus(k,1)},C._rowElements[0].addEventListener("focus",C._topBoundaryFocusListener),C._rowElements[C._rowElements.length-1].addEventListener("focus",C._bottomBoundaryFocusListener),C._refreshRowsDimensions(),C._accessibilityTreeRoot.appendChild(C._rowContainer),C._renderRowsDebouncer=new d.RenderDebouncer(C._renderRows.bind(C)),C._refreshRows(),C._liveRegion=document.createElement("div"),C._liveRegion.classList.add("live-region"),C._liveRegion.setAttribute("aria-live","assertive"),C._accessibilityTreeRoot.appendChild(C._liveRegion),!C._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return C._terminal.element.insertAdjacentElement("afterbegin",C._accessibilityTreeRoot),C.register(C._renderRowsDebouncer),C.register(C._terminal.onResize(function(k){return C._onResize(k.rows)})),C.register(C._terminal.onRender(function(k){return C._refreshRows(k.start,k.end)})),C.register(C._terminal.onScroll(function(){return C._refreshRows()})),C.register(C._terminal.onA11yChar(function(k){return C._onChar(k)})),C.register(C._terminal.onLineFeed(function(){return C._onChar(`
|
|
|
`)})),C.register(C._terminal.onA11yTab(function(k){return C._onTab(k)})),C.register(C._terminal.onKey(function(k){return C._onKey(k.key)})),C.register(C._terminal.onBlur(function(){return C._clearLiveRegion()})),C.register(C._renderService.onDimensionsChange(function(){return C._refreshRowsDimensions()})),C._screenDprMonitor=new s.ScreenDprMonitor,C.register(C._screenDprMonitor),C._screenDprMonitor.setListener(function(){return C._refreshRowsDimensions()}),C.register(U.addDisposableDomListener(window,"resize",function(){return C._refreshRowsDimensions()})),C}return K(l,u),l.prototype.dispose=function(){u.prototype.dispose.call(this),w.removeElementFromParent(this._accessibilityTreeRoot),this._rowElements.length=0},l.prototype._onBoundaryFocus=function(c,m){var C=c.target,M=this._rowElements[m===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")!==(m===0?"1":""+this._terminal.buffer.lines.length)&&c.relatedTarget===M){var k,E;if(m===0?(k=C,E=this._rowElements.pop(),this._rowContainer.removeChild(E)):(k=this._rowElements.shift(),E=C,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),E.removeEventListener("focus",this._bottomBoundaryFocusListener),m===0){var T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else T=this._createAccessibilityTreeNode(),this._rowElements.push(T),this._rowContainer.appendChild(T);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(),c.preventDefault(),c.stopImmediatePropagation()}},l.prototype._onResize=function(c){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>c;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},l.prototype._createAccessibilityTreeNode=function(){var c=document.createElement("div");return c.setAttribute("role","listitem"),c.tabIndex=-1,this._refreshRowDimensions(c),c},l.prototype._onTab=function(c){for(var m=0;m<c;m++)this._onChar(" ")},l.prototype._onChar=function(c){var m=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==c&&(this._charsToAnnounce+=c):this._charsToAnnounce+=c,c===`
|
|
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=P.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&&w.removeElementFromParent(this._liveRegion)},l.prototype._onKey=function(c){this._clearLiveRegion(),this._charsToConsume.push(c)},l.prototype._refreshRows=function(c,m){this._renderRowsDebouncer.refresh(c,m,this._terminal.rows)},l.prototype._renderRows=function(c,m){for(var C=this._terminal.buffer,M=C.lines.length.toString(),k=c;k<=m;k++){var E=C.translateBufferLineToString(C.ydisp+k,!0),T=(C.ydisp+k+1).toString(),I=this._rowElements[k];I&&(E.length===0?I.innerHTML=" ":I.textContent=E,I.setAttribute("aria-posinset",T),I.setAttribute("aria-setsize",M))}this._announceCharacters()},l.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var c=0;c<this._terminal.rows;c++)this._refreshRowDimensions(this._rowElements[c])}},l.prototype._refreshRowDimensions=function(c){c.style.height=this._renderService.dimensions.actualCellHeight+"px"},l.prototype._announceCharacters=function(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},l}(S.Disposable);y.AccessibilityManager=f},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(C,M){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,E){k.__proto__=E}||function(k,E){for(var T in E)E.hasOwnProperty(T)&&(k[T]=E[T])})(C,M)},function(C,M){function k(){this.constructor=C}N(C,M),C.prototype=M===null?Object.create(M):(k.prototype=M.prototype,new k)}),P=this&&this.__decorate||function(C,M,k,E){var T,I=arguments.length,F=I<3?M:E===null?E=Object.getOwnPropertyDescriptor(M,k):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(C,M,k,E);else for(var H=C.length-1;H>=0;H--)(T=C[H])&&(F=(I<3?T(F):I>3?T(M,k,F):T(M,k))||F);return I>3&&F&&Object.defineProperty(M,k,F),F},A=this&&this.__param||function(C,M){return function(k,E){M(k,E,C)}};Object.defineProperty(y,"__esModule",{value:!0}),y.DomRenderer=void 0;var d=R(58),U=R(9),S=R(2),s=R(5),w=R(1),f=R(0),u=R(10),l=R(17),c=1,m=function(C){function M(k,E,T,I,F,H,W,z,ie){var re=C.call(this)||this;return re._colors=k,re._element=E,re._screenElement=T,re._viewportElement=I,re._linkifier=F,re._linkifier2=H,re._charSizeService=W,re._optionsService=z,re._bufferService=ie,re._terminalClass=c++,re._rowElements=[],re._rowContainer=document.createElement("div"),re._rowContainer.classList.add("xterm-rows"),re._rowContainer.style.lineHeight="normal",re._rowContainer.setAttribute("aria-hidden","true"),re._refreshRowElements(re._bufferService.cols,re._bufferService.rows),re._selectionContainer=document.createElement("div"),re._selectionContainer.classList.add("xterm-selection"),re._selectionContainer.setAttribute("aria-hidden","true"),re.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},re._updateDimensions(),re._injectCss(),re._rowFactory=new d.DomRendererRowFactory(document,re._optionsService,re._colors),re._element.classList.add("xterm-dom-renderer-owner-"+re._terminalClass),re._screenElement.appendChild(re._rowContainer),re._screenElement.appendChild(re._selectionContainer),re._linkifier.onShowLinkUnderline(function(_e){return re._onLinkHover(_e)}),re._linkifier.onHideLinkUnderline(function(_e){return re._onLinkLeave(_e)}),re._linkifier2.onShowLinkUnderline(function(_e){return re._onLinkHover(_e)}),re._linkifier2.onHideLinkUnderline(function(_e){return re._onLinkLeave(_e)}),re}return K(M,C),Object.defineProperty(M.prototype,"onRequestRedraw",{get:function(){return new f.EventEmitter().event},enumerable:!1,configurable:!0}),M.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),l.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),C.prototype.dispose.call(this)},M.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,E=this._rowElements;k<E.length;k++){var T=E[k];T.style.width=this.dimensions.canvasWidth+"px",T.style.height=this.dimensions.actualCellHeight+"px",T.style.lineHeight=this.dimensions.actualCellHeight+"px",T.style.overflow="hidden"}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var I=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=I,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},M.prototype.setColors=function(k){this._colors=k,this._injectCss()},M.prototype._injectCss=function(){var k=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var E=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";E+=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;}",E+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",E+="@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+"; }}",E+=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;}",E+=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(T,I){E+=k._terminalSelector+" .xterm-fg-"+I+" { color: "+T.css+"; }"+k._terminalSelector+" .xterm-bg-"+I+" { background-color: "+T.css+"; }"}),E+=this._terminalSelector+" .xterm-fg-"+U.INVERTED_DEFAULT_COLOR+" { color: "+u.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+U.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=E},M.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},M.prototype._refreshRowElements=function(k,E){for(var T=this._rowElements.length;T<=E;T++){var I=document.createElement("div");this._rowContainer.appendChild(I),this._rowElements.push(I)}for(;this._rowElements.length>E;)this._rowContainer.removeChild(this._rowElements.pop())},M.prototype.onResize=function(k,E){this._refreshRowElements(k,E),this._updateDimensions()},M.prototype.onCharSizeChanged=function(){this._updateDimensions()},M.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},M.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},M.prototype.onSelectionChanged=function(k,E,T){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(k&&E){var I=k[1]-this._bufferService.buffer.ydisp,F=E[1]-this._bufferService.buffer.ydisp,H=Math.max(I,0),W=Math.min(F,this._bufferService.rows-1);if(!(H>=this._bufferService.rows||W<0)){var z=document.createDocumentFragment();if(T)z.appendChild(this._createSelectionElement(H,k[0],E[0],W-H+1));else{var ie=I===H?k[0]:0,re=H===W?E[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(H,ie,re));var _e=W-H-1;if(z.appendChild(this._createSelectionElement(H+1,0,this._bufferService.cols,_e)),H!==W){var Ae=F===W?E[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(W,0,Ae))}}this._selectionContainer.appendChild(z)}}},M.prototype._createSelectionElement=function(k,E,T,I){I===void 0&&(I=1);var F=document.createElement("div");return F.style.height=I*this.dimensions.actualCellHeight+"px",F.style.top=k*this.dimensions.actualCellHeight+"px",F.style.left=E*this.dimensions.actualCellWidth+"px",F.style.width=this.dimensions.actualCellWidth*(T-E)+"px",F},M.prototype.onCursorMove=function(){},M.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},M.prototype.clear=function(){for(var k=0,E=this._rowElements;k<E.length;k++)E[k].innerHTML=""},M.prototype.renderRows=function(k,E){for(var T=this._bufferService.buffer.ybase+this._bufferService.buffer.y,I=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),F=this._optionsService.options.cursorBlink,H=k;H<=E;H++){var W=this._rowElements[H];W.innerHTML="";var z=H+this._bufferService.buffer.ydisp,ie=this._bufferService.buffer.lines.get(z),re=this._optionsService.options.cursorStyle;W.appendChild(this._rowFactory.createRow(ie,z===T,re,I,F,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(M.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),M.prototype.registerCharacterJoiner=function(k){return-1},M.prototype.deregisterCharacterJoiner=function(k){return!1},M.prototype._onLinkHover=function(k){this._setCellUnderline(k.x1,k.x2,k.y1,k.y2,k.cols,!0)},M.prototype._onLinkLeave=function(k){this._setCellUnderline(k.x1,k.x2,k.y1,k.y2,k.cols,!1)},M.prototype._setCellUnderline=function(k,E,T,I,F,H){for(;k!==E||T!==I;){var W=this._rowElements[T];if(!W)return;var z=W.children[k];z&&(z.style.textDecoration=H?"underline":"none"),++k>=F&&(k=0,T++)}},M=P([A(6,s.ICharSizeService),A(7,w.IOptionsService),A(8,w.IBufferService)],M)}(S.Disposable);y.DomRenderer=m},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.DomRendererRowFactory=y.CURSOR_STYLE_UNDERLINE_CLASS=y.CURSOR_STYLE_BAR_CLASS=y.CURSOR_STYLE_BLOCK_CLASS=y.CURSOR_BLINK_CLASS=y.CURSOR_CLASS=y.UNDERLINE_CLASS=y.ITALIC_CLASS=y.DIM_CLASS=y.BOLD_CLASS=void 0;var N=R(9),K=R(3),P=R(4),A=R(10);y.BOLD_CLASS="xterm-bold",y.DIM_CLASS="xterm-dim",y.ITALIC_CLASS="xterm-italic",y.UNDERLINE_CLASS="xterm-underline",y.CURSOR_CLASS="xterm-cursor",y.CURSOR_BLINK_CLASS="xterm-cursor-blink",y.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",y.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",y.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var d=function(){function S(s,w,f){this._document=s,this._optionsService=w,this._colors=f,this._workCell=new P.CellData}return S.prototype.setColors=function(s){this._colors=s},S.prototype.createRow=function(s,w,f,u,l,c,m){for(var C=this._document.createDocumentFragment(),M=0,k=Math.min(s.length,m)-1;k>=0;k--)if(s.loadCell(k,this._workCell).getCode()!==K.NULL_CELL_CODE||w&&k===u){M=k+1;break}for(k=0;k<M;k++){s.loadCell(k,this._workCell);var E=this._workCell.getWidth();if(E!==0){var T=this._document.createElement("span");if(E>1&&(T.style.width=c*E+"px"),w&&k===u)switch(T.classList.add(y.CURSOR_CLASS),l&&T.classList.add(y.CURSOR_BLINK_CLASS),f){case"bar":T.classList.add(y.CURSOR_STYLE_BAR_CLASS);break;case"underline":T.classList.add(y.CURSOR_STYLE_UNDERLINE_CLASS);break;default:T.classList.add(y.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&T.classList.add(y.BOLD_CLASS),this._workCell.isItalic()&&T.classList.add(y.ITALIC_CLASS),this._workCell.isDim()&&T.classList.add(y.DIM_CLASS),this._workCell.isUnderline()&&T.classList.add(y.UNDERLINE_CLASS),this._workCell.isInvisible()?T.textContent=K.WHITESPACE_CELL_CHAR:T.textContent=this._workCell.getChars()||K.WHITESPACE_CELL_CHAR;var I=this._workCell.getFgColor(),F=this._workCell.getFgColorMode(),H=this._workCell.getBgColor(),W=this._workCell.getBgColorMode(),z=!!this._workCell.isInverse();if(z){var ie=I;I=H,H=ie;var re=F;F=W,W=re}switch(F){case 16777216:case 33554432:this._workCell.isBold()&&I<8&&this._optionsService.options.drawBoldTextInBrightColors&&(I+=8),this._applyMinimumContrast(T,this._colors.background,this._colors.ansi[I])||T.classList.add("xterm-fg-"+I);break;case 50331648:var _e=A.rgba.toColor(I>>16&255,I>>8&255,255&I);this._applyMinimumContrast(T,this._colors.background,_e)||this._addStyle(T,"color:#"+U(I.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(T,this._colors.background,this._colors.foreground)||z&&T.classList.add("xterm-fg-"+N.INVERTED_DEFAULT_COLOR)}switch(W){case 16777216:case 33554432:T.classList.add("xterm-bg-"+H);break;case 50331648:this._addStyle(T,"background-color:#"+U(H.toString(16),"0",6));break;case 0:default:z&&T.classList.add("xterm-bg-"+N.INVERTED_DEFAULT_COLOR)}C.appendChild(T)}}return C},S.prototype._applyMinimumContrast=function(s,w,f){if(this._optionsService.options.minimumContrastRatio===1)return!1;var u=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return u===void 0&&(u=A.color.ensureContrastRatio(w,f,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,u!=null?u:null)),!!u&&(this._addStyle(s,"color:"+u.css),!0)},S.prototype._addStyle=function(s,w){s.setAttribute("style",""+(s.getAttribute("style")||"")+w+";")},S}();function U(S,s,w){for(;S.length<w;)S=s+S;return S}y.DomRendererRowFactory=d},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.evaluateKeyboardEvent=void 0;var N=R(12),K={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};y.evaluateKeyboardEvent=function(P,A,d,U){var S={type:0,cancel:!1,key:void 0},s=(P.shiftKey?1:0)|(P.altKey?2:0)|(P.ctrlKey?4:0)|(P.metaKey?8:0);switch(P.keyCode){case 0:P.key==="UIKeyInputUpArrow"?S.key=A?N.C0.ESC+"OA":N.C0.ESC+"[A":P.key==="UIKeyInputLeftArrow"?S.key=A?N.C0.ESC+"OD":N.C0.ESC+"[D":P.key==="UIKeyInputRightArrow"?S.key=A?N.C0.ESC+"OC":N.C0.ESC+"[C":P.key==="UIKeyInputDownArrow"&&(S.key=A?N.C0.ESC+"OB":N.C0.ESC+"[B");break;case 8:if(P.shiftKey){S.key=N.C0.BS;break}if(P.altKey){S.key=N.C0.ESC+N.C0.DEL;break}S.key=N.C0.DEL;break;case 9:if(P.shiftKey){S.key=N.C0.ESC+"[Z";break}S.key=N.C0.HT,S.cancel=!0;break;case 13:S.key=P.altKey?N.C0.ESC+N.C0.CR:N.C0.CR,S.cancel=!0;break;case 27:S.key=N.C0.ESC,P.altKey&&(S.key=N.C0.ESC+N.C0.ESC),S.cancel=!0;break;case 37:if(P.metaKey)break;s?(S.key=N.C0.ESC+"[1;"+(s+1)+"D",S.key===N.C0.ESC+"[1;3D"&&(S.key=N.C0.ESC+(d?"b":"[1;5D"))):S.key=A?N.C0.ESC+"OD":N.C0.ESC+"[D";break;case 39:if(P.metaKey)break;s?(S.key=N.C0.ESC+"[1;"+(s+1)+"C",S.key===N.C0.ESC+"[1;3C"&&(S.key=N.C0.ESC+(d?"f":"[1;5C"))):S.key=A?N.C0.ESC+"OC":N.C0.ESC+"[C";break;case 38:if(P.metaKey)break;s?(S.key=N.C0.ESC+"[1;"+(s+1)+"A",d||S.key!==N.C0.ESC+"[1;3A"||(S.key=N.C0.ESC+"[1;5A")):S.key=A?N.C0.ESC+"OA":N.C0.ESC+"[A";break;case 40:if(P.metaKey)break;s?(S.key=N.C0.ESC+"[1;"+(s+1)+"B",d||S.key!==N.C0.ESC+"[1;3B"||(S.key=N.C0.ESC+"[1;5B")):S.key=A?N.C0.ESC+"OB":N.C0.ESC+"[B";break;case 45:P.shiftKey||P.ctrlKey||(S.key=N.C0.ESC+"[2~");break;case 46:S.key=s?N.C0.ESC+"[3;"+(s+1)+"~":N.C0.ESC+"[3~";break;case 36:S.key=s?N.C0.ESC+"[1;"+(s+1)+"H":A?N.C0.ESC+"OH":N.C0.ESC+"[H";break;case 35:S.key=s?N.C0.ESC+"[1;"+(s+1)+"F":A?N.C0.ESC+"OF":N.C0.ESC+"[F";break;case 33:P.shiftKey?S.type=2:S.key=N.C0.ESC+"[5~";break;case 34:P.shiftKey?S.type=3:S.key=N.C0.ESC+"[6~";break;case 112:S.key=s?N.C0.ESC+"[1;"+(s+1)+"P":N.C0.ESC+"OP";break;case 113:S.key=s?N.C0.ESC+"[1;"+(s+1)+"Q":N.C0.ESC+"OQ";break;case 114:S.key=s?N.C0.ESC+"[1;"+(s+1)+"R":N.C0.ESC+"OR";break;case 115:S.key=s?N.C0.ESC+"[1;"+(s+1)+"S":N.C0.ESC+"OS";break;case 116:S.key=s?N.C0.ESC+"[15;"+(s+1)+"~":N.C0.ESC+"[15~";break;case 117:S.key=s?N.C0.ESC+"[17;"+(s+1)+"~":N.C0.ESC+"[17~";break;case 118:S.key=s?N.C0.ESC+"[18;"+(s+1)+"~":N.C0.ESC+"[18~";break;case 119:S.key=s?N.C0.ESC+"[19;"+(s+1)+"~":N.C0.ESC+"[19~";break;case 120:S.key=s?N.C0.ESC+"[20;"+(s+1)+"~":N.C0.ESC+"[20~";break;case 121:S.key=s?N.C0.ESC+"[21;"+(s+1)+"~":N.C0.ESC+"[21~";break;case 122:S.key=s?N.C0.ESC+"[23;"+(s+1)+"~":N.C0.ESC+"[23~";break;case 123:S.key=s?N.C0.ESC+"[24;"+(s+1)+"~":N.C0.ESC+"[24~";break;default:if(!P.ctrlKey||P.shiftKey||P.altKey||P.metaKey)if(d&&!U||!P.altKey||P.metaKey)d&&!P.altKey&&!P.ctrlKey&&P.metaKey?P.keyCode===65&&(S.type=1):P.key&&!P.ctrlKey&&!P.altKey&&!P.metaKey&&P.keyCode>=48&&P.key.length===1?S.key=P.key:P.key&&P.ctrlKey&&P.key==="_"&&(S.key=N.C0.US);else{var w=K[P.keyCode],f=w&&w[P.shiftKey?1:0];if(f)S.key=N.C0.ESC+f;else if(P.keyCode>=65&&P.keyCode<=90){var u=P.ctrlKey?P.keyCode-64:P.keyCode+32;S.key=N.C0.ESC+String.fromCharCode(u)}}else P.keyCode>=65&&P.keyCode<=90?S.key=String.fromCharCode(P.keyCode-64):P.keyCode===32?S.key=N.C0.NUL:P.keyCode>=51&&P.keyCode<=55?S.key=String.fromCharCode(P.keyCode-51+27):P.keyCode===56?S.key=N.C0.DEL:P.keyCode===219?S.key=N.C0.ESC:P.keyCode===220?S.key=N.C0.FS:P.keyCode===221&&(S.key=N.C0.GS)}return S}},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(c,m){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,M){C.__proto__=M}||function(C,M){for(var k in M)M.hasOwnProperty(k)&&(C[k]=M[k])})(c,m)},function(c,m){function C(){this.constructor=c}N(c,m),c.prototype=m===null?Object.create(m):(C.prototype=m.prototype,new C)}),P=this&&this.__decorate||function(c,m,C,M){var k,E=arguments.length,T=E<3?m:M===null?M=Object.getOwnPropertyDescriptor(m,C):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(c,m,C,M);else for(var I=c.length-1;I>=0;I--)(k=c[I])&&(T=(E<3?k(T):E>3?k(m,C,T):k(m,C))||T);return E>3&&T&&Object.defineProperty(m,C,T),T},A=this&&this.__param||function(c,m){return function(C,M){m(C,M,c)}};Object.defineProperty(y,"__esModule",{value:!0}),y.RenderService=void 0;var d=R(31),U=R(0),S=R(2),s=R(32),w=R(7),f=R(1),u=R(5),l=function(c){function m(C,M,k,E,T,I){var F=c.call(this)||this;if(F._renderer=C,F._rowCount=M,F._isPaused=!1,F._needsFullRefresh=!1,F._isNextRenderRedrawOnly=!0,F._needsSelectionRefresh=!1,F._canvasWidth=0,F._canvasHeight=0,F._selectionState={start:void 0,end:void 0,columnSelectMode:!1},F._onDimensionsChange=new U.EventEmitter,F._onRender=new U.EventEmitter,F._onRefreshRequest=new U.EventEmitter,F.register({dispose:function(){return F._renderer.dispose()}}),F._renderDebouncer=new d.RenderDebouncer(function(W,z){return F._renderRows(W,z)}),F.register(F._renderDebouncer),F._screenDprMonitor=new s.ScreenDprMonitor,F._screenDprMonitor.setListener(function(){return F.onDevicePixelRatioChange()}),F.register(F._screenDprMonitor),F.register(I.onResize(function(W){return F._fullRefresh()})),F.register(E.onOptionChange(function(){return F._renderer.onOptionsChanged()})),F.register(T.onCharSizeChange(function(){return F.onCharSizeChanged()})),F._renderer.onRequestRedraw(function(W){return F.refreshRows(W.start,W.end,!0)}),F.register(w.addDisposableDomListener(window,"resize",function(){return F.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var H=new IntersectionObserver(function(W){return F._onIntersectionChange(W[W.length-1])},{threshold:0});H.observe(k),F.register({dispose:function(){return H.disconnect()}})}return F}return K(m,c),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(C){this._isPaused=C.intersectionRatio===0,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},m.prototype.refreshRows=function(C,M,k){k===void 0&&(k=!1),this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(C,M,this._rowCount))},m.prototype._renderRows=function(C,M){this._renderer.renderRows(C,M),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:C,end:M}),this._isNextRenderRedrawOnly=!0},m.prototype.resize=function(C,M){this._rowCount=M,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(){c.prototype.dispose.call(this)},m.prototype.setRenderer=function(C){var M=this;this._renderer.dispose(),this._renderer=C,this._renderer.onRequestRedraw(function(k){return M.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(C){this._renderer.setColors(C),this._fullRefresh()},m.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},m.prototype.onResize=function(C,M){this._renderer.onResize(C,M),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(C,M,k){this._selectionState.start=C,this._selectionState.end=M,this._selectionState.columnSelectMode=k,this._renderer.onSelectionChanged(C,M,k)},m.prototype.onCursorMove=function(){this._renderer.onCursorMove()},m.prototype.clear=function(){this._renderer.clear()},m.prototype.registerCharacterJoiner=function(C){return this._renderer.registerCharacterJoiner(C)},m.prototype.deregisterCharacterJoiner=function(C){return this._renderer.deregisterCharacterJoiner(C)},m=P([A(3,f.IOptionsService),A(4,u.ICharSizeService),A(5,f.IBufferService)],m)}(S.Disposable);y.RenderService=l},function(ke,y,R){"use strict";var N=this&&this.__decorate||function(S,s,w,f){var u,l=arguments.length,c=l<3?s:f===null?f=Object.getOwnPropertyDescriptor(s,w):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(S,s,w,f);else for(var m=S.length-1;m>=0;m--)(u=S[m])&&(c=(l<3?u(c):l>3?u(s,w,c):u(s,w))||c);return l>3&&c&&Object.defineProperty(s,w,c),c},K=this&&this.__param||function(S,s){return function(w,f){s(w,f,S)}};Object.defineProperty(y,"__esModule",{value:!0}),y.CharSizeService=void 0;var P=R(1),A=R(0),d=function(){function S(s,w,f){this._optionsService=f,this.width=0,this.height=0,this._onCharSizeChange=new A.EventEmitter,this._measureStrategy=new U(s,w,this._optionsService)}return Object.defineProperty(S.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),S.prototype.measure=function(){var s=this._measureStrategy.measure();s.width===this.width&&s.height===this.height||(this.width=s.width,this.height=s.height,this._onCharSizeChange.fire())},S=N([K(2,P.IOptionsService)],S)}();y.CharSizeService=d;var U=function(){function S(s,w,f){this._document=s,this._parentElement=w,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 S.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var s=this._measureElement.getBoundingClientRect();return s.width!==0&&s.height!==0&&(this._result.width=s.width,this._result.height=Math.ceil(s.height)),this._result},S}()},function(ke,y,R){"use strict";var N=this&&this.__decorate||function(U,S,s,w){var f,u=arguments.length,l=u<3?S:w===null?w=Object.getOwnPropertyDescriptor(S,s):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(U,S,s,w);else for(var c=U.length-1;c>=0;c--)(f=U[c])&&(l=(u<3?f(l):u>3?f(S,s,l):f(S,s))||l);return u>3&&l&&Object.defineProperty(S,s,l),l},K=this&&this.__param||function(U,S){return function(s,w){S(s,w,U)}};Object.defineProperty(y,"__esModule",{value:!0}),y.MouseService=void 0;var P=R(5),A=R(30),d=function(){function U(S,s){this._renderService=S,this._charSizeService=s}return U.prototype.getCoords=function(S,s,w,f,u){return A.getCoords(S,s,w,f,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,u)},U.prototype.getRawByteCoords=function(S,s,w,f){var u=this.getCoords(S,s,w,f);return A.getRawByteCoords(u)},U=N([K(0,P.IRenderService),K(1,P.ICharSizeService)],U)}();y.MouseService=d},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(f,u){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var m in c)c.hasOwnProperty(m)&&(l[m]=c[m])})(f,u)},function(f,u){function l(){this.constructor=f}N(f,u),f.prototype=u===null?Object.create(u):(l.prototype=u.prototype,new l)}),P=this&&this.__decorate||function(f,u,l,c){var m,C=arguments.length,M=C<3?u:c===null?c=Object.getOwnPropertyDescriptor(u,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(f,u,l,c);else for(var k=f.length-1;k>=0;k--)(m=f[k])&&(M=(C<3?m(M):C>3?m(u,l,M):m(u,l))||M);return C>3&&M&&Object.defineProperty(u,l,M),M},A=this&&this.__param||function(f,u){return function(l,c){u(l,c,f)}};Object.defineProperty(y,"__esModule",{value:!0}),y.Linkifier2=void 0;var d=R(1),U=R(0),S=R(2),s=R(7),w=function(f){function u(l){var c=f.call(this)||this;return c._bufferService=l,c._linkProviders=[],c._linkCacheDisposables=[],c._isMouseOut=!0,c._activeLine=-1,c._onShowLinkUnderline=c.register(new U.EventEmitter),c._onHideLinkUnderline=c.register(new U.EventEmitter),c.register(S.getDisposeArrayDisposable(c._linkCacheDisposables)),c}return K(u,f),Object.defineProperty(u.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),u.prototype.registerLinkProvider=function(l){var c=this;return this._linkProviders.push(l),{dispose:function(){var m=c._linkProviders.indexOf(l);m!==-1&&c._linkProviders.splice(m,1)}}},u.prototype.attachToDom=function(l,c,m){var C=this;this._element=l,this._mouseService=c,this._renderService=m,this.register(s.addDisposableDomListener(this._element,"mouseleave",function(){C._isMouseOut=!0,C._clearCurrentLink()})),this.register(s.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(s.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},u.prototype._onMouseMove=function(l){if(this._lastMouseEvent=l,this._element&&this._mouseService){var c=this._positionFromMouseEvent(l,this._element,this._mouseService);if(c){this._isMouseOut=!1;for(var m=l.composedPath(),C=0;C<m.length;C++){var M=m[C];if(M.classList.contains("xterm"))break;if(M.classList.contains("xterm-hover"))return}this._lastBufferCell&&c.x===this._lastBufferCell.x&&c.y===this._lastBufferCell.y||(this._onHover(c),this._lastBufferCell=c)}}},u.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))},u.prototype._askForLink=function(l,c){var m=this;this._activeProviderReplies&&c||(this._activeProviderReplies=new Map,this._activeLine=l.y);var C=!1;this._linkProviders.forEach(function(M,k){var E;c?!((E=m._activeProviderReplies)===null||E===void 0)&&E.get(k)&&(C=m._checkLinkProviderResult(k,l,C)):M.provideLinks(l.y,function(T){var I,F;if(!m._isMouseOut){var H=T==null?void 0:T.map(function(W){return{link:W}});(I=m._activeProviderReplies)===null||I===void 0||I.set(k,H),C=m._checkLinkProviderResult(k,l,C),((F=m._activeProviderReplies)===null||F===void 0?void 0:F.size)===m._linkProviders.length&&m._removeIntersectingLinks(l.y,m._activeProviderReplies)}})})},u.prototype._removeIntersectingLinks=function(l,c){for(var m=new Set,C=0;C<c.size;C++){var M=c.get(C);if(M)for(var k=0;k<M.length;k++)for(var E=M[k],T=E.link.range.start.y<l?0:E.link.range.start.x,I=E.link.range.end.y>l?this._bufferService.cols:E.link.range.end.x,F=T;F<=I;F++){if(m.has(F)){M.splice(k--,1);break}m.add(F)}}},u.prototype._checkLinkProviderResult=function(l,c,m){var C,M=this;if(!this._activeProviderReplies)return m;for(var k=this._activeProviderReplies.get(l),E=!1,T=0;T<l;T++)this._activeProviderReplies.has(T)&&!this._activeProviderReplies.get(T)||(E=!0);if(!E&&k){var I=k.find(function(H){return M._linkAtPosition(H.link,c)});I&&(m=!0,this._handleNewLink(I))}if(this._activeProviderReplies.size===this._linkProviders.length&&!m)for(T=0;T<this._activeProviderReplies.size;T++){var F=(C=this._activeProviderReplies.get(T))===null||C===void 0?void 0:C.find(function(H){return M._linkAtPosition(H.link,c)});if(F){m=!0,this._handleNewLink(F);break}}return m},u.prototype._onClick=function(l){if(this._element&&this._mouseService&&this._currentLink){var c=this._positionFromMouseEvent(l,this._element,this._mouseService);c&&this._linkAtPosition(this._currentLink.link,c)&&this._currentLink.link.activate(l,this._currentLink.link.text)}},u.prototype._clearCurrentLink=function(l,c){this._element&&this._currentLink&&this._lastMouseEvent&&(!l||!c||this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=c)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,S.disposeArray(this._linkCacheDisposables))},u.prototype._handleNewLink=function(l){var c=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 C,M;return(M=(C=c._currentLink)===null||C===void 0?void 0:C.state)===null||M===void 0?void 0:M.decorations.pointerCursor},set:function(C){var M,k;!((M=c._currentLink)===null||M===void 0)&&M.state&&c._currentLink.state.decorations.pointerCursor!==C&&(c._currentLink.state.decorations.pointerCursor=C,c._currentLink.state.isHovered&&((k=c._element)===null||k===void 0||k.classList.toggle("xterm-cursor-pointer",C)))}},underline:{get:function(){var C,M;return(M=(C=c._currentLink)===null||C===void 0?void 0:C.state)===null||M===void 0?void 0:M.decorations.underline},set:function(C){var M,k,E;!((M=c._currentLink)===null||M===void 0)&&M.state&&((E=(k=c._currentLink)===null||k===void 0?void 0:k.state)===null||E===void 0?void 0:E.decorations.underline)!==C&&(c._currentLink.state.decorations.underline=C,c._currentLink.state.isHovered&&c._fireUnderlineEvent(l.link,C))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(C){var M=C.start===0?0:C.start+1+c._bufferService.buffer.ydisp;c._clearCurrentLink(M,C.end+1+c._bufferService.buffer.ydisp)})))}},u.prototype._linkHover=function(l,c,m){var C;!((C=this._currentLink)===null||C===void 0)&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(c,!0),this._currentLink.state.decorations.pointerCursor&&l.classList.add("xterm-cursor-pointer")),c.hover&&c.hover(m,c.text)},u.prototype._fireUnderlineEvent=function(l,c){var m=l.range,C=this._bufferService.buffer.ydisp,M=this._createLinkUnderlineEvent(m.start.x-1,m.start.y-C-1,m.end.x,m.end.y-C-1,void 0);(c?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(M)},u.prototype._linkLeave=function(l,c,m){var C;!((C=this._currentLink)===null||C===void 0)&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(c,!1),this._currentLink.state.decorations.pointerCursor&&l.classList.remove("xterm-cursor-pointer")),c.leave&&c.leave(m,c.text)},u.prototype._linkAtPosition=function(l,c){var m=l.range.start.y===l.range.end.y,C=l.range.start.y<c.y,M=l.range.end.y>c.y;return(m&&l.range.start.x<=c.x&&l.range.end.x>=c.x||C&&l.range.end.x>=c.x||M&&l.range.start.x<=c.x||C&&M)&&l.range.start.y<=c.y&&l.range.end.y>=c.y},u.prototype._positionFromMouseEvent=function(l,c,m){var C=m.getCoords(l,c,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}},u.prototype._createLinkUnderlineEvent=function(l,c,m,C,M){return{x1:l,y1:c,x2:m,y2:C,cols:this._bufferService.cols,fg:M}},u=P([A(0,d.IBufferService)],u)}(S.Disposable);y.Linkifier2=w},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.CoreBrowserService=void 0;var N=function(){function K(P){this._textarea=P}return Object.defineProperty(K.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),K}();y.CoreBrowserService=N},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(T,I){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,H){F.__proto__=H}||function(F,H){for(var W in H)H.hasOwnProperty(W)&&(F[W]=H[W])})(T,I)},function(T,I){function F(){this.constructor=T}N(T,I),T.prototype=I===null?Object.create(I):(F.prototype=I.prototype,new F)});Object.defineProperty(y,"__esModule",{value:!0}),y.CoreTerminal=void 0;var P=R(2),A=R(1),d=R(66),U=R(67),S=R(68),s=R(74),w=R(75),f=R(0),u=R(76),l=R(77),c=R(78),m=R(80),C=R(81),M=R(19),k=R(82),E=function(T){function I(F){var H=T.call(this)||this;return H._onBinary=new f.EventEmitter,H._onData=new f.EventEmitter,H._onLineFeed=new f.EventEmitter,H._onResize=new f.EventEmitter,H._onScroll=new f.EventEmitter,H._instantiationService=new d.InstantiationService,H.optionsService=new s.OptionsService(F),H._instantiationService.setService(A.IOptionsService,H.optionsService),H._bufferService=H.register(H._instantiationService.createInstance(S.BufferService)),H._instantiationService.setService(A.IBufferService,H._bufferService),H._logService=H._instantiationService.createInstance(U.LogService),H._instantiationService.setService(A.ILogService,H._logService),H._coreService=H.register(H._instantiationService.createInstance(w.CoreService,function(){return H.scrollToBottom()})),H._instantiationService.setService(A.ICoreService,H._coreService),H._coreMouseService=H._instantiationService.createInstance(u.CoreMouseService),H._instantiationService.setService(A.ICoreMouseService,H._coreMouseService),H._dirtyRowService=H._instantiationService.createInstance(l.DirtyRowService),H._instantiationService.setService(A.IDirtyRowService,H._dirtyRowService),H.unicodeService=H._instantiationService.createInstance(c.UnicodeService),H._instantiationService.setService(A.IUnicodeService,H.unicodeService),H._charsetService=H._instantiationService.createInstance(m.CharsetService),H._instantiationService.setService(A.ICharsetService,H._charsetService),H._inputHandler=new M.InputHandler(H._bufferService,H._charsetService,H._coreService,H._dirtyRowService,H._logService,H.optionsService,H._coreMouseService,H.unicodeService),H.register(f.forwardEvent(H._inputHandler.onLineFeed,H._onLineFeed)),H.register(H._inputHandler),H.register(f.forwardEvent(H._bufferService.onResize,H._onResize)),H.register(f.forwardEvent(H._coreService.onData,H._onData)),H.register(f.forwardEvent(H._coreService.onBinary,H._onBinary)),H.register(H.optionsService.onOptionChange(function(W){return H._updateOptions(W)})),H._writeBuffer=new k.WriteBuffer(function(W){return H._inputHandler.parse(W)}),H}return K(I,T),Object.defineProperty(I.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),I.prototype.dispose=function(){var F;this._isDisposed||(T.prototype.dispose.call(this),(F=this._windowsMode)===null||F===void 0||F.dispose(),this._windowsMode=void 0)},I.prototype.write=function(F,H){this._writeBuffer.write(F,H)},I.prototype.writeSync=function(F){this._writeBuffer.writeSync(F)},I.prototype.resize=function(F,H){isNaN(F)||isNaN(H)||(F=Math.max(F,S.MINIMUM_COLS),H=Math.max(H,S.MINIMUM_ROWS),this._bufferService.resize(F,H))},I.prototype.scroll=function(F,H){H===void 0&&(H=!1);var W,z=this._bufferService.buffer;(W=this._cachedBlankLine)&&W.length===this.cols&&W.getFg(0)===F.fg&&W.getBg(0)===F.bg||(W=z.getBlankLine(F,H),this._cachedBlankLine=W),W.isWrapped=H;var ie=z.ybase+z.scrollTop,re=z.ybase+z.scrollBottom;if(z.scrollTop===0){var _e=z.lines.isFull;re===z.lines.length-1?_e?z.lines.recycle().copyFrom(W):z.lines.push(W.clone()):z.lines.splice(re+1,0,W.clone()),_e?this._bufferService.isUserScrolling&&(z.ydisp=Math.max(z.ydisp-1,0)):(z.ybase++,this._bufferService.isUserScrolling||z.ydisp++)}else{var Ae=re-ie+1;z.lines.shiftElements(ie+1,Ae-1,-1),z.lines.set(re,W.clone())}this._bufferService.isUserScrolling||(z.ydisp=z.ybase),this._dirtyRowService.markRangeDirty(z.scrollTop,z.scrollBottom),this._onScroll.fire(z.ydisp)},I.prototype.scrollLines=function(F,H){var W=this._bufferService.buffer;if(F<0){if(W.ydisp===0)return;this._bufferService.isUserScrolling=!0}else F+W.ydisp>=W.ybase&&(this._bufferService.isUserScrolling=!1);var z=W.ydisp;W.ydisp=Math.max(Math.min(W.ydisp+F,W.ybase),0),z!==W.ydisp&&(H||this._onScroll.fire(W.ydisp))},I.prototype.scrollPages=function(F){this.scrollLines(F*(this.rows-1))},I.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},I.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},I.prototype.scrollToLine=function(F){var H=F-this._bufferService.buffer.ydisp;H!==0&&this.scrollLines(H)},I.prototype.addEscHandler=function(F,H){return this._inputHandler.addEscHandler(F,H)},I.prototype.addDcsHandler=function(F,H){return this._inputHandler.addDcsHandler(F,H)},I.prototype.addCsiHandler=function(F,H){return this._inputHandler.addCsiHandler(F,H)},I.prototype.addOscHandler=function(F,H){return this._inputHandler.addOscHandler(F,H)},I.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},I.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},I.prototype._updateOptions=function(F){var H;switch(F){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():((H=this._windowsMode)===null||H===void 0||H.dispose(),this._windowsMode=void 0)}},I.prototype._enableWindowsMode=function(){var F=this;if(!this._windowsMode){var H=[];H.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),H.push(this.addCsiHandler({final:"H"},function(){return C.updateWindowsModeWrappedState(F._bufferService),!1})),this._windowsMode={dispose:function(){for(var W=0,z=H;W<z.length;W++)z[W].dispose()}}}},I}(P.Disposable);y.CoreTerminal=E},function(ke,y,R){"use strict";var N=this&&this.__spreadArrays||function(){for(var U=0,S=0,s=arguments.length;S<s;S++)U+=arguments[S].length;var w=Array(U),f=0;for(S=0;S<s;S++)for(var u=arguments[S],l=0,c=u.length;l<c;l++,f++)w[f]=u[l];return w};Object.defineProperty(y,"__esModule",{value:!0}),y.InstantiationService=y.ServiceCollection=void 0;var K=R(1),P=R(14),A=function(){function U(){for(var S=[],s=0;s<arguments.length;s++)S[s]=arguments[s];this._entries=new Map;for(var w=0,f=S;w<f.length;w++){var u=f[w],l=u[0],c=u[1];this.set(l,c)}}return U.prototype.set=function(S,s){var w=this._entries.get(S);return this._entries.set(S,s),w},U.prototype.forEach=function(S){this._entries.forEach(function(s,w){return S(w,s)})},U.prototype.has=function(S){return this._entries.has(S)},U.prototype.get=function(S){return this._entries.get(S)},U}();y.ServiceCollection=A;var d=function(){function U(){this._services=new A,this._services.set(K.IInstantiationService,this)}return U.prototype.setService=function(S,s){this._services.set(S,s)},U.prototype.getService=function(S){return this._services.get(S)},U.prototype.createInstance=function(S){for(var s=[],w=1;w<arguments.length;w++)s[w-1]=arguments[w];for(var f=P.getServiceDependencies(S).sort(function(k,E){return k.index-E.index}),u=[],l=0,c=f;l<c.length;l++){var m=c[l],C=this._services.get(m.id);if(!C)throw new Error("[createInstance] "+S.name+" depends on UNKNOWN service "+m.id+".");u.push(C)}var M=f.length>0?f[0].index:s.length;if(s.length!==M)throw new Error("[createInstance] First service dependency of "+S.name+" at position "+(M+1)+" conflicts with "+s.length+" static arguments");return new(S.bind.apply(S,N([void 0],N(s,u))))},U}();y.InstantiationService=d},function(ke,y,R){"use strict";var N=this&&this.__decorate||function(s,w,f,u){var l,c=arguments.length,m=c<3?w:u===null?u=Object.getOwnPropertyDescriptor(w,f):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,w,f,u);else for(var C=s.length-1;C>=0;C--)(l=s[C])&&(m=(c<3?l(m):c>3?l(w,f,m):l(w,f))||m);return c>3&&m&&Object.defineProperty(w,f,m),m},K=this&&this.__param||function(s,w){return function(f,u){w(f,u,s)}},P=this&&this.__spreadArrays||function(){for(var s=0,w=0,f=arguments.length;w<f;w++)s+=arguments[w].length;var u=Array(s),l=0;for(w=0;w<f;w++)for(var c=arguments[w],m=0,C=c.length;m<C;m++,l++)u[l]=c[m];return u};Object.defineProperty(y,"__esModule",{value:!0}),y.LogService=y.LogLevel=void 0;var A,d=R(1);(function(s){s[s.DEBUG=0]="DEBUG",s[s.INFO=1]="INFO",s[s.WARN=2]="WARN",s[s.ERROR=3]="ERROR",s[s.OFF=4]="OFF"})(A=y.LogLevel||(y.LogLevel={}));var U={debug:A.DEBUG,info:A.INFO,warn:A.WARN,error:A.ERROR,off:A.OFF},S=function(){function s(w){var f=this;this._optionsService=w,this._updateLogLevel(),this._optionsService.onOptionChange(function(u){u==="logLevel"&&f._updateLogLevel()})}return s.prototype._updateLogLevel=function(){this._logLevel=U[this._optionsService.options.logLevel]},s.prototype._evalLazyOptionalParams=function(w){for(var f=0;f<w.length;f++)typeof w[f]=="function"&&(w[f]=w[f]())},s.prototype._log=function(w,f,u){this._evalLazyOptionalParams(u),w.call.apply(w,P([console,"xterm.js: "+f],u))},s.prototype.debug=function(w){for(var f=[],u=1;u<arguments.length;u++)f[u-1]=arguments[u];this._logLevel<=A.DEBUG&&this._log(console.log,w,f)},s.prototype.info=function(w){for(var f=[],u=1;u<arguments.length;u++)f[u-1]=arguments[u];this._logLevel<=A.INFO&&this._log(console.info,w,f)},s.prototype.warn=function(w){for(var f=[],u=1;u<arguments.length;u++)f[u-1]=arguments[u];this._logLevel<=A.WARN&&this._log(console.warn,w,f)},s.prototype.error=function(w){for(var f=[],u=1;u<arguments.length;u++)f[u-1]=arguments[u];this._logLevel<=A.ERROR&&this._log(console.error,w,f)},s=N([K(0,d.IOptionsService)],s)}();y.LogService=S},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(f,u){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var m in c)c.hasOwnProperty(m)&&(l[m]=c[m])})(f,u)},function(f,u){function l(){this.constructor=f}N(f,u),f.prototype=u===null?Object.create(u):(l.prototype=u.prototype,new l)}),P=this&&this.__decorate||function(f,u,l,c){var m,C=arguments.length,M=C<3?u:c===null?c=Object.getOwnPropertyDescriptor(u,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(f,u,l,c);else for(var k=f.length-1;k>=0;k--)(m=f[k])&&(M=(C<3?m(M):C>3?m(u,l,M):m(u,l))||M);return C>3&&M&&Object.defineProperty(u,l,M),M},A=this&&this.__param||function(f,u){return function(l,c){u(l,c,f)}};Object.defineProperty(y,"__esModule",{value:!0}),y.BufferService=y.MINIMUM_ROWS=y.MINIMUM_COLS=void 0;var d=R(1),U=R(69),S=R(0),s=R(2);y.MINIMUM_COLS=2,y.MINIMUM_ROWS=1;var w=function(f){function u(l){var c=f.call(this)||this;return c._optionsService=l,c.isUserScrolling=!1,c._onResize=new S.EventEmitter,c.cols=Math.max(l.options.cols,y.MINIMUM_COLS),c.rows=Math.max(l.options.rows,y.MINIMUM_ROWS),c.buffers=new U.BufferSet(l,c),c}return K(u,f),Object.defineProperty(u.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),u.prototype.dispose=function(){f.prototype.dispose.call(this),this.buffers.dispose()},u.prototype.resize=function(l,c){this.cols=l,this.rows=c,this.buffers.resize(l,c),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:l,rows:c})},u.prototype.reset=function(){this.buffers.dispose(),this.buffers=new U.BufferSet(this._optionsService,this),this.isUserScrolling=!1},u=P([A(0,d.IOptionsService)],u)}(s.Disposable);y.BufferService=w},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(U,S){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,w){s.__proto__=w}||function(s,w){for(var f in w)w.hasOwnProperty(f)&&(s[f]=w[f])})(U,S)},function(U,S){function s(){this.constructor=U}N(U,S),U.prototype=S===null?Object.create(S):(s.prototype=S.prototype,new s)});Object.defineProperty(y,"__esModule",{value:!0}),y.BufferSet=void 0;var P=R(70),A=R(0),d=function(U){function S(s,w){var f=U.call(this)||this;return f._onBufferActivate=f.register(new A.EventEmitter),f._normal=new P.Buffer(!0,s,w),f._normal.fillViewportRows(),f._alt=new P.Buffer(!1,s,w),f._activeBuffer=f._normal,f.setupTabStops(),f}return K(S,U),Object.defineProperty(S.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),S.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}))},S.prototype.activateAltBuffer=function(s){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(s),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}))},S.prototype.resize=function(s,w){this._normal.resize(s,w),this._alt.resize(s,w)},S.prototype.setupTabStops=function(s){this._normal.setupTabStops(s),this._alt.setupTabStops(s)},S}(R(2).Disposable);y.BufferSet=d},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.BufferStringIterator=y.Buffer=y.MAX_BUFFER_SIZE=void 0;var N=R(71),K=R(16),P=R(4),A=R(3),d=R(72),U=R(73),S=R(20),s=R(6);y.MAX_BUFFER_SIZE=4294967295;var w=function(){function u(l,c,m){this._hasScrollback=l,this._optionsService=c,this._bufferService=m,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=K.DEFAULT_ATTR_DATA.clone(),this.savedCharset=S.DEFAULT_CHARSET,this.markers=[],this._nullCell=P.CellData.fromCharData([0,A.NULL_CELL_CHAR,A.NULL_CELL_WIDTH,A.NULL_CELL_CODE]),this._whitespaceCell=P.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 N.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return u.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 s.ExtendedAttrs),this._nullCell},u.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 s.ExtendedAttrs),this._whitespaceCell},u.prototype.getBlankLine=function(l,c){return new K.BufferLine(this._bufferService.cols,this.getNullCell(l),c)},Object.defineProperty(u.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"isCursorInViewport",{get:function(){var l=this.ybase+this.y-this.ydisp;return l>=0&&l<this._rows},enumerable:!1,configurable:!0}),u.prototype._getCorrectBufferLength=function(l){if(!this._hasScrollback)return l;var c=l+this._optionsService.options.scrollback;return c>y.MAX_BUFFER_SIZE?y.MAX_BUFFER_SIZE:c},u.prototype.fillViewportRows=function(l){if(this.lines.length===0){l===void 0&&(l=K.DEFAULT_ATTR_DATA);for(var c=this._rows;c--;)this.lines.push(this.getBlankLine(l))}},u.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new N.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},u.prototype.resize=function(l,c){var m=this.getNullCell(K.DEFAULT_ATTR_DATA),C=this._getCorrectBufferLength(c);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols<l)for(var M=0;M<this.lines.length;M++)this.lines.get(M).resize(l,m);var k=0;if(this._rows<c)for(var E=this._rows;E<c;E++)this.lines.length<c+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new K.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 K.BufferLine(l,m)));else for(E=this._rows;E>c;E--)this.lines.length>c+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(C<this.lines.maxLength){var T=this.lines.length-C;T>0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,0)),this.lines.maxLength=C}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,c-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(l,c),this._cols>l))for(M=0;M<this.lines.length;M++)this.lines.get(M).resize(l,m);this._cols=l,this._rows=c},Object.defineProperty(u.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!1,configurable:!0}),u.prototype._reflow=function(l,c){this._cols!==l&&(l>this._cols?this._reflowLarger(l,c):this._reflowSmaller(l,c))},u.prototype._reflowLarger=function(l,c){var m=d.reflowLargerGetLinesToRemove(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(K.DEFAULT_ATTR_DATA));if(m.length>0){var C=d.reflowLargerCreateNewLayout(this.lines,m);d.reflowLargerApplyNewLayout(this.lines,C.layout),this._reflowLargerAdjustViewport(l,c,C.countRemoved)}},u.prototype._reflowLargerAdjustViewport=function(l,c,m){for(var C=this.getNullCell(K.DEFAULT_ATTR_DATA),M=m;M-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new K.BufferLine(l,C))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-m,0)},u.prototype._reflowSmaller=function(l,c){for(var m=this.getNullCell(K.DEFAULT_ATTR_DATA),C=[],M=0,k=this.lines.length-1;k>=0;k--){var E=this.lines.get(k);if(!(!E||!E.isWrapped&&E.getTrimmedLength()<=l)){for(var T=[E];E.isWrapped&&k>0;)E=this.lines.get(--k),T.unshift(E);var I=this.ybase+this.y;if(!(I>=k&&I<k+T.length)){var F=T[T.length-1].getTrimmedLength(),H=d.reflowSmallerGetNewLineLengths(T,this._cols,l),W=H.length-T.length,z=void 0;z=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+W):Math.max(0,this.lines.length-this.lines.maxLength+W);for(var ie=[],re=0;re<W;re++){var _e=this.getBlankLine(K.DEFAULT_ATTR_DATA,!0);ie.push(_e)}ie.length>0&&(C.push({start:k+T.length+M,newLines:ie}),M+=ie.length),T.push.apply(T,ie);var Ae=H.length-1,ce=H[Ae];ce===0&&(ce=H[--Ae]);for(var J=T.length-W-1,ae=F;J>=0;){var G=Math.min(ae,ce);if(T[Ae].copyCellsFrom(T[J],ae-G,ce-G,G,!0),(ce-=G)===0&&(ce=H[--Ae]),(ae-=G)===0){J--;var X=Math.max(J,0);ae=d.getWrappedLineTrimmedLength(T,X,this._cols)}}for(re=0;re<T.length;re++)H[re]<l&&T[re].setCell(H[re],m);for(var Z=W-z;Z-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+M)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+W,this.ybase+c-1)}}}if(C.length>0){var B=[],O=[];for(re=0;re<this.lines.length;re++)O.push(this.lines.get(re));var ne=this.lines.length,me=ne-1,Oe=0,He=C[Oe];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+M);var ut=0;for(re=Math.min(this.lines.maxLength-1,ne+M-1);re>=0;re--)if(He&&He.start>me+ut){for(var Fe=He.newLines.length-1;Fe>=0;Fe--)this.lines.set(re--,He.newLines[Fe]);re++,B.push({index:me+1,amount:He.newLines.length}),ut+=He.newLines.length,He=C[++Oe]}else this.lines.set(re,O[me--]);var it=0;for(re=B.length-1;re>=0;re--)B[re].index+=it,this.lines.onInsertEmitter.fire(B[re]),it+=B[re].amount;var st=Math.max(0,ne+M-this.lines.maxLength);st>0&&this.lines.onTrimEmitter.fire(st)}},u.prototype.stringIndexToBufferIndex=function(l,c,m){for(m===void 0&&(m=!1);c;){var C=this.lines.get(l);if(!C)return[-1,-1];for(var M=m?C.getTrimmedLength():C.length,k=0;k<M;++k)if(C.get(k)[A.CHAR_DATA_WIDTH_INDEX]&&(c-=C.get(k)[A.CHAR_DATA_CHAR_INDEX].length||1),c<0)return[l,k];l++}return[l,0]},u.prototype.translateBufferLineToString=function(l,c,m,C){m===void 0&&(m=0);var M=this.lines.get(l);return M?M.translateToString(c,m,C):""},u.prototype.getWrappedRangeForLine=function(l){for(var c=l,m=l;c>0&&this.lines.get(c).isWrapped;)c--;for(;m+1<this.lines.length&&this.lines.get(m+1).isWrapped;)m++;return{first:c,last:m}},u.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},u.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},u.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},u.prototype.addMarker=function(l){var c=this,m=new U.Marker(l);return this.markers.push(m),m.register(this.lines.onTrim(function(C){m.line-=C,m.line<0&&m.dispose()})),m.register(this.lines.onInsert(function(C){m.line>=C.index&&(m.line+=C.amount)})),m.register(this.lines.onDelete(function(C){m.line>=C.index&&m.line<C.index+C.amount&&m.dispose(),m.line>C.index&&(m.line-=C.amount)})),m.register(m.onDispose(function(){return c._removeMarker(m)})),m},u.prototype._removeMarker=function(l){this.markers.splice(this.markers.indexOf(l),1)},u.prototype.iterator=function(l,c,m,C,M){return new f(this,l,c,m,C,M)},u}();y.Buffer=w;var f=function(){function u(l,c,m,C,M,k){m===void 0&&(m=0),C===void 0&&(C=l.lines.length),M===void 0&&(M=0),k===void 0&&(k=0),this._buffer=l,this._trimRight=c,this._startIndex=m,this._endIndex=C,this._startOverscan=M,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 u.prototype.hasNext=function(){return this._current<this._endIndex},u.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 c="",m=l.first;m<=l.last;++m)c+=this._buffer.translateBufferLineToString(m,this._trimRight);return this._current=l.last+1,{range:l,content:c}},u}();y.BufferStringIterator=f},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.CircularList=void 0;var N=R(0),K=function(){function P(A){this._maxLength=A,this.onDeleteEmitter=new N.EventEmitter,this.onInsertEmitter=new N.EventEmitter,this.onTrimEmitter=new N.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(P.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(P.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(P.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}),P.prototype.get=function(A){return this._array[this._getCyclicIndex(A)]},P.prototype.set=function(A,d){this._array[this._getCyclicIndex(A)]=d},P.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++},P.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(P.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),P.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},P.prototype.splice=function(A,d){for(var U=[],S=2;S<arguments.length;S++)U[S-2]=arguments[S];if(d){for(var s=A;s<this._length-d;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+d)];this._length-=d}for(s=this._length-1;s>=A;s--)this._array[this._getCyclicIndex(s+U.length)]=this._array[this._getCyclicIndex(s)];for(s=0;s<U.length;s++)this._array[this._getCyclicIndex(A+s)]=U[s];if(this._length+U.length>this._maxLength){var w=this._length+U.length-this._maxLength;this._startIndex+=w,this._length=this._maxLength,this.onTrimEmitter.fire(w)}else this._length+=U.length},P.prototype.trimStart=function(A){A>this._length&&(A=this._length),this._startIndex+=A,this._length-=A,this.onTrimEmitter.fire(A)},P.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 S=d-1;S>=0;S--)this.set(A+S+U,this.get(A+S));var s=A+d+U-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(S=0;S<d;S++)this.set(A+S+U,this.get(A+S))}},P.prototype._getCyclicIndex=function(A){return(this._startIndex+A)%this._maxLength},P}();y.CircularList=K},function(ke,y,R){"use strict";function N(K,P,A){if(P===K.length-1)return K[P].getTrimmedLength();var d=!K[P].hasContent(A-1)&&K[P].getWidth(A-1)===1,U=K[P+1].getWidth(0)===2;return d&&U?A-1:A}Object.defineProperty(y,"__esModule",{value:!0}),y.getWrappedLineTrimmedLength=y.reflowSmallerGetNewLineLengths=y.reflowLargerApplyNewLayout=y.reflowLargerCreateNewLayout=y.reflowLargerGetLinesToRemove=void 0,y.reflowLargerGetLinesToRemove=function(K,P,A,d,U){for(var S=[],s=0;s<K.length-1;s++){var w=s,f=K.get(++w);if(f.isWrapped){for(var u=[K.get(s)];w<K.length&&f.isWrapped;)u.push(f),f=K.get(++w);if(d>=s&&d<w)s+=u.length-1;else{for(var l=0,c=N(u,l,P),m=1,C=0;m<u.length;){var M=N(u,m,P),k=M-C,E=A-c,T=Math.min(k,E);u[l].copyCellsFrom(u[m],C,c,T,!1),(c+=T)===A&&(l++,c=0),(C+=T)===M&&(m++,C=0),c===0&&l!==0&&u[l-1].getWidth(A-1)===2&&(u[l].copyCellsFrom(u[l-1],A-1,c++,1,!1),u[l-1].setCell(A-1,U))}u[l].replaceCells(c,A,U);for(var I=0,F=u.length-1;F>0&&(F>l||u[F].getTrimmedLength()===0);F--)I++;I>0&&(S.push(s+u.length-I),S.push(I)),s+=u.length-1}}}return S},y.reflowLargerCreateNewLayout=function(K,P){for(var A=[],d=0,U=P[d],S=0,s=0;s<K.length;s++)if(U===s){var w=P[++d];K.onDeleteEmitter.fire({index:s-S,amount:w}),s+=w-1,S+=w,U=P[++d]}else A.push(s);return{layout:A,countRemoved:S}},y.reflowLargerApplyNewLayout=function(K,P){for(var A=[],d=0;d<P.length;d++)A.push(K.get(P[d]));for(d=0;d<A.length;d++)K.set(d,A[d]);K.length=P.length},y.reflowSmallerGetNewLineLengths=function(K,P,A){for(var d=[],U=K.map(function(c,m){return N(K,m,P)}).reduce(function(c,m){return c+m}),S=0,s=0,w=0;w<U;){if(U-w<A){d.push(U-w);break}S+=A;var f=N(K,s,P);S>f&&(S-=f,s++);var u=K[s].getWidth(S-1)===2;u&&S--;var l=u?A-1:A;d.push(l),w+=l}return d},y.getWrappedLineTrimmedLength=N},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(d,U){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,s){S.__proto__=s}||function(S,s){for(var w in s)s.hasOwnProperty(w)&&(S[w]=s[w])})(d,U)},function(d,U){function S(){this.constructor=d}N(d,U),d.prototype=U===null?Object.create(U):(S.prototype=U.prototype,new S)});Object.defineProperty(y,"__esModule",{value:!0}),y.Marker=void 0;var P=R(0),A=function(d){function U(S){var s=d.call(this)||this;return s.line=S,s._id=U._nextId++,s.isDisposed=!1,s._onDispose=new P.EventEmitter,s}return K(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}(R(2).Disposable);y.Marker=A},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.OptionsService=y.DEFAULT_OPTIONS=y.DEFAULT_BELL_SOUND=void 0;var N=R(0),K=R(11),P=R(33);y.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",y.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:y.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,linkTooltipHoverDuration:500,letterSpacing:0,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!0,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:K.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var A=["cols","rows"],d=function(){function U(S){this._onOptionChange=new N.EventEmitter,this.options=P.clone(y.DEFAULT_OPTIONS);for(var s=0,w=Object.keys(S);s<w.length;s++){var f=w[s];if(f in this.options){var u=S[f];this.options[f]=u}}}return Object.defineProperty(U.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),U.prototype.setOption=function(S,s){if(!(S in y.DEFAULT_OPTIONS))throw new Error('No option with key "'+S+'"');if(A.indexOf(S)!==-1)throw new Error('Option "'+S+'" can only be set in the constructor');this.options[S]!==s&&(s=this._sanitizeAndValidateOption(S,s),this.options[S]!==s&&(this.options[S]=s,this._onOptionChange.fire(S)))},U.prototype._sanitizeAndValidateOption=function(S,s){switch(S){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":s||(s=y.DEFAULT_OPTIONS[S]);break;case"cursorWidth":s=Math.floor(s);case"lineHeight":case"tabStopWidth":if(s<1)throw new Error(S+" cannot be less than 1, value: "+s);break;case"minimumContrastRatio":s=Math.max(1,Math.min(21,Math.round(10*s)/10));break;case"scrollback":if((s=Math.min(s,4294967295))<0)throw new Error(S+" cannot be less than 0, value: "+s);break;case"fastScrollSensitivity":case"scrollSensitivity":if(s<=0)throw new Error(S+" cannot be less than or equal to 0, value: "+s)}return s},U.prototype.getOption=function(S){if(!(S in y.DEFAULT_OPTIONS))throw new Error('No option with key "'+S+'"');return this.options[S]},U}();y.OptionsService=d},function(ke,y,R){"use strict";var N,K=this&&this.__extends||(N=function(l,c){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,C){m.__proto__=C}||function(m,C){for(var M in C)C.hasOwnProperty(M)&&(m[M]=C[M])})(l,c)},function(l,c){function m(){this.constructor=l}N(l,c),l.prototype=c===null?Object.create(c):(m.prototype=c.prototype,new m)}),P=this&&this.__decorate||function(l,c,m,C){var M,k=arguments.length,E=k<3?c:C===null?C=Object.getOwnPropertyDescriptor(c,m):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,c,m,C);else for(var T=l.length-1;T>=0;T--)(M=l[T])&&(E=(k<3?M(E):k>3?M(c,m,E):M(c,m))||E);return k>3&&E&&Object.defineProperty(c,m,E),E},A=this&&this.__param||function(l,c){return function(m,C){c(m,C,l)}};Object.defineProperty(y,"__esModule",{value:!0}),y.CoreService=void 0;var d=R(1),U=R(0),S=R(33),s=R(2),w=Object.freeze({insertMode:!1}),f=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),u=function(l){function c(m,C,M,k){var E=l.call(this)||this;return E._bufferService=C,E._logService=M,E._optionsService=k,E.isCursorInitialized=!1,E.isCursorHidden=!1,E._onData=E.register(new U.EventEmitter),E._onUserInput=E.register(new U.EventEmitter),E._onBinary=E.register(new U.EventEmitter),E._scrollToBottom=m,E.register({dispose:function(){return E._scrollToBottom=void 0}}),E.modes=S.clone(w),E.decPrivateModes=S.clone(f),E}return K(c,l),Object.defineProperty(c.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),c.prototype.reset=function(){this.modes=S.clone(w),this.decPrivateModes=S.clone(f)},c.prototype.triggerDataEvent=function(m,C){if(C===void 0&&(C=!1),!this._optionsService.options.disableStdin){var M=this._bufferService.buffer;M.ybase!==M.ydisp&&this._scrollToBottom(),C&&this._onUserInput.fire(),this._logService.debug('sending data "'+m+'"',function(){return m.split("").map(function(k){return k.charCodeAt(0)})}),this._onData.fire(m)}},c.prototype.triggerBinaryEvent=function(m){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+m+'"',function(){return m.split("").map(function(C){return C.charCodeAt(0)})}),this._onBinary.fire(m))},c=P([A(1,d.IBufferService),A(2,d.ILogService),A(3,d.IOptionsService)],c)}(s.Disposable);y.CoreService=u},function(ke,y,R){"use strict";var N=this&&this.__decorate||function(f,u,l,c){var m,C=arguments.length,M=C<3?u:c===null?c=Object.getOwnPropertyDescriptor(u,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(f,u,l,c);else for(var k=f.length-1;k>=0;k--)(m=f[k])&&(M=(C<3?m(M):C>3?m(u,l,M):m(u,l))||M);return C>3&&M&&Object.defineProperty(u,l,M),M},K=this&&this.__param||function(f,u){return function(l,c){u(l,c,f)}};Object.defineProperty(y,"__esModule",{value:!0}),y.CoreMouseService=void 0;var P=R(1),A=R(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,u){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||u||(l|=3)),l}var S=String.fromCharCode,s={DEFAULT:function(f){var u=[U(f,!1)+32,f.col+32,f.row+32];return u[0]>255||u[1]>255||u[2]>255?"":"\x1B[M"+S(u[0])+S(u[1])+S(u[2])},SGR:function(f){var u=f.action===0&&f.button!==4?"m":"M";return"\x1B[<"+U(f,!0)+";"+f.col+";"+f.row+u}},w=function(){function f(u,l){this._bufferService=u,this._coreService=l,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new A.EventEmitter,this._lastEvent=null;for(var c=0,m=Object.keys(d);c<m.length;c++){var C=m[c];this.addProtocol(C,d[C])}for(var M=0,k=Object.keys(s);M<k.length;M++){var E=k[M];this.addEncoding(E,s[E])}this.reset()}return f.prototype.addProtocol=function(u,l){this._protocols[u]=l},f.prototype.addEncoding=function(u,l){this._encodings[u]=l},Object.defineProperty(f.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(u){if(!this._protocols[u])throw new Error('unknown protocol "'+u+'"');this._activeProtocol=u,this._onProtocolChange.fire(this._protocols[u].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(u){if(!this._encodings[u])throw new Error('unknown encoding "'+u+'"');this._activeEncoding=u},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(u){if(u.col<0||u.col>=this._bufferService.cols||u.row<0||u.row>=this._bufferService.rows||u.button===4&&u.action===32||u.button===3&&u.action!==32||u.button!==4&&(u.action===2||u.action===3)||(u.col++,u.row++,u.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,u))||!this._protocols[this._activeProtocol].restrict(u))return!1;var l=this._encodings[this._activeEncoding](u);return l&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(l):this._coreService.triggerDataEvent(l,!0)),this._lastEvent=u,!0},f.prototype.explainEvents=function(u){return{down:!!(1&u),up:!!(2&u),drag:!!(4&u),move:!!(8&u),wheel:!!(16&u)}},f.prototype._compareEvents=function(u,l){return u.col===l.col&&u.row===l.row&&u.button===l.button&&u.action===l.action&&u.ctrl===l.ctrl&&u.alt===l.alt&&u.shift===l.shift},f=N([K(0,P.IBufferService),K(1,P.ICoreService)],f)}();y.CoreMouseService=w},function(ke,y,R){"use strict";var N=this&&this.__decorate||function(d,U,S,s){var w,f=arguments.length,u=f<3?U:s===null?s=Object.getOwnPropertyDescriptor(U,S):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(d,U,S,s);else for(var l=d.length-1;l>=0;l--)(w=d[l])&&(u=(f<3?w(u):f>3?w(U,S,u):w(U,S))||u);return f>3&&u&&Object.defineProperty(U,S,u),u},K=this&&this.__param||function(d,U){return function(S,s){U(S,s,d)}};Object.defineProperty(y,"__esModule",{value:!0}),y.DirtyRowService=void 0;var P=R(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,S){if(U>S){var s=U;U=S,S=s}U<this._start&&(this._start=U),S>this._end&&(this._end=S)},d.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},d=N([K(0,P.IBufferService)],d)}();y.DirtyRowService=A},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.UnicodeService=void 0;var N=R(0),K=R(79),P=function(){function A(){this._providers=Object.create(null),this._active="",this._onChange=new N.EventEmitter;var d=new K.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,S=d.length,s=0;s<S;++s){var w=d.charCodeAt(s);if(55296<=w&&w<=56319){if(++s>=S)return U+this.wcwidth(w);var f=d.charCodeAt(s);56320<=f&&f<=57343?w=1024*(w-55296)+f-56320+65536:U+=this.wcwidth(f)}U+=this.wcwidth(w)}return U},A}();y.UnicodeService=P},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.UnicodeV6=void 0;var N,K=R(15),P=[[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",!N){N=new Uint8Array(65536),K.fill(N,1),N[0]=0,K.fill(N,0,1,32),K.fill(N,0,127,160),K.fill(N,2,4352,4448),N[9001]=2,N[9002]=2,K.fill(N,2,11904,42192),N[12351]=1,K.fill(N,2,44032,55204),K.fill(N,2,63744,64256),K.fill(N,2,65040,65050),K.fill(N,2,65072,65136),K.fill(N,2,65280,65377),K.fill(N,2,65504,65511);for(var S=0;S<P.length;++S)K.fill(N,0,P[S][0],P[S][1]+1)}}return U.prototype.wcwidth=function(S){return S<32?0:S<127?1:S<65536?N[S]:function(s,w){var f,u=0,l=w.length-1;if(s<w[0][0]||s>w[l][1])return!1;for(;l>=u;)if(s>w[f=u+l>>1][1])u=f+1;else{if(!(s<w[f][0]))return!0;l=f-1}return!1}(S,A)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1},U}();y.UnicodeV6=d},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.CharsetService=void 0;var N=function(){function K(){this.glevel=0,this._charsets=[]}return K.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},K.prototype.setgLevel=function(P){this.glevel=P,this.charset=this._charsets[P]},K.prototype.setgCharset=function(P,A){this._charsets[P]=A,this.glevel===P&&(this.charset=A)},K}();y.CharsetService=N},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.updateWindowsModeWrappedState=void 0;var N=R(3);y.updateWindowsModeWrappedState=function(K){var P=K.buffer.lines.get(K.buffer.ybase+K.buffer.y-1),A=P==null?void 0:P.get(K.cols-1),d=K.buffer.lines.get(K.buffer.ybase+K.buffer.y);d&&A&&(d.isWrapped=A[N.CHAR_DATA_CODE_INDEX]!==N.NULL_CELL_CODE&&A[N.CHAR_DATA_CODE_INDEX]!==N.WHITESPACE_CELL_CODE)}},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.WriteBuffer=void 0;var N=function(){function K(P){this._action=P,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return K.prototype.writeSync=function(P){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(P)},K.prototype.write=function(P,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+=P.length,this._writeBuffer.push(P),this._callbacks.push(A)},K.prototype._innerWrite=function(){for(var P=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 P._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},K}();y.WriteBuffer=N},function(ke,y,R){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.AddonManager=void 0;var N=function(){function K(){this._addons=[]}return K.prototype.dispose=function(){for(var P=this._addons.length-1;P>=0;P--)this._addons[P].instance.dispose()},K.prototype.loadAddon=function(P,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(P)},K.prototype._wrappedAddonDispose=function(P){if(!P.isDisposed){for(var A=-1,d=0;d<this._addons.length;d++)if(this._addons[d]===P){A=d;break}if(A===-1)throw new Error("Could not dispose an addon that has not been loaded");P.isDisposed=!0,P.dispose.apply(P.instance),this._addons.splice(A,1)}},K}();y.AddonManager=N}])})},4977:function(Ot){"use strict";Ot.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=="},16471:function(Ot,ke,y){"use strict";y.d(ke,{ZP:function(){return ps}});const R=Number.isFinite||function(o){return typeof o=="number"&&isFinite(o)},N=Number.isSafeInteger||function(o){return typeof o=="number"&&Math.abs(o)<=K},K=Number.MAX_SAFE_INTEGER||9007199254740991;let P=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"},S={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class s{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 w{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 s(e),this.fast_=new s(t),this.defaultTTFB_=i,this.ttfb_=new s(e)}update(e,t){const{slow_:r,fast_:i,ttfb_:n}=this;r.halfLife!==e&&(this.slow_=new s(e,r.getEstimate(),r.getTotalWeight())),i.halfLife!==t&&(this.fast_=new s(t,i.getEstimate(),i.getTotalWeight())),n.halfLife!==e&&(this.ttfb_=new s(e,n.getEstimate(),n.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const r=8*t,i=e/1e3,n=r/i;this.fast_.sample(i,n),this.slow_.sample(i,n)}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=C(e))in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function u(){return u=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},u.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 c(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 C(o){var e=m(o,"string");return typeof e=="symbol"?e:e+""}class M{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(){},E={trace:k,debug:k,log:k,warn:k,info:k,error:k};function T(){return u({},E)}function I(o,e){const t=self.console[o];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${o}] >`):k}function F(o,e,t){return e[o]?e[o].bind(e):I(o,t)}const H=T();function W(o,e,t){const r=T();if(typeof console=="object"&&o===!0||typeof o=="object"){const i=["debug","log","info","warn","error"];i.forEach(n=>{r[n]=F(n,o,t)});try{r.log(`Debug logs enabled for "${e}" in hls.js version 1.6.15`)}catch(n){return T()}i.forEach(n=>{H[n]=F(n,o)})}else u(H,r);return r}const z=H;function ie(o=!0){return typeof self=="undefined"?void 0:(o||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function re(o){return typeof self!="undefined"&&o===self.ManagedMediaSource}function _e(o,e){const t=Object.keys(o),r=Object.keys(e),i=t.length,n=r.length;return!i||!n||i===n&&!t.some(a=>r.indexOf(a)===-1)}function Ae(o,e=!1){if(typeof TextDecoder!="undefined"){const g=new TextDecoder("utf-8").decode(o);if(e){const x=g.indexOf("\0");return x!==-1?g.substring(0,x):g}return g.replace(/\0/g,"")}const t=o.length;let r,i,n,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++],n=o[h++],a+=String.fromCharCode((r&15)<<12|(i&63)<<6|(n&63)<<0);break}}return a}function ce(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 J(o){return Uint8Array.from(o.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function ae(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var G={exports:{}},X;function Z(){return X||(X=1,function(o,e){(function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,h={buildAbsoluteURL:function(_,g,x){if(x=x||{},_=_.trim(),g=g.trim(),!g){if(!x.alwaysNormalize)return _;var D=h.parseURL(_);if(!D)throw new Error("Error trying to parse base URL.");return D.path=h.normalizePath(D.path),h.buildURLFromParts(D)}var j=h.parseURL(g);if(!j)throw new Error("Error trying to parse relative URL.");if(j.scheme)return x.alwaysNormalize?(j.path=h.normalizePath(j.path),h.buildURLFromParts(j)):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 Q=i.exec(Y.path);Y.netLoc=Q[1],Y.path=Q[2]}Y.netLoc&&!Y.path&&(Y.path="/");var ue={scheme:Y.scheme,netLoc:j.netLoc,path:null,params:j.params,query:j.query,fragment:j.fragment};if(!j.netLoc&&(ue.netLoc=Y.netLoc,j.path[0]!=="/"))if(!j.path)ue.path=Y.path,j.params||(ue.params=Y.params,j.query||(ue.query=Y.query));else{var le=Y.path,be=le.substring(0,le.lastIndexOf("/")+1)+j.path;ue.path=h.normalizePath(be)}return ue.path===null&&(ue.path=x.alwaysNormalize?h.normalizePath(j.path):j.path),h.buildURLFromParts(ue)},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(n,"");_.length!==(_=_.replace(a,"")).length;);return _.split("").reverse().join("")},buildURLFromParts:function(_){return _.scheme+_.netLoc+_.path+_.params+_.query+_.fragment}};o.exports=h})()}(G)),G.exports}var B=Z();class O{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 ne={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class me{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,it(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={[ne.AUDIO]:null,[ne.VIDEO]:null,[ne.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 O),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=B.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[ne.AUDIO]=null,e[ne.VIDEO]=null,e[ne.AUDIOVIDEO]=null}}function Oe(o){return o.sn!=="initSegment"}class He extends me{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.length){const e=this.byteRange[0],t=this.byteRange[1];if(R(e)&&R(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(){var e;const{levelkeys:t}=this;if(!t||t.NONE)return null;if(t.identity)this._decryptdata||(this._decryptdata=t.identity.getDecryptData(this.sn));else if(!((e=this._decryptdata)!=null&&e.keyId)){const r=Object.keys(t);if(r.length===1){const i=this._decryptdata=t[r[0]]||null;i&&(this._decryptdata=i.getDecryptData(this.sn,t))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=R(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){var t;const r=Object.keys(this.levelkeys),i=r.length;if(i>1||i===1&&(t=this.levelkeys[r[0]])!=null&&t.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(!R(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return Oe(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){const t=this.levelkeys;if(t){var r;const i=t[e];i&&!((r=this._decryptdata)!=null&&r.keyId)&&(this._decryptdata=i.getDecryptData(this.sn,t))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,r,i,n,a=!1){const{elementaryStreams:h}=this,_=h[e];if(!_){h[e]={startPTS:t,endPTS:r,startDTS:i,endDTS:n,partial:a};return}_.startPTS=Math.min(_.startPTS,t),_.endPTS=Math.max(_.endPTS,r),_.startDTS=Math.min(_.startDTS,i),_.endDTS=Math.max(_.endDTS,n)}}class ut extends me{constructor(e,t,r,i,n){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,n),n&&(this.fragOffset=n.fragOffset+n.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 Fe(o,e){const t=Object.getPrototypeOf(o);if(t){const r=Object.getOwnPropertyDescriptor(t,e);return r||Fe(t,e)}}function it(o,e){const t=Fe(o,e);t&&(t.enumerable=!0,Object.defineProperty(o,e,t))}const st=Math.pow(2,32)-1,et=[].push,Nt={video:1,audio:2,id3:3,text:4};function tt(o){return String.fromCharCode.apply(null,o)}function kt(o,e){const t=o[e]<<8|o[e+1];return t<0?65536+t:t}function Ne(o,e){const t=Pe(o,e);return t<0?4294967296+t:t}function ft(o,e){let t=Ne(o,e);return t*=Math.pow(2,32),t+=Ne(o,e+4),t}function Pe(o,e){return o[e]<<24|o[e+1]<<16|o[e+2]<<8|o[e+3]}function Te(o){const e=o.byteLength;for(let t=0;t<e;){const r=Ne(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 Se(o,e){const t=[];if(!e.length)return t;const r=o.byteLength;for(let i=0;i<r;){const n=Ne(o,i),a=tt(o.subarray(i+4,i+8)),h=n>1?i+n:r;if(a===e[0])if(e.length===1)t.push(o.subarray(i+8,h));else{const _=Se(o.subarray(i+8,h),e.slice(1));_.length&&et.apply(t,_)}i=h}return t}function ze(o){const e=[],t=o[0];let r=8;const i=Ne(o,r);r+=4;let n=0,a=0;t===0?(n=Ne(o,r),a=Ne(o,r+4),r+=8):(n=ft(o,r),a=ft(o,r+8),r+=16),r+=2;let h=o.length+a;const _=kt(o,r);r+=2;for(let g=0;g<_;g++){let x=r;const D=Ne(o,x);x+=4;const j=D&2147483647;if((D&2147483648)>>>31===1)return z.warn("SIDX has hierarchical references (not supported)"),null;const Q=Ne(o,x);x+=4,e.push({referenceSize:j,subsegmentDuration:Q,info:{duration:Q/i,start:h,end:h+j-1}}),h+=j,x+=4,r=x}return{earliestPresentationTime:n,timescale:i,version:t,referencesCount:_,references:e}}function Je(o){const e=[],t=Se(o,["moov","trak"]);for(let i=0;i<t.length;i++){const n=t[i],a=Se(n,["tkhd"])[0];if(a){let h=a[0];const _=Ne(a,h===0?12:20),g=Se(n,["mdia","mdhd"])[0];if(g){h=g[0];const x=Ne(g,h===0?12:20),D=Se(n,["mdia","hdlr"])[0];if(D){const j=tt(D.subarray(8,12)),Y={soun:ne.AUDIO,vide:ne.VIDEO}[j],Q=Se(n,["mdia","minf","stbl","stsd"])[0],ue=rt(Q);Y?(e[_]={timescale:x,type:Y,stsd:ue},e[Y]=c({timescale:x,id:_},ue)):e[_]={timescale:x,type:j,stsd:ue}}}}}return Se(o,["moov","mvex","trex"]).forEach(i=>{const n=Ne(i,4),a=e[n];a&&(a.default={duration:Ne(i,12),flags:Ne(i,20)})}),e}function rt(o){const e=o.subarray(8),t=e.subarray(86),r=tt(e.subarray(4,8));let i=r,n;const a=r==="enca"||r==="encv";if(a){const g=Se(e,[r])[0].subarray(r==="enca"?28:78);Se(g,["sinf"]).forEach(D=>{const j=Se(D,["schm"])[0];if(j){const Y=tt(j.subarray(4,8));if(Y==="cbcs"||Y==="cenc"){const Q=Se(D,["frma"])[0];Q&&(i=tt(Q))}}})}const h=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const _=Se(t,["avcC"])[0];_&&_.length>3&&(i+="."+Ge(_[1])+Ge(_[2])+Ge(_[3]),n=de(h==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const _=Se(e,[r])[0],g=Se(_.subarray(28),["esds"])[0];if(g&&g.length>7){let x=4;if(g[x++]!==3)break;x=We(g,x),x+=2;const D=g[x++];if(D&128&&(x+=2),D&64&&(x+=g[x++]),g[x++]!==4)break;x=We(g,x);const j=g[x++];if(j===64)i+="."+Ge(j);else break;if(x+=12,g[x++]!==5)break;x=We(g,x);const Y=g[x++];let Q=(Y&248)>>3;Q===31&&(Q+=1+((Y&7)<<3)+((g[x]&224)>>5)),i+="."+Q}break}case"hvc1":case"hev1":{const _=Se(t,["hvcC"])[0];if(_&&_.length>12){const g=_[1],x=["","A","B","C"][g>>6],D=g&31,j=Ne(_,2),Y=(g&32)>>5?"H":"L",Q=_[12],ue=_.subarray(6,12);i+="."+x+D,i+="."+Le(j).toString(16).toUpperCase(),i+="."+Y+Q;let le="";for(let be=ue.length;be--;){const xe=ue[be];(xe||le)&&(le="."+xe.toString(16).toUpperCase()+le)}i+=le}n=de(h=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{i=de(i,t)||i;break}case"vp09":{const _=Se(t,["vpcC"])[0];if(_&&_.length>6){const g=_[4],x=_[5],D=_[6]>>4&15;i+="."+Xe(g)+"."+Xe(x)+"."+Xe(D)}break}case"av01":{const _=Se(t,["av1C"])[0];if(_&&_.length>2){const g=_[1]>>>5,x=_[1]&31,D=_[2]>>>7?"H":"M",j=(_[2]&64)>>6,Y=(_[2]&32)>>5,Q=g===2&&j?Y?12:10:j?10:8,ue=(_[2]&16)>>4,le=(_[2]&8)>>3,be=(_[2]&4)>>2,xe=_[2]&3;i+="."+g+"."+Xe(x)+D+"."+Xe(Q)+"."+ue+"."+le+be+xe+"."+Xe(1)+"."+Xe(1)+"."+Xe(1)+"."+0,n=de("dav1",t)}break}}return{codec:i,encrypted:a,supplemental:n}}function de(o,e){const t=Se(e,["dvvC"]),r=t.length?t[0]:Se(e,["dvcC"])[0];if(r){const i=r[2]>>1&127,n=r[2]<<5&32|r[3]>>3&31;return o+"."+Xe(i)+"."+Xe(n)}}function Le(o){let e=0;for(let t=0;t<32;t++)e|=(o>>t&1)<<31-t;return e>>>0}function We(o,e){const t=e+5;for(;o[e++]&128&&e<t;);return e}function Ge(o){return("0"+o.toString(16).toUpperCase()).slice(-2)}function Xe(o){return(o<10?"0":"")+o}function gt(o,e){if(!o||!e)return;const t=e.keyId;t&&e.isCommonEncryption&&ht(o,(r,i)=>{const n=r.subarray(8,24);n.some(a=>a!==0)||(z.log(`[eme] Patching keyId in 'enc${i?"a":"v"}>sinf>>tenc' box: ${ce(n)} -> ${ce(t)}`),r.set(t,8))})}function Ct(o){const e=[];return ht(o,t=>e.push(t.subarray(8,24))),e}function ht(o,e){Se(o,["moov","trak"]).forEach(r=>{const i=Se(r,["mdia","minf","stbl","stsd"])[0];if(!i)return;const n=i.subarray(8);let a=Se(n,["enca"]);const h=a.length>0;h||(a=Se(n,["encv"])),a.forEach(_=>{const g=h?_.subarray(28):_.subarray(78);Se(g,["sinf"]).forEach(D=>{const j=dt(D);j&&e(j,h)})})})}function dt(o){const e=Se(o,["schm"])[0];if(e){const t=tt(e.subarray(4,8));if(t==="cbcs"||t==="cenc"){const r=Se(o,["schi","tenc"])[0];if(r)return r}}}function vt(o,e,t){const r={},i=Se(o,["moof","traf"]);for(let n=0;n<i.length;n++){const a=i[n],h=Se(a,["tfhd"])[0],_=Ne(h,4),g=e[_];if(!g)continue;r[_]||(r[_]={start:NaN,duration:0,sampleCount:0,timescale:g.timescale,type:g.type});const x=r[_],D=Se(a,["tfdt"])[0];if(D){const Ce=D[0];let Ue=Ne(D,4);Ce===1&&(Ue===st?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(Ue*=st+1,Ue+=Ne(D,8))),R(Ue)&&(!R(x.start)||Ue<x.start)&&(x.start=Ue)}const j=g.default,Y=Ne(h,0)|(j==null?void 0:j.flags);let Q=(j==null?void 0:j.duration)||0;Y&8&&(Y&2?Q=Ne(h,12):Q=Ne(h,8));const ue=Se(a,["trun"]);let le=x.start||0,be=0,xe=Q;for(let Ce=0;Ce<ue.length;Ce++){const Ue=ue[Ce],qe=Ne(Ue,4),pt=x.sampleCount;x.sampleCount+=qe;const Ye=Ue[3]&1,at=Ue[3]&4,nt=Ue[2]&1,Ze=Ue[2]&2,wt=Ue[2]&4,Wt=Ue[2]&8;let Zt=8,rr=qe;for(Ye&&(Zt+=4),at&&qe&&(!(Ue[Zt+1]&1)&&x.keyFrameIndex===void 0&&(x.keyFrameIndex=pt),Zt+=4,nt?(xe=Ne(Ue,Zt),Zt+=4):xe=Q,Ze&&(Zt+=4),Wt&&(Zt+=4),le+=xe,be+=xe,rr--);rr--;)nt?(xe=Ne(Ue,Zt),Zt+=4):xe=Q,Ze&&(Zt+=4),wt&&(Ue[Zt+1]&1||x.keyFrameIndex===void 0&&(x.keyFrameIndex=x.sampleCount-(rr+1),x.keyFrameStart=le),Zt+=4),Wt&&(Zt+=4),le+=xe,be+=xe;!be&&Q&&(be+=Q*qe)}x.duration+=be}if(!Object.keys(r).some(n=>r[n].duration)){let n=1/0,a=0;const h=Se(o,["sidx"]);for(let _=0;_<h.length;_++){const g=ze(h[_]);if(g!=null&&g.references){n=Math.min(n,g.earliestPresentationTime/g.timescale);const x=g.references.reduce((D,j)=>D+j.info.duration||0,0);a=Math.max(a,x+g.earliestPresentationTime/g.timescale)}}a&&R(a)&&Object.keys(r).forEach(_=>{r[_].duration||(r[_].duration=a*r[_].timescale-r[_].start)})}return r}function Pt(o){const e={valid:null,remainder:null},t=Se(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 Tt(o,e){const t=new Uint8Array(o.length+e.length);return t.set(o),t.set(e,o.length),t}function xt(o,e){const t=[],r=e.samples,i=e.timescale,n=e.id;let a=!1;return Se(r,["moof"]).map(_=>{const g=_.byteOffset-8;Se(_,["traf"]).map(D=>{const j=Se(D,["tfdt"]).map(Y=>{const Q=Y[0];let ue=Ne(Y,4);return Q===1&&(ue*=Math.pow(2,32),ue+=Ne(Y,8)),ue/i})[0];return j!==void 0&&(o=j),Se(D,["tfhd"]).map(Y=>{const Q=Ne(Y,4),ue=Ne(Y,0)&16777215,le=(ue&1)!==0,be=(ue&2)!==0,xe=(ue&8)!==0;let Ce=0;const Ue=(ue&16)!==0;let qe=0;const pt=(ue&32)!==0;let Ye=8;Q===n&&(le&&(Ye+=8),be&&(Ye+=4),xe&&(Ce=Ne(Y,Ye),Ye+=4),Ue&&(qe=Ne(Y,Ye),Ye+=4),pt&&(Ye+=4),e.type==="video"&&(a=Ke(e.codec)),Se(D,["trun"]).map(at=>{const nt=at[0],Ze=Ne(at,0)&16777215,wt=(Ze&1)!==0;let Wt=0;const Zt=(Ze&4)!==0,rr=(Ze&256)!==0;let Xt=0;const Ut=(Ze&512)!==0;let Jt=0;const Gt=(Ze&1024)!==0,tr=(Ze&2048)!==0;let hr=0;const Ht=Ne(at,4);let jt=8;wt&&(Wt=Ne(at,jt),jt+=4),Zt&&(jt+=4);let Er=Wt+g;for(let Br=0;Br<Ht;Br++){if(rr?(Xt=Ne(at,jt),jt+=4):Xt=Ce,Ut?(Jt=Ne(at,jt),jt+=4):Jt=qe,Gt&&(jt+=4),tr&&(nt===0?hr=Ne(at,jt):hr=Pe(at,jt),jt+=4),e.type===ne.VIDEO){let wr=0;for(;wr<Jt;){const Tr=Ne(r,Er);if(Er+=4,St(a,r[Er])){const ki=r.subarray(Er,Er+Tr);_t(ki,a?2:1,o+hr/i,t)}Er+=Tr,wr+=Tr+4}}o+=Xt/i}}))})})}),t}function Ke(o){if(!o)return!1;const e=o.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function St(o,e){if(o){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function _t(o,e,t,r){const i=lt(o);let n=0;n+=e;let a=0,h=0,_=0;for(;n<i.length;){a=0;do{if(n>=i.length)break;_=i[n++],a+=_}while(_===255);h=0;do{if(n>=i.length)break;_=i[n++],h+=_}while(_===255);const g=i.length-n;let x=n;if(h<g)n+=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[x++]===181){const j=kt(i,x);if(x+=2,j===49){const Y=Ne(i,x);if(x+=4,Y===1195456820){const Q=i[x++];if(Q===3){const ue=i[x++],le=31&ue,be=64&ue,xe=be?2+le*3:0,Ce=new Uint8Array(xe);if(be){Ce[0]=ue;for(let Ue=1;Ue<xe;Ue++)Ce[Ue]=i[x++]}r.push({type:Q,payloadType:a,pts:t,bytes:Ce})}}}}}else if(a===5&&h>16){const D=[];for(let Q=0;Q<16;Q++){const ue=i[x++].toString(16);D.push(ue.length==1?"0"+ue:ue),(Q===3||Q===5||Q===7||Q===9)&&D.push("-")}const j=h-16,Y=new Uint8Array(j);for(let Q=0;Q<j;Q++)Y[Q]=i[x++];r.push({payloadType:a,pts:t,uuid:D.join(""),userData:Ae(Y),userDataBytes:Y})}}}function lt(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,n=new Uint8Array(i);let a=0;for(r=0;r<i;a++,r++)a===t[0]&&(a++,t.shift()),n[r]=o[a];return n}function At(o){const e=o[0];let t="",r="",i=0,n=0,a=0,h=0,_=0,g=0;if(e===0){for(;tt(o.subarray(g,g+1))!=="\0";)t+=tt(o.subarray(g,g+1)),g+=1;for(t+=tt(o.subarray(g,g+1)),g+=1;tt(o.subarray(g,g+1))!=="\0";)r+=tt(o.subarray(g,g+1)),g+=1;r+=tt(o.subarray(g,g+1)),g+=1,i=Ne(o,12),n=Ne(o,16),h=Ne(o,20),_=Ne(o,24),g=28}else if(e===1){g+=4,i=Ne(o,g),g+=4;const D=Ne(o,g);g+=4;const j=Ne(o,g);for(g+=4,a=bu(2,32)*D+j,N(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=Ne(o,g),g+=4,_=Ne(o,g),g+=4;tt(o.subarray(g,g+1))!=="\0";)t+=tt(o.subarray(g,g+1)),g+=1;for(t+=tt(o.subarray(g,g+1)),g+=1;tt(o.subarray(g,g+1))!=="\0";)r+=tt(o.subarray(g,g+1)),g+=1;r+=tt(o.subarray(g,g+1)),g+=1}const x=o.subarray(g,o.byteLength);return{schemeIdUri:t,value:r,timeScale:i,presentationTime:a,presentationTimeDelta:n,eventDuration:h,id:_,payload:x}}function $(o,...e){const t=e.length;let r=8,i=t;for(;i--;)r+=e[i].byteLength;const n=new Uint8Array(r);for(n[0]=r>>24&255,n[1]=r>>16&255,n[2]=r>>8&255,n[3]=r&255,n.set(o,4),i=0,r=8;i<t;i++)n.set(e[i],r),r+=e[i].byteLength;return n}function q(o,e,t){if(o.byteLength!==16)throw new RangeError("Invalid system id");let r,i;r=0,i=new Uint8Array;let n;r>0?(n=new Uint8Array(4),e.length>0&&new DataView(n.buffer).setUint32(0,e.length,!1)):n=new Uint8Array;const a=new Uint8Array(4);return t.byteLength>0&&new DataView(a.buffer).setUint32(0,t.byteLength,!1),$([112,115,115,104],new Uint8Array([r,0,0,0]),o,n,i,a,t)}function Be(o){const e=[];if(o instanceof ArrayBuffer){const t=o.byteLength;let r=0;for(;r+32<t;){const i=new DataView(o,r),n=oe(i);e.push(n),r+=n.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 n=o.getUint32(8)>>>24;if(n!==0&&n!==1)return{offset:t,size:e};const a=o.buffer,h=ce(new Uint8Array(a,t+12,16));let _=null,g=null,x=0;if(n===0)x=28;else{const j=o.getUint32(28);if(!j||r<32+j*16)return{offset:t,size:e};_=[];for(let Y=0;Y<j;Y++)_.push(new Uint8Array(a,t+32+Y*16,16));x=32+j*16}if(!x)return{offset:t,size:e};const D=o.getUint32(x);return e-32<D?{offset:t,size:e}:(g=new Uint8Array(a,t+x+4,D),{version:n,systemId:h,kids:_,data:g,offset:t,size:e})}const ge=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Lt={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 Re(o,e){const t=Lt[e];return!!t&&!!t[o.slice(0,4)]}function Me(o,e,t=!0){return!o.split(",").some(r=>!$e(r,e,t))}function $e(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 fe(o){if(o){const e=o.substring(0,4);return Lt.video[e]}return 2}function Ee(o){const e=ge();return o.split(",").reduce((t,r)=>{const n=e&&Ke(r)?9:Lt.video[r];return n?(n*2+t)/(t?3:2):(Lt.audio[r]+t)/(t?2:1)},0)}const Ie={};function se(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($e(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 ot=/flac|opus|mp4a\.40\.34/i;function ve(o,e=!0){return o.replace(ot,t=>se(t.toLowerCase(),e))}function Rt(o,e){const t=[];if(o){const r=o.split(",");for(let i=0;i<r.length;i++)Re(r[i],"video")||t.push(r[i])}return e&&t.push(e),t.join(",")}function Bt(o,e){if(o&&(o.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(o)!==-1)&&(zt(o,"audio")||zt(o,"video")))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 zt(o,e){return Re(o,e)&&$e(o,e)}function Cr(o){const e=o.split(",");for(let t=0;t<e.length;t++){const r=e[t].split(".");r.length>2&&r[0]==="avc1"&&(e[t]=`avc1.${parseInt(r[1]).toString(16)}${("000"+parseInt(r[2]).toString(16)).slice(-4)}`)}return e.join(",")}function ar(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 qt(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 Dr(o){return o.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Hr={supported:!0,powerEfficient:!0,smooth:!0},pr={supported:!1,smooth:!1,powerEfficient:!1},gr={supported:!0,configurations:[],decodingInfoResults:[Hr]};function Mt(o,e){return{supported:!1,configurations:e,decodingInfoResults:[pr],error:o}}function yt(o,e,t,r,i,n){const a=o.videoCodec,h=o.audioCodec?o.audioGroups:null,_=n==null?void 0:n.audioCodec,g=n==null?void 0:n.channels,x=g?parseInt(g):_?1/0:2;let D=null;if(h!=null&&h.length)try{h.length===1&&h[0]?D=e.groups[h[0]].channels:D=h.reduce((j,Y)=>{if(Y){const Q=e.groups[Y];if(!Q)throw new Error(`Audio track group ${Y} not found`);Object.keys(Q.channels).forEach(ue=>{j[ue]=(j[ue]||0)+Q.channels[ue]})}return j},{2:0})}catch(j){return!0}return a!==void 0&&(a.split(",").some(j=>Ke(j))||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))||!!D&&R(x)&&Object.keys(D).some(j=>parseInt(j)>x)}function bt(o,e,t,r={}){const i=o.videoCodec;if(!i&&!o.audioCodec||!t)return Promise.resolve(gr);const n=[],a=Vt(o),h=a.length,_=cr(o,e,h>0),g=_.length;for(let x=h||1*g||1;x--;){const D={type:"media-source"};if(h&&(D.video=a[x%h]),g){D.audio=_[x%g];const j=D.audio.bitrate;D.video&&j&&(D.video.bitrate-=j)}n.push(D)}if(i){const x=navigator.userAgent;if(i.split(",").some(D=>Ke(D))&&ge())return Promise.resolve(Mt(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${x})`),n))}return Promise.all(n.map(x=>{const D=Zr(x);return r[D]||(r[D]=t.decodingInfo(x))})).then(x=>({supported:!x.some(D=>!D.supported),configurations:n,decodingInfoResults:x})).catch(x=>({supported:!1,configurations:n,decodingInfoResults:[],error:x}))}function Vt(o){var e;const t=(e=o.videoCodec)==null?void 0:e.split(","),r=Yr(o),i=o.width||640,n=o.height||480,a=o.frameRate||30,h=o.videoRange.toLowerCase();return t?t.map(_=>{const g={contentType:he(ar(_),"video"),width:i,height:n,bitrate:r,framerate:a};return h!=="sdr"&&(g.transferFunction=h),g}):[]}function cr(o,e,t){var r;const i=(r=o.audioCodec)==null?void 0:r.split(","),n=Yr(o);return i&&o.audioGroups?o.audioGroups.reduce((a,h)=>{var _;const g=h?(_=e.groups[h])==null?void 0:_.tracks:null;return g?g.reduce((x,D)=>{if(D.groupId===h){const j=parseFloat(D.channels||"");i.forEach(Y=>{const Q={contentType:he(Y,"audio"),bitrate:t?xr(Y,n):n};j&&(Q.channels=""+j),x.push(Q)})}return x},a):a},[]):[]}function xr(o,e){if(e<=1)return 1;let t=128e3;return o==="ec-3"?t=768e3:o==="ac-3"&&(t=64e4),Math.min(e/2,t)}function Yr(o){return Math.ceil(Math.max(o.bitrate*.9,o.averageBitrate)/1e3)*1e3||1}function Zr(o){let e="";const{audio:t,video:r}=o;if(r){const i=Dr(r.contentType);e+=`${i}_r${r.height}x${r.width}f${Math.ceil(r.framerate)}${r.transferFunction||"sd"}_${Math.ceil(r.bitrate/1e5)}`}if(t){const i=Dr(t.contentType);e+=`${r?"_":""}${i}_c${t.channels}`}return e}const ni=["NONE","TYPE-0","TYPE-1",null];function Jr(o){return ni.indexOf(o)>-1}const _r=["SDR","PQ","HLG"];function ci(o){return!!o&&_r.indexOf(o)>-1}var Rr={No:"",Yes:"YES",v2:"v2"};function bi(o){const{canSkipUntil:e,canSkipDateRanges:t,age:r}=o,i=r<e/2;return e&&i?t?Rr.v2:Rr.Yes:Rr.No}class fi{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 br{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 Ar(this._audioGroups,e)}hasSubtitleGroup(e){return Ar(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 Ar(o,e){return!e||!o?!1:o.indexOf(e)!==-1}function Lr(){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 Nr(o,e){let t=!1,r=[];if(o&&(t=o!=="SDR",r=[o]),e){r=e.allowedVideoRanges||_r.slice(0);const i=r.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:i&&Lr(),t||(r=["SDR"])}return{preferHDR:t,allowedVideoRanges:r}}const Sr=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}},ir=(o,e)=>JSON.stringify(o,Sr(e));function di(o,e,t,r,i){const n=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 x=!1,D=!1,j=1/0,Y=1/0,Q=1/0,ue=1/0,le=0,be=[];const{preferHDR:xe,allowedVideoRanges:Ce}=Nr(e,i);for(let at=n.length;at--;){const nt=o[n[at]];x||(x=nt.channels[2]>0),j=Math.min(j,nt.minHeight),Y=Math.min(Y,nt.minFramerate),Q=Math.min(Q,nt.minBitrate),Ce.filter(wt=>nt.videoRanges[wt]>0).length>0&&(D=!0)}j=R(j)?j:0,Y=R(Y)?Y:0;const Ue=Math.max(1080,j),qe=Math.max(30,Y);Q=R(Q)?Q:t,t=Math.max(Q,t),D||(e=void 0);const pt=n.length>1;return{codecSet:n.reduce((at,nt)=>{const Ze=o[nt];if(nt===at)return at;if(be=D?Ce.filter(wt=>Ze.videoRanges[wt]>0):[],pt){if(Ze.minBitrate>t)return Ur(nt,`min bitrate of ${Ze.minBitrate} > current estimate of ${t}`),at;if(!Ze.hasDefaultAudio)return Ur(nt,"no renditions with default or auto-select sound found"),at;if(h&&nt.indexOf(h.substring(0,4))%5!==0)return Ur(nt,`audio codec preference "${h}" not found`),at;if(a&&!g){if(!Ze.channels[a])return Ur(nt,`no renditions with ${a} channel sound found (channels options: ${Object.keys(Ze.channels)})`),at}else if((!h||g)&&x&&Ze.channels[2]===0)return Ur(nt,"no renditions with stereo sound found"),at;if(Ze.minHeight>Ue)return Ur(nt,`min resolution of ${Ze.minHeight} > maximum of ${Ue}`),at;if(Ze.minFramerate>qe)return Ur(nt,`min framerate of ${Ze.minFramerate} > maximum of ${qe}`),at;if(!be.some(wt=>Ze.videoRanges[wt]>0))return Ur(nt,`no variants with VIDEO-RANGE of ${ir(be)} found`),at;if(_&&nt.indexOf(_.substring(0,4))%5!==0)return Ur(nt,`video codec preference "${_}" not found`),at;if(Ze.maxScore<le)return Ur(nt,`max score of ${Ze.maxScore} < selected max of ${le}`),at}return at&&(Ee(nt)>=Ee(at)||Ze.fragmentError>o[at].fragmentError)?at:(ue=Ze.minIndex,le=Ze.maxScore,nt)},void 0),videoRanges:be,preferHDR:xe,minFramerate:Y,minBitrate:Q,minIndex:ue}}function Ur(o,e){z.log(`[abr] start candidates with "${o}" ignored because ${e}`)}function pi(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 Ji(o,e,t,r){return o.slice(t,r+1).reduce((i,n,a)=>{if(!n.codecSet)return i;const h=n.audioGroups;let _=i[n.codecSet];_||(i[n.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,n.bitrate);const g=Math.min(n.height,n.width);return _.minHeight=Math.min(_.minHeight,g),_.minFramerate=Math.min(_.minFramerate,n.frameRate),_.minIndex=Math.min(_.minIndex,a),_.maxScore=Math.max(_.maxScore,n.score),_.fragmentError+=n.fragmentError,_.videoRanges[n.videoRange]=(_.videoRanges[n.videoRange]||0)+1,h&&h.forEach(x=>{if(!x)return;const D=e.groups[x];D&&(_.hasDefaultAudio=_.hasDefaultAudio||e.hasDefaultAudio?D.hasDefault:D.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(D.channels).forEach(j=>{_.channels[j]=(_.channels[j]||0)+D.channels[j]}))}),i},{})}function es(o){if(!o)return o;const{lang:e,assocLang:t,characteristics:r,channels:i,audioCodec:n}=o;return{lang:e,assocLang:t,characteristics:r,channels:i,audioCodec:n}}function Ci(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($i(o,i,t))return r}return-1}function $i(o,e,t){const{groupId:r,name:i,lang:n,assocLang:a,default:h}=o,_=o.forced;return(r===void 0||e.groupId===r)&&(i===void 0||e.name===i)&&(n===void 0||ms(n,e.lang))&&(n===void 0||e.assocLang===a)&&(h===void 0||e.default===h)&&(_===void 0||e.forced===_)&&(!("characteristics"in o)||ts(o.characteristics||"",e.characteristics))&&(t===void 0||t(o,e))}function ms(o,e="--"){return o.length===e.length?o===e:o.startsWith(e)||e.startsWith(o)}function ts(o,e=""){const t=o.split(","),r=e.split(",");return t.length===r.length&&!t.some(i=>r.indexOf(i)===-1)}function si(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 Ir(o,e,t,r,i){const n=e[r],h=e.reduce((j,Y,Q)=>{const ue=Y.uri;return(j[ue]||(j[ue]=[])).push(Q),j},{})[n.uri];h.length>1&&(r=Math.max.apply(Math,h));const _=n.videoRange,g=n.frameRate,x=n.codecSet.substring(0,4),D=ti(e,r,j=>{if(j.videoRange!==_||j.frameRate!==g||j.codecSet.substring(0,4)!==x)return!1;const Y=j.audioGroups,Q=t.filter(ue=>!Y||Y.indexOf(ue.groupId)!==-1);return Ci(o,Q,i)>-1});return D>-1?D:ti(e,r,j=>{const Y=j.audioGroups,Q=t.filter(ue=>!Y||Y.indexOf(ue.groupId)!==-1);return Ci(o,Q,i)>-1})}function ti(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 mn(o,e){var t;return!!o&&o!==((t=e.loadLevelObj)==null?void 0:t.uri)}class Ai extends M{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var r;const{fragCurrent:i,partCurrent:n,hls:a}=this,{autoLevelEnabled:h,media:_}=a;if(!i||!_)return;const g=performance.now(),x=n?n.stats:i.stats,D=n?n.duration:i.duration,j=g-x.loading.start,Y=a.minAutoLevel,Q=i.level,ue=this._nextAutoLevel;if(x.aborted||x.loaded&&x.loaded===x.total||Q<=Y){this.clearTimer(),this._nextAutoLevel=-1;return}if(!h)return;const le=ue>-1&&ue!==Q,be=!!t||le;if(!be&&(_.paused||!_.playbackRate||!_.readyState))return;const xe=a.mainForwardBufferInfo;if(!be&&xe===null)return;const Ce=this.bwEstimator.getEstimateTTFB(),Ue=Math.abs(_.playbackRate);if(j<=Math.max(Ce,1e3*(D/(Ue*2))))return;const qe=xe?xe.len/Ue:0,pt=x.loading.first?x.loading.first-x.loading.start:-1,Ye=x.loaded&&pt>-1,at=this.getBwEstimate(),nt=a.levels,Ze=nt[Q],wt=Math.max(x.loaded,Math.round(D*(i.bitrate||Ze.averageBitrate)/8));let Wt=Ye?j-pt:j;Wt<1&&Ye&&(Wt=Math.min(j,x.loaded*8/at));const Zt=Ye?x.loaded*1e3/Wt:0,rr=Ce/1e3,Xt=Zt?(wt-x.loaded)/Zt:wt*8/at+rr;if(Xt<=qe)return;const Ut=Zt?Zt*8:at,Jt=((r=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:r.live)===!0,Gt=this.hls.config.abrBandWidthUpFactor;let tr=Number.POSITIVE_INFINITY,hr;for(hr=Q-1;hr>Y;hr--){const Br=nt[hr].maxBitrate,wr=!nt[hr].details||Jt;if(tr=this.getTimeToLoadFrag(rr,Ut,D*Br,wr),tr<Math.min(qe,D+rr))break}if(tr>=Xt||tr>D*10)return;Ye?this.bwEstimator.sample(j-Math.min(Ce,pt),x.loaded):this.bwEstimator.sampleTTFB(j);const Ht=nt[hr].maxBitrate;this.getBwEstimate()*Gt>Ht&&this.resetEstimator(Ht);const jt=this.findBestLevel(Ht,Y,hr,0,qe,1,1);jt>-1&&(hr=jt),this.warn(`Fragment ${i.sn}${n?" part "+n.index:""} of level ${Q} is loading too slowly;
|
|
|
Fragment duration: ${i.duration.toFixed(3)}
|
|
|
Time to underbuffer: ${qe.toFixed(3)} s
|
|
|
Estimated load time for current fragment: ${Xt.toFixed(3)} s
|
|
|
Estimated load time for down switch fragment: ${tr.toFixed(3)} s
|
|
|
TTFB estimate: ${pt|0} ms
|
|
|
Current BW estimate: ${R(at)?at|0:"Unknown"} bps
|
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
|
Switching to level ${hr} @ ${Ht|0} bps`),a.nextLoadLevel=a.nextAutoLevel=hr,this.clearTimer();const Er=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===hr&&hr>0){const Br=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${hr>0?"and switching down":""}
|
|
|
Fragment duration: ${i.duration.toFixed(3)} s
|
|
|
Time to underbuffer: ${Br.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,hr>Y){let wr=this.findBestLevel(this.hls.levels[Y].bitrate,Y,hr,0,Br,1,1);wr===-1&&(wr=Y),this.hls.nextLoadLevel=this.hls.nextAutoLevel=wr,this.resetEstimator(this.hls.levels[wr].bitrate)}}};le||Xt>tr*2?Er():this.timer=self.setInterval(Er,tr*1e3),a.trigger(d.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:n,stats:x})},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 w(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=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const 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:n}=this;if(r&&i&&r.sn===i.sn&&r.level===i.level){const a=performance.now(),h=n?n.stats:r.stats,_=a-h.loading.start,g=h.loading.first?h.loading.first-h.loading.start:-1;if(h.loaded&&g>-1){const D=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(_-Math.min(D,g),h.loaded)}else this.bwEstimator.sampleTTFB(_)}break}}}getTimeToLoadFrag(e,t,r,i){const n=e+r/t,a=i?e+this.lastLevelLoadSec:0;return n+a}onLevelLoaded(e,t){const r=this.hls.config,{loading:i}=t.stats,n=i.end-i.first;R(n)&&(this.lastLevelLoadSec=n/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===S.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 n=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)+n;a.loaded={bytes:h,duration:_},a.realBitrate=Math.round(8*h/_)}if(t.bitrateTest){const n={stats:i,frag:t,part:r,id:t.type};this.onFragBuffered(d.FRAG_BUFFERED,n),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:r,part:i}=t,n=i!=null&&i.stats.loaded?i.stats:r.stats;if(n.aborted||this.ignoreFragment(r))return;const a=n.parsing.end-n.loading.start-Math.min(n.loading.first-n.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(a,n.loaded),n.bwEstimate=this.getBwEstimate(),r.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==S.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,n=this.findBestLevel(r,t,e,0,i,1,1);if(n>-1)return n;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 n=r&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const a=this.hls.levels;if(a.length>Math.max(e,n)&&a[e].loadError<=a[n].loadError)return e}return this._nextAutoLevel=n,this.nextAutoLevelKey=this.getAutoLevelKey(),n}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:n,minAutoLevel:a}=r,h=t?t.duration:e?e.duration:0,_=this.getBwEstimate(),g=this.getStarvationDelay();let x=n.abrBandWidthFactor,D=n.abrBandWidthUpFactor;if(g){const le=this.findBestLevel(_,a,i,g,0,x,D);if(le>=0)return this.rebufferNotice=-1,le}let j=h?Math.min(h,n.maxStarvationDelay):n.maxStarvationDelay;if(!g){const le=this.bitrateTestDelay;le&&(j=(h?Math.min(h,n.maxLoadingDelay):n.maxLoadingDelay)-le,this.info(`bitrate test took ${Math.round(1e3*le)}ms, set first fragment max fetchDuration to ${Math.round(1e3*j)} ms`),x=D=1)}const Y=this.findBestLevel(_,a,i,g,j,x,D);if(this.rebufferNotice!==Y&&(this.rebufferNotice=Y,this.info(`${g?"rebuffering expected":"buffer is empty"}, optimal quality level ${Y}`)),Y>-1)return Y;const Q=r.levels[a],ue=r.loadLevelObj;return ue&&(Q==null?void 0:Q.bitrate)<ue.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,n,a,h){var _;const g=i+n,x=this.lastLoadedFragLevel,D=x===-1?this.hls.firstLevel:x,{fragCurrent:j,partCurrent:Y}=this,{levels:Q,allAudioTracks:ue,loadLevel:le,config:be}=this.hls;if(Q.length===1)return 0;const xe=Q[D],Ce=!!((_=this.hls.latestLevelDetails)!=null&&_.live),Ue=le===-1||x===-1;let qe,pt="SDR",Ye=(xe==null?void 0:xe.frameRate)||0;const{audioPreference:at,videoPreference:nt}=be,Ze=this.audioTracksByGroup||(this.audioTracksByGroup=pi(ue));let wt=-1;if(Ue){if(this.firstSelection!==-1)return this.firstSelection;const Ut=this.codecTiers||(this.codecTiers=Ji(Q,Ze,t,r)),Jt=di(Ut,pt,e,at,nt),{codecSet:Gt,videoRanges:tr,minFramerate:hr,minBitrate:Ht,minIndex:jt,preferHDR:Er}=Jt;wt=jt,qe=Gt,pt=Er?tr[tr.length-1]:tr[0],Ye=hr,e=Math.max(e,Ht),this.log(`picked start tier ${ir(Jt)}`)}else qe=xe==null?void 0:xe.codecSet,pt=xe==null?void 0:xe.videoRange;const Wt=Y?Y.duration:j?j.duration:0,Zt=this.bwEstimator.getEstimateTTFB()/1e3,rr=[];for(let Ut=r;Ut>=t;Ut--){var Xt;const Jt=Q[Ut],Gt=Ut>D;if(!Jt)continue;if(be.useMediaCapabilities&&!Jt.supportedResult&&!Jt.supportedPromise){const wr=navigator.mediaCapabilities;typeof(wr==null?void 0:wr.decodingInfo)=="function"&&yt(Jt,Ze,pt,Ye,e,at)?(Jt.supportedPromise=bt(Jt,Ze,wr,this.supportedCache),Jt.supportedPromise.then(Tr=>{if(!this.hls)return;Jt.supportedResult=Tr;const ki=this.hls.levels,wi=ki.indexOf(Jt);Tr.error?this.warn(`MediaCapabilities decodingInfo error: "${Tr.error}" for level ${wi} ${ir(Tr)}`):Tr.supported?Tr.decodingInfoResults.some(dn=>dn.smooth===!1||dn.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${wi} not smooth or powerEfficient: ${ir(Tr)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${wi} ${ir(Tr)}`),wi>-1&&ki.length>1&&(this.log(`Removing unsupported level ${wi}`),this.hls.removeLevel(wi),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))}).catch(Tr=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${Tr}`)})):Jt.supportedResult=gr}if((qe&&Jt.codecSet!==qe||pt&&Jt.videoRange!==pt||Gt&&Ye>Jt.frameRate||!Gt&&Ye>0&&Ye<Jt.frameRate||(Xt=Jt.supportedResult)!=null&&(Xt=Xt.decodingInfoResults)!=null&&Xt.some(wr=>wr.smooth===!1))&&(!Ue||Ut!==wt)){rr.push(Ut);continue}const tr=Jt.details,hr=(Y?tr==null?void 0:tr.partTarget:tr==null?void 0:tr.averagetargetduration)||Wt;let Ht;Gt?Ht=h*e:Ht=a*e;const jt=Wt&&i>=Wt*2&&n===0?Jt.averageBitrate:Jt.maxBitrate,Er=this.getTimeToLoadFrag(Zt,Ht,jt*hr,tr===void 0);if(Ht>=jt&&(Ut===x||Jt.loadError===0&&Jt.fragmentError===0)&&(Er<=Zt||!R(Er)||Ce&&!this.bitrateTestDelay||Er<g)){const wr=this.forcedAutoLevel;return Ut!==le&&(wr===-1||wr!==le)&&(rr.length&&this.trace(`Skipped level(s) ${rr.join(",")} of ${r} max with CODECS and VIDEO-RANGE:"${Q[rr[0]].codecs}" ${Q[rr[0]].videoRange}; not compatible with "${qe}" ${pt}`),this.info(`switch candidate:${D}->${Ut} adjustedbw(${Math.round(Ht)})-bitrate=${Math.round(Ht-jt)} ttfb:${Zt.toFixed(1)} avgDuration:${hr.toFixed(1)} maxFetchDuration:${g.toFixed(1)} fetchDuration:${Er.toFixed(1)} firstSelection:${Ue} codecSet:${Jt.codecSet} videoRange:${Jt.videoRange} hls.loadLevel:${le}`)),Ue&&(this.firstSelection=Ut),Ut}}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 Pr={search:function(o,e){let t=0,r=o.length-1,i=null,n=null;for(;t<=r;){i=(t+r)/2|0,n=o[i];const a=e(n);if(a>0)t=i+1;else if(a<0)r=i-1;else return n}return null}};function Kr(o,e,t){if(e===null||!Array.isArray(o)||!o.length||!R(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;for(let n=0;n<o.length;++n){const a=o[n];if(_n(e,t,a))return a}return null}function ai(o,e,t=0,r=0,i=.005){let n=null;if(o){n=e[1+o.sn-e[0].sn]||null;const h=o.endDTS-t;h>0&&h<15e-7&&(t+=15e-7),n&&o.level!==n.level&&n.end<=o.end&&(n=e[2+o.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(n=e[0]);if(n&&((!o||o.level===n.level)&&Si(t,r,n)===0||gn(n,o,Math.min(i,r))))return n;const a=Pr.search(e,Si.bind(null,t,r));return a&&(a!==o||!n)?a:n}function gn(o,e,t){if(e&&e.start===0&&e.level<o.level&&(e.endPTS||0)>0){const r=e.tagList.reduce((i,n)=>(n[0]==="INF"&&(i+=parseFloat(n[1])),i),t);return o.start<=r}return!1}function Si(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 _n(o,e,t){const r=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-r>o}function vn(o,e,t){if(o&&o.startCC<=e&&o.endCC>=e){let r=o.fragments;const{fragmentHint:i}=o;i&&(r=r.concat(i));let n;return Pr.search(r,a=>a.cc<e?1:a.cc>e?-1:(n=a,a.end<=t?1:a.start>t?-1:0)),n||null}return null}function Pi(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 en(o){return o.details.startsWith("key")}function ct(o){return en(o)&&!!o.frag&&!o.frag.decryptdata}function fr(o,e){const t=Pi(e);return o.default[`${t?"timeout":"error"}Retry`]}function Vr(o,e){const t=o.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*o.retryDelayMs,o.maxRetryDelayMs)}function yn(o){return c(c({},o),{errorRetry:null,timeoutRetry:null})}function bn(o,e,t,r){if(!o)return!1;const i=r==null?void 0:r.code,n=e<o.maxNumRetry&&(Gi(i)||!!t);return o.shouldRetry?o.shouldRetry(o,e,t,r,n):n}function Gi(o){return Ei(o)||!!o&&(o<400||o>499)}function Ei(o){return o===0&&navigator.onLine===!1}var ur={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Or={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,MoveAllAlternatesMatchingKey:4,SwitchToSDR:8};class Ti extends M{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,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}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===S.MAIN?e.level:this.getVariantIndex()}getVariantIndex(){var e;const t=this.hls,r=t.currentLevel;return(e=t.loadLevelObj)!=null&&e.details||r===-1?t.loadLevel:r}variantHasKey(e,t){if(e){var r;if((r=e.details)!=null&&r.hasKey(t))return!0;const i=e.audioGroups;if(i)return this.hls.allAudioTracks.filter(a=>i.indexOf(a.groupId)>=0).some(a=>{var h;return(h=a.details)==null?void 0:h.hasKey(t)})}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,t){var r;if(t.fatal)return;const i=this.hls,n=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=ei();return}case A.FRAG_GAP:case A.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=ur.SendAlternateToPenaltyBox;return}case A.LEVEL_EMPTY_ERROR:case A.LEVEL_PARSING_ERROR:{var a;const _=t.parent===S.MAIN?t.level:i.loadLevel;t.details===A.LEVEL_EMPTY_ERROR&&((a=t.context)!=null&&(a=a.levelDetails)!=null&&a.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,_):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,_))}return;case A.LEVEL_LOAD_ERROR:case A.LEVEL_LOAD_TIMEOUT:typeof(n==null?void 0:n.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.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(n){const _=i.loadLevelObj;if(_&&(n.type===U.AUDIO_TRACK&&_.hasAudioGroup(n.groupId)||n.type===U.SUBTITLE_TRACK&&_.hasSubtitleGroup(n.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=ur.SendAlternateToPenaltyBox,t.errorAction.flags=Or.MoveAllAlternatesMatchingHost;return}}return;case A.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:t.errorAction={action:ur.SendAlternateToPenaltyBox,flags:Or.MoveAllAlternatesMatchingHDCP};return;case A.KEY_SYSTEM_SESSION_UPDATE_FAILED:case A.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case A.KEY_SYSTEM_NO_SESSION:t.errorAction={action:ur.SendAlternateToPenaltyBox,flags:Or.MoveAllAlternatesMatchingKey};return;case A.BUFFER_ADD_CODEC_ERROR:case A.REMUX_ALLOC_ERROR:case A.BUFFER_APPEND_ERROR:if(!t.errorAction){var h;t.errorAction=this.getLevelSwitchAction(t,(h=t.level)!=null?h: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=ei();return}t.type===P.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=ei())}getPlaylistRetryOrSwitchAction(e,t){const r=this.hls,i=fr(r.config.playlistLoadPolicy,e),n=this.playlistError++;if(bn(i,n,Pi(e),e.response))return{action:ur.RetryRequest,flags:Or.None,retryConfig:i,retryCount:n};const h=this.getLevelSwitchAction(e,t);return i&&(h.retryConfig=i,h.retryCount=n),h}getFragRetryOrSwitchAction(e){const t=this.hls,r=this.getVariantLevelIndex(e.frag),i=t.levels[r],{fragLoadPolicy:n,keyLoadPolicy:a}=t.config,h=fr(en(e)?a:n,e),_=t.levels.reduce((x,D)=>x+D.fragmentError,0);if(i&&(e.details!==A.FRAG_GAP&&i.fragmentError++,!ct(e)&&bn(h,_,Pi(e),e.response)))return{action:ur.RetryRequest,flags:Or.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 n,a;const g=e.details;i.loadError++,g===A.BUFFER_APPEND_ERROR&&i.fragmentError++;let x=-1;const{levels:D,loadLevel:j,minAutoLevel:Y,maxAutoLevel:Q}=r;!r.autoLevelEnabled&&!r.config.preserveManualLevelOnError&&(r.loadLevel=-1);const ue=(n=e.frag)==null?void 0:n.type,be=(ue===S.AUDIO&&g===A.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(g===A.BUFFER_ADD_CODEC_ERROR||g===A.BUFFER_APPEND_ERROR))&&D.some(({audioCodec:pt})=>i.audioCodec!==pt),Ce=e.sourceBufferName==="video"&&(g===A.BUFFER_ADD_CODEC_ERROR||g===A.BUFFER_APPEND_ERROR)&&D.some(({codecSet:pt,audioCodec:Ye})=>i.codecSet!==pt&&i.audioCodec===Ye),{type:Ue,groupId:qe}=(a=e.context)!=null?a:{};for(let pt=D.length;pt--;){const Ye=(pt+j)%D.length;if(Ye!==j&&Ye>=Y&&Ye<=Q&&D[Ye].loadError===0){var h,_;const at=D[Ye];if(g===A.FRAG_GAP&&ue===S.MAIN&&e.frag){const nt=D[Ye].details;if(nt){const Ze=ai(e.frag,nt.fragments,e.frag.start);if(Ze!=null&&Ze.gap)continue}}else{if(Ue===U.AUDIO_TRACK&&at.hasAudioGroup(qe)||Ue===U.SUBTITLE_TRACK&&at.hasSubtitleGroup(qe))continue;if(ue===S.AUDIO&&(h=i.audioGroups)!=null&&h.some(nt=>at.hasAudioGroup(nt))||ue===S.SUBTITLE&&(_=i.subtitleGroups)!=null&&_.some(nt=>at.hasSubtitleGroup(nt))||be&&i.audioCodec===at.audioCodec||Ce&&i.codecSet===at.codecSet||!be&&i.codecSet!==at.codecSet)continue}x=Ye;break}}if(x>-1&&r.loadLevel!==x)return e.levelRetry=!0,this.playlistError=0,{action:ur.SendAlternateToPenaltyBox,flags:Or.None,nextAutoLevel:x}}return{action:ur.SendAlternateToPenaltyBox,flags:Or.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var r;switch((r=t.errorAction)==null?void 0:r.action){case ur.DoNothing:break;case ur.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 ur.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,r=e.errorAction;if(!r)return;const{flags:i}=r,n=r.nextAutoLevel;switch(i){case Or.None:this.switchLevel(e,n);break;case Or.MoveAllAlternatesMatchingHDCP:{const _=this.getVariantLevelIndex(e.frag),g=t.levels[_],x=g==null?void 0:g.attrs["HDCP-LEVEL"];if(r.hdcpLevel=x,x==="NONE")this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(x){t.maxHdcpLevel=ni[ni.indexOf(x)-1],r.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case Or.MoveAllAlternatesMatchingKey:{const _=e.decryptdata;if(_){const g=this.hls.levels,x=g.length;for(let j=x;j--;)if(this.variantHasKey(g[j],_)){var a,h;this.log(`Banned key found in level ${j} (${g[j].bitrate}bps) or audio group "${(a=g[j].audioGroups)==null?void 0:a.join(",")}" (${(h=e.frag)==null?void 0:h.type} fragment) ${ce(_.keyId||[])}`),g[j].fragmentError++,g[j].loadError++,this.log(`Removing level ${j} with key error (${e.error})`),this.hls.removeLevel(j)}const D=e.frag;if(this.hls.levels.length<x)r.resolved=!0;else if(D&&D.type!==S.MAIN){const j=D.decryptdata;j&&!_.matches(j)&&(r.resolved=!0)}}break}}r.resolved||this.switchLevel(e,n)}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=Dr(e.mimeType),i=this.hls.levels;for(let n=i.length;n--;)i[n][`${e.sourceBufferName}Codec`]===r&&(this.log(`Removing level ${n} for ${e.details} ("${r}" not supported)`),this.hls.removeLevel(n))}}}function ei(o){const e={action:ur.DoNothing,flags:Or.None};return o&&(e.resolved=!0),e}var $r={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class Gn{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&&(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&&(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.hls=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 n=r[i];if(!n)break;if(n.start<=e&&e<=n.end&&n.loaded)return n}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,r){const{fragments:i}=this,n=Object.keys(i);for(let a=n.length;a--;){const h=i[n[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,n){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||n)){_.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(x=>{const D=!this.isTimeBuffered(x.startPTS,x.endPTS,t);return D&&this.removeFragment(_.body),D})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const r=e.frag,i=hi(r),n=this.fragments[i];if(!n||n.buffered&&r.gap)return;const a=!r.relurl;Object.keys(t).forEach(h=>{const _=r.elementaryStreams[h];if(!_)return;const g=t[h],x=a||_.partial===!0;n.range[h]=this.getBufferedTimes(r,e.part,x,g)}),n.loaded=null,Object.keys(n.range).length?(this.bufferedEnd(n,r),Ki(n)||this.removeParts(r.sn-1,r.type)):this.removeFragment(n.body)}bufferedEnd(e,t){e.buffered=!0,(e.body.endList=t.endList||e.body.endList)&&(this.endListFragments[e.body.type]=e)}removeParts(e,t){const r=this.activePartLists[t];r&&(this.activePartLists[t]=Yt(r,i=>i.fragment.sn>=e))}fragBuffered(e,t){const r=hi(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,this.bufferedEnd(i,e))}getBufferedTimes(e,t,r,i){const n={time:[],partial:r},a=e.start,h=e.end,_=e.minEndPTS||h,g=e.maxStartPTS||a;for(let x=0;x<i.length;x++){const D=i.start(x)-this.bufferPadding,j=i.end(x)+this.bufferPadding;if(g>=D&&_<=j){n.time.push({startPTS:Math.max(a,i.start(x)),endPTS:Math.min(h,i.end(x))});break}else if(a<j&&h>D){const Y=Math.max(a,i.start(x)),Q=Math.min(h,i.end(x));Q>Y&&(n.partial=!0,n.time.push({startPTS:Y,endPTS:Q}))}else if(h<=D)break}return n}getPartialFragment(e){let t=null,r,i,n,a=0;const{bufferPadding:h,fragments:_}=this;return Object.keys(_).forEach(g=>{const x=_[g];x&&Ki(x)&&(i=x.body.start-h,n=x.body.end+h,e>=i&&e<=n&&(r=Math.min(e-i,n-e),a<=r&&(t=x.body,a=r)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Ki(t))}getState(e){const t=hi(e),r=this.fragments[t];return r?r.buffered?Ki(r)?$r.PARTIAL:$r.OK:$r.APPENDING:$r.NOT_LOADED}isTimeBuffered(e,t,r){let i,n;for(let a=0;a<r.length;a++){if(i=r.start(a)-this.bufferPadding,n=r.end(a)+this.bufferPadding,e>=i&&t<=n)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,n=hi(r);this.fragments[n]={body:r,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:r,part:i,timeRanges:n,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=n;const _=n[a];this.detectEvictedFragments(a,_,h,i)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=hi(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 n=t[r[i]];if((n==null?void 0:n.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,r,i,n){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||n)&&this.removeFragment(_)})}removeFragment(e){const t=hi(e);e.clearElementaryStreamInfo();const r=this.activePartLists[e.type];if(r){const i=e.sn;this.activePartLists[e.type]=Yt(r,n=>n.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const t=(e=this.hls)==null||(e=e.latestLevelDetails)==null?void 0:e.partList;t&&t.forEach(r=>r.clearElementaryStreamInfo())}}function Ki(o){var e,t,r;return o.buffered&&!!(o.body.gap||(e=o.range.video)!=null&&e.partial||(t=o.range.audio)!=null&&t.partial||(r=o.range.audiovideo)!=null&&r.partial)}function hi(o){return`${o.type}_${o.level}_${o.sn}`}function Yt(o,e){return o.filter(t=>{const r=e(t);return r||t.clearElementaryStreamInfo(),r})}var oi={cbc:0,ctr:1};class Qr{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 oi.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case oi.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 Oi(o){const e=o.byteLength,t=e&&new DataView(o.buffer).getUint8(e-1);return t?o.slice(0,e-t):o}class Sn{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],n=r[1],a=r[2],h=r[3],_=this.invSubMix,g=_[0],x=_[1],D=_[2],j=_[3],Y=new Uint32Array(256);let Q=0,ue=0,le=0;for(le=0;le<256;le++)le<128?Y[le]=le<<1:Y[le]=le<<1^283;for(le=0;le<256;le++){let be=ue^ue<<1^ue<<2^ue<<3^ue<<4;be=be>>>8^be&255^99,e[Q]=be,t[be]=Q;const xe=Y[Q],Ce=Y[xe],Ue=Y[Ce];let qe=Y[be]*257^be*16843008;i[Q]=qe<<24|qe>>>8,n[Q]=qe<<16|qe>>>16,a[Q]=qe<<8|qe>>>24,h[Q]=qe,qe=Ue*16843009^Ce*65537^xe*257^Q*16843008,g[be]=qe<<24|qe>>>8,x[be]=qe<<16|qe>>>16,D[be]=qe<<8|qe>>>24,j[be]=qe,Q?(Q=xe^Y[Y[Y[Ue^xe]]],ue^=Y[Y[ue]]):Q=ue=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 n=this.keySize=t.length;if(n!==4&&n!==6&&n!==8)throw new Error("Invalid aes key size="+n);const a=this.ksRows=(n+6+1)*4;let h,_;const g=this.keySchedule=new Uint32Array(a),x=this.invKeySchedule=new Uint32Array(a),D=this.sBox,j=this.rcon,Y=this.invSubMix,Q=Y[0],ue=Y[1],le=Y[2],be=Y[3];let xe,Ce;for(h=0;h<a;h++){if(h<n){xe=g[h]=t[h];continue}Ce=xe,h%n===0?(Ce=Ce<<8|Ce>>>24,Ce=D[Ce>>>24]<<24|D[Ce>>>16&255]<<16|D[Ce>>>8&255]<<8|D[Ce&255],Ce^=j[h/n|0]<<24):n>6&&h%n===4&&(Ce=D[Ce>>>24]<<24|D[Ce>>>16&255]<<16|D[Ce>>>8&255]<<8|D[Ce&255]),g[h]=xe=(g[h-n]^Ce)>>>0}for(_=0;_<a;_++)h=a-_,_&3?Ce=g[h]:Ce=g[h-4],_<4||h<=4?x[_]=Ce:x[_]=Q[D[Ce>>>24]]^ue[D[Ce>>>16&255]]^le[D[Ce>>>8&255]]^be[D[Ce&255]],x[_]=x[_]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,r){const i=this.keySize+6,n=this.invKeySchedule,a=this.invSBox,h=this.invSubMix,_=h[0],g=h[1],x=h[2],D=h[3],j=this.uint8ArrayToUint32Array_(r);let Y=j[0],Q=j[1],ue=j[2],le=j[3];const be=new Int32Array(e),xe=new Int32Array(be.length);let Ce,Ue,qe,pt,Ye,at,nt,Ze,wt,Wt,Zt,rr,Xt,Ut;const Jt=this.networkToHostOrderSwap;for(;t<be.length;){for(wt=Jt(be[t]),Wt=Jt(be[t+1]),Zt=Jt(be[t+2]),rr=Jt(be[t+3]),Ye=wt^n[0],at=rr^n[1],nt=Zt^n[2],Ze=Wt^n[3],Xt=4,Ut=1;Ut<i;Ut++)Ce=_[Ye>>>24]^g[at>>16&255]^x[nt>>8&255]^D[Ze&255]^n[Xt],Ue=_[at>>>24]^g[nt>>16&255]^x[Ze>>8&255]^D[Ye&255]^n[Xt+1],qe=_[nt>>>24]^g[Ze>>16&255]^x[Ye>>8&255]^D[at&255]^n[Xt+2],pt=_[Ze>>>24]^g[Ye>>16&255]^x[at>>8&255]^D[nt&255]^n[Xt+3],Ye=Ce,at=Ue,nt=qe,Ze=pt,Xt=Xt+4;Ce=a[Ye>>>24]<<24^a[at>>16&255]<<16^a[nt>>8&255]<<8^a[Ze&255]^n[Xt],Ue=a[at>>>24]<<24^a[nt>>16&255]<<16^a[Ze>>8&255]<<8^a[Ye&255]^n[Xt+1],qe=a[nt>>>24]<<24^a[Ze>>16&255]<<16^a[Ye>>8&255]<<8^a[at&255]^n[Xt+2],pt=a[Ze>>>24]<<24^a[Ye>>16&255]<<16^a[at>>8&255]<<8^a[nt&255]^n[Xt+3],xe[t]=Jt(Ce^Y),xe[t+1]=Jt(pt^Q),xe[t+2]=Jt(qe^ue),xe[t+3]=Jt(Ue^le),Y=wt,Q=Wt,ue=Zt,le=rr,t=t+4}return xe.buffer}}class En{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=Kn(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function Kn(o){switch(o){case oi.cbc:return"AES-CBC";case oi.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${o}`)}}const xn=16;class Xr{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?Oi(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((n,a)=>{const h=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(h,t,r,i);const _=this.flush();_?n(_.buffer):a(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,r,i)}softwareDecrypt(e,t,r,i){const{currentIV:n,currentResult:a,remainderData:h}=this;if(i!==oi.cbc||t.byteLength!==16)return z.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),h&&(e=Tt(h,e),this.remainderData=null);const _=this.getValidChunk(e);if(!_.length)return null;n&&(r=n);let g=this.softwareDecrypter;g||(g=this.softwareDecrypter=new Sn),g.expandKey(t);const x=a;return this.currentResult=g.decrypt(_.buffer,0,r),this.currentIV=_.slice(-16).buffer,x||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 En(this.subtle,t,i)}return this.fastAesKey.expandKey().then(n=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new Qr(this.subtle,new Uint8Array(r),i).decrypt(e.buffer,n)):Promise.reject(new Error("web crypto not initialized"))).catch(n=>(z.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${n.name}: ${n.message}`),this.onWebCryptoError(e,t,r,i)))}onWebCryptoError(e,t,r,i){const n=this.enableSoftwareAES;if(n){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"+(n?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const r=e.length-e.length%xn;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 tn=Math.pow(2,17);class Di{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 mr({type:P.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,n=i.fLoader,a=i.loader;return new Promise((h,_)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(Q=>Q[0]==="GAP")){_(Mi(e));return}else e.gap=!1;const g=this.loader=n?new n(i):new a(i),x=Vi(e);e.loader=g;const D=yn(i.fragLoadPolicy.default),j={loadPolicy:D,timeout:D.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:tn};e.stats=g.stats;const Y={onSuccess:(Q,ue,le,be)=>{this.resetLoader(e,g);let xe=Q.data;le.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(xe.slice(0,16)),xe=xe.slice(16)),h({frag:e,part:null,payload:xe,networkDetails:be})},onError:(Q,ue,le,be)=>{this.resetLoader(e,g),_(new mr({type:P.NETWORK_ERROR,details:A.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:c({url:r,data:void 0},Q),error:new Error(`HTTP Error ${Q.code} ${Q.text}`),networkDetails:le,stats:be}))},onAbort:(Q,ue,le)=>{this.resetLoader(e,g),_(new mr({type:P.NETWORK_ERROR,details:A.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:le,stats:Q}))},onTimeout:(Q,ue,le)=>{this.resetLoader(e,g),_(new mr({type:P.NETWORK_ERROR,details:A.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${j.timeout}ms`),networkDetails:le,stats:Q}))}};t&&(Y.onProgress=(Q,ue,le,be)=>t({frag:e,part:null,payload:le,networkDetails:be})),g.load(x,j,Y)})}loadPart(e,t,r){this.abort();const i=this.config,n=i.fLoader,a=i.loader;return new Promise((h,_)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){_(Mi(e,t));return}const g=this.loader=n?new n(i):new a(i),x=Vi(e,t);e.loader=g;const D=yn(i.fragLoadPolicy.default),j={loadPolicy:D,timeout:D.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:tn};t.stats=g.stats,g.load(x,j,{onSuccess:(Y,Q,ue,le)=>{this.resetLoader(e,g),this.updateStatsFromPart(e,t);const be={frag:e,part:t,payload:Y.data,networkDetails:le};r(be),h(be)},onError:(Y,Q,ue,le)=>{this.resetLoader(e,g),_(new mr({type:P.NETWORK_ERROR,details:A.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:c({url:x.url,data:void 0},Y),error:new Error(`HTTP Error ${Y.code} ${Y.text}`),networkDetails:ue,stats:le}))},onAbort:(Y,Q,ue)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,g),_(new mr({type:P.NETWORK_ERROR,details:A.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:ue,stats:Y}))},onTimeout:(Y,Q,ue)=>{this.resetLoader(e,g),_(new mr({type:P.NETWORK_ERROR,details:A.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${j.timeout}ms`),networkDetails:ue,stats:Y}))}})})}updateStatsFromPart(e,t){const r=e.stats,i=t.stats,n=i.total;if(r.loaded+=i.loaded,n){const _=Math.round(e.duration/t.duration),g=Math.min(Math.round(r.loaded/n),_),D=(_-g)*Math.round(r.loaded/g);r.total=r.loaded+D}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 Vi(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,n=t.byteRangeEndOffset;if(R(i)&&R(n)){var a;let h=i,_=n;if(o.sn==="initSegment"&&Ri((a=o.decryptdata)==null?void 0:a.method)){const g=n-i;g%16&&(_=n+(16-g%16)),i!==0&&(r.resetIV=!0,h=i-16)}r.rangeStart=h,r.rangeEnd=_}return r}function Mi(o,e){const t=new Error(`GAP ${o.gap?"tag":"attribute"} found`),r={type:P.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 mr(r)}function Ri(o){return o==="AES-128"||o==="AES-256"}class mr extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class wn extends M{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 rn{constructor(e,t,r,i=0,n=-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=nn(),this.buffering={audio:nn(),video:nn(),audiovideo:nn()},this.level=e,this.sn=t,this.id=r,this.size=i,this.part=n,this.partial=a}}function nn(){return{start:0,executeStart:0,executeEnd:0,end:0}}const li={length:0,start:()=>0,end:()=>0};class nr{static isBuffered(e,t){if(e){const r=nr.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=nr.getBuffered(e);return nr.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=nr.bufferedRanges(e);if(i.length)return nr.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((x,D)=>x.start-D.start||D.end-x.end);let i=-1,n=[];if(r)for(let x=0;x<e.length;x++){t>=e[x].start&&t<=e[x].end&&(i=x);const D=n.length;if(D){const j=n[D-1].end;e[x].start-j<r?e[x].end>j&&(n[D-1].end=e[x].end):n.push(e[x])}else n.push(e[x])}else n=e;let a=0,h,_=t,g=t;for(let x=0;x<n.length;x++){const D=n[x].start,j=n[x].end;if(i===-1&&t>=D&&t<=j&&(i=x),t+r>=D&&t<j)_=D,g=j,a=g-t;else if(t+r<D){h=D;break}}return{len:a,start:_||0,end:g||0,nextStart:h,buffered:e,bufferedIndex:i}}static getBuffered(e){try{return e.buffered||li}catch(t){return z.log("failed to get media.buffered",t),li}}}const rs=/\{\$([a-zA-Z0-9-_]+)\}/g;function Ft(o){return rs.test(o)}function ui(o,e){if(o.variableList!==null||o.hasVariableRefs){const t=o.variableList;return e.replace(rs,r=>{const i=r.substring(2,r.length-1),n=t==null?void 0:t[i];return n===void 0?(o.playlistParsingError||(o.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),r):n})}return e}function In(o,e,t){let r=o.variableList;r||(o.variableList=r={});let i,n;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const a=new self.URL(t).searchParams;if(a.has(i))n=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,n=e.VALUE;i in r?o.playlistParsingError||(o.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):r[i]=n||""}function Pn(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 mi=/^(\d+)x(\d+)$/,zi=/(.+?)=(".*?"|.*?)(?:,|$)/g;class or{constructor(e,t){typeof e=="string"&&(e=or.parseAttrList(e,t)),u(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,n)=>(i[n.toLowerCase()]=!0,i),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=mi.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={},n='"';for(zi.lastIndex=0;(r=zi.exec(e))!==null;){const a=r[1].trim();let h=r[2];const _=h.indexOf(n)===0&&h.lastIndexOf(n)===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=ui(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 Fi="com.apple.hls.interstitial";function On(o){return o!=="ID"&&o!=="CLASS"&&o!=="CUE"&&o!=="START-DATE"&&o!=="DURATION"&&o!=="END-DATE"&&o!=="END-ON-NEXT"}function is(o){return o==="SCTE35-OUT"||o==="SCTE35-IN"||o==="SCTE35-CMD"}class gi{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 n=t.attr;for(const a in n)if(Object.prototype.hasOwnProperty.call(e,a)&&e[a]!==n[a]){z.warn(`DATERANGE tag attribute: "${a}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=a;break}e=u(new or({}),n,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 n=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);R(n.getTime())&&(this._endDate=n)}}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(R(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===Fi}get isValid(){return!!this.id&&!this._badValueForSameId&&R(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 ns{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}hasKey(e){return this.encryptedFragments.some(t=>{let r=t.decryptdata;return r||(t.setKeyFormat(e.keyFormat),r=t.decryptdata),!!r&&e.matches(r)})}get hasProgramDateTime(){return this.fragments.length?R(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(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.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,e){return o.length===e.length?!o.some((t,r)=>t!==e[r]):!1}function qi(o,e){return!o&&!e?!0:!o||!e?!1:Li(o,e)}function Hi(o){return o==="AES-128"||o==="AES-256"||o==="AES-256-CTR"}function Fn(o){switch(o){case"AES-128":case"AES-256":return oi.cbc;case"AES-256-CTR":return oi.ctr;default:throw new Error(`invalid full segment method ${o}`)}}function Vn(o){return Uint8Array.from(atob(o),e=>e.charCodeAt(0))}function qn(o){return Uint8Array.from(unescape(encodeURIComponent(o)),e=>e.charCodeAt(0))}function Bi(o){const e=qn(o).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function Kt(o){const e=function(r,i,n){const a=r[i];r[i]=r[n],r[n]=a};e(o,0,3),e(o,1,2),e(o,4,5),e(o,6,7)}function sr(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 n=i[0]==="base64",a=i[1];n?(r.splice(-1,1),t=Vn(a)):t=Bi(a)}}return t}const Mr=typeof self!="undefined"?self:void 0;var dr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},yr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function sn(o){switch(o){case yr.FAIRPLAY:return dr.FAIRPLAY;case yr.PLAYREADY:return dr.PLAYREADY;case yr.WIDEVINE:return dr.WIDEVINE;case yr.CLEARKEY:return dr.CLEARKEY}}function Yi(o){switch(o){case dr.FAIRPLAY:return yr.FAIRPLAY;case dr.PLAYREADY:return yr.PLAYREADY;case dr.WIDEVINE:return yr.WIDEVINE;case dr.CLEARKEY:return yr.CLEARKEY}}function an(o){const{drmSystems:e,widevineLicenseUrl:t}=o,r=e?[dr.FAIRPLAY,dr.WIDEVINE,dr.PLAYREADY,dr.CLEARKEY].filter(i=>!!e[i]):[];return!r[dr.WIDEVINE]&&t&&r.push(dr.WIDEVINE),r}const Bn=function(o){return Mr!=null&&(o=Mr.navigator)!=null&&o.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function So(o,e,t,r){let i;switch(o){case dr.FAIRPLAY:i=["cenc","sinf"];break;case dr.WIDEVINE:case dr.PLAYREADY:i=["cenc"];break;case dr.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${o}`)}return Eo(i,e,t,r)}function Eo(o,e,t,r){return[{initDataTypes:o,persistentState:r.persistentState||"optional",distinctiveIdentifier:r.distinctiveIdentifier||"optional",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:e.map(n=>({contentType:`audio/mp4; codecs=${n}`,robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null})),videoCapabilities:t.map(n=>({contentType:`video/mp4; codecs=${n}`,robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null}))}]}function Aa(o){var e;return!!o&&(o.sessionType==="persistent-license"||!!((e=o.sessionTypes)!=null&&e.some(t=>t==="persistent-license")))}function Cn(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 _=Vn(h).subarray(0,16);return Kt(_),_}}return null}let on={};class An{static clearKeyUriToKeyIdMap(){on={}}static setKeyIdForUri(e,t){on[e]=t}static addKeyIdForUri(e){const t=Object.keys(on).length%Number.MAX_SAFE_INTEGER,r=new Uint8Array(16);return new DataView(r.buffer,12,4).setUint32(0,t),on[e]=r,r}constructor(e,t,r,i=[1],n=null,a){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=n,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!Hi(e),a!=null&&a.startsWith("0x")&&(this.keyId=new Uint8Array(J(a)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&Li(e.keyFormatVersions,this.keyFormatVersions)&&qi(e.iv,this.iv)&&qi(e.keyId,this.keyId)}isSupported(){if(this.method){if(Hi(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case yr.FAIRPLAY:case yr.WIDEVINE:case yr.PLAYREADY:case yr.CLEARKEY:return["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e,t){if(!this.encrypted||!this.uri)return null;if(Hi(this.method)){let n=this.iv;return n||(typeof e!="number"&&(z.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0),n=Ys(e)),new An(this.method,this.uri,"identity",this.keyFormatVersions,n)}if(this.keyId){const n=on[this.uri];if(n&&!Li(this.keyId,n)&&An.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const r=sr(this.uri);if(r)switch(this.keyFormat){case yr.WIDEVINE:if(this.pssh=r,!this.keyId){const n=Be(r.buffer);if(n.length){var i;const a=n[0];this.keyId=(i=a.kids)!=null&&i.length?a.kids[0]:null}}this.keyId||(this.keyId=Rs(t));break;case yr.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=q(n,null,r),this.keyId=Cn(r);break}default:{let n=r.subarray(0,16);if(n.length!==16){const a=new Uint8Array(16);a.set(n,16-n.length),n=a}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n;n=qs(t),n||(n=Rs(t),n||(n=on[this.uri])),n&&(this.keyId=n,An.setKeyIdForUri(this.uri,n))}return this}}function qs(o){const e=o==null?void 0:o[yr.WIDEVINE];return e?e.keyId:null}function Rs(o){const e=o==null?void 0:o[yr.PLAYREADY];if(e){const t=sr(e.uri);if(t)return Cn(t)}return null}function Ys(o){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=o>>8*(15-t)&255;return e}const Ta=/#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,Zs=/#EXT-X-MEDIA:(.*)/g,xo=/^#EXT(?:INF|-X-TARGETDURATION):/m,Ls=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),ks=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 ln{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 B.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return xo.test(e)}static parseMasterPlaylist(e,t){const r=Ft(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:r},n=[];if(Ta.lastIndex=0,!e.startsWith("#EXTM3U"))return i.playlistParsingError=new Error("no EXTM3U delimiter"),i;let a;for(;(a=Ta.exec(e))!=null;)if(a[1]){var h;const g=new or(a[1],i),x=ui(i,a[2]),D={attrs:g,bitrate:g.decimalInteger("BANDWIDTH")||g.decimalInteger("AVERAGE-BANDWIDTH"),name:g.NAME,url:ln.resolve(x,t)},j=g.decimalResolution("RESOLUTION");j&&(D.width=j.width,D.height=j.height),Qs(g.CODECS,D);const Y=g["SUPPLEMENTAL-CODECS"];Y&&(D.supplemental={},Qs(Y,D.supplemental)),(h=D.unknownCodecs)!=null&&h.length||n.push(D),i.levels.push(D)}else if(a[3]){const g=a[3],x=a[4];switch(g){case"SESSION-DATA":{const D=new or(x,i),j=D["DATA-ID"];j&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[j]=D);break}case"SESSION-KEY":{const D=Xs(x,t,i);D.encrypted&&D.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(D)):z.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${x}"`);break}case"DEFINE":{{const D=new or(x,i);In(i,D,t)}break}case"CONTENT-STEERING":{const D=new or(x,i);i.contentSteering={uri:ln.resolve(D["SERVER-URI"],t),pathwayId:D["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=Ra(x);break}}}const _=n.length>0&&n.length<i.levels.length;return i.levels=_?n:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,r){let i;const n={},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(Zs.lastIndex=0;(i=Zs.exec(e))!==null;){const g=new or(i[1],r),x=g.TYPE;if(x){const D=h[x],j=n[x]||[];n[x]=j;const Y=g.LANGUAGE,Q=g["ASSOC-LANGUAGE"],ue=g.CHANNELS,le=g.CHARACTERISTICS,be=g["INSTREAM-ID"],xe={attrs:g,bitrate:0,id:_++,groupId:g["GROUP-ID"]||"",name:g.NAME||Y||"",type:x,default:g.bool("DEFAULT"),autoselect:g.bool("AUTOSELECT"),forced:g.bool("FORCED"),lang:Y,url:g.URI?ln.resolve(g.URI,t):""};if(Q&&(xe.assocLang=Q),ue&&(xe.channels=ue),le&&(xe.characteristics=le),be&&(xe.instreamId=be),D!=null&&D.length){const Ce=ln.findGroup(D,xe.groupId)||D[0];Js(xe,Ce,"audioCodec"),Js(xe,Ce,"textCodec")}j.push(xe)}}return n}static parseLevelPlaylist(e,t,r,i,n,a){var h;const _={url:t},g=new ns(t),x=g.fragments,D=[];let j=null,Y=0,Q=0,ue=0,le=0,be=0,xe=null,Ce=new He(i,_),Ue,qe,pt,Ye=-1,at=!1,nt=null,Ze;if(Ls.lastIndex=0,g.m3u8=e,g.hasVariableRefs=Ft(e),((h=Ls.exec(e))==null?void 0:h[0])!=="#EXTM3U")return g.playlistParsingError=new Error("Missing format identifier #EXTM3U"),g;for(;(Ue=Ls.exec(e))!==null;){at&&(at=!1,Ce=new He(i,_),Ce.playlistOffset=ue,Ce.setStart(ue),Ce.sn=Y,Ce.cc=le,be&&(Ce.bitrate=be),Ce.level=r,j&&(Ce.initSegment=j,j.rawProgramDateTime&&(Ce.rawProgramDateTime=j.rawProgramDateTime,j.rawProgramDateTime=null),nt&&(Ce.setByteRange(nt),nt=null)));const rr=Ue[1];if(rr){Ce.duration=parseFloat(rr);const Xt=(" "+Ue[2]).slice(1);Ce.title=Xt||null,Ce.tagList.push(Xt?["INF",rr,Xt]:["INF",rr])}else if(Ue[3]){if(R(Ce.duration)){Ce.playlistOffset=ue,Ce.setStart(ue),pt&&La(Ce,pt,g),Ce.sn=Y,Ce.level=r,Ce.cc=le,x.push(Ce);const Xt=(" "+Ue[3]).slice(1);Ce.relurl=ui(g,Xt),un(Ce,xe,D),xe=Ce,ue+=Ce.duration,Y++,Q=0,at=!0}}else{if(Ue=Ue[0].match(ks),!Ue){z.warn("No matches on slow regex match for level playlist!");continue}for(qe=1;qe<Ue.length&&Ue[qe]===void 0;qe++);const Xt=(" "+Ue[qe]).slice(1),Ut=(" "+Ue[qe+1]).slice(1),Jt=Ue[qe+2]?(" "+Ue[qe+2]).slice(1):null;switch(Xt){case"BYTERANGE":xe?Ce.setByteRange(Ut,xe):Ce.setByteRange(Ut);break;case"PROGRAM-DATE-TIME":Ce.rawProgramDateTime=Ut,Ce.tagList.push(["PROGRAM-DATE-TIME",Ut]),Ye===-1&&(Ye=x.length);break;case"PLAYLIST-TYPE":g.type&&ji(g,Xt,Ue),g.type=Ut.toUpperCase();break;case"MEDIA-SEQUENCE":g.startSN!==0?ji(g,Xt,Ue):x.length>0&&ta(g,Xt,Ue),Y=g.startSN=parseInt(Ut);break;case"SKIP":{g.skippedSegments&&ji(g,Xt,Ue);const Gt=new or(Ut,g),tr=Gt.decimalInteger("SKIPPED-SEGMENTS");if(R(tr)){g.skippedSegments+=tr;for(let Ht=tr;Ht--;)x.push(null);Y+=tr}const hr=Gt.enumeratedString("RECENTLY-REMOVED-DATERANGES");hr&&(g.recentlyRemovedDateranges=(g.recentlyRemovedDateranges||[]).concat(hr.split(" ")));break}case"TARGETDURATION":g.targetduration!==0&&ji(g,Xt,Ue),g.targetduration=Math.max(parseInt(Ut),1);break;case"VERSION":g.version!==null&&ji(g,Xt,Ue),g.version=parseInt(Ut);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":g.live||ji(g,Xt,Ue),g.live=!1;break;case"#":(Ut||Jt)&&Ce.tagList.push(Jt?[Ut,Jt]:[Ut]);break;case"DISCONTINUITY":le++,Ce.tagList.push(["DIS"]);break;case"GAP":Ce.gap=!0,Ce.tagList.push([Xt]);break;case"BITRATE":Ce.tagList.push([Xt,Ut]),be=parseInt(Ut)*1e3,R(be)?Ce.bitrate=be:be=0;break;case"DATERANGE":{const Gt=new or(Ut,g),tr=new gi(Gt,g.dateRanges[Gt.ID],g.dateRangeTagCount);g.dateRangeTagCount++,tr.isValid||g.skippedSegments?g.dateRanges[tr.id]=tr:z.warn(`Ignoring invalid DATERANGE tag: "${Ut}"`),Ce.tagList.push(["EXT-X-DATERANGE",Ut]);break}case"DEFINE":{{const Gt=new or(Ut,g);"IMPORT"in Gt?Pn(g,Gt,a):In(g,Gt,t)}break}case"DISCONTINUITY-SEQUENCE":g.startCC!==0?ji(g,Xt,Ue):x.length>0&&ta(g,Xt,Ue),g.startCC=le=parseInt(Ut);break;case"KEY":{const Gt=Xs(Ut,t,g);if(Gt.isSupported()){if(Gt.method==="NONE"){pt=void 0;break}pt||(pt={});const tr=pt[Gt.keyFormat];tr!=null&&tr.matches(Gt)||(tr&&(pt=u({},pt)),pt[Gt.keyFormat]=Gt)}else z.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${Ut}"`);break}case"START":g.startTimeOffset=Ra(Ut);break;case"MAP":{const Gt=new or(Ut,g);if(Ce.duration){const tr=new He(i,_);ea(tr,Gt,r,pt),j=tr,Ce.initSegment=j,j.rawProgramDateTime&&!Ce.rawProgramDateTime&&(Ce.rawProgramDateTime=j.rawProgramDateTime)}else{const tr=Ce.byteRangeEndOffset;if(tr){const hr=Ce.byteRangeStartOffset;nt=`${tr-hr}@${hr}`}else nt=null;ea(Ce,Gt,r,pt),j=Ce,at=!0}j.cc=le;break}case"SERVER-CONTROL":{Ze&&ji(g,Xt,Ue),Ze=new or(Ut),g.canBlockReload=Ze.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=Ze.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&Ze.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=Ze.optionalFloat("PART-HOLD-BACK",0),g.holdBack=Ze.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{g.partTarget&&ji(g,Xt,Ue);const Gt=new or(Ut);g.partTarget=Gt.decimalFloatingPoint("PART-TARGET");break}case"PART":{let Gt=g.partList;Gt||(Gt=g.partList=[]);const tr=Q>0?Gt[Gt.length-1]:void 0,hr=Q++,Ht=new or(Ut,g),jt=new ut(Ht,Ce,_,hr,tr);Gt.push(jt),Ce.duration+=jt.duration;break}case"PRELOAD-HINT":{const Gt=new or(Ut,g);g.preloadHint=Gt;break}case"RENDITION-REPORT":{const Gt=new or(Ut,g);g.renditionReports=g.renditionReports||[],g.renditionReports.push(Gt);break}default:z.warn(`line parsed but not handled: ${Ue}`);break}}}xe&&!xe.relurl?(x.pop(),ue-=xe.duration,g.partList&&(g.fragmentHint=xe)):g.partList&&(un(Ce,xe,D),Ce.cc=le,g.fragmentHint=Ce,pt&&La(Ce,pt,g)),g.targetduration||(g.playlistParsingError=new Error("Missing Target Duration"));const wt=x.length,Wt=x[0],Zt=x[wt-1];if(ue+=g.skippedSegments*g.targetduration,ue>0&&wt&&Zt){g.averagetargetduration=ue/wt;const rr=Zt.sn;g.endSN=rr!=="initSegment"?rr:0,g.live||(Zt.endList=!0),Ye>0&&(Co(x,Ye),Wt&&D.unshift(Wt))}return g.fragmentHint&&(ue+=g.fragmentHint.duration),g.totalduration=ue,D.length&&g.dateRangeTagCount&&Wt&&Da(D,g),g.endCC=le,g}}function Da(o,e){let t=o.length;if(!t)if(e.hasProgramDateTime){const h=e.fragments[e.fragments.length-1];o.push(h),t++}else return;const r=o[t-1],i=e.live?1/0:e.totalduration,n=Object.keys(e.dateRanges);for(let h=n.length;h--;){const _=e.dateRanges[n[h]],g=_.startDate.getTime();_.tagAnchor=r.ref;for(let x=t;x--;){var a;if(((a=o[x])==null?void 0:a.sn)<e.startSN)break;const D=wo(e,g,o,x,i);if(D!==-1){_.tagAnchor=e.fragments[D].ref;break}}}}function wo(o,e,t,r,i){const n=t[r];if(n){const h=n.programDateTime;if(e>=h||r===0){var a;const _=(((a=t[r+1])==null?void 0:a.start)||i)-n.start;if(e<=h+_*1e3){const g=t[r].sn-o.startSN;if(g<0)return-1;const x=o.fragments;if(x.length>t.length){const j=(t[r+1]||x[x.length-1]).sn-o.startSN;for(let Y=j;Y>g;Y--){const Q=x[Y].programDateTime;if(e>=Q&&e<Q+x[Y].duration*1e3)return Y}}return g}}}return-1}function Xs(o,e,t){var r,i;const n=new or(o,t),a=(r=n.METHOD)!=null?r:"",h=n.URI,_=n.hexadecimalInteger("IV"),g=n.KEYFORMATVERSIONS,x=(i=n.KEYFORMAT)!=null?i:"identity";h&&n.IV&&!_&&z.error(`Invalid IV: ${n.IV}`);const D=h?ln.resolve(h,e):"",j=(g||"1").split("/").map(Number).filter(Number.isFinite);return new An(a,D,x,j,_,n.KEYID)}function Ra(o){const t=new or(o).decimalFloatingPoint("TIME-OFFSET");return R(t)?t:null}function Qs(o,e){let t=(o||"").split(/[ ,]+/).filter(r=>r);["video","audio","text"].forEach(r=>{const i=t.filter(n=>Re(n,r));i.length&&(e[`${r}Codec`]=i.map(n=>n.split("/")[0]).join(","),t=t.filter(n=>i.indexOf(n)===-1))}),e.unknownCodecs=t}function Js(o,e,t){const r=e[t];r&&(o[t]=r)}function Co(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 un(o,e,t){o.rawProgramDateTime?t.push(o):e!=null&&e.programDateTime&&(o.programDateTime=e.endProgramDateTime)}function ea(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 La(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 ji(o,e,t){o.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function ta(o,e,t){o.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function gs(o,e){const t=e.startPTS;if(R(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 Is(o,e,t,r,i,n,a){r-t<=0&&(a.warn("Fragment should have a positive duration",e),r=t+e.duration,n=i+e.duration);let _=t,g=r;const x=e.startPTS,D=e.endPTS;if(R(x)){const be=Math.abs(x-t);o&&be>o.totalduration?a.warn(`media timestamps and playlist times differ by ${be}s for level ${e.level} ${o.url}`):R(e.deltaPTS)?e.deltaPTS=Math.max(be,e.deltaPTS):e.deltaPTS=be,_=Math.max(t,x),t=Math.min(t,x),i=e.startDTS!==void 0?Math.min(i,e.startDTS):i,g=Math.min(r,D),r=Math.max(r,D),n=e.endDTS!==void 0?Math.max(n,e.endDTS):n}const j=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(r-e.start),e.startPTS=t,e.maxStartPTS=_,e.startDTS=i,e.endPTS=r,e.minEndPTS=g,e.endDTS=n;const Y=e.sn;if(!o||Y<o.startSN||Y>o.endSN)return 0;let Q;const ue=Y-o.startSN,le=o.fragments;for(le[ue]=e,Q=ue;Q>0;Q--)gs(le[Q],le[Q-1]);for(Q=ue;Q<le.length-1;Q++)gs(le[Q],le[Q+1]);return o.fragmentHint&&gs(le[le.length-1],o.fragmentHint),o.PTSKnown=o.alignedSliding=!0,j}function ka(o,e,t){if(o===e)return;let r=null;const i=o.fragments;for(let x=i.length-1;x>=0;x--){const D=i[x].initSegment;if(D){r=D;break}}o.fragmentHint&&delete o.fragmentHint.endPTS;let n;Yn(o,e,(x,D,j,Y)=>{if((!e.startCC||e.skippedSegments)&&D.cc!==x.cc){const Q=x.cc-D.cc;for(let ue=j;ue<Y.length;ue++)Y[ue].cc+=Q;e.endCC=Y[Y.length-1].cc}R(x.startPTS)&&R(x.endPTS)&&(D.setStart(D.startPTS=x.startPTS),D.startDTS=x.startDTS,D.maxStartPTS=x.maxStartPTS,D.endPTS=x.endPTS,D.endDTS=x.endDTS,D.minEndPTS=x.minEndPTS,D.setDuration(x.endPTS-x.startPTS),D.duration&&(n=D),e.PTSKnown=e.alignedSliding=!0),x.hasStreams&&(D.elementaryStreams=x.elementaryStreams),D.loader=x.loader,x.hasStats&&(D.stats=x.stats),x.initSegment&&(D.initSegment=x.initSegment,r=x.initSegment)});const a=e.fragments,h=e.fragmentHint?a.concat(e.fragmentHint):a;if(r&&h.forEach(x=>{var D;x&&(!x.initSegment||x.initSegment.relurl===((D=r)==null?void 0:D.relurl))&&(x.initSegment=r)}),e.skippedSegments){if(e.deltaUpdateFailed=a.some(x=>!x),e.deltaUpdateFailed){t.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let x=e.skippedSegments;x--;)a.shift();e.startSN=a[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=Nn(o.dateRanges,e,t));const x=o.fragments.filter(D=>D.rawProgramDateTime);if(o.hasProgramDateTime&&!e.hasProgramDateTime)for(let D=1;D<h.length;D++)h[D].programDateTime===null&&un(h[D],h[D-1],x);Da(x,e)}e.endCC=a[a.length-1].cc}if(!e.startCC){var _;const x=ia(o,e.startSN-1);e.startCC=(_=x==null?void 0:x.cc)!=null?_:a[0].cc}Ia(o.partList,e.partList,(x,D)=>{D.elementaryStreams=x.elementaryStreams,D.stats=x.stats}),n?Is(e,n,n.startPTS,n.endPTS,n.startDTS,n.endDTS,t):Tn(o,e),a.length&&(e.totalduration=e.edge-a[0].start),e.driftStartTime=o.driftStartTime,e.driftStart=o.driftStart;const g=e.advancedDateTime;if(e.advanced&&g){const x=e.edge;e.driftStart||(e.driftStartTime=g,e.driftStart=x),e.driftEndTime=g,e.driftEnd=x}else e.driftEndTime=o.driftEndTime,e.driftEnd=o.driftEnd,e.advancedDateTime=o.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=o.requestScheduled)}function Nn(o,e,t){const{dateRanges:r,recentlyRemovedDateranges:i}=e,n=u({},o);i&&i.forEach(_=>{delete n[_]});const h=Object.keys(n).length;return h?(Object.keys(r).forEach(_=>{const g=n[_],x=new gi(r[_].attr,g);x.isValid?(n[_]=x,g||(x.tagOrder+=h)):t.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${ir(r[_].attr)}"`)}),n):r}function Ia(o,e,t){if(o&&e){let r=0;for(let i=0,n=o.length;i<=n;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 Yn(o,e,t){const r=e.skippedSegments,i=Math.max(o.startSN,e.startSN)-e.startSN,n=(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<=n;g++){const x=_[a+g];let D=h[g];if(r&&!D&&x&&(D=e.fragments[g]=x),x&&D){t(x,D,g,h);const j=x.relurl,Y=D.relurl;if(j&&Ma(j,Y)){e.playlistParsingError=Ps(`media sequence mismatch ${D.sn}:`,o,e,x,D);return}else if(x.cc!==D.cc){e.playlistParsingError=Ps(`discontinuity sequence mismatch (${x.cc}!=${D.cc})`,o,e,x,D);return}}}}function Ps(o,e,t,r,i){return new Error(`${o} ${i.url}
|
|
|
Playlist starting @${e.startSN}
|
|
|
${e.m3u8}
|
|
|
|
|
|
Playlist starting @${t.startSN}
|
|
|
${t.m3u8}`)}function Tn(o,e,t=!0){const r=e.startSN+e.skippedSegments-o.startSN,i=o.fragments,n=r>=0;let a=0;if(n&&r<i.length)a=i[r].start;else if(n&&e.startSN===o.endSN+1)a=o.fragmentEnd;else if(n&&t)a=o.fragmentStart+r*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)a=o.fragmentStart;else return;ra(e,a)}function ra(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 Dn(o,e=1/0){let t=1e3*o.targetduration;if(o.updated){const r=o.fragments;if(r.length&&t*4>e){const n=r[r.length-1].duration*1e3;n<t&&(t=n)}}else t/=2;return Math.round(t)}function ia(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 Pa(o,e,t){return o?na(o.partList,e,t):null}function na(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 Oa(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 Ma(o,e){return o!==e&&e?sa(o)!==sa(e):!1}function sa(o){return o.replace(/\?[^?]*$/,"")}function Zn(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 Fa(o,e){return!!(o&&e.startCC<o.endCC&&e.endCC>o.startCC)}function aa(o,e){const t=o.start+e;o.startPTS=t,o.setStart(t),o.endPTS=t+o.duration}function oa(o,e){const t=e.fragments;for(let r=0,i=t.length;r<i;r++)aa(t[r],o);e.fragmentHint&&aa(e.fragmentHint,o),e.alignedSliding=!0}function Ba(o,e){o&&(Os(e,o),e.alignedSliding||ss(e,o),!e.alignedSliding&&!e.skippedSegments&&Tn(o,e,!1))}function Os(o,e){if(!Fa(e,o))return;const t=Math.min(e.endCC,o.endCC),r=Zn(e.fragments,t),i=Zn(o.fragments,t);if(!r||!i)return;z.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const n=r.start-i.start;oa(n,o)}function ss(o,e){if(!o.hasProgramDateTime||!e.hasProgramDateTime)return;const t=o.fragments,r=e.fragments;if(!t.length||!r.length)return;let i,n;const a=Math.min(e.endCC,o.endCC);e.startCC<a&&o.startCC<a&&(i=Zn(r,a),n=Zn(t,a)),(!i||!n)&&(i=r[Math.floor(r.length/2)],n=Zn(t,i.cc)||t[Math.floor(t.length/2)]);const h=i.programDateTime,_=n.programDateTime;if(!h||!_)return;const g=(_-h)/1e3-(n.start-i.start);oa(g,o)}function _i(o,e,t){xi(o,e,t),o.addEventListener(e,t)}function xi(o,e,t){o.removeEventListener(e,t)}const Na={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}},Et={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 _s extends wn{constructor(e,t,r,i,n){super(i,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=Et.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:x}=this,D=_?_.currentTime:0,j=nr.bufferInfo(g||_,D,a.maxBufferHole),Y=!j.len;if(this.log(`Media seeking to ${R(D)?D.toFixed(3):D}, state: ${x}, ${Y?"out of":"in"} buffer`),this.state===Et.ENDED)this.resetLoadingState();else if(h){const Q=a.maxFragLookUpTolerance,ue=h.start-Q,le=h.start+h.duration+Q;if(Y||le<j.start||ue>j.end){const be=D>le;(D<ue||be)&&(be&&h.loader&&(this.log(`Cancelling fragment load for seek (sn: ${h.sn})`),h.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(_){this.fragmentTracker.removeFragmentsInRange(D,1/0,this.playlistType,!0);const Q=this.lastCurrentTime;if(D>Q&&(this.lastCurrentTime=D),!this.loadingParts){const ue=Math.max(j.end,D),le=this.shouldLoadParts(this.getLevelDetails(),ue);le&&(this.log(`LL-Part loading ON after seeking to ${D.toFixed(2)} with buffer @${ue.toFixed(2)}`),this.loadingParts=le)}}this.hls.hasEnoughToStart||(this.log(`Setting ${Y?"startPosition":"nextLoadPosition"} to ${D} for seek without enough to start`),this.nextLoadPosition=D,Y&&(this.startPosition=D)),Y&&this.state===Et.IDLE&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=n,this.hls=e,this.fragmentLoader=new Di(e.config),this.keyLoader=r,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Xr(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===Et.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=Et.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 n=e.buffered;this.config.maxBufferHole&&n&&n.length>1&&(e=nr.bufferedInfo(n,e.start,0));const a=e.nextStart;if(a&&a>i&&a<t.edge||this.media.currentTime<e.start)return!1;const _=t.partList;if(_!=null&&_.length){const x=_[_.length-1];return nr.isBuffered(this.media,x.start+x.duration/2)}const g=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(g)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null)return this.levelLastLoaded.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;_i(r,"seeking",this.onMediaSeeking),_i(r,"ended",this.onMediaEnded);const i=this.config;this.levels&&i.autoStartLoad&&this.state===Et.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),xi(i,"seeking",this.onMediaSeeking),xi(i,"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=Et.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=n=>{const a=n.frag;if(this.fragContextChanged(a)){this.warn(`${a.type} sn: ${a.sn}${n.part?" part: "+n.part.index:""} of ${this.fragInfo(a,!1,n.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(a);return}a.stats.chunkCount++,this._handleFragmentLoadProgress(n)};this._doFragLoad(e,t,r,i).then(n=>{if(!n)return;const a=this.state,h=n.frag;if(this.fragContextChanged(h)){(a===Et.FRAG_LOADING||!this.fragCurrent&&a===Et.PARSING)&&(this.fragmentTracker.removeFragment(h),this.state=Et.IDLE);return}"payload"in n&&(this.log(`Loaded ${h.type} sn: ${h.sn} of ${this.playlistLabel()} ${h.level}`),this.hls.trigger(d.FRAG_LOADED,n)),this._handleFragmentLoadComplete(n)}).catch(n=>{this.state===Et.STOPPED||this.state===Et.ERROR||(this.warn(`Frag error: ${(n==null?void 0:n.message)||n}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:r}=this;if(r.getState(e)===$r.APPENDING){const n=e.type,a=this.getFwdBufferInfo(this.mediaBuffer,n),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)===$r.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:n,payload:a}=r,h=n.decryptdata;if(a&&a.byteLength>0&&h!=null&&h.key&&h.iv&&Hi(h.method)){const _=self.performance.now();return this.decrypter.decrypt(new Uint8Array(a),h.key.buffer,h.iv.buffer,Fn(h.method)).catch(g=>{throw i.trigger(d.ERROR,{type:P.MEDIA_ERROR,details:A.FRAG_DECRYPT_ERROR,fatal:!1,error:g,reason:g.message,frag:n}),g}).then(g=>{const x=self.performance.now();return i.trigger(d.FRAG_DECRYPTED,{frag:n,payload:g,stats:{tstart:_,tdecrypt:x}}),r.payload=g,this.completeInitSegmentLoad(r)})}return this.completeInitSegmentLoad(r)}).catch(r=>{this.state===Et.STOPPED||this.state===Et.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!==Et.STOPPED&&(this.state=Et.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()}unhandledEncryptionError(e,t){var r,i;const n=e.tracks;if(n&&!t.encrypted&&((r=n.audio)!=null&&r.encrypted||(i=n.video)!=null&&i.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const a=this.media,h=new Error(`Encrypted track with no key in ${this.fragInfo(t)} (media ${a?"attached mediaKeys: "+a.mediaKeys:"detached"})`);return this.warn(h.message),!a||a.mediaKeys?!1:(this.hls.trigger(d.ERROR,{type:P.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_NO_KEYS,fatal:!1,error:h,frag:t}),this.resetTransmuxer(),!0)}return!1}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?Na.toString(nr.getBuffered(r)):"(detached)"})`),Oe(e)){var i;if(e.type!==S.SUBTITLE){const a=e.elementaryStreams;if(!Object.keys(a).some(h=>!!a[h])){this.state=Et.IDLE;return}}const n=(i=this.levels)==null?void 0:i[e.level];n!=null&&n.fragmentError&&(this.log(`Resetting level fragment error count of ${n.fragmentError} on frag buffered`),n.fragmentError=0)}this.state=Et.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:r,part:i,partsLoaded:n}=e,a=!n||n.length===0||n.some(_=>!_),h=new rn(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 n;this.fragCurrent=e;const a=t.details;if(!this.levels||!a)throw new Error(`frag load aborted, missing level${a?"":" detail"}s`);let h=null;if(e.encrypted&&!((n=e.decryptdata)!=null&&n.key)){if(this.log(`Loading key for ${e.sn} of [${a.startSN}-${a.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=Et.KEY_LOADING,this.fragCurrent=e,h=this.keyLoader.load(e).then(j=>{if(!this.fragContextChanged(j.frag))return this.hls.trigger(d.KEY_LOADED,j),this.state===Et.KEY_LOADING&&(this.state=Et.IDLE),j}),this.hls.trigger(d.KEY_LOADING,{frag:e}),this.fragCurrent===null)return this.log("context changed in KEY_LOADING"),Promise.resolve(null)}else e.encrypted||(h=this.keyLoader.loadClear(e,a.encryptedFragments,this.startFragRequested),h&&this.log("[eme] blocking frag load until media-keys acquired"));const _=this.fragPrevious;if(Oe(e)&&(!_||e.sn!==_.sn)){const j=this.shouldLoadParts(t.details,e.end);j!==this.loadingParts&&(this.log(`LL-Part loading ${j?"ON":"OFF"} loading sn ${_==null?void 0:_.sn}->${e.sn}`),this.loadingParts=j)}if(r=Math.max(e.start,r||0),this.loadingParts&&Oe(e)){const j=a.partList;if(j&&i){r>a.fragmentEnd&&a.fragmentHint&&(e=a.fragmentHint);const Y=this.getNextPart(j,e,r);if(Y>-1){const Q=j[Y];e=this.fragCurrent=Q.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${Q.index} (${Y}/${j.length-1}) of ${this.fragInfo(e,!1,Q)}) cc: ${e.cc} [${a.startSN}-${a.endSN}], target: ${parseFloat(r.toFixed(3))}`),this.nextLoadPosition=Q.start+Q.duration,this.state=Et.FRAG_LOADING;let ue;return h?ue=h.then(le=>!le||this.fragContextChanged(le.frag)?null:this.doFragPartsLoad(e,Q,t,i)).catch(le=>this.handleFragLoadError(le)):ue=this.doFragPartsLoad(e,Q,t,i).catch(le=>this.handleFragLoadError(le)),this.hls.trigger(d.FRAG_LOADING,{frag:e,part:Q,targetBufferTime:r}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):ue}else if(!e.url||this.loadedEndOfParts(j,r))return Promise.resolve(null)}}if(Oe(e)&&this.loadingParts){var g;this.log(`LL-Part loading OFF after next part miss @${r.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${(g=a.partList)==null?void 0:g.filter(j=>j.loaded).map(j=>`[${j.start}-${j.end}]`)}`),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.startSN+"-"+a.endSN+"]"}, target: ${parseFloat(r.toFixed(3))}`),R(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Et.FRAG_LOADING;const x=this.config.progressive&&e.type!==S.SUBTITLE;let D;return x&&h?D=h.then(j=>!j||this.fragContextChanged(j.frag)?null:this.fragmentLoader.load(e,i)).catch(j=>this.handleFragLoadError(j)):D=Promise.all([this.fragmentLoader.load(e,x?i:void 0),h]).then(([j])=>(!x&&i&&i(j),j)).catch(j=>this.handleFragLoadError(j)),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")):D}doFragPartsLoad(e,t,r,i){return new Promise((n,a)=>{var h;const _=[],g=(h=r.details)==null?void 0:h.partList,x=D=>{this.fragmentLoader.loadPart(e,D,i).then(j=>{_[D.index]=j;const Y=j.part;this.hls.trigger(d.FRAG_LOADED,j);const Q=Pa(r.details,e.sn,D.index+1)||na(g,e.sn,D.index+1);if(Q)x(Q);else return n({frag:e,part:Y,partsLoaded:_})}).catch(a)};x(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;t.frag&&t.details===A.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):t.frag&&t.type===P.KEY_SYSTEM_ERROR?(t.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(t.frag)):this.hls.trigger(d.ERROR,t)}else this.hls.trigger(d.ERROR,{type:P.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!==Et.PARSING){!this.fragCurrent&&this.state!==Et.STOPPED&&this.state!==Et.ERROR&&(this.state=Et.IDLE);return}const{frag:r,part:i,level:n}=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,n,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){var r;const n=e.partList[0];if(n.fragment.type===S.SUBTITLE)return!1;const a=n.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())>n.start-n.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:r}=this,{level:i,sn:n,part:a}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${n} of ${this.playlistLabel()} ${i}. The current chunk will not be buffered.`),null;const h=t[i],_=h.details,g=a>-1?Pa(_,n,a):null,x=g?g.fragment:ia(_,n,r);return x?(r&&r!==x&&(x.stats=r.stats),{frag:x,part:g,level:h}):null}bufferFragmentData(e,t,r,i,n){if(this.state!==Et.PARSING)return;const{data1:a,data2:h}=e;let _=a;if(h&&(_=Tt(a,h)),!_.length)return;const g=this.initPTS[t.cc],x=g?-g.baseTime/g.timescale:void 0,D={type:e.type,frag:t,part:r,chunkMeta:i,offset:x,parent:t.type,data:_};if(this.hls.trigger(d.BUFFER_APPENDING,D),e.dropped&&e.independent&&!r){if(n)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!nr.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const r=t.currentTime,i=nr.bufferInfo(t,r,0),n=e.duration,a=Math.min(this.config.maxFragLookUpTolerance*2,n*.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(!R(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 n=nr.bufferInfo(e,t,i);if(n.len===0&&n.nextStart!==void 0){const a=this.fragmentTracker.getBufferedFrag(t,r);if(a&&(n.nextStart<=a.end||a.gap)){const h=Math.max(Math.min(n.nextStart,a.end)-t,i);return nr.bufferInfo(e,t,h)}}return n}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),n=Math.max(e-t*3,r.maxMaxBufferLength/2,i);return n>=i?(r.maxMaxBufferLength=n,this.warn(`Reduce max buffer length to ${n}s`),!0):!1}getAppendedFrag(e,t=S.MAIN){const r=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;return r&&"fragment"in r?r.fragment:r}getNextFragment(e,t){const r=t.fragments,i=r.length;if(!i)return null;const{config:n}=this,a=r[0].start,h=n.lowLatencyMode&&!!t.partList;let _=null;if(t.live){const D=n.initialLiveManifestSize;if(i<D)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${D})`),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);const j=this.hls.startPosition,Y=this.hls.liveSyncPosition,Q=_?(j!==-1&&j>=a?j:Y)||_.start:e;this.log(`Setting startPosition to ${Q} to match start frag at live edge. mainStart: ${j} liveSyncPosition: ${Y} frag.start: ${(g=_)==null?void 0:g.start}`),this.startPosition=this.nextLoadPosition=Q}}else e<=a&&(_=r[0]);if(!_){const D=this.loadingParts?t.partEnd:t.fragmentEnd;_=this.getFragmentAtPosition(e,D,t)}let x=this.filterReplacedPrimary(_,t);if(!x&&_){const D=_.sn-t.startSN;x=this.filterReplacedPrimary(r[D+1]||null,t)}return this.mapToInitFragWhenRequired(x)}isLoopLoading(e,t){const r=this.fragmentTracker.getState(e);return(r===$r.OK||r===$r.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,r,i,n){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>=n){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(la(this.config)){var e;if((e=this.hls.interstitialsManager)==null||(e=e.playingItem)==null?void 0:e.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(la(this.config)&&e.type!==S.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 n=r==null?void 0:r.playerQueue;if(n)for(let a=n.length;a--;){const h=n[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.initSegment.data&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,r){let i=-1,n=!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 x=g.loaded;x?i=-1:(n||(g.independent||a)&&g.fragment===t)&&(g.fragment!==t&&this.warn(`Need buffer at ${r} but next unloaded part starts at ${g.start}`),i=h),n=x}return i}loadedEndOfParts(e,t){let r;for(let i=e.length;i--;){if(r=e[i],!r.loaded)return!1;if(t>r.start)return!0}return!1}getInitialLiveFragment(e){const t=e.fragments,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=Kr(t,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const n=r.sn+1;if(n>=e.startSN&&n<=e.endSN){const a=t[n-e.startSN];r.cc===a.cc&&(i=a,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=vn(e,r.cc,r.end),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const n=this.hls.liveSyncPosition;n!==null&&(i=this.getFragmentAtPosition(n,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,r){const{config:i}=this;let{fragPrevious:n}=this,{fragments:a,endSN:h}=r;const{fragmentHint:_}=r,{maxFragLookUpTolerance:g}=i,x=r.partList,D=!!(this.loadingParts&&x!=null&&x.length&&_);D&&!this.bitrateTest&&x[x.length-1].fragment.sn===_.sn&&(a=a.concat(_),h=_.sn);let j;if(e<t){var Y;const ue=e<this.lastCurrentTime||e>t-g||(Y=this.media)!=null&&Y.paused||!this.startFragRequested?0:g;j=ai(n,a,e,ue)}else j=a[a.length-1];if(j){const Q=j.sn-r.startSN,ue=this.fragmentTracker.getState(j);if((ue===$r.OK||ue===$r.PARTIAL&&j.gap)&&(n=j),n&&j.sn===n.sn&&(!D||x[0].fragment.sn>j.sn||!r.live)&&j.level===n.level){const be=a[Q+1];j.sn<h&&this.fragmentTracker.getState(be)!==$r.OK?j=be:j=null}}return j}alignPlaylists(e,t,r){const i=e.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const n=e.fragmentStart,a=!t,h=e.alignedSliding&&R(n);if(a||!h&&!n){Ba(r,e);const _=e.fragmentStart;return this.log(`Live playlist sliding: ${_.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${i}`),_}return n}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 n=this.startTimeOffset!==null,a=n?this.startTimeOffset:e.startTimeOffset;a!==null&&R(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 ${n?"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&&Oe(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==Et.FRAG_LOADING_WAITING_RETRY)&&(this.state=Et.IDLE)}onFragmentOrKeyLoadError(e,t){var r;if(t.chunkMeta&&!t.frag){const be=this.getCurrentContext(t.chunkMeta);be&&(t.frag=be.frag)}const i=t.frag;if(!i||i.type!==e||!this.levels)return;if(this.fragContextChanged(i)){var n;this.warn(`Frag load error must match current frag to retry ${i.url} > ${(n=this.fragCurrent)==null?void 0:n.url}`);return}const a=t.details===A.FRAG_GAP;a&&this.fragmentTracker.fragBuffered(i,!0);const h=t.errorAction;if(!h){this.state=Et.ERROR;return}const{action:_,flags:g,retryCount:x=0,retryConfig:D}=h,j=!!D,Y=j&&_===ur.RetryRequest,Q=j&&!h.resolved&&g===Or.MoveAllAlternatesMatchingHost,ue=(r=this.hls.latestLevelDetails)==null?void 0:r.live;if(!Y&&Q&&Oe(i)&&!i.endList&&ue&&!ct(t))this.resetFragmentErrors(e),this.treatAsGap(i),h.resolved=!0;else if((Y||Q)&&x<D.maxNumRetry){var le;const be=Ei((le=t.response)==null?void 0:le.code),xe=Vr(D,x);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+xe,this.state=Et.FRAG_LOADING_WAITING_RETRY,h.resolved=!0,be){this.log("Waiting for connection (offline)"),this.retryDate=1/0,t.reason="offline";return}this.warn(`Fragment ${i.sn} of ${e} ${i.level} errored with ${t.details}, retrying loading ${x+1}/${D.maxNumRetry} in ${xe}ms`)}else if(D)if(this.resetFragmentErrors(e),x<D.maxNumRetry)!a&&_!==ur.RemoveAlternatePermanently&&(h.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${x})`);return}else _===ur.SendAlternateToPenaltyBox?this.state=Et.WAITING_LEVEL:this.state=Et.ERROR;this.tickImmediate()}checkRetryDate(){const e=self.performance.now(),t=this.retryDate,r=t===1/0;(!t||e>=t||r&&!Ei(0))&&(r&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=Et.IDLE)}reduceLengthAndFlushBuffer(e){if(this.state===Et.PARSING||this.state===Et.PARSED){const t=e.frag,r=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,r),n=i&&i.len>.5;n&&this.reduceMaxBufferLength(i.len,(t==null?void 0:t.duration)||10);const a=!n;return a&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${r} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),a}return!1}resetFragmentErrors(e){e===S.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==Et.STOPPED&&(this.state=Et.IDLE)}afterBufferFlushed(e,t,r){if(!e)return;const i=nr.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,r),this.state===Et.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==Et.STOPPED&&(this.state=Et.IDLE)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=this.levelLastLoaded,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.log(`Loading context changed while buffering sn ${e.sn} of ${this.playlistLabel()} ${e.level===-1?"<removed>":e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,r,i){const n=r.details;if(!n){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((_,g)=>{const x=e.elementaryStreams[g];if(x){const D=x.endPTS-x.startPTS;if(D<=0)return this.warn(`Could not parse fragment ${e.sn} ${g} duration reliably (${D})`),_||!1;const j=i?0:Is(n,e,x.startPTS,x.endPTS,x.startDTS,x.endDTS,this);return this.hls.trigger(d.LEVEL_PTS_UPDATED,{details:n,level:r,drift:j,type:g,frag:e,start:x.startPTS,end:x.endPTS}),!0}return _},!1)){var h;const _=((h=this.transmuxer)==null?void 0:h.error)===null;if((r.fragmentError===0||_&&(r.fragmentError<2||e.endList))&&this.treatAsGap(e,r),_){const g=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(g.message),this.hls.trigger(d.ERROR,{type:P.MEDIA_ERROR,details:A.FRAG_PARSING_ERROR,fatal:!1,error:g,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${r.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=Et.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===S.MAIN?"level":"track"}fragInfo(e,t=!0,r){var i,n;return`${this.playlistLabel()} ${e.level} (${r?"part":"frag"}:[${((i=t&&!r?e.startPTS:(r||e).start)!=null?i:NaN).toFixed(3)}-${((n=t&&!r?e.endPTS:(r||e).end)!=null?n: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.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function la(o){return!!o.interstitialsController&&o.enableInterstitialPlayback!==!1}class ua{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let r;if(e.length)e.length===1?r=e[0]:r=Ua(e,t);else return new Uint8Array(0);return this.reset(),r}reset(){this.chunks.length=0,this.dataLength=0}}function Ua(o,e){const t=new Uint8Array(e);let r=0;for(let i=0;i<o.length;i++){const n=o[i];t.set(n,r),r+=n.length}return t}var Un={exports:{}},as;function Ao(){return as||(as=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,x){this.fn=_,this.context=g,this.once=x||!1}function n(_,g,x,D,j){if(typeof x!="function")throw new TypeError("The listener must be a function");var Y=new i(x,D||_,j),Q=t?t+g:g;return _._events[Q]?_._events[Q].fn?_._events[Q]=[_._events[Q],Y]:_._events[Q].push(Y):(_._events[Q]=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=[],x,D;if(this._eventsCount===0)return g;for(D in x=this._events)e.call(x,D)&&g.push(t?D.slice(1):D);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(x)):g},h.prototype.listeners=function(g){var x=t?t+g:g,D=this._events[x];if(!D)return[];if(D.fn)return[D.fn];for(var j=0,Y=D.length,Q=new Array(Y);j<Y;j++)Q[j]=D[j].fn;return Q},h.prototype.listenerCount=function(g){var x=t?t+g:g,D=this._events[x];return D?D.fn?1:D.length:0},h.prototype.emit=function(g,x,D,j,Y,Q){var ue=t?t+g:g;if(!this._events[ue])return!1;var le=this._events[ue],be=arguments.length,xe,Ce;if(le.fn){switch(le.once&&this.removeListener(g,le.fn,void 0,!0),be){case 1:return le.fn.call(le.context),!0;case 2:return le.fn.call(le.context,x),!0;case 3:return le.fn.call(le.context,x,D),!0;case 4:return le.fn.call(le.context,x,D,j),!0;case 5:return le.fn.call(le.context,x,D,j,Y),!0;case 6:return le.fn.call(le.context,x,D,j,Y,Q),!0}for(Ce=1,xe=new Array(be-1);Ce<be;Ce++)xe[Ce-1]=arguments[Ce];le.fn.apply(le.context,xe)}else{var Ue=le.length,qe;for(Ce=0;Ce<Ue;Ce++)switch(le[Ce].once&&this.removeListener(g,le[Ce].fn,void 0,!0),be){case 1:le[Ce].fn.call(le[Ce].context);break;case 2:le[Ce].fn.call(le[Ce].context,x);break;case 3:le[Ce].fn.call(le[Ce].context,x,D);break;case 4:le[Ce].fn.call(le[Ce].context,x,D,j);break;default:if(!xe)for(qe=1,xe=new Array(be-1);qe<be;qe++)xe[qe-1]=arguments[qe];le[Ce].fn.apply(le[Ce].context,xe)}}return!0},h.prototype.on=function(g,x,D){return n(this,g,x,D,!1)},h.prototype.once=function(g,x,D){return n(this,g,x,D,!0)},h.prototype.removeListener=function(g,x,D,j){var Y=t?t+g:g;if(!this._events[Y])return this;if(!x)return a(this,Y),this;var Q=this._events[Y];if(Q.fn)Q.fn===x&&(!j||Q.once)&&(!D||Q.context===D)&&a(this,Y);else{for(var ue=0,le=[],be=Q.length;ue<be;ue++)(Q[ue].fn!==x||j&&!Q[ue].once||D&&Q[ue].context!==D)&&le.push(Q[ue]);le.length?this._events[Y]=le.length===1?le[0]:le:a(this,Y)}return this},h.prototype.removeAllListeners=function(g){var x;return g?(x=t?t+g:g,this._events[x]&&a(this,x)):(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}(Un)),Un.exports}var To=Ao(),Ms=ae(To);const vs="1.6.15",Xn={};function $a(){return typeof __HLS_WORKER_BUNDLE__=="function"}function Do(){const o=Xn[vs];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 Xn[vs]=i,i}function za(o){const e=Xn[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 Xn[o]=i,i}function Ro(o){const e=Xn[o||vs];if(e&&e.clientCount--===1){const{worker:r,objectURL:i}=e;delete Xn[o||vs],i&&self.URL.revokeObjectURL(i),r.terminate()}}function ca(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 ys(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 os(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 ls(o,e){const t=e;let r=0;for(;ys(o,e);){r+=10;const i=os(o,e+6);r+=i,ca(o,e+10)&&(r+=10),e+=r}if(r>0)return o.subarray(t,t+r)}function Ha(o,e,t,r){const i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],n=e[t+2],a=n>>2&15;if(a>12){const Y=new Error(`invalid ADTS sampling index:${a}`);o.emit(d.ERROR,d.ERROR,{type:P.MEDIA_ERROR,details:A.FRAG_PARSING_ERROR,fatal:!0,error:Y,reason:Y.message});return}const h=(n>>6&3)+1,_=e[t+3]>>6&3|(n&1)<<2,g="mp4a.40."+h,x=i[a];let D=a;(h===5||h===29)&&(D-=3);const j=[h<<3|(D&14)>>1,(D&1)<<7|_<<3];return z.log(`manifest codec:${r}, parsed codec:${g}, channels:${_}, rate:${x} (ADTS object type:${h} sampling index:${a})`),{config:j,samplerate:x,channelCount:_,codec:g,parsedCodec:g,manifestCodec:r}}function ha(o,e){return o[e]===255&&(o[e+1]&246)===240}function ja(o,e){return o[e+1]&1?7:9}function Fs(o,e){return(o[e+3]&3)<<11|o[e+4]<<3|(o[e+5]&224)>>>5}function Wa(o,e){return e+5<o.length}function Bs(o,e){return e+1<o.length&&ha(o,e)}function bs(o,e){return Wa(o,e)&&ha(o,e)&&Fs(o,e)<=o.length-e}function fa(o,e){if(Bs(o,e)){const t=ja(o,e);if(e+t>=o.length)return!1;const r=Fs(o,e);if(r<=t)return!1;const i=e+r;return i===o.length||Bs(o,i)}return!1}function da(o,e,t,r,i){if(!o.samplerate){const n=Ha(e,t,r,i);if(!n)return;u(o,n)}}function Ga(o){return 1024*9e4/o}function Lo(o,e){const t=ja(o,e);if(e+t<=o.length){const r=Fs(o,e)-t;if(r>0)return{headerLength:t,frameLength:r}}}function Ka(o,e,t,r,i){const n=Ga(o.samplerate),a=r+i*n,h=Lo(e,t);let _;if(h){const{frameLength:D,headerLength:j}=h,Y=j+D,Q=Math.max(0,t+Y-e.length);Q?(_=new Uint8Array(Y-j),_.set(e.subarray(t+j,e.length),0)):_=e.subarray(t+j,t+Y);const ue={unit:_,pts:a};return Q||o.samples.push(ue),{sample:ue,length:Y,missing:Q}}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 pa(o,e){return ys(o,e)&&os(o,e+6)+10<=o.length-e}function ko(o){return o instanceof ArrayBuffer?o:o.byteOffset==0&&o.byteLength==o.buffer.byteLength?o.buffer:new Uint8Array(o).buffer}function ma(o,e=0,t=1/0){return Va(o,e,t,Uint8Array)}function Va(o,e,t,r){const i=Io(o);let n=1;"BYTES_PER_ELEMENT"in r&&(n=r.BYTES_PER_ELEMENT);const a=qa(o)?o.byteOffset:0,h=(a+o.byteLength)/n,_=(a+e)/n,g=Math.floor(Math.max(0,Math.min(_,h))),x=Math.floor(Math.min(g+Math.max(t,0),h));return new r(i,g,x-g)}function Io(o){return o instanceof ArrayBuffer?o:o.buffer}function qa(o){return o&&o.buffer instanceof ArrayBuffer&&o.byteLength!==void 0&&o.byteOffset!==void 0}function Po(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=Ae(ma(o.data,1,r)),n=o.data[2+r],a=o.data.subarray(3+r).indexOf(0);if(a===-1)return;const h=Ae(ma(o.data,3+r,a));let _;return i==="-->"?_=Ae(ma(o.data,4+r+a)):_=ko(o.data.subarray(4+r+a)),e.mimeType=i,e.pictureType=n,e.description=h,e.data=_,e}function we(o){if(o.size<2)return;const e=Ae(o.data,!0),t=new Uint8Array(o.data.subarray(e.length+1));return{key:o.type,info:e,data:t.buffer}}function Ya(o){if(o.size<2)return;if(o.type==="TXXX"){let t=1;const r=Ae(o.data.subarray(t),!0);t+=r.length+1;const i=Ae(o.data.subarray(t));return{key:o.type,info:r,data:i}}const e=Ae(o.data.subarray(1));return{key:o.type,info:"",data:e}}function ga(o){if(o.type==="WXXX"){if(o.size<2)return;let t=1;const r=Ae(o.data.subarray(t),!0);t+=r.length+1;const i=Ae(o.data.subarray(t));return{key:o.type,info:r,data:i}}const e=Ae(o.data);return{key:o.type,info:"",data:e}}function _a(o){return o.type==="PRIV"?we(o):o.type[0]==="W"?ga(o):o.type==="APIC"?Po(o):Ya(o)}function Za(o){const e=String.fromCharCode(o[0],o[1],o[2],o[3]),t=os(o,4),r=10;return{type:e,size:t,data:o.subarray(r,r+t)}}const us=10,Xa=10;function va(o){let e=0;const t=[];for(;ys(o,e);){const r=os(o,e+6);o[e+5]>>6&1&&(e+=us),e+=us;const i=e+r;for(;e+Xa<i;){const n=Za(o.subarray(e)),a=_a(n);a&&t.push(a),e+=n.size+us}ca(o,e)&&(e+=us)}return t}function Qa(o){return o&&o.key==="PRIV"&&o.info==="com.apple.streaming.transportStreamTimestamp"}function Ja(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 Ns(o){const e=va(o);for(let t=0;t<e.length;t++){const r=e[t];if(Qa(r))return Ja(r)}}let vi=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 cn(o="",e=9e4){return{type:o,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class Ss{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=Tt(this.cachedData,e),this.cachedData=null);let r=ls(e,0),i=r?r.length:0,n;const a=this._audioTrack,h=this._id3Track,_=r?Ns(r):void 0,g=e.length;for((this.basePTS===null||this.frameIndex===0&&R(_))&&(this.basePTS=eo(_,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:vi.audioId3,duration:Number.POSITIVE_INFINITY});i<g;){if(this.canParse(e,i)){const x=this.appendFrame(a,e,i);x?(this.frameIndex++,this.lastPTS=x.sample.pts,i+=x.length,n=i):i=g}else pa(e,i)?(r=ls(e,i),h.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:vi.audioId3,duration:Number.POSITIVE_INFINITY}),i+=r.length,n=i):i++;if(i===g&&n!==g){const x=e.slice(n);this.cachedData?this.cachedData=Tt(this.cachedData,x):this.cachedData=x}}return{audioTrack:a,videoTrack:cn(),id3Track:h,textTrack:cn()}}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:cn(),id3Track:this._id3Track,textTrack:cn()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const eo=(o,e,t)=>{if(R(o))return o*90;const r=t?t.baseTime*9e4/t.timescale:0;return e*9e4+r};let Us=null;const Oo=[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],to=[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]],Mo=[0,1,1,4];function ro(o,e,t,r,i){if(t+24>e.length)return;const n=Fo(e,t);if(n&&t+n.frameLength<=e.length){const a=n.samplesPerFrame*9e4/n.sampleRate,h=r+i*a,_={unit:e.subarray(t,t+n.frameLength),pts:h,dts:h};return o.config=[],o.channelCount=n.channelCount,o.samplerate=n.sampleRate,o.samples.push(_),{sample:_,length:n.frameLength,missing:0}}}function Fo(o,e){const t=o[e+1]>>3&3,r=o[e+1]>>1&3,i=o[e+2]>>4&15,n=o[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&n!==3){const a=o[e+2]>>1&1,h=o[e+3]>>6,_=t===3?3-r:r===3?3:4,g=Oo[_*14+i-1]*1e3,D=to[(t===3?0:t===2?1:2)*3+n],j=h===3?1:2,Y=ya[t][r],Q=Mo[r],ue=Y*8*Q,le=Math.floor(Y*g/D+a)*Q;if(Us===null){const Ce=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Us=Ce?parseInt(Ce[1]):0}return!!Us&&Us<=87&&r===2&&g>=224e3&&h===0&&(o[e+3]=o[e+3]|128),{sampleRate:D,channelCount:j,frameLength:le,samplesPerFrame:ue}}}function te(o,e){return o[e]===255&&(o[e+1]&224)===224&&(o[e+1]&6)!==0}function p(o,e){return e+1<o.length&&te(o,e)}function v(o,e){return te(o,e)&&4<=o.length-e}function b(o,e){if(e+1<o.length&&te(o,e)){const r=Fo(o,e);let i=4;r!=null&&r.frameLength&&(i=r.frameLength);const n=e+i;return n===o.length||p(o,n)}return!1}class L extends Ss{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=ls(e,0);let i=(r==null?void 0:r.length)||0;if(b(e,i))return!1;for(let n=e.length;i<n;i++)if(fa(e,i))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return bs(e,t)}appendFrame(e,t,r){da(e,this.observer,t,r,e.manifestCodec);const i=Ka(e,t,r,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const V=(o,e)=>{let t=0,r=5;e+=r;const i=new Uint32Array(1),n=new Uint32Array(1),a=new Uint8Array(1);for(;r>0;){a[0]=o[e];const h=Math.min(r,8),_=8-h;n[0]=4278190080>>>24+_<<_,i[0]=(a[0]&n[0])>>_,t=t?t<<h|i[0]:i[0],e+=1,r-=h}return t};class ee extends Ss{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=pe(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=ls(e,0);if(!t)return!1;const r=t.length;return e[r]===11&&e[r+1]===119&&Ns(t)!==void 0&&V(e,r)<16}}function pe(o,e,t,r,i){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const n=e[t+4]>>6;if(n>=3)return-1;const h=[48e3,44100,32e3][n],_=e[t+4]&63,x=[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+n]*2;if(t+x>e.length)return-1;const D=e[t+6]>>5;let j=0;D===2?j+=2:(D&1&&D!==1&&(j+=2),D&4&&(j+=2));const Y=(e[t+6]<<8|e[t+7])>>12-j&1,ue=[2,1,2,3,3,4,4,5][D]+Y,le=e[t+5]>>3,be=e[t+5]&7,xe=new Uint8Array([n<<6|le<<1|be>>2,(be&3)<<6|D<<3|Y<<2|_>>4,_<<4&224]),Ce=1536/h*9e4,Ue=r+i*Ce,qe=e.subarray(t,t+x);return o.config=xe,o.channelCount=ue,o.samplerate=h,o.samples.push({unit:qe,pts:Ue}),x}class ye extends Ss{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=ls(e,0);let r=(t==null?void 0:t.length)||0;if(t&&e[r]===11&&e[r+1]===119&&Ns(t)!==void 0&&V(e,r)<=16)return!1;for(let i=e.length;r<i;r++)if(b(e,r))return z.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return v(e,t)}appendFrame(e,t,r){if(this.basePTS!==null)return ro(e,t,r,this.basePTS,this.frameIndex)}}const De=/\/emsg[-/]ID3/i;class je{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 n=this.videoTrack=cn("video",1),a=this.audioTrack=cn("audio",1),h=this.txtTrack=cn("text",1);if(this.id3Track=cn("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const _=Je(e);if(_.video){const{id:g,timescale:x,codec:D,supplemental:j}=_.video;n.id=g,n.timescale=h.timescale=x,n.codec=D,n.supplemental=j}if(_.audio){const{id:g,timescale:x,codec:D}=_.audio;a.id=g,a.timescale=x,a.codec=D}h.id=Nt.text,n.sampleDuration=0,n.duration=a.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return Te(e)}demux(e,t){this.timeOffset=t;let r=e;const i=this.videoTrack,n=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=Tt(this.remainderData,e));const h=Pt(r);this.remainderData=h.remainder,i.samples=h.valid||new Uint8Array}else i.samples=r;const a=this.extractID3Track(i,t);return n.samples=xt(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=xt(e,t),{videoTrack:t,audioTrack:cn(),id3Track:i,textTrack:cn()}}extractID3Track(e,t){const r=this.id3Track;if(e.samples.length){const i=Se(e.samples,["emsg"]);i&&i.forEach(n=>{const a=At(n);if(De.test(a.schemeIdUri)){const h=Qe(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:vi.emsg,duration:_})}else if(this.config.enableEmsgKLVMetadata&&a.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const h=Qe(a,t);r.samples.push({data:a.payload,len:a.payload.byteLength,dts:h,pts:h,type:vi.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 Qe(o,e){return R(o.presentationTime)?o.presentationTime/o.timeScale:e+o.presentationTimeDelta/o.timeScale}class mt{constructor(e,t,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new Xr(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,oi.cbc)}decryptAacSample(e,t,r){const i=e[t].unit;if(i.length<=16)return;const n=i.subarray(16,i.length-i.length%16),a=n.buffer.slice(n.byteOffset,n.byteOffset+n.length);this.decryptBuffer(a).then(h=>{const _=new Uint8Array(h);i.set(_,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,r)}).catch(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 n=32;n<e.length-16;n+=160,i+=16)r.set(e.subarray(n,n+16),i);return r}getAvcDecryptedUnit(e,t){const r=new Uint8Array(t);let i=0;for(let n=32;n<e.length-16;n+=160,i+=16)e.set(r.subarray(i,i+16),n);return e}decryptAvcSample(e,t,r,i,n){const a=lt(n.data),h=this.getAvcEncryptedData(a);this.decryptBuffer(h.buffer).then(_=>{n.data=this.getAvcDecryptedUnit(a,_),this.decrypter.isSync()||this.decryptAvcSamples(e,t,r+1,i)}).catch(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 n=e[t].units;for(;!(r>=n.length);r++){const a=n[r];if(!(a.data.length<=48||a.type!==1&&a.type!==5)&&(this.decryptAvcSample(e,t,r,i,a),!this.decrypter.isSync()))return}}}}class Dt{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 n=r.units;i=n[n.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 n=r[i-1];e.pts=n.pts,e.dts=n.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,r){const i=t.byteLength;let n=e.naluState||0;const a=n,h=[];let _=0,g,x,D,j=-1,Y=0;for(n===-1&&(j=0,Y=this.getNALuType(t,0),n=0,_=1);_<i;){if(g=t[_++],!n){n=g?0:1;continue}if(n===1){n=g?0:2;continue}if(!g)n=3;else if(g===1){if(x=_-n-1,j>=0){const Q={data:t.subarray(j,x),type:Y};h.push(Q)}else{const Q=this.getLastNalUnit(e.samples);Q&&(a&&_<=4-a&&Q.state&&(Q.data=Q.data.subarray(0,Q.data.byteLength-a)),x>0&&(Q.data=Tt(Q.data,t.subarray(0,x)),Q.state=0))}_<i?(D=this.getNALuType(t,_),j=_,Y=D,n=0):n=-1}else n=0}if(j>=0&&n>=0){const Q={data:t.subarray(j,i),type:Y,state:n};h.push(Q)}if(h.length===0){const Q=this.getLastNalUnit(e.samples);Q&&(Q.data=Tt(Q.data,t))}return e.naluState=n,h}}class It{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),n=Math.min(4,t);if(n===0)throw new Error("no bytes available");i.set(e.subarray(r,r+n)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=n*8,this.bytesAvailable-=n}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 $t extends Dt{parsePES(e,t,r,i){const n=this.parseNALu(e,r.data,i);let a=this.VideoSample,h,_=!1;r.data=null,a&&n.length&&!e.audFound&&(this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),n.forEach(g=>{var x,D;switch(g.type){case 1:{let ue=!1;h=!0;const le=g.data;if(_&&le.length>4){const be=this.readSliceType(le);(be===2||be===4||be===7||be===9)&&(ue=!0)}if(ue){var j;(j=a)!=null&&j.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=ue;break}case 5:h=!0,(x=a)!=null&&x.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,_t(g.data,1,r.pts,t.samples);break}case 7:{var Y,Q;h=!0,_=!0;const ue=g.data,le=this.readSPS(ue);if(!e.sps||e.width!==le.width||e.height!==le.height||((Y=e.pixelRatio)==null?void 0:Y[0])!==le.pixelRatio[0]||((Q=e.pixelRatio)==null?void 0:Q[1])!==le.pixelRatio[1]){e.width=le.width,e.height=le.height,e.pixelRatio=le.pixelRatio,e.sps=[ue];const be=ue.subarray(1,4);let xe="avc1.";for(let Ce=0;Ce<3;Ce++){let Ue=be[Ce].toString(16);Ue.length<2&&(Ue="0"+Ue),xe+=Ue}e.codec=xe}break}case 8:h=!0,e.pps=[g.data];break;case 9:h=!0,e.audFound=!0,(D=a)!=null&&D.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 It(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let r=8,i=8,n;for(let a=0;a<e;a++)i!==0&&(n=t.readEG(),i=(r+n+256)%256),r=i===0?r:i}readSPS(e){const t=new It(e);let r=0,i=0,n=0,a=0,h,_,g;const x=t.readUByte.bind(t),D=t.readBits.bind(t),j=t.readUEG.bind(t),Y=t.readBoolean.bind(t),Q=t.skipBits.bind(t),ue=t.skipEG.bind(t),le=t.skipUEG.bind(t),be=this.skipScalingList.bind(this);x();const xe=x();if(D(5),Q(3),x(),le(),xe===100||xe===110||xe===122||xe===244||xe===44||xe===83||xe===86||xe===118||xe===128){const at=j();if(at===3&&Q(1),le(),le(),Q(1),Y())for(_=at!==3?8:12,g=0;g<_;g++)Y()&&(g<6?be(16,t):be(64,t))}le();const Ce=j();if(Ce===0)j();else if(Ce===1)for(Q(1),ue(),ue(),h=j(),g=0;g<h;g++)ue();le(),Q(1);const Ue=j(),qe=j(),pt=D(1);pt===0&&Q(1),Q(1),Y()&&(r=j(),i=j(),n=j(),a=j());let Ye=[1,1];if(Y()&&Y())switch(x()){case 1:Ye=[1,1];break;case 2:Ye=[12,11];break;case 3:Ye=[10,11];break;case 4:Ye=[16,11];break;case 5:Ye=[40,33];break;case 6:Ye=[24,11];break;case 7:Ye=[20,11];break;case 8:Ye=[32,11];break;case 9:Ye=[80,33];break;case 10:Ye=[18,11];break;case 11:Ye=[15,11];break;case 12:Ye=[64,33];break;case 13:Ye=[160,99];break;case 14:Ye=[4,3];break;case 15:Ye=[3,2];break;case 16:Ye=[2,1];break;case 255:{Ye=[x()<<8|x(),x()<<8|x()];break}}return{width:Math.ceil((Ue+1)*16-r*2-i*2),height:(2-pt)*(qe+1)*16-(pt?2:4)*(n+a),pixelRatio:Ye}}}class Qt extends Dt{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,r,i){const n=this.parseNALu(e,r.data,i);let a=this.VideoSample,h,_=!1;r.data=null,a&&n.length&&!e.audFound&&(this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),n.forEach(g=>{var x,D;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 j;(j=a)!=null&&j.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,(x=a)!=null&&x.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,_t(g.data,2,r.pts,t.samples);break;case 32:h=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=u(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 Q in Y.params)e.params[Q]=Y.params[Q]}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 Q in Y)e.params[Q]=Y[Q]}this.pushParameterSet(e.pps,g.data,e.vps)}break;case 35:h=!0,e.audFound=!0,(D=a)!=null&&D.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 It(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 It(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const r=t.readBits(3);t.readBoolean();const i=t.readBits(2),n=t.readBoolean(),a=t.readBits(5),h=t.readUByte(),_=t.readUByte(),g=t.readUByte(),x=t.readUByte(),D=t.readUByte(),j=t.readUByte(),Y=t.readUByte(),Q=t.readUByte(),ue=t.readUByte(),le=t.readUByte(),be=t.readUByte(),xe=[],Ce=[];for(let kr=0;kr<r;kr++)xe.push(t.readBoolean()),Ce.push(t.readBoolean());if(r>0)for(let kr=r;kr<8;kr++)t.readBits(2);for(let kr=0;kr<r;kr++)xe[kr]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),Ce[kr]&&t.readUByte();t.readUEG();const Ue=t.readUEG();Ue==3&&t.skipBits(1);const qe=t.readUEG(),pt=t.readUEG(),Ye=t.readBoolean();let at=0,nt=0,Ze=0,wt=0;Ye&&(at+=t.readUEG(),nt+=t.readUEG(),Ze+=t.readUEG(),wt+=t.readUEG());const Wt=t.readUEG(),Zt=t.readUEG(),rr=t.readUEG(),Xt=t.readBoolean();for(let kr=Xt?0:r;kr<=r;kr++)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 Ii=0;Ii<4;Ii++)for(let pn=0;pn<(Ii===3?2:6);pn++)if(!t.readBoolean())t.readUEG();else{const kn=Math.min(64,1<<4+(Ii<<1));Ii>1&&t.readEG();for(let Vs=0;Vs<kn;Vs++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const Gt=t.readUEG();let tr=0;for(let kr=0;kr<Gt;kr++){let Ii=!1;if(kr!==0&&(Ii=t.readBoolean()),Ii){kr===Gt&&t.readUEG(),t.readBoolean(),t.readUEG();let pn=0;for(let Ts=0;Ts<=tr;Ts++){const kn=t.readBoolean();let Vs=!1;kn||(Vs=t.readBoolean()),(kn||Vs)&&pn++}tr=pn}else{const pn=t.readUEG(),Ts=t.readUEG();tr=pn+Ts;for(let kn=0;kn<pn;kn++)t.readUEG(),t.readBoolean();for(let kn=0;kn<Ts;kn++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const kr=t.readUEG();for(let Ii=0;Ii<kr;Ii++){for(let pn=0;pn<rr+4;pn++)t.readBits(1);t.readBits(1)}}let Ht=0,jt=1,Er=1,Br=!0,wr=1,Tr=0;t.readBoolean(),t.readBoolean();let ki=!1;if(t.readBoolean()){if(t.readBoolean()){const Ds=t.readUByte(),mu=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],bo=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Ds>0&&Ds<16?(jt=mu[Ds-1],Er=bo[Ds-1]):Ds===255&&(jt=t.readBits(16),Er=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(),ki=t.readBoolean(),ki&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG()),t.readBoolean()&&(wr=t.readBits(32),Tr=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const bo=t.readBoolean(),gu=t.readBoolean();let wa=!1;(bo||gu)&&(wa=t.readBoolean(),wa&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),wa&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let _u=0;_u<=r;_u++){Br=t.readBoolean();const Wh=Br||t.readBoolean();let vu=!1;Wh?t.readEG():vu=t.readBoolean();const yu=vu?1:t.readUEG()+1;if(bo)for(let Ca=0;Ca<yu;Ca++)t.readUEG(),t.readUEG(),wa&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(gu)for(let Ca=0;Ca<yu;Ca++)t.readUEG(),t.readUEG(),wa&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),Ht=t.readUEG())}let dn=qe,Wn=pt;if(Ye){let kr=1,Ii=1;Ue===1?kr=Ii=2:Ue==2&&(kr=2),dn=qe-kr*nt-kr*at,Wn=pt-Ii*wt-Ii*Ze}const As=i?["A","B","C"][i]:"",jh=h<<24|_<<16|g<<8|x;let fl=0;for(let kr=0;kr<32;kr++)fl=(fl|(jh>>kr&1)<<31-kr)>>>0;let dl=fl.toString(16);return a===1&&dl==="2"&&(dl="6"),{codecString:`hvc1.${As}${a}.${dl}.${n?"H":"L"}${be}.B0`,params:{general_tier_flag:n,general_profile_idc:a,general_profile_space:i,general_profile_compatibility_flags:[h,_,g,x],general_constraint_indicator_flags:[D,j,Y,Q,ue,le],general_level_idc:be,bit_depth:Wt+8,bit_depth_luma_minus8:Wt,bit_depth_chroma_minus8:Zt,min_spatial_segmentation_idc:Ht,chroma_format_idc:Ue,frame_rate:{fixed:Br,fps:Tr/wr}},width:dn,height:Wn,pixelRatio:[jt,Er]}}readPPS(e){const t=new It(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(),n=t.readBoolean();let a=1;return n&&i?a=0:n?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 er=188;class lr{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=lr.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(er*5,t-er)+1,i=0;for(;i<r;){let n=!1,a=-1,h=0;for(let _=i;_<t;_+=er)if(e[_]===71&&(t-_===er||e[_+er]===71)){if(h++,a===-1&&(a=_,a!==0&&(r=Math.min(a+er*99,e.length-er)+1)),n||(n=vr(e,_)===0),n&&h>1&&(a===0&&h>2||_+er>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:Nt[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=lr.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=lr.createTrack("audio",i),this._id3Track=lr.createTrack("id3"),this._txtTrack=lr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,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 n;const a=this._videoTrack,h=this._audioTrack,_=this._id3Track,g=this._txtTrack;let x=a.pid,D=a.pesData,j=h.pid,Y=_.pid,Q=h.pesData,ue=_.pesData,le=null,be=this.pmtParsed,xe=this._pmtId,Ce=e.length;if(this.remainderData&&(e=Tt(this.remainderData,e),Ce=e.length,this.remainderData=null),Ce<er&&!i)return this.remainderData=e,{audioTrack:h,videoTrack:a,id3Track:_,textTrack:g};const Ue=Math.max(0,lr.syncOffset(e));Ce-=(Ce-Ue)%er,Ce<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,Ce,e.buffer.byteLength-Ce));let qe=0;for(let Ye=Ue;Ye<Ce;Ye+=er)if(e[Ye]===71){const at=!!(e[Ye+1]&64),nt=vr(e,Ye),Ze=(e[Ye+3]&48)>>4;let wt;if(Ze>1){if(wt=Ye+5+e[Ye+4],wt===Ye+er)continue}else wt=Ye+4;switch(nt){case x:at&&(D&&(n=zr(D,this.logger))&&(this.readyVideoParser(a.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(a,g,n,!1)),D={data:[],size:0}),D&&(D.data.push(e.subarray(wt,Ye+er)),D.size+=Ye+er-wt);break;case j:if(at){if(Q&&(n=zr(Q,this.logger)))switch(h.segmentCodec){case"aac":this.parseAACPES(h,n);break;case"mp3":this.parseMPEGPES(h,n);break;case"ac3":this.parseAC3PES(h,n);break}Q={data:[],size:0}}Q&&(Q.data.push(e.subarray(wt,Ye+er)),Q.size+=Ye+er-wt);break;case Y:at&&(ue&&(n=zr(ue,this.logger))&&this.parseID3PES(_,n),ue={data:[],size:0}),ue&&(ue.data.push(e.subarray(wt,Ye+er)),ue.size+=Ye+er-wt);break;case 0:at&&(wt+=e[wt]+1),xe=this._pmtId=jr(e,wt);break;case xe:{at&&(wt+=e[wt]+1);const Wt=Fr(e,wt,this.typeSupported,r,this.observer,this.logger);x=Wt.videoPid,x>0&&(a.pid=x,a.segmentCodec=Wt.segmentVideoCodec),j=Wt.audioPid,j>0&&(h.pid=j,h.segmentCodec=Wt.segmentAudioCodec),Y=Wt.id3Pid,Y>0&&(_.pid=Y),le!==null&&!be&&(this.logger.warn(`MPEG-TS PMT found at ${Ye} after unknown PID '${le}'. Backtracking to sync byte @${Ue} to parse all TS packets.`),le=null,Ye=Ue-188),be=this.pmtParsed=!0;break}case 17:case 8191:break;default:le=nt;break}}else qe++;qe>0&&Wr(this.observer,new Error(`Found ${qe} TS packet/s that do not start with 0x47`),void 0,this.logger),a.pesData=D,h.pesData=Q,_.pesData=ue;const pt={audioTrack:h,videoTrack:a,id3Track:_,textTrack:g};return i&&this.extractRemainingSamples(pt),pt}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:n}=e,a=r.pesData,h=t.pesData,_=i.pesData;let g;if(a&&(g=zr(a,this.logger))?(this.readyVideoParser(r.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(r,n,g,!0),r.pesData=null)):r.pesData=a,h&&(g=zr(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=zr(_,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),n=this.sampleAes=new mt(this.observer,this.config,t);return this.decrypt(i,n)}readyVideoParser(e){this.videoParser===null&&(e==="avc"?this.videoParser=new $t:e==="hevc"&&(this.videoParser=new Qt))}decrypt(e,t){return new Promise(r=>{const{audioTrack:i,videoTrack:n}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{n.samples?t.decryptAvcSamples(n.samples,0,0,()=>{r(e)}):r(e)}):n.samples&&t.decryptAvcSamples(n.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 n=t.data;if(i){this.aacOverFlow=null;const D=i.missing,j=i.sample.unit.byteLength;if(D===-1)n=Tt(i.sample.unit,n);else{const Y=j-D;i.sample.unit.set(n.subarray(0,D),Y),e.samples.push(i.sample),r=i.missing}}let a,h;for(a=r,h=n.length;a<h-1&&!Bs(n,a);a++);if(a!==r){let D;const j=a<h-1;if(j?D=`AAC PES did not start with ADTS header,offset:${a}`:D="No ADTS header found in AAC PES",Wr(this.observer,new Error(D),j,this.logger),!j)return}da(e,this.observer,n,a,this.audioCodec);let _;if(t.pts!==void 0)_=t.pts;else if(i){const D=Ga(e.samplerate);_=i.sample.pts+D}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let g=0,x;for(;a<h;)if(x=Ka(e,n,a,_,g),a+=x.length,x.missing){this.aacOverFlow=x;break}else for(g++;a<h-1&&!Bs(n,a);a++);}parseMPEGPES(e,t){const r=t.data,i=r.length;let n=0,a=0;const h=t.pts;if(h===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;a<i;)if(p(r,a)){const _=ro(e,r,a,h,n);if(_)a+=_.length,n++;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 n=r.length;let a=0,h=0,_;for(;h<n&&(_=pe(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=u({},t,{type:this._videoTrack?vi.emsg:vi.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(r)}}function vr(o,e){return((o[e+1]&31)<<8)+o[e+2]}function jr(o,e){return(o[e+10]&31)<<8|o[e+11]}function Fr(o,e,t,r,i,n){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 x=vr(o,e),D=(o[e+3]&15)<<8|o[e+4];switch(o[e]){case 207:if(!r){Gr("ADTS AAC",n);break}case 15:a.audioPid===-1&&(a.audioPid=x);break;case 21:a.id3Pid===-1&&(a.id3Pid=x);break;case 219:if(!r){Gr("H.264",n);break}case 27:a.videoPid===-1&&(a.videoPid=x);break;case 3:case 4:!t.mpeg&&!t.mp3?n.log("MPEG audio found, not supported in this browser"):a.audioPid===-1&&(a.audioPid=x,a.segmentAudioCodec="mp3");break;case 193:if(!r){Gr("AC-3",n);break}case 129:t.ac3?a.audioPid===-1&&(a.audioPid=x,a.segmentAudioCodec="ac3"):n.log("AC-3 audio found, not supported in this browser");break;case 6:if(a.audioPid===-1&&D>0){let j=e+5,Y=D;for(;Y>2;){switch(o[j]){case 106:t.ac3!==!0?n.log("AC-3 audio found, not supported in this browser for now"):(a.audioPid=x,a.segmentAudioCodec="ac3");break}const ue=o[j+1]+2;j+=ue,Y-=ue}}break;case 194:case 135:return Wr(i,new Error("Unsupported EC-3 in M2TS found"),void 0,n),a;case 36:a.videoPid===-1&&(a.videoPid=x,a.segmentVideoCodec="hevc",n.log("HEVC in M2TS found"));break}e+=D+5}return a}function Wr(o,e,t,r){r.warn(`parsing error: ${e.message}`),o.emit(d.ERROR,d.ERROR,{type:P.MEDIA_ERROR,details:A.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function Gr(o,e){e.log(`${o} with AES-128-CBC encryption found in unencrypted stream`)}function zr(o,e){let t=0,r,i,n,a,h;const _=o.data;if(!o||o.size===0)return null;for(;_[0].length<19&&_.length>1;)_[0]=Tt(_[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 x=r[7];x&192&&(a=(r[9]&14)*536870912+(r[10]&255)*4194304+(r[11]&254)*16384+(r[12]&255)*128+(r[13]&254)/2,x&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),n=r[8];let D=n+9;if(o.size<=D)return null;o.size-=D;const j=new Uint8Array(o.size);for(let Y=0,Q=_.length;Y<Q;Y++){r=_[Y];let ue=r.byteLength;if(D)if(D>ue){D-=ue;continue}else r=r.subarray(D),ue-=D,D=0;j.set(r,t),t+=ue}return i&&(i-=n+3),{data:j,pts:a,dts:h,len:i}}return null}class yi{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 qr=Math.pow(2,32)-1;class Ve{static init(){Ve.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 Ve.types)Ve.types.hasOwnProperty(e)&&(Ve.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]);Ve.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]),n=new Uint8Array([0,0,0,0,0,0,0,0]);Ve.STTS=Ve.STSC=Ve.STCO=n,Ve.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ve.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Ve.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Ve.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]);Ve.FTYP=Ve.box(Ve.types.ftyp,a,_,a,h),Ve.DINF=Ve.box(Ve.types.dinf,Ve.box(Ve.types.dref,i))}static box(e,...t){let r=8,i=t.length;const n=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<n;i++)a.set(t[i],r),r+=t[i].byteLength;return a}static hdlr(e){return Ve.box(Ve.types.hdlr,Ve.HDLR_TYPES[e])}static mdat(e){return Ve.box(Ve.types.mdat,e)}static mdhd(e,t){t*=e;const r=Math.floor(t/(qr+1)),i=Math.floor(t%(qr+1));return Ve.box(Ve.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 Ve.box(Ve.types.mdia,Ve.mdhd(e.timescale||0,e.duration||0),Ve.hdlr(e.type),Ve.minf(e))}static mfhd(e){return Ve.box(Ve.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"?Ve.box(Ve.types.minf,Ve.box(Ve.types.smhd,Ve.SMHD),Ve.DINF,Ve.stbl(e)):Ve.box(Ve.types.minf,Ve.box(Ve.types.vmhd,Ve.VMHD),Ve.DINF,Ve.stbl(e))}static moof(e,t,r){return Ve.box(Ve.types.moof,Ve.mfhd(e),Ve.traf(r,t))}static moov(e){let t=e.length;const r=[];for(;t--;)r[t]=Ve.trak(e[t]);return Ve.box.apply(null,[Ve.types.moov,Ve.mvhd(e[0].timescale||0,e[0].duration||0)].concat(r).concat(Ve.mvex(e)))}static mvex(e){let t=e.length;const r=[];for(;t--;)r[t]=Ve.trex(e[t]);return Ve.box.apply(null,[Ve.types.mvex,...r])}static mvhd(e,t){t*=e;const r=Math.floor(t/(qr+1)),i=Math.floor(t%(qr+1)),n=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 Ve.box(Ve.types.mvhd,n)}static sdtp(e){const t=e.samples||[],r=new Uint8Array(4+t.length);let i,n;for(i=0;i<t.length;i++)n=t[i].flags,r[i+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return Ve.box(Ve.types.sdtp,r)}static stbl(e){return Ve.box(Ve.types.stbl,Ve.stsd(e),Ve.box(Ve.types.stts,Ve.STTS),Ve.box(Ve.types.stsc,Ve.STSC),Ve.box(Ve.types.stsz,Ve.STSZ),Ve.box(Ve.types.stco,Ve.STCO))}static avc1(e){let t=[],r=[],i,n,a;for(i=0;i<e.sps.length;i++)n=e.sps[i],a=n.byteLength,t.push(a>>>8&255),t.push(a&255),t=t.concat(Array.prototype.slice.call(n));for(i=0;i<e.pps.length;i++)n=e.pps[i],a=n.byteLength,r.push(a>>>8&255),r.push(a&255),r=r.concat(Array.prototype.slice.call(n));const h=Ve.box(Ve.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,x=e.pixelRatio[0],D=e.pixelRatio[1];return Ve.box(Ve.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,Ve.box(Ve.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Ve.box(Ve.types.pasp,new Uint8Array([x>>24,x>>16&255,x>>8&255,x&255,D>>24,D>>16&255,D>>8&255,D&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 Ve.box(Ve.types.mp4a,Ve.audioStsd(e),Ve.box(Ve.types.esds,Ve.esds(e)))}static mp3(e){return Ve.box(Ve.types[".mp3"],Ve.audioStsd(e))}static ac3(e){return Ve.box(Ve.types["ac-3"],Ve.audioStsd(e),Ve.box(Ve.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return Ve.box(Ve.types.stsd,Ve.STSD,Ve.mp4a(e));if(t==="ac3"&&e.config)return Ve.box(Ve.types.stsd,Ve.STSD,Ve.ac3(e));if(t==="mp3"&&e.codec==="mp3")return Ve.box(Ve.types.stsd,Ve.STSD,Ve.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return Ve.box(Ve.types.stsd,Ve.STSD,Ve.avc1(e));if(t==="hevc"&&e.vps)return Ve.box(Ve.types.stsd,Ve.STSD,Ve.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,n=e.height||0,a=Math.floor(r/(qr+1)),h=Math.floor(r%(qr+1));return Ve.box(Ve.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,n>>8&255,n&255,0,0]))}static traf(e,t){const r=Ve.sdtp(e),i=e.id,n=Math.floor(t/(qr+1)),a=Math.floor(t%(qr+1));return Ve.box(Ve.types.traf,Ve.box(Ve.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),Ve.box(Ve.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,a>>24,a>>16&255,a>>8&255,a&255])),Ve.trun(e,r.length+16+20+8+16+8+8),r)}static trak(e){return e.duration=e.duration||4294967295,Ve.box(Ve.types.trak,Ve.tkhd(e),Ve.mdia(e))}static trex(e){const t=e.id;return Ve.box(Ve.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,n=12+16*i,a=new Uint8Array(n);let h,_,g,x,D,j;for(t+=8+n,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,x=_.size,D=_.flags,j=_.cts,a.set([g>>>24&255,g>>>16&255,g>>>8&255,g&255,x>>>24&255,x>>>16&255,x>>>8&255,x&255,D.isLeading<<2|D.dependsOn,D.isDependedOn<<6|D.hasRedundancy<<4|D.paddingValue<<1|D.isNonSync,D.degradPrio&61440,D.degradPrio&15,j>>>24&255,j>>>16&255,j>>>8&255,j&255],12+16*h);return Ve.box(Ve.types.trun,a)}static initSegment(e){Ve.types||Ve.init();const t=Ve.moov(e);return Tt(Ve.FTYP,t)}static hvc1(e){const t=e.params,r=[e.vps,e.sps,e.pps],i=4,n=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=n.length;for(let Q=0;Q<r.length;Q+=1){a+=3;for(let ue=0;ue<r[Q].length;ue+=1)a+=2+r[Q][ue].length}const h=new Uint8Array(a);h.set(n,0),a=n.length;const _=r.length-1;for(let Q=0;Q<r.length;Q+=1){h.set(new Uint8Array([32+Q|(Q===_?128:0),0,r[Q].length]),a),a+=3;for(let ue=0;ue<r[Q].length;ue+=1)h.set(new Uint8Array([r[Q][ue].length>>8,r[Q][ue].length&255]),a),a+=2,h.set(r[Q][ue],a),a+=r[Q][ue].length}const g=Ve.box(Ve.types.hvcC,h),x=e.width,D=e.height,j=e.pixelRatio[0],Y=e.pixelRatio[1];return Ve.box(Ve.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,x>>8&255,x&255,D>>8&255,D&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),g,Ve.box(Ve.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Ve.box(Ve.types.pasp,new Uint8Array([j>>24,j>>16&255,j>>8&255,j&255,Y>>24,Y>>16&255,Y>>8&255,Y&255])))}}Ve.types=void 0,Ve.HDLR_TYPES=void 0,Ve.STTS=void 0,Ve.STSC=void 0,Ve.STCO=void 0,Ve.STSZ=void 0,Ve.VMHD=void 0,Ve.SMHD=void 0,Ve.STSD=void 0,Ve.FTYP=void 0,Ve.DINF=void 0;const Ni=9e4;function hn(o,e,t=1,r=!1){const i=o*e*t;return r?Math.round(i):i}function Zi(o,e,t=1,r=!1){return hn(o,e,1/t,r)}function ri(o,e=!1){return hn(o,1e3,1/Ni,e)}function $n(o,e=1){return hn(o,Ni,1/e)}function fn(o){const{baseTime:e,timescale:t,trackId:r}=o;return`${e/t} (${e}/${t}) trackId: ${r}`}const io=10*1e3,Bo=1024,cs=1152,hs=1536;let Xi=null,fs=null;function Es(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 $s extends M{constructor(e,t,r,i){if(super("mp4-remuxer",i),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=r,this.ISGenerated=!1,Xi===null){const a=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Xi=a?parseInt(a[1]):0}if(fs===null){const n=navigator.userAgent.match(/Safari\/(\d+)/i);fs=n?parseInt(n[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){const t=this._initPTS;(!t||!e||e.trackId!==t.trackId||e.baseTime!==t.baseTime||e.timescale!==t.timescale)&&this.log(`Reset initPTS: ${t&&fn(t)} > ${e&&fn(e)}`),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const r=e[0].pts,i=e.reduce((n,a)=>{let h=a.pts,_=h-n;return _<-4294967296&&(t=!0,h=Ui(h,r),_=h-n),_>0?n:h},r);return t&&this.debug("PTS rollover detected"),i}remux(e,t,r,i,n,a,h,_){let g,x,D,j,Y,Q,ue=n,le=n;const be=e.pid>-1,xe=t.pid>-1,Ce=t.samples.length,Ue=e.samples.length>0,qe=h&&Ce>0||Ce>1;if((!be||Ue)&&(!xe||qe)||this.ISGenerated||h){if(this.ISGenerated){var Ye,at,nt,Ze;const rr=this.videoTrackConfig;(rr&&(t.width!==rr.width||t.height!==rr.height||((Ye=t.pixelRatio)==null?void 0:Ye[0])!==((at=rr.pixelRatio)==null?void 0:at[0])||((nt=t.pixelRatio)==null?void 0:nt[1])!==((Ze=rr.pixelRatio)==null?void 0:Ze[1]))||!rr&&qe||this.nextAudioTs===null&&Ue)&&this.resetInitSegment()}this.ISGenerated||(D=this.generateIS(e,t,n,a));const wt=this.isVideoContiguous;let Wt=-1,Zt;if(qe&&(Wt=No(t.samples),!wt&&this.config.forceKeyFrameOnDiscontinuity))if(Q=!0,Wt>0){this.warn(`Dropped ${Wt} out of ${Ce} video samples due to a missing keyframe`);const rr=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(Wt),t.dropped+=Wt,le+=(t.samples[0].pts-rr)/t.inputTimeScale,Zt=le}else Wt===-1&&(this.warn(`No keyframe found out of ${Ce} video samples`),Q=!1);if(this.ISGenerated){if(Ue&&qe){const rr=this.getVideoStartPts(t.samples),Ut=(Ui(e.samples[0].pts,rr)-rr)/t.inputTimeScale;ue+=Math.max(0,Ut),le+=Math.max(0,-Ut)}if(Ue){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),D=this.generateIS(e,t,n,a)),x=this.remuxAudio(e,ue,this.isAudioContiguous,a,xe||qe||_===S.AUDIO?le:void 0),qe){const rr=x?x.endPTS-x.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),D=this.generateIS(e,t,n,a)),g=this.remuxVideo(t,le,wt,rr)}}else qe&&(g=this.remuxVideo(t,le,wt,0));g&&(g.firstKeyFrame=Wt,g.independent=Wt!==-1,g.firstKeyFramePTS=Zt)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(r.samples.length&&(Y=zs(r,n,this._initPTS,this._initDTS)),i.samples.length&&(j=ba(i,n,this._initPTS))),{audio:x,video:g,initSegment:D,independent:Q,text:j,id3:Y}}computeInitPts(e,t,r,i){const n=Math.round(r*t);let a=Ui(e,n);if(a<n+t)for(this.log(`Adjusting PTS for rollover in timeline near ${(n-a)/t} ${i}`);a<n+t;)a+=8589934592;return a-n}generateIS(e,t,r,i){const n=e.samples,a=t.samples,h=this.typeSupported,_={},g=this._initPTS;let x=!g||i,D="audio/mp4",j,Y,Q,ue=-1;if(x&&(j=Y=1/0),e.config&&n.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":h.mpeg?(D="audio/mpeg",e.codec=""):h.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}_.audio={id:"audio",container:D,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&h.mpeg?new Uint8Array(0):Ve.initSegment([e]),metadata:{channelCount:e.channelCount}},x&&(ue=e.id,Q=e.inputTimeScale,!g||Q!==g.timescale?j=Y=this.computeInitPts(n[0].pts,Q,r,"audio"):x=!1)}if(t.sps&&t.pps&&a.length){if(t.timescale=t.inputTimeScale,_.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Ve.initSegment([t]),metadata:{width:t.width,height:t.height}},x)if(ue=t.id,Q=t.inputTimeScale,!g||Q!==g.timescale){const le=this.getVideoStartPts(a),be=Ui(a[0].dts,le),xe=this.computeInitPts(be,Q,r,"video"),Ce=this.computeInitPts(le,Q,r,"video");Y=Math.min(Y,xe),j=Math.min(j,Ce)}else x=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(_).length)return this.ISGenerated=!0,x?(g&&this.warn(`Timestamps at playlist time: ${i?"":"~"}${r} ${j/Q} != initPTS: ${g.baseTime/g.timescale} (${g.baseTime}/${g.timescale}) trackId: ${g.trackId}`),this.log(`Found initPTS at playlist time: ${r} offset: ${j/Q} (${j}/${Q}) trackId: ${ue}`),this._initPTS={baseTime:j,timescale:Q,trackId:ue},this._initDTS={baseTime:Y,timescale:Q,trackId:ue}):j=Q=void 0,{tracks:_,initPTS:j,timescale:Q,trackId:ue}}remuxVideo(e,t,r,i){const n=e.inputTimeScale,a=e.samples,h=[],_=a.length,g=this._initPTS,x=g.baseTime*n/g.timescale;let D=this.nextVideoTs,j=8,Y=this.videoSampleDuration,Q,ue,le=Number.POSITIVE_INFINITY,be=Number.NEGATIVE_INFINITY,xe=!1;if(!r||D===null){const Ht=x+t*n,jt=a[0].pts-Ui(a[0].dts,a[0].pts);Xi&&D!==null&&Math.abs(Ht-jt-(D+x))<15e3?r=!0:D=Ht-jt-x}const Ce=D+x;for(let Ht=0;Ht<_;Ht++){const jt=a[Ht];jt.pts=Ui(jt.pts,Ce),jt.dts=Ui(jt.dts,Ce),jt.dts<a[Ht>0?Ht-1:Ht].dts&&(xe=!0)}xe&&a.sort(function(Ht,jt){const Er=Ht.dts-jt.dts,Br=Ht.pts-jt.pts;return Er||Br}),Q=a[0].dts,ue=a[a.length-1].dts;const Ue=ue-Q,qe=Ue?Math.round(Ue/(_-1)):Y||e.inputTimeScale/30;if(r){const Ht=Q-Ce,jt=Ht>qe,Er=Ht<-1;if((jt||Er)&&(jt?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${ri(Ht,!0)} ms (${Ht}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${ri(-Ht,!0)} ms (${Ht}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!Er||Ce>=a[0].pts||Xi)){Q=Ce;const Br=a[0].pts-Ht;if(jt)a[0].dts=Q,a[0].pts=Br;else{let wr=!0;for(let Tr=0;Tr<a.length&&!(a[Tr].dts>Br&&wr);Tr++){const ki=a[Tr].pts;if(a[Tr].dts-=Ht,a[Tr].pts-=Ht,Tr<a.length-1){const wi=a[Tr+1].pts,dn=a[Tr].pts,Wn=wi<=dn,As=wi<=ki;wr=Wn==As}}}this.log(`Video: Initial PTS/DTS adjusted: ${ri(Br,!0)}/${ri(Q,!0)}, delta: ${ri(Ht,!0)} ms`)}}Q=Math.max(0,Q);let pt=0,Ye=0,at=Q;for(let Ht=0;Ht<_;Ht++){const jt=a[Ht],Er=jt.units,Br=Er.length;let wr=0;for(let Tr=0;Tr<Br;Tr++)wr+=Er[Tr].data.length;Ye+=wr,pt+=Br,jt.length=wr,jt.dts<at?(jt.dts=at,at+=qe/4|0||1):at=jt.dts,le=Math.min(jt.pts,le),be=Math.max(jt.pts,be)}ue=a[_-1].dts;const nt=Ye+4*pt+8;let Ze;try{Ze=new Uint8Array(nt)}catch(Ht){this.observer.emit(d.ERROR,d.ERROR,{type:P.MUX_ERROR,details:A.REMUX_ALLOC_ERROR,fatal:!1,error:Ht,bytes:nt,reason:`fail allocating video mdat ${nt}`});return}const wt=new DataView(Ze.buffer);wt.setUint32(0,nt),Ze.set(Ve.types.mdat,4);let Wt=!1,Zt=Number.POSITIVE_INFINITY,rr=Number.POSITIVE_INFINITY,Xt=Number.NEGATIVE_INFINITY,Ut=Number.NEGATIVE_INFINITY;for(let Ht=0;Ht<_;Ht++){const jt=a[Ht],Er=jt.units;let Br=0;for(let ki=0,wi=Er.length;ki<wi;ki++){const dn=Er[ki],Wn=dn.data,As=dn.data.byteLength;wt.setUint32(j,As),j+=4,Ze.set(Wn,j),j+=As,Br+=4+As}let wr;if(Ht<_-1)Y=a[Ht+1].dts-jt.dts,wr=a[Ht+1].pts-jt.pts;else{const ki=this.config,wi=Ht>0?jt.dts-a[Ht-1].dts:qe;if(wr=Ht>0?jt.pts-a[Ht-1].pts:qe,ki.stretchShortVideoTrack&&this.nextAudioTs!==null){const dn=Math.floor(ki.maxBufferHole*n),Wn=(i?le+i*n:this.nextAudioTs+x)-jt.pts;Wn>dn?(Y=Wn-wi,Y<0?Y=wi:Wt=!0,this.log(`It is approximately ${Wn/90} ms to the next segment; using duration ${Y/90} ms for the last video frame.`)):Y=wi}else Y=wi}const Tr=Math.round(jt.pts-jt.dts);Zt=Math.min(Zt,Y),Xt=Math.max(Xt,Y),rr=Math.min(rr,wr),Ut=Math.max(Ut,wr),h.push(Es(jt.key,Y,Br,Tr))}if(h.length){if(Xi){if(Xi<70){const Ht=h[0].flags;Ht.dependsOn=2,Ht.isNonSync=0}}else if(fs&&Ut-rr<Xt-Zt&&qe/Xt<.025&&h[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let Ht=Q;for(let jt=0,Er=h.length;jt<Er;jt++){const Br=Ht+h[jt].duration,wr=Ht+h[jt].cts;if(jt<Er-1){const Tr=Br+h[jt+1].cts;h[jt].duration=Tr-wr}else h[jt].duration=jt?h[jt-1].duration:qe;h[jt].cts=0,Ht=Br}}}Y=Wt||!Y?qe:Y;const Jt=ue+Y;this.nextVideoTs=D=Jt-x,this.videoSampleDuration=Y,this.isVideoContiguous=!0;const hr={data1:Ve.moof(e.sequenceNumber++,Q,u(e,{samples:h})),data2:Ze,startPTS:(le-x)/n,endPTS:(be+Y-x)/n,startDTS:(Q-x)/n,endDTS:D/n,type:"video",hasAudio:!1,hasVideo:!0,nb:h.length,dropped:e.dropped};return e.samples=[],e.dropped=0,hr}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return cs;case"ac3":return hs;default:return Bo}}remuxAudio(e,t,r,i,n){const a=e.inputTimeScale,h=e.samplerate?e.samplerate:a,_=a/h,g=this.getSamplesPerFrame(e),x=g*_,D=this._initPTS,j=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,Y=[],Q=n!==void 0;let ue=e.samples,le=j?0:8,be=this.nextAudioTs||-1;const xe=D.baseTime*a/D.timescale,Ce=xe+t*a;if(this.isAudioContiguous=r=r||ue.length&&be>0&&(i&&Math.abs(Ce-(be+xe))<9e3||Math.abs(Ui(ue[0].pts,Ce)-(be+xe))<20*x),ue.forEach(function(Ut){Ut.pts=Ui(Ut.pts,Ce)}),!r||be<0){const Ut=ue.length;if(ue=ue.filter(Jt=>Jt.pts>=0),Ut!==ue.length&&this.warn(`Removed ${ue.length-Ut} of ${Ut} samples (initPTS ${xe} / ${a})`),!ue.length)return;n===0?be=0:i&&!Q?be=Math.max(0,Ce-xe):be=ue[0].pts-xe}if(e.segmentCodec==="aac"){const Ut=this.config.maxAudioFramesDrift;for(let Jt=0,Gt=be+xe;Jt<ue.length;Jt++){const tr=ue[Jt],hr=tr.pts,Ht=hr-Gt,jt=Math.abs(1e3*Ht/a);if(Ht<=-Ut*x&&Q)Jt===0&&(this.warn(`Audio frame @ ${(hr/a).toFixed(3)}s overlaps marker by ${Math.round(1e3*Ht/a)} ms.`),this.nextAudioTs=be=hr-xe,Gt=hr);else if(Ht>=Ut*x&&jt<io&&Q){let Er=Math.round(Ht/x);for(Gt=hr-Er*x;Gt<0&&Er&&x;)Er--,Gt+=x;Jt===0&&(this.nextAudioTs=be=Gt-xe),this.warn(`Injecting ${Er} audio frames @ ${((Gt-xe)/a).toFixed(3)}s due to ${Math.round(1e3*Ht/a)} ms gap.`);for(let Br=0;Br<Er;Br++){let wr=yi.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);wr||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),wr=tr.unit.subarray()),ue.splice(Jt,0,{unit:wr,pts:Gt}),Gt+=x,Jt++}}tr.pts=Gt,Gt+=x}}let Ue=null,qe=null,pt,Ye=0,at=ue.length;for(;at--;)Ye+=ue[at].unit.byteLength;for(let Ut=0,Jt=ue.length;Ut<Jt;Ut++){const Gt=ue[Ut],tr=Gt.unit;let hr=Gt.pts;if(qe!==null){const jt=Y[Ut-1];jt.duration=Math.round((hr-qe)/_)}else if(r&&e.segmentCodec==="aac"&&(hr=be+xe),Ue=hr,Ye>0){Ye+=le;try{pt=new Uint8Array(Ye)}catch(jt){this.observer.emit(d.ERROR,d.ERROR,{type:P.MUX_ERROR,details:A.REMUX_ALLOC_ERROR,fatal:!1,error:jt,bytes:Ye,reason:`fail allocating audio mdat ${Ye}`});return}j||(new DataView(pt.buffer).setUint32(0,Ye),pt.set(Ve.types.mdat,4))}else return;pt.set(tr,le);const Ht=tr.byteLength;le+=Ht,Y.push(Es(!0,g,Ht,0)),qe=hr}const nt=Y.length;if(!nt)return;const Ze=Y[Y.length-1];be=qe-xe,this.nextAudioTs=be+_*Ze.duration;const wt=j?new Uint8Array(0):Ve.moof(e.sequenceNumber++,Ue/_,u({},e,{samples:Y}));e.samples=[];const Wt=(Ue-xe)/a,Zt=this.nextAudioTs/a,Xt={data1:wt,data2:pt,startPTS:Wt,endPTS:Zt,startDTS:Wt,endDTS:Zt,type:"audio",hasAudio:!0,hasVideo:!1,nb:nt};return this.isAudioContiguous=!0,Xt}}function Ui(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 No(o){for(let e=0;e<o.length;e++)if(o[e].key)return e;return-1}function zs(o,e,t,r){const i=o.samples.length;if(!i)return;const n=o.inputTimeScale;for(let h=0;h<i;h++){const _=o.samples[h];_.pts=Ui(_.pts-t.baseTime*n/t.timescale,e*n)/n,_.dts=Ui(_.dts-r.baseTime*n/r.timescale,e*n)/n}const a=o.samples;return o.samples=[],{samples:a}}function ba(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=Ui(h.pts-t.baseTime*i/t.timescale,e*i)/i}o.samples.sort((a,h)=>a.pts-h.pts);const n=o.samples;return o.samples=[],{samples:n}}class no extends M{constructor(e,t,r,i){super("passthrough-remuxer",i),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;const t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,r,i){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(e,i),this.emitInitSegment=!0}generateInitSegment(e,t){let{audioCodec:r,videoCodec:i}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const{audio:n,video:a}=this.initData=Je(e);if(t)gt(e,t);else{const _=n||a;_!=null&&_.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${_.codec}")!`)}n&&(r=pl(n,ne.AUDIO,this)),a&&(i=pl(a,ne.VIDEO,this));const h={};n&&a?h.audiovideo={container:"video/mp4",codec:r+","+i,supplemental:a.supplemental,encrypted:a.encrypted,initSegment:e,id:"main"}:n?h.audio={container:"audio/mp4",codec:r,encrypted:n.encrypted,initSegment:e,id:"audio"}:a?h.video={container:"video/mp4",codec:i,supplemental:a.supplemental,encrypted:a.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=h}remux(e,t,r,i,n,a){var h,_;let{initPTS:g,lastEndTime:x}=this;const D={audio:void 0,video:void 0,text:i,id3:r,initSegment:void 0};R(x)||(x=this.lastEndTime=n||0);const j=t.samples;if(!j.length)return D;const Y={initPTS:void 0,timescale:void 0,trackId:void 0};let Q=this.initData;if((h=Q)!=null&&h.length||(this.generateInitSegment(j),Q=this.initData),!((_=Q)!=null&&_.length))return this.warn("Failed to generate initSegment."),D;this.emitInitSegment&&(Y.tracks=this.initTracks,this.emitInitSegment=!1);const ue=vt(j,Q,this),le=Q.audio?ue[Q.audio.id]:null,be=Q.video?ue[Q.video.id]:null,xe=xs(be,1/0),Ce=xs(le,1/0),Ue=xs(be,0,!0),qe=xs(le,0,!0);let pt=n,Ye=0;const at=le&&(!be||!g&&Ce<xe||g&&g.trackId===Q.audio.id),nt=at?le:be;if(nt){const Gt=nt.timescale,tr=nt.start-n*Gt,hr=at?Q.audio.id:Q.video.id;pt=nt.start/Gt,Ye=at?qe-Ce:Ue-xe,(a||!g)&&(Hs(g,pt,n,Ye)||Gt!==g.timescale)&&(g&&this.warn(`Timestamps at playlist time: ${a?"":"~"}${n} ${tr/Gt} != initPTS: ${g.baseTime/g.timescale} (${g.baseTime}/${g.timescale}) trackId: ${g.trackId}`),this.log(`Found initPTS at playlist time: ${n} offset: ${pt-n} (${tr}/${Gt}) trackId: ${hr}`),g=null,Y.initPTS=tr,Y.timescale=Gt,Y.trackId=hr)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${n}`);g?(Y.initPTS=g.baseTime,Y.timescale=g.timescale,Y.trackId=g.trackId):((!Y.timescale||Y.trackId===void 0||Y.initPTS===void 0)&&(this.warn("Could not set initPTS"),Y.initPTS=pt,Y.timescale=1,Y.trackId=-1),this.initPTS=g={baseTime:Y.initPTS,timescale:Y.timescale,trackId:Y.trackId});const Ze=pt-g.baseTime/g.timescale,wt=Ze+Ye;Ye>0?this.lastEndTime=wt:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const Wt=!!Q.audio,Zt=!!Q.video;let rr="";Wt&&(rr+="audio"),Zt&&(rr+="video");const Xt=(Q.audio?Q.audio.encrypted:!1)||(Q.video?Q.video.encrypted:!1),Ut={data1:j,startPTS:Ze,startDTS:Ze,endPTS:wt,endDTS:wt,type:rr,hasAudio:Wt,hasVideo:Zt,nb:1,dropped:0,encrypted:Xt};D.audio=Wt&&!Zt?Ut:void 0,D.video=Zt?Ut:void 0;const Jt=be==null?void 0:be.sampleCount;if(Jt){const Gt=be.keyFrameIndex,tr=Gt!==-1;Ut.nb=Jt,Ut.dropped=Gt===0||this.isVideoContiguous?0:tr?Gt:Jt,Ut.independent=tr,Ut.firstKeyFrame=Gt,tr&&be.keyFrameStart&&(Ut.firstKeyFramePTS=(be.keyFrameStart-g.baseTime)/g.timescale),this.isVideoContiguous||(D.independent=tr),this.isVideoContiguous||(this.isVideoContiguous=tr),Ut.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${Gt}/${Jt} dropped: ${Ut.dropped} start: ${Ut.firstKeyFramePTS||"NA"}`)}return D.initSegment=Y,D.id3=zs(r,n,g,g),i.samples.length&&(D.text=ba(i,n,g)),D}}function xs(o,e,t=!1){return(o==null?void 0:o.start)!==void 0?(o.start+(t?o.duration:0))/o.timescale:e}function Hs(o,e,t,r){if(o===null)return!0;const i=Math.max(r,1),n=e-o.baseTime/o.timescale;return Math.abs(n-t)>i}function pl(o,e,t){const r=o.codec;return r&&r.length>4?r:e===ne.AUDIO?r==="ec-3"||r==="ac-3"||r==="alac"?r:r==="fLaC"||r==="Opus"?ve(r,!1):(t.warn(`Unhandled audio codec "${r}" in mp4 MAP`),r||"mp4a"):(t.warn(`Unhandled video codec "${r}" in mp4 MAP`),r||"avc1")}let Qn;try{Qn=self.performance.now.bind(self.performance)}catch(o){Qn=Date.now}const so=[{demux:je,remux:no},{demux:lr,remux:$s},{demux:L,remux:$s},{demux:ye,remux:$s}];so.splice(2,0,{demux:ee,remux:$s});class ml{constructor(e,t,r,i,n,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=n,this.logger=a}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,r,i){const n=r.transmuxing;n.executeStart=Qn();let a=new Uint8Array(e);const{currentTransmuxState:h,transmuxConfig:_}=this;i&&(this.currentTransmuxState=i);const{contiguous:g,discontinuity:x,trackSwitch:D,accurateTimeOffset:j,timeOffset:Y,initSegmentChange:Q}=i||h,{audioCodec:ue,videoCodec:le,defaultInitPts:be,duration:xe,initSegmentData:Ce}=_,Ue=xu(a,t);if(Ue&&Hi(Ue.method)){const at=this.getDecrypter(),nt=Fn(Ue.method);if(at.isSync()){let Ze=at.softwareDecrypt(a,Ue.key.buffer,Ue.iv.buffer,nt);if(r.part>-1){const Wt=at.flush();Ze=Wt&&Wt.buffer}if(!Ze)return n.executeEnd=Qn(),Uo(r);a=new Uint8Array(Ze)}else return this.asyncResult=!0,this.decryptionPromise=at.webCryptoDecrypt(a,Ue.key.buffer,Ue.iv.buffer,nt).then(Ze=>{const wt=this.push(Ze,null,r);return this.decryptionPromise=null,wt}),this.decryptionPromise}const qe=this.needsProbing(x,D);if(qe){const at=this.configureTransmuxer(a);if(at)return this.logger.warn(`[transmuxer] ${at.message}`),this.observer.emit(d.ERROR,d.ERROR,{type:P.MEDIA_ERROR,details:A.FRAG_PARSING_ERROR,fatal:!1,error:at,reason:at.message}),n.executeEnd=Qn(),Uo(r)}(x||D||Q||qe)&&this.resetInitSegment(Ce,ue,le,xe,t),(x||Q||qe)&&this.resetInitialTimestamp(be),g||this.resetContiguity();const pt=this.transmux(a,Ue,Y,j,r);this.asyncResult=Sa(pt);const Ye=this.currentTransmuxState;return Ye.contiguous=!0,Ye.discontinuity=!1,Ye.trackSwitch=!1,n.executeEnd=Qn(),pt}flush(e){const t=e.transmuxing;t.executeStart=Qn();const{decrypter:r,currentTransmuxState:i,decryptionPromise:n}=this;if(n)return this.asyncResult=!0,n.then(()=>this.flush(e));const a=[],{timeOffset:h}=i;if(r){const D=r.flush();D&&a.push(this.push(D.buffer,null,e))}const{demuxer:_,remuxer:g}=this;if(!_||!g){t.executeEnd=Qn();const D=[Uo(e)];return this.asyncResult?Promise.resolve(D):D}const x=_.flush(h);return Sa(x)?(this.asyncResult=!0,x.then(D=>(this.flushRemux(a,D,e),a))):(this.flushRemux(a,x,e),this.asyncResult?Promise.resolve(a):a)}flushRemux(e,t,r){const{audioTrack:i,videoTrack:n,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===S.MAIN?"level":"track"} ${r.level}`);const x=this.remuxer.remux(i,n,a,h,g,_,!0,this.id);e.push({remuxResult:x,chunkMeta:r}),r.transmuxing.executeEnd=Qn()}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,n){const{demuxer:a,remuxer:h}=this;!a||!h||(a.resetInitSegment(e,t,r,i),h.resetInitSegment(e,t,r,n))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,r,i,n){let a;return t&&t.method==="SAMPLE-AES"?a=this.transmuxSampleAes(e,t,r,i,n):a=this.transmuxUnencrypted(e,r,i,n),a}transmuxUnencrypted(e,t,r,i){const{audioTrack:n,videoTrack:a,id3Track:h,textTrack:_}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(n,a,h,_,t,r,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,r,i,n){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:n}))}configureTransmuxer(e){const{config:t,observer:r,typeSupported:i}=this;let n;for(let D=0,j=so.length;D<j;D++){var a;if((a=so[D].demux)!=null&&a.probe(e,this.logger)){n=so[D];break}}if(!n)return new Error("Failed to find demuxer by probing fragment data");const h=this.demuxer,_=this.remuxer,g=n.remux,x=n.demux;(!_||!(_ instanceof g))&&(this.remuxer=new g(r,t,i,this.logger)),(!h||!(h instanceof x))&&(this.demuxer=new x(r,t,i,this.logger),this.probe=x.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Xr(this.config)),e}}function xu(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 Uo=o=>({remuxResult:{},chunkMeta:o});function Sa(o){return"then"in o&&o.then instanceof Function}class wu{constructor(e,t,r,i,n){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=n||null}}class Cu{constructor(e,t,r,i,n,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=n,this.initSegmentChange=a}}let gl=0;class _l{constructor(e,t,r,i){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=gl++,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,x=this.hls;if(!(!x||!(g!=null&&g.event)||g.instanceNo!==this.instanceNo))switch(g.event){case"init":{var D;const j=(D=this.workerContext)==null?void 0:D.objectURL;j&&self.URL.revokeObjectURL(j);break}case"transmuxComplete":{this.handleTransmuxComplete(g.data);break}case"flush":{this.onFlush(g.data);break}case"workerLog":{x.logger[g.data.logType]&&x.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,x.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:P.OTHER_ERROR,details:A.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:g})};const n=e.config;this.hls=e,this.id=t,this.useWorker=!!n.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 Ms,this.observer.on(d.FRAG_DECRYPTED,a),this.observer.on(d.ERROR,a);const h=qt(n.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const _=this.hls.logger;if(n.workerPath||$a()){try{n.workerPath?(_.log(`loading Web Worker ${n.workerPath} for "${t}"`),this.workerContext=za(n.workerPath)):(_.log(`injecting Web Worker for "${t}"`),this.workerContext=Do());const{worker:x}=this.workerContext;x.addEventListener("message",this.onWorkerMessage),x.addEventListener("error",this.onWorkerError),x.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:h,id:t,config:ir(n)})}catch(x){_.warn(`Error setting up "${t}" Web Worker, fallback to inline`,x),this.terminateWorker(),this.error=null,this.transmuxer=new ml(this.observer,h,n,"",t,e.logger)}return}}this.transmuxer=new ml(this.observer,h,n,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=gl++;const t=this.hls.config,r=qt(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:r,id:this.id,config:ir(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),Ro(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,n,a,h,_,g,x){var D,j;g.transmuxing.start=self.performance.now();const{instanceNo:Y,transmuxer:Q}=this,ue=a?a.start:n.start,le=n.decryptdata,be=this.frag,xe=!(be&&n.cc===be.cc),Ce=!(be&&g.level===be.level),Ue=be?g.sn-be.sn:-1,qe=this.part?g.part-this.part.index:-1,pt=Ue===0&&g.id>1&&g.id===(be==null?void 0:be.stats.chunkCount),Ye=!Ce&&(Ue===1||Ue===0&&(qe===1||pt&&qe<=0)),at=self.performance.now();(Ce||Ue||n.stats.parsing.start===0)&&(n.stats.parsing.start=at),a&&(qe||!Ye)&&(a.stats.parsing.start=at);const nt=!(be&&((D=n.initSegment)==null?void 0:D.url)===((j=be.initSegment)==null?void 0:j.url)),Ze=new Cu(xe,Ye,_,Ce,ue,nt);if(!Ye||xe||nt){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${n.type} sn: ${g.sn}${g.part>-1?" part: "+g.part:""} ${this.id===S.MAIN?"level":"track"}: ${g.level} id: ${g.id}
|
|
|
discontinuity: ${xe}
|
|
|
trackSwitch: ${Ce}
|
|
|
contiguous: ${Ye}
|
|
|
accurateTimeOffset: ${_}
|
|
|
timeOffset: ${ue}
|
|
|
initSegmentChange: ${nt}`);const wt=new wu(r,i,t,h,x);this.configureTransmuxer(wt)}if(this.frag=n,this.part=a,this.workerContext)this.workerContext.worker.postMessage({instanceNo:Y,cmd:"demux",data:e,decryptdata:le,chunkMeta:g,state:Ze},e instanceof ArrayBuffer?[e]:[]);else if(Q){const wt=Q.push(e,le,g,Ze);Sa(wt)?wt.then(Wt=>{this.handleTransmuxComplete(Wt)}).catch(Wt=>{this.transmuxerError(Wt,g,"transmuxer-interface push error")}):this.handleTransmuxComplete(wt)}}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);Sa(i)?i.then(n=>{this.handleFlushResult(n,e)}).catch(n=>{this.transmuxerError(n,e,"transmuxer-interface flush error")}):this.handleFlushResult(i,e)}}transmuxerError(e,t,r){this.hls&&(this.error=e,this.hls.trigger(d.ERROR,{type:P.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 vl=100;class Au extends _s{constructor(e,t,r){super(e,t,r,"audio-stream-controller",S.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:n,trackId:a}){if(r===S.MAIN){const h=t.cc,_=this.fragCurrent;if(this.initPTS[h]={baseTime:i,timescale:n,trackId:a},this.log(`InitPTS for cc: ${h} found from main: ${i/n} (${i}/${n}) trackId: ${a}`),this.mainAnchor=t,this.state===Et.WAITING_INIT_PTS){const g=this.waitingData;(!g&&!this.loadingParts||g&&g.frag.cc!==h)&&this.syncWithAnchor(t,g==null?void 0:g.frag)}else!this.hls.hasEnoughToStart&&_&&_.cc!==h?(_.abortRequests(),this.syncWithAnchor(t,_)):this.state===Et.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var r;const i=((r=this.mainFragLoading)==null?void 0:r.frag)||null;if(t&&(i==null?void 0:i.cc)===t.cc)return;const n=(i||e).cc,a=this.getLevelDetails(),h=this.getLoadPosition(),_=vn(a,n,h);_&&(this.log(`Syncing with main frag at ${_.start} cc ${_.cc}`),this.startFragRequested=!1,this.nextLoadPosition=_.start,this.resetLoadingState(),this.state===Et.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=Et.STOPPED;return}const r=this.lastCurrentTime;this.stopLoad(),this.setInterval(vl),r>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r,this.state=Et.IDLE):this.state=Et.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case Et.IDLE:this.doTickIdle();break;case Et.WAITING_TRACK:{const{levels:e,trackId:t}=this,r=e==null?void 0:e[t],i=r==null?void 0:r.details;if(i&&!this.waitForLive(r)){if(this.waitForCdnTuneIn(i))break;this.state=Et.WAITING_INIT_PTS}break}case Et.FRAG_LOADING_WAITING_RETRY:{this.checkRetryDate();break}case Et.WAITING_INIT_PTS:{const e=this.waitingData;if(e){const{frag:t,part:r,cache:i,complete:n}=e,a=this.mainAnchor;if(this.initPTS[t.cc]!==void 0){this.waitingData=null,this.state=Et.FRAG_LOADING;const h=i.flush().buffer,_={frag:t,part:r,payload:h,networkDetails:null};this._handleFragmentLoadProgress(_),n&&super._handleFragmentLoadComplete(_)}else a&&a.cc!==e.frag.cc&&this.syncWithAnchor(a,e.frag)}else this.state=Et.IDLE}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:r,media:i,trackId:n}=this,a=t.config;if(!this.buffering||!i&&!this.primaryPrefetch&&(this.startFragRequested||!a.startFragPrefetch)||!(r!=null&&r[n]))return;const h=r[n],_=h.details;if(!_||this.waitForLive(h)||this.waitForCdnTuneIn(_)){this.state=Et.WAITING_TRACK,this.startFragRequested=!1;return}const g=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&g&&(this.bufferFlushed=!1,this.afterBufferFlushed(g,ne.AUDIO,S.AUDIO));const x=this.getFwdBufferInfo(g,S.AUDIO);if(x===null)return;if(!this.switchingTrack&&this._streamEnded(x,_)){t.trigger(d.BUFFER_EOS,{type:"audio"}),this.state=Et.ENDED;return}const D=x.len,j=t.maxBufferLength,Y=_.fragments,Q=Y[0].start,ue=this.getLoadPosition(),le=this.flushing?ue:x.end;if(this.switchingTrack&&i){const Ce=ue;_.PTSKnown&&Ce<Q&&(x.end>Q||x.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=Q+.05)}if(D>=j&&!this.switchingTrack&&le<Y[Y.length-1].start)return;let be=this.getNextFragment(le,_);if(be&&this.isLoopLoading(be,le)&&(be=this.getNextFragmentLoopLoading(be,_,x,S.MAIN,j)),!be){this.bufferFlushed=!0;return}let xe=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&xe&&Oe(be)&&!be.endList&&(!_.live||!this.loadingParts&&le<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(xe)===$r.OK&&(this.mainFragLoading=xe=null),xe&&Oe(xe))){if(be.start>xe.end){const Ue=this.fragmentTracker.getFragAtPos(le,S.MAIN);Ue&&Ue.end>xe.end&&(xe=Ue,this.mainFragLoading={frag:Ue,targetBufferTime:null})}if(be.start>xe.end)return}this.loadFragment(be,h,le)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(r=>new br(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!==Et.STOPPED&&(this.setInterval(vl),this.state=Et.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:n,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||n.endCC>g.endCC||g.expired){this.cachedTrackLoadedData=t,this.state!==Et.STOPPED&&(this.state=Et.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${a} "${_.name}" of "${h}" loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""},duration:${n.totalduration}`);const x=i[a];let D=0;if(n.live||(r=x.details)!=null&&r.live){if(this.checkLiveUpdate(n),n.deltaUpdateFailed)return;if(x.details){var j;D=this.alignPlaylists(n,x.details,(j=this.levelLastLoaded)==null?void 0:j.details)}n.alignedSliding||(Os(n,g),n.alignedSliding||ss(n,g),D=n.fragmentStart)}x.details=n,this.levelLastLoaded=x,this.startFragRequested||this.setStartPosition(g,D),this.hls.trigger(d.AUDIO_TRACK_UPDATED,{details:n,id:a,groupId:t.groupId}),this.state===Et.WAITING_TRACK&&!this.waitForCdnTuneIn(n)&&(this.state=Et.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:i,payload:n}=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 x=g.details;if(!x){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(r.start);return}const D=a.defaultAudioCodec||g.audioCodec||"mp4a.40.2";let j=this.transmuxer;j||(j=this.transmuxer=new _l(this.hls,S.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const Y=this.initPTS[r.cc],Q=(t=r.initSegment)==null?void 0:t.data;if(Y!==void 0){const le=i?i.index:-1,be=le!==-1,xe=new rn(r.level,r.sn,r.stats.chunkCount,n.byteLength,le,be);j.push(n,Q,D,"",r,i,x.totalduration,!1,xe,Y)}else{this.log(`Unknown video PTS for cc ${r.cc}, waiting for video PTS before demuxing audio frag ${r.sn} of [${x.startSN} ,${x.endSN}],track ${h}`);const{cache:ue}=this.waitingData=this.waitingData||{frag:r,part:i,cache:new ua,complete:!1};ue.push(new Uint8Array(n)),this.state!==Et.STOPPED&&(this.state=Et.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===S.MAIN&&Oe(t.frag)&&(this.mainFragLoading=t,this.state===Et.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:r,part:i}=t;if(r.type!==S.AUDIO){!this.audioOnly&&r.type===S.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(Oe(r)){this.fragPrevious=r;const n=this.switchingTrack;n&&(this.bufferedTrack=n,this.switchingTrack=null,this.hls.trigger(d.AUDIO_TRACK_SWITCHED,c({},n)))}this.fragBufferedComplete(r,i),this.media&&this.tick()}onError(e,t){var r;if(t.fatal){this.state=Et.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(S.AUDIO,t);break;case A.AUDIO_TRACK_LOAD_ERROR:case A.AUDIO_TRACK_LOAD_TIMEOUT:case A.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===Et.WAITING_TRACK&&((r=t.context)==null?void 0:r.type)===U.AUDIO_TRACK&&(this.state=Et.IDLE);break;case A.BUFFER_ADD_CODEC_ERROR:case A.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)||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!==ne.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==ne.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===Et.ENDED&&(this.state=Et.IDLE);const r=this.mediaBuffer||this.media;r&&(this.afterBufferFlushed(r,t,S.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const r="audio",{hls:i}=this,{remuxResult:n,chunkMeta:a}=e,h=this.getCurrentContext(a);if(!h){this.resetWhenMissingContext(a);return}const{frag:_,part:g,level:x}=h,{details:D}=x,{audio:j,text:Y,id3:Q,initSegment:ue}=n;if(this.fragContextChanged(_)||!D){this.fragmentTracker.removeFragment(_);return}if(this.state=Et.PARSING,this.switchingTrack&&j&&this.completeAudioSwitch(this.switchingTrack),ue!=null&&ue.tracks){const le=_.initSegment||_;if(this.unhandledEncryptionError(ue,_))return;this._bufferInitSegment(x,ue.tracks,le,a),i.trigger(d.FRAG_PARSING_INIT_SEGMENT,{frag:le,id:r,tracks:ue.tracks})}if(j){const{startPTS:le,endPTS:be,startDTS:xe,endDTS:Ce}=j;g&&(g.elementaryStreams[ne.AUDIO]={startPTS:le,endPTS:be,startDTS:xe,endDTS:Ce}),_.setElementaryStreamInfo(ne.AUDIO,le,be,xe,Ce),this.bufferFragmentData(j,_,g,a)}if(Q!=null&&(t=Q.samples)!=null&&t.length){const le=u({id:r,frag:_,details:D},Q);i.trigger(d.FRAG_PARSING_METADATA,le)}if(Y){const le=u({id:r,frag:_,details:D},Y);i.trigger(d.FRAG_PARSING_USERDATA,le)}}_bufferInitSegment(e,t,r,i){if(this.state!==Et.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const n=t.audio;n.id=S.AUDIO;const a=e.audioCodec;this.log(`Init audio buffer, container:${n.container}, codecs[level/parsed]=[${a}/${n.codec}]`),a&&a.split(",").length===1&&(n.levelCodec=a),this.hls.trigger(d.BUFFER_CODECS,t);const h=n.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===$r.NOT_LOADED||i===$r.PARTIAL){var n;if(!Oe(e))this._loadInitSegment(e,t);else if((n=t.details)!=null&&n.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=Et.WAITING_INIT_PTS;const a=this.mainDetails;a&&a.fragmentStart!==t.details.fragmentStart&&ss(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:n,audioCodec:a,channels:h}=this.bufferedTrack;$i({name:t,lang:r,assocLang:i,characteristics:n,audioCodec:a,channels:h},e,si)||(mn(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,c({},e))}}class $o extends M{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 n=-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){n=a;break}else _===e.substring(0,_.length)&&(n=a)}if(n!==-1){const a=i[n],h=parseInt(a["LAST-MSN"])||t.lastPartSn;let _=parseInt(a["LAST-PART"])||t.lastPartIndex;if(this.hls.config.lowLatencyMode){const x=Math.min(t.age-t.partTarget,t.targetduration);_>=0&&x>t.partTarget&&(_+=1)}const g=r&&bi(r);return new fi(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:n}=t,a=self.performance.now(),h=n.loading.first?Math.max(0,a-n.loading.first):0;i.advancedDateTime=Date.now()-h;const _=this.hls.config.timelineOffset;if(_!==i.appliedTimelineOffset){const x=Math.max(_||0,0);i.appliedTimelineOffset=x,i.fragments.forEach(D=>{D.setStart(D.playlistOffset+x)})}if(i.live||r!=null&&r.live){const x="levelInfo"in t?t.levelInfo:t.track;if(i.reloaded(r),r&&i.fragments.length>0){ka(r,i,this);const xe=i.playlistParsingError;if(xe){this.warn(xe);const Ce=this.hls;if(!Ce.config.ignorePlaylistParsingErrors){var g;const{networkDetails:Ue}=t;Ce.trigger(d.ERROR,{type:P.NETWORK_ERROR,details:A.LEVEL_PARSING_ERROR,fatal:!1,url:i.url,error:xe,reason:xe.message,level:t.level||void 0,parent:(g=i.fragments[0])==null?void 0:g.type,networkDetails:Ue,stats:n});return}i.playlistParsingError=null}}i.requestScheduled===-1&&(i.requestScheduled=n.loading.start);const D=this.hls.mainForwardBufferInfo,j=D?D.end-D.len:0,Y=(i.edge-j)*1e3,Q=Dn(i,Y);if(i.requestScheduled+Q<a?i.requestScheduled=a:i.requestScheduled+=Q,this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),!this.canLoad||!i.live)return;let ue,le,be;if(i.canBlockReload&&i.endSN&&i.advanced){const xe=this.hls.config.lowLatencyMode,Ce=i.lastPartSn,Ue=i.endSN,qe=i.lastPartIndex,pt=qe!==-1,Ye=Ce===Ue;pt?Ye?(le=Ue+1,be=xe?0:qe):(le=Ce,be=xe?qe+1:i.maxPartIndex):le=Ue+1;const at=i.age,nt=at+i.ageHeader;let Ze=Math.min(nt-i.partTarget,i.targetduration*1.5);if(Ze>0){if(nt>i.targetduration*3)this.log(`Playlist last advanced ${at.toFixed(2)}s ago. Omitting segment and part directives.`),le=void 0,be=void 0;else if(r!=null&&r.tuneInGoal&&nt-i.partTarget>r.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${r.tuneInGoal} to: ${Ze} with playlist age: ${i.age}`),Ze=0;else{const wt=Math.floor(Ze/i.targetduration);if(le+=wt,be!==void 0){const Wt=Math.round(Ze%i.targetduration/i.partTarget);be+=Wt}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${at.toFixed(2)}s goal: ${Ze} skip sn ${wt} to part ${be}`)}i.tuneInGoal=Ze}if(ue=this.getDeliveryDirectives(i,t.deliveryDirectives,le,be),xe||!Ye){i.requestScheduled=a,this.loadingPlaylist(x,ue);return}}else(i.canBlockReload||i.canSkipUntil)&&(ue=this.getDeliveryDirectives(i,t.deliveryDirectives,le,be));ue&&le!==void 0&&i.canBlockReload&&(i.requestScheduled=n.loading.first+Math.max(Q-h*2,Q/2)),this.scheduleLoading(x,ue,i)}else this.clearTimer()}scheduleLoading(e,t,r){const i=r||e.details;if(!i){this.loadingPlaylist(e,t);return}const n=self.performance.now(),a=i.requestScheduled;if(n>=a){this.loadingPlaylist(e,t);return}const h=a-n;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 n=bi(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(r=t.msn,i=t.part,n=Rr.No),new fi(r,i,n)}checkRetry(e){const t=e.details,r=Pi(e),i=e.errorAction,{action:n,retryCount:a=0,retryConfig:h}=i||{},_=!!i&&!!h&&(n===ur.RetryRequest||!i.resolved&&n===ur.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 x=Vr(h,a);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),x),this.warn(`Retrying playlist loading ${a+1}/${h.maxNumRetry} after "${t}" in ${x}ms`)}e.levelRetry=!0,i.resolved=!0}return _}}function yl(o,e){if(o.length!==e.length)return!1;for(let t=0;t<o.length;t++)if(!Ea(o[t].attrs,e[t].attrs))return!1;return!0}function Ea(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 zo(o,e){return e.label.toLowerCase()===o.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(o.lang||"").toLowerCase())}class Tu extends $o{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:n}=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 [${n.startSN}-${n.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 n=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(j=>!r||r.indexOf(j.groupId)!==-1);if(h.length)this.selectDefaultTrack&&!h.some(j=>j.default)&&(this.selectDefaultTrack=!1),h.forEach((j,Y)=>{j.id=Y});else if(!n&&!this.tracksInGroup.length)return;this.tracksInGroup=h;const _=this.hls.config.audioPreference;if(!n&&_){const j=Ci(_,h,si);if(j>-1)n=h[j];else{const Y=Ci(_,this.tracks);n=this.tracks[Y]}}let g=this.findTrackId(n);g===-1&&n&&(g=this.findTrackId(null));const x={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,x);const D=this.trackId;if(g!==-1&&D===-1)this.setAudioTrack(g);else if(h.length&&D===-1){var a;const j=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(j.message),this.hls.trigger(d.ERROR,{type:P.MEDIA_ERROR,details:A.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:j})}}}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&&$i(e,i,si))return i;const n=Ci(e,this.tracksInGroup,si);if(n>-1){const a=this.tracksInGroup[n];return this.setAudioTrack(n),a}else if(i){let a=t.loadLevel;a===-1&&(a=t.firstAutoLevel);const h=Ir(e,t.levels,r,a,si);if(h===-1)return null;t.nextLoadLevel=h}if(e.channels||e.audioCodec){const a=Ci(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],n=i.details&&!i.details.live;if(e===this.trackId&&i===r&&n||(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,c({},i)),n))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||$i(e,i,si)))return r}if(e){const{name:r,lang:i,assocLang:n,characteristics:a,audioCodec:h,channels:_}=e;for(let g=0;g<t.length;g++){const x=t[g];if($i({name:r,lang:i,assocLang:n,characteristics:a,audioCodec:h,channels:_},x,si))return g}for(let g=0;g<t.length;g++){const x=t[g];if(Ea(e.attrs,x.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return g}for(let g=0;g<t.length;g++){const x=t[g];if(Ea(e.attrs,x.attrs,["LANGUAGE"]))return g}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&mn(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=e.id,i=e.groupId,n=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:""):""} ${n}`),this.hls.trigger(d.AUDIO_TRACK_LOADING,{url:n,id:r,groupId:i,deliveryDirectives:t||null,track:e})}}class Du{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(n){var r;if(i.onError(n),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 bl=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,Sl="HlsJsTrackRemovedError";class Ru extends Error{constructor(e){super(e),this.name=Sl}}class Lu extends M{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:n}=this;r&&this.log("Media source opened"),!(!i||!n)&&(n.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(d.MEDIA_ATTACHED,{media:i,mediaSource:n}),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=re(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 n=this.isUpdating();n||this.operationQueue.removeBlockers();const a=this.isQueued();(n||a)&&this.warn(`Transfering MediaSource with${a?" operations in queue":""}${n?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const i=this.transferData;return!this.sourceBufferCount&&i&&i.mediaSource===t?u(r,i.tracks):this.sourceBuffers.forEach(n=>{const[a]=n;a&&(r[a]=u({},this.tracks[a]),this.removeBuffer(a)),n[0]=n[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;this.transferData=this.overrides=void 0;const i=ie(this.appendSource);if(i){const n=!!t.mediaSource;(n||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const a=this.mediaSource=t.mediaSource||new i;if(this.assignMediaSource(a),n)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 _,El(r),ku(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,n=i?Object.keys(i):null,a=n?n.length:0,h=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(i&&n&&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: ${ir(r,(_,g)=>_==="initSegment"?void 0:g)};
|
|
|
transfer tracks: ${ir(i,(_,g)=>_==="initSegment"?void 0:g)}}`),!_e(i,r)){t.mediaSource=null,t.tracks=void 0;const _=e.currentTime,g=this.details,x=Math.max(_,(g==null?void 0:g.fragments[0].start)||0);if(x-_>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${_} -> ${x}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(i)}"->"${Object.keys(r)}") start time: ${x} currentTime: ${_}`),this.onMediaDetaching(d.MEDIA_DETACHING,{}),this.onMediaAttaching(d.MEDIA_ATTACHING,t),e.currentTime=x;return}this.transferData=void 0,n.forEach(_=>{const g=_,x=i[g];if(x){const D=x.buffer;if(D){const j=this.fragmentTracker,Y=x.id;if(j.hasFragments(Y)||j.hasParts(Y)){const le=nr.getBuffered(D);j.detectEvictedFragments(g,le,Y,null,!0)}const Q=Ho(g),ue=[g,D];this.sourceBuffers[Q]=ue,D.updating&&this.operationQueue&&this.operationQueue.prependBlocker(g),this.trackSourceBuffer(g,x)}}}),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:n,_objectUrl:a}=this;if(n){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=n.readyState==="open";try{const _=n.sourceBuffers;for(let g=_.length;g--;)h&&_[g].abort(),n.removeSourceBuffer(_[g]);h&&n.endOfStream()}catch(_){this.warn(`onMediaDetaching: ${_.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(n.removeEventListener("startstreaming",this._onStartStreaming),n.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&&El(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(n){this.warn(`onBufferReset ${e}`,n)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[Ho(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new Du(this.tracks)}onBufferCodecs(e,t){var r;const i=this.tracks,n=Object.keys(t);this.log(`BUFFER_CODECS: "${n}" (current SB count ${this.sourceBufferCount})`);const a="audiovideo"in t&&(i.audio||i.video)||i.audiovideo&&("audio"in t||"video"in t),h=!a&&this.sourceBufferCount&&this.media&&n.some(_=>!i[_]);if(a||h){this.warn(`Unsupported transition between "${Object.keys(i)}" and "${n}" SourceBuffers`);return}n.forEach(_=>{var g,x;const D=t[_],{id:j,codec:Y,levelCodec:Q,container:ue,metadata:le,supplemental:be}=D;let xe=i[_];const Ce=(g=this.transferData)==null||(g=g.tracks)==null?void 0:g[_],Ue=Ce!=null&&Ce.buffer?Ce:xe,qe=(Ue==null?void 0:Ue.pendingCodec)||(Ue==null?void 0:Ue.codec),pt=Ue==null?void 0:Ue.levelCodec;xe||(xe=i[_]={buffer:void 0,listeners:[],codec:Y,supplemental:be,container:ue,levelCodec:Q,metadata:le,id:j});const Ye=Bt(qe,pt),at=Ye==null?void 0:Ye.replace(bl,"$1");let nt=Bt(Y,Q);const Ze=(x=nt)==null?void 0:x.replace(bl,"$1");nt&&Ye&&at!==Ze&&(_.slice(0,5)==="audio"&&(nt=ve(nt,this.appendSource)),this.log(`switching codec ${qe} to ${nt}`),nt!==(xe.pendingCodec||xe.codec)&&(xe.pendingCodec=nt),xe.container=ue,this.appendChangeType(_,ue,nt))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!t.video&&((r=t.audio)==null?void 0:r.id)==="main"&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),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}`,n={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(n,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,S.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&&nr.isBuffered(_.buffer,i)||((h=this.fragmentTracker.getAppendedFrag(i,S.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:n,parent:a,frag:h,part:_,chunkMeta:g,offset:x}=t,D=g.buffering[n],{sn:j,cc:Y}=h,Q=self.performance.now();D.start=Q;const ue=h.stats.buffering,le=_?_.stats.buffering:null;ue.start===0&&(ue.start=Q),le&&le.start===0&&(le.start=Q);const be=r.audio;let xe=!1;n==="audio"&&(be==null?void 0:be.container)==="audio/mpeg"&&(xe=!this.lastMpegAudioChunk||g.id===1||this.lastMpegAudioChunk.sn!==g.sn,this.lastMpegAudioChunk=g);const Ce=r.video,Ue=Ce==null?void 0:Ce.buffer;if(Ue&&j!=="initSegment"){const Ye=_||h,at=this.blockedAudioAppend;if(n==="audio"&&a!=="main"&&!this.blockedAudioAppend&&!(Ce.ending||Ce.ended)){const Ze=Ye.start+Ye.duration*.05,wt=Ue.buffered,Wt=this.currentOp("video");!wt.length&&!Wt?this.blockAudio(Ye):!Wt&&!nr.isBuffered(Ue,Ze)&&this.lastVideoAppendEnd<Ze&&this.blockAudio(Ye)}else if(n==="video"){const nt=Ye.end;if(at){const Ze=at.frag.start;(nt>Ze||nt<this.lastVideoAppendEnd||nr.isBuffered(Ue,Ze))&&this.unblockAudio()}this.lastVideoAppendEnd=nt}}const qe=(_||h).start,pt={label:`append-${n}`,execute:()=>{var Ye;D.executeStart=self.performance.now();const at=(Ye=this.tracks[n])==null?void 0:Ye.buffer;at&&(xe?this.updateTimestampOffset(at,qe,.1,n,j,Y):x!==void 0&&R(x)&&this.updateTimestampOffset(at,x,1e-6,n,j,Y)),this.appendExecutor(i,n)},onStart:()=>{},onComplete:()=>{const Ye=self.performance.now();D.executeEnd=D.end=Ye,ue.first===0&&(ue.first=Ye),le&&le.first===0&&(le.first=Ye);const at={};this.sourceBuffers.forEach(([nt,Ze])=>{nt&&(at[nt]=nr.getBuffered(Ze))}),this.appendErrors[n]=0,n==="audio"||n==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(d.BUFFER_APPENDED,{type:n,frag:h,part:_,chunkMeta:g,parent:h.type,timeRanges:at})},onError:Ye=>{var at;const nt={type:P.MEDIA_ERROR,parent:h.type,details:A.BUFFER_APPEND_ERROR,sourceBufferName:n,frag:h,part:_,chunkMeta:g,error:Ye,err:Ye,fatal:!1},Ze=(at=this.media)==null?void 0:at.error;if(Ye.code===DOMException.QUOTA_EXCEEDED_ERR||Ye.name=="QuotaExceededError"||"quota"in Ye)nt.details=A.BUFFER_FULL_ERROR;else if(Ye.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!Ze)nt.errorAction=ei(!0);else if(Ye.name===Sl&&this.sourceBufferCount===0)nt.errorAction=ei(!0);else{const wt=++this.appendErrors[n];this.warn(`Failed ${wt}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${n}" sourceBuffer (${Ze||"no media error"})`),(wt>=this.hls.config.appendErrorMaxRetry||Ze)&&(nt.fatal=!0)}this.hls.trigger(d.ERROR,nt)}};this.log(`queuing "${n}" append sn: ${j}${_?" p: "+_.index:""} of ${h.type===S.MAIN?"level":"track"} ${h.level} cc: ${Y}`),this.append(pt,n,this.isPending(this.tracks[n]))}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:n}=t;r?this.append(this.getFlushOp(r,i,n),r):this.sourceBuffers.forEach(([a])=>{a&&this.append(this.getFlushOp(a,i,n),a)})}onFragParsed(e,t){const{frag:r,part:i}=t,n=[],a=i?i.elementaryStreams:r.elementaryStreams;a[ne.AUDIOVIDEO]?n.push("audiovideo"):(a[ne.AUDIO]&&n.push("audio"),a[ne.VIDEO]&&n.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})};n.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${r.type} level: ${r.level} sn: ${r.sn}`),this.blockBuffers(h,n).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])=>{if(e){const t=this.tracks[e];if(t)return!t.ended||t.ending}return!1})}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)):t.type==="video"&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,t){if(t.details===A.BUFFER_APPEND_ERROR&&t.frag){var r;const i=(r=t.errorAction)==null?void 0:r.nextAutoLevel;R(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,n=r.currentTime,a=t.levelTargetDuration,h=t.live&&i.liveBackBufferLength!==null?i.liveBackBufferLength:i.backBufferLength;if(R(h)&&h>=0){const g=Math.max(h,a),x=Math.floor(n/a)*a-g;this.flushBackBuffer(n,a,x)}const _=i.frontBufferFlushThreshold;if(R(_)&&_>0){const g=Math.max(i.maxBufferLength,_),x=Math.max(g,a),D=Math.floor(n/a)*a+x;this.flushFrontBuffer(n,a,D)}}flushBackBuffer(e,t,r){this.sourceBuffers.forEach(([i,n])=>{if(n){const h=nr.getBuffered(n);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,n])=>{if(n){const a=nr.getBuffered(n),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&&r.setLiveSeekableRange){const g=Math.max(0,t.fragmentStart),x=Math.max(g,i);return{duration:1/0,start:g,end:x}}return{duration:1/0}}const n=(e=this.overrides)==null?void 0:e.duration;if(n)return R(n)?{duration:n}:null;const a=this.media.duration,h=R(r.duration)?r.duration:0;return i>h&&i>a||!R(a)?{duration:i}:null}updateMediaSource({duration:e,start:t,end:r}){const i=this.mediaSource;!this.media||!i||i.readyState!=="open"||(i.duration!==e&&(R(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}) ${ir(r)}`),this.tracksReady){var i;const n=(i=this.transferData)==null?void 0:i.tracks;n&&Object.keys(n).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:P.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 n in e){const a=n,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":""} ${ir(h)}`);try{const x=r.addSourceBuffer(g),D=Ho(a),j=[a,x];t[D]=j,h.buffer=x}catch(x){var i;this.error(`error while trying to add sourceBuffer: ${x.message}`),this.shiftAndExecuteNext(a),(i=this.operationQueue)==null||i.removeBlockers(),delete this.tracks[a],this.hls.trigger(d.ERROR,{type:P.MEDIA_ERROR,details:A.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,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")&&Me(r,"video")&&(i=Rt(i,r));const n=Bt(i,e.levelCodec);return n?t.slice(0,5)==="audio"?ve(n,this.appendSource):n:""}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",(n,a)=>{const h=a.removedRanges;h!=null&&h.length&&this.hls.trigger(d.BUFFER_FLUSHED,{type:n})})}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:P.MEDIA_ERROR,details:A.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const n=this.currentOp(e);n&&n.onError(i)}updateTimestampOffset(e,t,r,i,n,a){const h=t-e.timestampOffset;Math.abs(h)>=r&&(this.log(`Updating ${i} SourceBuffer timestampOffset to ${t} (sn: ${n} cc: ${a})`),e.timestampOffset=t)}removeExecutor(e,t,r){const{media:i,mediaSource:n}=this,a=this.tracks[e],h=a==null?void 0:a.buffer;if(!i||!n||!h){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const _=R(i.duration)?i.duration:1/0,g=R(n.duration)?n.duration:1/0,x=Math.max(0,t),D=Math.min(r,_,g);D>x&&(!a.ending||a.ended)?(a.ended=!1,this.log(`Removing [${x},${D}] from the ${e} SourceBuffer`),h.remove(x,D)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const r=this.tracks[t],i=r==null?void 0:r.buffer;if(!i)throw new Ru(`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 n=i.buffer;if(!n)return;const a=r.bind(this,e);i.listeners.push({event:t,listener:a}),n.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 El(o){const e=o.querySelectorAll("source");[].slice.call(e).forEach(t=>{o.removeChild(t)})}function ku(o,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,o.appendChild(t)}function Ho(o){return o==="audio"?1:0}class jo{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&&R(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,n)=>this.isLevelAllowed(i)&&n<=e);return this.clientRect=null,jo.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 n=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])){n=h;break}}return n}}const Wi={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},Iu={HLS:"h"};class zn{constructor(e,t){Array.isArray(e)&&(e=e.map(r=>r instanceof zn?r:new zn(r))),this.value=e,this.params=t}}const Pu="Dict";function Ou(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 Mu(o,e,t,r){return new Error(`failed to ${o} "${Ou(e)}" as ${t}`,{cause:r})}function Hn(o,e,t){return Mu("serialize",o,e,t)}class xl{constructor(e){this.description=e}}const wl="Bare Item",Fu="Boolean";function Bu(o){if(typeof o!="boolean")throw Hn(o,Fu);return o?"?1":"?0"}function Nu(o){return btoa(String.fromCharCode(...o))}const Uu="Byte Sequence";function $u(o){if(ArrayBuffer.isView(o)===!1)throw Hn(o,Uu);return`:${Nu(o)}:`}const zu="Integer";function Hu(o){return o<-999999999999999||999999999999999<o}function Cl(o){if(Hu(o))throw Hn(o,zu);return o.toString()}function ju(o){return`@${Cl(o.getTime()/1e3)}`}function Al(o,e){if(o<0)return-Al(-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}const Wu="Decimal";function Gu(o){const e=Al(o,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Hn(o,Wu);const t=e.toString();return t.includes(".")?t:`${t}.0`}const Ku="String",Vu=/[\x00-\x1f\x7f]+/;function qu(o){if(Vu.test(o))throw Hn(o,Ku);return`"${o.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Yu(o){return o.description||o.toString().slice(7,-1)}const Zu="Token";function Tl(o){const e=Yu(o);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Hn(e,Zu);return e}function Wo(o){switch(typeof o){case"number":if(!R(o))throw Hn(o,wl);return Number.isInteger(o)?Cl(o):Gu(o);case"string":return qu(o);case"symbol":return Tl(o);case"boolean":return Bu(o);case"object":if(o instanceof Date)return ju(o);if(o instanceof Uint8Array)return $u(o);if(o instanceof xl)return Tl(o);default:throw Hn(o,wl)}}const Xu="Key";function Go(o){if(/^[a-z*][a-z0-9\-_.*]*$/.test(o)===!1)throw Hn(o,Xu);return o}function Ko(o){return o==null?"":Object.entries(o).map(([e,t])=>t===!0?`;${Go(e)}`:`;${Go(e)}=${Wo(t)}`).join("")}function Dl(o){return o instanceof zn?`${Wo(o.value)}${Ko(o.params)}`:Wo(o)}function Qu(o){return`(${o.value.map(Dl).join(" ")})${Ko(o.params)}`}function Ju(o,e={whitespace:!0}){if(typeof o!="object"||o==null)throw Hn(o,Pu);const t=o instanceof Map?o.entries():Object.entries(o),r=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,n])=>{n instanceof zn||(n=new zn(n));let a=Go(i);return n.value===!0?a+=Ko(n.params):(a+="=",Array.isArray(n.value)?a+=Qu(n):a+=Dl(n)),a}).join(`,${r}`)}function Rl(o,e){return Ju(o,e)}const jn="CMCD-Object",ii="CMCD-Request",ws="CMCD-Session",ds="CMCD-Status",ec={br:jn,ab:jn,d:jn,ot:jn,tb:jn,tpb:jn,lb:jn,tab:jn,lab:jn,url:jn,pb:ii,bl:ii,tbl:ii,dl:ii,ltc:ii,mtp:ii,nor:ii,nrr:ii,rc:ii,sn:ii,sta:ii,su:ii,ttfb:ii,ttfbb:ii,ttlb:ii,cmsdd:ii,cmsds:ii,smrt:ii,df:ii,cs:ii,ts:ii,cid:ws,pr:ws,sf:ws,sid:ws,st:ws,v:ws,msd:ws,bs:ds,bsd:ds,cdn:ds,rtp:ds,bg:ds,pt:ds,ec:ds,e:ds},tc={REQUEST:ii};function rc(o){return Object.keys(o).reduce((e,t)=>{var r;return(r=o[t])===null||r===void 0||r.forEach(i=>e[i]=t),e},{})}function ic(o,e){const t={};if(!o)return t;const r=Object.keys(o),i=e?rc(e):{};return r.reduce((n,a)=>{var h;const _=ec[a]||i[a]||tc.REQUEST,g=(h=n[_])!==null&&h!==void 0?h:n[_]={};return g[a]=o[a],n},t)}function nc(o){return["ot","sf","st","e","sta"].includes(o)}function sc(o){return typeof o=="number"?R(o):o!=null&&o!==""&&o!==!1}const Ll="event";function ac(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),n=r.pathname.split("/").slice(1,-1);for(;i[0]===n[0];)i.shift(),n.shift();for(;n.length;)n.shift(),i.unshift("..");return i.join("/")+t.search+t.hash}const ao=o=>Math.round(o),Vo=(o,e)=>Array.isArray(o)?o.map(t=>Vo(t,e)):o instanceof zn&&typeof o.value=="string"?new zn(Vo(o.value,e),o.params):(e.baseUrl&&(o=ac(o,e.baseUrl)),e.version===1?encodeURIComponent(o):o),oo=o=>ao(o/100)*100,oc={br:ao,d:ao,bl:oo,dl:oo,mtp:oo,nor:(o,e)=>{let t=o;return e.version>=2&&(o instanceof zn&&typeof o.value=="string"?t=new zn([o]):typeof o=="string"&&(t=[o])),Vo(t,e)},rtp:oo,tb:ao},kl="request",Il="response",qo=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],lc=["e"],uc=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function lo(o){return uc.test(o)}function cc(o){return qo.includes(o)||lc.includes(o)||lo(o)}const Pl=["d","dl","nor","ot","rtp","su"];function hc(o){return qo.includes(o)||Pl.includes(o)||lo(o)}const fc=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];function dc(o){return qo.includes(o)||Pl.includes(o)||fc.includes(o)||lo(o)}const pc=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function mc(o){return pc.includes(o)||lo(o)}const gc={[Il]:dc,[Ll]:cc,[kl]:hc};function Ol(o,e={}){const t={};if(o==null||typeof o!="object")return t;const r=e.version||o.v||1,i=e.reportingMode||kl,n=r===1?mc:gc[i];let a=Object.keys(o).filter(n);const h=e.filter;typeof h=="function"&&(a=a.filter(h));const _=i===Il||i===Ll;_&&!a.includes("ts")&&a.push("ts"),r>1&&!a.includes("v")&&a.push("v");const g=u({},oc,e.formatters),x={version:r,reportingMode:i,baseUrl:e.baseUrl};return a.sort().forEach(D=>{let j=o[D];const Y=g[D];if(typeof Y=="function"&&(j=Y(j,x)),D==="v"){if(r===1)return;j=r}D=="pr"&&j===1||(_&&D==="ts"&&!R(j)&&(j=Date.now()),sc(j)&&(nc(D)&&typeof j=="string"&&(j=new xl(j)),t[D]=j))}),t}function _c(o,e={}){const t={};if(!o)return t;const r=Ol(o,e),i=ic(r,e==null?void 0:e.customHeaderMap);return Object.entries(i).reduce((n,[a,h])=>{const _=Rl(h,{whitespace:!1});return _&&(n[a]=_),n},t)}function vc(o,e,t){return u(o,_c(e,t))}const yc="CMCD";function bc(o,e={}){return o?Rl(Ol(o,e),{whitespace:!1}):""}function Sc(o,e={}){if(!o)return"";const t=bc(o,e);return encodeURIComponent(t)}function Ec(o,e={}){if(!o)return"";const t=Sc(o,e);return`${yc}=${t}`}const Ml=/CMCD=[^&#]+/;function xc(o,e,t){const r=Ec(e,t);if(!r)return o;if(Ml.test(o))return o.replace(Ml,r);const i=o.includes("?")?"&":"?";return`${o}${i}${r}`}class wc{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:Wi.MANIFEST,su:!this.initialized})}catch(n){this.hls.logger.warn("Could not generate manifest CMCD data.",n)}},this.applyFragmentData=i=>{try{const{frag:n,part:a}=i,h=this.hls.levels[n.level],_=this.getObjectType(n),g={d:(a||n).duration*1e3,ot:_};(_===Wi.VIDEO||_===Wi.AUDIO||_==Wi.MUXED)&&(g.br=h.bitrate/1e3,g.tb=this.getTopBandwidth(_)/1e3,g.bl=this.getBufferLength(_));const x=a?this.getNextPart(a):this.getNextFrag(n);x!=null&&x.url&&x.url!==n.url&&(g.nor=x.url),this.apply(i,g)}catch(n){this.hls.logger.warn("Could not generate segment CMCD data.",n)}},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:Iu.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){u(t,this.createData());const r=t.ot===Wi.INIT||t.ot===Wi.VIDEO||t.ot===Wi.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 n={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),vc(e.headers,t,n)):e.url=xc(e.url,t,n)}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;const{index:r,fragment:i}=e,n=(t=this.hls.levels[i.level])==null||(t=t.details)==null?void 0:t.partList;if(n){const{sn:a}=i;for(let h=n.length-1;h>=0;h--){const _=n[h];if(_.index===r&&_.fragment.sn===a)return n[h+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Wi.TIMED_TEXT;if(e.sn==="initSegment")return Wi.INIT;if(t==="audio")return Wi.AUDIO;if(t==="main")return this.hls.audioTracks.length?Wi.VIDEO:Wi.MUXED}getTopBandwidth(e){let t=0,r;const i=this.hls;if(e===Wi.AUDIO)r=i.audioTracks;else{const n=i.maxAutoLevel,a=n>-1?n+1:i.levels.length;r=i.levels.slice(0,a)}return r.forEach(n=>{n.bitrate>t&&(t=n.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,r=e===Wi.AUDIO?this.audioBuffer:this.videoBuffer;return!r||!t?NaN:nr.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(n){this.loader=void 0,this.loader=new r(n)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(n,a,h){t(n),this.loader.load(n,a,h)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,r=e||this.config.loader;return class{constructor(n){this.loader=void 0,this.loader=new r(n)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(n,a,h){t(n),this.loader.load(n,a,h)}}}}const Cc=3e5;class Ac extends M{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)===ur.SendAlternateToPenaltyBox&&r.flags===Or.MoveAllAlternatesMatchingHost){const i=this.levels;let n=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()),!n&&i&&(n=this.pathways()),n&&n.length>1&&(this.updatePathwayPriority(n),r.resolved=this.pathwayId!==a),t.details===A.BUFFER_APPEND_ERROR&&!t.fatal?r.resolved=!0:r.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${a} levels: ${i&&i.length} priorities: ${ir(n)} penalized: ${ir(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(n=>{i-r[n]>Cc&&delete r[n]});for(let n=0;n<e.length;n++){const a=e[n];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,Oa(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 n=0;n<i.length;n++)if(t===U.AUDIO_TRACK&&i[n].hasAudioGroup(e)||t===U.SUBTITLE_TRACK&&i[n].hasSubtitleGroup(e))return i[n].pathwayId;return r}clonePathways(e){const t=this.levels;if(!t)return;const r={},i={};e.forEach(n=>{const{ID:a,"BASE-ID":h,"URI-REPLACEMENT":_}=n;if(t.some(x=>x.pathwayId===a))return;const g=this.getLevelsForPathway(h).map(x=>{const D=new or(x.attrs);D["PATHWAY-ID"]=a;const j=D.AUDIO&&`${D.AUDIO}_clone_${a}`,Y=D.SUBTITLES&&`${D.SUBTITLES}_clone_${a}`;j&&(r[D.AUDIO]=j,D.AUDIO=j),Y&&(i[D.SUBTITLES]=Y,D.SUBTITLES=Y);const Q=Bl(x.uri,D["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",_),ue=new br({attrs:D,audioCodec:x.audioCodec,bitrate:x.bitrate,height:x.height,name:x.name,url:Q,videoCodec:x.videoCodec,width:x.width});if(x.audioGroups)for(let le=1;le<x.audioGroups.length;le++)ue.addGroupId("audio",`${x.audioGroups[le]}_clone_${a}`);if(x.subtitleGroups)for(let le=1;le<x.subtitleGroups.length;le++)ue.addGroupId("text",`${x.subtitleGroups[le]}_clone_${a}`);return ue});t.push(...g),Fl(this.audioTracks,r,_,a),Fl(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(x){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const x=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+x)}const n={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:(x,D,j,Y)=>{this.log(`Loaded steering manifest: "${i}"`);const Q=x.data;if((Q==null?void 0:Q.VERSION)!==1){this.log(`Steering VERSION ${Q.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=Q.TTL;const{"RELOAD-URI":ue,"PATHWAY-CLONES":le,"PATHWAY-PRIORITY":be}=Q;if(ue)try{this.uri=new self.URL(ue,i).href}catch(Ce){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${ue}`);return}this.scheduleRefresh(this.uri||j.url),le&&this.clonePathways(le);const xe={steeringManifest:Q,url:i.toString()};this.hls.trigger(d.STEERING_MANIFEST_LOADED,xe),be&&this.updatePathwayPriority(be)},onError:(x,D,j,Y)=>{if(this.log(`Error loading steering manifest: ${x.code} ${x.text} (${D.url})`),this.stopLoad(),x.code===410){this.enabled=!1,this.log(`Steering manifest ${D.url} no longer available`);return}let Q=this.timeToLoad*1e3;if(x.code===429){const ue=this.loader;if(typeof(ue==null?void 0:ue.getResponseHeader)=="function"){const le=ue.getResponseHeader("Retry-After");le&&(Q=parseFloat(le)*1e3)}this.log(`Steering manifest ${D.url} rate limited`);return}this.scheduleRefresh(this.uri||D.url,Q)},onTimeout:(x,D,j)=>{this.log(`Timeout loading steering manifest (${D.url})`),this.scheduleRefresh(this.uri||D.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(n,_,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 Fl(o,e,t,r){o&&Object.keys(e).forEach(i=>{const n=o.filter(a=>a.groupId===i).map(a=>{const h=u({},a);return h.details=void 0,h.attrs=new or(h.attrs),h.url=h.attrs.URI=Bl(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(...n)})}function Bl(o,e,t,r){const{HOST:i,PARAMS:n,[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),n&&Object.keys(n).sort().forEach(g=>{g&&_.searchParams.set(g,n[g])}),_.href}class js extends M{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.mediaResolved=void 0,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=js.CDMCleanupPromise?[js.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=t=>{const{initDataType:r,initData:i}=t,n=`"${t.type}" event: init data type: "${r}"`;if(this.debug(n),i!==null){if(!this.keyFormatPromise){let a=Object.keys(this.keySystemAccessPromises);a.length||(a=an(this.config));const h=a.map(Yi).filter(_=>!!_);this.keyFormatPromise=this.getKeyFormatPromise(h)}this.keyFormatPromise.then(a=>{const h=sn(a);if(r!=="sinf"||h!==dr.FAIRPLAY){this.log(`Ignoring "${t.type}" event with init data type: "${r}" for selected key-system ${h}`);return}let _;try{const Y=tt(new Uint8Array(i)),Q=Vn(JSON.parse(Y).sinf),ue=dt(Q);if(!ue)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");_=new Uint8Array(ue.subarray(8,24))}catch(Y){this.warn(`${n} Failed to parse sinf: ${Y}`);return}const g=ce(_),{keyIdToKeySessionPromise:x,mediaKeySessions:D}=this;let j=x[g];for(let Y=0;Y<D.length;Y++){const Q=D[Y],ue=Q.decryptdata;if(!ue.keyId)continue;const le=ce(ue.keyId);if(Li(_,ue.keyId)||ue.uri.replace(/-/g,"").indexOf(g)!==-1){if(j=x[le],!j)continue;if(ue.pssh)break;delete x[le],ue.pssh=new Uint8Array(i),ue.keyId=_,j=x[g]=j.then(()=>this.generateRequestWithPreferredKeySession(Q,r,i,"encrypted-event-key-match")),j.catch(be=>this.handleError(be));break}}j||this.handleError(new Error(`Key ID ${g} not encountered in playlist. Key-system sessions ${D.length}.`))}).catch(a=>this.handleError(a))}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(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),this.hls.on(d.DESTROYING,this.onDestroying,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),this.hls.off(d.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:r}=this.config,i=t==null?void 0:t[e];if(i)return i.licenseUrl;if(e===dr.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==null?void 0: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),n=t.map(a=>a.videoCodec).filter(r);return i.length+n.length===0&&n.push("avc1.42e01e"),new Promise((a,h)=>{const _=g=>{const x=g.shift();this.getMediaKeysPromise(x,i,n).then(D=>a({keySystem:x,mediaKeys:D})).catch(D=>{g.length?_(g):D instanceof Qi?h(D):h(new Qi({type:P.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_NO_ACCESS,error:D,fatal:!0},D.message))})};_(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:r}=this.config;if(typeof r!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${r}`;return Bn===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){var i;const n=So(e,t,r,this.config.drmSystemOptions||{});let a=this.keySystemAccessPromises[e],h=(i=a)==null?void 0:i.keySystemAccess;if(!h){this.log(`Requesting encrypted media "${e}" key-system access with config: ${ir(n)}`),h=this.requestMediaKeySystemAccess(e,n);const _=a=this.keySystemAccessPromises[e]={keySystemAccess:h};return h.catch(g=>{this.log(`Failed to obtain access to key-system "${e}": ${g}`)}),h.then(g=>{this.log(`Access for key-system "${g.keySystem}" obtained`);const x=this.fetchServerCertificate(e);this.log(`Create media-keys for "${e}"`);const D=_.mediaKeys=g.createMediaKeys().then(j=>(this.log(`Media-keys created for "${e}"`),_.hasMediaKeys=!0,x.then(Y=>Y?this.setMediaKeysServerCertificate(j,e,Y):j)));return D.catch(j=>{this.error(`Failed to create media-keys for "${e}"}: ${j}`)}),D})}return h.then(()=>a.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:r}){this.log(`Creating key-system session "${t}" keyId: ${ce(e.keyId||[])} keyUri: ${e.uri}`);const i=r.createSession(),n={decryptdata:e,keySystem:t,mediaKeys:r,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(n),n}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const r=this.createMediaKeySessionContext(e),i=uo(t),n="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(r,n,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}updateKeySession(e,t){const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyId ${ce(e.decryptdata.keyId||[])}
|
|
|
} (data length: ${t.byteLength})`),r.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>Yi(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:r})=>this.attemptSetMediaKeys(t,r))}selectKeySystem(e){return new Promise((t,r)=>{this.getKeySystemSelectionPromise(e).then(({keySystem:i})=>{const n=Yi(i);n?t(n):r(new Error(`Unable to find format for key-system "${i}"`))}).catch(r)})}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=an(this.config),r=e.map(sn).filter(i=>!!i&&t.indexOf(i)!==-1);return this.selectKeySystem(r)}getKeyStatus(e){const{mediaKeySessions:t}=this;for(let r=0;r<t.length;r++){const i=Tc(e,t[r]);if(i)return i}}loadKey(e){const t=e.keyInfo.decryptdata,r=uo(t),i=this.bannedKeyIds[r];if(i||this.getKeyStatus(t)==="internal-error"){const h=Nl(i||"internal-error",t);return this.handleError(h,e.frag),Promise.reject(h)}const n=`(keyId: ${r} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${n}`);const a=this.keyIdToKeySessionPromise[r];if(!a){const h=this.getKeySystemForKeyPromise(t).then(({keySystem:_,mediaKeys:g})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${n}`),this.attemptSetMediaKeys(_,g).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:_,mediaKeys:g,decryptdata:t}))))).then(_=>{const g="cenc",x=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(_,g,x,"playlist-key")});return h.catch(_=>this.handleError(_,e.frag)),this.keyIdToKeySessionPromise[r]=h,h}return a.catch(h=>{if(h instanceof Qi){const _=c({},h.data);this.getKeyStatus(t)==="internal-error"&&(_.decryptdata=t);const g=new Qi(_,h.message);this.handleError(g,e.frag)}}),a}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e,t){if(this.hls)if(e instanceof Qi){t&&(e.data.frag=t);const r=e.data.decryptdata;this.error(`${e.message}${r?` (${ce(r.keyId||[])})`:""}`),this.hls.trigger(d.ERROR,e.data)}else this.error(e.message),this.hls.trigger(d.ERROR,{type:P.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0})}getKeySystemForKeyPromise(e){const t=uo(e),r=this.keyIdToKeySessionPromise[t];if(!r){const i=sn(e.keyFormat),n=i?[i]:an(this.config);return this.attemptKeySystemAccess(n)}return r}getKeySystemSelectionPromise(e){if(e.length||(e=an(this.config)),e.length===0)throw new Qi({type:P.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${ir({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaResolved=void 0,this.mediaKeys===t)return Promise.resolve();const r=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(r).then(()=>this.media?this.media.setMediaKeys(t):new Promise((n,a)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return a(new Error("Attempted to set mediaKeys without media element attached"));this.mediaKeys=t,this.media.setMediaKeys(t).then(n).catch(a)}}));return this.mediaKeys=t,this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),r.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(n=>r.indexOf(n)===-1)})}generateRequestWithPreferredKeySession(e,t,r,i){var n;const a=(n=this.config.drmSystems)==null||(n=n[e.keySystem])==null?void 0:n.generateRequest;if(a)try{const Q=a.call(this.hls,t,r,e);if(!Q)throw new Error("Invalid response from configured generateRequest filter");t=Q.initDataType,r=Q.initData?Q.initData:null,e.decryptdata.pssh=r?new Uint8Array(r):null}catch(Q){if(this.warn(Q.message),this.hls&&this.hls.config.debug)throw Q}if(r===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const h=uo(e.decryptdata),_=e.decryptdata.uri;this.log(`Generating key-session request for "${i}" keyId: ${h} URI: ${_} (init data type: ${t} length: ${r.byteLength})`);const g=new Ms,x=e._onmessage=Q=>{const ue=e.mediaKeysSession;if(!ue){g.emit("error",new Error("invalid state"));return}const{messageType:le,message:be}=Q;this.log(`"${le}" message event for session "${ue.sessionId}" message size: ${be.byteLength}`),le==="license-request"||le==="license-renewal"?this.renewLicense(e,be).catch(xe=>{g.eventNames().length?g.emit("error",xe):this.handleError(xe)}):le==="license-release"?e.keySystem===dr.FAIRPLAY&&this.updateKeySession(e,qn("acknowledged")).then(()=>this.removeSession(e)).catch(xe=>this.handleError(xe)):this.warn(`unhandled media key message type "${le}"`)},D=(Q,ue)=>{ue.keyStatus=Q;let le;Q.startsWith("usable")?g.emit("resolved"):Q==="internal-error"||Q==="output-restricted"||Q==="output-downscaled"?le=Nl(Q,ue.decryptdata):Q==="expired"?le=new Error(`key expired (keyId: ${h})`):Q==="released"?le=new Error("key released"):Q==="status-pending"||this.warn(`unhandled key status change "${Q}" (keyId: ${h})`),le&&(g.eventNames().length?g.emit("error",le):this.handleError(le))},j=e._onkeystatuseschange=Q=>{if(!e.mediaKeysSession){g.emit("error",new Error("invalid state"));return}const le=this.getKeyStatuses(e);if(!Object.keys(le).some(Ue=>le[Ue]!=="status-pending"))return;if(le[h]==="expired"){this.log(`Expired key ${ir(le)} in key-session "${e.mediaKeysSession.sessionId}"`),this.renewKeySession(e);return}let xe=le[h];if(xe)D(xe,e);else{var Ce;e.keyStatusTimeouts||(e.keyStatusTimeouts={}),(Ce=e.keyStatusTimeouts)[h]||(Ce[h]=self.setTimeout(()=>{if(!e.mediaKeysSession||!this.mediaKeys)return;const qe=this.getKeyStatus(e.decryptdata);if(qe&&qe!=="status-pending")return this.log(`No status for keyId ${h} in key-session "${e.mediaKeysSession.sessionId}". Using session key-status ${qe} from other session.`),D(qe,e);this.log(`key status for ${h} in key-session "${e.mediaKeysSession.sessionId}" timed out after 1000ms`),xe="internal-error",D(xe,e)},1e3)),this.log(`No status for keyId ${h} (${ir(le)}).`)}};_i(e.mediaKeysSession,"message",x),_i(e.mediaKeysSession,"keystatuseschange",j);const Y=new Promise((Q,ue)=>{g.on("error",ue),g.on("resolved",Q)});return e.mediaKeysSession.generateRequest(t,r).then(()=>{this.log(`Request generated for key-session "${e.mediaKeysSession.sessionId}" keyId: ${h} URI: ${_}`)}).catch(Q=>{throw new Qi({type:P.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_NO_SESSION,error:Q,decryptdata:e.decryptdata,fatal:!1},`Error generating key-session request: ${Q}`)}).then(()=>Y).catch(Q=>(g.removeAllListeners(),this.removeSession(e).then(()=>{throw Q}))).then(()=>(g.removeAllListeners(),e))}getKeyStatuses(e){const t={};return e.mediaKeysSession.keyStatuses.forEach((r,i)=>{if(typeof i=="string"&&typeof r=="object"){const h=i;i=r,r=h}const n="buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i);if(e.keySystem===dr.PLAYREADY&&n.length===16){const h=ce(n);t[h]=r,Kt(n)}const a=ce(n);r==="internal-error"&&(this.bannedKeyIds[a]=r),this.log(`key status change "${r}" for keyStatuses keyId: ${a} key-session "${e.mediaKeysSession.sessionId}"`),t[a]=r}),t}fetchServerCertificate(e){const t=this.config,r=t.loader,i=new r(t),n=this.getServerCertificateUrl(e);return n?(this.log(`Fetching server certificate for "${e}"`),new Promise((a,h)=>{const _={responseType:"arraybuffer",url:n},g=t.certLoadPolicy.default,x={loadPolicy:g,timeout:g.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},D={onSuccess:(j,Y,Q,ue)=>{a(j.data)},onError:(j,Y,Q,ue)=>{h(new Qi({type:P.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:Q,response:c({url:_.url,data:void 0},j)},`"${e}" certificate request failed (${n}). Status: ${j.code} (${j.text})`))},onTimeout:(j,Y,Q)=>{h(new Qi({type:P.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:Q,response:{url:_.url,data:void 0}},`"${e}" certificate request timed out (${n})`))},onAbort:(j,Y,Q)=>{h(new Error("aborted"))}};i.load(_,x,D)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,r){return new Promise((i,n)=>{e.setServerCertificate(r).then(a=>{this.log(`setServerCertificate ${a?"success":"not supported by CDM"} (${r.byteLength}) on "${t}"`),i(e)}).catch(a=>{n(new Qi({type:P.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 Qi({type:P.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:e.decryptdata,error:i,fatal:!1},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"),n=i.querySelectorAll("HttpHeader");if(n.length>0){let x;for(let D=0,j=n.length;D<j;D++){var a,h;x=n[D];const Y=(a=x.querySelector("name"))==null?void 0:a.textContent,Q=(h=x.querySelector("value"))==null?void 0:h.textContent;Y&&Q&&e.setRequestHeader(Y,Q)}}const _=i.querySelector("Challenge"),g=_==null?void 0:_.textContent;if(!g)throw new Error("Cannot find <Challenge> in key message");return qn(atob(g))}setupLicenseXHR(e,t,r,i){const n=this.config.licenseXhrSetup;return n?Promise.resolve().then(()=>{if(!r.decryptdata)throw new Error("Key removed");return n.call(this.hls,e,t,r,i)}).catch(a=>{if(!r.decryptdata)throw a;return e.open("POST",t,!0),n.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,n)=>{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 n(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(x){this.error(x)}i(_)}else{const _=r.errorRetry,g=_?_.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>g||h.status>=400&&h.status<500)n(new Qi({type:P.KEY_SYSTEM_ERROR,details:A.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,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 x=g-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${x} attempts left`),this.requestLicense(e,t).then(i,n)}}},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==dr.PLAYREADY&&(g=this.unpackPlayReadyKeyMessage(_,g)),_.send(g)}).catch(n)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const r=t.media;this.media=r,_i(r,"encrypted",this.onMediaEncrypted),_i(r,"waitingforkey",this.onWaitingForKey);const i=this.mediaResolved;i?i():this.mediaKeys=r.mediaKeys}onMediaDetached(){const e=this.media;e&&(xi(e,"encrypted",this.onMediaEncrypted),xi(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};const t=this.mediaResolved;if(t&&t(),!this.mediaKeys&&!this.mediaKeySessions.length)return;const r=this.media,i=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,An.clearKeyUriToKeyIdMap();const n=i.length;js.CDMCleanupPromise=Promise.all(i.map(a=>this.removeSession(a)).concat((r==null||(e=r.setMediaKeys(null))==null?void 0:e.catch(a=>{this.log(`Could not clear media keys: ${a}`),this.hls&&this.hls.trigger(d.ERROR,{type:P.OTHER_ERROR,details:A.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${a}`)})}))||Promise.resolve())).catch(a=>{this.log(`Could not close sessions and clear media keys: ${a}`),this.hls&&this.hls.trigger(d.ERROR,{type:P.OTHER_ERROR,details:A.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${a}`)})}).then(()=>{n&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this._clear()}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const r=t.reduce((i,n)=>(i.indexOf(n.keyFormat)===-1&&i.push(n.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${r.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(r)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:r,decryptdata:i}=e;if(t){this.log(`Remove licenses and keys and close session "${t.sessionId}" keyId: ${ce((i==null?void 0:i.keyId)||[])}`),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 n=this.mediaKeySessions.indexOf(e);n>-1&&this.mediaKeySessions.splice(n,1);const{keyStatusTimeouts:a}=e;a&&Object.keys(a).forEach(g=>self.clearTimeout(a[g]));const{drmSystemOptions:h}=this.config;return(Aa(h)?new Promise((g,x)=>{self.setTimeout(()=>x(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(g).catch(x)}):Promise.resolve()).catch(g=>{this.log(`Could not remove session: ${g}`),this.hls&&this.hls.trigger(d.ERROR,{type:P.OTHER_ERROR,details:A.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${g}`)})}).then(()=>t.close()).catch(g=>{this.log(`Could not close session: ${g}`),this.hls&&this.hls.trigger(d.ERROR,{type:P.OTHER_ERROR,details:A.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${g}`)})})}return Promise.resolve()}}js.CDMCleanupPromise=void 0;function uo(o){if(!o)throw new Error("Could not read keyId of undefined decryptdata");if(o.keyId===null)throw new Error("keyId is null");return ce(o.keyId)}function Tc(o,e){if(o.keyId&&e.mediaKeysSession.keyStatuses.has(o.keyId))return e.mediaKeysSession.keyStatuses.get(o.keyId);if(o.matches(e.decryptdata))return e.keyStatus}class Qi extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}function Nl(o,e){const t=o==="output-restricted",r=t?A.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:A.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new Qi({type:P.KEY_SYSTEM_ERROR,details:r,fatal:!1,decryptdata:e},t?"HDCP level output restricted":`key status changed to "${o}"`)}class Dc{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 n=i-this.lastTime,a=r-this.lastDroppedFrames,h=t-this.lastDecodedFrames,_=1e3*a/n,g=this.hls;if(g.trigger(d.FPS_DROP,{currentDropped:a,currentDecoded:h,totalDroppedFrames:r}),_>0&&a>g.config.fpsDroppedMonitoringThreshold*h){let x=g.currentLevel;g.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+x),x>0&&(g.autoLevelCapping===-1||g.autoLevelCapping>=x)&&(x=x-1,g.trigger(d.FPS_DROP_LEVEL_CAPPING,{level:x,droppedLevel:g.currentLevel}),g.autoLevelCapping=x,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 Ul(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 $l(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 Ws(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 Yo(o,e,t,r){const i=o.mode;if(i==="disabled"&&(o.mode="hidden"),o.cues&&o.cues.length>0){const n=Lc(o.cues,e,t);for(let a=0;a<n.length;a++)(!r||r(n[a]))&&o.removeCue(n[a])}i==="disabled"&&(o.mode=i)}function Rc(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,n;for(;r<=i;)if(n=Math.floor((i+r)/2),e<o[n].startTime)i=n-1;else if(e>o[n].startTime&&r<t)r=n+1;else return n;return o[r].startTime-e<e-o[i].startTime?r:i}function Lc(o,e,t){const r=[],i=Rc(o,e);if(i>-1)for(let n=i,a=o.length;n<a;n++){const h=o[n];if(h.startTime>=e&&h.endTime<=t)r.push(h);else if(h.startTime>t)return r}return r}function co(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 kc extends $o{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=co(this.media.textTracks);for(let n=0;n<r.length;n++)if(r[n].mode==="hidden")t=r[n];else if(r[n].mode==="showing"){t=r[n];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;co(r.textTracks).forEach(a=>{Ws(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:n}=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 [${n.startSN}-${n.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 n=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(x=>!r||r.indexOf(x.groupId)!==-1);if(a.length)this.selectDefaultTrack&&!a.some(x=>x.default)&&(this.selectDefaultTrack=!1),a.forEach((x,D)=>{x.id=D});else if(!n&&!this.tracksInGroup.length)return;this.tracksInGroup=a;const h=this.hls.config.subtitlePreference;if(!n&&h){this.selectDefaultTrack=!1;const x=Ci(h,a);if(x>-1)n=a[x];else{const D=Ci(h,this.tracks);n=this.tracks[D]}}let _=this.findTrackId(n);_===-1&&n&&(_=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 n=t[i];if(!(r&&!n.default||!r&&!e)&&(!e||$i(n,e)))return i}if(e){for(let i=0;i<t.length;i++){const n=t[i];if(Ea(e.attrs,n.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const n=t[i];if(Ea(e.attrs,n.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(zo(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&&$i(e,r))return r;const i=Ci(e,this.tracksInGroup);if(i>-1){const n=this.tracksInGroup[i];return this.setSubtitleTrack(i),n}else{if(r)return null;{const n=Ci(e,t);if(n>-1)return t[n]}}}}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,n=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:""):""} ${n}`),this.hls.trigger(d.SUBTITLE_TRACK_LOADING,{url:n,id:r,groupId:i,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=co(e.textTracks),r=this.currentTrack;let i;if(r&&(i=t.filter(n=>zo(r,n))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${r.name}" and language "${r.lang}"`)),[].slice.call(t).forEach(n=>{n.mode!=="disabled"&&n!==i&&(n.mode="disabled")}),i){const n=this.subtitleDisplay?"showing":"hidden";i.mode!==n&&(i.mode=n)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!R(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 n=!!i.details&&!i.details.live;if(e===this.trackId&&i===r&&n)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:x}=i;this.hls.trigger(d.SUBTITLE_TRACK_SWITCH,{id:a,groupId:h,name:_,type:g,url:x});const D=this.switchParams(i.url,r==null?void 0:r.details,i.details);this.loadPlaylist(D)}}function Ic(){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 n=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?n:n&3|8).toString(16)})}}}function xa(o){let e=5381,t=o.length;for(;t;)e=e*33^o.charCodeAt(--t);return(e>>>0).toString()}const Gs=.025;let ho=function(o){return o[o.Point=0]="Point",o[o.Range=1]="Range",o}({});function Pc(o,e,t){return`${o.identifier}-${t+1}-${xa(e)}`}class Oc{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var t;if(e>0&&e>=this.assetList.length)return!0;const r=this.playoutLimit;return e<=0||isNaN(r)?!1:r===0?!0:(((t=this.assetList[e])==null?void 0:t.startOffset)||0)>r}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 Zo(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=Zo(t,e);return t-r<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=R(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 Zo(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)<Gs))}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"?ho.Range:ho.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 Mc(this)}}function Zo(o,e){return o-e.start<e.duration/2&&!(Math.abs(o-(e.start+e.duration))<Gs)?e.start:e.start+e.duration}function zl(o,e,t){const r=new self.URL(o,t);return r.protocol!=="data:"&&r.searchParams.set("_HLS_primary_id",e),r}function Xo(o,e){for(;(t=o.assetList[++e])!=null&&t.error;)var t;return e}function Mc(o){return`["${o.identifier}" ${o.cue.pre?"<pre>":o.cue.post?"<post>":""}${o.timelineStart.toFixed(2)}-${o.resumeTime.toFixed(2)}]`}function Ks(o){const e=o.timelineStart,t=o.duration||0;return`["${o.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class Fc{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=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(d.PLAYOUT_LIMIT_REACHED,{})};const n=this.hls=new e(t);this.interstitial=r,this.assetItem=i;const a=()=>{this.hasDetails=!0};n.once(d.LEVEL_LOADED,a),n.once(d.AUDIO_TRACK_LOADED,a),n.once(d.SUBTITLE_TRACK_LOADED,a),n.on(d.MEDIA_ATTACHING,(h,{media:_})=>{this.removeMediaListeners(),this.mediaAttached=_,this.interstitial.playoutLimit&&(_.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&n.on(d.BUFFER_APPENDED,()=>{const x=this.bufferedEnd;this.reachedPlayout(x)&&(this._bufferedEosTime=x,n.trigger(d.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const e=this.hls;if(e)if(e.url)e.levels.length&&!e.started&&e.startLoad(-1,!0);else{let t=this.assetItem.uri;try{t=zl(t,e.config.primarySessionId||"").href}catch(r){}e.loadSource(t)}}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e)return!1;const r=Math.min(this._bufferedEosTime||1/0,this.duration),i=this.timelineOffset,n=nr.bufferInfo(e,i,0);return this.getAssetTime(n.end)>=r-.02}reachedPlayout(e){const r=this.interstitial.playoutLimit;return this.startOffset+e>=r}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=nr.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;if(!e)return 0;const t=this.interstitial.playoutLimit;if(t){const r=t-this.startOffset;if(r>0&&r<e)return r}return e}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&&this.hls){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&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){var t;this.loadSource(),(t=this.hls)==null||t.attachMedia(e)}detachMedia(){var e;this.removeMediaListeners(),this.mediaAttached=null,(e=this.hls)==null||e.detachMedia()}resumeBuffering(){var e;(e=this.hls)==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.hls)==null||e.pauseBuffering()}transferMedia(){var e;return this.bufferSnapShot(),((e=this.hls)==null?void 0:e.transferMedia())||null}resetDetails(){const e=this.hls;if(e&&this.hasDetails){e.stopLoad();const t=r=>delete r.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,r){var i;(i=this.hls)==null||i.on(e,t)}once(e,t,r){var i;(i=this.hls)==null||i.once(e,t)}off(e,t,r){var i;(i=this.hls)==null||i.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${Ks(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const Hl=.033;class Bc extends M{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&&(n=i[r])!=null&&n.event;){var n;r--}return r}findItemIndexAtTime(e,t){const r=this.items;if(r)for(let i=0;i<r.length;i++){let n=r[i];if(t&&t!=="primary"&&(n=n[t]),e===n.start||e>n.start&&e<n.end)return i}return-1}findJumpRestrictedIndex(e,t){const r=this.items;if(r)for(let i=e;i<=t&&r[i];i++){const n=r[i].event;if(n!=null&&n.restrictions.jump&&!n.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 n=0;n<i;n++){const a=r[n];if(!a.error){const h=a.timelineStart;if(t===h||t>h&&(t<h+(a.duration||0)||n===i-1))return n}}return 0}get assetIdAtEnd(){var e;const t=(e=this.items)==null||(e=e[this.length-1])==null?void 0:e.event;if(t){const r=t.assetList,i=r[r.length-1];if(i)return i.identifier}return null}parseInterstitialDateRanges(e,t){const r=e.main.details,{dateRanges:i}=r,n=this.events,a=this.parseDateRanges(i,{url:r.url},t),h=Object.keys(i),_=n?n.filter(g=>!h.includes(g.identifier)):[];a.length&&a.sort((g,x)=>{const D=g.cue.pre,j=g.cue.post,Y=x.cue.pre,Q=x.cue.post;if(D&&!Y)return-1;if(Y&&!D||j&&!Q)return 1;if(Q&&!j)return-1;if(!D&&!Y&&!j&&!Q){const ue=g.startTime,le=x.startTime;if(ue!==le)return ue-le}return g.dateRange.tagOrder-x.dateRange.tagOrder}),this.events=a,_.forEach(g=>{this.removeEvent(g)}),this.updateSchedule(e,_)}updateSchedule(e,t=[],r=!1){const i=this.events||[];if(i.length||t.length||this.length<2){const n=this.items,a=this.parseSchedule(i,e);(r||t.length||(n==null?void 0:n.length)!==a.length||a.some((_,g)=>Math.abs(_.playout.start-n[g].playout.start)>.005||Math.abs(_.playout.end-n[g].playout.end)>.005))&&(this.items=a,this.onScheduleUpdate(t,n))}}parseDateRanges(e,t,r){const i=[],n=Object.keys(e);for(let a=0;a<n.length;a++){const h=n[a],_=e[h];if(_.isInterstitial){let g=this.eventMap[h];g?g.setDateRange(_):(g=new Oc(_,t),this.eventMap[h]=g,r===!1&&(g.appendInPlace=r)),i.push(g)}}return i}parseSchedule(e,t){const r=[],i=t.main.details,n=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((x,D)=>{const j=x.cue.pre,Y=x.cue.post,Q=e[D-1]||null,ue=x.appendInPlace,le=Y?n:x.startOffset,be=x.duration,xe=x.timelineOccupancy===ho.Range?be:0,Ce=x.resumptionOffset,Ue=(Q==null?void 0:Q.startTime)===le,qe=le+x.cumulativeDuration;let pt=ue?qe+be:le+Ce;if(j||!Y&&le<=0){const at=g;g+=xe,x.timelineStart=qe;const nt=a;a+=be,r.push({event:x,start:qe,end:pt,playout:{start:nt,end:a},integrated:{start:at,end:g}})}else if(le<=n){if(!Ue){const Ze=le-_;if(Ze>Hl){const wt=_,Wt=g;g+=Ze;const Zt=a;a+=Ze;const rr={previousEvent:e[D-1]||null,nextEvent:x,start:wt,end:wt+Ze,playout:{start:Zt,end:a},integrated:{start:Wt,end:g}};r.push(rr)}else Ze>0&&Q&&(Q.cumulativeDuration+=Ze,r[r.length-1].end=le)}Y&&(pt=qe),x.timelineStart=qe;const at=g;g+=xe;const nt=a;a+=be,r.push({event:x,start:qe,end:pt,playout:{start:nt,end:a},integrated:{start:at,end:g}})}else return;const Ye=x.resumeTime;Y||Ye>n?_=n:_=Ye}),_<n){var h;const x=_,D=g,j=n-_;g+=j;const Y=a;a+=j,r.push({previousEvent:((h=r[r.length-1])==null?void 0:h.event)||null,nextEvent:null,start:_,end:x+j,playout:{start:Y,end:a},integrated:{start:D,end:g}})}this.setDurations(n,a,g)}else r.push({previousEvent:null,nextEvent:null,start:0,end:n,playout:{start:0,end:n},integrated:{start:0,end:n}}),this.setDurations(n,n,n);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 n=0,a=-1;e.forEach((h,_)=>{const g=h.cue.pre,x=h.cue.post,D=g?0:x?i:h.startTime;this.updateAssetDurations(h),a===D?h.cumulativeDuration=n:(n=0,a=D),!x&&h.snapOptions.in&&(h.resumeAnchor=ai(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<Hl&&(e[_+1].appendInPlace=!1,e[_+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${h}`));const Y=R(h.resumeOffset)?h.resumeOffset:h.duration;n+=Y})}primaryCanResumeInPlaceAt(e,t){const r=e.resumeTime,i=e.startTime+e.resumptionOffset;return Math.abs(r-i)>Gs?(this.log(`"${e.identifier}" resumption ${r} not aligned with estimated timeline end ${i}`),!1):!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=ai(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 x=a==="audio"?.175:0;return Math.abs(g.start-r)<Gs+x||Math.abs(g.end-r)<Gs+x?!1:(this.log(`"${e.identifier}" resumption ${r} not aligned with ${a} fragment bounds (${g.start}-${g.end} sn: ${g.sn} cc: ${g.cc})`),!0)})}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let r=0,i=!1,n=!1;for(let a=0;a<e.assetList.length;a++){const h=e.assetList[a],_=t+r;h.startOffset=r,h.timelineStart=_,i||(i=h.duration===null),n||(n=!!h.error);const g=h.error?0:h.duration||0;r+=g}i&&!n?e.duration=Math.max(r,e.duration):e.duration=r}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Rn(o){return`[${o.event?'"'+o.event.identifier+'"':"primary"}: ${o.start.toFixed(2)}-${o.end.toFixed(2)}]`}class Nc{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const r=e.assetListUrl;let i;try{i=zl(r,this.hls.sessionId,e.baseUrl)}catch(j){const Y=this.assignAssetListError(e,A.ASSET_LIST_LOAD_ERROR,j,r);this.hls.trigger(d.ERROR,Y);return}t&&i.protocol!=="data:"&&i.searchParams.set("_HLS_start_offset",""+t);const n=this.hls.config,a=n.loader,h=new a(n),_={responseType:"json",url:i.href},g=n.interstitialAssetListLoadPolicy.default,x={loadPolicy:g,timeout:g.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},D={onSuccess:(j,Y,Q,ue)=>{const le=j.data,be=le==null?void 0:le.ASSETS;if(!Array.isArray(be)){const xe=this.assignAssetListError(e,A.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),Q.url,Y,ue);this.hls.trigger(d.ERROR,xe);return}e.assetListResponse=le,this.hls.trigger(d.ASSET_LIST_LOADED,{event:e,assetListResponse:le,networkDetails:ue})},onError:(j,Y,Q,ue)=>{const le=this.assignAssetListError(e,A.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${j.code} ${j.text} (${Y.url})`),Y.url,ue,Q);this.hls.trigger(d.ERROR,le)},onTimeout:(j,Y,Q)=>{const ue=this.assignAssetListError(e,A.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${Y.url})`),Y.url,j,Q);this.hls.trigger(d.ERROR,ue)}};return h.load(_,x,D),this.hls.trigger(d.ASSET_LIST_LOADING,{event:e}),h}assignAssetListError(e,t,r,i,n,a){return e.error=r,{type:P.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:i,error:r,networkDetails:a,stats:n}}}function jl(o){var e;o==null||(e=o.play())==null||e.catch(()=>{})}function fo(o,e){return`[${o}] Advancing timeline position to ${e}`}class Uc extends M{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||!this.schedule)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(!0),this.checkBuffer(),a&&r<h.start||r>=h.end){var _;const Y=this.findItemIndex(h);let Q=this.schedule.findItemIndexAtTime(r);if(Q===-1&&(Q=Y+(a?-1:1),this.log(`seeked ${a?"back ":""}to position not covered by schedule ${r} (resolving from ${Y} to ${Q})`)),!this.isInterstitial(h)&&(_=this.media)!=null&&_.paused&&(this.shouldPlay=!1),!a&&Q>Y){const ue=this.schedule.findJumpRestrictedIndex(Y+1,Q);if(ue>Y){this.setSchedulePosition(ue);return}}this.setSchedulePosition(Q);return}const g=this.playingAsset;if(!g){if(this.playingLastItem&&this.isInterstitial(h)){const Y=h.event.assetList[0];Y&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(r,Y))}return}const x=g.timelineStart,D=g.duration||0;if(a&&r<x||r>=x+D){var j;(j=h.event)!=null&&j.appendInPlace&&(this.clearAssetPlayers(h.event,h),this.flushFrontBuffer(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 n=this.playingAsset;if(!n)return;const a=n.timelineStart+(n.duration||0);r>=a&&this.setScheduleToAssetAtTime(r,n)},this.onScheduleUpdate=(r,i)=>{const n=this.schedule;if(!n)return;const a=this.playingItem,h=n.events||[],_=n.items||[],g=n.durations,x=r.map(ue=>ue.identifier),D=!!(h.length||x.length);(D||i)&&this.log(`INTERSTITIALS_UPDATED (${h.length}): ${h}
|
|
|
Schedule: ${_.map(ue=>Rn(ue))} pos: ${this.timelinePos}`),x.length&&this.log(`Removed events ${x}`);let j=null,Y=null;a&&(j=this.updateItem(a,this.timelinePos),this.itemsMatch(a,j)?this.playingItem=j:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const Q=this.bufferingItem;if(Q&&(Y=this.updateItem(Q,this.bufferedPos),this.itemsMatch(Q,Y)?this.bufferingItem=Y:Q.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(Q.event,null))),r.forEach(ue=>{ue.assetList.forEach(le=>{this.clearAssetPlayer(le.identifier,null)})}),this.playerQueue.forEach(ue=>{if(ue.interstitial.appendInPlace){const le=ue.assetItem.timelineStart,be=ue.timelineOffset-le;if(be)try{ue.timelineOffset=le}catch(xe){Math.abs(be)>Gs&&this.warn(`${xe} ("${ue.assetId}" ${ue.timelineOffset}->${le})`)}}}),D||i){if(this.hls.trigger(d.INTERSTITIALS_UPDATED,{events:h.slice(0),schedule:_.slice(0),durations:g,removedIds:x}),this.isInterstitial(a)&&x.includes(a.event.identifier)){this.warn(`Interstitial "${a.event.identifier}" removed while playing`),this.primaryFallback(a.event);return}a&&this.trimInPlace(j,a),Q&&Y!==j&&this.trimInPlace(Y,Q),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new Nc(e),this.schedule=new Bc(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e&&(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.schedule=this.manager=null,this.hls=this.HlsPlayerClass=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){xi(e,"play",this.onPlay),xi(e,"pause",this.onPause),xi(e,"seeking",this.onSeeking),xi(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const r=this.media=t.media;_i(r,"seeking",this.onSeeking),_i(r,"timeupdate",this.onTimeupdate),_i(r,"play",this.onPlay),_i(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 n=this.findItemIndex(r);this.setSchedulePosition(n)}}clearScheduleState(){this.log("clear schedule state"),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 n=this.getBufferingPlayer();n&&(this.log(`Removing schedule state for detachedData and ${n}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,n.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const e=this,t=()=>e.bufferingItem||e.waitingItem,r=D=>D&&e.getAssetPlayer(D.identifier),i=(D,j,Y,Q,ue)=>{if(D){let le=D[j].start;const be=D.event;if(be){if(j==="playout"||be.timelineOccupancy!==ho.Point){const xe=r(Y);(xe==null?void 0:xe.interstitial)===be&&(le+=xe.assetItem.startOffset+xe[ue])}}else{const xe=Q==="bufferedPos"?a():e[Q];le+=xe-D.start}return le}return 0},n=(D,j)=>{var Y;if(D!==0&&j!=="primary"&&(Y=e.schedule)!=null&&Y.length){var Q;const ue=e.schedule.findItemIndexAtTime(D),le=(Q=e.schedule.items)==null?void 0:Q[ue];if(le){const be=le[j].start-le.start;return D+be}}return D},a=()=>{const D=e.bufferedPos;return D===Number.MAX_VALUE?h("primary"):Math.max(D,0)},h=D=>{var j,Y;return(j=e.primaryDetails)!=null&&j.live?e.primaryDetails.edge:((Y=e.schedule)==null?void 0:Y.durations[D])||0},_=(D,j)=>{var Y,Q;const ue=e.effectivePlayingItem;if(ue!=null&&(Y=ue.event)!=null&&Y.restrictions.skip||!e.schedule)return;e.log(`seek to ${D} "${j}"`);const le=e.effectivePlayingItem,be=e.schedule.findItemIndexAtTime(D,j),xe=(Q=e.schedule.items)==null?void 0:Q[be],Ce=e.getBufferingPlayer(),Ue=Ce==null?void 0:Ce.interstitial,qe=Ue==null?void 0:Ue.appendInPlace,pt=le&&e.itemsMatch(le,xe);if(le&&(qe||pt)){const Ye=r(e.playingAsset),at=(Ye==null?void 0:Ye.media)||e.primaryMedia;if(at){const nt=j==="primary"?at.currentTime:i(le,j,e.playingAsset,"timelinePos","currentTime"),Ze=D-nt,wt=(qe?nt:at.currentTime)+Ze;if(wt>=0&&(!Ye||qe||wt<=Ye.duration)){at.currentTime=wt;return}}}if(xe){let Ye=D;if(j!=="primary"){const nt=xe[j].start,Ze=D-nt;Ye=xe.start+Ze}const at=!e.isInterstitial(xe);if((!e.isInterstitial(le)||le.event.appendInPlace)&&(at||xe.event.appendInPlace)){const nt=e.media||(qe?Ce==null?void 0:Ce.media:null);nt&&(nt.currentTime=Ye)}else if(le){const nt=e.findItemIndex(le);if(be>nt){const wt=e.schedule.findJumpRestrictedIndex(nt+1,be);if(wt>nt){e.setSchedulePosition(wt);return}}let Ze=0;if(at)e.timelinePos=Ye,e.checkBuffer();else{const wt=xe.event.assetList,Wt=D-(xe[j]||xe).start;for(let Zt=wt.length;Zt--;){const rr=wt[Zt];if(rr.duration&&Wt>=rr.startOffset&&Wt<rr.startOffset+rr.duration){Ze=Zt;break}}}e.setSchedulePosition(be,Ze)}}},g=()=>{const D=e.effectivePlayingItem;if(e.isInterstitial(D))return D;const j=t();return e.isInterstitial(j)?j:null},x={get bufferedEnd(){const D=t(),j=e.bufferingItem;if(j&&j===D){var Y;return i(j,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-j.playout.start||((Y=e.bufferingAsset)==null?void 0:Y.startOffset)||0}return 0},get currentTime(){const D=g(),j=e.effectivePlayingItem;return j&&j===D?i(j,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-j.playout.start:0},set currentTime(D){const j=g(),Y=e.effectivePlayingItem;Y&&Y===j&&_(D+Y.playout.start,"playout")},get duration(){const D=g();return D?D.playout.end-D.playout.start:0},get assetPlayers(){var D;const j=(D=g())==null?void 0:D.event.assetList;return j?j.map(Y=>e.getAssetPlayer(Y.identifier)):[]},get playingIndex(){var D;const j=(D=g())==null?void 0:D.event;return j&&e.effectivePlayingAsset?j.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return g()}};return this.manager={get events(){var D;return((D=e.schedule)==null||(D=D.events)==null?void 0:D.slice(0))||[]},get schedule(){var D;return((D=e.schedule)==null||(D=D.items)==null?void 0:D.slice(0))||[]},get interstitialPlayer(){return g()?x:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const D=t();return e.findItemIndex(D)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const D=e.effectivePlayingItem;return e.findItemIndex(D)},primary:{get bufferedEnd(){return a()},get currentTime(){const D=e.timelinePos;return D>0?D:0},set currentTime(D){_(D,"primary")},get duration(){return h("primary")},get seekableStart(){var D;return((D=e.primaryDetails)==null?void 0:D.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(D){_(D,"integrated")},get duration(){return h("integrated")},get seekableStart(){var D;return n(((D=e.primaryDetails)==null?void 0:D.fragmentStart)||0,"integrated")}},skip:()=>{const D=e.effectivePlayingItem,j=D==null?void 0:D.event;if(j&&!j.restrictions.skip){const Y=e.findItemIndex(D);if(j.appendInPlace){const Q=D.playout.start+D.event.duration;_(Q+.001,"playout")}else e.advanceAfterAssetEnded(j,Y,1/0)}}}}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;if(this.mediaSelection===null)return;const r=this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&!r.event.appendInPlace)return;let i=this.media;!i&&(e=this.bufferingItem)!=null&&(e=e.event)!=null&&e.appendInPlace&&(i=this.primaryMedia);const n=(t=i)==null?void 0:t.currentTime;if(!(n===void 0||!R(n)))return n}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 n=e.transferMedia();this.log(`transfer MediaSource from ${e} ${ir(n)}`),this.detachedData=n}else t&&i&&(this.shouldPlay||(this.shouldPlay=!i.paused))}transferMediaTo(e,t){var r,i;if(e.media===t)return;let n=null;const a=this.hls,h=e!==a,_=h&&e.interstitial.appendInPlace,g=(r=this.detachedData)==null?void 0:r.mediaSource;let x;if(a.media)_&&(n=a.transferMedia(),this.detachedData=n),x="Primary";else if(g){const Q=this.getBufferingPlayer();Q?(n=Q.transferMedia(),x=`${Q}`):x="detached MediaSource"}else x="detached media";if(!n){if(g)n=this.detachedData,this.log(`using detachedData: MediaSource ${ir(n)}`);else if(!this.detachedData||a.media===t){const Q=this.playerQueue;Q.length>1&&Q.forEach(ue=>{if(h&&ue.interstitial.appendInPlace!==_){const le=ue.interstitial;this.clearInterstitial(ue.interstitial,null),le.appendInPlace=!1,le.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${le}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const D=n&&"mediaSource"in n&&((i=n.mediaSource)==null?void 0:i.readyState)!=="closed",j=D&&n?n:t;this.log(`${D?"transfering MediaSource":"attaching media"} to ${h?e:"Primary"} from ${x} (media.currentTime: ${t.currentTime})`);const Y=this.schedule;if(j===n&&Y){const Q=h&&e.assetId===Y.assetIdAtEnd;j.overrides={duration:Y.duration,endOfStream:!h||Q,cueRemoval:!h}}e.attachMedia(j)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e==null?void 0: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 n=this.hls.startPosition;if(this.log(fo("checkStart",n)),this.timelinePos=n,t.length&&t[0].cue.pre){const a=e.findEventIndex(t[0].identifier);this.setSchedulePosition(a)}else if(n>=0||!this.primaryLive){const a=this.timelinePos=n>0?n:0,h=e.findItemIndexAtTime(a);this.setSchedulePosition(h)}}else if(i&&!this.playingItem){const n=e.findItemIndex(i);this.setSchedulePosition(n)}}advanceAssetBuffering(e,t){const r=e.event,i=r.findAssetIndex(t),n=Xo(r,i);if(!r.isAssetPastPlayoutLimit(n))this.bufferedToEvent(e,n);else if(this.schedule){var a;const h=(a=this.schedule.items)==null?void 0:a[this.findItemIndex(e)+1];h&&this.bufferedToItem(h)}}advanceAfterAssetEnded(e,t,r){const i=Xo(e,r);if(e.isAssetPastPlayoutLimit(i)){if(this.schedule){const n=this.schedule.items;if(n){const a=t+1,h=n.length;if(a>=h){this.setSchedulePosition(-1);return}const _=e.resumeTime;this.timelinePos<_&&(this.log(fo("advanceAfterAssetEnded",_)),this.timelinePos=_,e.appendInPlace&&this.advanceInPlace(_),this.checkBuffer(this.bufferedPos<_)),this.setSchedulePosition(a)}}}else{if(e.appendInPlace){const n=e.assetList[i];n&&this.advanceInPlace(n.timelineStart)}this.setSchedulePosition(t,i)}}setScheduleToAssetAtTime(e,t){const r=this.schedule;if(!r)return;const i=t.parentIdentifier,n=r.getEvent(i);if(n){const a=r.findEventIndex(i),h=r.findAssetIndex(n,e);this.advanceAfterAssetEnded(n,a,h-1)}}setSchedulePosition(e,t){var r;const i=(r=this.schedule)==null?void 0:r.items;if(!i||this.playbackDisabled)return;const n=e>=0?i[e]:null;this.log(`setSchedulePosition ${e}, ${t} (${n&&Rn(n)}) pos: ${this.timelinePos}`);const a=this.waitingItem||this.playingItem,h=this.playingLastItem;if(this.isInterstitial(a)){const x=a.event,D=this.playingAsset,j=D==null?void 0:D.identifier,Y=j?this.getAssetPlayer(j):null;if(Y&&j&&(!this.eventItemsMatch(a,n)||t!==void 0&&j!==x.assetList[t].identifier)){var _;const Q=x.findAssetIndex(D);if(this.log(`INTERSTITIAL_ASSET_ENDED ${Q+1}/${x.assetList.length} ${Ks(D)}`),this.endedAsset=D,this.playingAsset=null,this.hls.trigger(d.INTERSTITIAL_ASSET_ENDED,{asset:D,assetListIndex:Q,event:x,schedule:i.slice(0),scheduleIndex:e,player:Y}),a!==this.playingItem){this.itemsMatch(a,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(x,this.findItemIndex(this.playingItem),Q);return}this.retreiveMediaSource(j,n),Y.media&&!((_=this.detachedData)!=null&&_.mediaSource)&&Y.detachMedia()}if(!this.eventItemsMatch(a,n)&&(this.endedItem=a,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${x} ${Rn(a)}`),x.hasPlayed=!0,this.hls.trigger(d.INTERSTITIAL_ENDED,{event:x,schedule:i.slice(0),scheduleIndex:e}),x.cue.once)){var g;this.updateSchedule();const Q=(g=this.schedule)==null?void 0:g.items;if(n&&Q){const ue=this.findItemIndex(n);this.advanceSchedule(ue,Q,t,a,h)}return}}this.advanceSchedule(e,i,t,a,h)}advanceSchedule(e,t,r,i,n){const a=this.schedule;if(!a)return;const h=t[e]||null,_=this.primaryMedia,g=this.playerQueue;if(g.length&&g.forEach(x=>{const D=x.interstitial,j=a.findEventIndex(D.identifier);(j<e||j>e+1)&&this.clearInterstitial(D,h)}),this.isInterstitial(h)){this.timelinePos=Math.min(Math.max(this.timelinePos,h.start),h.end);const x=h.event;if(r===void 0){r=a.findAssetIndex(x,this.timelinePos);const Q=Xo(x,r-1);if(x.isAssetPastPlayoutLimit(Q)||x.appendInPlace&&this.timelinePos===h.end){this.advanceAfterAssetEnded(x,e,r);return}r=Q}const D=this.waitingItem;this.assetsBuffered(h,_)||this.setBufferingItem(h);let j=this.preloadAssets(x,r);if(this.eventItemsMatch(h,D||i)||(this.waitingItem=h,this.log(`INTERSTITIAL_STARTED ${Rn(h)} ${x.appendInPlace?"append in place":""}`),this.hls.trigger(d.INTERSTITIAL_STARTED,{event:x,schedule:t.slice(0),scheduleIndex:e})),!x.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${x}`);return}if(x.assetListLoader&&(x.assetListLoader.destroy(),x.assetListLoader=void 0),!_){this.log(`Waiting for attachMedia to start Interstitial ${x}`);return}this.waitingItem=this.endedItem=null,this.playingItem=h;const Y=x.assetList[r];if(!Y){this.advanceAfterAssetEnded(x,e,r||0);return}if(j||(j=this.getAssetPlayer(Y.identifier)),j===null||j.destroyed){const Q=x.assetList.length;this.warn(`asset ${r+1}/${Q} player destroyed ${x}`),j=this.createAssetPlayer(x,Y,r),j.loadSource()}if(!this.eventItemsMatch(h,this.bufferingItem)&&x.appendInPlace&&this.isAssetBuffered(Y))return;this.startAssetPlayer(j,r,t,e,_),this.shouldPlay&&jl(j.media)}else h?(this.resumePrimary(h,e,i),this.shouldPlay&&jl(this.hls.media)):n&&this.isInterstitial(i)&&(this.endedItem=null,this.playingItem=i,i.event.appendInPlace||this.attachPrimary(a.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e;return(e=this.mediaSelection)==null?void 0:e.main.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,r){var i,n;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Rn(e)}`),!((i=this.detachedData)!=null&&i.mediaSource)){let h=this.timelinePos;(h<e.start||h>=e.end)&&(h=this.getPrimaryResumption(e,t),this.log(fo("resumePrimary",h)),this.timelinePos=h),this.attachPrimary(h,e)}if(!r)return;const a=(n=this.schedule)==null?void 0:n.items;a&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Rn(e)}`),this.hls.trigger(d.INTERSTITIALS_PRIMARY_RESUMED,{schedule:a.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:nr.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 n=this.hls;n.media?this.checkBuffer():(this.transferMediaTo(n,i),r&&this.startLoadingPrimaryAt(e,r)),r||(this.log(fo("attachPrimary",e)),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(){var e;this.stopLoad(),(e=this.schedule)==null||e.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||!this.schedule)return;const r=this.hls.levels[t.level];if(!r.details)return;const i=c(c({},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=c(c({},this.altSelection),{},{audio:r});return}const n=c(c({},i),{},{audio:r});this.mediaSelection=n}onSubtitleTrackUpdated(e,t){const r=this.hls.subtitleTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=c(c({},this.altSelection),{},{subtitles:r});return}const n=c(c({},i),{},{subtitles:r});this.mediaSelection=n}onAudioTrackSwitching(e,t){const r=es(t);this.playerQueue.forEach(({hls:i})=>i&&(i.setAudioOption(t)||i.setAudioOption(r)))}onSubtitleTrackSwitch(e,t){const r=es(t);this.playerQueue.forEach(({hls:i})=>i&&(i.setSubtitleOption(t)||t.id!==-1&&i.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){if(!this.schedule)return;const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let i=0;i<t.length;i++){const n=t[i];if(n.cue.post){var r;const a=this.schedule.findEventIndex(n.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){var r;const i=(r=this.schedule)==null?void 0:r.items;if(e&&i){const n=this.findItemIndex(e,t);return i[n]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((n,a)=>{e.event.isAssetPastPlayoutLimit(a)&&this.clearAssetPlayer(n.identifier,null)});const r=e.end+.25,i=nr.bufferInfo(this.primaryMedia,r,0);(i.end>r||(i.nextStart||0)>r)&&(this.log(`trim buffered interstitial ${Rn(e)} (was ${Rn(t)})`),this.attachPrimary(r,null,!0),this.flushFrontBuffer(r))}}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?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t;const r=this.mediaSelection;r&&((t=this.schedule)==null||t.updateSchedule(r,[],e))}checkBuffer(e){var t;const r=(t=this.schedule)==null?void 0:t.items;if(!r)return;const i=nr.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=i.len<1),this.updateBufferedPos(i.end,r,e)}updateBufferedPos(e,t,r){const i=this.schedule,n=this.bufferingItem;if(this.bufferedPos>e||!i)return;if(t.length===1&&this.itemsMatch(t[0],n)){this.bufferedPos=e;return}const a=this.playingItem,h=this.findItemIndex(a);let _=i.findItemIndexAtTime(e);if(this.bufferedPos<e){var g;const x=this.findItemIndex(n),D=Math.min(x+1,t.length-1),j=t[D];if((_===-1&&n&&e>=n.end||(g=j.event)!=null&&g.appendInPlace&&e+.01>=j.start)&&(_=D),this.isInterstitial(n)){const Y=n.event;if(D-h>1&&Y.appendInPlace===!1||Y.assetList.length===0&&Y.assetListLoader)return}if(this.bufferedPos=e,_>x&&_>h)this.bufferedToItem(j);else{const Y=this.primaryDetails;this.primaryLive&&Y&&e>Y.edge-Y.targetduration&&j.start<Y.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(j)&&this.preloadAssets(j.event,0)}}else r&&a&&!this.itemsMatch(a,n)&&(_===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 n=this.getAssetPlayer(i.identifier);return!(n!=null&&n.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,r=this.schedule;if(!this.itemsMatch(e,t)&&r){const{items:i,events:n}=r;if(!i||!n)return t;const a=this.isInterstitial(e),h=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const _=h?h.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Rn(e)}`+(t?` (${_.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(a){const g=r.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach((x,D)=>{const j=this.getAssetPlayer(x.identifier);j&&(D===g&&j.loadSource(),j.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(g=>g.pauseBuffering());this.hls.trigger(d.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:n.slice(0),schedule:i.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);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,n=r.cue.once;if(i||!n){const a=this.preloadAssets(r,t);if(a!=null&&a.interstitial.appendInPlace){const h=this.primaryMedia;h&&this.bufferAssetPlayer(a,h)}}}preloadAssets(e,t){const r=e.assetUrl,i=e.assetList.length,n=i===0&&!e.assetListLoader,a=e.cue.once;if(n){const _=e.timelineStart;if(e.appendInPlace){var h;const j=this.playingItem;!this.isInterstitial(j)&&(j==null||(h=j.nextEvent)==null?void 0:h.identifier)===e.identifier&&this.flushFrontBuffer(_+.25)}let g,x=0;if(!this.playingItem&&this.primaryLive&&(x=this.hls.startPosition,x===-1&&(x=this.hls.liveSyncPosition||0)),x&&!(e.cue.pre||e.cue.post)){const j=x-_;j>0&&(g=Math.round(j*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${r?1:i} ${e}${g?` live-start: ${x} start-offset: ${g}`:""}`),r)return this.createAsset(e,0,0,_,e.duration,r);const D=this.assetListLoader.loadAssetList(e,g);D&&(e.assetListLoader=D)}else if(!a&&i){for(let g=t;g<i;g++){const x=e.assetList[g],D=this.getAssetPlayerQueueIndex(x.identifier);(D===-1||this.playerQueue[D].destroyed)&&!x.error&&this.createAssetPlayer(e,x,g)}const _=e.assetList[t];if(_){const g=this.getAssetPlayer(_.identifier);return g&&g.loadSource(),g}}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,n,a){const h={parentIdentifier:e.identifier,identifier:Pc(e,a,t),duration:n,startOffset:r,timelineStart:i,uri:a};return this.createAssetPlayer(e,h,t)}createAssetPlayer(e,t,r){const i=this.hls,n=i.userConfig;let a=n.videoPreference;const h=i.loadLevelObj||i.levels[i.currentLevel];(a||h)&&(a=u({},a),h.videoCodec&&(a.videoCodec=h.videoCodec),h.videoRange&&(a.allowedVideoRanges=[h.videoRange]));const _=i.audioTracks[i.audioTrack],g=i.subtitleTracks[i.subtitleTrack];let x=0;if(this.primaryLive||e.appendInPlace){const Ue=this.timelinePos-t.timelineStart;if(Ue>1){const qe=t.duration;qe&&Ue<qe&&(x=Ue)}}const D=t.identifier,j=c(c({},n),{},{maxMaxBufferLength:Math.min(180,i.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:i.sessionId,assetPlayerId:D,abrEwmaDefaultEstimate:i.bandwidthEstimate,interstitialsController:void 0,startPosition:x,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:a,audioPreference:_||n.audioPreference,subtitlePreference:g||n.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(j.timelineOffset=t.timelineStart));const Y=j.cmcd;Y!=null&&Y.sessionId&&Y.contentId&&(j.cmcd=u({},Y,{contentId:xa(t.uri)})),this.getAssetPlayer(D)&&this.warn(`Duplicate date range identifier ${e} and asset ${D}`);const Q=new Fc(this.HlsPlayerClass,j,e,t);this.playerQueue.push(Q),e.assetList[r]=t;let ue=!0;const le=Ue=>{if(Ue.live){var qe;const at=new Error(`Interstitials MUST be VOD assets ${e}`),nt={fatal:!0,type:P.OTHER_ERROR,details:A.INTERSTITIAL_ASSET_ITEM_ERROR,error:at},Ze=((qe=this.schedule)==null?void 0:qe.findEventIndex(e.identifier))||-1;this.handleAssetItemError(nt,e,Ze,r,at.message);return}const pt=Ue.edge-Ue.fragmentStart,Ye=t.duration;(ue||Ye===null||pt>Ye)&&(ue=!1,this.log(`Interstitial asset "${D}" duration change ${Ye} > ${pt}`),t.duration=pt,this.updateSchedule())};Q.on(d.LEVEL_UPDATED,(Ue,{details:qe})=>le(qe)),Q.on(d.LEVEL_PTS_UPDATED,(Ue,{details:qe})=>le(qe)),Q.on(d.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const be=(Ue,qe)=>{const pt=this.getAssetPlayer(D);if(pt&&qe.tracks){pt.off(d.BUFFER_CODECS,be),pt.tracks=qe.tracks;const Ye=this.primaryMedia;this.bufferingAsset===pt.assetItem&&Ye&&!pt.media&&this.bufferAssetPlayer(pt,Ye)}};Q.on(d.BUFFER_CODECS,be);const xe=()=>{var Ue;const qe=this.getAssetPlayer(D);if(this.log(`buffered to end of asset ${qe}`),!qe||!this.schedule)return;const pt=this.schedule.findEventIndex(e.identifier),Ye=(Ue=this.schedule.items)==null?void 0:Ue[pt];this.isInterstitial(Ye)&&this.advanceAssetBuffering(Ye,t)};Q.on(d.BUFFERED_TO_END,xe);const Ce=Ue=>()=>{if(!this.getAssetPlayer(D)||!this.schedule)return;this.shouldPlay=!0;const pt=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,pt,Ue)};return Q.once(d.MEDIA_ENDED,Ce(r)),Q.once(d.PLAYOUT_LIMIT_REACHED,Ce(1/0)),Q.on(d.ERROR,(Ue,qe)=>{if(!this.schedule)return;const pt=this.getAssetPlayer(D);if(qe.details===A.BUFFER_STALLED_ERROR){if(pt!=null&&pt.appendInPlace){this.handleInPlaceStall(e);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(qe,e,this.schedule.findEventIndex(e.identifier),r,`Asset player error ${qe.error} ${e}`)}),Q.on(d.DESTROYING,()=>{if(!this.getAssetPlayer(D)||!this.schedule)return;const qe=new Error(`Asset player destroyed unexpectedly ${D}`),pt={fatal:!0,type:P.OTHER_ERROR,details:A.INTERSTITIAL_ASSET_ITEM_ERROR,error:qe};this.handleAssetItemError(pt,e,this.schedule.findEventIndex(e.identifier),r,qe.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${Ks(t)}`),this.hls.trigger(d.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:r,event:e,player:Q}),Q}clearInterstitial(e,t){this.clearAssetPlayers(e,t),e.reset()}clearAssetPlayers(e,t){e.assetList.forEach(r=>{this.clearAssetPlayer(r.identifier,t)})}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);const r=this.playerQueue[t];this.transferMediaFromPlayer(r,null),r.resetDetails()}}clearAssetPlayer(e,t){const r=this.getAssetPlayerQueueIndex(e);if(r!==-1){const i=this.playerQueue[r];this.log(`clear ${i} toSegment: ${t&&Rn(t)}`),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,n){const{interstitial:a,assetItem:h,assetId:_}=e,g=a.assetList.length,x=this.playingAsset;this.endedAsset=null,this.playingAsset=h,(!x||x.identifier!==_)&&(x&&(this.clearAssetPlayer(x.identifier,r[i]),delete x.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${g} ${Ks(h)}`),this.hls.trigger(d.INTERSTITIAL_ASSET_STARTED,{asset:h,assetListIndex:t,event:a,schedule:r.slice(0),scheduleIndex:i,player:e})),this.bufferAssetPlayer(e,n)}bufferAssetPlayer(e,t){var r,i;if(!this.schedule)return;const{interstitial:n,assetItem:a}=e,h=this.schedule.findEventIndex(n.identifier),_=(r=this.schedule.items)==null?void 0:r[h];if(!_)return;e.loadSource(),this.setBufferingItem(_),this.bufferingAsset=a;const g=this.getBufferingPlayer();if(g===e)return;const x=n.appendInPlace;if(x&&(g==null?void 0:g.interstitial.appendInPlace)===!1)return;const D=(g==null?void 0:g.tracks)||((i=this.detachedData)==null?void 0:i.tracks)||this.requiredTracks;if(x&&a!==this.playingAsset){if(!e.tracks){this.log(`Waiting for track info before buffering ${e}`);return}if(D&&!_e(D,e.tracks)){const j=new Error(`Asset ${Ks(a)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(D)}')`),Y={fatal:!0,type:P.OTHER_ERROR,details:A.INTERSTITIAL_ASSET_ITEM_ERROR,error:j},Q=n.findAssetIndex(a);this.handleAssetItemError(Y,n,h,Q,j.message);return}}this.transferMediaTo(e,t)}handleInPlaceStall(e){const t=this.schedule,r=this.primaryMedia;if(!t||!r)return;const i=r.currentTime,n=t.findAssetIndex(e,i),a=e.assetList[n];if(a){const h=this.getAssetPlayer(a.identifier);if(h){const _=h.currentTime||i-a.timelineStart,g=h.duration-_;if(this.warn(`Stalled at ${_} of ${_+g} in ${h} ${e} (media.currentTime: ${i})`),_&&(g/r.playbackRate<.5||h.bufferedInPlaceToEnd(r))&&h.hls){const x=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,x,n)}}}}advanceInPlace(e){const t=this.primaryMedia;t&&t.currentTime<e&&(t.currentTime=e)}handleAssetItemError(e,t,r,i,n){if(e.details===A.BUFFER_STALLED_ERROR)return;const a=t.assetList[i]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${a&&Ks(a)} ${e.error}`),!this.schedule)return;const h=(a==null?void 0:a.identifier)||"",_=this.getAssetPlayerQueueIndex(h),g=this.playerQueue[_]||null,x=this.schedule.items,D=u({},e,{fatal:!1,errorAction:ei(!0),asset:a,assetListIndex:i,event:t,schedule:x,scheduleIndex:r,player:g});if(this.hls.trigger(d.INTERSTITIAL_ASSET_ERROR,D),!e.fatal)return;const j=this.playingAsset,Y=this.bufferingAsset,Q=new Error(n);if(a&&(this.clearAssetPlayer(h,null),a.error=Q),!t.assetList.some(ue=>!ue.error))t.error=Q;else for(let ue=i;ue<t.assetList.length;ue++)this.resetAssetPlayer(t.assetList[ue].identifier);this.updateSchedule(!0),t.error?this.primaryFallback(t):j&&j.identifier===h?this.advanceAfterAssetEnded(t,r,i):Y&&Y.identifier===h&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,Y)}primaryFallback(e){const t=e.timelineStart,r=this.effectivePlayingItem;let i=this.timelinePos;if(r){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${i} playing: ${Rn(r)} error: ${e.error}`),i===-1&&(i=this.hls.startPosition);const a=this.updateItem(r,i);this.itemsMatch(r,a)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t))}else if(i===-1){this.checkStart();return}if(!this.schedule)return;const n=this.schedule.findItemIndexAtTime(i);this.setSchedulePosition(n)}onAssetListLoaded(e,t){var r,i;const n=t.event,a=n.identifier,h=t.assetListResponse.ASSETS;if(!((r=this.schedule)!=null&&r.hasEvent(a)))return;const _=n.timelineStart,g=n.duration;let x=0;h.forEach((ue,le)=>{const be=parseFloat(ue.DURATION);this.createAsset(n,le,x,_+x,be,ue.URI),x+=be}),n.duration=x,this.log(`Loaded asset-list with duration: ${x} (was: ${g}) ${n}`);const D=this.waitingItem,j=(D==null?void 0:D.event.identifier)===a;this.updateSchedule();const Y=(i=this.bufferingItem)==null?void 0:i.event;if(j){var Q;const ue=this.schedule.findEventIndex(a),le=(Q=this.schedule.items)==null?void 0:Q[ue];if(le){if(!this.playingItem&&this.timelinePos>le.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==ue){n.error=new Error(`Interstitial ${h.length?"no longer within playback range":"asset-list is empty"} ${this.timelinePos} ${n}`),this.log(n.error.message),this.updateSchedule(!0),this.primaryFallback(n);return}this.setBufferingItem(le)}this.setSchedulePosition(ue)}else if((Y==null?void 0:Y.identifier)===a){const ue=n.assetList[0];if(ue){const le=this.getAssetPlayer(ue.identifier);if(Y.appendInPlace){const be=this.primaryMedia;le&&be&&this.bufferAssetPlayer(le,be)}else le&&le.loadSource()}}}onError(e,t){if(this.schedule)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.updateSchedule(!0),this.primaryFallback(r));break}case A.BUFFER_STALLED_ERROR:{const r=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&r.event.appendInPlace){this.handleInPlaceStall(r.event);return}this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}const Wl=500;class $c extends _s{constructor(e,t,r){super(e,t,r,"subtitle-stream-controller",S.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=Et.IDLE,this.setInterval(Wl),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(this.fragContextChanged(r)||(Oe(r)&&(this.fragPrevious=r),this.state=Et.IDLE),!i)return;const n=this.tracksBuffered[this.currentTrackId];if(!n)return;let a;const h=r.start;for(let g=0;g<n.length;g++)if(h>=n[g].start&&h<=n[g].end){a=n[g];break}const _=r.start+r.duration;a?a.end=_:(a={start:h,end:_},n.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 n=i-1;if(n<=0)return;t.endOffsetSubtitles=Math.max(0,n),this.tracksBuffered.forEach(a=>{for(let h=0;h<a.length;){if(a[h].end<=n){a.shift();continue}else if(a[h].start<n)a[h].start=n;else break;h++}}),this.fragmentTracker.removeFragmentsInRange(r,n,S.SUBTITLE)}}onError(e,t){const r=t.frag;(r==null?void 0:r.type)===S.SUBTITLE&&(t.details===A.FRAG_GAP&&this.fragmentTracker.fragBuffered(r,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Et.STOPPED&&(this.state=Et.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&yl(this.levels,t)){this.levels=t.map(r=>new br(r));return}this.tracksBuffered=[],this.levels=t.map(r=>{const i=new br(r);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,S.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!==Et.STOPPED&&this.setInterval(Wl)}onSubtitleTrackLoaded(e,t){var r;const{currentTrackId:i,levels:n}=this,{details:a,id:h}=t;if(!n){this.warn(`Subtitle tracks were reset while loading level ${h}`);return}const _=n[h];if(h>=n.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){if(a.deltaUpdateFailed)return;const D=this.mainDetails;if(!D){this.startFragRequested=!1;return}const j=D.fragments[0];if(!_.details)a.hasProgramDateTime&&D.hasProgramDateTime?(ss(a,D),g=a.fragmentStart):j&&(g=j.start,ra(a,g));else{var x;g=this.alignPlaylists(a,_.details,(x=this.levelLastLoaded)==null?void 0:x.details),g===0&&j&&(g=j.start,ra(a,g))}D&&!this.startFragRequested&&this.setStartPosition(D,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===Et.IDLE&&(ai(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,n=this.hls;if(!this.fragContextChanged(t)&&r&&r.byteLength>0&&i!=null&&i.key&&i.iv&&Hi(i.method)){const a=performance.now();this.decrypter.decrypt(new Uint8Array(r),i.key.buffer,i.iv.buffer,Fn(i.method)).catch(h=>{throw n.trigger(d.ERROR,{type:P.MEDIA_ERROR,details:A.FRAG_DECRYPT_ERROR,fatal:!1,error:h,reason:h.message,frag:t}),h}).then(h=>{const _=performance.now();n.trigger(d.FRAG_DECRYPTED,{frag:t,payload:h,stats:{tstart:a,tdecrypt:_}})}).catch(h=>{this.warn(`${h.name}: ${h.message}`),this.state=Et.IDLE})}}doTick(){if(!this.media){this.state=Et.IDLE;return}if(this.state===Et.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,n=this.getLoadPosition(),a=nr.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],n,i.maxBufferHole),{end:h,len:_}=a,g=r.details,x=this.hls.maxBufferLength+g.levelTargetDuration;if(_>x)return;const D=g.fragments,j=D.length,Y=g.edge;let Q=null;const ue=this.fragPrevious;if(h<Y){const xe=i.maxFragLookUpTolerance,Ce=h>Y-xe?0:xe;Q=ai(ue,D,Math.max(D[0].start,h),Ce),!Q&&ue&&ue.start<D[0].start&&(Q=D[0])}else Q=D[j-1];if(Q=this.filterReplacedPrimary(Q,r.details),!Q)return;const le=Q.sn-g.startSN,be=D[le-1];if(be&&be.cc===Q.cc&&this.fragmentTracker.getState(be)===$r.NOT_LOADED&&(Q=be),this.fragmentTracker.getState(Q)===$r.NOT_LOADED){const xe=this.mapToInitFragWhenRequired(Q);xe&&this.loadFragment(xe,r,h)}}}loadFragment(e,t,r){Oe(e)?super.loadFragment(e,t,r):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new zc(this.tracksBuffered[this.currentTrackId]||[])}}class zc{constructor(e){this.buffered=void 0;const t=(r,i,n)=>{if(i=i>>>0,i>n-1)throw new DOMException(`Failed to execute '${r}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${n})`);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 Hc={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},Gl=o=>String.fromCharCode(Hc[o]||o),Ln=15,Jn=100,jc={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Wc={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Gc={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Kc={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Vc=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class qc{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 Kl{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 Yc{constructor(){this.uchar=" ",this.penState=new Kl}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 Zc{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Kl,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<Jn;t++)this.chars.push(new Yc);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=Gl(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 Qo{constructor(e){this.rows=[],this.currRow=Ln-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<Ln;t++)this.rows.push(new Zc(e));this.logger=e}reset(){for(let e=0;e<Ln;e++)this.rows[e].clear();this.currRow=Ln-1}equals(e){let t=!0;for(let r=0;r<Ln;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t}copy(e){for(let t=0;t<Ln;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<Ln;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 = "+ir(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<Ln;h++)this.rows[h].clear();const n=this.currRow+1-this.nrRollUpRows,a=this.lastOutputScreen;if(a){const h=a.rows[n].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[n+g])}}this.currRow=t;const r=this.rows[this.currRow];if(e.indent!==null){const n=e.indent,a=Math.max(n-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 = "+ir(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 n=0;n<Ln;n++){const a=this.rows[n].getTextString();a&&(i=n+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 Vl{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 Qo(r),this.nonDisplayedMemory=new Qo(r),this.lastOutputScreen=new Qo(r),this.currRollUpRow=this.displayedMemory.rows[Ln-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[Ln-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: "+ir(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 ql{constructor(e,t,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=Qc(),this.logger=void 0;const i=this.logger=new qc;this.channels=[null,new Vl(e,t,i),new Vl(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,n=t[r+1]&127;let a=!1,h=null;if(i===0&&n===0)continue;this.logger.log(3,()=>"["+Cs([t[r],t[r+1]])+"] -> ("+Cs([i,n])+")");const _=this.cmdHistory;if(i>=16&&i<=31){if(Xc(i,n,_)){po(null,null,_),this.logger.log(3,()=>"Repeated command ("+Cs([i,n])+") is dropped");continue}po(i,n,this.cmdHistory),a=this.parseCmd(i,n),a||(a=this.parseMidrow(i,n)),a||(a=this.parsePAC(i,n)),a||(a=this.parseBackgroundAttributes(i,n))}else po(null,null,_);if(!a&&(h=this.parseChars(i,n),h)){const x=this.currentChannel;x&&x>0?this.channels[x].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,n])+" 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 n=e===20||e===21||e===23?1:2,a=this.channels[n];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=n,!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,n=(e===16||e===24)&&t>=64&&t<=95;if(!(i||n))return!1;const a=e<=23?1:2;t>=64&&t<=95?r=a===1?jc[e]:Gc[e]:r=a===1?Wc[e]:Kc[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,n=null;if(e>=25?(r=2,n=e-8):(r=1,n=e),n>=17&&n<=19){let a;n===17?a=t+80:n===18?a=t+112:a=t+144,this.logger.log(2,()=>"Special char '"+Gl(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 n;const a={};e===16||e===24?(n=Math.floor((t-32)/2),a.background=Vc[n],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()}po(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 po(o,e,t){t.a=o,t.b=e}function Xc(o,e,t){return t.a===o&&t.b===e}function Qc(){return{a:null,b:null}}var Jo=function(){if(Mr!=null&&Mr.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 n(h,..._){let g=1;for(;g<arguments.length;g++){const x=arguments[g];for(const D in x)h[D]=x[D]}return h}function a(h,_,g){const x=this,D={enumerable:!0};x.hasBeenReset=!1;let j="",Y=!1,Q=h,ue=_,le=g,be=null,xe="",Ce=!0,Ue="auto",qe="start",pt=50,Ye="middle",at=50,nt="middle";Object.defineProperty(x,"id",n({},D,{get:function(){return j},set:function(Ze){j=""+Ze}})),Object.defineProperty(x,"pauseOnExit",n({},D,{get:function(){return Y},set:function(Ze){Y=!!Ze}})),Object.defineProperty(x,"startTime",n({},D,{get:function(){return Q},set:function(Ze){if(typeof Ze!="number")throw new TypeError("Start time must be set to a number.");Q=Ze,this.hasBeenReset=!0}})),Object.defineProperty(x,"endTime",n({},D,{get:function(){return ue},set:function(Ze){if(typeof Ze!="number")throw new TypeError("End time must be set to a number.");ue=Ze,this.hasBeenReset=!0}})),Object.defineProperty(x,"text",n({},D,{get:function(){return le},set:function(Ze){le=""+Ze,this.hasBeenReset=!0}})),Object.defineProperty(x,"region",n({},D,{get:function(){return be},set:function(Ze){be=Ze,this.hasBeenReset=!0}})),Object.defineProperty(x,"vertical",n({},D,{get:function(){return xe},set:function(Ze){const wt=r(Ze);if(wt===!1)throw new SyntaxError("An invalid or illegal string was specified.");xe=wt,this.hasBeenReset=!0}})),Object.defineProperty(x,"snapToLines",n({},D,{get:function(){return Ce},set:function(Ze){Ce=!!Ze,this.hasBeenReset=!0}})),Object.defineProperty(x,"line",n({},D,{get:function(){return Ue},set:function(Ze){if(typeof Ze!="number"&&Ze!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");Ue=Ze,this.hasBeenReset=!0}})),Object.defineProperty(x,"lineAlign",n({},D,{get:function(){return qe},set:function(Ze){const wt=i(Ze);if(!wt)throw new SyntaxError("An invalid or illegal string was specified.");qe=wt,this.hasBeenReset=!0}})),Object.defineProperty(x,"position",n({},D,{get:function(){return pt},set:function(Ze){if(Ze<0||Ze>100)throw new Error("Position must be between 0 and 100.");pt=Ze,this.hasBeenReset=!0}})),Object.defineProperty(x,"positionAlign",n({},D,{get:function(){return Ye},set:function(Ze){const wt=i(Ze);if(!wt)throw new SyntaxError("An invalid or illegal string was specified.");Ye=wt,this.hasBeenReset=!0}})),Object.defineProperty(x,"size",n({},D,{get:function(){return at},set:function(Ze){if(Ze<0||Ze>100)throw new Error("Size must be between 0 and 100.");at=Ze,this.hasBeenReset=!0}})),Object.defineProperty(x,"align",n({},D,{get:function(){return nt},set:function(Ze){const wt=i(Ze);if(!wt)throw new SyntaxError("An invalid or illegal string was specified.");nt=wt,this.hasBeenReset=!0}})),x.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}();class Jc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Yl(o){function e(r,i,n,a){return(r|0)*3600+(i|0)*60+(n|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 eh{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 Zl(o,e,t,r){const i=r?o.split(r):[o];for(const n in i){if(typeof i[n]!="string")continue;const a=i[n].split(t);if(a.length!==2)continue;const h=a[0],_=a[1];e(h,_)}}const el=new Jo(0,0,""),mo=el.align==="middle"?"middle":"center";function th(o,e,t){const r=o;function i(){const h=Yl(o);if(h===null)throw new Error("Malformed timestamp: "+r);return o=o.replace(/^[^\sa-zA-Z-]+/,""),h}function n(h,_){const g=new eh;Zl(h,function(j,Y){let Q;switch(j){case"region":for(let ue=t.length-1;ue>=0;ue--)if(t[ue].id===Y){g.set(j,t[ue].region);break}break;case"vertical":g.alt(j,Y,["rl","lr"]);break;case"line":Q=Y.split(","),g.integer(j,Q[0]),g.percent(j,Q[0])&&g.set("snapToLines",!1),g.alt(j,Q[0],["auto"]),Q.length===2&&g.alt("lineAlign",Q[1],["start",mo,"end"]);break;case"position":Q=Y.split(","),g.percent(j,Q[0]),Q.length===2&&g.alt("positionAlign",Q[1],["start",mo,"end","line-left","line-right","auto"]);break;case"size":g.percent(j,Y);break;case"align":g.alt(j,Y,["start",mo,"end","left","right"]);break}},/:/,/\s/),_.region=g.get("region",null),_.vertical=g.get("vertical","");let x=g.get("line","auto");x==="auto"&&el.line===-1&&(x=-1),_.line=x,_.lineAlign=g.get("lineAlign","start"),_.snapToLines=g.get("snapToLines",!0),_.size=g.get("size",100),_.align=g.get("align",mo);let D=g.get("position","auto");D==="auto"&&el.position===50&&(D=_.align==="start"||_.align==="left"?0:_.align==="end"||_.align==="right"?100:50),_.position=D}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(),n(o,e)}function Xl(o){return o.replace(/<br(?: \/)?>/gi,`
|
|
|
`)}class rh{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Jc,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 n=t.buffer,a=0;for(n=Xl(n);a<n.length&&n[a]!=="\r"&&n[a]!==`
|
|
|
`;)++a;const h=n.slice(0,a);return n[a]==="\r"&&++a,n[a]===`
|
|
|
`&&++a,t.buffer=n.slice(a),h}function i(n){Zl(n,function(a,h){},/:/)}try{let n="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;n=r();const h=n.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:n=r(),t.state){case"HEADER":/:/.test(n)?i(n):n||(t.state="ID");continue;case"NOTE":n||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){t.state="NOTE";break}if(!n)continue;if(t.cue=new Jo(0,0,""),t.state="CUE",n.indexOf("-->")===-1){t.cue.id=n;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{th(n,t.cue,t.regionList)}catch(h){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const h=n.indexOf("-->")!==-1;if(!n||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+=n}continue;case"BADCUE":n||(t.state="ID")}}}catch(n){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 ih=/\r\n|\n\r|\n|\r/g,tl=function(e,t,r=0){return e.slice(r,r+t.length)===t},nh=function(e){let t=parseInt(e.slice(-3));const r=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),n=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!R(t)||!R(r)||!R(i)||!R(n))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*r,t+=60*1e3*i,t+=60*60*1e3*n,t};function rl(o,e,t){return xa(o.toString())+xa(e.toString())+xa(t)}const sh=function(e,t,r){let i=e[t],n=e[i.prevCC];if(!n||!n.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(a=n)!=null&&a.new;){var a;e.ccOffset+=i.start-n.start,i.new=!1,i=n,n=e[i.prevCC]}e.presentationOffset=r};function ah(o,e,t,r,i,n,a){const h=new rh,_=Ae(new Uint8Array(o)).trim().replace(ih,`
|
|
|
`).split(`
|
|
|
`),g=[],x=e?$n(e.baseTime,e.timescale):0;let D="00:00.000",j=0,Y=0,Q,ue=!0;h.oncue=function(le){const be=t[r];let xe=t.ccOffset;const Ce=(j-x)/9e4;if(be!=null&&be.new&&(Y!==void 0?xe=t.ccOffset=be.start:sh(t,r,Ce)),Ce){if(!e){Q=new Error("Missing initPTS for VTT MPEGTS");return}xe=Ce-t.presentationOffset}const Ue=le.endTime-le.startTime,qe=Ui((le.startTime+xe-Y)*9e4,i*9e4)/9e4;le.startTime=Math.max(qe,0),le.endTime=Math.max(qe+Ue,0);const pt=le.text.trim();le.text=decodeURIComponent(encodeURIComponent(pt)),le.id||(le.id=rl(le.startTime,le.endTime,pt)),le.endTime>0&&g.push(le)},h.onparsingerror=function(le){Q=le},h.onflush=function(){if(Q){a(Q);return}n(g)},_.forEach(le=>{if(ue)if(tl(le,"X-TIMESTAMP-MAP=")){ue=!1,le.slice(16).split(",").forEach(be=>{tl(be,"LOCAL:")?D=be.slice(6):tl(be,"MPEGTS:")&&(j=parseInt(be.slice(7)))});try{Y=nh(D)/1e3}catch(be){Q=be}return}else le===""&&(ue=!1);h.parse(le+`
|
|
|
`)}),h.flush()}const il="stpp.ttml.im1t",Ql=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Jl=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,oh={left:"start",center:"center",right:"end",start:"start",end:"end"};function eu(o,e,t,r){const i=Se(new Uint8Array(o),["mdat"]);if(i.length===0){r(new Error("Could not parse IMSC1 mdat"));return}const n=i.map(h=>Ae(h)),a=Zi(e.baseTime,1,e.timescale);try{n.forEach(h=>t(lh(h,a)))}catch(h){r(h)}}function lh(o,e){const i=new DOMParser().parseFromString(o,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const n={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},a=Object.keys(n).reduce((D,j)=>(D[j]=i.getAttribute(`ttp:${j}`)||n[j],D),{}),h=i.getAttribute("xml:space")!=="preserve",_=tu(nl(i,"styling","style")),g=tu(nl(i,"layout","region")),x=nl(i,"body","[begin]");return[].map.call(x,D=>{const j=ru(D,h);if(!j||!D.hasAttribute("begin"))return null;const Y=al(D.getAttribute("begin"),a),Q=al(D.getAttribute("dur"),a);let ue=al(D.getAttribute("end"),a);if(Y===null)throw iu(D);if(ue===null){if(Q===null)throw iu(D);ue=Y+Q}const le=new Jo(Y-e,ue-e,j);le.id=rl(le.startTime,le.endTime,le.text);const be=g[D.getAttribute("region")],xe=_[D.getAttribute("style")],Ce=uh(be,xe,_),{textAlign:Ue}=Ce;if(Ue){const qe=oh[Ue];qe&&(le.lineAlign=qe),le.align=Ue}return u(le,Ce),le}).filter(D=>D!==null)}function nl(o,e,t){const r=o.getElementsByTagName(e)[0];return r?[].slice.call(r.querySelectorAll(t)):[]}function tu(o){return o.reduce((e,t)=>{const r=t.getAttribute("xml:id");return r&&(e[r]=t),e},{})}function ru(o,e){return[].slice.call(o.childNodes).reduce((t,r,i)=>{var n;return r.nodeName==="br"&&i?t+`
|
|
|
`:(n=r.childNodes)!=null&&n.length?ru(r,e):e?t+r.textContent.trim().replace(/\s+/g," "):t+r.textContent},"")}function uh(o,e,t){const r="http://www.w3.org/ns/ttml#styling";let i=null;const n=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],a=o!=null&&o.hasAttribute("style")?o.getAttribute("style"):null;return a&&t.hasOwnProperty(a)&&(i=t[a]),n.reduce((h,_)=>{const g=sl(e,r,_)||sl(o,r,_)||sl(i,r,_);return g&&(h[_]=g),h},{})}function sl(o,e,t){return o&&o.hasAttributeNS(e,t)?o.getAttributeNS(e,t):null}function iu(o){return new Error(`Could not parse ttml timestamp ${o}`)}function al(o,e){if(!o)return null;let t=Yl(o);return t===null&&(Ql.test(o)?t=ch(o,e):Jl.test(o)&&(t=hh(o,e))),t}function ch(o,e){const t=Ql.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 hh(o,e){const t=Jl.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 go{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 fh{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=au(),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 go(this,"textTrack1"),t=new go(this,"textTrack2"),r=new go(this,"textTrack3"),i=new go(this,"textTrack4");this.cea608Parser1=new ql(1,e,t),this.cea608Parser2=new ql(3,r,i)}addCues(e,t,r,i,n){let a=!1;for(let h=n.length;h--;){const _=n[h],g=dh(_[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||n.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:n,trackId:a}){const{unparsedVttFrags:h}=this;r===S.MAIN&&(this.initPTS[t.cc]={baseTime:i,timescale:n,trackId:a}),h.length&&(this.unparsedVttFrags=[],h.forEach(_=>{this.initPTS[_.frag.cc]?this.onFragLoaded(d.FRAG_LOADED,_):this.hls.trigger(d.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:r}=this;if(r)for(let i=0;i<r.textTracks.length;i++){const n=r.textTracks[i];if(su(n,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return n}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:n,languageCode:a}=t[e],h=this.getExistingTrack(n,a);if(h)r[e]=h,Ws(r[e]),Ul(r[e],i);else{const _=this.createTextTrack("captions",n,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(n=>{Ws(i[n]),delete i[n]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=au(),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++)Ws(t[r])}onSubtitleTracksUpdated(e,t){const r=t.subtitleTracks||[],i=r.some(n=>n.textCodec===il);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(yl(this.tracks,r)){this.tracks=r;return}if(this.textTracks=[],this.tracks=r,this.config.renderTextTracksNatively){const a=this.media,h=a?co(a.textTracks):null;if(this.tracks.forEach((_,g)=>{let x;if(h){let D=null;for(let j=0;j<h.length;j++)if(h[j]&&su(h[j],_)){D=h[j],h[j]=null;break}D&&(x=D)}if(x)Ws(x);else{const D=nu(_);x=this.createTextTrack(D,_.name,_.lang),x&&(x.mode="disabled")}x&&this.textTracks.push(x)}),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 n=`textTrack${i[1]}`,a=this.captionsProperties[n];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===S.MAIN){var r,i;const{cea608Parser1:n,cea608Parser2:a,lastSn:h}=this,{cc:_,sn:g}=t.frag,x=(r=(i=t.part)==null?void 0:i.index)!=null?r:-1;n&&a&&(g!==h+1||g===h&&x!==this.lastPartIndex+1||_!==this.lastCc)&&(n.reset(),a.reset()),this.lastCc=_,this.lastSn=g,this.lastPartIndex=x}}onFragLoaded(e,t){const{frag:r,payload:i}=t;if(r.type===S.SUBTITLE)if(i.byteLength){const n=r.decryptdata,a="stats"in t;if(n==null||!n.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===il?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;eu(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:n,unparsedVttFrags:a}=this,h=n.length-1;if(!n[r.cc]&&h===-1){a.push(e);return}const _=this.hls,g=(t=r.initSegment)!=null&&t.data?Tt(r.initSegment.data,new Uint8Array(i)).buffer:i;ah(g,this.initPTS[r.cc],this.vttCCs,r.cc,r.start,x=>{this._appendCues(x,r.level),_.trigger(d.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},x=>{const D=x.message==="Missing initPTS for VTT MPEGTS";D?a.push(e):this._fallbackToIMSC1(r,i),_.logger.log(`Failed to parse VTT cue: ${x}`),!(D&&h>r.cc)&&_.trigger(d.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:x})})}_fallbackToIMSC1(e,t){const r=this.tracks[e.level];r.textCodec||eu(t,this.initPTS[e.cc],()=>{r.textCodec=il,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(n=>$l(i,n))}else{const i=this.tracks[t];if(!i)return;const n=i.default?"default":"subtitles"+t;r.trigger(d.CUES_PARSED,{type:"subtitles",cues:e,track:n})}}onFragDecrypted(e,t){const{frag:r}=t;r.type===S.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===S.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let n=0;n<i.length;n++){const a=i[n].bytes;if(a){this.cea608Parser1||this.initCea608Parsers();const h=this.extractCea608Data(a);this.cea608Parser1.addData(i[n].pts,h[0]),this.cea608Parser2.addData(i[n].pts,h[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:r,endOffsetSubtitles:i,type:n}){const{media:a}=this;if(!(!a||a.currentTime<r)){if(!n||n==="video"){const{captionsTracks:h}=this;Object.keys(h).forEach(_=>Yo(h[_],t,r))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:h}=this;Object.keys(h).forEach(_=>Yo(h[_],t,i))}}}extractCea608Data(e){const t=[[],[]],r=e[0]&31;let i=2;for(let n=0;n<r;n++){const a=e[i++],h=127&e[i++],_=127&e[i++];if(h===0&&_===0)continue;if((4&a)!==0){const x=3&a;(x===0||x===1)&&(t[x].push(h),t[x].push(_))}}return t}}function nu(o){return o.characteristics&&/transcribes-spoken-dialog/gi.test(o.characteristics)&&/describes-music-and-sound/gi.test(o.characteristics)?"captions":"subtitles"}function su(o,e){return!!o&&o.kind===nu(e)&&zo(e,o)}function dh(o,e,t,r){return Math.min(e,r)-Math.max(o,t)}function au(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const ph=/\s/,mh={newCue(o,e,t,r){const i=[];let n,a,h,_,g;const x=self.VTTCue||self.TextTrackCue;for(let j=0;j<r.rows.length;j++)if(n=r.rows[j],h=!0,_=0,g="",!n.isEmpty()){var D;for(let ue=0;ue<n.chars.length;ue++)ph.test(n.chars[ue].uchar)&&h?_++:(g+=n.chars[ue].uchar,h=!1);n.cueStartTime=e,e===t&&(t+=1e-4),_>=16?_--:_++;const Y=Xl(g.trim()),Q=rl(e,t,Y);o!=null&&(D=o.cues)!=null&&D.getCueById(Q)||(a=new x(e,t,Y),a.id=Q,a.line=j+1,a.align="left",a.position=10+Math.min(80,Math.floor(_*8/32)*10),i.push(a))}return o&&i.length&&(i.sort((j,Y)=>j.line==="auto"||Y.line==="auto"?0:j.line>8&&Y.line>8?Y.line-j.line:j.line-Y.line),i.forEach(j=>$l(o,j))),i}};function gh(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(o){}return!1}const _h=/(\d+)-(\d+)\/(\d+)/;class ou{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||Sh,this.controller=new self.AbortController,this.stats=new O}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 n=vh(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,n),self.clearTimeout(this.requestTimeout),t.timeout=_&&R(_)?_:g,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},t.timeout),(Sa(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(D=>{var j;this.response=this.loader=D;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)),!D.ok){const{status:ue,statusText:le}=D;throw new Eh(le||"fetch, bad network response",ue,D)}i.loading.first=Y,i.total=bh(D.headers)||i.total;const Q=(j=this.callbacks)==null?void 0:j.onProgress;return Q&&R(t.highWaterMark)?this.loadProgressively(D,i,e,t.highWaterMark,Q):a?D.arrayBuffer():e.responseType==="json"?D.json():D.text()}).then(D=>{var j,Y;const Q=this.response;if(!Q)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const ue=D[h];ue&&(i.loaded=i.total=ue);const le={url:Q.url,data:D,code:Q.status},be=(j=this.callbacks)==null?void 0:j.onProgress;be&&!R(t.highWaterMark)&&be(i,e,D,Q),(Y=this.callbacks)==null||Y.onSuccess(le,i,e,Q)}).catch(D=>{var j;if(self.clearTimeout(this.requestTimeout),i.aborted)return;const Y=D&&D.code||0,Q=D?D.message:null;(j=this.callbacks)==null||j.onError({code:Y,text:Q},e,D?D.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,n){const a=new ua,h=e.body.getReader(),_=()=>h.read().then(g=>{if(g.done)return a.dataLength&&n(t,r,a.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const x=g.value,D=x.length;return t.loaded+=D,D<i||a.dataLength?(a.push(x),a.dataLength>=i&&n(t,r,a.flush().buffer,e)):n(t,r,x.buffer,e),_()}).catch(()=>Promise.reject());return _()}}function vh(o,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(u({},o.headers))};return o.rangeEnd&&t.headers.set("Range","bytes="+o.rangeStart+"-"+String(o.rangeEnd-1)),t}function yh(o){const e=_h.exec(o);if(e)return parseInt(e[2])-parseInt(e[1])+1}function bh(o){const e=o.get("Content-Range");if(e){const r=yh(e);if(R(r))return r}const t=o.get("Content-Length");if(t)return parseInt(t)}function Sh(o,e){return new self.Request(o.url,e)}class Eh extends Error{constructor(e,t,r){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=r}}const xh=/^age:\s*[\d.]+\s*$/im;class lu{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 O,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 n=this.xhrSetup;n?Promise.resolve().then(()=>{if(!(this.loader!==r||this.stats.aborted))return n(r,t.url)}).catch(a=>{if(!(this.loader!==r||this.stats.aborted))return r.open("GET",t.url,!0),n(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:n,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=n&&R(n)?n: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,n=this.config;if(!r.aborted&&i>=2&&(r.loading.first===0&&(r.loading.first=Math.max(self.performance.now(),r.loading.start),n.timeout!==n.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),n.timeout=n.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.loadPolicy.maxLoadTimeMs-(r.loading.first-r.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const g=t.status,x=t.responseType==="text"?t.responseText:null;if(g>=200&&g<300){const Q=x!=null?x:t.response;if(Q!=null){var a,h;r.loading.end=Math.max(self.performance.now(),r.loading.first);const ue=t.responseType==="arraybuffer"?Q.byteLength:Q.length;r.loaded=r.total=ue,r.bwEstimate=r.total*8e3/(r.loading.end-r.loading.first);const le=(a=this.callbacks)==null?void 0:a.onProgress;le&&le(r,e,Q,t);const be={url:t.responseURL,data:Q,code:g};(h=this.callbacks)==null||h.onSuccess(be,r,e,t);return}}const D=n.loadPolicy.errorRetry,j=r.retry,Y={url:e.url,data:void 0,code:g};if(bn(D,j,!1,Y))this.retry(D);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(bn(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=Vr(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&&xh.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 wh={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Ch=c(c({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:lu,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Ai,bufferController:Lu,capLevelController:jo,errorController:Ti,fpsController:Dc,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:Bn,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:wh},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},Ah()),{},{subtitleStreamController:$c,subtitleTrackController:kc,timelineController:fh,audioStreamController:Au,audioTrackController:Tu,emeController:js,cmcdController:wc,contentSteeringController:Ac,interstitialsController:Uc});function Ah(){return{cueHandler:mh,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 Th(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=ol(o),i=["manifest","level","frag"],n=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(a=>{const h=`${a==="level"?"playlist":a}LoadPolicy`,_=e[h]===void 0,g=[];n.forEach(x=>{const D=`${a}Loading${x}`,j=e[D];if(j!==void 0&&_){g.push(D);const Y=r[h].default;switch(e[h]={default:Y},x){case"TimeOut":Y.maxLoadTimeMs=j,Y.maxTimeToFirstByteMs=j;break;case"MaxRetry":Y.errorRetry.maxNumRetry=j,Y.timeoutRetry.maxNumRetry=j;break;case"RetryDelay":Y.errorRetry.retryDelayMs=j,Y.timeoutRetry.retryDelayMs=j;break;case"MaxRetryTimeout":Y.errorRetry.maxRetryDelayMs=j,Y.timeoutRetry.maxRetryDelayMs=j;break}}}),g.length&&t.warn(`hls.js config: "${g.join('", "')}" setting(s) are deprecated, use "${h}": ${ir(e[h])}`)}),c(c({},r),e)}function ol(o){return o&&typeof o=="object"?Array.isArray(o)?o.map(ol):Object.keys(o).reduce((e,t)=>(e[t]=ol(o[t]),e),{}):o}function Dh(o,e){const t=o.loader;t!==ou&&t!==lu?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),o.progressive=!1):gh()&&(o.loader=ou,o.progressive=!0,o.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const _o=2,Rh=.1,Lh=.05,kh=100;class Ih extends wn{constructor(e,t){super("gap-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,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(kh),this.mediaSource=t.mediaSource;const r=this.media=t.media;_i(r,"playing",this.onMediaPlaying),_i(r,"waiting",this.onMediaWaiting),_i(r,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:r}=this;r&&(xi(r,"playing",this.onMediaPlaying),xi(r,"waiting",this.onMediaWaiting),xi(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 n=(r=this.hls)==null?void 0:r.config;if(!n)return;const a=this.media;if(!a)return;const{seeking:h}=a,_=this.seeking&&!h,g=!this.seeking&&h,x=a.paused&&!h||a.ended||a.playbackRate===0;if(this.seeking=h,e!==t){t&&(this.ended=0),this.moved=!0,h||(this.nudgeRetry=0,n.nudgeOnVideoHole&&!x&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(g||_){_&&this.stallResolved(e);return}if(x){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(!nr.getBuffered(a).length){this.nudgeRetry=0;return}const D=nr.bufferInfo(a,e,0),j=D.nextStart||0,Y=this.fragmentTracker;if(h&&Y&&this.hls){const pt=uu(this.hls.inFlightFragments,e),Ye=D.len>_o,at=!j||pt||j-e>_o&&!Y.getPartialFragment(e);if(Ye||at)return;this.moved=!1}const Q=(i=this.hls)==null?void 0:i.latestLevelDetails;if(!this.moved&&this.stalled!==null&&Y){if(!(D.len>0)&&!j)return;const Ye=Math.max(j,D.start||0)-e,nt=!!(Q!=null&&Q.live)?Q.targetduration*2:_o,Ze=vo(e,Y);if(Ye>0&&(Ye<=nt||Ze)){a.paused||this._trySkipBufferHole(Ze);return}}const ue=n.detectStallWithCurrentTimeMs,le=self.performance.now(),be=this.waiting;let xe=this.stalled;if(xe===null)if(be>0&&le-be<ue)xe=this.stalled=be;else{this.stalled=le;return}const Ce=le-xe;if(!h&&(Ce>=ue||be)&&this.hls){var Ue;if(((Ue=this.mediaSource)==null?void 0:Ue.readyState)==="ended"&&!(Q!=null&&Q.live)&&Math.abs(e-((Q==null?void 0:Q.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(d.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(D),!this.media||!this.hls)return}const qe=nr.bufferInfo(a,e,n.maxBufferHole);this._tryFixBufferStall(qe,Ce,e)}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 n=nr.bufferedInfo(nr.timeRangesToArray(this.buffered.audio),e,0);if(n.len>1&&t>=n.start){const a=nr.timeRangesToArray(i),h=nr.bufferedInfo(a,t,0).bufferedIndex;if(h>-1&&h<a.length-1){const _=nr.bufferedInfo(a,e,0).bufferedIndex,g=a[h].end,x=a[h+1].start;if((_===-1||_>h)&&x-g<1&&e-g<2){const D=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${g} -> ${x} buffered index: ${_}`);this.warn(D.message),this.media.currentTime+=1e-6;let j=vo(e,this.fragmentTracker);j&&"fragment"in j?j=j.fragment:j||(j=void 0);const Y=nr.bufferInfo(this.media,e,0);this.hls.trigger(d.ERROR,{type:P.MEDIA_ERROR,details:A.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:D,reason:D.message,frag:j,buffer:Y.len,bufferInfo:Y})}}}}}_tryFixBufferStall(e,t,r){var i,n;const{fragmentTracker:a,media:h}=this,_=(i=this.hls)==null?void 0:i.config;if(!h||!a||!_)return;const g=(n=this.hls)==null?void 0:n.latestLevelDetails,x=vo(r,a);if((x||g!=null&&g.live&&r<g.fragmentStart)&&(this._trySkipBufferHole(x)||!this.media))return;const D=e.buffered,j=this.adjacentTraversal(e,r);(D&&D.length>1&&e.len>_.maxBufferHole||e.nextStart&&(e.nextStart-r<_.maxBufferHole||j))&&(t>_.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const r=this.fragmentTracker,i=e.nextStart;if(r&&i){const n=r.getFragAtPos(t,S.MAIN),a=r.getFragAtPos(i,S.MAIN);if(n&&a)return a.sn-n.sn<2}return!1}_reportStall(e){const{hls:t,media:r,stallReported:i,stalled:n}=this;if(!i&&n!==null&&r&&t){this.stallReported=!0;const a=new Error(`Playback stalling at @${r.currentTime} due to low buffer (${ir(e)})`);this.warn(a.message),t.trigger(d.ERROR,{type:P.MEDIA_ERROR,details:A.BUFFER_STALLED_ERROR,fatal:!1,error:a,buffer:e.len,bufferInfo:e,stalled:{start:n}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:r,media:i}=this,n=(t=this.hls)==null?void 0:t.config;if(!i||!r||!n)return 0;const a=i.currentTime,h=nr.bufferInfo(i,a,0),_=a<h.start?h.start:h.nextStart;if(_&&this.hls){const x=h.len<=n.maxBufferHole,D=h.len>0&&h.len<1&&i.readyState<3,j=_-a;if(j>0&&(x||D)){if(j>n.maxBufferHole){let Q=!1;if(a===0){const ue=r.getAppendedFrag(0,S.MAIN);ue&&_<ue.end&&(Q=!0)}if(!Q&&e){var g;if(!((g=this.hls.loadLevelObj)!=null&&g.details)||uu(this.hls.inFlightFragments,_))return 0;let le=!1,be=e.end;for(;be<_;){const xe=vo(be,r);if(xe)be+=xe.duration;else{le=!0;break}}if(le)return 0}}const Y=Math.max(_+Lh,a+Rh);if(this.warn(`skipping hole, adjusting currentTime from ${a} to ${Y}`),this.moved=!0,i.currentTime=Y,!(e!=null&&e.gap)){const Q=new Error(`fragment loaded with buffer holes, seeking from ${a} to ${Y}`),ue={type:P.MEDIA_ERROR,details:A.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:Q,reason:Q.message,buffer:h.len,bufferInfo:h};e&&("fragment"in e?ue.part=e:ue.frag=e),this.hls.trigger(d.ERROR,ue)}return Y}}return 0}_tryNudgeBuffer(e){const{hls:t,media:r,nudgeRetry:i}=this,n=t==null?void 0:t.config;if(!r||!n)return 0;const a=r.currentTime;if(this.nudgeRetry++,i<n.nudgeMaxRetry){const h=a+(i+1)*n.nudgeOffset,_=new Error(`Nudging 'currentTime' from ${a} to ${h}`);this.warn(_.message),r.currentTime=h,t.trigger(d.ERROR,{type:P.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 ${n.nudgeMaxRetry} nudges`);this.error(h.message),t.trigger(d.ERROR,{type:P.MEDIA_ERROR,details:A.BUFFER_STALLED_ERROR,error:h,fatal:!0,buffer:e.len,bufferInfo:e})}}}function uu(o,e){const t=cu(o.main);if(t&&t.start<=e)return t;const r=cu(o.audio);return r&&r.start<=e?r:null}function cu(o){if(!o)return null;switch(o.state){case Et.IDLE:case Et.STOPPED:case Et.ENDED:case Et.ERROR:return null}return o.frag}function vo(o,e){return e.getAppendedFrag(o,S.MAIN)||e.getPartialFragment(o)}const Ph=.25;function ll(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function ul(o,e,t,r,i){let n=new o(e,t,"");try{n.value=r,i&&(n.type=i)}catch(a){n=new o(e,t,ir(i?c({type:i},r):r))}return n}const yo=(()=>{const o=ll();try{o&&new o(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class Oh{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 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&&(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&&(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(){var e;const t=(e=this.hls)==null?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&Ws(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 Ul(r,this.media),r}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:r,enableID3MetadataCues:i}=this.hls.config;if(!r&&!i)return;const{samples:n}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const a=ll();if(a)for(let h=0;h<n.length;h++){const _=n[h].type;if(_===vi.emsg&&!r||!i)continue;const g=va(n[h].data),x=n[h].pts;let D=x+n[h].duration;D>yo&&(D=yo),D-x<=0&&(D=x+Ph);for(let Y=0;Y<g.length;Y++){const Q=g[Y];if(!Qa(Q)){this.updateId3CueEnds(x,_);const ue=ul(a,x,D,Q,_);ue&&this.id3Track.addCue(ue)}}}}updateId3CueEnds(e,t){var r;const i=(r=this.id3Track)==null?void 0:r.cues;if(i)for(let n=i.length;n--;){const a=i[n];a.type===t&&a.startTime<e&&a.endTime===yo&&(a.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:r,type:i}){const{id3Track:n,hls:a}=this;if(!a)return;const{config:{enableEmsgMetadataCues:h,enableID3MetadataCues:_}}=a;if(n&&(h||_)){let g;i==="audio"?g=x=>x.type===vi.audioId3&&_:i==="video"?g=x=>x.type===vi.emsg&&h:g=x=>x.type===vi.audioId3&&_||x.type===vi.emsg&&h,Yo(n,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.hls||!this.media)return;const{assetPlayerId:r,timelineOffset:i,enableDateRangeMetadataCues:n,interstitialsController:a}=this.hls.config;if(!n)return;const h=ll();if(r&&i&&!a){const{fragmentStart:ue,fragmentEnd:le}=e;let be=this.assetCue;be?(be.startTime=ue,be.endTime=le):h&&(be=this.assetCue=ul(h,ue,le,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),be&&(be.id=r,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(be),be.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:_}=this,{dateRanges:g}=e,x=Object.keys(g);let D=this.dateRangeCuesAppended;if(_&&t){var j;if((j=_.cues)!=null&&j.length){const ue=Object.keys(D).filter(le=>!x.includes(le));for(let le=ue.length;le--;){var Y;const be=ue[le],xe=(Y=D[be])==null?void 0:Y.cues;delete D[be],xe&&Object.keys(xe).forEach(Ce=>{const Ue=xe[Ce];if(Ue){Ue.removeEventListener("enter",this.onEventCueEnter);try{_.removeCue(Ue)}catch(qe){}}})}}else D=this.dateRangeCuesAppended={}}const Q=e.fragments[e.fragments.length-1];if(!(x.length===0||!R(Q==null?void 0:Q.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let ue=0;ue<x.length;ue++){const le=x[ue],be=g[le],xe=be.startTime,Ce=D[le],Ue=(Ce==null?void 0:Ce.cues)||{};let qe=(Ce==null?void 0:Ce.durationKnown)||!1,pt=yo;const{duration:Ye,endDate:at}=be;if(at&&Ye!==null)pt=xe+Ye,qe=!0;else if(be.endOnNext&&!qe){const Ze=x.reduce((wt,Wt)=>{if(Wt!==be.id){const Zt=g[Wt];if(Zt.class===be.class&&Zt.startDate>be.startDate&&(!wt||be.startDate<wt.startDate))return Zt}return wt},null);Ze&&(pt=Ze.startTime,qe=!0)}const nt=Object.keys(be.attr);for(let Ze=0;Ze<nt.length;Ze++){const wt=nt[Ze];if(!On(wt))continue;const Wt=Ue[wt];if(Wt)qe&&!(Ce!=null&&Ce.durationKnown)?Wt.endTime=pt:Math.abs(Wt.startTime-xe)>.01&&(Wt.startTime=xe,Wt.endTime=pt);else if(h){let Zt=be.attr[wt];is(wt)&&(Zt=J(Zt));const Xt=ul(h,xe,pt,{key:wt,data:Zt},vi.dateRange);Xt&&(Xt.id=le,this.id3Track.addCue(Xt),Ue[wt]=Xt,a&&(wt==="X-ASSET-LIST"||wt==="X-ASSET-URL")&&Xt.addEventListener("enter",this.onEventCueEnter))}}D[le]={cues:Ue,dateRange:be,durationKnown:qe}}}}}class Mh{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:n,maxLiveSyncPlaybackRate:a}=this.config;if(!n||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 D=Math.min(2,Math.max(1,a)),j=Math.round(2/(1+Math.exp(-.75*_-this.edgeStalled))*20)/20,Y=Math.min(D,Math.max(1,j));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:n,liveSyncDurationCount:a,lowLatencyMode:h}=this.config,_=this.hls.userConfig;let g=h&&r||t;(this._targetLatencyUpdated||_.liveSyncDuration||_.liveSyncDurationCount||g===0)&&(g=n!==void 0?n:a*i);const x=i;return g+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,x)}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,n=e-t-this.edgeStalled,a=i-r.totalduration,h=i-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(a,n),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 Fh extends $o{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=[],n={},a={};let h=!1,_=!1,g=!1;t.levels.forEach(x=>{const D=x.attrs;let{audioCodec:j,videoCodec:Y}=x;j&&(x.audioCodec=j=ve(j,r)||void 0),Y&&(Y=x.videoCodec=Cr(Y));const{width:Q,height:ue,unknownCodecs:le}=x,be=(le==null?void 0:le.length)||0;if(h||(h=!!(Q&&ue)),_||(_=!!Y),g||(g=!!j),be||j&&!this.isAudioSupported(j)||Y&&!this.isVideoSupported(Y)){this.log(`Some or all CODECS not supported "${D.CODECS}"`);return}const{CODECS:xe,"FRAME-RATE":Ce,"HDCP-LEVEL":Ue,"PATHWAY-ID":qe,RESOLUTION:pt,"VIDEO-RANGE":Ye}=D,nt=`${`${qe||"."}-`}${x.bitrate}-${pt}-${Ce}-${xe}-${Ye}-${Ue}`;if(n[nt])if(n[nt].uri!==x.url&&!x.attrs["PATHWAY-ID"]){const Ze=a[nt]+=1;x.attrs["PATHWAY-ID"]=new Array(Ze+1).join(".");const wt=this.createLevel(x);n[nt]=wt,i.push(wt)}else n[nt].addGroupId("audio",D.AUDIO),n[nt].addGroupId("text",D.SUBTITLES);else{const Ze=this.createLevel(x);n[nt]=Ze,a[nt]=1,i.push(Ze)}}),this.filterAndSortMediaOptions(i,t,h,_,g)}createLevel(e){const t=new br(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=Mt(i,[])}return t}isAudioSupported(e){return Me(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Me(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,r,i,n){var a;let h=[],_=[],g=e;const x=((a=t.stats)==null?void 0:a.parsing)||{};if((r||i)&&n&&(g=g.filter(({videoCodec:xe,videoRange:Ce,width:Ue,height:qe})=>(!!xe||!!(Ue&&qe))&&ci(Ce))),g.length===0){Promise.resolve().then(()=>{if(this.hls){let xe="no level with compatible codecs found in manifest",Ce=xe;t.levels.length&&(Ce=`one or more CODECS in variant not supported: ${ir(t.levels.map(qe=>qe.attrs.CODECS).filter((qe,pt,Ye)=>Ye.indexOf(qe)===pt))}`,this.warn(Ce),xe+=` (${Ce})`);const Ue=new Error(xe);this.hls.trigger(d.ERROR,{type:P.MEDIA_ERROR,details:A.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:Ue,reason:Ce})}}),x.end=performance.now();return}t.audioTracks&&(h=t.audioTracks.filter(xe=>!xe.audioCodec||this.isAudioSupported(xe.audioCodec)),hu(h)),t.subtitles&&(_=t.subtitles,hu(_));const D=g.slice(0);g.sort((xe,Ce)=>{if(xe.attrs["HDCP-LEVEL"]!==Ce.attrs["HDCP-LEVEL"])return(xe.attrs["HDCP-LEVEL"]||"")>(Ce.attrs["HDCP-LEVEL"]||"")?1:-1;if(r&&xe.height!==Ce.height)return xe.height-Ce.height;if(xe.frameRate!==Ce.frameRate)return xe.frameRate-Ce.frameRate;if(xe.videoRange!==Ce.videoRange)return _r.indexOf(xe.videoRange)-_r.indexOf(Ce.videoRange);if(xe.videoCodec!==Ce.videoCodec){const Ue=fe(xe.videoCodec),qe=fe(Ce.videoCodec);if(Ue!==qe)return qe-Ue}if(xe.uri===Ce.uri&&xe.codecSet!==Ce.codecSet){const Ue=Ee(xe.codecSet),qe=Ee(Ce.codecSet);if(Ue!==qe)return qe-Ue}return xe.averageBitrate!==Ce.averageBitrate?xe.averageBitrate-Ce.averageBitrate:0});let j=D[0];if(this.steering&&(g=this.steering.filterParsedLevels(g),g.length!==D.length)){for(let xe=0;xe<D.length;xe++)if(D[xe].pathwayId===g[0].pathwayId){j=D[xe];break}}this._levels=g;for(let xe=0;xe<g.length;xe++)if(g[xe]===j){var Y;this._firstLevel=xe;const Ce=j.bitrate,Ue=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${g.length} level(s) found, first bitrate: ${Ce}`),((Y=this.hls.userConfig)==null?void 0:Y.abrEwmaDefaultEstimate)===void 0){const qe=Math.min(Ce,this.hls.config.abrEwmaDefaultEstimateMax);qe>Ue&&Ue===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=qe)}break}const Q=n&&!i,ue=this.hls.config,le=!!(ue.audioStreamController&&ue.audioTrackController),be={levels:g,audioTracks:h,subtitleTracks:_,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:n,video:i,altAudio:le&&!Q&&h.some(xe=>!!xe.url)};x.end=performance.now(),this.hls.trigger(d.MANIFEST_PARSED,be)}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 x=new Error("invalid level idx"),D=e<0;if(this.hls.trigger(d.ERROR,{type:P.OTHER_ERROR,details:A.LEVEL_SWITCH_ERROR,level:e,fatal:D,error:x,reason:x.message}),D)return;e=Math.min(e,t.length-1)}const r=this.currentLevelIndex,i=this.currentLevel,n=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&&n===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}${n?" with Pathway "+n:""}`);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 x=this.switchParams(a.uri,i==null?void 0:i.details,g);this.loadPlaylist(x)}}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===S.MAIN){const r=t.elementaryStreams;if(!Object.keys(r).some(n=>!!r[n]))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:n}=t,a=t.levelInfo;if(!a){var h;this.warn(`Invalid level index ${i}`),(h=t.deliveryDirectives)!=null&&h.skip&&(n.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&&(n.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,n=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:""}${n?" Pathway "+n:""}${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((n,a)=>a!==e?!0:(this.steering&&this.steering.removeLevel(n),n===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,n.details&&n.details.fragments.forEach(h=>h.level=-1)),!1));Oa(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 hu(o){const e={};o.forEach(t=>{const r=t.groupId||"";t.id=e[r]=e[r]||0,e[r]++})}function fu(){return self.SourceBuffer||self.WebKitSourceBuffer}function du(){if(!ie())return!1;const e=fu();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function Bh(){if(!du())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 Nh(){var o;const e=fu();return typeof(e==null||(o=e.prototype)==null?void 0:o.changeType)=="function"}const Uh=100;class $h extends _s{constructor(e,t,r){super(e,t,r,"stream-controller",S.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,n=i?i.currentTime:null;if(n===null||!R(n)||(this.log(`Media seeked to ${n.toFixed(3)}`),!this.getBufferedFrag(n)))return;const a=this.getFwdBufferInfoAtPos(i,n,S.MAIN,0);if(a===null||a.len===0){this.warn(`Main forward buffer length at ${n} 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(Uh),this.level=-1,!this.startFragRequested){let n=i.startLevel;n===-1&&(i.config.testBandwidth&&this.levels.length>1?(n=0,this.bitrateTest=!0):n=i.firstAutoLevel),i.nextLoadLevel=n,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=Et.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=Et.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Et.WAITING_LEVEL:{const{levels:e,level:t}=this,r=e==null?void 0:e[t],i=r==null?void 0:r.details;if(i&&(!i.live||this.levelLastLoaded===r&&!this.waitForLive(r))){if(this.waitForCdnTuneIn(i))break;this.state=Et.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=Et.IDLE;break}break}case Et.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===Et.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 n=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(r!=null&&r[n]))return;const a=r[n],h=this.getMainFwdBufferInfo();if(h===null)return;const _=this.getLevelDetails();if(_&&this._streamEnded(h,_)){const ue={};this.altAudio===2&&(ue.type="video"),this.hls.trigger(d.BUFFER_EOS,ue),this.state=Et.ENDED;return}if(!this.buffering)return;e.loadLevel!==n&&e.manualLevel===-1&&this.log(`Adapting to level ${n} from level ${this.level}`),this.level=e.nextLoadLevel=n;const g=a.details;if(!g||this.state===Et.WAITING_LEVEL||this.waitForLive(a)){this.level=n,this.state=Et.WAITING_LEVEL,this.startFragRequested=!1;return}const x=h.len,D=this.getMaxBufferLength(a.maxBitrate);if(x>=D)return;this.backtrackFragment&&this.backtrackFragment.start>h.end&&(this.backtrackFragment=null);const j=this.backtrackFragment?this.backtrackFragment.start:h.end;let Y=this.getNextFragment(j,g);if(this.couldBacktrack&&!this.fragPrevious&&Y&&Oe(Y)&&this.fragmentTracker.getState(Y)!==$r.OK){var Q;const le=((Q=this.backtrackFragment)!=null?Q:Y).sn-g.startSN,be=g.fragments[le-1];be&&Y.cc===be.cc&&(Y=be,this.fragmentTracker.removeFragment(be))}else this.backtrackFragment&&h.len&&(this.backtrackFragment=null);if(Y&&this.isLoopLoading(Y,j)){if(!Y.gap){const le=this.audioOnly&&!this.altAudio?ne.AUDIO:ne.VIDEO,be=(le===ne.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;be&&this.afterBufferFlushed(be,le,S.MAIN)}Y=this.getNextFragmentLoopLoading(Y,g,h,S.MAIN,D)}Y&&(Y.initSegment&&!Y.initSegment.data&&!this.bitrateTest&&(Y=Y.initSegment),this.loadFragment(Y,a,j))}loadFragment(e,t,r){const i=this.fragmentTracker.getState(e);i===$r.NOT_LOADED||i===$r.PARTIAL?Oe(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,S.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 n=this.getLevelDetails();if(n!=null&&n.live){const h=this.getMainFwdBufferInfo();if(!h||h.len<n.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,x=Math.max(a.end,_+Math.min(Math.max(g-this.config.maxFragLookUpTolerance,g*(this.couldBacktrack?.5:.125)),g*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(x,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 Et.KEY_LOADING:case Et.FRAG_LOADING:case Et.FRAG_LOADING_WAITING_RETRY:case Et.PARSING:case Et.PARSED:this.state=Et.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;_i(r,"playing",this.onMediaPlaying),_i(r,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:r}=this;r&&(xi(r,"playing",this.onMediaPlaying),xi(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;for(let n=0;n<t.levels.length;n++){const a=t.levels[n].audioCodec;a&&(r=r||a.indexOf("mp4a.40.2")!==-1,i=i||a.indexOf("mp4a.40.5")!==-1)}this.audioCodecSwitch=r&&i&&!Nh(),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!==Et.IDLE)return;const i=t.levelInfo;(!i.details||i.details.live&&(this.levelLastLoaded!==i||i.details.expired)||this.waitForCdnTuneIn(i.details))&&(this.state=Et.WAITING_LEVEL)}onLevelLoaded(e,t){var r;const{levels:i,startFragRequested:n}=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,x=this.fragCurrent;x&&(this.state===Et.FRAG_LOADING||this.state===Et.FRAG_LOADING_WAITING_RETRY)&&x.level!==t.level&&x.loader&&this.abortCurrentFrag();let D=0;if(h.live||(r=g.details)!=null&&r.live){var j;if(this.checkLiveUpdate(h),h.deltaUpdateFailed)return;D=this.alignPlaylists(h,g.details,(j=this.levelLastLoaded)==null?void 0:j.details)}if(g.details=h,this.levelLastLoaded=g,n||this.setStartPosition(h,D),this.hls.trigger(d.LEVEL_UPDATED,{details:h,level:a}),this.state===Et.WAITING_LEVEL){if(this.waitForCdnTuneIn(h))return;this.state=Et.IDLE}n&&h.live&&this.synchronizeToLiveEdge(h),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:r}=this;if(!r)return;const i=this.hls.liveSyncPosition,n=this.getLoadPosition(),a=e.fragmentStart,h=e.edge,_=n>=a-t.maxFragLookUpTolerance&&n<=h;if(i!==null&&r.duration>i&&(n<i||!_)){const x=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!_&&r.readyState<4||n<h-x)&&(this._hasEnoughToStart||(this.nextLoadPosition=i),r.readyState))if(this.warn(`Playback: ${n.toFixed(3)} is located too far from the end of live sliding playlist: ${h}, reset currentTime to : ${i.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var g;const D=nr.bufferInfo(r,i,0);if(!((g=D.buffered)!=null&&g.length)){r.currentTime=i;return}if(D.start<=n){r.currentTime=i;return}const{nextStart:Y}=nr.bufferedInfo(D.buffered,n,0);Y&&(r.currentTime=Y)}else r.currentTime=i}}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:i,payload:n}=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,x=_.PTSKnown||!_.live,D=(t=r.initSegment)==null?void 0:t.data,j=this._getAudioCodec(h),Y=this.transmuxer=this.transmuxer||new _l(this.hls,S.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Q=i?i.index:-1,ue=Q!==-1,le=new rn(r.level,r.sn,r.stats.chunkCount,n.byteLength,Q,ue),be=this.initPTS[r.cc];Y.push(n,D,j,g,r,i,_.totalduration,x,le,be)}onAudioTrackSwitching(e,t){const r=this.hls,i=this.altAudio!==0;if(mn(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.altAudio=0,this.fragmentTracker.removeAllFragments(),r.once(d.BUFFER_FLUSHED,()=>{this.hls&&this.hls.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=mn(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,n,a=!1;for(const h in r){const _=r[h];if(_.id==="main"){if(n=h,i=_,h==="video"){const g=r[h];g&&(this.videoBuffer=g.buffer)}}else a=!0}a&&i?(this.log(`Alternate track found, use ${n}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:r,part:i}=t,n=r.type===S.MAIN;if(n){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===Et.PARSED&&(this.state=Et.IDLE);return}const h=i?i.stats:r.stats;this.fragLastKbps=Math.round(8*h.total/(h.buffering.end-h.loading.first)),Oe(r)&&(this.fragPrevious=r),this.fragBufferedComplete(r,i)}const a=this.media;a&&(!this._hasEnoughToStart&&nr.getBuffered(a).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),n&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var r;if(t.fatal){this.state=Et.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(S.MAIN,t);break;case A.LEVEL_LOAD_ERROR:case A.LEVEL_LOAD_TIMEOUT:case A.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===Et.WAITING_LEVEL&&((r=t.context)==null?void 0:r.type)===U.LEVEL&&(this.state=Et.IDLE);break;case A.BUFFER_ADD_CODEC_ERROR:case A.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case A.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case A.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=Et.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==ne.AUDIO||!this.altAudio){const r=(t===ne.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;r&&(this.afterBufferFlushed(r,t,S.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 n=this.getLevelDetails(),a=nr.getBuffered(e),h=a.length?a.start(0):0,_=h-r,g=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||_>0&&(_<g||this.loadingParts&&_<2*((n==null?void 0:n.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,n=r==null?void 0:r.frag;if(!n||this.fragContextChanged(n))return;t.fragmentError=0,this.state=Et.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const a=n.stats;a.parsing.start=a.parsing.end=a.buffering.start=a.buffering.end=self.performance.now(),i.trigger(d.FRAG_LOADED,r),n.bitrateTest=!1}).catch(r=>{this.state===Et.STOPPED||this.state===Et.ERROR||(this.warn(r),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){const t=this.playlistType,{hls:r}=this,{remuxResult:i,chunkMeta:n}=e,a=this.getCurrentContext(n);if(!a){this.resetWhenMissingContext(n);return}const{frag:h,part:_,level:g}=a,{video:x,text:D,id3:j,initSegment:Y}=i,{details:Q}=g,ue=this.altAudio?void 0:i.audio;if(this.fragContextChanged(h)){this.fragmentTracker.removeFragment(h);return}if(this.state=Et.PARSING,Y){const le=Y.tracks;if(le){const Ue=h.initSegment||h;if(this.unhandledEncryptionError(Y,h))return;this._bufferInitSegment(g,le,Ue,n),r.trigger(d.FRAG_PARSING_INIT_SEGMENT,{frag:Ue,id:t,tracks:le})}const be=Y.initPTS,xe=Y.timescale,Ce=this.initPTS[h.cc];if(R(be)&&(!Ce||Ce.baseTime!==be||Ce.timescale!==xe)){const Ue=Y.trackId;this.initPTS[h.cc]={baseTime:be,timescale:xe,trackId:Ue},r.trigger(d.INIT_PTS_FOUND,{frag:h,id:t,initPTS:be,timescale:xe,trackId:Ue})}}if(x&&Q){ue&&x.type==="audiovideo"&&this.logMuxedErr(h);const le=Q.fragments[h.sn-1-Q.startSN],be=h.sn===Q.startSN,xe=!le||h.cc>le.cc;if(i.independent!==!1){const{startPTS:Ce,endPTS:Ue,startDTS:qe,endDTS:pt}=x;if(_)_.elementaryStreams[x.type]={startPTS:Ce,endPTS:Ue,startDTS:qe,endDTS:pt};else if(x.firstKeyFrame&&x.independent&&n.id===1&&!xe&&(this.couldBacktrack=!0),x.dropped&&x.independent){const Ye=this.getMainFwdBufferInfo(),at=(Ye?Ye.end:this.getLoadPosition())+this.config.maxBufferHole,nt=x.firstKeyFramePTS?x.firstKeyFramePTS:Ce;if(!be&&at<nt-this.config.maxBufferHole&&!xe){this.backtrack(h);return}else xe&&(h.gap=!0);h.setElementaryStreamInfo(x.type,h.start,Ue,h.start,pt,!0)}else be&&Ce-(Q.appliedTimelineOffset||0)>_o&&(h.gap=!0);h.setElementaryStreamInfo(x.type,Ce,Ue,qe,pt),this.backtrackFragment&&(this.backtrackFragment=h),this.bufferFragmentData(x,h,_,n,be||xe)}else if(be||xe)h.gap=!0;else{this.backtrack(h);return}}if(ue){const{startPTS:le,endPTS:be,startDTS:xe,endDTS:Ce}=ue;_&&(_.elementaryStreams[ne.AUDIO]={startPTS:le,endPTS:be,startDTS:xe,endDTS:Ce}),h.setElementaryStreamInfo(ne.AUDIO,le,be,xe,Ce),this.bufferFragmentData(ue,h,_,n)}if(Q&&j!=null&&j.samples.length){const le={id:t,frag:h,details:Q,samples:j.samples};r.trigger(d.FRAG_PARSING_METADATA,le)}if(Q&&D){const le={id:t,frag:h,details:Q,samples:D.samples};r.trigger(d.FRAG_PARSING_USERDATA,le)}}logMuxedErr(e){this.warn(`${Oe(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,r,i){if(this.state!==Et.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(r));const{audio:n,video:a,audiovideo:h}=t;if(n){const g=e.audioCodec;let x=Bt(n.codec,g);x==="mp4a"&&(x="mp4a.40.5");const D=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){x&&(x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5");const j=n.metadata;j&&"channelCount"in j&&(j.channelCount||1)!==1&&D.indexOf("firefox")===-1&&(x="mp4a.40.5")}x&&x.indexOf("mp4a.40.5")!==-1&&D.indexOf("android")!==-1&&n.container!=="audio/mpeg"&&(x="mp4a.40.2",this.log(`Android: force audio codec to ${x}`)),g&&g!==x&&this.log(`Swapping manifest audio codec "${g}" for "${x}"`),n.levelCodec=x,n.id=S.MAIN,this.log(`Init audio buffer, container:${n.container}, codecs[selected/level/parsed]=[${x||""}/${g||""}/${n.codec}]`),delete t.audiovideo}if(a){a.levelCodec=e.videoCodec,a.id=S.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 D=t[g].initSegment;D!=null&&D.byteLength&&this.hls.trigger(d.BUFFER_APPENDING,{type:g,data:D,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,S.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=Et.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const r=e.currentTime;if(nr.isBuffered(e,r)?t=this.getAppendedFrag(r):nr.isBuffered(e,r+.1)&&(t=this.getAppendedFrag(r+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,n=t.level;(!i||t.sn!==i.sn||i.level!==n)&&(this.fragPlaying=t,this.hls.trigger(d.FRAG_CHANGED,{frag:t}),(!i||i.level!==n)&&this.hls.trigger(d.LEVEL_SWITCHED,{level:n}))}}}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 R(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(R(t)){const r=this.getLevelDetails(),i=this.currentFrag||(r?ai(null,r.fragments,t):null);if(i){const n=i.programDateTime;if(n!==null){const a=n+(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 zh extends M{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const r in this.keyIdToKeyInfo){const i=this.keyIdToKeyInfo[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.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=A.KEY_LOAD_ERROR,r,i,n){return new mr({type:P.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:n,error:r,networkDetails:i})}loadClear(e,t,r){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let i=0,n=t.length;i<n;i++){const a=t[i];if(e.cc<=a.cc&&(!Oe(e)||!Oe(a)||e.sn<a.sn)||!r&&i==n-1)return this.emeController.selectKeySystemFormat(a).then(h=>{if(!this.emeController)return;a.setKeyFormat(h);const _=sn(h);if(_)return this.emeController.getKeySystemAccess([_])})}if(this.config.requireKeySystemAccessOnStart){const i=an(this.config);if(i.length)return this.emeController.getKeySystemAccess(i)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var r,i;t&&e.setKeyFormat(t);const n=e.decryptdata;if(!n){const g=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,A.KEY_LOAD_ERROR,g))}const a=n.uri;if(!a)return Promise.reject(this.createKeyLoadError(e,A.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${a}"`)));const h=cl(n);let _=this.keyIdToKeyInfo[h];if((r=_)!=null&&r.decryptdata.key)return n.key=_.decryptdata.key,Promise.resolve({frag:e,keyInfo:_});if(this.emeController&&(i=_)!=null&&i.keyLoadPromise)switch(this.emeController.getKeyStatus(_.decryptdata)){case"usable":case"usable-in-future":return _.keyLoadPromise.then(x=>{const{keyInfo:D}=x;return n.key=D.decryptdata.key,{frag:e,keyInfo:D}})}switch(this.log(`${this.keyIdToKeyInfo[h]?"Rel":"L"}oading${n.keyId?" keyId: "+ce(n.keyId):""} URI: ${n.uri} from ${e.type} ${e.level}`),_=this.keyIdToKeyInfo[h]={decryptdata:n,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},n.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return n.keyFormat==="identity"?this.loadKeyHTTP(_,e):this.loadKeyEME(_,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(_,e);default:return Promise.reject(this.createKeyLoadError(e,A.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${n.method}"`)))}}loadKeyEME(e,t){const r={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var i;if(!e.decryptdata.keyId&&(i=t.initSegment)!=null&&i.data){const a=Ct(t.initSegment.data);if(a.length){let h=a[0];h.some(_=>_!==0)?(this.log(`Using keyId found in init segment ${ce(h)}`),An.setKeyIdForUri(e.decryptdata.uri,h)):(h=An.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${ce(h)}`)),e.decryptdata.keyId=h}}if(!e.decryptdata.keyId&&!Oe(t))return Promise.resolve(r);const n=this.emeController.loadKey(r);return(e.keyLoadPromise=n.then(a=>(e.mediaKeySessionContext=a,r))).catch(a=>{throw e.keyLoadPromise=null,"data"in a&&(a.data.frag=t),a})}return Promise.resolve(r)}loadKeyHTTP(e,t){const r=this.config,i=r.loader,n=new i(r);return t.keyLoader=e.loader=n,e.keyLoadPromise=new Promise((a,h)=>{const _={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},g=r.keyLoadPolicy.default,x={loadPolicy:g,timeout:g.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},D={onSuccess:(j,Y,Q,ue)=>{const{frag:le,keyInfo:be}=Q,xe=cl(be.decryptdata);if(!le.decryptdata||be!==this.keyIdToKeyInfo[xe])return h(this.createKeyLoadError(le,A.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),ue));be.decryptdata.key=le.decryptdata.key=new Uint8Array(j.data),le.keyLoader=null,be.loader=null,a({frag:le,keyInfo:be})},onError:(j,Y,Q,ue)=>{this.resetLoader(Y),h(this.createKeyLoadError(t,A.KEY_LOAD_ERROR,new Error(`HTTP Error ${j.code} loading key ${j.text}`),Q,c({url:_.url,data:void 0},j)))},onTimeout:(j,Y,Q)=>{this.resetLoader(Y),h(this.createKeyLoadError(t,A.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),Q))},onAbort:(j,Y,Q)=>{this.resetLoader(Y),h(this.createKeyLoadError(t,A.INTERNAL_ABORTED,new Error("key loading aborted"),Q))}};n.load(_,x,D)})}resetLoader(e){const{frag:t,keyInfo:r,url:i}=e,n=r.loader;t.keyLoader===n&&(t.keyLoader=null,r.loader=null);const a=cl(r.decryptdata)||i;delete this.keyIdToKeyInfo[a],n&&n.destroy()}}function cl(o){if(o.keyFormat!==yr.FAIRPLAY){const e=o.keyId;if(e)return ce(e)}return o.uri}function pu(o){const{type:e}=o;switch(e){case U.AUDIO_TRACK:return S.AUDIO;case U.SUBTITLE_TRACK:return S.SUBTITLE;default:return S.MAIN}}function hl(o,e){let t=o.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Hh{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,n=r||i,a=new n(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:n,url:a,deliveryDirectives:h,levelInfo:_}=t;this.load({id:r,level:i,pathwayId:n,responseType:"text",type:U.LEVEL,url:a,deliveryDirectives:h,levelOrTrack:_})}onAudioTrackLoading(e,t){const{id:r,groupId:i,url:n,deliveryDirectives:a,track:h}=t;this.load({id:r,groupId:i,level:null,responseType:"text",type:U.AUDIO_TRACK,url:n,deliveryDirectives:a,levelOrTrack:h})}onSubtitleTrackLoading(e,t){const{id:r,groupId:i,url:n,deliveryDirectives:a,track:h}=t;this.load({id:r,groupId:i,level:null,responseType:"text",type:U.SUBTITLE_TRACK,url:n,deliveryDirectives:a,levelOrTrack:h})}onLevelsUpdated(e,t){const r=this.loaders[U.LEVEL];if(r){const i=r.context;i&&!t.levels.some(n=>n===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,x=i.context;if(x&&x.levelOrTrack===e.levelOrTrack&&(x.url===e.url||x.deliveryDirectives&&!e.deliveryDirectives)){x.url===e.url?g.log(`[playlist-loader]: ignore ${e.url} ongoing request`):g.log(`[playlist-loader]: ignore ${e.url} in favor of ${x.url}`);return}g.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let n;if(e.type===U.MANIFEST?n=r.manifestLoadPolicy.default:n=u({},r.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),R((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 x=g.partTarget,D=g.targetduration;if(x&&D){const j=Math.max(x*3,D*.8)*1e3;n=u({},n,{maxTimeToFirstByteMs:Math.min(j,n.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(j,n.maxTimeToFirstByteMs)})}}}const a=n.errorRetry||n.timeoutRetry||{},h={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},_={onSuccess:(g,x,D,j)=>{const Y=this.getInternalLoader(D);this.resetInternalLoader(D.type);const Q=g.data;x.parsing.start=performance.now(),ln.isMediaPlaylist(Q)||D.type!==U.MANIFEST?this.handleTrackOrLevelPlaylist(g,x,D,j||null,Y):this.handleMasterPlaylist(g,x,D,j)},onError:(g,x,D,j)=>{this.handleNetworkError(x,D,!1,g,j)},onTimeout:(g,x,D)=>{this.handleNetworkError(x,D,!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 n=this.hls,a=e.data,h=hl(e,r),_=ln.parseMasterPlaylist(a,h);if(_.playlistParsingError){t.parsing.end=performance.now(),this.handleManifestParsingError(e,r,_.playlistParsingError,i,t);return}const{contentSteering:g,levels:x,sessionData:D,sessionKeys:j,startTimeOffset:Y,variableList:Q}=_;this.variableList=Q,x.forEach(xe=>{const{unknownCodecs:Ce}=xe;if(Ce){const{preferManagedMediaSource:Ue}=this.hls.config;let{audioCodec:qe,videoCodec:pt}=xe;for(let Ye=Ce.length;Ye--;){const at=Ce[Ye];Me(at,"audio",Ue)?(xe.audioCodec=qe=qe?`${qe},${at}`:at,Lt.audio[qe.substring(0,4)]=2,Ce.splice(Ye,1)):Me(at,"video",Ue)&&(xe.videoCodec=pt=pt?`${pt},${at}`:at,Lt.video[pt.substring(0,4)]=2,Ce.splice(Ye,1))}}});const{AUDIO:ue=[],SUBTITLES:le,"CLOSED-CAPTIONS":be}=ln.parseMasterPlaylistMedia(a,h,_);ue.length&&!ue.some(Ce=>!Ce.url)&&x[0].audioCodec&&!x[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),ue.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new or({}),bitrate:0,url:""})),n.trigger(d.MANIFEST_LOADED,{levels:x,audioTracks:ue,subtitles:le,captions:be,contentSteering:g,url:h,stats:t,networkDetails:i,sessionData:D,sessionKeys:j,startTimeOffset:Y,variableList:Q})}handleTrackOrLevelPlaylist(e,t,r,i,n){const a=this.hls,{id:h,level:_,type:g}=r,x=hl(e,r),D=R(_)?_:R(h)?h:0,j=pu(r),Y=ln.parseLevelPlaylist(e.data,x,D,j,0,this.variableList);if(g===U.MANIFEST){const Q={attrs:new or({}),bitrate:0,details:Y,name:"",url:x};Y.requestScheduled=t.loading.start+Dn(Y,0),a.trigger(d.MANIFEST_LOADED,{levels:[Q],audioTracks:[],url:x,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,n)}handleManifestParsingError(e,t,r,i,n){this.hls.trigger(d.ERROR,{type:P.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:n})}handleNetworkError(e,t,r=!1,i,n){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 x=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}x&&this.resetInternalLoader(e.type);const D={type:P.NETWORK_ERROR,details:_,fatal:g,url:e.url,loader:x,context:e,error:h,networkDetails:t,stats:n};if(i){const j=(t==null?void 0:t.url)||e.url;D.response=c({url:j,data:void 0},i)}this.hls.trigger(d.ERROR,D)}handlePlaylistLoaded(e,t,r,i,n,a){const h=this.hls,{type:_,level:g,levelOrTrack:x,id:D,groupId:j,deliveryDirectives:Y}=i,Q=hl(t,i),ue=pu(i);let le=typeof i.level=="number"&&ue===S.MAIN?g:void 0;const be=e.playlistParsingError;if(be){if(this.hls.logger.warn(`${be} ${e.url}`),!h.config.ignorePlaylistParsingErrors){h.trigger(d.ERROR,{type:P.NETWORK_ERROR,details:A.LEVEL_PARSING_ERROR,fatal:!1,url:Q,error:be,reason:be.message,response:t,context:i,level:le,parent:ue,networkDetails:n,stats:r});return}e.playlistParsingError=null}if(!e.fragments.length){const xe=e.playlistParsingError=new Error("No Segments found in Playlist");h.trigger(d.ERROR,{type:P.NETWORK_ERROR,details:A.LEVEL_EMPTY_ERROR,fatal:!1,url:Q,error:xe,reason:xe.message,response:t,context:i,level:le,parent:ue,networkDetails:n,stats:r});return}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:if(le){if(!x)le=0;else if(x!==h.levels[le]){const xe=h.levels.indexOf(x);xe>-1&&(le=xe)}}h.trigger(d.LEVEL_LOADED,{details:e,levelInfo:x||h.levels[0],level:le||0,id:D||0,stats:r,networkDetails:n,deliveryDirectives:Y,withoutMultiVariant:_===U.MANIFEST});break;case U.AUDIO_TRACK:h.trigger(d.AUDIO_TRACK_LOADED,{details:e,track:x,id:D||0,groupId:j||"",stats:r,networkDetails:n,deliveryDirectives:Y});break;case U.SUBTITLE_TRACK:h.trigger(d.SUBTITLE_TRACK_LOADED,{details:e,track:x,id:D||0,groupId:j||"",stats:r,networkDetails:n,deliveryDirectives:Y});break}}}class ps{static get version(){return vs}static isMSESupported(){return du()}static isSupported(){return Bh()}static getMediaSource(){return ie()}static get Events(){return d}static get MetadataSchema(){return vi}static get ErrorTypes(){return P}static get ErrorDetails(){return A}static get DefaultConfig(){return ps.defaultConfig?ps.defaultConfig:Ch}static set DefaultConfig(e){ps.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 Ms,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=W(e.debug||!1,"Hls instance",e.assetPlayerId),r=this.config=Th(ps.DefaultConfig,e,t);this.userConfig=e,r.progressive&&Dh(r,t);const{abrController:i,bufferController:n,capLevelController:a,errorController:h,fpsController:_}=r,g=new h(this),x=this.abrController=new i(this),D=new Gn(this),j=r.interstitialsController,Y=j?this.interstitialsController=new j(this,ps):null,Q=this.bufferController=new n(this,D),ue=this.capLevelController=new a(this),le=new _(this),be=new Hh(this),xe=r.contentSteeringController,Ce=xe?new xe(this):null,Ue=this.levelController=new Fh(this,Ce),qe=new Oh(this),pt=new zh(this.config,this.logger),Ye=this.streamController=new $h(this,D,pt),at=this.gapController=new Ih(this,D);ue.setStreamController(Ye),le.setStreamController(Ye);const nt=[be,Ue,Ye];Y&&nt.splice(1,0,Y),Ce&&nt.splice(1,0,Ce),this.networkControllers=nt;const Ze=[x,Q,at,ue,le,qe,D];this.audioTrackController=this.createController(r.audioTrackController,nt);const wt=r.audioStreamController;wt&&nt.push(this.audioStreamController=new wt(this,D,pt)),this.subtitleTrackController=this.createController(r.subtitleTrackController,nt);const Wt=r.subtitleStreamController;Wt&&nt.push(this.subtititleStreamController=new Wt(this,D,pt)),this.createController(r.timelineController,Ze),pt.emeController=this.emeController=this.createController(r.emeController,Ze),this.cmcdController=this.createController(r.cmcdController,Ze),this.latencyController=this.createController(Mh,Ze),this.coreComponents=Ze,nt.push(g);const Zt=g.onErrorOut;typeof Zt=="function"&&this.on(d.ERROR,Zt,g),this.on(d.MANIFEST_LOADED,be.onManifestLoaded,be)}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:P.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 n=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(d.ERROR,{type:P.OTHER_ERROR,details:A.ATTACH_MEDIA_ERROR,fatal:!0,error:n});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=B.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={[S.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[S.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[S.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=Ic()),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){Jr(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 n=i;n--;){const a=e[n].attrs["HDCP-LEVEL"];if(a&&a<=r)return n}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=pi(t);return bt(e,r,navigator.mediaCapabilities)}}ps.defaultConfig=void 0}}]);
|
|
|
}()); |