You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__RestFul__index.ae30e7fc....

1038 lines
1.1 MiB

!(function(){var Xo=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[1006],{65352:function(vn,Et,A){"use strict";A.d(Et,{Z:function(){return qe}});var k=A(20439),pe=A(50298),Te=A(62646),fe=A(43403),$=A(92310),p=A.n($),me=A(29301),ce=A(76846),o=A(96452),x=A(6089),D=A(80402),h=A(34280),m=A(49658),y=A(59301),S=A(14809),M=A(77900),z=A(8654);function Y(Re){var we=Re.prefixCls,K=Re.align,Se=Re.arrow,Ne=Re.arrowPos,V=Se||{},I=V.className,F=V.content,oe=Ne.x,w=oe===void 0?0:oe,C=Ne.y,B=C===void 0?0:C,W=y.useRef();if(!K||!K.points)return null;var Z={position:"absolute"};if(K.autoArrow!==!1){var te=K.points[0],ue=K.points[1],ge=te[0],Ce=te[1],De=ue[0],Fe=ue[1];ge===De||!["t","b"].includes(ge)?Z.top=B:ge==="t"?Z.top=0:Z.bottom=0,Ce===Fe||!["l","r"].includes(Ce)?Z.left=w:Ce==="l"?Z.left=0:Z.right=0}return y.createElement("div",{ref:W,className:p()("".concat(we,"-arrow"),I),style:Z},F)}function L(Re){var we=Re.prefixCls,K=Re.open,Se=Re.zIndex,Ne=Re.mask,V=Re.motion;return Ne?y.createElement(M.default,(0,S.Z)({},V,{motionAppear:!0,visible:K,removeOnLeave:!0}),function(I){var F=I.className;return y.createElement("div",{style:{zIndex:Se},className:p()("".concat(we,"-mask"),F)})}):null}var O=y.memo(function(Re){var we=Re.children;return we},function(Re,we){return we.cache}),T=O,R=y.forwardRef(function(Re,we){var K=Re.popup,Se=Re.className,Ne=Re.prefixCls,V=Re.style,I=Re.target,F=Re.onVisibleChanged,oe=Re.open,w=Re.keepDom,C=Re.fresh,B=Re.onClick,W=Re.mask,Z=Re.arrow,te=Re.arrowPos,ue=Re.align,ge=Re.motion,Ce=Re.maskMotion,De=Re.forceRender,Fe=Re.getPopupContainer,Ve=Re.autoDestroy,Ge=Re.portal,$e=Re.zIndex,mt=Re.onMouseEnter,xt=Re.onMouseLeave,St=Re.onPointerEnter,Lt=Re.onPointerDownCapture,Ht=Re.ready,ut=Re.offsetX,Ut=Re.offsetY,Le=Re.offsetR,Ae=Re.offsetB,Ie=Re.onAlign,H=Re.onPrepare,ee=Re.stretch,de=Re.targetWidth,re=Re.targetHeight,_e=typeof K=="function"?K():K,et=oe||w,Ye=(Fe==null?void 0:Fe.length)>0,it=y.useState(!Fe||!Ye),Rt=(0,pe.Z)(it,2),on=Rt[0],fn=Rt[1];if((0,h.Z)(function(){!on&&Ye&&I&&fn(!0)},[on,Ye,I]),!on)return null;var Pt="auto",jt={left:"-1000vw",top:"-1000vh",right:Pt,bottom:Pt};if(Ht||!oe){var wn,Gn=ue.points,An=ue.dynamicInset||((wn=ue._experimental)===null||wn===void 0?void 0:wn.dynamicInset),Mn=An&&Gn[0][1]==="r",Cn=An&&Gn[0][0]==="b";Mn?(jt.right=Le,jt.left=Pt):(jt.left=ut,jt.right=Pt),Cn?(jt.bottom=Ae,jt.top=Pt):(jt.top=Ut,jt.bottom=Pt)}var rn={};return ee&&(ee.includes("height")&&re?rn.height=re:ee.includes("minHeight")&&re&&(rn.minHeight=re),ee.includes("width")&&de?rn.width=de:ee.includes("minWidth")&&de&&(rn.minWidth=de)),oe||(rn.pointerEvents="none"),y.createElement(Ge,{open:De||et,getContainer:Fe&&function(){return Fe(I)},autoDestroy:Ve},y.createElement(L,{prefixCls:Ne,open:oe,zIndex:$e,mask:W,motion:Ce}),y.createElement(me.Z,{onResize:Ie,disabled:!oe},function(Tn){return y.createElement(M.default,(0,S.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:De,leavedClassName:"".concat(Ne,"-hidden")},ge,{onAppearPrepare:H,onEnterPrepare:H,visible:oe,onVisibleChanged:function(tr){var Me;ge==null||(Me=ge.onVisibleChanged)===null||Me===void 0||Me.call(ge,tr),F(tr)}}),function($n,tr){var Me=$n.className,Pe=$n.style,Tt=p()(Ne,Me,Se);return y.createElement("div",{ref:(0,z.sQ)(Tn,we,tr),className:Tt,style:(0,k.Z)((0,k.Z)((0,k.Z)((0,k.Z)({"--arrow-x":"".concat(te.x||0,"px"),"--arrow-y":"".concat(te.y||0,"px")},jt),rn),Pe),{},{boxSizing:"border-box",zIndex:$e},V),onMouseEnter:mt,onMouseLeave:xt,onPointerEnter:St,onClick:B,onPointerDownCapture:Lt},Z&&y.createElement(Y,{prefixCls:Ne,arrow:Z,arrowPos:te,align:ue}),y.createElement(T,{cache:!oe&&!C},_e))})}))}),se=R,ae=y.forwardRef(function(Re,we){var K=Re.children,Se=Re.getTriggerDOMNode,Ne=(0,z.Yr)(K),V=y.useCallback(function(F){(0,z.mH)(we,Se?Se(F):F)},[Se]),I=(0,z.x1)(V,(0,z.C4)(K));return Ne?y.cloneElement(K,{ref:I}):K}),q=ae,he=y.createContext(null),ve=he;function be(Re){return Re?Array.isArray(Re)?Re:[Re]:[]}function Oe(Re,we,K,Se){return y.useMemo(function(){var Ne=be(K!=null?K:we),V=be(Se!=null?Se:we),I=new Set(Ne),F=new Set(V);return Re&&(I.has("hover")&&(I.delete("hover"),I.add("click")),F.has("hover")&&(F.delete("hover"),F.add("click"))),[I,F]},[Re,we,K,Se])}var Q=A(29194);function P(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],K=arguments.length>2?arguments[2]:void 0;return K?Re[0]===we[0]:Re[0]===we[0]&&Re[1]===we[1]}function j(Re,we,K,Se){for(var Ne=K.points,V=Object.keys(Re),I=0;I<V.length;I+=1){var F,oe=V[I];if(P((F=Re[oe])===null||F===void 0?void 0:F.points,Ne,Se))return"".concat(we,"-placement-").concat(oe)}return""}function X(Re,we,K,Se){return we||(K?{motionName:"".concat(Re,"-").concat(K)}:Se?{motionName:Se}:null)}function ne(Re){return Re.ownerDocument.defaultView}function J(Re){for(var we=[],K=Re==null?void 0:Re.parentElement,Se=["hidden","scroll","clip","auto"];K;){var Ne=ne(K).getComputedStyle(K),V=Ne.overflowX,I=Ne.overflowY,F=Ne.overflow;[V,I,F].some(function(oe){return Se.includes(oe)})&&we.push(K),K=K.parentElement}return we}function v(Re){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Re)?we:Re}function g(Re){return v(parseFloat(Re),0)}function U(Re,we){var K=(0,k.Z)({},Re);return(we||[]).forEach(function(Se){if(!(Se instanceof HTMLBodyElement||Se instanceof HTMLHtmlElement)){var Ne=ne(Se).getComputedStyle(Se),V=Ne.overflow,I=Ne.overflowClipMargin,F=Ne.borderTopWidth,oe=Ne.borderBottomWidth,w=Ne.borderLeftWidth,C=Ne.borderRightWidth,B=Se.getBoundingClientRect(),W=Se.offsetHeight,Z=Se.clientHeight,te=Se.offsetWidth,ue=Se.clientWidth,ge=g(F),Ce=g(oe),De=g(w),Fe=g(C),Ve=v(Math.round(B.width/te*1e3)/1e3),Ge=v(Math.round(B.height/W*1e3)/1e3),$e=(te-ue-De-Fe)*Ve,mt=(W-Z-ge-Ce)*Ge,xt=ge*Ge,St=Ce*Ge,Lt=De*Ve,Ht=Fe*Ve,ut=0,Ut=0;if(V==="clip"){var Le=g(I);ut=Le*Ve,Ut=Le*Ge}var Ae=B.x+Lt-ut,Ie=B.y+xt-Ut,H=Ae+B.width+2*ut-Lt-Ht-$e,ee=Ie+B.height+2*Ut-xt-St-mt;K.left=Math.max(K.left,Ae),K.top=Math.max(K.top,Ie),K.right=Math.min(K.right,H),K.bottom=Math.min(K.bottom,ee)}}),K}function ie(Re){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,K="".concat(we),Se=K.match(/^(.*)\%$/);return Se?Re*(parseFloat(Se[1])/100):parseFloat(K)}function Be(Re,we){var K=we||[],Se=(0,pe.Z)(K,2),Ne=Se[0],V=Se[1];return[ie(Re.width,Ne),ie(Re.height,V)]}function Ze(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Re[0],Re[1]]}function Qe(Re,we){var K=we[0],Se=we[1],Ne,V;return K==="t"?V=Re.y:K==="b"?V=Re.y+Re.height:V=Re.y+Re.height/2,Se==="l"?Ne=Re.x:Se==="r"?Ne=Re.x+Re.width:Ne=Re.x+Re.width/2,{x:Ne,y:V}}function nt(Re,we){var K={t:"b",b:"t",l:"r",r:"l"};return Re.map(function(Se,Ne){return Ne===we?K[Se]||"c":Se}).join("")}function At(Re,we,K,Se,Ne,V,I){var F=y.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Ne[Se]||{}}),oe=(0,pe.Z)(F,2),w=oe[0],C=oe[1],B=y.useRef(0),W=y.useMemo(function(){return we?J(we):[]},[we]),Z=y.useRef({}),te=function(){Z.current={}};Re||te();var ue=(0,x.Z)(function(){if(we&&K&&Re){let Ir=function(Fn,lr){var Sn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Zt,Zn=it.x+Fn,On=it.y+lr,Un=Zn+Mn,ur=On+An,yr=Math.max(Zn,Sn.left),gn=Math.max(On,Sn.top),In=Math.min(Un,Sn.right),fr=Math.min(ur,Sn.bottom);return Math.max(0,(In-yr)*(fr-gn))},_r=function(){Vn=it.y+Mt,mr=Vn+An,nr=it.x+Nt,ar=nr+Mn};var De,Fe,Ve,Ge,$e=we,mt=$e.ownerDocument,xt=ne($e),St=xt.getComputedStyle($e),Lt=St.width,Ht=St.height,ut=St.position,Ut=$e.style.left,Le=$e.style.top,Ae=$e.style.right,Ie=$e.style.bottom,H=$e.style.overflow,ee=(0,k.Z)((0,k.Z)({},Ne[Se]),V),de=mt.createElement("div");(De=$e.parentElement)===null||De===void 0||De.appendChild(de),de.style.left="".concat($e.offsetLeft,"px"),de.style.top="".concat($e.offsetTop,"px"),de.style.position=ut,de.style.height="".concat($e.offsetHeight,"px"),de.style.width="".concat($e.offsetWidth,"px"),$e.style.left="0",$e.style.top="0",$e.style.right="auto",$e.style.bottom="auto",$e.style.overflow="hidden";var re;if(Array.isArray(K))re={x:K[0],y:K[1],width:0,height:0};else{var _e,et,Ye=K.getBoundingClientRect();Ye.x=(_e=Ye.x)!==null&&_e!==void 0?_e:Ye.left,Ye.y=(et=Ye.y)!==null&&et!==void 0?et:Ye.top,re={x:Ye.x,y:Ye.y,width:Ye.width,height:Ye.height}}var it=$e.getBoundingClientRect();it.x=(Fe=it.x)!==null&&Fe!==void 0?Fe:it.left,it.y=(Ve=it.y)!==null&&Ve!==void 0?Ve:it.top;var Rt=mt.documentElement,on=Rt.clientWidth,fn=Rt.clientHeight,Pt=Rt.scrollWidth,jt=Rt.scrollHeight,wn=Rt.scrollTop,Gn=Rt.scrollLeft,An=it.height,Mn=it.width,Cn=re.height,rn=re.width,Tn={left:0,top:0,right:on,bottom:fn},$n={left:-Gn,top:-wn,right:Pt-Gn,bottom:jt-wn},tr=ee.htmlRegion,Me="visible",Pe="visibleFirst";tr!=="scroll"&&tr!==Pe&&(tr=Me);var Tt=tr===Pe,pt=U($n,W),dt=U(Tn,W),Zt=tr===Me?dt:pt,ze=Tt?dt:Zt;$e.style.left="auto",$e.style.top="auto",$e.style.right="0",$e.style.bottom="0";var tt=$e.getBoundingClientRect();$e.style.left=Ut,$e.style.top=Le,$e.style.right=Ae,$e.style.bottom=Ie,$e.style.overflow=H,(Ge=$e.parentElement)===null||Ge===void 0||Ge.removeChild(de);var ot=v(Math.round(Mn/parseFloat(Lt)*1e3)/1e3),It=v(Math.round(An/parseFloat(Ht)*1e3)/1e3);if(ot===0||It===0||(0,ce.Sh)(K)&&!(0,Q.Z)(K))return;var Ft=ee.offset,Xt=ee.targetOffset,Bt=Be(it,Ft),yt=(0,pe.Z)(Bt,2),ye=yt[0],Ue=yt[1],He=Be(re,Xt),je=(0,pe.Z)(He,2),at=je[0],ct=je[1];re.x-=at,re.y-=ct;var lt=ee.points||[],wt=(0,pe.Z)(lt,2),Ot=wt[0],$t=wt[1],pn=Ze($t),kt=Ze(Ot),_n=Qe(re,pn),sn=Qe(it,kt),un=(0,k.Z)({},ee),Nt=_n.x-sn.x+ye,Mt=_n.y-sn.y+Ue,qt=Ir(Nt,Mt),cn=Ir(Nt,Mt,dt),ln=Qe(re,["t","l"]),an=Qe(it,["t","l"]),yn=Qe(re,["b","r"]),Vt=Qe(it,["b","r"]),Wt=ee.overflow||{},Jn=Wt.adjustX,Wn=Wt.adjustY,Bn=Wt.shiftX,Hn=Wt.shiftY,qn=function(lr){return typeof lr=="boolean"?lr:lr>=0},Vn,mr,nr,ar;_r();var En=qn(Wn),Dt=kt[0]===pn[0];if(En&&kt[0]==="t"&&(mr>ze.bottom||Z.current.bt)){var bt=Mt;Dt?bt-=An-Cn:bt=ln.y-Vt.y-Ue;var Qt=Ir(Nt,bt),Yt=Ir(Nt,bt,dt);Qt>qt||Qt===qt&&(!Tt||Yt>=cn)?(Z.current.bt=!0,Mt=bt,Ue=-Ue,un.points=[nt(kt,0),nt(pn,0)]):Z.current.bt=!1}if(En&&kt[0]==="b"&&(Vn<ze.top||Z.current.tb)){var mn=Mt;Dt?mn+=An-Cn:mn=yn.y-an.y-Ue;var Yn=Ir(Nt,mn),er=Ir(Nt,mn,dt);Yn>qt||Yn===qt&&(!Tt||er>=cn)?(Z.current.tb=!0,Mt=mn,Ue=-Ue,un.points=[nt(kt,0),nt(pn,0)]):Z.current.tb=!1}var en=qn(Jn),xn=kt[1]===pn[1];if(en&&kt[1]==="l"&&(ar>ze.right||Z.current.rl)){var Pn=Nt;xn?Pn-=Mn-rn:Pn=ln.x-Vt.x-ye;var kn=Ir(Pn,Mt),dr=Ir(Pn,Mt,dt);kn>qt||kn===qt&&(!Tt||dr>=cn)?(Z.current.rl=!0,Nt=Pn,ye=-ye,un.points=[nt(kt,1),nt(pn,1)]):Z.current.rl=!1}if(en&&kt[1]==="r"&&(nr<ze.left||Z.current.lr)){var bn=Nt;xn?bn+=Mn-rn:bn=yn.x-an.x-ye;var jn=Ir(bn,Mt),Xn=Ir(bn,Mt,dt);jn>qt||jn===qt&&(!Tt||Xn>=cn)?(Z.current.lr=!0,Nt=bn,ye=-ye,un.points=[nt(kt,1),nt(pn,1)]):Z.current.lr=!1}_r();var tn=Bn===!0?0:Bn;typeof tn=="number"&&(nr<dt.left&&(Nt-=nr-dt.left-ye,re.x+rn<dt.left+tn&&(Nt+=re.x-dt.left+rn-tn)),ar>dt.right&&(Nt-=ar-dt.right-ye,re.x>dt.right-tn&&(Nt+=re.x-dt.right+tn)));var rr=Hn===!0?0:Hn;typeof rr=="number"&&(Vn<dt.top&&(Mt-=Vn-dt.top-Ue,re.y+Cn<dt.top+rr&&(Mt+=re.y-dt.top+Cn-rr)),mr>dt.bottom&&(Mt-=mr-dt.bottom-Ue,re.y>dt.bottom-rr&&(Mt+=re.y-dt.bottom+rr)));var vr=it.x+Nt,hr=vr+Mn,Er=it.y+Mt,kr=Er+An,Cr=re.x,br=Cr+rn,Kn=re.y,Xr=Kn+Cn,Mr=Math.max(vr,Cr),zr=Math.min(hr,br),Tr=(Mr+zr)/2,ai=Tr-vr,ti=Math.max(Er,Kn),Fr=Math.min(kr,Xr),Wr=(ti+Fr)/2,Zr=Wr-Er;I==null||I(we,un);var Nr=tt.right-it.x-(Nt+it.width),Ar=tt.bottom-it.y-(Mt+it.height);ot===1&&(Nt=Math.round(Nt),Nr=Math.round(Nr)),It===1&&(Mt=Math.round(Mt),Ar=Math.round(Ar));var $r={ready:!0,offsetX:Nt/ot,offsetY:Mt/It,offsetR:Nr/ot,offsetB:Ar/It,arrowX:ai/ot,arrowY:Zr/It,scaleX:ot,scaleY:It,align:un};C($r)}}),ge=function(){B.current+=1;var Fe=B.current;Promise.resolve().then(function(){B.current===Fe&&ue()})},Ce=function(){C(function(Fe){return(0,k.Z)((0,k.Z)({},Fe),{},{ready:!1})})};return(0,h.Z)(Ce,[Se]),(0,h.Z)(function(){Re||Ce()},[Re]),[w.ready,w.offsetX,w.offsetY,w.offsetR,w.offsetB,w.arrowX,w.arrowY,w.scaleX,w.scaleY,w.align,ge]}var _t=A(95190);function xe(Re,we,K,Se,Ne){(0,h.Z)(function(){if(Re&&we&&K){let B=function(){Se(),Ne()};var V=we,I=K,F=J(V),oe=J(I),w=ne(I),C=new Set([w].concat((0,_t.Z)(F),(0,_t.Z)(oe)));return C.forEach(function(W){W.addEventListener("scroll",B,{passive:!0})}),w.addEventListener("resize",B,{passive:!0}),Se(),function(){C.forEach(function(W){W.removeEventListener("scroll",B),w.removeEventListener("resize",B)})}}},[Re,we,K])}var vt=A(48736);function zt(Re,we,K,Se,Ne,V,I,F){var oe=y.useRef(Re);oe.current=Re;var w=y.useRef(!1);y.useEffect(function(){if(we&&Se&&(!Ne||V)){var B=function(){w.current=!1},W=function(Ve){var Ge;oe.current&&!I(((Ge=Ve.composedPath)===null||Ge===void 0||(Ge=Ge.call(Ve))===null||Ge===void 0?void 0:Ge[0])||Ve.target)&&!w.current&&F(!1)},Z=ne(Se);Z.addEventListener("pointerdown",B,!0),Z.addEventListener("mousedown",W,!0),Z.addEventListener("contextmenu",W,!0);var te=(0,o.A)(K);if(te&&(te.addEventListener("mousedown",W,!0),te.addEventListener("contextmenu",W,!0)),0)var ue,ge,Ce,De;return function(){Z.removeEventListener("pointerdown",B,!0),Z.removeEventListener("mousedown",W,!0),Z.removeEventListener("contextmenu",W,!0),te&&(te.removeEventListener("mousedown",W,!0),te.removeEventListener("contextmenu",W,!0))}}},[we,K,Se,Ne,V]);function C(){w.current=!0}return C}var Ct=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function nn(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fe.Z,we=y.forwardRef(function(K,Se){var Ne=K.prefixCls,V=Ne===void 0?"rc-trigger-popup":Ne,I=K.children,F=K.action,oe=F===void 0?"hover":F,w=K.showAction,C=K.hideAction,B=K.popupVisible,W=K.defaultPopupVisible,Z=K.onPopupVisibleChange,te=K.afterPopupVisibleChange,ue=K.mouseEnterDelay,ge=K.mouseLeaveDelay,Ce=ge===void 0?.1:ge,De=K.focusDelay,Fe=K.blurDelay,Ve=K.mask,Ge=K.maskClosable,$e=Ge===void 0?!0:Ge,mt=K.getPopupContainer,xt=K.forceRender,St=K.autoDestroy,Lt=K.destroyPopupOnHide,Ht=K.popup,ut=K.popupClassName,Ut=K.popupStyle,Le=K.popupPlacement,Ae=K.builtinPlacements,Ie=Ae===void 0?{}:Ae,H=K.popupAlign,ee=K.zIndex,de=K.stretch,re=K.getPopupClassNameFromAlign,_e=K.fresh,et=K.alignPoint,Ye=K.onPopupClick,it=K.onPopupAlign,Rt=K.arrow,on=K.popupMotion,fn=K.maskMotion,Pt=K.popupTransitionName,jt=K.popupAnimation,wn=K.maskTransitionName,Gn=K.maskAnimation,An=K.className,Mn=K.getTriggerDOMNode,Cn=(0,Te.Z)(K,Ct),rn=St||Lt||!1,Tn=y.useState(!1),$n=(0,pe.Z)(Tn,2),tr=$n[0],Me=$n[1];(0,h.Z)(function(){Me((0,m.Z)())},[]);var Pe=y.useRef({}),Tt=y.useContext(ve),pt=y.useMemo(function(){return{registerSubPopup:function(In,fr){Pe.current[In]=fr,Tt==null||Tt.registerSubPopup(In,fr)}}},[Tt]),dt=(0,D.Z)(),Zt=y.useState(null),ze=(0,pe.Z)(Zt,2),tt=ze[0],ot=ze[1],It=y.useRef(null),Ft=(0,x.Z)(function(gn){It.current=gn,(0,ce.Sh)(gn)&&tt!==gn&&ot(gn),Tt==null||Tt.registerSubPopup(dt,gn)}),Xt=y.useState(null),Bt=(0,pe.Z)(Xt,2),yt=Bt[0],ye=Bt[1],Ue=y.useRef(null),He=(0,x.Z)(function(gn){(0,ce.Sh)(gn)&&yt!==gn&&(ye(gn),Ue.current=gn)}),je=y.Children.only(I),at=(je==null?void 0:je.props)||{},ct={},lt=(0,x.Z)(function(gn){var In,fr,or=yt;return(or==null?void 0:or.contains(gn))||((In=(0,o.A)(or))===null||In===void 0?void 0:In.host)===gn||gn===or||(tt==null?void 0:tt.contains(gn))||((fr=(0,o.A)(tt))===null||fr===void 0?void 0:fr.host)===gn||gn===tt||Object.values(Pe.current).some(function(pr){return(pr==null?void 0:pr.contains(gn))||gn===pr})}),wt=X(V,on,jt,Pt),Ot=X(V,fn,Gn,wn),$t=y.useState(W||!1),pn=(0,pe.Z)($t,2),kt=pn[0],_n=pn[1],sn=B!=null?B:kt,un=(0,x.Z)(function(gn){B===void 0&&_n(gn)});(0,h.Z)(function(){_n(B||!1)},[B]);var Nt=y.useRef(sn);Nt.current=sn;var Mt=y.useRef([]);Mt.current=[];var qt=(0,x.Z)(function(gn){var In;un(gn),((In=Mt.current[Mt.current.length-1])!==null&&In!==void 0?In:sn)!==gn&&(Mt.current.push(gn),Z==null||Z(gn))}),cn=y.useRef(),ln=function(){clearTimeout(cn.current)},an=function(In){var fr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ln(),fr===0?qt(In):cn.current=setTimeout(function(){qt(In)},fr*1e3)};y.useEffect(function(){return ln},[]);var yn=y.useState(!1),Vt=(0,pe.Z)(yn,2),Wt=Vt[0],Jn=Vt[1];(0,h.Z)(function(gn){(!gn||sn)&&Jn(!0)},[sn]);var Wn=y.useState(null),Bn=(0,pe.Z)(Wn,2),Hn=Bn[0],qn=Bn[1],Vn=y.useState(null),mr=(0,pe.Z)(Vn,2),nr=mr[0],ar=mr[1],En=function(In){ar([In.clientX,In.clientY])},Dt=At(sn,tt,et&&nr!==null?nr:yt,Le,Ie,H,it),bt=(0,pe.Z)(Dt,11),Qt=bt[0],Yt=bt[1],mn=bt[2],Yn=bt[3],er=bt[4],en=bt[5],xn=bt[6],Pn=bt[7],kn=bt[8],dr=bt[9],bn=bt[10],jn=Oe(tr,oe,w,C),Xn=(0,pe.Z)(jn,2),tn=Xn[0],rr=Xn[1],vr=tn.has("click"),hr=rr.has("click")||rr.has("contextMenu"),Er=(0,x.Z)(function(){Wt||bn()}),kr=function(){Nt.current&&et&&hr&&an(!1)};xe(sn,yt,tt,Er,kr),(0,h.Z)(function(){Er()},[nr,Le]),(0,h.Z)(function(){sn&&!(Ie!=null&&Ie[Le])&&Er()},[JSON.stringify(H)]);var Cr=y.useMemo(function(){var gn=j(Ie,V,dr,et);return p()(gn,re==null?void 0:re(dr))},[dr,re,Ie,V,et]);y.useImperativeHandle(Se,function(){return{nativeElement:Ue.current,popupElement:It.current,forceAlign:Er}});var br=y.useState(0),Kn=(0,pe.Z)(br,2),Xr=Kn[0],Mr=Kn[1],zr=y.useState(0),Tr=(0,pe.Z)(zr,2),ai=Tr[0],ti=Tr[1],Fr=function(){if(de&&yt){var In=yt.getBoundingClientRect();Mr(In.width),ti(In.height)}},Wr=function(){Fr(),Er()},Zr=function(In){Jn(!1),bn(),te==null||te(In)},Nr=function(){return new Promise(function(In){Fr(),qn(function(){return In})})};(0,h.Z)(function(){Hn&&(bn(),Hn(),qn(null))},[Hn]);function Ar(gn,In,fr,or){ct[gn]=function(pr){var Br;or==null||or(pr),an(In,fr);for(var fi=arguments.length,Vr=new Array(fi>1?fi-1:0),Qr=1;Qr<fi;Qr++)Vr[Qr-1]=arguments[Qr];(Br=at[gn])===null||Br===void 0||Br.call.apply(Br,[at,pr].concat(Vr))}}(vr||hr)&&(ct.onClick=function(gn){var In;Nt.current&&hr?an(!1):!Nt.current&&vr&&(En(gn),an(!0));for(var fr=arguments.length,or=new Array(fr>1?fr-1:0),pr=1;pr<fr;pr++)or[pr-1]=arguments[pr];(In=at.onClick)===null||In===void 0||In.call.apply(In,[at,gn].concat(or))});var $r=zt(sn,hr,yt,tt,Ve,$e,lt,an),Ir=tn.has("hover"),_r=rr.has("hover"),Fn,lr;Ir&&(Ar("onMouseEnter",!0,ue,function(gn){En(gn)}),Ar("onPointerEnter",!0,ue,function(gn){En(gn)}),Fn=function(In){(sn||Wt)&&tt!==null&&tt!==void 0&&tt.contains(In.target)&&an(!0,ue)},et&&(ct.onMouseMove=function(gn){var In;(In=at.onMouseMove)===null||In===void 0||In.call(at,gn)})),_r&&(Ar("onMouseLeave",!1,Ce),Ar("onPointerLeave",!1,Ce),lr=function(){an(!1,Ce)}),tn.has("focus")&&Ar("onFocus",!0,De),rr.has("focus")&&Ar("onBlur",!1,Fe),tn.has("contextMenu")&&(ct.onContextMenu=function(gn){var In;Nt.current&&rr.has("contextMenu")?an(!1):(En(gn),an(!0)),gn.preventDefault();for(var fr=arguments.length,or=new Array(fr>1?fr-1:0),pr=1;pr<fr;pr++)or[pr-1]=arguments[pr];(In=at.onContextMenu)===null||In===void 0||In.call.apply(In,[at,gn].concat(or))}),An&&(ct.className=p()(at.className,An));var Sn=(0,k.Z)((0,k.Z)({},at),ct),Zn={},On=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];On.forEach(function(gn){Cn[gn]&&(Zn[gn]=function(){for(var In,fr=arguments.length,or=new Array(fr),pr=0;pr<fr;pr++)or[pr]=arguments[pr];(In=Sn[gn])===null||In===void 0||In.call.apply(In,[Sn].concat(or)),Cn[gn].apply(Cn,or)})});var Un=y.cloneElement(je,(0,k.Z)((0,k.Z)({},Sn),Zn)),ur={x:en,y:xn},yr=Rt?(0,k.Z)({},Rt!==!0?Rt:{}):null;return y.createElement(y.Fragment,null,y.createElement(me.Z,{disabled:!sn,ref:He,onResize:Wr},y.createElement(q,{getTriggerDOMNode:Mn},Un)),y.createElement(ve.Provider,{value:pt},y.createElement(se,{portal:Re,ref:Ft,prefixCls:V,popup:Ht,className:p()(ut,Cr),style:Ut,target:yt,onMouseEnter:Fn,onMouseLeave:lr,onPointerEnter:Fn,zIndex:ee,open:sn,keepDom:Wt,fresh:_e,onClick:Ye,onPointerDownCapture:$r,mask:Ve,motion:wt,maskMotion:Ot,onVisibleChanged:Zr,onPrepare:Nr,forceRender:xt,autoDestroy:rn,getPopupContainer:mt,align:dr,arrow:yr,arrowPos:ur,ready:Qt,offsetX:Yt,offsetY:mn,offsetR:Yn,offsetB:er,onAlign:Er,stretch:de,targetWidth:Xr/Pn,targetHeight:ai/kn})))});return we}var qe=nn(fe.Z)},28426:function(vn,Et,A){"use strict";var k=A(59301),pe=A(93314),Te=A(99571),fe=Object.defineProperty,$=Object.defineProperties,p=Object.getOwnPropertyDescriptors,me=Object.getOwnPropertySymbols,ce=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,x=(y,S,M)=>S in y?fe(y,S,{enumerable:!0,configurable:!0,writable:!0,value:M}):y[S]=M,D=(y,S)=>{for(var M in S||(S={}))ce.call(S,M)&&x(y,M,S[M]);if(me)for(var M of me(S))o.call(S,M)&&x(y,M,S[M]);return y},h=(y,S)=>$(y,p(S));const m=({img:y,buttonProps:S={},styles:M={},customText:z,ButtonText:Y,ButtonClick:L,Buttonclass:O,ButtonTwo:T,imgStyles:R,loading:se=!1,className:ae=""})=>k.createElement("section",{className:`tc animated fadeIn ${ae}`,style:D({color:"#999",margin:"100px auto",visibility:se?"hidden":"visible"},M)},k.createElement("img",{src:y||pe,style:h(D({},R),{pointerEvents:"none",userSelect:"none"})}),k.createElement("p",{className:"mt20 font14"},z||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),Y&&k.createElement(Te.ZP,D({className:O,onClick:L},S),Y),T&&T);Et.Z=m},45677:function(vn,Et,A){"use strict";A.d(Et,{Z:function(){return O}});var k=A(59301),pe={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},Te=A(99571),fe=A(70557),$=A(75975),p=A(25399),me=A(51257),ce=A(81722),o=A(28426),x=A(346),D=A(44203),h=A(59301),m=Object.defineProperty,y=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable,z=(T,R,se)=>R in T?m(T,R,{enumerable:!0,configurable:!0,writable:!0,value:se}):T[R]=se,Y=(T,R)=>{for(var se in R||(R={}))S.call(R,se)&&z(T,se,R[se]);if(y)for(var se of y(R))M.call(R,se)&&z(T,se,R[se]);return T},L=(T,R,se)=>new Promise((ae,q)=>{var he=Oe=>{try{be(se.next(Oe))}catch(Q){q(Q)}},ve=Oe=>{try{be(se.throw(Oe))}catch(Q){q(Q)}},be=Oe=>Oe.done?ae(Oe.value):Promise.resolve(Oe.value).then(he,ve);be((se=se.apply(T,R)).next())}),O=({editOffice:T="view",data:R,issaver:se,onSaver:ae,theme:q,type:he,filename:ve,monacoEditor:be,className:Oe,style:Q,close:P,onClose:j,hasMask:X,disabledDownload:ne,onImgDimensions:J,showNodata:v,recordInfo:g})=>{const[U,ie]=(0,k.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[Be,Ze]=(0,k.useState)(""),[Qe,nt]=(0,k.useState)(),At=window.ENV==="build"?"/react/build":"",_t=location.host.startsWith("localhost")?x.Z.PROXY_SERVER:x.Z.API_SERVER,vt=10*(1024*1024),zt=(0,k.useRef)();R!=null&&R.startsWith("/api")&&he!=="txt"&&(R=x.Z.API_SERVER+R);const Ct=K=>K.substring(K.lastIndexOf("/")+1).split(".").pop();ve&&be&&(be.filename=ve),(0,k.useEffect)(()=>{var K,Se;const Ne=(Se=(K=document.cookie)==null?void 0:K.replace(/\s/g,""))==null?void 0:Se.split(";");Ne==null||Ne.map(V=>{let I=V.split("=");I[0]==="_educoder_session"&&Ze(I[1])})},[]),(0,k.useEffect)(()=>{he==="office"&&(R.indexOf("bigfilescdn.")>-1||R.indexOf("bigfiles1")>-1?nt({url:R,fileType:Ct(R),model:R.indexOf("model=edit")?"edit":"view"}):qe())},[he,R]);function nn(K){return L(this,null,function*(){K.data.type==="pdfdata"&&(ae(K.data.data),window.removeEventListener("message",nn,!1)),console.log("mess---:",K.data)})}const qe=()=>L(void 0,null,function*(){console.log("data:",R);let K=R;R.startsWith("http")||(K=location.origin+K);let Se=new URL(K).pathname.split("/").pop();const Ne=yield(0,ce.gJ)({attachment_id:Se});Ne.url=_t+Ne.url,nt(Ne)}),Re=()=>{if(R.startsWith("http")||R.startsWith("blob:")){we();return}(0,me.Sv)(ve||"educoder",R,ve)},we=()=>{g&&(0,D.fc)({id:g==null?void 0:g.id,watch_type:1,course_id:g==null?void 0:g.course_id}),(0,me.Nd)(ve||"educoder",decodeURIComponent(R))};return h.createElement("div",{style:Y({},Q||{}),className:`${X&&pe.bgBlack} ${he?pe.wrp:"hide"}`},P&&h.createElement("div",{className:pe.close,ref:zt},!!J&&h.createElement(p.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>zt.current},h.createElement("span",{onClick:()=>{j(),J()}},h.createElement("i",{className:"icon-yulanpizhu"}))),!ne&&h.createElement(p.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>zt.current},h.createElement("span",{onClick:we},h.createElement("i",{className:"icon-quxiaozhiding"}))),se&&h.createElement(p.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>zt.current},h.createElement("span",{className:"",onClick:()=>{const K=document.getElementById("pdfiframe");window.addEventListener("message",nn,!1),setTimeout(()=>{K.contentWindow.postMessage("getData","*")},300)}},h.createElement("i",{className:"icon-baocun"}))),h.createElement(p.Z,{title:"\u5173\u95ED",getPopupContainer:()=>zt.current},h.createElement("span",{className:"",onClick:()=>{j()}},h.createElement("i",{className:"icon-guanbi1"})))),h.createElement("div",{className:`${pe[Oe]} ${Oe} ${pe.monaco} ${he==="txt"?"show":"hide"}`},he==="txt"&&h.createElement(h.Fragment,null,h.createElement($.ZP,Y({},be)))),he==="audio"&&h.createElement("audio",{src:`${(R==null?void 0:R.indexOf("http://"))>-1||(R==null?void 0:R.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${R}`,autoPlay:!0}),he==="video"&&h.createElement(h.Fragment,null,(R==null?void 0:R.indexOf("http"))>-1?h.createElement("video",{controls:!0,src:`${R}`,autoPlay:!0}):h.createElement("video",{controls:!0,src:`data:video/mp4;base64,${R}`,autoPlay:!0})),he==="office"&&Qe&&h.createElement("iframe",{src:`${At}/office.html?key=${Qe.key}&url=${btoa(Qe.url)}&callbackUrl=${_t+(Qe.callbackUrl||"")}&fileType=${Qe.fileType}&title=${Qe.title||""}&model=${T}&officeServer=${x.Z.ONLYOFFICE}&disabledDownload=${!!ne}`}),he==="html"&&h.createElement("iframe",{src:R+"&disposition=inline"}),he==="pdf"&&h.createElement("iframe",{id:"pdfiframe",src:`${At}/js/pdfview/index.html?filename=${ve||"educoder.pdf"}&url=${encodeURIComponent(R)}&disabledDownload=${!!ne}&model=${T}`}),he==="image"&&h.createElement("img",{src:`${(R==null?void 0:R.indexOf("http://"))>-1||(R==null?void 0:R.indexOf("https://"))>-1?"":"data:image/png;base64,"}${R}`}),(he==="other"||he==="download")&&h.createElement(h.Fragment,null,v?h.createElement(o.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:h.createElement(Te.ZP,{icon:h.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Re,disabled:ne},"\u4E0B\u8F7D")}):h.createElement(Te.ZP,{type:"primary",size:"middle",onClick:Re,disabled:ne},h.createElement(fe.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},76902:function(vn,Et,A){"use strict";A.d(Et,{z:function(){return q},Z:function(){return he}});var k=A(59301),pe=A(8944),Te=A(81428),fe=A(64018),$=A(15360),p=A(346),me=A(51257),ce=A(15342),o=A(1012),x=A(45677),D=A(59301),m=({html:ve})=>{const be=(0,k.useRef)(null),Oe=(0,k.useRef)(null),Q=`.markdown-body p {
margin: 0 0 16px 0 !important;
line-height: 28px;
white-space: pre-wrap;
}
ol,
ul,
li {
list-style-type: none
}
ol,
ul,
dl {
margin-bottom: 0px;
}
.markdown-body {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
color: #333;
overflow: hidden;
font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif;
word-break: break-word;
font-size: 16px;
line-height: 1.6;
white-space: normal;
word-wrap: break-word;
position: relative;
}
.markdown-body ul>li {
list-style-type: disc;
}
.markdown-body ol>li {
list-style-type: decimal;
}
.markdown-body a {
background: transparent;
}
.markdown-body a:active,
.markdown-body a:hover {
outline: 0;
}
.markdown-body strong {
font-weight: bold;
}
.markdown-body h1 {
font-size: 2em;
margin: 0.67em 0;
}
.markdown-body img {
border: 0;
}
.markdown-body hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
.markdown-body pre {
overflow: auto;
}
.markdown-body code,
.markdown-body kbd,
.markdown-body pre {
font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
font-size: 1em;
}
.markdown-body input {
color: inherit;
font: inherit;
margin: 0;
}
.markdown-body html input[disabled] {
cursor: default;
}
.markdown-body input {
line-height: normal;
}
.markdown-body input[type="checkbox"] {
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
}
.markdown-body table {
border-collapse: collapse;
border-spacing: 0;
}
.markdown-body td,
.markdown-body th {
padding: 0;
}
.markdown-body * {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body input {
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
}
.markdown-body a {
color: #4183c4;
text-decoration: none;
}
.markdown-body a:hover,
.markdown-body a:active {
text-decoration: underline;
}
.markdown-body hr {
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid #ddd;
}
.markdown-body hr:before {
display: table;
content: "";
}
.markdown-body hr:after {
display: table;
clear: both;
content: "";
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 15px;
margin-bottom: 15px;
line-height: 1.1;
}
.markdown-body h1 {
font-size: 30px;
}
.markdown-body h2 {
font-size: 21px;
}
.markdown-body h3 {
font-size: 16px;
}
.markdown-body h4 {
font-size: 14px;
}
.markdown-body h5 {
font-size: 12px;
}
.markdown-body h6 {
font-size: 11px;
}
.markdown-body blockquote {
margin: 0;
}
.markdown-body ul,
.markdown-body ol {
padding: 0;
margin-top: 0;
margin-bottom: 0;
}
ul.linenums,
ol.linenums {
padding: 16px 0 0 56px !important;
}
.markdown-body ul,
.markdown-body ol {
padding-left: 2em;
}
.markdown-body ol ol,
.markdown-body ul ol {
list-style-type: lower-roman;
}
.markdown-body ul ul ol,
.markdown-body ul ol ol,
.markdown-body ol ul ol,
.markdown-body ol ol ol {
list-style-type: lower-alpha;
}
.markdown-body dd {
margin-left: 0;
}
.markdown-body code {
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 12px;
}
.markdown-body pre {
margin-top: 0;
margin-bottom: 0;
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.markdown-body .octicon {
font: normal normal 16px octicons-anchor;
line-height: 1;
display: inline-block;
text-decoration: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.markdown-body .octicon-link:before {
content: '\f05c';
}
.markdown-body>*:first-child {
margin-top: 0 !important;
}
.markdown-body>*:last-child {
margin-bottom: 0 !important;
}
.markdown-body .anchor {
position: absolute;
top: 0;
left: 0;
display: block;
padding-right: 6px;
padding-left: 30px;
margin-left: -30px;
}
.markdown-body .anchor:focus {
outline: none;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
position: relative;
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
display: none;
color: #000;
vertical-align: middle;
}
.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
padding-left: 8px;
margin-left: -30px;
text-decoration: none;
}
.markdown-body h1:hover .anchor .octicon-link,
.markdown-body h2:hover .anchor .octicon-link,
.markdown-body h3:hover .anchor .octicon-link,
.markdown-body h4:hover .anchor .octicon-link,
.markdown-body h5:hover .anchor .octicon-link,
.markdown-body h6:hover .anchor .octicon-link {
display: inline-block;
}
.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
.markdown-body h1 .anchor {
line-height: 1;
}
.markdown-body h2 {
padding-bottom: 0.3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}
.markdown-body h2 .anchor {
line-height: 1;
}
.markdown-body h3 {
font-size: 1.5em;
line-height: 1.43;
}
.markdown-body h3 .anchor {
line-height: 1.2;
}
.markdown-body h4 {
font-size: 1.25em;
}
.markdown-body h4 .anchor {
line-height: 1.2;
}
.markdown-body h5 {
font-size: 1em;
}
.markdown-body h5 .anchor {
line-height: 1.1;
}
.markdown-body h6 {
font-size: 1em;
color: #777;
}
.markdown-body h6 .anchor {
line-height: 1.1;
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}
.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body li>p {
margin-top: 16px;
}
.markdown-body dl {
padding: 0;
}
.markdown-body dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: bold;
}
.markdown-body dl dd {
padding: 0 16px;
margin-bottom: 16px;
}
.markdown-body blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
.markdown-body blockquote> :first-child {
margin-top: 0;
}
.markdown-body blockquote> :last-child {
margin-bottom: 0;
}
.markdown-body table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
}
.markdown-body table th {
font-weight: bold;
text-align: revert;
}
.markdown-body table th,
.markdown-body table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
.markdown-body table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
.markdown-body table tr:nth-child(2n) {
background-color: #f8f8f8;
}
.markdown-body img {
max-width: 100%;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body code {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(0, 0, 0, 0.04);
border-radius: 3px;
}
.markdown-body code:has(.katex) {
background-color: transparent;
}
.markdown-body code:before,
.markdown-body code:after {
letter-spacing: -0.2em;
content: "\\00a0";
}
.markdown-body pre>code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
.markdown-body .highlight {
margin-bottom: 16px;
}
.markdown-body .highlight pre,
.markdown-body pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}
.markdown-body .highlight pre {
margin-bottom: 0;
word-break: normal;
}
.markdown-body pre {
word-wrap: normal;
}
.markdown-body pre code {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
.markdown-body pre code:before,
.markdown-body pre code:after {
content: normal;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .pl-c {
color: #969896;
}
.markdown-body .pl-c1,
.markdown-body .pl-mdh,
.markdown-body .pl-mm,
.markdown-body .pl-mp,
.markdown-body .pl-mr,
.markdown-body .pl-s1 .pl-v,
.markdown-body .pl-s3,
.markdown-body .pl-sc,
.markdown-body .pl-sv {
color: #0086b3;
}
.markdown-body .pl-e,
.markdown-body .pl-en {
color: #795da3;
}
.markdown-body .pl-s1 .pl-s2,
.markdown-body .pl-smi,
.markdown-body .pl-smp,
.markdown-body .pl-stj,
.markdown-body .pl-vo,
.markdown-body .pl-vpf {
color: #333;
}
.markdown-body .pl-ent {
color: #63a35c;
}
.markdown-body .pl-k,
.markdown-body .pl-s,
.markdown-body .pl-st {
color: #a71d5d;
}
.markdown-body .pl-pds,
.markdown-body .pl-s1,
.markdown-body .pl-s1 .pl-pse .pl-s2,
.markdown-body .pl-sr,
.markdown-body .pl-sr .pl-cce,
.markdown-body .pl-sr .pl-sra,
.markdown-body .pl-sr .pl-sre,
.markdown-body .pl-src {
color: #df5000;
}
.markdown-body .pl-mo,
.markdown-body .pl-v {
color: #1d3e81;
}
.markdown-body .pl-id {
color: #b52a1d;
}
.markdown-body .pl-ii {
background-color: #b52a1d;
color: #f8f8f8;
}
.markdown-body .pl-sr .pl-cce {
color: #63a35c;
font-weight: bold;
}
.markdown-body .pl-ml {
color: #693a17;
}
.markdown-body .pl-mh,
.markdown-body .pl-mh .pl-en,
.markdown-body .pl-ms {
color: #1d3e81;
font-weight: bold;
}
.markdown-body .pl-mq {
color: #008080;
}
.markdown-body .pl-mi {
color: #333;
font-style: italic;
}
.markdown-body .pl-mb {
color: #333;
font-weight: bold;
}
.markdown-body .pl-md,
.markdown-body .pl-mdhf {
background-color: #ffecec;
color: #bd2c00;
}
.markdown-body .pl-mdht,
.markdown-body .pl-mi1 {
background-color: #eaffea;
color: #55a532;
}
.markdown-body .pl-mdr {
color: #795da3;
font-weight: bold;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .task-list-item {
list-style-type: none;
}
.markdown-body .task-list-item+.task-list-item {
margin-top: 3px;
}
.markdown-body .task-list-item input {
float: left;
margin: 0.3em 0 0.25em -1.6em;
vertical-align: middle;
}
.markdown-body :checked+.radio-label {
z-index: 1;
position: relative;
border-color: #4183c4;
}
/*! Pretty printing styles. Used with prettify.js. */
/* SPAN elements with the classes below are added by prettyprint. */
.pln {
color: #000
}
/* plain text */
@media screen {
.str {
color: #080
}
/* string content */
.kwd {
color: #008
}
/* a keyword */
.com {
color: #800
}
/* a comment */
.typ {
color: #606
}
/* a type name */
.lit {
color: #066
}
/* a literal value */
/* punctuation, lisp open bracket, lisp close bracket */
.pun,
.opn,
.clo {
color: #660
}
.tag {
color: #008
}
/* a markup tag name */
.atn {
color: #606
}
/* a markup attribute name */
.atv {
color: #080
}
/* a markup attribute value */
.dec,
.var {
color: #606
}
/* a declaration; a variable name */
.fun {
color: red
}
/* a function name */
}
/* Use higher contrast and text-weight for printable form. */
@media print,
projection {
.str {
color: #060
}
.kwd {
color: #006;
font-weight: bold
}
.com {
color: #600;
font-style: italic
}
.typ {
color: #404;
font-weight: bold
}
.lit {
color: #044
}
.pun,
.opn,
.clo {
color: #440
}
.tag {
color: #006;
font-weight: bold
}
.atn {
color: #404
}
.atv {
color: #060
}
}
/* Put a border around prettyprinted code snippets. */
pre.prettyprint {
padding: 2px;
/* border: 1px solid #888 */
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0
}
/* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L5,
li.L6,
li.L7,
li.L8 {
list-style-type: none
}
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 {
background: #eee
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}`;return(0,k.useEffect)(()=>{const P=be.current.attachShadow({mode:"open"});Oe.current=document.createElement("div"),Oe.current.className="markdown-body",Oe.current.innerHTML=ve,P.appendChild(Oe.current);const j=document.createElement("style");return j.textContent=Q,P.appendChild(j),()=>{P.innerHTML=""}},[]),(0,k.useEffect)(()=>{Oe.current&&(Oe.current.innerHTML=ve)},[ve]),D.createElement("div",{ref:be})};function y(ve){const be=["onabort","onanimationend","onanimationiteration","onanimationstart","onauxclick","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncopy","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onvolumechange","onwaiting","onwheel"],Oe=new RegExp(`\\b(${be.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return ve.replace(Oe,"").trim()}var S=Object.defineProperty,M=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,L=(ve,be,Oe)=>be in ve?S(ve,be,{enumerable:!0,configurable:!0,writable:!0,value:Oe}):ve[be]=Oe,O=(ve,be)=>{for(var Oe in be||(be={}))z.call(be,Oe)&&L(ve,Oe,be[Oe]);if(M)for(var Oe of M(be))Y.call(be,Oe)&&L(ve,Oe,be[Oe]);return ve};const T="@\u2581\u2581@",R="@\u2581@",se=/<pre[^>]*>/g;function ae(ve){let be=document.createElement("div");return be.innerHTML=ve,be.childNodes.length===0?"":be.childNodes[0].nodeValue}const q=(ve,be)=>{ve=ve||"";const Oe=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Q=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,P=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,j=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return be?ve.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(Oe,(X,ne,J,v,g,U,ie)=>{const Be=ne||v||U,Ze=J||g||ie||"?";return p.Z.API_SERVER+"/api/attachments/"+Be+Ze+"&t="+(0,me.Jn)(Be,Date.now())+(X.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(ve=ve.replace(j,(X,ne,J,v,g,U,ie)=>{const Be=ne||v||U,Ze=J||g||ie||"?";return p.Z.API_SERVER+"/attachments/download/"+Be+Ze+"&t="+(0,me.Jn)(Be,Date.now())+(X.indexOf(")")>-1?")":"&")}).replace(Oe,(X,ne,J,v,g,U,ie)=>{const Be=ne||v||U,Ze=J||g||ie||"?";return p.Z.API_SERVER+"/api/attachments/"+Be+Ze+"&t="+(0,me.Jn)(Be,Date.now())+(X.indexOf(")")>-1?")":"&")}).replace(Q,(X,ne,J,v,g)=>{const U=ne||v,ie=J||g||"";return'"'+p.Z.API_SERVER+"/api/attachments/"+U+ie+U+ie+"&t="+(0,me.Jn)(U,Date.now())}).replace(P,(X,ne,J,v,g)=>{const U=ne||v,ie=J||g||"";return"("+p.Z.API_SERVER+"/files/uploads/"+U+ie+U+ie+"&t="+(0,me.Jn)(U,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,`
`),ve)};var he=({value:ve="",className:be,showTextOnly:Oe,showLines:Q,style:P={},stylesPrev:j={},highlightKeywords:X,showProgramFill:ne,isProgramFill:J,disabledFill:v=!1,programFillValue:g,onFillChange:U=Ze=>{},onFillBlur:ie=()=>{},onFillFocus:Be=()=>{}})=>{let Ze=y(String(ve||""));const[Qe,nt]=(0,k.useState)(""),[At,_t]=(0,k.useState)("office"),[xe,vt]=(0,k.useState)([]),zt=(0,k.useRef)("a"+(0,o.Z)()),Ct={},nn=C=>/<style[\s\S]*?>/i.test(C||""),qe=(C,B,W)=>{const Z=document.createElement(C===R?"input":"textarea");Z.style.width="100%",Z.style.height=C===R?"40px":"151px",Z.rows=5,Z.spellcheck=!1,Z.name="edu-program-fill",Z.placeholder="\u8BF7\u8F93\u5165",Z.dataset.id=B;const te=Object.keys(Ct).length;return Ct[te]=Z,`<span class="edu-program-fill-wrap ${C===R?"":"show"}" style="width:${C===R?"400px":"100%"}" title=${W||""}><span>${Z.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Re(C){return C=C.replace(/!\[.*?\]\(.*?\)/g,""),C=C.replace(/\[.*?\]\(.*?\)/g,""),C=C.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),C=C.replace(/<embed.*?>/g,""),C=C.replace(/<img.*?>/g,""),C=C.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),C=C.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),C=C.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),C=C.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),C}const we=C=>!Oe&&nn(Ze)?C:C.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(B,W){let Z=W.replace(/(\n|\r)/g,"").split("}"),te=[];return Z.map(ue=>{ue!=""&&te.push(`.${zt.current} ${ue}`)}),`<style>${te.join("}")}</style>`}),K=(0,k.useMemo)(()=>{try{const Z=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,te=/\"\/api\/attachments\/|\"\/attachments\/download\//g,ue=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,ge=/\(\/attachments\/download\//g;Ze=Ze.replace(ge,"("+p.Z.API_SERVER+"/attachments/download/").replace(Z,"("+p.Z.API_SERVER+"/api/attachments/").replace(te,'"'+p.Z.API_SERVER+"/api/attachments/").replace(ue,'"'+p.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(Z){}if(ne){let Z=-1;return Ze=Ze.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,function(te,ue,ge){var Ce;return++Z,qe(te,Z,(Ce=g==null?void 0:g[Z])==null?void 0:Ce.value.replaceAll("<","&lt;").replaceAll(">","&gt;"))}),`<pre style="background:#fff;padding:4px">${we(Ze||"")}</pre>`}let C=we(Ze);C=(0,Te.ZP)(C);const B=(0,Te.ez)();Ze.match(/\[TOC\]/)&&(C=C.replace("<p>[TOC]</p>",(0,Te.Qv)()),(0,Te.Iy)()),C=C.replace(/(__special_katext_id_\d+__)/g,(Z,te)=>{const{type:ue,expression:ge}=B[te];return(0,ce.renderToString)(ae(ge)||"",{displayMode:ue==="block",throwOnError:!1,output:"html"})}),C=C.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,Te.AL)();const W=document.createElement("div");if(W.innerHTML=C,Oe)return W.innerText;if(X){const Z=X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return I(W,Z),W.innerHTML}return setTimeout(()=>w(),500),W.innerHTML},[Ze,X]);(0,k.useEffect)(()=>{F.current&&F.current.querySelectorAll(["input","textarea"]).forEach(B=>{B.oninput=Se,B.onblur=Ne,B.onfocus=V})},[xe]),(0,k.useEffect)(()=>{var C,B,W,Z,te;if(g!=null&&g.length)try{const ue=F.current.querySelectorAll(".edu-program-fill-score"),ge=F.current.querySelectorAll('[name="edu-program-fill"]');for(const[Ce,De]of ge.entries())De.value=((C=g==null?void 0:g[Ce])==null?void 0:C.value)||"",((B=g==null?void 0:g[Ce])==null?void 0:B.type)==="warning"?De.className="program-fill-warning":((W=g==null?void 0:g[Ce])==null?void 0:W.type)==="success"?De.className="program-fill-success":De.className="";for(const[Ce,De]of ue.entries())De.innerHTML=(Z=g==null?void 0:g[Ce])!=null&&Z.score?`${(te=g==null?void 0:g[Ce])==null?void 0:te.score}\u5206`:"";vt(g)}catch(ue){console.log(ue,"error")}},[g]);const Se=C=>{xe[C.target.dataset.id]=xe[C.target.dataset.id]||{},xe[C.target.dataset.id].value=C.target.value,vt([...xe]),U(xe,C.target.dataset.id)},Ne=C=>{xe[C.target.dataset.id]=xe[C.target.dataset.id]||{},xe[C.target.dataset.id].value=C.target.value,vt([...xe]),ie(xe,C.target.dataset.id)},V=C=>{xe[C.target.dataset.id]=xe[C.target.dataset.id]||{},xe[C.target.dataset.id].value=C.target.value,vt([...xe]),Be(xe,C.target.dataset.id)};function I(C,B){return C.childNodes.forEach(W=>{var Z;if(W.childNodes.length>0)I(W,B);else if(W.nodeName!=="IMG")if(W.innerHTML)W.innerHTML=(Z=W.innerHTML)==null?void 0:Z.replace(new RegExp(B,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const te=document.createElement("span");te.innerHTML=W.textContent.replace(new RegExp(B,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),W.replaceWith(te)}})}const F=(0,k.useRef)();Te.jb.WebkitLineClamp=Q,Q&&(P=O(O({},P),Te.jb));function oe(C){let B=C.target;if(B.tagName.toUpperCase()==="A"){let W=B.getAttribute("href");if(W.indexOf("office")>-1)C.preventDefault(),nt(W),_t("office");else if(W.indexOf("application/pdf")>-1)C.preventDefault(),nt(W),_t("pdf");else if(W.indexOf("text/html")>-1)C.preventDefault(),nt(W),_t("html");else if(W.startsWith("#")){C.preventDefault();let Z=document.getElementById(W.replace("#",""));Z&&Z.scrollIntoView(!0)}}}const w=()=>{var C;const B=(C=F.current)==null?void 0:C.querySelectorAll("video");B==null||B.forEach(W=>{if(W.oncontextmenu=()=>!1,W.src.indexOf(".m3u8")>-1&&!W.canPlayType("application/vnd.apple.mpegurl")){if($.ZP.isSupported()){var Z=new $.ZP;Z.loadSource(W.src),Z.attachMedia(W)}}})};return(0,k.useEffect)(()=>{if(F.current&&K&&K.match(se)&&window.PR.prettyPrint(),F.current)return F.current.addEventListener("click",oe),()=>{var C;(C=F.current)==null||C.removeEventListener("click",oe),(0,Te.AL)(),(0,Te.Iy)()}},[K,F.current,oe]),(0,k.useEffect)(()=>{var C;const B=W=>{W.preventDefault(),W.clipboardData.setData("text",window.getSelection().toString())};return(C=F.current)==null||C.addEventListener("copy",B),()=>{var W;(W=F.current)==null||W.removeEventListener("copy",B)}},[F.current]),k.createElement(k.Fragment,null,Oe&&k.createElement("div",{ref:F},K),!Oe&&!nn(K)&&k.createElement("div",{ref:F,style:O({},P),className:`${be||""} ${v?"disabled-fill":""} markdown-body ${zt.current}`,dangerouslySetInnerHTML:{__html:K}}),!Oe&&nn(K)&&k.createElement(m,{html:K}),k.createElement(x.Z,{close:!0,data:Qe,type:Qe!=null&&Qe.length?At:"",style:O({},j),onClose:()=>nt("")}))}},75975:function(vn,Et,A){"use strict";A.d(Et,{SV:function(){return I},ZP:function(){return V}});var k=A(59301),pe=A(76374);const Te={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"]},fe={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"]},$={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},p={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},me={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 ce=A(53184),o=A.n(ce),x=Object.defineProperty,D=Object.defineProperties,h=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,M=(F,oe,w)=>oe in F?x(F,oe,{enumerable:!0,configurable:!0,writable:!0,value:w}):F[oe]=w,z=(F,oe)=>{for(var w in oe||(oe={}))y.call(oe,w)&&M(F,w,oe[w]);if(m)for(var w of m(oe))S.call(oe,w)&&M(F,w,oe[w]);return F},Y=(F,oe)=>D(F,h(oe)),L=(F,oe,w)=>new Promise((C,B)=>{var W=ue=>{try{te(w.next(ue))}catch(ge){B(ge)}},Z=ue=>{try{te(w.throw(ue))}catch(ge){B(ge)}},te=ue=>ue.done?C(ue.value):Promise.resolve(ue.value).then(W,Z);te((w=w.apply(F,oe)).next())});const O={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"]}},T=(F,oe)=>oe.map(w=>({label:w,kind:F.languages.CompletionItemKind.Keyword,insertText:w})),R=F=>Object.keys(O.tables).map(oe=>({label:oe,kind:F.languages.CompletionItemKind.Variable,insertText:oe})),se=(F,oe)=>{const w=O.tables[F];return w?w.map(C=>({label:C,kind:oe.languages.CompletionItemKind.Field,insertText:C})):[]};function ae(F,oe,w,C,B){let W=oe.getWordUntilPosition(w),Z={startLineNumber:w.lineNumber,endLineNumber:w.lineNumber,startColumn:W.startColumn,endColumn:W.endColumn},te=C.map(ue=>({label:ue,kind:F.languages.CompletionItemKind.Keyword,insertText:ue,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}));return B.map(ue=>{te.push(Y(z({},ue),{range:Z}))}),te}var q=F=>{O.languages.map(B=>(F.languages.registerDocumentFormattingEditProvider(B,{provideDocumentFormattingEdits(W,Z,te){return L(this,null,function*(){const ue=o()(W.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:W.getFullModelRange(),text:ue}]})}}),B));const oe=$.quickKey.map(B=>({label:B.label,kind:F.languages.CompletionItemKind.Method,insertText:B.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet})),w=p.quickKey.map(B=>({label:B.label,kind:F.languages.CompletionItemKind.Method,insertText:B.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet})),C=fe.quickKey.map(B=>({label:B.label,kind:F.languages.CompletionItemKind.Method,insertText:B.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet}));F.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(B,W){var Z=B.getWordUntilPosition(W),te={startLineNumber:W.lineNumber,endLineNumber:W.lineNumber,startColumn:Z.startColumn,endColumn:Z.endColumn},ue=B.getLineContent(W.lineNumber).substring(Z.startColumn-2,Z.endColumn);return{suggestions:[...$.keywords.map(ge=>({label:ge,kind:F.languages.CompletionItemKind.Function,documentation:ge,insertText:ge,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te})),...$.quickKey.map(ge=>({label:ge.label,kind:F.languages.CompletionItemKind.Function,documentation:ge.content,insertText:ue.startsWith("#")?ge.content.replace(/#/,""):ge.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te}))]}}}),F.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(B,W){var Z=B.getWordUntilPosition(W),te={startLineNumber:W.lineNumber,endLineNumber:W.lineNumber,startColumn:Z.startColumn,endColumn:Z.endColumn};return{suggestions:[...Te.keywords.map(ue=>({label:ue,kind:F.languages.CompletionItemKind.Function,documentation:ue,insertText:ue,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te}))]}}}),F.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(B,W){var Z=B.getWordUntilPosition(W),te={startLineNumber:W.lineNumber,endLineNumber:W.lineNumber,startColumn:Z.startColumn,endColumn:Z.endColumn},ue=B.getLineContent(W.lineNumber).substring(Z.startColumn-2,Z.endColumn);return{suggestions:[...fe.keywords.map(ge=>({label:ge,kind:F.languages.CompletionItemKind.Function,documentation:ge,insertText:ge,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te})),...fe.quickKey.map(ge=>({label:ge.label,kind:F.languages.CompletionItemKind.Function,documentation:ge.content,insertText:ue.startsWith("#")?ge.content.replace(/#/,""):ge.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te}))]}}}),F.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(B,W){var Z=B.getWordUntilPosition(W),te={startLineNumber:W.lineNumber,endLineNumber:W.lineNumber,startColumn:Z.startColumn,endColumn:Z.endColumn},ue=B.getLineContent(W.lineNumber).substring(Z.startColumn-2,Z.endColumn);return{suggestions:[...me.keywords.map(ge=>({label:ge,kind:F.languages.CompletionItemKind.Function,documentation:ge,insertText:ge,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te})),...me.quickKey.map(ge=>({label:ge.label,kind:F.languages.CompletionItemKind.Function,documentation:ge.content,insertText:ue.startsWith("#")?ge.content.replace(/#/,""):ge.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te}))]}}}),F.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(B,W){var Z=B.getWordUntilPosition(W),te={startLineNumber:W.lineNumber,endLineNumber:W.lineNumber,startColumn:Z.startColumn,endColumn:Z.endColumn},ue=B.getLineContent(W.lineNumber).substring(Z.startColumn-2,Z.endColumn);return{suggestions:[...p.keywords.map(ge=>({label:ge,kind:F.languages.CompletionItemKind.Function,documentation:ge,insertText:ge,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te})),...p.quickKey.map(ge=>({label:ge.label,kind:F.languages.CompletionItemKind.Function,documentation:ge.content,insertText:ue.startsWith("#")?ge.content.replace(/#/,""):ge.content,insertTextRules:F.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:te}))]}}})};const he="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var ve=Object.defineProperty,be=(F,oe,w)=>oe in F?ve(F,oe,{enumerable:!0,configurable:!0,writable:!0,value:w}):F[oe]=w,Oe=(F,oe,w)=>be(F,typeof oe!="symbol"?oe+"":oe,w);const Q=class Qo{constructor(oe,w,C){this.placeholder=oe,this.editor=w,this.monaco=C,w.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Qo.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};Oe(Q,"ID","editor.widget.placeholderHint");var j=Q,X=A(96236),ne=A(6767),J=A(25399),v=A(89392),g=A(49535),U=A(56102),ie=Object.defineProperty,Be=Object.defineProperties,Ze=Object.getOwnPropertyDescriptors,Qe=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,_t=(F,oe,w)=>oe in F?ie(F,oe,{enumerable:!0,configurable:!0,writable:!0,value:w}):F[oe]=w,xe=(F,oe)=>{for(var w in oe||(oe={}))nt.call(oe,w)&&_t(F,w,oe[w]);if(Qe)for(var w of Qe(oe))At.call(oe,w)&&_t(F,w,oe[w]);return F},vt=(F,oe)=>Be(F,Ze(oe)),zt=(F,oe)=>{var w={};for(var C in F)nt.call(F,C)&&oe.indexOf(C)<0&&(w[C]=F[C]);if(F!=null&&Qe)for(var C of Qe(F))oe.indexOf(C)<0&&At.call(F,C)&&(w[C]=F[C]);return w},Ct=(F,oe,w)=>new Promise((C,B)=>{var W=ue=>{try{te(w.next(ue))}catch(ge){B(ge)}},Z=ue=>{try{te(w.throw(ue))}catch(ge){B(ge)}},te=ue=>ue.done?C(ue.value):Promise.resolve(ue.value).then(W,Z);te((w=w.apply(F,oe)).next())});function nn(F){return/^\d+$/.test(F)?`${F}px`:F}function qe(){}let Re=!1;const we={"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 K(F=[]){let oe=F;if(Array.isArray(F)){for(let w=0;w<F.length;w++){let C=we[F[w]];if(C)return C}return oe[0]}return we[oe]||oe}let Se=null;const Ne=()=>Ct(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(F){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",F)}});var V=F=>{var oe=F,{width:w="100%",height:C="100%",value:B,language:W="javascript",style:Z={},options:te={},overrideServices:ue={},theme:ge="vs-dark",onEditBlur:Ce,isCopy:De=!1,onSave:Fe,autoHeight:Ve=!1,forbidCopy:Ge=!1,onChange:$e=qe,editorDidMount:mt=qe,onFocus:xt=qe,onBreakPoint:St=qe,breakPointValue:Lt=[],filename:Ht="educoder.txt",errorLine:ut,errorContent:Ut="",highlightLine:Le,openBreakPoint:Ae=!1,placeholder:Ie="",showMiniMap:H=!0}=oe,ee=zt(oe,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const de=(0,k.useRef)(),re=(0,k.useRef)({}),_e=(0,k.useRef)(),et=(0,k.useRef)(),Ye=(0,k.useRef)([]),it=(0,k.useRef)(!1),Rt=(0,k.useRef)(),on=(0,k.useRef)(),fn=(0,k.useRef)(!1),[Pt,jt]=(0,k.useState)(!1);function wn(){let ze;return de.current&&(ze=new pe.Z(tt=>{for(let ot of tt)(ot.target.offsetHeight>0||ot.target.offsetWidth>0)&&re.current.instance.layout()}),ze.observe(de.current)),ze}function Gn(){ne.ZP.warning({content:decodeURIComponent(he),key:"monaco-editor-tip"})}const An=()=>{let ze=re.current.instance;if(B!=null&&ze&&Pt){const tt=ze.getModel();tt&&B!==tt.getValue()&&(Re=!0,tt.setValue(B),ze.layout(),Re=!1)}};(0,k.useEffect)(()=>{const ze=g.Z.subscribe("formatDocument",tt=>{var ot;let It=re.current.instance;(ot=It==null?void 0:It.getAction)==null||ot.call(It,"editor.action.formatDocument").run()});return window.updateMonacoValue=tt=>{$e(tt)},ze},[]),(0,k.useEffect)(()=>{var ze;let tt=re.current.instance;et.current&&clearTimeout(et.current),et.current=setTimeout(()=>{An()},500),B&&(B!=null&&B.length)&&((ze=tt==null?void 0:tt.updateOptions)==null||ze.call(tt,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(B.split(/\r\n|\r|\n/g).length))+3,5)}))},[B,Pt,re.current]),(0,k.useEffect)(()=>{if(ut&&re.current&&re.current.instance){let tt=re.current.instance;tt.changeViewZones(function(ot){var It=document.createElement("div");It.style.padding="10px 20px",It.style.width="calc(100% - 20px)",It.className="my-error-line-wrp",It.innerHTML=Ut,ot.addZone({afterLineNumber:ut||11,heightInLines:3,domNode:It})});var ze={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}};tt.addOverlayWidget(ze),tt.revealPositionInCenter({lineNumber:20,column:1})}},[ut,re.current,Pt]);const Mn=(ze="",tt)=>{if(!ze||ze.trim()==="")return!0;const It=re.current.instance.getModel().getLineTokens(tt);let Ft=!1;for(let Xt=0;Xt<2;Xt++)It.getStandardTokenType(Xt)===1&&(Ft=!0);return Ft};(0,k.useEffect)(()=>{var ze;const tt=(ze=re.current)==null?void 0:ze.instance;if(tt&&Pt&&Ge){const ot=tt.onDidBlurEditorWidget(()=>{fn.current=!1}),It=tt.onDidFocusEditorText(()=>{fn.current=!0});return()=>{ot.dispose(),It.dispose()}}},[re.current,Pt,Ge]),(0,k.useEffect)(()=>{var ze;if((ze=re.current)!=null&&ze.instance&&Pt&&Ae){let tt=re.current.instance,ot=tt.getModel();if(!ot)return;(()=>{var lt;let wt=[],Ot=[];const $t=ot.getAllDecorations();for(let kt of $t)kt.options.className==="highlighted-line"&&(wt.push((lt=kt==null?void 0:kt.range)==null?void 0:lt.startLineNumber),Ot.push(kt==null?void 0:kt.id));if(Le===wt[0])return;ot.deltaDecorations(Ot,[]);const pn=ot.getLineCount();Le&&Le<=pn&&(tt.deltaDecorations([],[{range:new Se.Range(Le,1,Le,ot.getLineMaxColumn(Le)),options:{isWholeLine:!0,className:"highlighted-line"}}]),tt.revealLineInCenter(Le))})();const Ft=(lt=!1)=>{var wt;let Ot=[],$t=[];const pn=ot.getAllDecorations();for(let kt of pn)kt.options.linesDecorationsClassName==="breakpoints-select"&&(Ot.push((wt=kt==null?void 0:kt.range)==null?void 0:wt.startLineNumber),$t.push(kt==null?void 0:kt.id));if(lt)return{lines:Ot,ids:$t};St(Ot)},Xt=lt=>Ct(void 0,null,function*(){let wt={range:new Se.Range(lt,1,lt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield ot.deltaDecorations([],[wt]),Ft()}),Bt=lt=>Ct(void 0,null,function*(){let wt=[];const Ot=tt.getLineDecorations(lt);for(let $t of Ot)$t.options.linesDecorationsClassName==="breakpoints-select"&&wt.push($t.id);yield ot.deltaDecorations(wt,[]),Ft()}),yt=lt=>{let wt=tt.getLineDecorations(lt);for(let Ot of wt)if(Ot.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,v.isEqual)(Lt,Ft(!0).lines)){ot.deltaDecorations(Ft(!0).ids,[]);const lt=Lt.map(wt=>({range:new Se.Range(wt,1,wt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));ot.deltaDecorations([],lt)}const ye=tt.onDidChangeModelContent(lt=>{let wt=tt.getPosition();if(wt){let Ot=wt.lineNumber;clearTimeout(on.current),on.current=setTimeout(()=>{Mn(ot.getLineContent(Ot),Ot)?Bt(Ot):yt(Ot)?(Bt(Ot),Xt(Ot)):Ft()},100)}}),Ue=tt.onMouseDown(lt=>{var wt,Ot,$t;if(lt.target.detail&&(($t=(Ot=(wt=lt.target)==null?void 0:wt.element)==null?void 0:Ot.className)!=null&&$t.includes("line-numbers"))){let pn=lt.target.position.lineNumber;if(Mn(ot.getLineContent(pn),pn))return;yt(pn)?Bt(pn):Xt(pn)}}),He=lt=>{let wt={range:new Se.Range(lt,1,lt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Ye.current=tt.deltaDecorations(Ye.current,[wt])},je=()=>{Ye.current=tt.deltaDecorations(Ye.current,[])},at=tt.onMouseMove(lt=>{var wt,Ot,$t;if(je(),lt.target.detail&&(($t=(Ot=(wt=lt.target)==null?void 0:wt.element)==null?void 0:Ot.className)!=null&&$t.includes("line-numbers"))){let pn=lt.target.position.lineNumber;if(Mn(ot.getLineContent(pn),pn))return;He(pn)}}),ct=tt.onMouseLeave(()=>{je()});return()=>{ye.dispose(),Ue.dispose(),at.dispose(),ct.dispose()}}},[re.current,Pt,Lt,Le,Ae,W]),(0,k.useEffect)(()=>{var ze;(ze=re.current)!=null&&ze.instance&&Ae&&re.current.instance.setPosition({lineNumber:0,column:0})},[Le]);function Cn(){let ze=re.current.instance;if(ze){const tt=ze.getSelection(),ot=re.current.pastePos||{},It=new Se.Range(ot.startLineNumber||tt.endLineNumber,ot.startColumn||tt.endColumn,ot.endLineNumber||tt.endLineNumber,ot.endColumn||tt.endColumn);setTimeout(()=>{ze.executeEdits("",[{range:It,text:""}])},300)}}function rn(ze){(window.navigator.platform.match("Mac")?ze.metaKey:ze.ctrlKey)&&ze.keyCode==83&&(ze.preventDefault(),Fe())}const Tn=()=>{if(Ve&&re.current.instance){const ze=re.current.instance.getContentHeight();dt(ze<C?C:ze)}else dt(C)};function $n(ze){var tt=document.createEvent("MouseEvents");tt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),ze.dispatchEvent(tt)}const tr=ze=>{if(!fn.current)return;const{keyCode:tt,ctrlKey:ot,metaKey:It,target:Ft,type:Xt}=ze;return(Xt==="paste"||(tt===67||tt===86)&&(It||ot))&&Ft.nodeName==="TEXTAREA"&&(Gn(),ze.preventDefault()),!1};function Me(ze,tt){var ot=window.URL||window.webkitURL||window,It=new Blob([tt]),Ft=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ft.href=ot.createObjectURL(It),Ft.download=ze,$n(Ft)}(0,k.useEffect)(()=>{Tn()},[Tn]),(0,k.useEffect)(()=>{de.current&&!Pt&&Promise.all([A.e(8909),A.e(6656)]).then(A.bind(A,71448)).then(ze=>{try{Se=ze,re.current.instance=Se.editor.create(de.current,{value:B,language:K(W),theme:ge,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:H||!1}},ue);const tt=re.current.instance;let Ft=[...X.BH._menuItems].find(ye=>ye[0]._debugName=="EditorContext")[1],Xt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Bt=(ye,Ue)=>{var He,je;let at=ye._first;do Ue.includes((je=(He=at.element)==null?void 0:He.command)==null?void 0:je.id)&&ye._remove(at);while(at=at.next)};if(mt(tt,Se),setTimeout(()=>{Tn(),re.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Me(Ht||"educoder.txt",tt.getValue())}})},500),re.current.subscription=tt.onDidChangeModelContent(ye=>{it.current?clearTimeout(Rt.current):(Tn(),$e(tt.getValue(),ye)),Rt.current=setTimeout(()=>{it.current=!1},500)}),window.Monaco||q(Se,K(W)),Ge&&(Bt(Ft,Xt),de.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",tr),window.removeEventListener("paste",tr),window.addEventListener("keydown",tr),window.addEventListener("paste",tr)),window.Monaco=Se,Ce&&tt.onDidBlurEditorWidget(()=>{Ce(tt.getValue())}),xt&&tt.onDidFocusEditorText(()=>{Ge&&Ne(),xt(tt.getValue())}),Ge){Ne();try{tt.onDidPaste(ye=>{const Ue=tt.getSelection(),He=re.current.pastePos||{},je=new Se.Range(He.startLineNumber||Ue.endLineNumber,He.startColumn||Ue.endColumn,He.endLineNumber||Ue.endLineNumber,He.endColumn||Ue.endColumn);tt.executeEdits("",[{range:ye.range,text:""}])})}catch(ye){}}let yt=wn();return Ie&&typeof Ie=="string"&&new j(Ie,tt,Se),jt(!0),()=>{const ye=re.current.instance;ye.dispose();const Ue=ye.getModel();Ue&&Ue.dispose(),re.current.subscription&&re.current.subscription.dispose(),yt.unobserve(de.current)}}catch(tt){}})},[]),(0,k.useEffect)(()=>{if(re.current.instance&&Pt)return document.addEventListener("keydown",rn,!1),()=>{document.removeEventListener("keydown",rn)}},[Fe,Pt]),(0,k.useEffect)(()=>{let ze=re.current.instance;if(ze&&Pt){let tt=K(W);Se.editor.setModelLanguage(ze.getModel(),tt)}},[W,Pt]),(0,k.useEffect)(()=>{re.current.instance&&Pt&&Se.editor.setTheme(ge)},[ge,Pt]),(0,k.useEffect)(()=>{let ze=re.current.instance;_e.current=te,ze&&Pt&&(ze.updateOptions(xe({},te)),setTimeout(()=>{ze.getModel().updateOptions(xe({},te))},200))},[JSON.stringify(te),Pt]),(0,k.useEffect)(()=>{let ze=re.current.instance;ze&&Pt&&ze.layout()},[w,C,Pt]);const[Pe,Tt]=(0,k.useState)(nn(w)),[pt,dt]=(0,k.useState)(nn(C)),Zt=vt(xe({},Z),{width:Pe,height:pt,position:"relative"});return k.createElement("div",{className:"my-monaco-editor",ref:de,style:Zt},De&&k.createElement(U.CopyToClipboard,{text:B,onCopy:()=>ne.ZP.success("\u590D\u5236\u6210\u529F")},k.createElement(J.Z,{title:"\u590D\u5236\u4EE3\u7801"},k.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},k.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function I({width:F="100%",height:oe="100%",original:w,modified:C,language:B,options:W={}}){const Z=(0,k.useRef)(),[te,ue]=(0,k.useState)(null);function ge(Ve){let Ge;return Z.current&&(Ge=new pe.Z($e=>{for(let mt of $e)(mt.target.offsetHeight>0||mt.target.offsetWidth>0)&&Ve.layout()}),Ge.observe(Z.current)),Ge}(0,k.useEffect)(()=>(Z.current&&Promise.all([A.e(8909),A.e(9404)]).then(A.bind(A,2550)).then(Ve=>{Se=Ve;const Ge=Se.editor.createDiffEditor(Z.current,vt(xe({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},W),{wordWrap:!0}));ue(Ge);let $e=ge(Ge);return()=>{Ge.dispose();const mt=Ge.getModel();mt&&mt.dispose(),$e.unobserve(Z.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,k.useEffect)(()=>{te&&te.setModel({original:Se.editor.createModel(w,B),modified:Se.editor.createModel(C,B)})},[w,C,B,te]);const Ce=nn(F),De=nn(oe),Fe={width:Ce,height:De};return k.createElement("div",{className:"my-diff-editor",ref:Z,style:Fe})}},54204:function(vn,Et,A){"use strict";A.r(Et),A.d(Et,{default:function(){return B}});var k=A(59301),pe=A(25690),Te=A(91882),fe=A(77019),$=A(5269),p=A(25399),me=A(76902),ce=A(48790),o={flex_box_center:"flex_box_center___iOjMJ",flex_space_between:"flex_space_between___aidWN",flex_box_vertical_center:"flex_box_vertical_center___z01Y6",flex_box_center_end:"flex_box_center_end___bizdK",flex_box_column:"flex_box_column___T3eUo",info:"info___PTCcN",bar:"bar___F2ZHD"},x=A(37568),D=A(18287),h=A(28284),m=A(62957),y=A(6767),S=A(37639),M=A(69219),z=A(38986),Y=Object.defineProperty,L=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,R=(W,Z,te)=>Z in W?Y(W,Z,{enumerable:!0,configurable:!0,writable:!0,value:te}):W[Z]=te,se=(W,Z)=>{for(var te in Z||(Z={}))O.call(Z,te)&&R(W,te,Z[te]);if(L)for(var te of L(Z))T.call(Z,te)&&R(W,te,Z[te]);return W},ae=(W,Z,te)=>new Promise((ue,ge)=>{var Ce=Ve=>{try{Fe(te.next(Ve))}catch(Ge){ge(Ge)}},De=Ve=>{try{Fe(te.throw(Ve))}catch(Ge){ge(Ge)}},Fe=Ve=>Ve.done?ue(Ve.value):Promise.resolve(Ve.value).then(Ce,De);Fe((te=te.apply(W,Z)).next())});const{TreeNode:q}=M.default,he=({restful:W,loading:Z,dispatch:te})=>{const ue=(0,pe.useParams)(),ge=(0,pe.useLocation)(),[Ce,De]=(0,k.useState)(!1),[Fe,Ve]=(0,k.useState)(),{actionTabs:Ge}=W,[$e]=h.default.useForm();return(0,k.useEffect)(()=>{W.actionTabs.key=="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"&&$e.resetFields()},[W.actionTabs.key]),W.actionTabs.key!=="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"?null:k.createElement(m.default,{centered:!0,title:"\u65B0\u5EFA\u76EE\u5F55",open:W.actionTabs.key==="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{minHeight:150},confirmLoading:Ce,onOk:()=>ae(void 0,null,function*(){yield $e.validateFields();const mt=$e.getFieldValue();De(!0),(yield(0,z.ZP)("/api/restfuls.json",{method:"post",body:se({file_type:1},mt)})).status===0&&(y.ZP.success("\u6DFB\u52A0\u6210\u529F"),te({type:"restful/setActionTabs",payload:{}}),te({type:"restful/getRestful"})),De(!1)}),onCancel:()=>{te({type:"restful/setActionTabs",payload:{}})}},k.createElement("div",{className:"pl30 pr30"},k.createElement(h.default,{form:$e,initialValues:{name:""}},k.createElement(h.default.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0"}]},k.createElement(fe.Z,{className:"mt30"},k.createElement($.Z,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),k.createElement($.Z,{flex:"1"},k.createElement(x.default,{placeholder:`\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26
`,maxLength:60})))))))};var ve=(0,pe.connect)(({restful:W,loading:Z})=>({restful:W,loading:Z}))(he),be=Object.defineProperty,Oe=Object.getOwnPropertySymbols,Q=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,j=(W,Z,te)=>Z in W?be(W,Z,{enumerable:!0,configurable:!0,writable:!0,value:te}):W[Z]=te,X=(W,Z)=>{for(var te in Z||(Z={}))Q.call(Z,te)&&j(W,te,Z[te]);if(Oe)for(var te of Oe(Z))P.call(Z,te)&&j(W,te,Z[te]);return W},ne=(W,Z,te)=>new Promise((ue,ge)=>{var Ce=Ve=>{try{Fe(te.next(Ve))}catch(Ge){ge(Ge)}},De=Ve=>{try{Fe(te.throw(Ve))}catch(Ge){ge(Ge)}},Fe=Ve=>Ve.done?ue(Ve.value):Promise.resolve(Ve.value).then(Ce,De);Fe((te=te.apply(W,Z)).next())});const{TreeNode:J}=M.default,v=({restful:W,loading:Z,dispatch:te})=>{const ue=(0,pe.useParams)(),ge=(0,pe.useLocation)(),[Ce,De]=(0,k.useState)(!1),[Fe,Ve]=(0,k.useState)(),{actionTabs:Ge}=W,[$e]=h.default.useForm();return(0,k.useEffect)(()=>{W.actionTabs.key=="\u91CD\u547D\u540D"&&($e.resetFields(),$e.setFieldsValue({name:W.actionTabs.data.title}))},[W.actionTabs.key]),W.actionTabs.key!=="\u91CD\u547D\u540D"?null:k.createElement(m.default,{centered:!0,title:"\u91CD\u547D\u540D",open:W.actionTabs.key==="\u91CD\u547D\u540D",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{minHeight:150},confirmLoading:Ce,onOk:()=>ne(void 0,null,function*(){yield $e.validateFields();const mt=$e.getFieldValue();De(!0);let xt=`/api/restfuls/${W.actionTabs.data.id}.json`;(yield(0,z.ZP)(xt,{method:"put",body:X({file_type:1},mt)})).status===0&&(y.ZP.success("\u4FEE\u6539\u6210\u529F"),te({type:"restful/setActionTabs",payload:{}}),te({type:"restful/getRestful"})),De(!1)}),onCancel:()=>{te({type:"restful/setActionTabs",payload:{}})}},k.createElement("div",{className:"pl30 pr30"},k.createElement(h.default,{form:$e,initialValues:{name:""}},k.createElement(fe.Z,{className:"mt30"},k.createElement($.Z,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),k.createElement($.Z,{flex:"1"},k.createElement(h.default.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u65B0\u540D\u79F0"}]},k.createElement(x.default,{placeholder:`\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26
`,maxLength:60})))))))};var g=(0,pe.connect)(({restful:W,loading:Z})=>({restful:W,loading:Z}))(v),U=A(506),ie={flex_box_center:"flex_box_center___EW6x1",flex_space_between:"flex_space_between___aSZFN",flex_box_vertical_center:"flex_box_vertical_center___MsqeW",flex_box_center_end:"flex_box_center_end___YMP0b",flex_box_column:"flex_box_column___KXrxt",tree:"tree___Zx4EL",actions:"actions___zwp8u"},Be=Object.defineProperty,Ze=Object.defineProperties,Qe=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable,xe=(W,Z,te)=>Z in W?Be(W,Z,{enumerable:!0,configurable:!0,writable:!0,value:te}):W[Z]=te,vt=(W,Z)=>{for(var te in Z||(Z={}))At.call(Z,te)&&xe(W,te,Z[te]);if(nt)for(var te of nt(Z))_t.call(Z,te)&&xe(W,te,Z[te]);return W},zt=(W,Z)=>Ze(W,Qe(Z)),Ct=(W,Z,te)=>new Promise((ue,ge)=>{var Ce=Ve=>{try{Fe(te.next(Ve))}catch(Ge){ge(Ge)}},De=Ve=>{try{Fe(te.throw(Ve))}catch(Ge){ge(Ge)}},Fe=Ve=>Ve.done?ue(Ve.value):Promise.resolve(Ve.value).then(Ce,De);Fe((te=te.apply(W,Z)).next())});const{Search:nn}=x.default,{DirectoryTree:qe}=D.default,Re=({user:W,globalSetting:Z,loading:te,dispatch:ue,restful:ge})=>{const Ce=(0,pe.useParams)(),[De,Fe]=(0,k.useState)(!0),[Ve]=h.default.useForm(),[Ge,$e]=(0,k.useState)(""),[mt]=(0,k.useState)([{id:1,name:"\u65B0\u5EFA\u6587\u4EF6"},{id:2,name:"\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"},{id:3,name:"\u91CD\u547D\u540D"},{id:4,name:"\u7F16\u8F91"},{id:5,name:"\u5220\u9664"}]),[xt,St]=(0,k.useState)([]),[Lt,Ht]=(0,k.useState)([]),[ut,Ut]=(0,k.useState)(!1),[Le,Ae]=(0,k.useState)([]);(0,k.useEffect)(()=>{var et,Ye,it,Rt;if((et=ge.restful)!=null&&et.data){Ae([...(Ye=ge.restful)==null?void 0:Ye.data]);let on=0,fn;if((Rt=(it=ge.restful)==null?void 0:it.data)==null||Rt.map(Pt=>{var jt;Pt.id==Ce.id&&(on=Pt.id),Pt.file_type==0&&!fn&&(fn=Pt.id),(jt=Pt==null?void 0:Pt.children)==null||jt.map(wn=>{fn||(fn=wn.id),wn.id==Ce.id&&(on=Pt.id)}),!Pt.children&&!fn&&(fn=Pt.id)}),!Ce.id&&fn){pe.history.push(`/ch/rest/${fn}`);return}on&&setTimeout(()=>{St([on]),Ht([Number(Ce.id||fn)])},200)}},[ge.restful]);const Ie=(et,Ye)=>{Ye.node.file_type===0?pe.history.push(`/ch/rest/${et[0]}`):Ht([...et]),console.log("Trigger Select",et,Ye)},H=et=>{St(et),console.log("Trigger Expand",et)},ee=et=>k.createElement("div",null,mt.map((Ye,it)=>k.createElement("p",{key:Ye.id,className:"current",onClick:()=>{switch(Ye.id){case 1:pe.history.push(`/ch/rest/edit/${et.id}/0`);break;case 2:case 3:ue({type:"restful/setActionTabs",payload:{key:Ye.name,data:et}});break;case 4:document.location.href=`/ch/rest/edit/${et.pid||0}/${et.id}`;break;case 5:m.default.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u5B9A\u5220\u9664\uFF1F",onOk:()=>Ct(void 0,null,function*(){const Rt=yield(0,U.E1)({id:et.id});(Rt==null?void 0:Rt.status)==0&&(y.ZP.success("\u5220\u9664\u6210\u529F"),ue({type:"restful/getRestful"}))})});break}}},Ye.name)).filter(Ye=>!!Ye).filter(Ye=>et.pid||et.file_type==0?Ye.key>3:Ye.key!=4)),de=et=>et.map(Ye=>{var it;const Rt=Ye.title.indexOf(Ge),on=Ye.title.substr(0,Rt),fn=Ye.title.substr(Rt+Ge.length),Pt=k.createElement("span",null,on,k.createElement("span",{className:"c-blue"},Ge),fn,(0,ce.ag)()&&k.createElement(S.Z,{placement:"right",title:Ge,content:()=>ee(Ye),trigger:"hover"},k.createElement("span",{className:`iconfont icon-sandian ${ie.actions}`})));return Ge!==""&&Rt===-1&&!((it=Ye.children)!=null&&it.length)?null:Ye.children&&Ye.file_type===1?zt(vt({},Ye),{title:Pt,key:Ye.key,children:de(Ye.children)}):zt(vt({},Ye),{title:Pt,key:Ye.key,isLeaf:!0})}).filter(Ye=>!!Ye),re=(et,Ye)=>{let it;for(let Rt=0;Rt<Ye.length;Rt++){const on=Ye[Rt];on.children&&(on.children.some(fn=>fn.key===et)?it=on.key:re(et,on.children)&&(it=re(et,on.children)))}return it},_e=et=>{const{value:Ye}=et.target,it=Le.map(Rt=>{var on;return Rt!=null&&Rt.children&&(on=Rt==null?void 0:Rt.children.filter(fn=>fn.title.indexOf(Ye)>-1))!=null&&on.length?Rt.id:null});$e(Ye),Ut(!0),console.log("expandedKeys:",it),St(it)};return console.log("loop(treeData):",de(Le)),k.createElement("div",{className:ie.tree},k.createElement(nn,{style:{marginBottom:8},placeholder:"\u8F93\u5165\u5173\u952E\u5B57\u68C0\u7D22",onChange:_e}),k.createElement(qe,{multiple:!0,defaultExpandAll:!0,onSelect:Ie,onExpand:H,expandedKeys:xt,selectedKeys:Lt,autoExpandParent:ut,treeData:de(Le)}),k.createElement(ve,null),k.createElement(g,null))};var we=(0,pe.connect)(({user:W,loading:Z,globalSetting:te,restful:ue})=>({user:W,globalSetting:te,restful:ue,loading:Z.models.index}))(Re),K=Object.defineProperty,Se=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,I=(W,Z,te)=>Z in W?K(W,Z,{enumerable:!0,configurable:!0,writable:!0,value:te}):W[Z]=te,F=(W,Z)=>{for(var te in Z||(Z={}))Ne.call(Z,te)&&I(W,te,Z[te]);if(Se)for(var te of Se(Z))V.call(Z,te)&&I(W,te,Z[te]);return W},oe=(W,Z)=>{var te={};for(var ue in W)Ne.call(W,ue)&&Z.indexOf(ue)<0&&(te[ue]=W[ue]);if(W!=null&&Se)for(var ue of Se(W))Z.indexOf(ue)<0&&V.call(W,ue)&&(te[ue]=W[ue]);return te},w=(W,Z,te)=>new Promise((ue,ge)=>{var Ce=Ve=>{try{Fe(te.next(Ve))}catch(Ge){ge(Ge)}},De=Ve=>{try{Fe(te.throw(Ve))}catch(Ge){ge(Ge)}},Fe=Ve=>Ve.done?ue(Ve.value):Promise.resolve(Ve.value).then(Ce,De);Fe((te=te.apply(W,Z)).next())});const C=W=>{var Z=W,{user:te,globalSetting:ue,loading:ge,dispatch:Ce,restful:De}=Z,Fe=oe(Z,["user","globalSetting","loading","dispatch","restful"]),Ve,Ge;const $e=(0,pe.useParams)(),[mt,xt]=(0,k.useState)(!0),St=()=>w(void 0,null,function*(){Ce({type:"restful/getRestful"}),$e.id&&Ce({type:"restful/getRestfulDetail",payload:F({},$e)})});(0,k.useEffect)(()=>{xt(!0),St()},[$e.id]);const Lt=()=>{Ce({type:"restful/setActionTabs",payload:{key:"\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"}})},Ht=()=>{var ut,Ut,Le;if((ut=De.restful)!=null&&ut.data){let Ae=0;return(Le=(Ut=De.restful)==null?void 0:Ut.data)==null||Le.map(Ie=>{var H;(H=Ie==null?void 0:Ie.children)==null||H.map(ee=>{ee.id==$e.id&&(Ae=Ie.id)}),!Ie.children&&!Ae&&(Ae=Ie.id)}),Ae}return 0};return k.createElement("section",null,k.createElement("aside",{className:"edu-container mt20"},k.createElement(Te.Z,null,k.createElement(Te.Z.Item,null,k.createElement(pe.Link,{to:"/"},"\u9996\u9875")),k.createElement(Te.Z.Item,null,k.createElement(pe.Link,{to:"/ch/rest"},"API\u6587\u6863"))),k.createElement("div",{className:"mt20"},k.createElement(fe.Z,{gutter:[20,20]},k.createElement($.Z,{flex:"300px"},k.createElement(we,F({},Fe))),k.createElement($.Z,{flex:"1"},k.createElement("div",{className:o.info},k.createElement("h1",{style:{fontSize:28,paddingBottom:15,borderBottom:"1px solid #eaeaea",textAlign:"center"}},(Ve=De.restfulDetail)==null?void 0:Ve.name),k.createElement(me.Z,{value:(Ge=De.restfulDetail)==null?void 0:Ge.description}))))),(0,ce.ag)()&&k.createElement("div",{className:o.bar},k.createElement(fe.Z,null,!!Ht()&&k.createElement($.Z,null,k.createElement(p.Z,{title:"\u7F16\u8F91\u6587\u4EF6"},k.createElement(pe.Link,{to:`/ch/rest/edit/${Ht()}/${$e.id}`,className:"icon-zhongmingming current"}))),k.createElement($.Z,null,k.createElement(p.Z,{title:"\u6DFB\u52A0\u6587\u4EF6"},k.createElement(pe.Link,{to:`/ch/rest/edit/${Ht()}/0`,className:"icon-tianjiatimu current"}))),k.createElement($.Z,null,k.createElement(p.Z,{title:"\u65B0\u5EFA\u6587\u4EF6\u5939"},k.createElement("span",{className:"icon-wenjianjia1 current",onClick:Lt})))))))};var B=(0,pe.connect)(({user:W,loading:Z,globalSetting:te,restful:ue})=>({user:W,globalSetting:te,restful:ue,loading:Z.models.index}))(C)},81428:function(vn,Et,A){"use strict";A.d(Et,{AL:function(){return T},Iy:function(){return D},Qv:function(){return y},ez:function(){return O},jb:function(){return h}});var k=A(32834),pe=A.n(k),Te=A(11690),fe=A.n(Te);let $=1;function p(he,ve){const be=he.match(/^(\s+)(?:```)/);if(be===null)return ve;const Oe=be[1];return ve.split(`
`).map(Q=>{const P=Q.match(/^\s+/);if(P===null)return Q;const[j]=P;return j.length>=Oe.length?Q.slice(Oe.length):Q}).join(`
`)}let me=[],ce=["<ul>"];const o=new(pe()).Renderer,x=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function D(){me.length=0,ce=["<ul>"]}const h={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(he,ve,be,Oe){if(ve>=he.length||he[ve].level<=be)return ve;var Q=he[ve];Oe.push("<li><a href='#"+$+Q.anchor+"'>"+Q.text+"</a>"),ve++;var P=[];return ve=m(he,ve,Q.level,P),P.length>0&&(Oe.push("<ul>"),P.forEach(function(j){Oe.push(j)}),Oe.push("</ul>")),Oe.push("</li>"),ve=m(he,ve,be,Oe),ve}function y(){return m(me,0,0,ce),ce.push("</ul>"),ce.join("")}const S={heading(he){const ve=x.exec(he);if($+=1,ve)return{type:"heading",raw:ve[0],depth:ve[1].length,text:ve[2]}},fences(he){const ve=this.rules.block.fences.exec(he);if(ve){const be=ve[0];let Oe=p(be,ve[3]||"");const Q=ve[2]?ve[2].trim():ve[2];if(["latex","katex","math"].indexOf(Q)>=0){const P=Y(),j=Oe;Oe=P,L[P]={type:"block",expression:j}}return{type:"code",raw:be,lang:Q,text:Oe}}}},M=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let z=0;const Y=()=>`__special_katext_id_${z++}__`;let L={};function O(){return L}function T(){z=0,L={}}function R(he){return he=he.replace(M,(ve,be)=>{const Oe=Y();return L[Oe]={type:"inline",expression:be},Oe}),he}const se=o.listitem;o.listitem=function(he){return se(R(he))};const ae=o.paragraph;o.paragraph=function(he){return ae(R(he))};const q=o.tablecell;o.tablecell=function(he,ve){return q(R(he),ve)},o.code=function(he,ve,be){const Oe=(ve||"").match(/\S*/)[0];return Oe?["latex","katex","math"].indexOf(Oe)>=0?`<p class='editormd-tex'>${he}</p>`:`<pre class="prettyprint linenums"><code class="language-${ve}">${be?he:(0,Te.escape)(he,!0)}</code></pre>
`:'<pre class="prettyprint linenums"><code>'+(be?he:(0,Te.escape)(he,!0))+"</code></pre>"},o.heading=function(he,ve,be){let Oe=this.options.headerPrefix+be.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return me.push({anchor:Oe,level:ve,text:he}),"<h"+ve+' id="'+$+Oe+'">'+he+"</h"+ve+">"},pe().setOptions({silent:!0,gfm:!0,pedantic:!1}),pe().use({tokenizer:S,renderer:o}),Et.ZP=pe()},64018:function(){var vn,Et,A,k=!1,pe,Te;window.PR_SHOULD_USE_CONTINUATION=!0;var fe,$;(function(){var p=window,me=["break,continue,do,else,for,if,return,while"],ce=[me,"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"],o=[ce,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],x=[o,"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"],D=[o,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[o,"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"],m="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",y=[o,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],S="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",M=[me,"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"],z=[me,"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"],Y=[me,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],L=[x,h,D,y,S,M,z,Y],O=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",R="kwd",se="com",ae="typ",q="lit",he="pun",ve="pln",be="tag",Oe="dec",Q="src",P="atn",j="atv",X="nocode",ne="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function J(we){for(var K=0,Se=!1,Ne=!1,V=0,I=we.length;V<I;++V){var F=we[V];if(F.ignoreCase)Ne=!0;else if(/[a-z]/i.test(F.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Se=!0,Ne=!1;break}}var oe={b:8,t:9,n:10,v:11,f:12,r:13};function w(te){var ue=te.charCodeAt(0);if(ue!==92)return ue;var ge=te.charAt(1);return ue=oe[ge],ue||("0"<=ge&&ge<="7"?parseInt(te.substring(1),8):ge==="u"||ge==="x"?parseInt(te.substring(2),16):te.charCodeAt(1))}function C(te){if(te<32)return(te<16?"\\x0":"\\x")+te.toString(16);var ue=String.fromCharCode(te);return ue==="\\"||ue==="-"||ue==="]"||ue==="^"?"\\"+ue:ue}function B(te){var ue=te.substring(1,te.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")),ge=[],Ce=ue[0]==="^",De=["["];Ce&&De.push("^");for(var Fe=Ce?1:0,Ve=ue.length;Fe<Ve;++Fe){var Ge=ue[Fe];if(/\\[bdsw]/i.test(Ge))De.push(Ge);else{var $e=w(Ge),mt;Fe+2<Ve&&ue[Fe+1]==="-"?(mt=w(ue[Fe+2]),Fe+=2):mt=$e,ge.push([$e,mt]),mt<65||$e>122||(mt<65||$e>90||ge.push([Math.max(65,$e)|32,Math.min(mt,90)|32]),mt<97||$e>122||ge.push([Math.max(97,$e)&-33,Math.min(mt,122)&-33]))}}ge.sort(function(Ht,ut){return Ht[0]-ut[0]||ut[1]-Ht[1]});for(var xt=[],St=[],Fe=0;Fe<ge.length;++Fe){var Lt=ge[Fe];Lt[0]<=St[1]+1?St[1]=Math.max(St[1],Lt[1]):xt.push(St=Lt)}for(var Fe=0;Fe<xt.length;++Fe){var Lt=xt[Fe];De.push(C(Lt[0])),Lt[1]>Lt[0]&&(Lt[1]+1>Lt[0]&&De.push("-"),De.push(C(Lt[1])))}return De.push("]"),De.join("")}function W(te){for(var ue=te.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")),ge=ue.length,Ce=[],De=0,Fe=0;De<ge;++De){var Ve=ue[De];if(Ve==="(")++Fe;else if(Ve.charAt(0)==="\\"){var Ge=+Ve.substring(1);Ge&&(Ge<=Fe?Ce[Ge]=-1:ue[De]=C(Ge))}}for(var De=1;De<Ce.length;++De)Ce[De]===-1&&(Ce[De]=++K);for(var De=0,Fe=0;De<ge;++De){var Ve=ue[De];if(Ve==="(")++Fe,Ce[Fe]||(ue[De]="(?:");else if(Ve.charAt(0)==="\\"){var Ge=+Ve.substring(1);Ge&&Ge<=Fe&&(ue[De]="\\"+Ce[Ge])}}for(var De=0;De<ge;++De)ue[De]==="^"&&ue[De+1]!=="^"&&(ue[De]="");if(te.ignoreCase&&Se)for(var De=0;De<ge;++De){var Ve=ue[De],$e=Ve.charAt(0);Ve.length>=2&&$e==="["?ue[De]=B(Ve):$e!=="\\"&&(ue[De]=Ve.replace(/[a-zA-Z]/g,function(St){var Lt=St.charCodeAt(0);return"["+String.fromCharCode(Lt&-33,Lt|32)+"]"}))}return ue.join("")}for(var Z=[],V=0,I=we.length;V<I;++V){var F=we[V];if(F.global||F.multiline)throw new Error(""+F);Z.push("(?:"+W(F)+")")}return new RegExp(Z.join("|"),Ne?"gi":"g")}function v(we,K){var Se=/(?:^|\s)nocode(?:\s|$)/,Ne=[],V=0,I=[],F=0;function oe(w){var C=w.nodeType;if(C==1){if(Se.test(w.className))return;for(var B=w.firstChild;B;B=B.nextSibling)oe(B);var W=w.nodeName.toLowerCase();(W==="br"||W==="li")&&(Ne[F]=`
`,I[F<<1]=V++,I[F++<<1|1]=w)}else if(C==3||C==4){var Z=w.nodeValue;Z.length&&(K?Z=Z.replace(/\r\n?/g,`
`):Z=Z.replace(/[ \t\r\n]+/g," "),Ne[F]=Z,I[F<<1]=V,V+=Z.length,I[F++<<1|1]=w)}}return oe(we),{sourceCode:Ne.join("").replace(/\n$/,""),spans:I}}function g(we,K,Se,Ne,V){if(Se){var I={sourceNode:we,pre:1,langExtension:null,numberLines:null,sourceCode:Se,spans:null,basePos:K,decorations:null};Ne(I),V.push.apply(V,I.decorations)}}var U=/\S/;function ie(we){for(var K=void 0,Se=we.firstChild;Se;Se=Se.nextSibling){var Ne=Se.nodeType;K=Ne===1?K?we:Se:Ne===3&&U.test(Se.nodeValue)?we:K}return K===we?void 0:K}function Be(we,K){var Se={},Ne;(function(){for(var F=we.concat(K),oe=[],w={},C=0,B=F.length;C<B;++C){var W=F[C],Z=W[3];if(Z)for(var te=Z.length;--te>=0;)Se[Z.charAt(te)]=W;var ue=W[1],ge=""+ue;w.hasOwnProperty(ge)||(oe.push(ue),w[ge]=null)}oe.push(/[\0-\uffff]/),Ne=J(oe)})();var V=K.length,I=function(F){for(var oe=F.sourceCode,w=F.basePos,C=F.sourceNode,B=[w,ve],W=0,Z=oe.match(Ne)||[],te={},ue=0,ge=Z.length;ue<ge;++ue){var Ce=Z[ue],De=te[Ce],Fe=void 0,Ve;if(typeof De=="string")Ve=!1;else{var Ge=Se[Ce.charAt(0)];if(Ge)Fe=Ce.match(Ge[1]),De=Ge[0];else{for(var $e=0;$e<V;++$e)if(Ge=K[$e],Fe=Ce.match(Ge[1]),Fe){De=Ge[0];break}Fe||(De=ve)}Ve=De.length>=5&&De.substring(0,5)==="lang-",Ve&&!(Fe&&typeof Fe[1]=="string")&&(Ve=!1,De=Q),Ve||(te[Ce]=De)}var mt=W;if(W+=Ce.length,!Ve)B.push(w+mt,De);else{var xt=Fe[1],St=Ce.indexOf(xt),Lt=St+xt.length;Fe[2]&&(Lt=Ce.length-Fe[2].length,St=Lt-xt.length);var Ht=De.substring(5);g(C,w+mt,Ce.substring(0,St),I,B),g(C,w+mt+St,xt,vt(Ht,xt),B),g(C,w+mt+Lt,Ce.substring(Lt),I,B)}}F.decorations=B};return I}function Ze(we){var K=[],Se=[];we.tripleQuotedStrings?K.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):we.multiLineStrings?K.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):K.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),we.verbatimStrings&&Se.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ne=we.hashComments;Ne&&(we.cStyleComments?(Ne>1?K.push([se,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):K.push([se,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Se.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):K.push([se,/^#[^\r\n]*/,null,"#"])),we.cStyleComments&&(Se.push([se,/^\/\/[^\r\n]*/,null]),Se.push([se,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var V=we.regexLiterals;if(V){var I=V>1?"":`
\r`,F=I?".":"[\\S\\s]",oe="/(?=[^/*"+I+"])(?:[^/\\x5B\\x5C"+I+"]|\\x5C"+F+"|\\x5B(?:[^\\x5C\\x5D"+I+"]|\\x5C"+F+")*(?:\\x5D|$))+/";Se.push(["lang-regex",RegExp("^"+ne+"("+oe+")")])}var w=we.types;w&&Se.push([ae,w]);var C=(""+we.keywords).replace(/^ | $/g,"");C.length&&Se.push([R,new RegExp("^(?:"+C.replace(/[\s,]+/g,"|")+")\\b"),null]),K.push([ve,/^\s+/,null,` \r
\xA0`]);var B="^.[^\\s\\w.$@'\"`/\\\\]*";return we.regexLiterals&&(B+="(?!s*/)"),Se.push([q,/^@[a-z_$][a-z_$@0-9]*/i,null],[ae,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[ve,/^[a-z_$][a-z_$@0-9]*/i,null],[q,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[ve,/^\\[\s\S]?/,null],[he,new RegExp(B),null]),Be(K,Se)}var Qe=Ze({keywords:L,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function nt(we,K,Se){for(var Ne=/(?:^|\s)nocode(?:\s|$)/,V=/\r\n?|\n/,I=we.ownerDocument,F=I.createElement("li");we.firstChild;)F.appendChild(we.firstChild);var oe=[F];function w(ue){var ge=ue.nodeType;if(ge==1&&!Ne.test(ue.className))if(ue.nodeName==="br")C(ue),ue.parentNode&&ue.parentNode.removeChild(ue);else for(var Ce=ue.firstChild;Ce;Ce=Ce.nextSibling)w(Ce);else if((ge==3||ge==4)&&Se){var De=ue.nodeValue,Fe=De.match(V);if(Fe){var Ve=De.substring(0,Fe.index);ue.nodeValue=Ve;var Ge=De.substring(Fe.index+Fe[0].length);if(Ge){var $e=ue.parentNode;$e.insertBefore(I.createTextNode(Ge),ue.nextSibling)}C(ue),Ve||ue.parentNode.removeChild(ue)}}}function C(ue){for(;!ue.nextSibling;)if(ue=ue.parentNode,!ue)return;function ge(Fe,Ve){var Ge=Ve?Fe.cloneNode(!1):Fe,$e=Fe.parentNode;if($e){var mt=ge($e,1),xt=Fe.nextSibling;mt.appendChild(Ge);for(var St=xt;St;St=xt)xt=St.nextSibling,mt.appendChild(St)}return Ge}for(var Ce=ge(ue.nextSibling,0),De;(De=Ce.parentNode)&&De.nodeType===1;)Ce=De;oe.push(Ce)}for(var B=0;B<oe.length;++B)w(oe[B]);K===(K|0)&&oe[0].setAttribute("value",K);var W=I.createElement("ol");W.className="linenums";for(var Z=Math.max(0,K-1|0)||0,B=0,te=oe.length;B<te;++B)F=oe[B],F.className="L"+(B+Z)%10,F.firstChild||F.appendChild(I.createTextNode("\xA0")),W.appendChild(F);we.appendChild(W)}function At(we){var K=/\bMSIE\s(\d+)/.exec(navigator.userAgent);K=K&&+K[1]<=8;var Se=/\n/g,Ne=we.sourceCode,V=Ne.length,I=0,F=we.spans,oe=F.length,w=0,C=we.decorations,B=C.length,W=0;C[B]=V;var Z,te;for(te=Z=0;te<B;)C[te]!==C[te+2]?(C[Z++]=C[te++],C[Z++]=C[te++]):te+=2;for(B=Z,te=Z=0;te<B;){for(var ue=C[te],ge=C[te+1],Ce=te+2;Ce+2<=B&&C[Ce+1]===ge;)Ce+=2;C[Z++]=ue,C[Z++]=ge,te=Ce}B=C.length=Z;var De=we.sourceNode,Fe="";De&&(Fe=De.style.display,De.style.display="none");try{for(var Ve=null;w<oe;){var Ge=F[w],$e=F[w+2]||V,mt=C[W+2]||V,Ce=Math.min($e,mt),xt=F[w+1],St;if(xt.nodeType!==1&&(St=Ne.substring(I,Ce))){K&&(St=St.replace(Se,"\r")),xt.nodeValue=St;var Lt=xt.ownerDocument,Ht=Lt.createElement("span");Ht.className=C[W+1];var ut=xt.parentNode;ut.replaceChild(Ht,xt),Ht.appendChild(xt),I<$e&&(F[w+1]=xt=Lt.createTextNode(Ne.substring(Ce,$e)),ut.insertBefore(xt,Ht.nextSibling))}I=Ce,I>=$e&&(w+=2),I>=mt&&(W+=2)}}finally{De&&(De.style.display=Fe)}}var _t={};function xe(we,K){for(var Se=K.length;--Se>=0;){var Ne=K[Se];_t.hasOwnProperty(Ne)?p.console&&console.warn("cannot override language handler %s",Ne):_t[Ne]=we}}function vt(we,K){return we&&_t.hasOwnProperty(we)||(we=/^\s*</.test(K)?"default-markup":"default-code"),_t[we]}xe(Qe,["default-code"]),xe(Be([],[[ve,/^[^<?]+/],[Oe,/^<!\w[^>]*(?:>|$)/],[se,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[he,/^(?:<[%?]|[%?]>)/],["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"]),xe(Be([[ve,/^[\s]+/,null,` \r
`],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[be,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[he,/^[=<>\/]+/],["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"]),xe(Be([],[[j,/^[\s\S]+/]]),["uq.val"]),xe(Ze({keywords:x,hashComments:!0,cStyleComments:!0,types:O}),["c","cc","cpp","cxx","cyc","m"]),xe(Ze({keywords:"null,true,false"}),["json"]),xe(Ze({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:O}),["cs"]),xe(Ze({keywords:D,cStyleComments:!0}),["java"]),xe(Ze({keywords:Y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),xe(Ze({keywords:M,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),xe(Ze({keywords:S,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),xe(Ze({keywords:z,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),xe(Ze({keywords:y,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),xe(Ze({keywords:m,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),xe(Be([],[[T,/^[\s\S]+/]]),["regex"]);function zt(we){var K=we.langExtension;try{var Se=v(we.sourceNode,we.pre),Ne=Se.sourceCode;we.sourceCode=Ne,we.spans=Se.spans,we.basePos=0,vt(K,Ne)(we),At(we)}catch(V){p.console&&console.log(V&&V.stack||V)}}function Ct(we,K,Se){var Ne=Se||!1,V=K||null,I=document.createElement("div");I.innerHTML="<pre>"+we+"</pre>",I=I.firstChild,Ne&&nt(I,Ne,!0);var F={langExtension:V,numberLines:Ne,sourceNode:I,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return zt(F),I.innerHTML}function nn(we,K){var Se=K||document.body,Ne=Se.ownerDocument||document;function V(Ge){return Se.getElementsByTagName(Ge)}for(var I=[V("pre"),V("code"),V("xmp")],F=[],oe=0;oe<I.length;++oe)for(var w=0,C=I[oe].length;w<C;++w)F.push(I[oe][w]);I=null;var B=Date;B.now||(B={now:function(){return+new Date}});var W=0,Z=/\blang(?:uage)?-([\w.]+)(?!\S)/,te=/\bprettyprint\b/,ue=/\bprettyprinted\b/,ge=/pre|xmp/i,Ce=/^code$/i,De=/^(?:pre|code|xmp)$/i,Fe={};function Ve(){for(var Ge=p.PR_SHOULD_USE_CONTINUATION?B.now()+250:1/0;W<F.length&&B.now()<Ge;W++){for(var $e=F[W],mt=Fe,xt=$e;xt=xt.previousSibling;){var St=xt.nodeType,Lt=(St===7||St===8)&&xt.nodeValue;if(Lt?!/^\??prettify\b/.test(Lt):St!==3||/\S/.test(xt.nodeValue))break;if(Lt){mt={},Lt.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ye,it,Rt){mt[it]=Rt});break}}var Ht=$e.className;if((mt!==Fe||te.test(Ht))&&!ue.test(Ht)){for(var ut=!1,Ut=$e.parentNode;Ut;Ut=Ut.parentNode){var Le=Ut.tagName;if(De.test(Le)&&Ut.className&&te.test(Ut.className)){ut=!0;break}}if(!ut){$e.className+=" prettyprinted";var Ae=mt.lang;if(!Ae){Ae=Ht.match(Z);var Ie;!Ae&&(Ie=ie($e))&&Ce.test(Ie.tagName)&&(Ae=Ie.className.match(Z)),Ae&&(Ae=Ae[1])}var H;if(ge.test($e.tagName))H=1;else{var ee=$e.currentStyle,de=Ne.defaultView,re=ee?ee.whiteSpace:de&&de.getComputedStyle?de.getComputedStyle($e,null).getPropertyValue("white-space"):0;H=re&&re.substring(0,3)==="pre"}var _e=mt.linenums;(_e=_e==="true"||+_e)||(_e=Ht.match(/\blinenums\b(?::(\d+))?/),_e=_e?_e[1]&&_e[1].length?+_e[1]:!0:!1),_e&&nt($e,_e,H);var et={langExtension:Ae,sourceNode:$e,numberLines:_e,pre:H,sourceCode:null,basePos:null,spans:null,decorations:null};zt(et)}}}W<F.length?p.setTimeout(Ve,250):typeof we=="function"&&we()}Ve()}var qe=p.PR={createSimpleLexer:Be,registerLangHandler:xe,sourceDecorator:Ze,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:j,PR_COMMENT:se,PR_DECLARATION:Oe,PR_KEYWORD:R,PR_LITERAL:q,PR_NOCODE:X,PR_PLAIN:ve,PR_PUNCTUATION:he,PR_SOURCE:Q,PR_STRING:T,PR_TAG:be,PR_TYPE:ae,prettyPrintOne:k?p.prettyPrintOne=Ct:fe=Ct,prettyPrint:$=k?p.prettyPrint=nn:$=nn},Re=p.define;typeof Re=="function"&&Re.amd&&Re("google-code-prettify",[],function(){return qe})})()},25769:function(vn,Et,A){"use strict";var k=A(98040),pe={"text/plain":"Text","text/html":"Url",default:"Text"},Te="Copy to clipboard: #{key}, Enter";function fe(p){var me=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return p.replace(/#{\s*key\s*}/g,me)}function $(p,me){var ce,o,x,D,h,m,y=!1;me||(me={}),ce=me.debug||!1;try{x=k(),D=document.createRange(),h=document.getSelection(),m=document.createElement("span"),m.textContent=p,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(M){if(M.stopPropagation(),me.format)if(M.preventDefault(),typeof M.clipboardData=="undefined"){ce&&console.warn("unable to use e.clipboardData"),ce&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var z=pe[me.format]||pe.default;window.clipboardData.setData(z,p)}else M.clipboardData.clearData(),M.clipboardData.setData(me.format,p);me.onCopy&&(M.preventDefault(),me.onCopy(M.clipboardData))}),document.body.appendChild(m),D.selectNodeContents(m),h.addRange(D);var S=document.execCommand("copy");if(!S)throw new Error("copy command was unsuccessful");y=!0}catch(M){ce&&console.error("unable to copy using execCommand: ",M),ce&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(me.format||"text",p),me.onCopy&&me.onCopy(window.clipboardData),y=!0}catch(z){ce&&console.error("unable to copy using clipboardData: ",z),ce&&console.error("falling back to prompt"),o=fe("message"in me?me.message:Te),window.prompt(o,p)}}finally{h&&(typeof h.removeRange=="function"?h.removeRange(D):h.removeAllRanges()),m&&document.body.removeChild(m),x()}return y}vn.exports=$},53184:function(vn,Et,A){"use strict";var k,pe;function Te(fe,$,p){var me=function(ce,o){return fe.js_beautify(ce,o)};return me.js=fe.js_beautify,me.css=$.css_beautify,me.html=p.html_beautify,me.js_beautify=fe.js_beautify,me.css_beautify=$.css_beautify,me.html_beautify=p.html_beautify,me}k=[A(58553),A(87804),A(40998)],pe=function(fe,$,p){return Te(fe,$,p)}.apply(Et,k),pe!==void 0&&(vn.exports=pe)},87804:function(vn,Et){var A,k;(function(){var pe;(function(){"use strict";var fe=[,,function(ce){function o(h){this.__parent=h,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=[]}o.prototype.clone_empty=function(){var h=new o(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},o.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},o.prototype.has_match=function(h){for(var m=this.__items.length-1;m>=0;m--)if(this.__items[m].match(h))return!0;return!1},o.prototype.set_indent=function(h,m){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=m||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},o.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)},o.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},o.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},o.prototype.is_empty=function(){return this.__items.length===0},o.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},o.prototype.push=function(h){this.__items.push(h);var m=h.lastIndexOf(`
`);m!==-1?this.__character_count=h.length-m:this.__character_count+=h.length},o.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},o.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},o.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},o.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},o.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function x(h,m){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),m=m||"",h.indent_level>0&&(m=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=m,this.__base_string_length=m.length}x.prototype.get_indent_size=function(h,m){var y=this.__base_string_length;return m=m||0,h<0&&(y=0),y+=h*this.__indent_size,y+=m,y},x.prototype.get_indent_string=function(h,m){var y=this.__base_string;return m=m||0,h<0&&(h=0,y=""),m+=h*this.__indent_size,this.__ensure_cache(m),y+=this.__cache[m],y},x.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},x.prototype.__add_column=function(){var h=this.__cache.length,m=0,y="";this.__indent_size&&h>=this.__indent_size&&(m=Math.floor(h/this.__indent_size),h-=m*this.__indent_size,y=new Array(m+1).join(this.__indent_string)),h&&(y+=new Array(h+1).join(" ")),this.__cache.push(y)};function D(h,m){this.__indent_cache=new x(h,m),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new o(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}D.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},D.prototype.get_line_number=function(){return this.__lines.length},D.prototype.get_indent_string=function(h,m){return this.__indent_cache.get_indent_string(h,m)},D.prototype.get_indent_size=function(h,m){return this.__indent_cache.get_indent_size(h,m)},D.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},D.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},D.prototype.get_code=function(h){this.trim(!0);var m=this.current_line.pop();m&&(m[m.length-1]===`
`&&(m=m.replace(/\n+$/g,"")),this.current_line.push(m)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
`);return h!==`
`&&(y=y.replace(/[\n]/g,h)),y},D.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},D.prototype.set_indent=function(h,m){return h=h||0,m=m||0,this.next_line.set_indent(h,m),this.__lines.length>1?(this.current_line.set_indent(h,m),!0):(this.current_line.set_indent(),!1)},D.prototype.add_raw_token=function(h){for(var m=0;m<h.newlines;m++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},D.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},D.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(" "))},D.prototype.remove_indent=function(h){for(var m=this.__lines.length;h<m;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},D.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&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},D.prototype.just_added_newline=function(){return this.current_line.is_empty()},D.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},D.prototype.ensure_empty_line_above=function(h,m){for(var y=this.__lines.length-2;y>=0;){var S=this.__lines[y];if(S.is_empty())break;if(S.item(0).indexOf(h)!==0&&S.item(-1)!==m){this.__lines.splice(y+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},ce.exports.Output=D},,,,function(ce){function o(h,m){this.raw_options=x(h,m),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}o.prototype._get_array=function(h,m){var y=this.raw_options[h],S=m||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(S=y.concat()):typeof y=="string"&&(S=y.split(/[^a-zA-Z0-9_\/\-]+/)),S},o.prototype._get_boolean=function(h,m){var y=this.raw_options[h],S=y===void 0?!!m:!!y;return S},o.prototype._get_characters=function(h,m){var y=this.raw_options[h],S=m||"";return typeof y=="string"&&(S=y.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),S},o.prototype._get_number=function(h,m){var y=this.raw_options[h];m=parseInt(m,10),isNaN(m)&&(m=0);var S=parseInt(y,10);return isNaN(S)&&(S=m),S},o.prototype._get_selection=function(h,m,y){var S=this._get_selection_list(h,m,y);if(S.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
`+m+`
You passed in: '`+this.raw_options[h]+"'");return S[0]},o.prototype._get_selection_list=function(h,m,y){if(!m||m.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[m[0]],!this._is_valid_selection(y,m))throw new Error("Invalid Default Value!");var S=this._get_array(h,y);if(!this._is_valid_selection(S,m))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
`+m+`
You passed in: '`+this.raw_options[h]+"'");return S},o.prototype._is_valid_selection=function(h,m){return h.length&&m.length&&!h.some(function(y){return m.indexOf(y)===-1})};function x(h,m){var y={};h=D(h);var S;for(S in h)S!==m&&(y[S]=h[S]);if(m&&h[m])for(S in h[m])y[S]=h[m][S];return y}function D(h){var m={},y;for(y in h){var S=y.replace(/-/g,"_");m[S]=h[y]}return m}ce.exports.Options=o,ce.exports.normalizeOpts=D,ce.exports.mergeOpts=x},,function(ce){var o=RegExp.prototype.hasOwnProperty("sticky");function x(D){this.__input=D||"",this.__input_length=this.__input.length,this.__position=0}x.prototype.restart=function(){this.__position=0},x.prototype.back=function(){this.__position>0&&(this.__position-=1)},x.prototype.hasNext=function(){return this.__position<this.__input_length},x.prototype.next=function(){var D=null;return this.hasNext()&&(D=this.__input.charAt(this.__position),this.__position+=1),D},x.prototype.peek=function(D){var h=null;return D=D||0,D+=this.__position,D>=0&&D<this.__input_length&&(h=this.__input.charAt(D)),h},x.prototype.__match=function(D,h){D.lastIndex=h;var m=D.exec(this.__input);return m&&!(o&&D.sticky)&&m.index!==h&&(m=null),m},x.prototype.test=function(D,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(D,h):!1},x.prototype.testChar=function(D,h){var m=this.peek(h);return D.lastIndex=0,m!==null&&D.test(m)},x.prototype.match=function(D){var h=this.__match(D,this.__position);return h?this.__position+=h[0].length:h=null,h},x.prototype.read=function(D,h,m){var y="",S;return D&&(S=this.match(D),S&&(y+=S[0])),h&&(S||!D)&&(y+=this.readUntil(h,m)),y},x.prototype.readUntil=function(D,h){var m="",y=this.__position;D.lastIndex=this.__position;var S=D.exec(this.__input);return S?(y=S.index,h&&(y+=S[0].length)):y=this.__input_length,m=this.__input.substring(this.__position,y),this.__position=y,m},x.prototype.readUntilAfter=function(D){return this.readUntil(D,!0)},x.prototype.get_regexp=function(D,h){var m=null,y="g";return h&&o&&(y="y"),typeof D=="string"&&D!==""?m=new RegExp(D,y):D&&(m=new RegExp(D.source,y)),m},x.prototype.get_literal_regexp=function(D){return RegExp(D.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},x.prototype.peekUntilAfter=function(D){var h=this.__position,m=this.readUntilAfter(D);return this.__position=h,m},x.prototype.lookBack=function(D){var h=this.__position-1;return h>=D.length&&this.__input.substring(h-D.length,h).toLowerCase()===D},ce.exports.InputScanner=x},,,,,function(ce){function o(x,D){x=typeof x=="string"?x:x.source,D=typeof D=="string"?D:D.source,this.__directives_block_pattern=new RegExp(x+/ beautify( \w+[:]\w+)+ /.source+D,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(x+/\sbeautify\signore:end\s/.source+D,"g")}o.prototype.get_directives=function(x){if(!x.match(this.__directives_block_pattern))return null;var D={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(x);h;)D[h[1]]=h[2],h=this.__directive_pattern.exec(x);return D},o.prototype.readIgnored=function(x){return x.readUntilAfter(this.__directives_end_ignore_pattern)},ce.exports.Directives=o},,function(ce,o,x){var D=x(16).Beautifier,h=x(17).Options;function m(y,S){var M=new D(y,S);return M.beautify()}ce.exports=m,ce.exports.defaultOptions=function(){return new h}},function(ce,o,x){var D=x(17).Options,h=x(2).Output,m=x(8).InputScanner,y=x(13).Directives,S=new y(/\/\*/,/\*\//),M=/\r\n|[\r\n]/,z=/\r\n|[\r\n]/g,Y=/\s/,L=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,T=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function R(se,ae){this._source_text=se||"",this._options=new D(ae),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"]}R.prototype.eatString=function(se){var ae="";for(this._ch=this._input.next();this._ch;){if(ae+=this._ch,this._ch==="\\")ae+=this._input.next();else if(se.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return ae},R.prototype.eatWhitespace=function(se){for(var ae=Y.test(this._input.peek()),q=0;Y.test(this._input.peek());)this._ch=this._input.next(),se&&this._ch===`
`&&(q===0||q<this._options.max_preserve_newlines)&&(q++,this._output.add_new_line(!0));return ae},R.prototype.foundNestedPseudoClass=function(){for(var se=0,ae=1,q=this._input.peek(ae);q;){if(q==="{")return!0;if(q==="(")se+=1;else if(q===")"){if(se===0)return!1;se-=1}else if(q===";"||q==="}")return!1;ae++,q=this._input.peek(ae)}return!1},R.prototype.print_string=function(se){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(se)},R.prototype.preserveSingleSpace=function(se){se&&(this._output.space_before_token=!0)},R.prototype.indent=function(){this._indentLevel++},R.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},R.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var se=this._source_text,ae=this._options.eol;ae==="auto"&&(ae=`
`,se&&M.test(se||"")&&(ae=se.match(M)[0])),se=se.replace(z,`
`);var q=se.match(/^[\t ]*/)[0];this._output=new h(this._options,q),this._input=new m(se),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var he=0,ve=!1,be=!1,Oe=!1,Q=!1,P=!1,j=this._ch,X=!1,ne,J,v;ne=this._input.read(L),J=ne!=="",v=j,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),j=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var g=this._input.read(O),U=S.get_directives(g);U&&U.ignore==="start"&&(g+=S.readIgnored(this._input)),this.print_string(g),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(T)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(J),this.print_string(this._ch);var ie=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ie.match(/[ :]$/)&&(ie=this.eatString(": ").replace(/\s+$/,""),this.print_string(ie),this._output.space_before_token=!0),he===0&&ie.indexOf(":")!==-1&&(be=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(J),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var Be=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Be.match(/[ :]$/)&&(Be=this.eatString(": ").replace(/\s+$/,""),this.print_string(Be),this._output.space_before_token=!0),he===0&&Be.indexOf(":")!==-1?(be=!0,this.indent()):Be in this.NESTED_AT_RULE?(this._nestedLevel+=1,Be in this.CONDITIONAL_GROUP_RULE&&(Oe=!0)):he===0&&!be&&(Q=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(J),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")be&&(be=!1,this.outdent()),Q=!1,Oe?(Oe=!1,ve=this._indentLevel>=this._nestedLevel):ve=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&ve&&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)):(v==="("?this._output.space_before_token=!1:v!==","&&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(),v==="{"&&this._output.trim(!0),be&&(this.outdent(),be=!1),this.print_string(this._ch),ve=!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 Ze=0;Ze<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Ze++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Ze])){X=!0;break}(ve||Oe)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!Q&&he===0?(this.print_string(":"),be||(be=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Qe=v==='"'||v==="'";this.preserveSingleSpace(Qe||J),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")X=!1,he===0?(be&&(this.outdent(),be=!1),Q=!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(),he++,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(")")),he&&(he--,this.outdent()));else{var nt=!1;this._input.lookBack("with")&&(nt=!0),this.preserveSingleSpace(J||nt),this.print_string(this._ch),be&&v==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),P=!0):(this.eatWhitespace(),he++,this.indent())}else if(this._ch===")")he&&(he--,this.outdent()),P&&this._input.peek()===";"&&this._options.selector_separator_newline&&(P=!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&&(!be||P)&&he===0&&!Q?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!be&&he===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&&Y.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(J),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),Y.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 At=v==='"'||v==="'";this.preserveSingleSpace(At||J),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&X&&this._output.add_new_line()}var _t=this._output.get_code(ae);return _t},ce.exports.Beautifier=R},function(ce,o,x){var D=x(6).Options;function h(m){D.call(this,m,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var y=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||y;var S=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var M=0;M<S.length;M++)S[M]!=="expand"?this.brace_style="collapse":this.brace_style=S[M]}h.prototype=new D,ce.exports.Options=h}],$={};function p(ce){var o=$[ce];if(o!==void 0)return o.exports;var x=$[ce]={exports:{}};return fe[ce](x,x.exports,p),x.exports}var me=p(15);pe=me})();var Te=pe;A=[],k=function(){return{css_beautify:Te}}.apply(Et,A),k!==void 0&&(vn.exports=k)})()},40998:function(vn,Et,A){var k,pe;(function(){var Te;(function(){"use strict";var me=[,,function(D){function h(S){this.__parent=S,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=[]}h.prototype.clone_empty=function(){var S=new h(this.__parent);return S.set_indent(this.__indent_count,this.__alignment_count),S},h.prototype.item=function(S){return S<0?this.__items[this.__items.length+S]:this.__items[S]},h.prototype.has_match=function(S){for(var M=this.__items.length-1;M>=0;M--)if(this.__items[M].match(S))return!0;return!1},h.prototype.set_indent=function(S,M){this.is_empty()&&(this.__indent_count=S||0,this.__alignment_count=M||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},h.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)},h.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},h.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var S=this.__parent.current_line;return S.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),S.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),S.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,S.__items[0]===" "&&(S.__items.splice(0,1),S.__character_count-=1),!0}return!1},h.prototype.is_empty=function(){return this.__items.length===0},h.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},h.prototype.push=function(S){this.__items.push(S);var M=S.lastIndexOf(`
`);M!==-1?this.__character_count=S.length-M:this.__character_count+=S.length},h.prototype.pop=function(){var S=null;return this.is_empty()||(S=this.__items.pop(),this.__character_count-=S.length),S},h.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},h.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},h.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},h.prototype.toString=function(){var S="";return this.is_empty()?this.__parent.indent_empty_lines&&(S=this.__parent.get_indent_string(this.__indent_count)):(S=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),S+=this.__items.join("")),S};function m(S,M){this.__cache=[""],this.__indent_size=S.indent_size,this.__indent_string=S.indent_char,S.indent_with_tabs||(this.__indent_string=new Array(S.indent_size+1).join(S.indent_char)),M=M||"",S.indent_level>0&&(M=new Array(S.indent_level+1).join(this.__indent_string)),this.__base_string=M,this.__base_string_length=M.length}m.prototype.get_indent_size=function(S,M){var z=this.__base_string_length;return M=M||0,S<0&&(z=0),z+=S*this.__indent_size,z+=M,z},m.prototype.get_indent_string=function(S,M){var z=this.__base_string;return M=M||0,S<0&&(S=0,z=""),M+=S*this.__indent_size,this.__ensure_cache(M),z+=this.__cache[M],z},m.prototype.__ensure_cache=function(S){for(;S>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var S=this.__cache.length,M=0,z="";this.__indent_size&&S>=this.__indent_size&&(M=Math.floor(S/this.__indent_size),S-=M*this.__indent_size,z=new Array(M+1).join(this.__indent_string)),S&&(z+=new Array(S+1).join(" ")),this.__cache.push(z)};function y(S,M){this.__indent_cache=new m(S,M),this.raw=!1,this._end_with_newline=S.end_with_newline,this.indent_size=S.indent_size,this.wrap_line_length=S.wrap_line_length,this.indent_empty_lines=S.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new h(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}y.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},y.prototype.get_line_number=function(){return this.__lines.length},y.prototype.get_indent_string=function(S,M){return this.__indent_cache.get_indent_string(S,M)},y.prototype.get_indent_size=function(S,M){return this.__indent_cache.get_indent_size(S,M)},y.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},y.prototype.add_new_line=function(S){return this.is_empty()||!S&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},y.prototype.get_code=function(S){this.trim(!0);var M=this.current_line.pop();M&&(M[M.length-1]===`
`&&(M=M.replace(/\n+$/g,"")),this.current_line.push(M)),this._end_with_newline&&this.__add_outputline();var z=this.__lines.join(`
`);return S!==`
`&&(z=z.replace(/[\n]/g,S)),z},y.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},y.prototype.set_indent=function(S,M){return S=S||0,M=M||0,this.next_line.set_indent(S,M),this.__lines.length>1?(this.current_line.set_indent(S,M),!0):(this.current_line.set_indent(),!1)},y.prototype.add_raw_token=function(S){for(var M=0;M<S.newlines;M++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(S.whitespace_before),this.current_line.push(S.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},y.prototype.add_token=function(S){this.__add_space_before_token(),this.current_line.push(S),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},y.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},y.prototype.remove_indent=function(S){for(var M=this.__lines.length;S<M;)this.__lines[S]._remove_indent(),S++;this.current_line._remove_wrap_indent()},y.prototype.trim=function(S){for(S=S===void 0?!1:S,this.current_line.trim();S&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},y.prototype.just_added_newline=function(){return this.current_line.is_empty()},y.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},y.prototype.ensure_empty_line_above=function(S,M){for(var z=this.__lines.length-2;z>=0;){var Y=this.__lines[z];if(Y.is_empty())break;if(Y.item(0).indexOf(S)!==0&&Y.item(-1)!==M){this.__lines.splice(z+1,0,new h(this)),this.previous_line=this.__lines[this.__lines.length-2];break}z--}},D.exports.Output=y},function(D){function h(m,y,S,M){this.type=m,this.text=y,this.comments_before=null,this.newlines=S||0,this.whitespace_before=M||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}D.exports.Token=h},,,function(D){function h(S,M){this.raw_options=m(S,M),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}h.prototype._get_array=function(S,M){var z=this.raw_options[S],Y=M||[];return typeof z=="object"?z!==null&&typeof z.concat=="function"&&(Y=z.concat()):typeof z=="string"&&(Y=z.split(/[^a-zA-Z0-9_\/\-]+/)),Y},h.prototype._get_boolean=function(S,M){var z=this.raw_options[S],Y=z===void 0?!!M:!!z;return Y},h.prototype._get_characters=function(S,M){var z=this.raw_options[S],Y=M||"";return typeof z=="string"&&(Y=z.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),Y},h.prototype._get_number=function(S,M){var z=this.raw_options[S];M=parseInt(M,10),isNaN(M)&&(M=0);var Y=parseInt(z,10);return isNaN(Y)&&(Y=M),Y},h.prototype._get_selection=function(S,M,z){var Y=this._get_selection_list(S,M,z);if(Y.length!==1)throw new Error("Invalid Option Value: The option '"+S+`' can only be one of the following values:
`+M+`
You passed in: '`+this.raw_options[S]+"'");return Y[0]},h.prototype._get_selection_list=function(S,M,z){if(!M||M.length===0)throw new Error("Selection list cannot be empty.");if(z=z||[M[0]],!this._is_valid_selection(z,M))throw new Error("Invalid Default Value!");var Y=this._get_array(S,z);if(!this._is_valid_selection(Y,M))throw new Error("Invalid Option Value: The option '"+S+`' can contain only the following values:
`+M+`
You passed in: '`+this.raw_options[S]+"'");return Y},h.prototype._is_valid_selection=function(S,M){return S.length&&M.length&&!S.some(function(z){return M.indexOf(z)===-1})};function m(S,M){var z={};S=y(S);var Y;for(Y in S)Y!==M&&(z[Y]=S[Y]);if(M&&S[M])for(Y in S[M])z[Y]=S[M][Y];return z}function y(S){var M={},z;for(z in S){var Y=z.replace(/-/g,"_");M[Y]=S[z]}return M}D.exports.Options=h,D.exports.normalizeOpts=y,D.exports.mergeOpts=m},,function(D){var h=RegExp.prototype.hasOwnProperty("sticky");function m(y){this.__input=y||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__input.charAt(this.__position),this.__position+=1),y},m.prototype.peek=function(y){var S=null;return y=y||0,y+=this.__position,y>=0&&y<this.__input_length&&(S=this.__input.charAt(y)),S},m.prototype.__match=function(y,S){y.lastIndex=S;var M=y.exec(this.__input);return M&&!(h&&y.sticky)&&M.index!==S&&(M=null),M},m.prototype.test=function(y,S){return S=S||0,S+=this.__position,S>=0&&S<this.__input_length?!!this.__match(y,S):!1},m.prototype.testChar=function(y,S){var M=this.peek(S);return y.lastIndex=0,M!==null&&y.test(M)},m.prototype.match=function(y){var S=this.__match(y,this.__position);return S?this.__position+=S[0].length:S=null,S},m.prototype.read=function(y,S,M){var z="",Y;return y&&(Y=this.match(y),Y&&(z+=Y[0])),S&&(Y||!y)&&(z+=this.readUntil(S,M)),z},m.prototype.readUntil=function(y,S){var M="",z=this.__position;y.lastIndex=this.__position;var Y=y.exec(this.__input);return Y?(z=Y.index,S&&(z+=Y[0].length)):z=this.__input_length,M=this.__input.substring(this.__position,z),this.__position=z,M},m.prototype.readUntilAfter=function(y){return this.readUntil(y,!0)},m.prototype.get_regexp=function(y,S){var M=null,z="g";return S&&h&&(z="y"),typeof y=="string"&&y!==""?M=new RegExp(y,z):y&&(M=new RegExp(y.source,z)),M},m.prototype.get_literal_regexp=function(y){return RegExp(y.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(y){var S=this.__position,M=this.readUntilAfter(y);return this.__position=S,M},m.prototype.lookBack=function(y){var S=this.__position-1;return S>=y.length&&this.__input.substring(S-y.length,S).toLowerCase()===y},D.exports.InputScanner=m},function(D,h,m){var y=m(8).InputScanner,S=m(3).Token,M=m(10).TokenStream,z=m(11).WhitespacePattern,Y={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},L=function(O,T){this._input=new y(O),this._options=T||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new z(this._input)};L.prototype.tokenize=function(){this._input.restart(),this.__tokens=new M,this._reset();for(var O,T=new S(Y.START,""),R=null,se=[],ae=new M;T.type!==Y.EOF;){for(O=this._get_next_token(T,R);this._is_comment(O);)ae.add(O),O=this._get_next_token(T,R);ae.isEmpty()||(O.comments_before=ae,ae=new M),O.parent=R,this._is_opening(O)?(se.push(R),R=O):R&&this._is_closing(O,R)&&(O.opened=R,R.closed=O,R=se.pop(),O.parent=R),O.previous=T,T.next=O,this.__tokens.add(O),T=O}return this.__tokens},L.prototype._is_first_token=function(){return this.__tokens.isEmpty()},L.prototype._reset=function(){},L.prototype._get_next_token=function(O,T){this._readWhitespace();var R=this._input.read(/.+/g);return R?this._create_token(Y.RAW,R):this._create_token(Y.EOF,"")},L.prototype._is_comment=function(O){return!1},L.prototype._is_opening=function(O){return!1},L.prototype._is_closing=function(O,T){return!1},L.prototype._create_token=function(O,T){var R=new S(O,T,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return R},L.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},D.exports.Tokenizer=L,D.exports.TOKEN=Y},function(D){function h(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}h.prototype.restart=function(){this.__position=0},h.prototype.isEmpty=function(){return this.__tokens_length===0},h.prototype.hasNext=function(){return this.__position<this.__tokens_length},h.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},h.prototype.peek=function(m){var y=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(y=this.__tokens[m]),y},h.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},D.exports.TokenStream=h},function(D,h,m){var y=m(12).Pattern;function S(M,z){y.call(this,M,z),z?this._line_regexp=this._input.get_regexp(z._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}S.prototype=new y,S.prototype.__set_whitespace_patterns=function(M,z){M+="\\t ",z+="\\n\\r",this._match_pattern=this._input.get_regexp("["+M+z+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+z+"]")},S.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var M=this._input.read(this._match_pattern);if(M===" ")this.whitespace_before_token=" ";else if(M){var z=this.__split(this._newline_regexp,M);this.newline_count=z.length-1,this.whitespace_before_token=z[this.newline_count]}return M},S.prototype.matching=function(M,z){var Y=this._create();return Y.__set_whitespace_patterns(M,z),Y._update(),Y},S.prototype._create=function(){return new S(this._input,this)},S.prototype.__split=function(M,z){M.lastIndex=0;for(var Y=0,L=[],O=M.exec(z);O;)L.push(z.substring(Y,O.index)),Y=O.index+O[0].length,O=M.exec(z);return Y<z.length?L.push(z.substring(Y,z.length)):L.push(""),L},D.exports.WhitespacePattern=S},function(D){function h(m,y){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,y&&(this._starting_pattern=this._input.get_regexp(y._starting_pattern,!0),this._match_pattern=this._input.get_regexp(y._match_pattern,!0),this._until_pattern=this._input.get_regexp(y._until_pattern),this._until_after=y._until_after)}h.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},h.prototype.read_match=function(){return this._input.match(this._match_pattern)},h.prototype.until_after=function(m){var y=this._create();return y._until_after=!0,y._until_pattern=this._input.get_regexp(m),y._update(),y},h.prototype.until=function(m){var y=this._create();return y._until_after=!1,y._until_pattern=this._input.get_regexp(m),y._update(),y},h.prototype.starting_with=function(m){var y=this._create();return y._starting_pattern=this._input.get_regexp(m,!0),y._update(),y},h.prototype.matching=function(m){var y=this._create();return y._match_pattern=this._input.get_regexp(m,!0),y._update(),y},h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){},D.exports.Pattern=h},function(D){function h(m,y){m=typeof m=="string"?m:m.source,y=typeof y=="string"?y:y.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+y,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+y,"g")}h.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var y={};this.__directive_pattern.lastIndex=0;for(var S=this.__directive_pattern.exec(m);S;)y[S[1]]=S[2],S=this.__directive_pattern.exec(m);return y},h.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},D.exports.Directives=h},function(D,h,m){var y=m(12).Pattern,S={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function M(z,Y){y.call(this,z,Y),this.__template_pattern=null,this._disabled=Object.assign({},S),this._excluded=Object.assign({},S),Y&&(this.__template_pattern=this._input.get_regexp(Y.__template_pattern),this._excluded=Object.assign(this._excluded,Y._excluded),this._disabled=Object.assign(this._disabled,Y._disabled));var L=new y(z);this.__patterns={handlebars_comment:L.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:L.starting_with(/{{{/).until_after(/}}}/),handlebars:L.starting_with(/{{/).until_after(/}}/),php:L.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:L.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:L.starting_with(/{%/).until_after(/%}/),django_value:L.starting_with(/{{/).until_after(/}}/),django_comment:L.starting_with(/{#/).until_after(/#}/),smarty:L.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:L.starting_with(/{\*/).until_after(/\*}/),smarty_literal:L.starting_with(/{literal}/).until_after(/{\/literal}/)}}M.prototype=new y,M.prototype._create=function(){return new M(this._input,this)},M.prototype._update=function(){this.__set_templated_pattern()},M.prototype.disable=function(z){var Y=this._create();return Y._disabled[z]=!0,Y._update(),Y},M.prototype.read_options=function(z){var Y=this._create();for(var L in S)Y._disabled[L]=z.templating.indexOf(L)===-1;return Y._update(),Y},M.prototype.exclude=function(z){var Y=this._create();return Y._excluded[z]=!0,Y._update(),Y},M.prototype.read=function(){var z="";this._match_pattern?z=this._input.read(this._starting_pattern):z=this._input.read(this._starting_pattern,this.__template_pattern);for(var Y=this._read_template();Y;)this._match_pattern?Y+=this._input.read(this._match_pattern):Y+=this._input.readUntil(this.__template_pattern),z+=Y,Y=this._read_template();return this._until_after&&(z+=this._input.readUntilAfter(this._until_pattern)),z},M.prototype.__set_templated_pattern=function(){var z=[];this._disabled.php||z.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||z.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||z.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||z.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(z.push(this.__patterns.django._starting_pattern.source),z.push(this.__patterns.django_value._starting_pattern.source),z.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||z.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&z.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+z.join("|")+")")},M.prototype._read_template=function(){var z="",Y=this._input.peek();if(Y==="<"){var L=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&L==="?"&&(z=z||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&L==="%"&&(z=z||this.__patterns.erb.read())}else Y==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(z=z||this.__patterns.handlebars_comment.read(),z=z||this.__patterns.handlebars_unescaped.read(),z=z||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(z=z||this.__patterns.django_value.read()),this._excluded.django||(z=z||this.__patterns.django_comment.read(),z=z||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(z=z||this.__patterns.smarty_comment.read(),z=z||this.__patterns.smarty_literal.read(),z=z||this.__patterns.smarty.read()));return z},D.exports.TemplatablePattern=M},,,,function(D,h,m){var y=m(19).Beautifier,S=m(20).Options;function M(z,Y,L,O){var T=new y(z,Y,L,O);return T.beautify()}D.exports=M,D.exports.defaultOptions=function(){return new S}},function(D,h,m){var y=m(20).Options,S=m(2).Output,M=m(21).Tokenizer,z=m(21).TOKEN,Y=/\r\n|[\r\n]/,L=/\r\n|[\r\n]/g,O=function(Q,P){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=Q.max_preserve_newlines,this.preserve_newlines=Q.preserve_newlines,this._output=new S(Q,P)};O.prototype.current_line_has_match=function(Q){return this._output.current_line.has_match(Q)},O.prototype.set_space_before_token=function(Q,P){this._output.space_before_token=Q,this._output.non_breaking_space=P},O.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},O.prototype.add_raw_token=function(Q){this._output.add_raw_token(Q)},O.prototype.print_preserved_newlines=function(Q){var P=0;Q.type!==z.TEXT&&Q.previous.type!==z.TEXT&&(P=Q.newlines?1:0),this.preserve_newlines&&(P=Q.newlines<this.max_preserve_newlines+1?Q.newlines:this.max_preserve_newlines+1);for(var j=0;j<P;j++)this.print_newline(j>0);return P!==0},O.prototype.traverse_whitespace=function(Q){return Q.whitespace_before||Q.newlines?(this.print_preserved_newlines(Q)||(this._output.space_before_token=!0),!0):!1},O.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},O.prototype.print_newline=function(Q){this._output.add_new_line(Q)},O.prototype.print_token=function(Q){Q.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(Q.text))},O.prototype.indent=function(){this.indent_level++},O.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},O.prototype.get_full_indent=function(Q){return Q=this.indent_level+(Q||0),Q<1?"":this._output.get_indent_string(Q)};var T=function(Q){for(var P=null,j=Q.next;j.type!==z.EOF&&Q.closed!==j;){if(j.type===z.ATTRIBUTE&&j.text==="type"){j.next&&j.next.type===z.EQUALS&&j.next.next&&j.next.next.type===z.VALUE&&(P=j.next.next.text);break}j=j.next}return P},R=function(Q,P){var j=null,X=null;return P.closed?(Q==="script"?j="text/javascript":Q==="style"&&(j="text/css"),j=T(P)||j,j.search("text/css")>-1?X="css":j.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?X="javascript":j.search(/(text|application|dojo)\/(x-)?(html)/)>-1?X="html":j.search(/test\/null/)>-1&&(X="null"),X):null};function se(Q,P){return P.indexOf(Q)!==-1}function ae(Q,P,j){this.parent=Q||null,this.tag=P?P.tag_name:"",this.indent_level=j||0,this.parser_token=P||null}function q(Q){this._printer=Q,this._current_frame=null}q.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},q.prototype.record_tag=function(Q){var P=new ae(this._current_frame,Q,this._printer.indent_level);this._current_frame=P},q.prototype._try_pop_frame=function(Q){var P=null;return Q&&(P=Q.parser_token,this._printer.indent_level=Q.indent_level,this._current_frame=Q.parent),P},q.prototype._get_frame=function(Q,P){for(var j=this._current_frame;j&&Q.indexOf(j.tag)===-1;){if(P&&P.indexOf(j.tag)!==-1){j=null;break}j=j.parent}return j},q.prototype.try_pop=function(Q,P){var j=this._get_frame([Q],P);return this._try_pop_frame(j)},q.prototype.indent_to_tag=function(Q){var P=this._get_frame(Q);P&&(this._printer.indent_level=P.indent_level)};function he(Q,P,j,X){this._source_text=Q||"",P=P||{},this._js_beautify=j,this._css_beautify=X,this._tag_stack=null;var ne=new y(P,"html");this._options=ne,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"}he.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var Q=this._source_text,P=this._options.eol;this._options.eol==="auto"&&(P=`
`,Q&&Y.test(Q)&&(P=Q.match(Y)[0])),Q=Q.replace(L,`
`);var j=Q.match(/^[\t ]*/)[0],X={text:"",type:""},ne=new ve(this._options),J=new O(this._options,j),v=new M(Q,this._options).tokenize();this._tag_stack=new q(J);for(var g=null,U=v.next();U.type!==z.EOF;)U.type===z.TAG_OPEN||U.type===z.COMMENT?(g=this._handle_tag_open(J,U,ne,X,v),ne=g):U.type===z.ATTRIBUTE||U.type===z.EQUALS||U.type===z.VALUE||U.type===z.TEXT&&!ne.tag_complete?g=this._handle_inside_tag(J,U,ne,X):U.type===z.TAG_CLOSE?g=this._handle_tag_close(J,U,ne):U.type===z.TEXT?g=this._handle_text(J,U,ne):U.type===z.CONTROL_FLOW_OPEN?g=this._handle_control_flow_open(J,U):U.type===z.CONTROL_FLOW_CLOSE?g=this._handle_control_flow_close(J,U):J.add_raw_token(U),X=g,U=v.next();var ie=J._output.get_code(P);return ie},he.prototype._handle_control_flow_open=function(Q,P){var j={text:P.text,type:P.type};return Q.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),P.newlines?Q.print_preserved_newlines(P):Q.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),Q.print_token(P),Q.indent(),j},he.prototype._handle_control_flow_close=function(Q,P){var j={text:P.text,type:P.type};return Q.deindent(),P.newlines?Q.print_preserved_newlines(P):Q.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),Q.print_token(P),j},he.prototype._handle_tag_close=function(Q,P,j){var X={text:P.text,type:P.type};return Q.alignment_size=0,j.tag_complete=!0,Q.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),j.is_unformatted?Q.add_raw_token(P):(j.tag_start_char==="<"&&(Q.set_space_before_token(P.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&j.has_wrapped_attrs&&Q.print_newline(!1)),Q.print_token(P)),j.indent_content&&!(j.is_unformatted||j.is_content_unformatted)&&(Q.indent(),j.indent_content=!1),!j.is_inline_element&&!(j.is_unformatted||j.is_content_unformatted)&&Q.set_wrap_point(),X},he.prototype._handle_inside_tag=function(Q,P,j,X){var ne=j.has_wrapped_attrs,J={text:P.text,type:P.type};return Q.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),j.is_unformatted?Q.add_raw_token(P):j.tag_start_char==="{"&&P.type===z.TEXT?Q.print_preserved_newlines(P)?(P.newlines=0,Q.add_raw_token(P)):Q.print_token(P):(P.type===z.ATTRIBUTE?Q.set_space_before_token(!0):(P.type===z.EQUALS||P.type===z.VALUE&&P.previous.type===z.EQUALS)&&Q.set_space_before_token(!1),P.type===z.ATTRIBUTE&&j.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(Q.traverse_whitespace(P),ne=ne||P.newlines!==0),this._is_wrap_attributes_force&&j.attr_count>=this._options.wrap_attributes_min_attrs&&(X.type!==z.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(Q.print_newline(!1),ne=!0)),Q.print_token(P),ne=ne||Q.previous_token_wrapped(),j.has_wrapped_attrs=ne),J},he.prototype._handle_text=function(Q,P,j){var X={text:P.text,type:"TK_CONTENT"};return j.custom_beautifier_name?this._print_custom_beatifier_text(Q,P,j):j.is_unformatted||j.is_content_unformatted?Q.add_raw_token(P):(Q.traverse_whitespace(P),Q.print_token(P)),X},he.prototype._print_custom_beatifier_text=function(Q,P,j){var X=this;if(P.text!==""){var ne=P.text,J,v=1,g="",U="";j.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?J=this._js_beautify:j.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?J=this._css_beautify:j.custom_beautifier_name==="html"&&(J=function(At,_t){var xe=new he(At,_t,X._js_beautify,X._css_beautify);return xe.beautify()}),this._options.indent_scripts==="keep"?v=0:this._options.indent_scripts==="separate"&&(v=-Q.indent_level);var ie=Q.get_full_indent(v);if(ne=ne.replace(/\n[ \t]*$/,""),j.custom_beautifier_name!=="html"&&ne[0]==="<"&&ne.match(/^(<!--|<!\[CDATA\[)/)){var Be=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(ne);if(!Be){Q.add_raw_token(P);return}g=ie+Be[1]+`
`,ne=Be[4],Be[5]&&(U=ie+Be[5]),ne=ne.replace(/\n[ \t]*$/,""),(Be[2]||Be[3].indexOf(`
`)!==-1)&&(Be=Be[3].match(/[ \t]+$/),Be&&(P.whitespace_before=Be[0]))}if(ne)if(J){var Ze=function(){this.eol=`
`};Ze.prototype=this._options.raw_options;var Qe=new Ze;ne=J(ie+ne,Qe)}else{var nt=P.whitespace_before;nt&&(ne=ne.replace(new RegExp(`
(`+nt+")?","g"),`
`)),ne=ie+ne.replace(/\n/g,`
`+ie)}g&&(ne?ne=g+ne+`
`+U:ne=g+U),Q.print_newline(!1),ne&&(P.text=ne,P.whitespace_before="",P.newlines=0,Q.add_raw_token(P),Q.print_newline(!0))}},he.prototype._handle_tag_open=function(Q,P,j,X,ne){var J=this._get_tag_open_token(P);if((j.is_unformatted||j.is_content_unformatted)&&!j.is_empty_element&&P.type===z.TAG_OPEN&&!J.is_start_tag?(Q.add_raw_token(P),J.start_tag_token=this._tag_stack.try_pop(J.tag_name)):(Q.traverse_whitespace(P),this._set_tag_position(Q,P,J,j,X),J.is_inline_element||Q.set_wrap_point(),Q.print_token(P)),J.is_start_tag&&this._is_wrap_attributes_force){var v=0,g;do g=ne.peek(v),g.type===z.ATTRIBUTE&&(J.attr_count+=1),v+=1;while(g.type!==z.EOF&&g.type!==z.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(J.alignment_size=P.text.length+1),!J.tag_complete&&!J.is_unformatted&&(Q.alignment_size=J.alignment_size),J};var ve=function(Q,P,j){if(this.parent=P||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="",!j)this.tag_complete=!0;else{var X;this.tag_start_char=j.text[0],this.text=j.text,this.tag_start_char==="<"?(X=j.text.match(/^<([^\s>]*)/),this.tag_check=X?X[1]:""):(X=j.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=X?X[1]:"",(j.text.startsWith("{{#>")||j.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&j.next!==null?this.tag_check=j.next.text.split(" ")[0]:this.tag_check=j.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),j.type===z.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||j.closed&&j.closed.text==="/>";var ne=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(ne=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!Q.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(ne)))}};he.prototype._get_tag_open_token=function(Q){var P=new ve(this._options,this._tag_stack.get_parser_token(),Q);return P.alignment_size=this._options.wrap_attributes_indent_size,P.is_end_tag=P.is_end_tag||se(P.tag_check,this._options.void_elements),P.is_empty_element=P.tag_complete||P.is_start_tag&&P.is_end_tag,P.is_unformatted=!P.tag_complete&&se(P.tag_check,this._options.unformatted),P.is_content_unformatted=!P.is_empty_element&&se(P.tag_check,this._options.content_unformatted),P.is_inline_element=se(P.tag_name,this._options.inline)||this._options.inline_custom_elements&&P.tag_name.includes("-")||P.tag_start_char==="{",P},he.prototype._set_tag_position=function(Q,P,j,X,ne){if(j.is_empty_element||(j.is_end_tag?j.start_tag_token=this._tag_stack.try_pop(j.tag_name):(this._do_optional_end_element(j)&&(j.is_inline_element||Q.print_newline(!1)),this._tag_stack.record_tag(j),(j.tag_name==="script"||j.tag_name==="style")&&!(j.is_unformatted||j.is_content_unformatted)&&(j.custom_beautifier_name=R(j.tag_check,P)))),se(j.tag_check,this._options.extra_liners)&&(Q.print_newline(!1),Q._output.just_added_blankline()||Q.print_newline(!0)),j.is_empty_element){if(j.tag_start_char==="{"&&j.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),j.indent_content=!0;var J=Q.current_line_has_match(/{{#if/);J||Q.print_newline(!1)}j.tag_name==="!--"&&ne.type===z.TAG_CLOSE&&X.is_end_tag&&j.text.indexOf(`
`)===-1||(j.is_inline_element||j.is_unformatted||Q.print_newline(!1),this._calcluate_parent_multiline(Q,j))}else if(j.is_end_tag){var v=!1;v=j.start_tag_token&&j.start_tag_token.multiline_content,v=v||!j.is_inline_element&&!(X.is_inline_element||X.is_unformatted)&&!(ne.type===z.TAG_CLOSE&&j.start_tag_token===X)&&ne.type!=="TK_CONTENT",(j.is_content_unformatted||j.is_unformatted)&&(v=!1),v&&Q.print_newline(!1)}else j.indent_content=!j.custom_beautifier_name,j.tag_start_char==="<"&&(j.tag_name==="html"?j.indent_content=this._options.indent_inner_html:j.tag_name==="head"?j.indent_content=this._options.indent_head_inner_html:j.tag_name==="body"&&(j.indent_content=this._options.indent_body_inner_html)),!(j.is_inline_element||j.is_unformatted)&&(ne.type!=="TK_CONTENT"||j.is_content_unformatted)&&Q.print_newline(!1),this._calcluate_parent_multiline(Q,j)},he.prototype._calcluate_parent_multiline=function(Q,P){P.parent&&Q._output.just_added_newline()&&!((P.is_inline_element||P.is_unformatted)&&P.parent.is_inline_element)&&(P.parent.multiline_content=!0)};var be=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],Oe=["a","audio","del","ins","map","noscript","video"];he.prototype._do_optional_end_element=function(Q){var P=null;if(!(Q.is_empty_element||!Q.is_start_tag||!Q.parent)){if(Q.tag_name==="body")P=P||this._tag_stack.try_pop("head");else if(Q.tag_name==="li")P=P||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(Q.tag_name==="dd"||Q.tag_name==="dt")P=P||this._tag_stack.try_pop("dt",["dl"]),P=P||this._tag_stack.try_pop("dd",["dl"]);else if(Q.parent.tag_name==="p"&&be.indexOf(Q.tag_name)!==-1){var j=Q.parent.parent;(!j||Oe.indexOf(j.tag_name)===-1)&&(P=P||this._tag_stack.try_pop("p"))}else Q.tag_name==="rp"||Q.tag_name==="rt"?(P=P||this._tag_stack.try_pop("rt",["ruby","rtc"]),P=P||this._tag_stack.try_pop("rp",["ruby","rtc"])):Q.tag_name==="optgroup"?P=P||this._tag_stack.try_pop("optgroup",["select"]):Q.tag_name==="option"?P=P||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):Q.tag_name==="colgroup"?P=P||this._tag_stack.try_pop("caption",["table"]):Q.tag_name==="thead"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"])):Q.tag_name==="tbody"||Q.tag_name==="tfoot"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"]),P=P||this._tag_stack.try_pop("thead",["table"]),P=P||this._tag_stack.try_pop("tbody",["table"])):Q.tag_name==="tr"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"]),P=P||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(Q.tag_name==="th"||Q.tag_name==="td")&&(P=P||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),P=P||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return Q.parent=this._tag_stack.get_parser_token(),P}},D.exports.Beautifier=he},function(D,h,m){var y=m(6).Options;function S(M){y.call(this,M,"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"])}S.prototype=new y,D.exports.Options=S},function(D,h,m){var y=m(9).Tokenizer,S=m(9).TOKEN,M=m(13).Directives,z=m(14).TemplatablePattern,Y=m(12).Pattern,L={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:S.START,RAW:S.RAW,EOF:S.EOF},O=new M(/<\!--/,/-->/),T=function(R,se){y.call(this,R,se),this._current_tag_name="";var ae=new z(this._input).read_options(this._options),q=new Y(this._input);if(this.__patterns={word:ae.until(/[\n\r\t <]/),word_control_flow_close_excluded:ae.until(/[\n\r\t <}]/),single_quote:ae.until_after(/'/),double_quote:ae.until_after(/"/),attribute:ae.until(/[\n\r\t =>]|\/>/),element_name:ae.until(/[\n\r\t >\/]/),angular_control_flow_start:q.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:q.starting_with(/{{!--/).until_after(/--}}/),handlebars:q.starting_with(/{{/).until_after(/}}/),handlebars_open:q.until(/[\n\r\t }]/),handlebars_raw_close:q.until(/}}/),comment:q.starting_with(/<!--/).until_after(/-->/),cdata:q.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:q.starting_with(/<!\[/).until_after(/]>/),processing:q.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 he=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=q.matching(he).until_after(he)}};T.prototype=new y,T.prototype._is_comment=function(R){return!1},T.prototype._is_opening=function(R){return R.type===L.TAG_OPEN||R.type===L.CONTROL_FLOW_OPEN},T.prototype._is_closing=function(R,se){return R.type===L.TAG_CLOSE&&se&&((R.text===">"||R.text==="/>")&&se.text[0]==="<"||R.text==="}}"&&se.text[0]==="{"&&se.text[1]==="{")||R.type===L.CONTROL_FLOW_CLOSE&&R.text==="}"&&se.text.endsWith("{")},T.prototype._reset=function(){this._current_tag_name=""},T.prototype._get_next_token=function(R,se){var ae=null;this._readWhitespace();var q=this._input.peek();return q===null?this._create_token(L.EOF,""):(ae=ae||this._read_open_handlebars(q,se),ae=ae||this._read_attribute(q,R,se),ae=ae||this._read_close(q,se),ae=ae||this._read_script_and_style(q,R),ae=ae||this._read_control_flows(q,se),ae=ae||this._read_raw_content(q,R,se),ae=ae||this._read_content_word(q,se),ae=ae||this._read_comment_or_cdata(q),ae=ae||this._read_processing(q),ae=ae||this._read_open(q,se),ae=ae||this._create_token(L.UNKNOWN,this._input.next()),ae)},T.prototype._read_comment_or_cdata=function(R){var se=null,ae=null,q=null;if(R==="<"){var he=this._input.peek(1);he==="!"&&(ae=this.__patterns.comment.read(),ae?(q=O.get_directives(ae),q&&q.ignore==="start"&&(ae+=O.readIgnored(this._input))):ae=this.__patterns.cdata.read()),ae&&(se=this._create_token(L.COMMENT,ae),se.directives=q)}return se},T.prototype._read_processing=function(R){var se=null,ae=null,q=null;if(R==="<"){var he=this._input.peek(1);(he==="!"||he==="?")&&(ae=this.__patterns.conditional_comment.read(),ae=ae||this.__patterns.processing.read()),ae&&(se=this._create_token(L.COMMENT,ae),se.directives=q)}return se},T.prototype._read_open=function(R,se){var ae=null,q=null;return(!se||se.type===L.CONTROL_FLOW_OPEN)&&R==="<"&&(ae=this._input.next(),this._input.peek()==="/"&&(ae+=this._input.next()),ae+=this.__patterns.element_name.read(),q=this._create_token(L.TAG_OPEN,ae)),q},T.prototype._read_open_handlebars=function(R,se){var ae=null,q=null;return(!se||se.type===L.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&R==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(ae=this.__patterns.handlebars_comment.read(),ae=ae||this.__patterns.handlebars.read(),q=this._create_token(L.COMMENT,ae)):(ae=this.__patterns.handlebars_open.read(),q=this._create_token(L.TAG_OPEN,ae))),q},T.prototype._read_control_flows=function(R,se){var ae="",q=null;if(!this._options.templating.includes("angular"))return q;if(R==="@"){if(ae=this.__patterns.angular_control_flow_start.read(),ae==="")return q;for(var he=ae.endsWith("(")?1:0,ve=0;!(ae.endsWith("{")&&he===ve);){var be=this._input.next();if(be===null)break;be==="("?he++:be===")"&&ve++,ae+=be}q=this._create_token(L.CONTROL_FLOW_OPEN,ae)}else R==="}"&&se&&se.type===L.CONTROL_FLOW_OPEN&&(ae=this._input.next(),q=this._create_token(L.CONTROL_FLOW_CLOSE,ae));return q},T.prototype._read_close=function(R,se){var ae=null,q=null;return se&&se.type===L.TAG_OPEN&&(se.text[0]==="<"&&(R===">"||R==="/"&&this._input.peek(1)===">")?(ae=this._input.next(),R==="/"&&(ae+=this._input.next()),q=this._create_token(L.TAG_CLOSE,ae)):se.text[0]==="{"&&R==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),q=this._create_token(L.TAG_CLOSE,"}}"))),q},T.prototype._read_attribute=function(R,se,ae){var q=null,he="";if(ae&&ae.text[0]==="<")if(R==="=")q=this._create_token(L.EQUALS,this._input.next());else if(R==='"'||R==="'"){var ve=this._input.next();R==='"'?ve+=this.__patterns.double_quote.read():ve+=this.__patterns.single_quote.read(),q=this._create_token(L.VALUE,ve)}else he=this.__patterns.attribute.read(),he&&(se.type===L.EQUALS?q=this._create_token(L.VALUE,he):q=this._create_token(L.ATTRIBUTE,he));return q},T.prototype._is_content_unformatted=function(R){return this._options.void_elements.indexOf(R)===-1&&(this._options.content_unformatted.indexOf(R)!==-1||this._options.unformatted.indexOf(R)!==-1)},T.prototype._read_raw_content=function(R,se,ae){var q="";if(ae&&ae.text[0]==="{")q=this.__patterns.handlebars_raw_close.read();else if(se.type===L.TAG_CLOSE&&se.opened.text[0]==="<"&&se.text[0]!=="/"){var he=se.opened.text.substr(1).toLowerCase();this._is_content_unformatted(he)&&(q=this._input.readUntil(new RegExp("</"+he+"[\\n\\r\\t ]*?>","ig")))}return q?this._create_token(L.TEXT,q):null},T.prototype._read_script_and_style=function(R,se){if(se.type===L.TAG_CLOSE&&se.opened.text[0]==="<"&&se.text[0]!=="/"){var ae=se.opened.text.substr(1).toLowerCase();if(ae==="script"||ae==="style"){var q=this._read_comment_or_cdata(R);if(q)return q.type=L.TEXT,q;var he=this._input.readUntil(new RegExp("</"+ae+"[\\n\\r\\t ]*?>","ig"));if(he)return this._create_token(L.TEXT,he)}}return null},T.prototype._read_content_word=function(R,se){var ae="";return this._options.unformatted_content_delimiter&&R===this._options.unformatted_content_delimiter[0]&&(ae=this.__patterns.unformatted_content_delimiter.read()),ae||(ae=se&&se.type===L.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),ae?this._create_token(L.TEXT,ae):null},D.exports.Tokenizer=T,D.exports.TOKEN=L}],ce={};function o(D){var h=ce[D];if(h!==void 0)return h.exports;var m=ce[D]={exports:{}};return me[D](m,m.exports,o),m.exports}var x=o(18);Te=x})();var fe=Te;if(1)k=[A,A(58553),A(87804)],pe=function(me){var ce=A(58553),o=A(87804);return{html_beautify:function(x,D){return fe(x,D,ce.js_beautify,o.css_beautify)}}}.apply(Et,k),pe!==void 0&&(vn.exports=pe);else var $,p})()},58553:function(vn,Et){var A,k;(function(){var pe;(function(){"use strict";var fe=[function(ce,o,x){var D=x(1).Beautifier,h=x(5).Options;function m(y,S){var M=new D(y,S);return M.beautify()}ce.exports=m,ce.exports.defaultOptions=function(){return new h}},function(ce,o,x){var D=x(2).Output,h=x(3).Token,m=x(4),y=x(5).Options,S=x(7).Tokenizer,M=x(7).line_starters,z=x(7).positionable_operators,Y=x(7).TOKEN;function L(g,U){return U.indexOf(g)!==-1}function O(g){return g.replace(/^\s+/g,"")}function T(g){for(var U={},ie=0;ie<g.length;ie++)U[g[ie].replace(/-/g,"_")]=g[ie];return U}function R(g,U){return g&&g.type===Y.RESERVED&&g.text===U}function se(g,U){return g&&g.type===Y.RESERVED&&L(g.text,U)}var ae=["case","return","do","if","throw","else","await","break","continue","async"],q=["before-newline","after-newline","preserve-newline"],he=T(q),ve=[he.before_newline,he.preserve_newline],be={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function Oe(g,U){U.multiline_frame||U.mode===be.ForInitializer||U.mode===be.Conditional||g.remove_indent(U.start_line_index)}function Q(g){g=g.replace(m.allLineBreaks,`
`);for(var U=[],ie=g.indexOf(`
`);ie!==-1;)U.push(g.substring(0,ie)),g=g.substring(ie+1),ie=g.indexOf(`
`);return g.length&&U.push(g),U}function P(g){return g===be.ArrayLiteral}function j(g){return L(g,[be.Expression,be.ForInitializer,be.Conditional])}function X(g,U){for(var ie=0;ie<g.length;ie++){var Be=g[ie].trim();if(Be.charAt(0)!==U)return!1}return!0}function ne(g,U){for(var ie=0,Be=g.length,Ze;ie<Be;ie++)if(Ze=g[ie],Ze&&Ze.indexOf(U)!==0)return!1;return!0}function J(g,U){U=U||{},this._source_text=g||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new y(U)}J.prototype.create_flags=function(g,U){var ie=0;g&&(ie=g.indentation_level,!this._output.just_added_newline()&&g.line_indent_level>ie&&(ie=g.line_indent_level));var Be={mode:U,parent:g,last_token:g?g.last_token:new h(Y.START_BLOCK,""),last_word:g?g.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:ie,alignment:0,line_indent_level:g?g.line_indent_level:ie,start_line_index:this._output.get_line_number(),ternary_depth:0};return Be},J.prototype._reset=function(g){var U=g.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new D(this._options,U),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(be.BlockStatement);var ie=new S(g,this._options);return this._tokens=ie.tokenize(),g},J.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g,U=this._reset(this._source_text),ie=this._options.eol;this._options.eol==="auto"&&(ie=`
`,U&&m.lineBreak.test(U||"")&&(ie=U.match(m.lineBreak)[0]));for(var Be=this._tokens.next();Be;)this.handle_token(Be),this._last_last_text=this._flags.last_token.text,this._flags.last_token=Be,Be=this._tokens.next();return g=this._output.get_code(ie),g},J.prototype.handle_token=function(g,U){g.type===Y.START_EXPR?this.handle_start_expr(g):g.type===Y.END_EXPR?this.handle_end_expr(g):g.type===Y.START_BLOCK?this.handle_start_block(g):g.type===Y.END_BLOCK?this.handle_end_block(g):g.type===Y.WORD?this.handle_word(g):g.type===Y.RESERVED?this.handle_word(g):g.type===Y.SEMICOLON?this.handle_semicolon(g):g.type===Y.STRING?this.handle_string(g):g.type===Y.EQUALS?this.handle_equals(g):g.type===Y.OPERATOR?this.handle_operator(g):g.type===Y.COMMA?this.handle_comma(g):g.type===Y.BLOCK_COMMENT?this.handle_block_comment(g,U):g.type===Y.COMMENT?this.handle_comment(g,U):g.type===Y.DOT?this.handle_dot(g):g.type===Y.EOF?this.handle_eof(g):g.type===Y.UNKNOWN?this.handle_unknown(g,U):this.handle_unknown(g,U)},J.prototype.handle_whitespace_and_comments=function(g,U){var ie=g.newlines,Be=this._options.keep_array_indentation&&P(this._flags.mode);if(g.comments_before)for(var Ze=g.comments_before.next();Ze;)this.handle_whitespace_and_comments(Ze,U),this.handle_token(Ze,U),Ze=g.comments_before.next();if(Be)for(var Qe=0;Qe<ie;Qe+=1)this.print_newline(Qe>0,U);else if(this._options.max_preserve_newlines&&ie>this._options.max_preserve_newlines&&(ie=this._options.max_preserve_newlines),this._options.preserve_newlines&&ie>1){this.print_newline(!1,U);for(var nt=1;nt<ie;nt+=1)this.print_newline(!0,U)}};var v=["async","break","continue","return","throw","yield"];J.prototype.allow_wrap_or_preserved_newline=function(g,U){if(U=U===void 0?!1:U,!this._output.just_added_newline()){var ie=this._options.preserve_newlines&&g.newlines||U,Be=L(this._flags.last_token.text,z)||L(g.text,z);if(Be){var Ze=L(this._flags.last_token.text,z)&&L(this._options.operator_position,ve)||L(g.text,z);ie=ie&&Ze}if(ie)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(se(this._flags.last_token,v))return;this._output.set_wrap_point()}}},J.prototype.print_newline=function(g,U){if(!U&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==Y.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var ie=this._tokens.peek();this._flags.mode===be.Statement&&!(this._flags.if_block&&R(ie,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(g)&&(this._flags.multiline_frame=!0)},J.prototype.print_token_line_indentation=function(g){this._output.just_added_newline()&&(this._options.keep_array_indentation&&g.newlines&&(g.text==="["||P(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(g.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))},J.prototype.print_token=function(g){if(this._output.raw){this._output.add_raw_token(g);return}if(this._options.comma_first&&g.previous&&g.previous.type===Y.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var U=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(U),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(g),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(g),this._output.non_breaking_space=!0,this._output.add_token(g.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},J.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},J.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))},J.prototype.set_mode=function(g){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,g),this._flags=this.create_flags(this._previous_flags,g),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},J.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===be.Statement&&Oe(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},J.prototype.start_of_object_property=function(){return this._flags.parent.mode===be.ObjectLiteral&&this._flags.mode===be.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||se(this._flags.last_token,["get","set"]))},J.prototype.start_of_statement=function(g){var U=!1;return U=U||se(this._flags.last_token,["var","let","const"])&&g.type===Y.WORD,U=U||R(this._flags.last_token,"do"),U=U||!(this._flags.parent.mode===be.ObjectLiteral&&this._flags.mode===be.Statement)&&se(this._flags.last_token,v)&&!g.newlines,U=U||R(this._flags.last_token,"else")&&!(R(g,"if")&&!g.comments_before),U=U||this._flags.last_token.type===Y.END_EXPR&&(this._previous_flags.mode===be.ForInitializer||this._previous_flags.mode===be.Conditional),U=U||this._flags.last_token.type===Y.WORD&&this._flags.mode===be.BlockStatement&&!this._flags.in_case&&!(g.text==="--"||g.text==="++")&&this._last_last_text!=="function"&&g.type!==Y.WORD&&g.type!==Y.RESERVED,U=U||this._flags.mode===be.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||se(this._flags.last_token,["get","set"])),U?(this.set_mode(be.Statement),this.indent(),this.handle_whitespace_and_comments(g,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g,se(g,["do","for","if","while"])),!0):!1},J.prototype.handle_start_expr=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g);var U=be.Expression;if(g.text==="["){if(this._flags.last_token.type===Y.WORD||this._flags.last_token.text===")"){se(this._flags.last_token,M)&&(this._output.space_before_token=!0),this.print_token(g),this.set_mode(U),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}U=be.ArrayLiteral,P(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),L(this._flags.last_token.type,[Y.START_EXPR,Y.END_EXPR,Y.WORD,Y.OPERATOR,Y.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===Y.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,U=be.ForInitializer):L(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,U=be.Conditional):L(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&g.whitespace_before===""?this._output.space_before_token=!1:(L(this._flags.last_token.text,M)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===Y.EQUALS||this._flags.last_token.type===Y.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g);else if(this._flags.last_token.type===Y.WORD){this._output.space_before_token=!1;var ie=this._tokens.peek(-3);if(this._options.space_after_named_function&&ie){var Be=this._tokens.peek(-4);se(ie,["async","function"])||ie.text==="*"&&se(Be,["async","function"])?this._output.space_before_token=!0:this._flags.mode===be.ObjectLiteral?(ie.text==="{"||ie.text===","||ie.text==="*"&&(Be.text==="{"||Be.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(g);(this._flags.last_token.type===Y.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(L(this._last_last_text,["function","yield"])||this._flags.mode===be.ObjectLiteral&&L(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===Y.START_BLOCK?this.print_newline():(this._flags.last_token.type===Y.END_EXPR||this._flags.last_token.type===Y.START_EXPR||this._flags.last_token.type===Y.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===Y.COMMA)&&this.allow_wrap_or_preserved_newline(g,g.newlines),this.print_token(g),this.set_mode(U),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},J.prototype.handle_end_expr=function(g){for(;this._flags.mode===be.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(g,g.text==="]"&&P(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===Y.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(g),this.restore_mode(),Oe(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===be.Conditional&&(this._previous_flags.mode=be.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},J.prototype.handle_start_block=function(g){this.handle_whitespace_and_comments(g);var U=this._tokens.peek(),ie=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===Y.END_EXPR?(this.set_mode(be.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(be.BlockStatement):ie&&(L(ie.text,[":",","])&&L(U.type,[Y.STRING,Y.WORD,Y.RESERVED])||L(U.text,["get","set","..."])&&L(ie.type,[Y.WORD,Y.RESERVED]))?L(this._last_last_text,["class","interface"])&&!L(ie.text,[":",","])?this.set_mode(be.BlockStatement):this.set_mode(be.ObjectLiteral):this._flags.last_token.type===Y.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(be.BlockStatement):L(this._flags.last_token.type,[Y.EQUALS,Y.START_EXPR,Y.COMMA,Y.OPERATOR])||se(this._flags.last_token,["return","throw","import","default"])?this.set_mode(be.ObjectLiteral):this.set_mode(be.BlockStatement),this._flags.last_token&&se(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var Be=!U.comments_before&&U.text==="}",Ze=Be&&this._flags.last_word==="function"&&this._flags.last_token.type===Y.END_EXPR;if(this._options.brace_preserve_inline){var Qe=0,nt=null;this._flags.inline_frame=!0;do if(Qe+=1,nt=this._tokens.peek(Qe-1),nt.newlines){this._flags.inline_frame=!1;break}while(nt.type!==Y.EOF&&!(nt.type===Y.END_BLOCK&&nt.opened===g))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==Y.OPERATOR&&(Ze||this._flags.last_token.type===Y.EQUALS||se(this._flags.last_token,ae)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(P(this._previous_flags.mode)&&(this._flags.last_token.type===Y.START_EXPR||this._flags.last_token.type===Y.COMMA)&&((this._flags.last_token.type===Y.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===Y.COMMA||this._flags.last_token.type===Y.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(g),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==Y.OPERATOR&&this._flags.last_token.type!==Y.START_EXPR&&(L(this._flags.last_token.type,[Y.START_BLOCK,Y.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(g),this.indent(),!Be&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},J.prototype.handle_end_block=function(g){for(this.handle_whitespace_and_comments(g);this._flags.mode===be.Statement;)this.restore_mode();var U=this._flags.last_token.type===Y.START_BLOCK;this._flags.inline_frame&&!U?this._output.space_before_token=!0:this._options.brace_style==="expand"?U||this.print_newline():U||(P(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(g)},J.prototype.handle_word=function(g){if(g.type===Y.RESERVED){if(L(g.text,["set","get"])&&this._flags.mode!==be.ObjectLiteral)g.type=Y.WORD;else if(g.text==="import"&&L(this._tokens.peek().text,["(","."]))g.type=Y.WORD;else if(L(g.text,["as","from"])&&!this._flags.import_block)g.type=Y.WORD;else if(this._flags.mode===be.ObjectLiteral){var U=this._tokens.peek();U.text===":"&&(g.type=Y.WORD)}}if(this.start_of_statement(g)?se(this._flags.last_token,["var","let","const"])&&g.type===Y.WORD&&(this._flags.declaration_statement=!0):g.newlines&&!j(this._flags.mode)&&(this._flags.last_token.type!==Y.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==Y.EQUALS&&(this._options.preserve_newlines||!se(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(g),this.print_newline()):this.handle_whitespace_and_comments(g),this._flags.do_block&&!this._flags.do_while)if(R(g,"while")){this._output.space_before_token=!0,this.print_token(g),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&&R(g,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===be.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&se(g,["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(g),this._flags.in_case=!0;return}if((this._flags.last_token.type===Y.COMMA||this._flags.last_token.type===Y.START_EXPR||this._flags.last_token.type===Y.EQUALS||this._flags.last_token.type===Y.OPERATOR)&&!this.start_of_object_property()&&!(L(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===be.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(g),R(g,"function")){(L(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(L(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===Y.OPERATOR))&&!this._output.just_added_blankline()&&!g.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===Y.RESERVED||this._flags.last_token.type===Y.WORD?se(this._flags.last_token,["get","set","new","export"])||se(this._flags.last_token,v)?this._output.space_before_token=!0:R(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===Y.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(j(this._flags.mode)||P(this._flags.mode))||this.print_newline(),this.print_token(g),this._flags.last_word=g.text;return}var ie="NONE";if(this._flags.last_token.type===Y.END_BLOCK?this._previous_flags.inline_frame?ie="SPACE":se(g,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines?ie="NEWLINE":(ie="SPACE",this._output.space_before_token=!0):ie="NEWLINE":this._flags.last_token.type===Y.SEMICOLON&&this._flags.mode===be.BlockStatement?ie="NEWLINE":this._flags.last_token.type===Y.SEMICOLON&&j(this._flags.mode)?ie="SPACE":this._flags.last_token.type===Y.STRING?ie="NEWLINE":this._flags.last_token.type===Y.RESERVED||this._flags.last_token.type===Y.WORD||this._flags.last_token.text==="*"&&(L(this._last_last_text,["function","yield"])||this._flags.mode===be.ObjectLiteral&&L(this._last_last_text,["{",","]))?ie="SPACE":this._flags.last_token.type===Y.START_BLOCK?this._flags.inline_frame?ie="SPACE":ie="NEWLINE":this._flags.last_token.type===Y.END_EXPR&&(this._output.space_before_token=!0,ie="NEWLINE"),se(g,M)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?ie="SPACE":ie="NEWLINE"),se(g,["else","catch","finally"]))if((!(this._flags.last_token.type===Y.END_BLOCK&&this._previous_flags.mode===be.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var Be=this._output.current_line;Be.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else ie==="NEWLINE"?se(this._flags.last_token,ae)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&se(g,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==Y.END_EXPR?(this._flags.last_token.type!==Y.START_EXPR||!se(g,["var","let","const"]))&&this._flags.last_token.text!==":"&&(R(g,"if")&&R(g.previous,"else")?this._output.space_before_token=!0:this.print_newline()):se(g,M)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&P(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ie==="SPACE"&&(this._output.space_before_token=!0);g.previous&&(g.previous.type===Y.WORD||g.previous.type===Y.RESERVED)&&(this._output.space_before_token=!0),this.print_token(g),this._flags.last_word=g.text,g.type===Y.RESERVED&&(g.text==="do"?this._flags.do_block=!0:g.text==="if"?this._flags.if_block=!0:g.text==="import"?this._flags.import_block=!0:this._flags.import_block&&R(g,"from")&&(this._flags.import_block=!1))},J.prototype.handle_semicolon=function(g){this.start_of_statement(g)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(g);for(var U=this._tokens.peek();this._flags.mode===be.Statement&&!(this._flags.if_block&&R(U,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(g)},J.prototype.handle_string=function(g){g.text.startsWith("`")&&g.newlines===0&&g.whitespace_before===""&&(g.previous.text===")"||this._flags.last_token.type===Y.WORD)||(this.start_of_statement(g)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(g),this._flags.last_token.type===Y.RESERVED||this._flags.last_token.type===Y.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===Y.COMMA||this._flags.last_token.type===Y.START_EXPR||this._flags.last_token.type===Y.EQUALS||this._flags.last_token.type===Y.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g):g.text.startsWith("`")&&this._flags.last_token.type===Y.END_EXPR&&(g.previous.text==="]"||g.previous.text===")")&&g.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(g)},J.prototype.handle_equals=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0},J.prototype.handle_comma=function(g){this.handle_whitespace_and_comments(g,!0),this.print_token(g),this._output.space_before_token=!0,this._flags.declaration_statement?(j(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(g)):this._flags.mode===be.ObjectLiteral||this._flags.mode===be.Statement&&this._flags.parent.mode===be.ObjectLiteral?(this._flags.mode===be.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)},J.prototype.handle_operator=function(g){var U=g.text==="*"&&(se(this._flags.last_token,["function","yield"])||L(this._flags.last_token.type,[Y.START_BLOCK,Y.COMMA,Y.END_BLOCK,Y.SEMICOLON])),ie=L(g.text,["-","+"])&&(L(this._flags.last_token.type,[Y.START_BLOCK,Y.START_EXPR,Y.EQUALS,Y.OPERATOR])||L(this._flags.last_token.text,M)||this._flags.last_token.text===",");if(!this.start_of_statement(g)){var Be=!U;this.handle_whitespace_and_comments(g,Be)}if(g.text==="*"&&this._flags.last_token.type===Y.DOT){this.print_token(g);return}if(g.text==="::"){this.print_token(g);return}if(L(g.text,["-","+"])&&this.start_of_object_property()){this.print_token(g);return}if(this._flags.last_token.type===Y.OPERATOR&&L(this._options.operator_position,ve)&&this.allow_wrap_or_preserved_newline(g),g.text===":"&&this._flags.in_case){this.print_token(g),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==Y.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 Ze=!0,Qe=!0,nt=!1;if(g.text===":"?this._flags.ternary_depth===0?Ze=!1:(this._flags.ternary_depth-=1,nt=!0):g.text==="?"&&(this._flags.ternary_depth+=1),!ie&&!U&&this._options.preserve_newlines&&L(g.text,z)){var At=g.text===":",_t=At&&nt,xe=At&&!nt;switch(this._options.operator_position){case he.before_newline:this._output.space_before_token=!xe,this.print_token(g),(!At||_t)&&this.allow_wrap_or_preserved_newline(g),this._output.space_before_token=!0;return;case he.after_newline:this._output.space_before_token=!0,!At||_t?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(g):this._output.space_before_token=!1,this.print_token(g),this._output.space_before_token=!0;return;case he.preserve_newline:xe||this.allow_wrap_or_preserved_newline(g),Ze=!(this._output.just_added_newline()||xe),this._output.space_before_token=Ze,this.print_token(g),this._output.space_before_token=!0;return}}if(U){this.allow_wrap_or_preserved_newline(g),Ze=!1;var vt=this._tokens.peek();Qe=vt&&L(vt.type,[Y.WORD,Y.RESERVED])}else if(g.text==="...")this.allow_wrap_or_preserved_newline(g),Ze=this._flags.last_token.type===Y.START_BLOCK,Qe=!1;else if(L(g.text,["--","++","!","~"])||ie){if((this._flags.last_token.type===Y.COMMA||this._flags.last_token.type===Y.START_EXPR)&&this.allow_wrap_or_preserved_newline(g),Ze=!1,Qe=!1,g.newlines&&(g.text==="--"||g.text==="++"||g.text==="~")){var zt=se(this._flags.last_token,ae)&&g.newlines;zt&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(zt,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(Ze=!0),this._flags.last_token.type===Y.RESERVED?Ze=!0:this._flags.last_token.type===Y.END_EXPR?Ze=!(this._flags.last_token.text==="]"&&(g.text==="--"||g.text==="++")):this._flags.last_token.type===Y.OPERATOR&&(Ze=L(g.text,["--","-","++","+"])&&L(this._flags.last_token.text,["--","-","++","+"]),L(g.text,["+","-"])&&L(this._flags.last_token.text,["--","++"])&&(Qe=!0)),(this._flags.mode===be.BlockStatement&&!this._flags.inline_frame||this._flags.mode===be.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Ze,this.print_token(g),this._output.space_before_token=Qe},J.prototype.handle_block_comment=function(g,U){if(this._output.raw){this._output.add_raw_token(g),g.directives&&g.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(g.directives){this.print_newline(!1,U),this.print_token(g),g.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!m.newline.test(g.text)&&!g.newlines){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0;return}else this.print_block_commment(g,U)},J.prototype.print_block_commment=function(g,U){var ie=Q(g.text),Be,Ze=!1,Qe=!1,nt=g.whitespace_before,At=nt.length;if(this.print_newline(!1,U),this.print_token_line_indentation(g),this._output.add_token(ie[0]),this.print_newline(!1,U),ie.length>1){for(ie=ie.slice(1),Ze=X(ie,"*"),Qe=ne(ie,nt),Ze&&(this._flags.alignment=1),Be=0;Be<ie.length;Be++)Ze?(this.print_token_line_indentation(g),this._output.add_token(O(ie[Be]))):Qe&&ie[Be]?(this.print_token_line_indentation(g),this._output.add_token(ie[Be].substring(At))):(this._output.current_line.set_indent(-1),this._output.add_token(ie[Be])),this.print_newline(!1,U);this._flags.alignment=0}},J.prototype.handle_comment=function(g,U){g.newlines?this.print_newline(!1,U):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(g),this.print_newline(!1,U)},J.prototype.handle_dot=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),se(this._flags.last_token,ae)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(g,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(g)},J.prototype.handle_unknown=function(g,U){this.print_token(g),g.text[g.text.length-1]===`
`&&this.print_newline(!1,U)},J.prototype.handle_eof=function(g){for(;this._flags.mode===be.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g)},ce.exports.Beautifier=J},function(ce){function o(h){this.__parent=h,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=[]}o.prototype.clone_empty=function(){var h=new o(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},o.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},o.prototype.has_match=function(h){for(var m=this.__items.length-1;m>=0;m--)if(this.__items[m].match(h))return!0;return!1},o.prototype.set_indent=function(h,m){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=m||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},o.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)},o.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},o.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},o.prototype.is_empty=function(){return this.__items.length===0},o.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},o.prototype.push=function(h){this.__items.push(h);var m=h.lastIndexOf(`
`);m!==-1?this.__character_count=h.length-m:this.__character_count+=h.length},o.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},o.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},o.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},o.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},o.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function x(h,m){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),m=m||"",h.indent_level>0&&(m=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=m,this.__base_string_length=m.length}x.prototype.get_indent_size=function(h,m){var y=this.__base_string_length;return m=m||0,h<0&&(y=0),y+=h*this.__indent_size,y+=m,y},x.prototype.get_indent_string=function(h,m){var y=this.__base_string;return m=m||0,h<0&&(h=0,y=""),m+=h*this.__indent_size,this.__ensure_cache(m),y+=this.__cache[m],y},x.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},x.prototype.__add_column=function(){var h=this.__cache.length,m=0,y="";this.__indent_size&&h>=this.__indent_size&&(m=Math.floor(h/this.__indent_size),h-=m*this.__indent_size,y=new Array(m+1).join(this.__indent_string)),h&&(y+=new Array(h+1).join(" ")),this.__cache.push(y)};function D(h,m){this.__indent_cache=new x(h,m),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new o(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}D.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},D.prototype.get_line_number=function(){return this.__lines.length},D.prototype.get_indent_string=function(h,m){return this.__indent_cache.get_indent_string(h,m)},D.prototype.get_indent_size=function(h,m){return this.__indent_cache.get_indent_size(h,m)},D.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},D.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},D.prototype.get_code=function(h){this.trim(!0);var m=this.current_line.pop();m&&(m[m.length-1]===`
`&&(m=m.replace(/\n+$/g,"")),this.current_line.push(m)),this._end_with_newline&&this.__add_outputline();var y=this.__lines.join(`
`);return h!==`
`&&(y=y.replace(/[\n]/g,h)),y},D.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},D.prototype.set_indent=function(h,m){return h=h||0,m=m||0,this.next_line.set_indent(h,m),this.__lines.length>1?(this.current_line.set_indent(h,m),!0):(this.current_line.set_indent(),!1)},D.prototype.add_raw_token=function(h){for(var m=0;m<h.newlines;m++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},D.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},D.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(" "))},D.prototype.remove_indent=function(h){for(var m=this.__lines.length;h<m;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},D.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&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},D.prototype.just_added_newline=function(){return this.current_line.is_empty()},D.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},D.prototype.ensure_empty_line_above=function(h,m){for(var y=this.__lines.length-2;y>=0;){var S=this.__lines[y];if(S.is_empty())break;if(S.item(0).indexOf(h)!==0&&S.item(-1)!==m){this.__lines.splice(y+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}y--}},ce.exports.Output=D},function(ce){function o(x,D,h,m){this.type=x,this.text=D,this.comments_before=null,this.newlines=h||0,this.whitespace_before=m||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}ce.exports.Token=o},function(ce,o){var x="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",D="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\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",m="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",y="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",S="(?:"+y+"|["+x+h+"])",M="(?:"+y+"|["+D+h+m+"])*";o.identifier=new RegExp(S+M,"g"),o.identifierStart=new RegExp(S),o.identifierMatch=new RegExp("(?:"+y+"|["+D+h+m+"])+");var z=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;o.newline=/[\n\r\u2028\u2029]/,o.lineBreak=new RegExp(`\r
|`+o.newline.source),o.allLineBreaks=new RegExp(o.lineBreak.source,"g")},function(ce,o,x){var D=x(6).Options,h=["before-newline","after-newline","preserve-newline"];function m(y){D.call(this,y,"js");var S=this.raw_options.brace_style||null;S==="expand-strict"?this.raw_options.brace_style="expand":S==="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 M=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var z=0;z<M.length;z++)M[z]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=M[z];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",h),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}m.prototype=new D,ce.exports.Options=m},function(ce){function o(h,m){this.raw_options=x(h,m),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}o.prototype._get_array=function(h,m){var y=this.raw_options[h],S=m||[];return typeof y=="object"?y!==null&&typeof y.concat=="function"&&(S=y.concat()):typeof y=="string"&&(S=y.split(/[^a-zA-Z0-9_\/\-]+/)),S},o.prototype._get_boolean=function(h,m){var y=this.raw_options[h],S=y===void 0?!!m:!!y;return S},o.prototype._get_characters=function(h,m){var y=this.raw_options[h],S=m||"";return typeof y=="string"&&(S=y.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),S},o.prototype._get_number=function(h,m){var y=this.raw_options[h];m=parseInt(m,10),isNaN(m)&&(m=0);var S=parseInt(y,10);return isNaN(S)&&(S=m),S},o.prototype._get_selection=function(h,m,y){var S=this._get_selection_list(h,m,y);if(S.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
`+m+`
You passed in: '`+this.raw_options[h]+"'");return S[0]},o.prototype._get_selection_list=function(h,m,y){if(!m||m.length===0)throw new Error("Selection list cannot be empty.");if(y=y||[m[0]],!this._is_valid_selection(y,m))throw new Error("Invalid Default Value!");var S=this._get_array(h,y);if(!this._is_valid_selection(S,m))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
`+m+`
You passed in: '`+this.raw_options[h]+"'");return S},o.prototype._is_valid_selection=function(h,m){return h.length&&m.length&&!h.some(function(y){return m.indexOf(y)===-1})};function x(h,m){var y={};h=D(h);var S;for(S in h)S!==m&&(y[S]=h[S]);if(m&&h[m])for(S in h[m])y[S]=h[m][S];return y}function D(h){var m={},y;for(y in h){var S=y.replace(/-/g,"_");m[S]=h[y]}return m}ce.exports.Options=o,ce.exports.normalizeOpts=D,ce.exports.mergeOpts=x},function(ce,o,x){var D=x(8).InputScanner,h=x(9).Tokenizer,m=x(9).TOKEN,y=x(13).Directives,S=x(4),M=x(12).Pattern,z=x(14).TemplatablePattern;function Y(X,ne){return ne.indexOf(X)!==-1}var L={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:m.START,RAW:m.RAW,EOF:m.EOF},O=new y(/\/\*/,/\*\//),T=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,R=/[0-9]/,se=/[^\d\.]/,ae=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),q=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";q=q.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),q="\\?\\.(?!\\d) "+q,q=q.replace(/ /g,"|");var he=new RegExp(q),ve="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),be=ve.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),Oe=new RegExp("^(?:"+be.join("|")+")$"),Q,P=function(X,ne){h.call(this,X,ne),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var J=new M(this._input),v=new z(this._input).read_options(this._options);this.__patterns={template:v,identifier:v.starting_with(S.identifier).matching(S.identifierMatch),number:J.matching(T),punct:J.matching(he),comment:J.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:J.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:J.matching(/<!--/),html_comment_end:J.matching(/-->/),include:J.starting_with(/#include/).until_after(S.lineBreak),shebang:J.starting_with(/#!/).until_after(S.lineBreak),xml:J.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:v.until(/['\\\n\r\u2028\u2029]/),double_quote:v.until(/["\\\n\r\u2028\u2029]/),template_text:v.until(/[`\\$]/),template_expression:v.until(/[`}\\]/)}};P.prototype=new h,P.prototype._is_comment=function(X){return X.type===L.COMMENT||X.type===L.BLOCK_COMMENT||X.type===L.UNKNOWN},P.prototype._is_opening=function(X){return X.type===L.START_BLOCK||X.type===L.START_EXPR},P.prototype._is_closing=function(X,ne){return(X.type===L.END_BLOCK||X.type===L.END_EXPR)&&ne&&(X.text==="]"&&ne.text==="["||X.text===")"&&ne.text==="("||X.text==="}"&&ne.text==="{")},P.prototype._reset=function(){Q=!1},P.prototype._get_next_token=function(X,ne){var J=null;this._readWhitespace();var v=this._input.peek();return v===null?this._create_token(L.EOF,""):(J=J||this._read_non_javascript(v),J=J||this._read_string(v),J=J||this._read_pair(v,this._input.peek(1)),J=J||this._read_word(X),J=J||this._read_singles(v),J=J||this._read_comment(v),J=J||this._read_regexp(v,X),J=J||this._read_xml(v,X),J=J||this._read_punctuation(),J=J||this._create_token(L.UNKNOWN,this._input.next()),J)},P.prototype._read_word=function(X){var ne;if(ne=this.__patterns.identifier.read(),ne!=="")return ne=ne.replace(S.allLineBreaks,`
`),!(X.type===L.DOT||X.type===L.RESERVED&&(X.text==="set"||X.text==="get"))&&Oe.test(ne)?(ne==="in"||ne==="of")&&(X.type===L.WORD||X.type===L.STRING)?this._create_token(L.OPERATOR,ne):this._create_token(L.RESERVED,ne):this._create_token(L.WORD,ne);if(ne=this.__patterns.number.read(),ne!=="")return this._create_token(L.WORD,ne)},P.prototype._read_singles=function(X){var ne=null;return X==="("||X==="["?ne=this._create_token(L.START_EXPR,X):X===")"||X==="]"?ne=this._create_token(L.END_EXPR,X):X==="{"?ne=this._create_token(L.START_BLOCK,X):X==="}"?ne=this._create_token(L.END_BLOCK,X):X===";"?ne=this._create_token(L.SEMICOLON,X):X==="."&&se.test(this._input.peek(1))?ne=this._create_token(L.DOT,X):X===","&&(ne=this._create_token(L.COMMA,X)),ne&&this._input.next(),ne},P.prototype._read_pair=function(X,ne){var J=null;return X==="#"&&ne==="{"&&(J=this._create_token(L.START_BLOCK,X+ne)),J&&(this._input.next(),this._input.next()),J},P.prototype._read_punctuation=function(){var X=this.__patterns.punct.read();if(X!=="")return X==="="?this._create_token(L.EQUALS,X):X==="?."?this._create_token(L.DOT,X):this._create_token(L.OPERATOR,X)},P.prototype._read_non_javascript=function(X){var ne="";if(X==="#"){if(this._is_first_token()&&(ne=this.__patterns.shebang.read(),ne))return this._create_token(L.UNKNOWN,ne.trim()+`
`);if(ne=this.__patterns.include.read(),ne)return this._create_token(L.UNKNOWN,ne.trim()+`
`);X=this._input.next();var J="#";if(this._input.hasNext()&&this._input.testChar(R)){do X=this._input.next(),J+=X;while(this._input.hasNext()&&X!=="#"&&X!=="=");return X==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(J+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(J+="{}",this._input.next(),this._input.next())),this._create_token(L.WORD,J)}this._input.back()}else if(X==="<"&&this._is_first_token()){if(ne=this.__patterns.html_comment_start.read(),ne){for(;this._input.hasNext()&&!this._input.testChar(S.newline);)ne+=this._input.next();return Q=!0,this._create_token(L.COMMENT,ne)}}else if(Q&&X==="-"&&(ne=this.__patterns.html_comment_end.read(),ne))return Q=!1,this._create_token(L.COMMENT,ne);return null},P.prototype._read_comment=function(X){var ne=null;if(X==="/"){var J="";if(this._input.peek(1)==="*"){J=this.__patterns.block_comment.read();var v=O.get_directives(J);v&&v.ignore==="start"&&(J+=O.readIgnored(this._input)),J=J.replace(S.allLineBreaks,`
`),ne=this._create_token(L.BLOCK_COMMENT,J),ne.directives=v}else this._input.peek(1)==="/"&&(J=this.__patterns.comment.read(),ne=this._create_token(L.COMMENT,J))}return ne},P.prototype._read_string=function(X){if(X==="`"||X==="'"||X==='"'){var ne=this._input.next();return this.has_char_escapes=!1,X==="`"?ne+=this._read_string_recursive("`",!0,"${"):ne+=this._read_string_recursive(X),this.has_char_escapes&&this._options.unescape_strings&&(ne=j(ne)),this._input.peek()===X&&(ne+=this._input.next()),ne=ne.replace(S.allLineBreaks,`
`),this._create_token(L.STRING,ne)}return null},P.prototype._allow_regexp_or_xml=function(X){return X.type===L.RESERVED&&Y(X.text,["return","case","throw","else","do","typeof","yield"])||X.type===L.END_EXPR&&X.text===")"&&X.opened.previous.type===L.RESERVED&&Y(X.opened.previous.text,["if","while","for"])||Y(X.type,[L.COMMENT,L.START_EXPR,L.START_BLOCK,L.START,L.END_BLOCK,L.OPERATOR,L.EQUALS,L.EOF,L.SEMICOLON,L.COMMA])},P.prototype._read_regexp=function(X,ne){if(X==="/"&&this._allow_regexp_or_xml(ne)){for(var J=this._input.next(),v=!1,g=!1;this._input.hasNext()&&(v||g||this._input.peek()!==X)&&!this._input.testChar(S.newline);)J+=this._input.peek(),v?v=!1:(v=this._input.peek()==="\\",this._input.peek()==="["?g=!0:this._input.peek()==="]"&&(g=!1)),this._input.next();return this._input.peek()===X&&(J+=this._input.next(),J+=this._input.read(S.identifier)),this._create_token(L.STRING,J)}return null},P.prototype._read_xml=function(X,ne){if(this._options.e4x&&X==="<"&&this._allow_regexp_or_xml(ne)){var J="",v=this.__patterns.xml.read_match();if(v){for(var g=v[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),U=g.indexOf("{")===0,ie=0;v;){var Be=!!v[1],Ze=v[2],Qe=!!v[v.length-1]||Ze.slice(0,8)==="![CDATA[";if(!Qe&&(Ze===g||U&&Ze.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Be?--ie:++ie),J+=v[0],ie<=0)break;v=this.__patterns.xml.read_match()}return v||(J+=this._input.match(/[\s\S]*/g)[0]),J=J.replace(S.allLineBreaks,`
`),this._create_token(L.STRING,J)}}return null};function j(X){for(var ne="",J=0,v=new D(X),g=null;v.hasNext();)if(g=v.match(/([\s]|[^\\]|\\\\)+/g),g&&(ne+=g[0]),v.peek()==="\\"){if(v.next(),v.peek()==="x")g=v.match(/x([0-9A-Fa-f]{2})/g);else if(v.peek()==="u")g=v.match(/u([0-9A-Fa-f]{4})/g),g||(g=v.match(/u\{([0-9A-Fa-f]+)\}/g));else{ne+="\\",v.hasNext()&&(ne+=v.next());continue}if(!g||(J=parseInt(g[1],16),J>126&&J<=255&&g[0].indexOf("x")===0))return X;J>=0&&J<32||J>1114111?ne+="\\"+g[0]:J===34||J===39||J===92?ne+="\\"+String.fromCharCode(J):ne+=String.fromCharCode(J)}return ne}P.prototype._read_string_recursive=function(X,ne,J){var v,g;X==="'"?g=this.__patterns.single_quote:X==='"'?g=this.__patterns.double_quote:X==="`"?g=this.__patterns.template_text:X==="}"&&(g=this.__patterns.template_expression);for(var U=g.read(),ie="";this._input.hasNext();){if(ie=this._input.next(),ie===X||!ne&&S.newline.test(ie)){this._input.back();break}else ie==="\\"&&this._input.hasNext()?(v=this._input.peek(),v==="x"||v==="u"?this.has_char_escapes=!0:v==="\r"&&this._input.peek(1)===`
`&&this._input.next(),ie+=this._input.next()):J&&(J==="${"&&ie==="$"&&this._input.peek()==="{"&&(ie+=this._input.next()),J===ie&&(X==="`"?ie+=this._read_string_recursive("}",ne,"`"):ie+=this._read_string_recursive("`",ne,"${"),this._input.hasNext()&&(ie+=this._input.next())));ie+=g.read(),U+=ie}return U},ce.exports.Tokenizer=P,ce.exports.TOKEN=L,ce.exports.positionable_operators=ae.slice(),ce.exports.line_starters=ve.slice()},function(ce){var o=RegExp.prototype.hasOwnProperty("sticky");function x(D){this.__input=D||"",this.__input_length=this.__input.length,this.__position=0}x.prototype.restart=function(){this.__position=0},x.prototype.back=function(){this.__position>0&&(this.__position-=1)},x.prototype.hasNext=function(){return this.__position<this.__input_length},x.prototype.next=function(){var D=null;return this.hasNext()&&(D=this.__input.charAt(this.__position),this.__position+=1),D},x.prototype.peek=function(D){var h=null;return D=D||0,D+=this.__position,D>=0&&D<this.__input_length&&(h=this.__input.charAt(D)),h},x.prototype.__match=function(D,h){D.lastIndex=h;var m=D.exec(this.__input);return m&&!(o&&D.sticky)&&m.index!==h&&(m=null),m},x.prototype.test=function(D,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(D,h):!1},x.prototype.testChar=function(D,h){var m=this.peek(h);return D.lastIndex=0,m!==null&&D.test(m)},x.prototype.match=function(D){var h=this.__match(D,this.__position);return h?this.__position+=h[0].length:h=null,h},x.prototype.read=function(D,h,m){var y="",S;return D&&(S=this.match(D),S&&(y+=S[0])),h&&(S||!D)&&(y+=this.readUntil(h,m)),y},x.prototype.readUntil=function(D,h){var m="",y=this.__position;D.lastIndex=this.__position;var S=D.exec(this.__input);return S?(y=S.index,h&&(y+=S[0].length)):y=this.__input_length,m=this.__input.substring(this.__position,y),this.__position=y,m},x.prototype.readUntilAfter=function(D){return this.readUntil(D,!0)},x.prototype.get_regexp=function(D,h){var m=null,y="g";return h&&o&&(y="y"),typeof D=="string"&&D!==""?m=new RegExp(D,y):D&&(m=new RegExp(D.source,y)),m},x.prototype.get_literal_regexp=function(D){return RegExp(D.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},x.prototype.peekUntilAfter=function(D){var h=this.__position,m=this.readUntilAfter(D);return this.__position=h,m},x.prototype.lookBack=function(D){var h=this.__position-1;return h>=D.length&&this.__input.substring(h-D.length,h).toLowerCase()===D},ce.exports.InputScanner=x},function(ce,o,x){var D=x(8).InputScanner,h=x(3).Token,m=x(10).TokenStream,y=x(11).WhitespacePattern,S={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},M=function(z,Y){this._input=new D(z),this._options=Y||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new y(this._input)};M.prototype.tokenize=function(){this._input.restart(),this.__tokens=new m,this._reset();for(var z,Y=new h(S.START,""),L=null,O=[],T=new m;Y.type!==S.EOF;){for(z=this._get_next_token(Y,L);this._is_comment(z);)T.add(z),z=this._get_next_token(Y,L);T.isEmpty()||(z.comments_before=T,T=new m),z.parent=L,this._is_opening(z)?(O.push(L),L=z):L&&this._is_closing(z,L)&&(z.opened=L,L.closed=z,L=O.pop(),z.parent=L),z.previous=Y,Y.next=z,this.__tokens.add(z),Y=z}return this.__tokens},M.prototype._is_first_token=function(){return this.__tokens.isEmpty()},M.prototype._reset=function(){},M.prototype._get_next_token=function(z,Y){this._readWhitespace();var L=this._input.read(/.+/g);return L?this._create_token(S.RAW,L):this._create_token(S.EOF,"")},M.prototype._is_comment=function(z){return!1},M.prototype._is_opening=function(z){return!1},M.prototype._is_closing=function(z,Y){return!1},M.prototype._create_token=function(z,Y){var L=new h(z,Y,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return L},M.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},ce.exports.Tokenizer=M,ce.exports.TOKEN=S},function(ce){function o(x){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=x}o.prototype.restart=function(){this.__position=0},o.prototype.isEmpty=function(){return this.__tokens_length===0},o.prototype.hasNext=function(){return this.__position<this.__tokens_length},o.prototype.next=function(){var x=null;return this.hasNext()&&(x=this.__tokens[this.__position],this.__position+=1),x},o.prototype.peek=function(x){var D=null;return x=x||0,x+=this.__position,x>=0&&x<this.__tokens_length&&(D=this.__tokens[x]),D},o.prototype.add=function(x){this.__parent_token&&(x.parent=this.__parent_token),this.__tokens.push(x),this.__tokens_length+=1},ce.exports.TokenStream=o},function(ce,o,x){var D=x(12).Pattern;function h(m,y){D.call(this,m,y),y?this._line_regexp=this._input.get_regexp(y._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}h.prototype=new D,h.prototype.__set_whitespace_patterns=function(m,y){m+="\\t ",y+="\\n\\r",this._match_pattern=this._input.get_regexp("["+m+y+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+y+"]")},h.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var m=this._input.read(this._match_pattern);if(m===" ")this.whitespace_before_token=" ";else if(m){var y=this.__split(this._newline_regexp,m);this.newline_count=y.length-1,this.whitespace_before_token=y[this.newline_count]}return m},h.prototype.matching=function(m,y){var S=this._create();return S.__set_whitespace_patterns(m,y),S._update(),S},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(m,y){m.lastIndex=0;for(var S=0,M=[],z=m.exec(y);z;)M.push(y.substring(S,z.index)),S=z.index+z[0].length,z=m.exec(y);return S<y.length?M.push(y.substring(S,y.length)):M.push(""),M},ce.exports.WhitespacePattern=h},function(ce){function o(x,D){this._input=x,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,D&&(this._starting_pattern=this._input.get_regexp(D._starting_pattern,!0),this._match_pattern=this._input.get_regexp(D._match_pattern,!0),this._until_pattern=this._input.get_regexp(D._until_pattern),this._until_after=D._until_after)}o.prototype.read=function(){var x=this._input.read(this._starting_pattern);return(!this._starting_pattern||x)&&(x+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),x},o.prototype.read_match=function(){return this._input.match(this._match_pattern)},o.prototype.until_after=function(x){var D=this._create();return D._until_after=!0,D._until_pattern=this._input.get_regexp(x),D._update(),D},o.prototype.until=function(x){var D=this._create();return D._until_after=!1,D._until_pattern=this._input.get_regexp(x),D._update(),D},o.prototype.starting_with=function(x){var D=this._create();return D._starting_pattern=this._input.get_regexp(x,!0),D._update(),D},o.prototype.matching=function(x){var D=this._create();return D._match_pattern=this._input.get_regexp(x,!0),D._update(),D},o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){},ce.exports.Pattern=o},function(ce){function o(x,D){x=typeof x=="string"?x:x.source,D=typeof D=="string"?D:D.source,this.__directives_block_pattern=new RegExp(x+/ beautify( \w+[:]\w+)+ /.source+D,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(x+/\sbeautify\signore:end\s/.source+D,"g")}o.prototype.get_directives=function(x){if(!x.match(this.__directives_block_pattern))return null;var D={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(x);h;)D[h[1]]=h[2],h=this.__directive_pattern.exec(x);return D},o.prototype.readIgnored=function(x){return x.readUntilAfter(this.__directives_end_ignore_pattern)},ce.exports.Directives=o},function(ce,o,x){var D=x(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function m(y,S){D.call(this,y,S),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),S&&(this.__template_pattern=this._input.get_regexp(S.__template_pattern),this._excluded=Object.assign(this._excluded,S._excluded),this._disabled=Object.assign(this._disabled,S._disabled));var M=new D(y);this.__patterns={handlebars_comment:M.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:M.starting_with(/{{{/).until_after(/}}}/),handlebars:M.starting_with(/{{/).until_after(/}}/),php:M.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:M.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:M.starting_with(/{%/).until_after(/%}/),django_value:M.starting_with(/{{/).until_after(/}}/),django_comment:M.starting_with(/{#/).until_after(/#}/),smarty:M.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:M.starting_with(/{\*/).until_after(/\*}/),smarty_literal:M.starting_with(/{literal}/).until_after(/{\/literal}/)}}m.prototype=new D,m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){this.__set_templated_pattern()},m.prototype.disable=function(y){var S=this._create();return S._disabled[y]=!0,S._update(),S},m.prototype.read_options=function(y){var S=this._create();for(var M in h)S._disabled[M]=y.templating.indexOf(M)===-1;return S._update(),S},m.prototype.exclude=function(y){var S=this._create();return S._excluded[y]=!0,S._update(),S},m.prototype.read=function(){var y="";this._match_pattern?y=this._input.read(this._starting_pattern):y=this._input.read(this._starting_pattern,this.__template_pattern);for(var S=this._read_template();S;)this._match_pattern?S+=this._input.read(this._match_pattern):S+=this._input.readUntil(this.__template_pattern),y+=S,S=this._read_template();return this._until_after&&(y+=this._input.readUntilAfter(this._until_pattern)),y},m.prototype.__set_templated_pattern=function(){var y=[];this._disabled.php||y.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||y.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||y.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(y.push(this.__patterns.django._starting_pattern.source),y.push(this.__patterns.django_value._starting_pattern.source),y.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||y.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&y.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+y.join("|")+")")},m.prototype._read_template=function(){var y="",S=this._input.peek();if(S==="<"){var M=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&M==="?"&&(y=y||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&M==="%"&&(y=y||this.__patterns.erb.read())}else S==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(y=y||this.__patterns.handlebars_comment.read(),y=y||this.__patterns.handlebars_unescaped.read(),y=y||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(y=y||this.__patterns.django_value.read()),this._excluded.django||(y=y||this.__patterns.django_comment.read(),y=y||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(y=y||this.__patterns.smarty_comment.read(),y=y||this.__patterns.smarty_literal.read(),y=y||this.__patterns.smarty.read()));return y},ce.exports.TemplatablePattern=m}],$={};function p(ce){var o=$[ce];if(o!==void 0)return o.exports;var x=$[ce]={exports:{}};return fe[ce](x,x.exports,p),x.exports}var me=p(0);pe=me})();var Te=pe;A=[],k=function(){return{js_beautify:Te}}.apply(Et,A),k!==void 0&&(vn.exports=k)})()},32834:function(vn){(function(Et,A){vn.exports=A()})(this,function(){"use strict";function Et(Le,Ae){for(var Ie=0;Ie<Ae.length;Ie++){var H=Ae[Ie];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(Le,H.key,H)}}function A(Le,Ae,Ie){return Ae&&Et(Le.prototype,Ae),Ie&&Et(Le,Ie),Le}function k(Le,Ae){if(Le){if(typeof Le=="string")return pe(Le,Ae);var Ie=Object.prototype.toString.call(Le).slice(8,-1);if(Ie==="Object"&&Le.constructor&&(Ie=Le.constructor.name),Ie==="Map"||Ie==="Set")return Array.from(Le);if(Ie==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ie))return pe(Le,Ae)}}function pe(Le,Ae){(Ae==null||Ae>Le.length)&&(Ae=Le.length);for(var Ie=0,H=new Array(Ae);Ie<Ae;Ie++)H[Ie]=Le[Ie];return H}function Te(Le,Ae){var Ie=typeof Symbol!="undefined"&&Le[Symbol.iterator]||Le["@@iterator"];if(Ie)return(Ie=Ie.call(Le)).next.bind(Ie);if(Array.isArray(Le)||(Ie=k(Le))||Ae&&Le&&typeof Le.length=="number"){Ie&&(Le=Ie);var H=0;return function(){return H>=Le.length?{done:!0}:{done:!1,value:Le[H++]}}}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 fe={exports:{}};function $(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function p(Le){fe.exports.defaults=Le}fe.exports={defaults:$(),getDefaults:$,changeDefaults:p};var me=/[&<>"']/,ce=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,x=/[<>"']|&(?!#?\w+;)/g,D={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},h=function(Ae){return D[Ae]};function m(Le,Ae){if(Ae){if(me.test(Le))return Le.replace(ce,h)}else if(o.test(Le))return Le.replace(x,h);return Le}var y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function S(Le){return Le.replace(y,function(Ae,Ie){return Ie=Ie.toLowerCase(),Ie==="colon"?":":Ie.charAt(0)==="#"?Ie.charAt(1)==="x"?String.fromCharCode(parseInt(Ie.substring(2),16)):String.fromCharCode(+Ie.substring(1)):""})}var M=/(^|[^\[])\^/g;function z(Le,Ae){Le=Le.source||Le,Ae=Ae||"";var Ie={replace:function(ee,de){return de=de.source||de,de=de.replace(M,"$1"),Le=Le.replace(ee,de),Ie},getRegex:function(){return new RegExp(Le,Ae)}};return Ie}var Y=/[^\w:]/g,L=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(Le,Ae,Ie){if(Le){var H;try{H=decodeURIComponent(S(Ie)).replace(Y,"").toLowerCase()}catch(ee){return null}if(H.indexOf("javascript:")===0||H.indexOf("vbscript:")===0||H.indexOf("data:")===0)return null}Ae&&!L.test(Ie)&&(Ie=q(Ae,Ie));try{Ie=encodeURI(Ie).replace(/%25/g,"%")}catch(ee){return null}return Ie}var T={},R=/^[^:]+:\/*[^/]*$/,se=/^([^:]+:)[\s\S]*$/,ae=/^([^:]+:\/*[^/]*)[\s\S]*$/;function q(Le,Ae){T[" "+Le]||(R.test(Le)?T[" "+Le]=Le+"/":T[" "+Le]=Oe(Le,"/",!0)),Le=T[" "+Le];var Ie=Le.indexOf(":")===-1;return Ae.substring(0,2)==="//"?Ie?Ae:Le.replace(se,"$1")+Ae:Ae.charAt(0)==="/"?Ie?Ae:Le.replace(ae,"$1")+Ae:Le+Ae}var he={exec:function(){}};function ve(Le){for(var Ae=1,Ie,H;Ae<arguments.length;Ae++){Ie=arguments[Ae];for(H in Ie)Object.prototype.hasOwnProperty.call(Ie,H)&&(Le[H]=Ie[H])}return Le}function be(Le,Ae){var Ie=Le.replace(/\|/g,function(de,re,_e){for(var et=!1,Ye=re;--Ye>=0&&_e[Ye]==="\\";)et=!et;return et?"|":" |"}),H=Ie.split(/ \|/),ee=0;if(H.length>Ae)H.splice(Ae);else for(;H.length<Ae;)H.push("");for(;ee<H.length;ee++)H[ee]=H[ee].trim().replace(/\\\|/g,"|");return H}function Oe(Le,Ae,Ie){var H=Le.length;if(H===0)return"";for(var ee=0;ee<H;){var de=Le.charAt(H-ee-1);if(de===Ae&&!Ie)ee++;else if(de!==Ae&&Ie)ee++;else break}return Le.substr(0,H-ee)}function Q(Le,Ae){if(Le.indexOf(Ae[1])===-1)return-1;for(var Ie=Le.length,H=0,ee=0;ee<Ie;ee++)if(Le[ee]==="\\")ee++;else if(Le[ee]===Ae[0])H++;else if(Le[ee]===Ae[1]&&(H--,H<0))return ee;return-1}function P(Le){Le&&Le.sanitize&&!Le.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 j(Le,Ae){if(Ae<1)return"";for(var Ie="";Ae>1;)Ae&1&&(Ie+=Le),Ae>>=1,Le+=Le;return Ie+Le}var X={escape:m,unescape:S,edit:z,cleanUrl:O,resolveUrl:q,noopTest:he,merge:ve,splitCells:be,rtrim:Oe,findClosingBracket:Q,checkSanitizeDeprecation:P,repeatString:j},ne=fe.exports.defaults,J=X.rtrim,v=X.splitCells,g=X.escape,U=X.findClosingBracket;function ie(Le,Ae,Ie){var H=Ae.href,ee=Ae.title?g(Ae.title):null,de=Le[1].replace(/\\([\[\]])/g,"$1");return Le[0].charAt(0)!=="!"?{type:"link",raw:Ie,href:H,title:ee,text:de}:{type:"image",raw:Ie,href:H,title:ee,text:g(de)}}function Be(Le,Ae){var Ie=Le.match(/^(\s+)(?:```)/);if(Ie===null)return Ae;var H=Ie[1];return Ae.split(`
`).map(function(ee){var de=ee.match(/^\s+/);if(de===null)return ee;var re=de[0];return re.length>=H.length?ee.slice(H.length):ee}).join(`
`)}var Ze=function(){function Le(Ie){this.options=Ie||ne}var Ae=Le.prototype;return Ae.space=function(H){var ee=this.rules.block.newline.exec(H);if(ee)return ee[0].length>1?{type:"space",raw:ee[0]}:{raw:`
`}},Ae.code=function(H){var ee=this.rules.block.code.exec(H);if(ee){var de=ee[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:ee[0],codeBlockStyle:"indented",text:this.options.pedantic?de:J(de,`
`)}}},Ae.fences=function(H){var ee=this.rules.block.fences.exec(H);if(ee){var de=ee[0],re=Be(de,ee[3]||"");return{type:"code",raw:de,lang:ee[2]?ee[2].trim():ee[2],text:re}}},Ae.heading=function(H){var ee=this.rules.block.heading.exec(H);if(ee){var de=ee[2].trim();if(/#$/.test(de)){var re=J(de,"#");(this.options.pedantic||!re||/ $/.test(re))&&(de=re.trim())}return{type:"heading",raw:ee[0],depth:ee[1].length,text:de}}},Ae.nptable=function(H){var ee=this.rules.block.nptable.exec(H);if(ee){var de={type:"table",header:v(ee[1].replace(/^ *| *\| *$/g,"")),align:ee[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ee[3]?ee[3].replace(/\n$/,"").split(`
`):[],raw:ee[0]};if(de.header.length===de.align.length){var re=de.align.length,_e;for(_e=0;_e<re;_e++)/^ *-+: *$/.test(de.align[_e])?de.align[_e]="right":/^ *:-+: *$/.test(de.align[_e])?de.align[_e]="center":/^ *:-+ *$/.test(de.align[_e])?de.align[_e]="left":de.align[_e]=null;for(re=de.cells.length,_e=0;_e<re;_e++)de.cells[_e]=v(de.cells[_e],de.header.length);return de}}},Ae.hr=function(H){var ee=this.rules.block.hr.exec(H);if(ee)return{type:"hr",raw:ee[0]}},Ae.blockquote=function(H){var ee=this.rules.block.blockquote.exec(H);if(ee){var de=ee[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ee[0],text:de}}},Ae.list=function(H){var ee=this.rules.block.list.exec(H);if(ee){var de=ee[0],re=ee[2],_e=re.length>1,et={type:"list",raw:de,ordered:_e,start:_e?+re.slice(0,-1):"",loose:!1,items:[]},Ye=ee[0].match(this.rules.block.item),it=!1,Rt,on,fn,Pt,jt,wn,Gn,An,Mn,Cn=Ye.length;fn=this.rules.block.listItemStart.exec(Ye[0]);for(var rn=0;rn<Cn;rn++){if(Rt=Ye[rn],de=Rt,this.options.pedantic||(Mn=Rt.match(new RegExp("\\n\\s*\\n {0,"+(fn[0].length-1)+"}\\S")),Mn&&(jt=Rt.length-Mn.index+Ye.slice(rn+1).join(`
`).length,et.raw=et.raw.substring(0,et.raw.length-jt),Rt=Rt.substring(0,Mn.index),de=Rt,Cn=rn+1)),rn!==Cn-1){if(Pt=this.rules.block.listItemStart.exec(Ye[rn+1]),this.options.pedantic?Pt[1].length>fn[1].length:Pt[1].length>=fn[0].length||Pt[1].length>3){Ye.splice(rn,2,Ye[rn]+(!this.options.pedantic&&Pt[1].length<fn[0].length&&!Ye[rn].match(/\n$/)?"":`
`)+Ye[rn+1]),rn--,Cn--;continue}else(!this.options.pedantic||this.options.smartLists?Pt[2][Pt[2].length-1]!==re[re.length-1]:_e===(Pt[2].length===1))&&(jt=Ye.slice(rn+1).join(`
`).length,et.raw=et.raw.substring(0,et.raw.length-jt),rn=Cn-1);fn=Pt}on=Rt.length,Rt=Rt.replace(/^ *([*+-]|\d+[.)]) ?/,""),~Rt.indexOf(`
`)&&(on-=Rt.length,Rt=this.options.pedantic?Rt.replace(/^ {1,4}/gm,""):Rt.replace(new RegExp("^ {1,"+on+"}","gm"),"")),Rt=J(Rt,`
`),rn!==Cn-1&&(de=de+`
`),wn=it||/\n\n(?!\s*$)/.test(de),rn!==Cn-1&&(it=de.slice(-2)===`
`,wn||(wn=it)),wn&&(et.loose=!0),this.options.gfm&&(Gn=/^\[[ xX]\] /.test(Rt),An=void 0,Gn&&(An=Rt[1]!==" ",Rt=Rt.replace(/^\[[ xX]\] +/,""))),et.items.push({type:"list_item",raw:de,task:Gn,checked:An,loose:wn,text:Rt})}return et}},Ae.html=function(H){var ee=this.rules.block.html.exec(H);if(ee)return{type:this.options.sanitize?"paragraph":"html",raw:ee[0],pre:!this.options.sanitizer&&(ee[1]==="pre"||ee[1]==="script"||ee[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ee[0]):g(ee[0]):ee[0]}},Ae.def=function(H){var ee=this.rules.block.def.exec(H);if(ee){ee[3]&&(ee[3]=ee[3].substring(1,ee[3].length-1));var de=ee[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:de,raw:ee[0],href:ee[2],title:ee[3]}}},Ae.table=function(H){var ee=this.rules.block.table.exec(H);if(ee){var de={type:"table",header:v(ee[1].replace(/^ *| *\| *$/g,"")),align:ee[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ee[3]?ee[3].replace(/\n$/,"").split(`
`):[]};if(de.header.length===de.align.length){de.raw=ee[0];var re=de.align.length,_e;for(_e=0;_e<re;_e++)/^ *-+: *$/.test(de.align[_e])?de.align[_e]="right":/^ *:-+: *$/.test(de.align[_e])?de.align[_e]="center":/^ *:-+ *$/.test(de.align[_e])?de.align[_e]="left":de.align[_e]=null;for(re=de.cells.length,_e=0;_e<re;_e++)de.cells[_e]=v(de.cells[_e].replace(/^ *\| *| *\| *$/g,""),de.header.length);return de}}},Ae.lheading=function(H){var ee=this.rules.block.lheading.exec(H);if(ee)return{type:"heading",raw:ee[0],depth:ee[2].charAt(0)==="="?1:2,text:ee[1]}},Ae.paragraph=function(H){var ee=this.rules.block.paragraph.exec(H);if(ee)return{type:"paragraph",raw:ee[0],text:ee[1].charAt(ee[1].length-1)===`
`?ee[1].slice(0,-1):ee[1]}},Ae.text=function(H){var ee=this.rules.block.text.exec(H);if(ee)return{type:"text",raw:ee[0],text:ee[0]}},Ae.escape=function(H){var ee=this.rules.inline.escape.exec(H);if(ee)return{type:"escape",raw:ee[0],text:g(ee[1])}},Ae.tag=function(H,ee,de){var re=this.rules.inline.tag.exec(H);if(re)return!ee&&/^<a /i.test(re[0])?ee=!0:ee&&/^<\/a>/i.test(re[0])&&(ee=!1),!de&&/^<(pre|code|kbd|script)(\s|>)/i.test(re[0])?de=!0:de&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(re[0])&&(de=!1),{type:this.options.sanitize?"text":"html",raw:re[0],inLink:ee,inRawBlock:de,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):g(re[0]):re[0]}},Ae.link=function(H){var ee=this.rules.inline.link.exec(H);if(ee){var de=ee[2].trim();if(!this.options.pedantic&&/^</.test(de)){if(!/>$/.test(de))return;var re=J(de.slice(0,-1),"\\");if((de.length-re.length)%2===0)return}else{var _e=U(ee[2],"()");if(_e>-1){var et=ee[0].indexOf("!")===0?5:4,Ye=et+ee[1].length+_e;ee[2]=ee[2].substring(0,_e),ee[0]=ee[0].substring(0,Ye).trim(),ee[3]=""}}var it=ee[2],Rt="";if(this.options.pedantic){var on=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(it);on&&(it=on[1],Rt=on[3])}else Rt=ee[3]?ee[3].slice(1,-1):"";return it=it.trim(),/^</.test(it)&&(this.options.pedantic&&!/>$/.test(de)?it=it.slice(1):it=it.slice(1,-1)),ie(ee,{href:it&&it.replace(this.rules.inline._escapes,"$1"),title:Rt&&Rt.replace(this.rules.inline._escapes,"$1")},ee[0])}},Ae.reflink=function(H,ee){var de;if((de=this.rules.inline.reflink.exec(H))||(de=this.rules.inline.nolink.exec(H))){var re=(de[2]||de[1]).replace(/\s+/g," ");if(re=ee[re.toLowerCase()],!re||!re.href){var _e=de[0].charAt(0);return{type:"text",raw:_e,text:_e}}return ie(de,re,de[0])}},Ae.emStrong=function(H,ee,de){de===void 0&&(de="");var re=this.rules.inline.emStrong.lDelim.exec(H);if(re&&!(re[3]&&de.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var _e=re[1]||re[2]||"";if(!_e||_e&&(de===""||this.rules.inline.punctuation.exec(de))){var et=re[0].length-1,Ye,it,Rt=et,on=0,fn=re[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(fn.lastIndex=0,ee=ee.slice(-1*H.length+et);(re=fn.exec(ee))!=null;)if(Ye=re[1]||re[2]||re[3]||re[4]||re[5]||re[6],!!Ye){if(it=Ye.length,re[3]||re[4]){Rt+=it;continue}else if((re[5]||re[6])&&et%3&&!((et+it)%3)){on+=it;continue}if(Rt-=it,!(Rt>0))return it=Math.min(it,it+Rt+on),Math.min(et,it)%2?{type:"em",raw:H.slice(0,et+re.index+it+1),text:H.slice(1,et+re.index+it)}:{type:"strong",raw:H.slice(0,et+re.index+it+1),text:H.slice(2,et+re.index+it-1)}}}}},Ae.codespan=function(H){var ee=this.rules.inline.code.exec(H);if(ee){var de=ee[2].replace(/\n/g," "),re=/[^ ]/.test(de),_e=/^ /.test(de)&&/ $/.test(de);return re&&_e&&(de=de.substring(1,de.length-1)),de=g(de,!0),{type:"codespan",raw:ee[0],text:de}}},Ae.br=function(H){var ee=this.rules.inline.br.exec(H);if(ee)return{type:"br",raw:ee[0]}},Ae.del=function(H){var ee=this.rules.inline.del.exec(H);if(ee)return{type:"del",raw:ee[0],text:ee[2]}},Ae.autolink=function(H,ee){var de=this.rules.inline.autolink.exec(H);if(de){var re,_e;return de[2]==="@"?(re=g(this.options.mangle?ee(de[1]):de[1]),_e="mailto:"+re):(re=g(de[1]),_e=re),{type:"link",raw:de[0],text:re,href:_e,tokens:[{type:"text",raw:re,text:re}]}}},Ae.url=function(H,ee){var de;if(de=this.rules.inline.url.exec(H)){var re,_e;if(de[2]==="@")re=g(this.options.mangle?ee(de[0]):de[0]),_e="mailto:"+re;else{var et;do et=de[0],de[0]=this.rules.inline._backpedal.exec(de[0])[0];while(et!==de[0]);re=g(de[0]),de[1]==="www."?_e="http://"+re:_e=re}return{type:"link",raw:de[0],text:re,href:_e,tokens:[{type:"text",raw:re,text:re}]}}},Ae.inlineText=function(H,ee,de){var re=this.rules.inline.text.exec(H);if(re){var _e;return ee?_e=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):g(re[0]):re[0]:_e=g(this.options.smartypants?de(re[0]):re[0]),{type:"text",raw:re[0],text:_e}}},Le}(),Qe=X.noopTest,nt=X.edit,At=X.merge,_t={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Qe,table:Qe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};_t._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_t._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,_t.def=nt(_t.def).replace("label",_t._label).replace("title",_t._title).getRegex(),_t.bullet=/(?:[*+-]|\d{1,9}[.)])/,_t.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,_t.item=nt(_t.item,"gm").replace(/bull/g,_t.bullet).getRegex(),_t.listItemStart=nt(/^( *)(bull) */).replace("bull",_t.bullet).getRegex(),_t.list=nt(_t.list).replace(/bull/g,_t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+_t.def.source+")").getRegex(),_t._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",_t._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,_t.html=nt(_t.html,"i").replace("comment",_t._comment).replace("tag",_t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_t.paragraph=nt(_t._paragraph).replace("hr",_t.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",_t._tag).getRegex(),_t.blockquote=nt(_t.blockquote).replace("paragraph",_t.paragraph).getRegex(),_t.normal=At({},_t),_t.gfm=At({},_t.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*|$)"}),_t.gfm.nptable=nt(_t.gfm.nptable).replace("hr",_t.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",_t._tag).getRegex(),_t.gfm.table=nt(_t.gfm.table).replace("hr",_t.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",_t._tag).getRegex(),_t.pedantic=At({},_t.normal,{html:nt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_t._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Qe,paragraph:nt(_t.normal._paragraph).replace("hr",_t.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",_t.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var xe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Qe,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Qe,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};xe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",xe.punctuation=nt(xe.punctuation).replace(/punctuation/g,xe._punctuation).getRegex(),xe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,xe.escapedEmSt=/\\\*|\\_/g,xe._comment=nt(_t._comment).replace("(?:-->|$)","-->").getRegex(),xe.emStrong.lDelim=nt(xe.emStrong.lDelim).replace(/punct/g,xe._punctuation).getRegex(),xe.emStrong.rDelimAst=nt(xe.emStrong.rDelimAst,"g").replace(/punct/g,xe._punctuation).getRegex(),xe.emStrong.rDelimUnd=nt(xe.emStrong.rDelimUnd,"g").replace(/punct/g,xe._punctuation).getRegex(),xe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,xe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,xe._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])?)+(?![-_])/,xe.autolink=nt(xe.autolink).replace("scheme",xe._scheme).replace("email",xe._email).getRegex(),xe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,xe.tag=nt(xe.tag).replace("comment",xe._comment).replace("attribute",xe._attribute).getRegex(),xe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,xe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,xe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,xe.link=nt(xe.link).replace("label",xe._label).replace("href",xe._href).replace("title",xe._title).getRegex(),xe.reflink=nt(xe.reflink).replace("label",xe._label).getRegex(),xe.reflinkSearch=nt(xe.reflinkSearch,"g").replace("reflink",xe.reflink).replace("nolink",xe.nolink).getRegex(),xe.normal=At({},xe),xe.pedantic=At({},xe.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:nt(/^!?\[(label)\]\((.*?)\)/).replace("label",xe._label).getRegex(),reflink:nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xe._label).getRegex()}),xe.gfm=At({},xe.normal,{escape:nt(xe.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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),xe.gfm.url=nt(xe.gfm.url,"i").replace("email",xe.gfm._extended_email).getRegex(),xe.breaks=At({},xe.gfm,{br:nt(xe.br).replace("{2,}","*").getRegex(),text:nt(xe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var vt={block:_t,inline:xe},zt=Ze,Ct=fe.exports.defaults,nn=vt.block,qe=vt.inline,Re=X.repeatString;function we(Le){return Le.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 K(Le){var Ae="",Ie,H,ee=Le.length;for(Ie=0;Ie<ee;Ie++)H=Le.charCodeAt(Ie),Math.random()>.5&&(H="x"+H.toString(16)),Ae+="&#"+H+";";return Ae}var Se=function(){function Le(Ie){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ie||Ct,this.options.tokenizer=this.options.tokenizer||new zt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var H={block:nn.normal,inline:qe.normal};this.options.pedantic?(H.block=nn.pedantic,H.inline=qe.pedantic):this.options.gfm&&(H.block=nn.gfm,this.options.breaks?H.inline=qe.breaks:H.inline=qe.gfm),this.tokenizer.rules=H}Le.lex=function(H,ee){var de=new Le(ee);return de.lex(H)},Le.lexInline=function(H,ee){var de=new Le(ee);return de.inlineTokens(H)};var Ae=Le.prototype;return Ae.lex=function(H){return H=H.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(H,this.tokens,!0),this.inline(this.tokens),this.tokens},Ae.blockTokens=function(H,ee,de){ee===void 0&&(ee=[]),de===void 0&&(de=!0),this.options.pedantic&&(H=H.replace(/^ +$/gm,""));for(var re,_e,et,Ye;H;){if(re=this.tokenizer.space(H)){H=H.substring(re.raw.length),re.type&&ee.push(re);continue}if(re=this.tokenizer.code(H)){H=H.substring(re.raw.length),Ye=ee[ee.length-1],Ye&&Ye.type==="paragraph"?(Ye.raw+=`
`+re.raw,Ye.text+=`
`+re.text):ee.push(re);continue}if(re=this.tokenizer.fences(H)){H=H.substring(re.raw.length),ee.push(re);continue}if(re=this.tokenizer.heading(H)){H=H.substring(re.raw.length),ee.push(re);continue}if(re=this.tokenizer.nptable(H)){H=H.substring(re.raw.length),ee.push(re);continue}if(re=this.tokenizer.hr(H)){H=H.substring(re.raw.length),ee.push(re);continue}if(re=this.tokenizer.blockquote(H)){H=H.substring(re.raw.length),re.tokens=this.blockTokens(re.text,[],de),ee.push(re);continue}if(re=this.tokenizer.list(H)){for(H=H.substring(re.raw.length),et=re.items.length,_e=0;_e<et;_e++)re.items[_e].tokens=this.blockTokens(re.items[_e].text,[],!1);ee.push(re);continue}if(re=this.tokenizer.html(H)){H=H.substring(re.raw.length),ee.push(re);continue}if(de&&(re=this.tokenizer.def(H))){H=H.substring(re.raw.length),this.tokens.links[re.tag]||(this.tokens.links[re.tag]={href:re.href,title:re.title});continue}if(re=this.tokenizer.table(H)){H=H.substring(re.raw.length),ee.push(re);continue}if(re=this.tokenizer.lheading(H)){H=H.substring(re.raw.length),ee.push(re);continue}if(de&&(re=this.tokenizer.paragraph(H))){H=H.substring(re.raw.length),ee.push(re);continue}if(re=this.tokenizer.text(H)){H=H.substring(re.raw.length),Ye=ee[ee.length-1],Ye&&Ye.type==="text"?(Ye.raw+=`
`+re.raw,Ye.text+=`
`+re.text):ee.push(re);continue}if(H){var it="Infinite loop on byte: "+H.charCodeAt(0);if(this.options.silent){console.error(it);break}else throw new Error(it)}}return ee},Ae.inline=function(H){var ee,de,re,_e,et,Ye,it=H.length;for(ee=0;ee<it;ee++)switch(Ye=H[ee],Ye.type){case"paragraph":case"text":case"heading":{Ye.tokens=[],this.inlineTokens(Ye.text,Ye.tokens);break}case"table":{for(Ye.tokens={header:[],cells:[]},_e=Ye.header.length,de=0;de<_e;de++)Ye.tokens.header[de]=[],this.inlineTokens(Ye.header[de],Ye.tokens.header[de]);for(_e=Ye.cells.length,de=0;de<_e;de++)for(et=Ye.cells[de],Ye.tokens.cells[de]=[],re=0;re<et.length;re++)Ye.tokens.cells[de][re]=[],this.inlineTokens(et[re],Ye.tokens.cells[de][re]);break}case"blockquote":{this.inline(Ye.tokens);break}case"list":{for(_e=Ye.items.length,de=0;de<_e;de++)this.inline(Ye.items[de].tokens);break}}return H},Ae.inlineTokens=function(H,ee,de,re){ee===void 0&&(ee=[]),de===void 0&&(de=!1),re===void 0&&(re=!1);var _e,et,Ye=H,it,Rt,on;if(this.tokens.links){var fn=Object.keys(this.tokens.links);if(fn.length>0)for(;(it=this.tokenizer.rules.inline.reflinkSearch.exec(Ye))!=null;)fn.includes(it[0].slice(it[0].lastIndexOf("[")+1,-1))&&(Ye=Ye.slice(0,it.index)+"["+Re("a",it[0].length-2)+"]"+Ye.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(it=this.tokenizer.rules.inline.blockSkip.exec(Ye))!=null;)Ye=Ye.slice(0,it.index)+"["+Re("a",it[0].length-2)+"]"+Ye.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(it=this.tokenizer.rules.inline.escapedEmSt.exec(Ye))!=null;)Ye=Ye.slice(0,it.index)+"++"+Ye.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;H;){if(Rt||(on=""),Rt=!1,_e=this.tokenizer.escape(H)){H=H.substring(_e.raw.length),ee.push(_e);continue}if(_e=this.tokenizer.tag(H,de,re)){H=H.substring(_e.raw.length),de=_e.inLink,re=_e.inRawBlock;var Pt=ee[ee.length-1];Pt&&_e.type==="text"&&Pt.type==="text"?(Pt.raw+=_e.raw,Pt.text+=_e.text):ee.push(_e);continue}if(_e=this.tokenizer.link(H)){H=H.substring(_e.raw.length),_e.type==="link"&&(_e.tokens=this.inlineTokens(_e.text,[],!0,re)),ee.push(_e);continue}if(_e=this.tokenizer.reflink(H,this.tokens.links)){H=H.substring(_e.raw.length);var jt=ee[ee.length-1];_e.type==="link"?(_e.tokens=this.inlineTokens(_e.text,[],!0,re),ee.push(_e)):jt&&_e.type==="text"&&jt.type==="text"?(jt.raw+=_e.raw,jt.text+=_e.text):ee.push(_e);continue}if(_e=this.tokenizer.emStrong(H,Ye,on)){H=H.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],de,re),ee.push(_e);continue}if(_e=this.tokenizer.codespan(H)){H=H.substring(_e.raw.length),ee.push(_e);continue}if(_e=this.tokenizer.br(H)){H=H.substring(_e.raw.length),ee.push(_e);continue}if(_e=this.tokenizer.del(H)){H=H.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],de,re),ee.push(_e);continue}if(_e=this.tokenizer.autolink(H,K)){H=H.substring(_e.raw.length),ee.push(_e);continue}if(!de&&(_e=this.tokenizer.url(H,K))){H=H.substring(_e.raw.length),ee.push(_e);continue}if(_e=this.tokenizer.inlineText(H,re,we)){H=H.substring(_e.raw.length),_e.raw.slice(-1)!=="_"&&(on=_e.raw.slice(-1)),Rt=!0,et=ee[ee.length-1],et&&et.type==="text"?(et.raw+=_e.raw,et.text+=_e.text):ee.push(_e);continue}if(H){var wn="Infinite loop on byte: "+H.charCodeAt(0);if(this.options.silent){console.error(wn);break}else throw new Error(wn)}}return ee},A(Le,null,[{key:"rules",get:function(){return{block:nn,inline:qe}}}]),Le}(),Ne=fe.exports.defaults,V=X.cleanUrl,I=X.escape,F=function(){function Le(Ie){this.options=Ie||Ne}var Ae=Le.prototype;return Ae.code=function(H,ee,de){var re=(ee||"").match(/\S*/)[0];if(this.options.highlight){var _e=this.options.highlight(H,re);_e!=null&&_e!==H&&(de=!0,H=_e)}return H=H.replace(/\n$/,"")+`
`,re?'<pre><code class="'+this.options.langPrefix+I(re,!0)+'">'+(de?H:I(H,!0))+`</code></pre>
`:"<pre><code>"+(de?H:I(H,!0))+`</code></pre>
`},Ae.blockquote=function(H){return`<blockquote>
`+H+`</blockquote>
`},Ae.html=function(H){return H},Ae.heading=function(H,ee,de,re){return this.options.headerIds?"<h"+ee+' id="'+this.options.headerPrefix+re.slug(de)+'">'+H+"</h"+ee+`>
`:"<h"+ee+">"+H+"</h"+ee+`>
`},Ae.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Ae.list=function(H,ee,de){var re=ee?"ol":"ul",_e=ee&&de!==1?' start="'+de+'"':"";return"<"+re+_e+`>
`+H+"</"+re+`>
`},Ae.listitem=function(H){return"<li>"+H+`</li>
`},Ae.checkbox=function(H){return"<input "+(H?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Ae.paragraph=function(H){return"<p>"+H+`</p>
`},Ae.table=function(H,ee){return ee&&(ee="<tbody>"+ee+"</tbody>"),`<table>
<thead>
`+H+`</thead>
`+ee+`</table>
`},Ae.tablerow=function(H){return`<tr>
`+H+`</tr>
`},Ae.tablecell=function(H,ee){var de=ee.header?"th":"td",re=ee.align?"<"+de+' align="'+ee.align+'">':"<"+de+">";return re+H+"</"+de+`>
`},Ae.strong=function(H){return"<strong>"+H+"</strong>"},Ae.em=function(H){return"<em>"+H+"</em>"},Ae.codespan=function(H){return"<code>"+H+"</code>"},Ae.br=function(){return this.options.xhtml?"<br/>":"<br>"},Ae.del=function(H){return"<del>"+H+"</del>"},Ae.link=function(H,ee,de){if(H=V(this.options.sanitize,this.options.baseUrl,H),H===null)return de;var re='<a href="'+I(H)+'"';return ee&&(re+=' title="'+ee+'"'),re+=">"+de+"</a>",re},Ae.image=function(H,ee,de){if(H=V(this.options.sanitize,this.options.baseUrl,H),H===null)return de;var re='<img src="'+H+'" alt="'+de+'"';return ee&&(re+=' title="'+ee+'"'),re+=this.options.xhtml?"/>":">",re},Ae.text=function(H){return H},Le}(),oe=function(){function Le(){}var Ae=Le.prototype;return Ae.strong=function(H){return H},Ae.em=function(H){return H},Ae.codespan=function(H){return H},Ae.del=function(H){return H},Ae.html=function(H){return H},Ae.text=function(H){return H},Ae.link=function(H,ee,de){return""+de},Ae.image=function(H,ee,de){return""+de},Ae.br=function(){return""},Le}(),w=function(){function Le(){this.seen={}}var Ae=Le.prototype;return Ae.serialize=function(H){return H.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},Ae.getNextSafeSlug=function(H,ee){var de=H,re=0;if(this.seen.hasOwnProperty(de)){re=this.seen[H];do re++,de=H+"-"+re;while(this.seen.hasOwnProperty(de))}return ee||(this.seen[H]=re,this.seen[de]=0),de},Ae.slug=function(H,ee){ee===void 0&&(ee={});var de=this.serialize(H);return this.getNextSafeSlug(de,ee.dryrun)},Le}(),C=F,B=oe,W=w,Z=fe.exports.defaults,te=X.unescape,ue=function(){function Le(Ie){this.options=Ie||Z,this.options.renderer=this.options.renderer||new C,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new B,this.slugger=new W}Le.parse=function(H,ee){var de=new Le(ee);return de.parse(H)},Le.parseInline=function(H,ee){var de=new Le(ee);return de.parseInline(H)};var Ae=Le.prototype;return Ae.parse=function(H,ee){ee===void 0&&(ee=!0);var de="",re,_e,et,Ye,it,Rt,on,fn,Pt,jt,wn,Gn,An,Mn,Cn,rn,Tn,$n,tr=H.length;for(re=0;re<tr;re++)switch(jt=H[re],jt.type){case"space":continue;case"hr":{de+=this.renderer.hr();continue}case"heading":{de+=this.renderer.heading(this.parseInline(jt.tokens),jt.depth,te(this.parseInline(jt.tokens,this.textRenderer)),this.slugger);continue}case"code":{de+=this.renderer.code(jt.text,jt.lang,jt.escaped);continue}case"table":{for(fn="",on="",Ye=jt.header.length,_e=0;_e<Ye;_e++)on+=this.renderer.tablecell(this.parseInline(jt.tokens.header[_e]),{header:!0,align:jt.align[_e]});for(fn+=this.renderer.tablerow(on),Pt="",Ye=jt.cells.length,_e=0;_e<Ye;_e++){for(Rt=jt.tokens.cells[_e],on="",it=Rt.length,et=0;et<it;et++)on+=this.renderer.tablecell(this.parseInline(Rt[et]),{header:!1,align:jt.align[et]});Pt+=this.renderer.tablerow(on)}de+=this.renderer.table(fn,Pt);continue}case"blockquote":{Pt=this.parse(jt.tokens),de+=this.renderer.blockquote(Pt);continue}case"list":{for(wn=jt.ordered,Gn=jt.start,An=jt.loose,Ye=jt.items.length,Pt="",_e=0;_e<Ye;_e++)Cn=jt.items[_e],rn=Cn.checked,Tn=Cn.task,Mn="",Cn.task&&($n=this.renderer.checkbox(rn),An?Cn.tokens.length>0&&Cn.tokens[0].type==="text"?(Cn.tokens[0].text=$n+" "+Cn.tokens[0].text,Cn.tokens[0].tokens&&Cn.tokens[0].tokens.length>0&&Cn.tokens[0].tokens[0].type==="text"&&(Cn.tokens[0].tokens[0].text=$n+" "+Cn.tokens[0].tokens[0].text)):Cn.tokens.unshift({type:"text",text:$n}):Mn+=$n),Mn+=this.parse(Cn.tokens,An),Pt+=this.renderer.listitem(Mn,Tn,rn);de+=this.renderer.list(Pt,wn,Gn);continue}case"html":{de+=this.renderer.html(jt.text);continue}case"paragraph":{de+=this.renderer.paragraph(this.parseInline(jt.tokens));continue}case"text":{for(Pt=jt.tokens?this.parseInline(jt.tokens):jt.text;re+1<tr&&H[re+1].type==="text";)jt=H[++re],Pt+=`
`+(jt.tokens?this.parseInline(jt.tokens):jt.text);de+=ee?this.renderer.paragraph(Pt):Pt;continue}default:{var Me='Token with "'+jt.type+'" type was not found.';if(this.options.silent){console.error(Me);return}else throw new Error(Me)}}return de},Ae.parseInline=function(H,ee){ee=ee||this.renderer;var de="",re,_e,et=H.length;for(re=0;re<et;re++)switch(_e=H[re],_e.type){case"escape":{de+=ee.text(_e.text);break}case"html":{de+=ee.html(_e.text);break}case"link":{de+=ee.link(_e.href,_e.title,this.parseInline(_e.tokens,ee));break}case"image":{de+=ee.image(_e.href,_e.title,_e.text);break}case"strong":{de+=ee.strong(this.parseInline(_e.tokens,ee));break}case"em":{de+=ee.em(this.parseInline(_e.tokens,ee));break}case"codespan":{de+=ee.codespan(_e.text);break}case"br":{de+=ee.br();break}case"del":{de+=ee.del(this.parseInline(_e.tokens,ee));break}case"text":{de+=ee.text(_e.text);break}default:{var Ye='Token with "'+_e.type+'" type was not found.';if(this.options.silent){console.error(Ye);return}else throw new Error(Ye)}}return de},Le}(),ge=Se,Ce=ue,De=Ze,Fe=F,Ve=oe,Ge=w,$e=X.merge,mt=X.checkSanitizeDeprecation,xt=X.escape,St=fe.exports.getDefaults,Lt=fe.exports.changeDefaults,Ht=fe.exports.defaults;function ut(Le,Ae,Ie){if(typeof Le=="undefined"||Le===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Le!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Le)+", string expected");if(typeof Ae=="function"&&(Ie=Ae,Ae=null),Ae=$e({},ut.defaults,Ae||{}),mt(Ae),Ie){var H=Ae.highlight,ee;try{ee=ge.lex(Le,Ae)}catch(et){return Ie(et)}var de=function(Ye){var it;if(!Ye)try{Ae.walkTokens&&ut.walkTokens(ee,Ae.walkTokens),it=Ce.parse(ee,Ae)}catch(Rt){Ye=Rt}return Ae.highlight=H,Ye?Ie(Ye):Ie(null,it)};if(!H||H.length<3||(delete Ae.highlight,!ee.length))return de();var re=0;ut.walkTokens(ee,function(et){et.type==="code"&&(re++,setTimeout(function(){H(et.text,et.lang,function(Ye,it){if(Ye)return de(Ye);it!=null&&it!==et.text&&(et.text=it,et.escaped=!0),re--,re===0&&de()})},0))}),re===0&&de();return}try{var _e=ge.lex(Le,Ae);return Ae.walkTokens&&ut.walkTokens(_e,Ae.walkTokens),Ce.parse(_e,Ae)}catch(et){if(et.message+=`
Please report this to https://github.com/markedjs/marked.`,Ae.silent)return"<p>An error occurred:</p><pre>"+xt(et.message+"",!0)+"</pre>";throw et}}ut.options=ut.setOptions=function(Le){return $e(ut.defaults,Le),Lt(ut.defaults),ut},ut.getDefaults=St,ut.defaults=Ht,ut.use=function(Le){var Ae=$e({},Le);if(Le.renderer&&function(){var H=ut.defaults.renderer||new Fe,ee=function(_e){var et=H[_e];H[_e]=function(){for(var Ye=arguments.length,it=new Array(Ye),Rt=0;Rt<Ye;Rt++)it[Rt]=arguments[Rt];var on=Le.renderer[_e].apply(H,it);return on===!1&&(on=et.apply(H,it)),on}};for(var de in Le.renderer)ee(de);Ae.renderer=H}(),Le.tokenizer&&function(){var H=ut.defaults.tokenizer||new De,ee=function(_e){var et=H[_e];H[_e]=function(){for(var Ye=arguments.length,it=new Array(Ye),Rt=0;Rt<Ye;Rt++)it[Rt]=arguments[Rt];var on=Le.tokenizer[_e].apply(H,it);return on===!1&&(on=et.apply(H,it)),on}};for(var de in Le.tokenizer)ee(de);Ae.tokenizer=H}(),Le.walkTokens){var Ie=ut.defaults.walkTokens;Ae.walkTokens=function(H){Le.walkTokens(H),Ie&&Ie(H)}}ut.setOptions(Ae)},ut.walkTokens=function(Le,Ae){for(var Ie=Te(Le),H;!(H=Ie()).done;){var ee=H.value;switch(Ae(ee),ee.type){case"table":{for(var de=Te(ee.tokens.header),re;!(re=de()).done;){var _e=re.value;ut.walkTokens(_e,Ae)}for(var et=Te(ee.tokens.cells),Ye;!(Ye=et()).done;)for(var it=Ye.value,Rt=Te(it),on;!(on=Rt()).done;){var fn=on.value;ut.walkTokens(fn,Ae)}break}case"list":{ut.walkTokens(ee.items,Ae);break}default:ee.tokens&&ut.walkTokens(ee.tokens,Ae)}}},ut.parseInline=function(Le,Ae){if(typeof Le=="undefined"||Le===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Le!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Le)+", string expected");Ae=$e({},ut.defaults,Ae||{}),mt(Ae);try{var Ie=ge.lexInline(Le,Ae);return Ae.walkTokens&&ut.walkTokens(Ie,Ae.walkTokens),Ce.parseInline(Ie,Ae)}catch(H){if(H.message+=`
Please report this to https://github.com/markedjs/marked.`,Ae.silent)return"<p>An error occurred:</p><pre>"+xt(H.message+"",!0)+"</pre>";throw H}},ut.Parser=Ce,ut.parser=Ce.parse,ut.Renderer=Fe,ut.TextRenderer=Ve,ut.Lexer=ge,ut.lexer=ge.lex,ut.Tokenizer=De,ut.Slugger=Ge,ut.parse=ut;var Ut=ut;return Ut})},11690:function(vn){const Et=/[&<>"']/,A=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,pe=/[<>"']|&(?!#?\w+;)/g,Te={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fe=q=>Te[q];function $(q,he){if(he){if(Et.test(q))return q.replace(A,fe)}else if(k.test(q))return q.replace(pe,fe);return q}const p=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function me(q){return q.replace(p,(he,ve)=>(ve=ve.toLowerCase(),ve==="colon"?":":ve.charAt(0)==="#"?ve.charAt(1)==="x"?String.fromCharCode(parseInt(ve.substring(2),16)):String.fromCharCode(+ve.substring(1)):""))}const ce=/(^|[^\[])\^/g;function o(q,he){q=q.source||q,he=he||"";const ve={replace:(be,Oe)=>(Oe=Oe.source||Oe,Oe=Oe.replace(ce,"$1"),q=q.replace(be,Oe),ve),getRegex:()=>new RegExp(q,he)};return ve}const x=/[^\w:]/g,D=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function h(q,he,ve){if(q){let be;try{be=decodeURIComponent(me(ve)).replace(x,"").toLowerCase()}catch(Oe){return null}if(be.indexOf("javascript:")===0||be.indexOf("vbscript:")===0||be.indexOf("data:")===0)return null}he&&!D.test(ve)&&(ve=z(he,ve));try{ve=encodeURI(ve).replace(/%25/g,"%")}catch(be){return null}return ve}const m={},y=/^[^:]+:\/*[^/]*$/,S=/^([^:]+:)[\s\S]*$/,M=/^([^:]+:\/*[^/]*)[\s\S]*$/;function z(q,he){m[" "+q]||(y.test(q)?m[" "+q]=q+"/":m[" "+q]=T(q,"/",!0)),q=m[" "+q];const ve=q.indexOf(":")===-1;return he.substring(0,2)==="//"?ve?he:q.replace(S,"$1")+he:he.charAt(0)==="/"?ve?he:q.replace(M,"$1")+he:q+he}const Y={exec:function(){}};function L(q){let he=1,ve,be;for(;he<arguments.length;he++){ve=arguments[he];for(be in ve)Object.prototype.hasOwnProperty.call(ve,be)&&(q[be]=ve[be])}return q}function O(q,he){const ve=q.replace(/\|/g,(Q,P,j)=>{let X=!1,ne=P;for(;--ne>=0&&j[ne]==="\\";)X=!X;return X?"|":" |"}),be=ve.split(/ \|/);let Oe=0;if(be.length>he)be.splice(he);else for(;be.length<he;)be.push("");for(;Oe<be.length;Oe++)be[Oe]=be[Oe].trim().replace(/\\\|/g,"|");return be}function T(q,he,ve){const be=q.length;if(be===0)return"";let Oe=0;for(;Oe<be;){const Q=q.charAt(be-Oe-1);if(Q===he&&!ve)Oe++;else if(Q!==he&&ve)Oe++;else break}return q.substr(0,be-Oe)}function R(q,he){if(q.indexOf(he[1])===-1)return-1;const ve=q.length;let be=0,Oe=0;for(;Oe<ve;Oe++)if(q[Oe]==="\\")Oe++;else if(q[Oe]===he[0])be++;else if(q[Oe]===he[1]&&(be--,be<0))return Oe;return-1}function se(q){q&&q.sanitize&&!q.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(q,he){if(he<1)return"";let ve="";for(;he>1;)he&1&&(ve+=q),he>>=1,q+=q;return ve+q}vn.exports={escape:$,unescape:me,edit:o,cleanUrl:h,resolveUrl:z,noopTest:Y,merge:L,splitCells:O,rtrim:T,findClosingBracket:R,checkSanitizeDeprecation:se,repeatString:ae}},75918:function(vn,Et,A){"use strict";A.d(Et,{Wi:function(){return p},Z0:function(){return me},aU:function(){return $},eZ:function(){return o},wY:function(){return ce}});var k=A(4348),pe=A(69323),Te=A(13268),fe=function(x,D,h,m){function y(S){return S instanceof h?S:new h(function(M){M(S)})}return new(h||(h=Promise))(function(S,M){function z(O){try{L(m.next(O))}catch(T){M(T)}}function Y(O){try{L(m.throw(O))}catch(T){M(T)}}function L(O){O.done?S(O.value):y(O.value).then(z,Y)}L((m=m.apply(x,D||[])).next())})};class $ extends pe.JT{constructor(D,h="",m="",y=!0,S){super(),this._onDidChange=this._register(new k.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=h,this._cssClass=m,this._enabled=y,this._actionCallback=S}get id(){return this._id}get label(){return this._label}set label(D){this._setLabel(D)}_setLabel(D){this._label!==D&&(this._label=D,this._onDidChange.fire({label:D}))}get tooltip(){return this._tooltip||""}set tooltip(D){this._setTooltip(D)}_setTooltip(D){this._tooltip!==D&&(this._tooltip=D,this._onDidChange.fire({tooltip:D}))}get class(){return this._cssClass}set class(D){this._setClass(D)}_setClass(D){this._cssClass!==D&&(this._cssClass=D,this._onDidChange.fire({class:D}))}get enabled(){return this._enabled}set enabled(D){this._setEnabled(D)}_setEnabled(D){this._enabled!==D&&(this._enabled=D,this._onDidChange.fire({enabled:D}))}get checked(){return this._checked}set checked(D){this._setChecked(D)}_setChecked(D){this._checked!==D&&(this._checked=D,this._onDidChange.fire({checked:D}))}run(D,h){return fe(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class p extends pe.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new k.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new k.Q5),this.onDidRun=this._onDidRun.event}run(D,h){return fe(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let m;try{yield this.runAction(D,h)}catch(y){m=y}this._onDidRun.fire({action:D,error:m})})}runAction(D,h){return fe(this,void 0,void 0,function*(){yield D.run(h)})}}class me extends ${constructor(D){super(me.ID,D,D?"separator text":"separator"),this.checked=!1,this.enabled=!1}}me.ID="vs.actions.separator";class ce{constructor(D,h,m,y){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=h,this.class=y,this._actions=m}get actions(){return this._actions}dispose(){}run(){return fe(this,void 0,void 0,function*(){})}}class o extends ${constructor(){super(o.ID,Te.N("submenu.empty","(empty)"),void 0,!1)}}o.ID="vs.actions.empty"},76068:function(vn,Et,A){"use strict";A.d(Et,{ok:function(){return k}});function k(pe,Te){if(!pe)throw new Error(Te?`Assertion failed (${Te})`:"Assertion Failed")}},52615:function(vn,Et,A){"use strict";A.d(Et,{CM:function(){return $},JL:function(){return p},dT:function(){return ce},fK:function(){return fe},lA:function(){return me}});var k=A(4348);class pe{constructor(){this._icons=new Map,this._onDidRegister=new k.Q5}add(x){const D=this._icons.get(x.id);D?x.description?D.description=x.description:console.error(`Duplicate registration of codicon ${x.id}`):(this._icons.set(x.id,x),this._onDidRegister.fire(x))}get(x){return this._icons.get(x)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const Te=new pe,fe=Te;function $(o,x){return new me(o,x)}function p(o){return o?o.replace(/\$\((.*?)\)/g,(x,D)=>` ${D} `).trim():""}class me{constructor(x,D,h){this.id=x,this.definition=D,this.description=h,Te.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var ce;(function(o){o.iconNameSegment="[A-Za-z0-9]+",o.iconNameExpression="[A-Za-z0-9\\-]+",o.iconModifierExpression="~[A-Za-z]+";const x=new RegExp(`^(${o.iconNameExpression})(${o.iconModifierExpression})?$`);function D(y){if(y instanceof me)return["codicon","codicon-"+y.id];const S=x.exec(y.id);if(!S)return D(me.error);let[,M,z]=S;const Y=["codicon","codicon-"+M];return z&&Y.push("codicon-modifier-"+z.substr(1)),Y}o.asClassNameArray=D;function h(y){return D(y).join(" ")}o.asClassName=h;function m(y){return"."+D(y).join(".")}o.asCSSSelector=m})(ce||(ce={})),function(o){o.add=new o("add",{fontCharacter:"\\ea60"}),o.plus=new o("plus",o.add.definition),o.gistNew=new o("gist-new",o.add.definition),o.repoCreate=new o("repo-create",o.add.definition),o.lightbulb=new o("lightbulb",{fontCharacter:"\\ea61"}),o.lightBulb=new o("light-bulb",{fontCharacter:"\\ea61"}),o.repo=new o("repo",{fontCharacter:"\\ea62"}),o.repoDelete=new o("repo-delete",{fontCharacter:"\\ea62"}),o.gistFork=new o("gist-fork",{fontCharacter:"\\ea63"}),o.repoForked=new o("repo-forked",{fontCharacter:"\\ea63"}),o.gitPullRequest=new o("git-pull-request",{fontCharacter:"\\ea64"}),o.gitPullRequestAbandoned=new o("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),o.recordKeys=new o("record-keys",{fontCharacter:"\\ea65"}),o.keyboard=new o("keyboard",{fontCharacter:"\\ea65"}),o.tag=new o("tag",{fontCharacter:"\\ea66"}),o.tagAdd=new o("tag-add",{fontCharacter:"\\ea66"}),o.tagRemove=new o("tag-remove",{fontCharacter:"\\ea66"}),o.person=new o("person",{fontCharacter:"\\ea67"}),o.personFollow=new o("person-follow",{fontCharacter:"\\ea67"}),o.personOutline=new o("person-outline",{fontCharacter:"\\ea67"}),o.personFilled=new o("person-filled",{fontCharacter:"\\ea67"}),o.gitBranch=new o("git-branch",{fontCharacter:"\\ea68"}),o.gitBranchCreate=new o("git-branch-create",{fontCharacter:"\\ea68"}),o.gitBranchDelete=new o("git-branch-delete",{fontCharacter:"\\ea68"}),o.sourceControl=new o("source-control",{fontCharacter:"\\ea68"}),o.mirror=new o("mirror",{fontCharacter:"\\ea69"}),o.mirrorPublic=new o("mirror-public",{fontCharacter:"\\ea69"}),o.star=new o("star",{fontCharacter:"\\ea6a"}),o.starAdd=new o("star-add",{fontCharacter:"\\ea6a"}),o.starDelete=new o("star-delete",{fontCharacter:"\\ea6a"}),o.starEmpty=new o("star-empty",{fontCharacter:"\\ea6a"}),o.comment=new o("comment",{fontCharacter:"\\ea6b"}),o.commentAdd=new o("comment-add",{fontCharacter:"\\ea6b"}),o.alert=new o("alert",{fontCharacter:"\\ea6c"}),o.warning=new o("warning",{fontCharacter:"\\ea6c"}),o.search=new o("search",{fontCharacter:"\\ea6d"}),o.searchSave=new o("search-save",{fontCharacter:"\\ea6d"}),o.logOut=new o("log-out",{fontCharacter:"\\ea6e"}),o.signOut=new o("sign-out",{fontCharacter:"\\ea6e"}),o.logIn=new o("log-in",{fontCharacter:"\\ea6f"}),o.signIn=new o("sign-in",{fontCharacter:"\\ea6f"}),o.eye=new o("eye",{fontCharacter:"\\ea70"}),o.eyeUnwatch=new o("eye-unwatch",{fontCharacter:"\\ea70"}),o.eyeWatch=new o("eye-watch",{fontCharacter:"\\ea70"}),o.circleFilled=new o("circle-filled",{fontCharacter:"\\ea71"}),o.primitiveDot=new o("primitive-dot",{fontCharacter:"\\ea71"}),o.closeDirty=new o("close-dirty",{fontCharacter:"\\ea71"}),o.debugBreakpoint=new o("debug-breakpoint",{fontCharacter:"\\ea71"}),o.debugBreakpointDisabled=new o("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),o.debugHint=new o("debug-hint",{fontCharacter:"\\ea71"}),o.primitiveSquare=new o("primitive-square",{fontCharacter:"\\ea72"}),o.edit=new o("edit",{fontCharacter:"\\ea73"}),o.pencil=new o("pencil",{fontCharacter:"\\ea73"}),o.info=new o("info",{fontCharacter:"\\ea74"}),o.issueOpened=new o("issue-opened",{fontCharacter:"\\ea74"}),o.gistPrivate=new o("gist-private",{fontCharacter:"\\ea75"}),o.gitForkPrivate=new o("git-fork-private",{fontCharacter:"\\ea75"}),o.lock=new o("lock",{fontCharacter:"\\ea75"}),o.mirrorPrivate=new o("mirror-private",{fontCharacter:"\\ea75"}),o.close=new o("close",{fontCharacter:"\\ea76"}),o.removeClose=new o("remove-close",{fontCharacter:"\\ea76"}),o.x=new o("x",{fontCharacter:"\\ea76"}),o.repoSync=new o("repo-sync",{fontCharacter:"\\ea77"}),o.sync=new o("sync",{fontCharacter:"\\ea77"}),o.clone=new o("clone",{fontCharacter:"\\ea78"}),o.desktopDownload=new o("desktop-download",{fontCharacter:"\\ea78"}),o.beaker=new o("beaker",{fontCharacter:"\\ea79"}),o.microscope=new o("microscope",{fontCharacter:"\\ea79"}),o.vm=new o("vm",{fontCharacter:"\\ea7a"}),o.deviceDesktop=new o("device-desktop",{fontCharacter:"\\ea7a"}),o.file=new o("file",{fontCharacter:"\\ea7b"}),o.fileText=new o("file-text",{fontCharacter:"\\ea7b"}),o.more=new o("more",{fontCharacter:"\\ea7c"}),o.ellipsis=new o("ellipsis",{fontCharacter:"\\ea7c"}),o.kebabHorizontal=new o("kebab-horizontal",{fontCharacter:"\\ea7c"}),o.mailReply=new o("mail-reply",{fontCharacter:"\\ea7d"}),o.reply=new o("reply",{fontCharacter:"\\ea7d"}),o.organization=new o("organization",{fontCharacter:"\\ea7e"}),o.organizationFilled=new o("organization-filled",{fontCharacter:"\\ea7e"}),o.organizationOutline=new o("organization-outline",{fontCharacter:"\\ea7e"}),o.newFile=new o("new-file",{fontCharacter:"\\ea7f"}),o.fileAdd=new o("file-add",{fontCharacter:"\\ea7f"}),o.newFolder=new o("new-folder",{fontCharacter:"\\ea80"}),o.fileDirectoryCreate=new o("file-directory-create",{fontCharacter:"\\ea80"}),o.trash=new o("trash",{fontCharacter:"\\ea81"}),o.trashcan=new o("trashcan",{fontCharacter:"\\ea81"}),o.history=new o("history",{fontCharacter:"\\ea82"}),o.clock=new o("clock",{fontCharacter:"\\ea82"}),o.folder=new o("folder",{fontCharacter:"\\ea83"}),o.fileDirectory=new o("file-directory",{fontCharacter:"\\ea83"}),o.symbolFolder=new o("symbol-folder",{fontCharacter:"\\ea83"}),o.logoGithub=new o("logo-github",{fontCharacter:"\\ea84"}),o.markGithub=new o("mark-github",{fontCharacter:"\\ea84"}),o.github=new o("github",{fontCharacter:"\\ea84"}),o.terminal=new o("terminal",{fontCharacter:"\\ea85"}),o.console=new o("console",{fontCharacter:"\\ea85"}),o.repl=new o("repl",{fontCharacter:"\\ea85"}),o.zap=new o("zap",{fontCharacter:"\\ea86"}),o.symbolEvent=new o("symbol-event",{fontCharacter:"\\ea86"}),o.error=new o("error",{fontCharacter:"\\ea87"}),o.stop=new o("stop",{fontCharacter:"\\ea87"}),o.variable=new o("variable",{fontCharacter:"\\ea88"}),o.symbolVariable=new o("symbol-variable",{fontCharacter:"\\ea88"}),o.array=new o("array",{fontCharacter:"\\ea8a"}),o.symbolArray=new o("symbol-array",{fontCharacter:"\\ea8a"}),o.symbolModule=new o("symbol-module",{fontCharacter:"\\ea8b"}),o.symbolPackage=new o("symbol-package",{fontCharacter:"\\ea8b"}),o.symbolNamespace=new o("symbol-namespace",{fontCharacter:"\\ea8b"}),o.symbolObject=new o("symbol-object",{fontCharacter:"\\ea8b"}),o.symbolMethod=new o("symbol-method",{fontCharacter:"\\ea8c"}),o.symbolFunction=new o("symbol-function",{fontCharacter:"\\ea8c"}),o.symbolConstructor=new o("symbol-constructor",{fontCharacter:"\\ea8c"}),o.symbolBoolean=new o("symbol-boolean",{fontCharacter:"\\ea8f"}),o.symbolNull=new o("symbol-null",{fontCharacter:"\\ea8f"}),o.symbolNumeric=new o("symbol-numeric",{fontCharacter:"\\ea90"}),o.symbolNumber=new o("symbol-number",{fontCharacter:"\\ea90"}),o.symbolStructure=new o("symbol-structure",{fontCharacter:"\\ea91"}),o.symbolStruct=new o("symbol-struct",{fontCharacter:"\\ea91"}),o.symbolParameter=new o("symbol-parameter",{fontCharacter:"\\ea92"}),o.symbolTypeParameter=new o("symbol-type-parameter",{fontCharacter:"\\ea92"}),o.symbolKey=new o("symbol-key",{fontCharacter:"\\ea93"}),o.symbolText=new o("symbol-text",{fontCharacter:"\\ea93"}),o.symbolReference=new o("symbol-reference",{fontCharacter:"\\ea94"}),o.goToFile=new o("go-to-file",{fontCharacter:"\\ea94"}),o.symbolEnum=new o("symbol-enum",{fontCharacter:"\\ea95"}),o.symbolValue=new o("symbol-value",{fontCharacter:"\\ea95"}),o.symbolRuler=new o("symbol-ruler",{fontCharacter:"\\ea96"}),o.symbolUnit=new o("symbol-unit",{fontCharacter:"\\ea96"}),o.activateBreakpoints=new o("activate-breakpoints",{fontCharacter:"\\ea97"}),o.archive=new o("archive",{fontCharacter:"\\ea98"}),o.arrowBoth=new o("arrow-both",{fontCharacter:"\\ea99"}),o.arrowDown=new o("arrow-down",{fontCharacter:"\\ea9a"}),o.arrowLeft=new o("arrow-left",{fontCharacter:"\\ea9b"}),o.arrowRight=new o("arrow-right",{fontCharacter:"\\ea9c"}),o.arrowSmallDown=new o("arrow-small-down",{fontCharacter:"\\ea9d"}),o.arrowSmallLeft=new o("arrow-small-left",{fontCharacter:"\\ea9e"}),o.arrowSmallRight=new o("arrow-small-right",{fontCharacter:"\\ea9f"}),o.arrowSmallUp=new o("arrow-small-up",{fontCharacter:"\\eaa0"}),o.arrowUp=new o("arrow-up",{fontCharacter:"\\eaa1"}),o.bell=new o("bell",{fontCharacter:"\\eaa2"}),o.bold=new o("bold",{fontCharacter:"\\eaa3"}),o.book=new o("book",{fontCharacter:"\\eaa4"}),o.bookmark=new o("bookmark",{fontCharacter:"\\eaa5"}),o.debugBreakpointConditionalUnverified=new o("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),o.debugBreakpointConditional=new o("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),o.debugBreakpointConditionalDisabled=new o("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),o.debugBreakpointDataUnverified=new o("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),o.debugBreakpointData=new o("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),o.debugBreakpointDataDisabled=new o("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),o.debugBreakpointLogUnverified=new o("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),o.debugBreakpointLog=new o("debug-breakpoint-log",{fontCharacter:"\\eaab"}),o.debugBreakpointLogDisabled=new o("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),o.briefcase=new o("briefcase",{fontCharacter:"\\eaac"}),o.broadcast=new o("broadcast",{fontCharacter:"\\eaad"}),o.browser=new o("browser",{fontCharacter:"\\eaae"}),o.bug=new o("bug",{fontCharacter:"\\eaaf"}),o.calendar=new o("calendar",{fontCharacter:"\\eab0"}),o.caseSensitive=new o("case-sensitive",{fontCharacter:"\\eab1"}),o.check=new o("check",{fontCharacter:"\\eab2"}),o.checklist=new o("checklist",{fontCharacter:"\\eab3"}),o.chevronDown=new o("chevron-down",{fontCharacter:"\\eab4"}),o.dropDownButton=new o("drop-down-button",o.chevronDown.definition),o.chevronLeft=new o("chevron-left",{fontCharacter:"\\eab5"}),o.chevronRight=new o("chevron-right",{fontCharacter:"\\eab6"}),o.chevronUp=new o("chevron-up",{fontCharacter:"\\eab7"}),o.chromeClose=new o("chrome-close",{fontCharacter:"\\eab8"}),o.chromeMaximize=new o("chrome-maximize",{fontCharacter:"\\eab9"}),o.chromeMinimize=new o("chrome-minimize",{fontCharacter:"\\eaba"}),o.chromeRestore=new o("chrome-restore",{fontCharacter:"\\eabb"}),o.circleOutline=new o("circle-outline",{fontCharacter:"\\eabc"}),o.debugBreakpointUnverified=new o("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),o.circleSlash=new o("circle-slash",{fontCharacter:"\\eabd"}),o.circuitBoard=new o("circuit-board",{fontCharacter:"\\eabe"}),o.clearAll=new o("clear-all",{fontCharacter:"\\eabf"}),o.clippy=new o("clippy",{fontCharacter:"\\eac0"}),o.closeAll=new o("close-all",{fontCharacter:"\\eac1"}),o.cloudDownload=new o("cloud-download",{fontCharacter:"\\eac2"}),o.cloudUpload=new o("cloud-upload",{fontCharacter:"\\eac3"}),o.code=new o("code",{fontCharacter:"\\eac4"}),o.collapseAll=new o("collapse-all",{fontCharacter:"\\eac5"}),o.colorMode=new o("color-mode",{fontCharacter:"\\eac6"}),o.commentDiscussion=new o("comment-discussion",{fontCharacter:"\\eac7"}),o.compareChanges=new o("compare-changes",{fontCharacter:"\\eafd"}),o.creditCard=new o("credit-card",{fontCharacter:"\\eac9"}),o.dash=new o("dash",{fontCharacter:"\\eacc"}),o.dashboard=new o("dashboard",{fontCharacter:"\\eacd"}),o.database=new o("database",{fontCharacter:"\\eace"}),o.debugContinue=new o("debug-continue",{fontCharacter:"\\eacf"}),o.debugDisconnect=new o("debug-disconnect",{fontCharacter:"\\ead0"}),o.debugPause=new o("debug-pause",{fontCharacter:"\\ead1"}),o.debugRestart=new o("debug-restart",{fontCharacter:"\\ead2"}),o.debugStart=new o("debug-start",{fontCharacter:"\\ead3"}),o.debugStepInto=new o("debug-step-into",{fontCharacter:"\\ead4"}),o.debugStepOut=new o("debug-step-out",{fontCharacter:"\\ead5"}),o.debugStepOver=new o("debug-step-over",{fontCharacter:"\\ead6"}),o.debugStop=new o("debug-stop",{fontCharacter:"\\ead7"}),o.debug=new o("debug",{fontCharacter:"\\ead8"}),o.deviceCameraVideo=new o("device-camera-video",{fontCharacter:"\\ead9"}),o.deviceCamera=new o("device-camera",{fontCharacter:"\\eada"}),o.deviceMobile=new o("device-mobile",{fontCharacter:"\\eadb"}),o.diffAdded=new o("diff-added",{fontCharacter:"\\eadc"}),o.diffIgnored=new o("diff-ignored",{fontCharacter:"\\eadd"}),o.diffModified=new o("diff-modified",{fontCharacter:"\\eade"}),o.diffRemoved=new o("diff-removed",{fontCharacter:"\\eadf"}),o.diffRenamed=new o("diff-renamed",{fontCharacter:"\\eae0"}),o.diff=new o("diff",{fontCharacter:"\\eae1"}),o.discard=new o("discard",{fontCharacter:"\\eae2"}),o.editorLayout=new o("editor-layout",{fontCharacter:"\\eae3"}),o.emptyWindow=new o("empty-window",{fontCharacter:"\\eae4"}),o.exclude=new o("exclude",{fontCharacter:"\\eae5"}),o.extensions=new o("extensions",{fontCharacter:"\\eae6"}),o.eyeClosed=new o("eye-closed",{fontCharacter:"\\eae7"}),o.fileBinary=new o("file-binary",{fontCharacter:"\\eae8"}),o.fileCode=new o("file-code",{fontCharacter:"\\eae9"}),o.fileMedia=new o("file-media",{fontCharacter:"\\eaea"}),o.filePdf=new o("file-pdf",{fontCharacter:"\\eaeb"}),o.fileSubmodule=new o("file-submodule",{fontCharacter:"\\eaec"}),o.fileSymlinkDirectory=new o("file-symlink-directory",{fontCharacter:"\\eaed"}),o.fileSymlinkFile=new o("file-symlink-file",{fontCharacter:"\\eaee"}),o.fileZip=new o("file-zip",{fontCharacter:"\\eaef"}),o.files=new o("files",{fontCharacter:"\\eaf0"}),o.filter=new o("filter",{fontCharacter:"\\eaf1"}),o.flame=new o("flame",{fontCharacter:"\\eaf2"}),o.foldDown=new o("fold-down",{fontCharacter:"\\eaf3"}),o.foldUp=new o("fold-up",{fontCharacter:"\\eaf4"}),o.fold=new o("fold",{fontCharacter:"\\eaf5"}),o.folderActive=new o("folder-active",{fontCharacter:"\\eaf6"}),o.folderOpened=new o("folder-opened",{fontCharacter:"\\eaf7"}),o.gear=new o("gear",{fontCharacter:"\\eaf8"}),o.gift=new o("gift",{fontCharacter:"\\eaf9"}),o.gistSecret=new o("gist-secret",{fontCharacter:"\\eafa"}),o.gist=new o("gist",{fontCharacter:"\\eafb"}),o.gitCommit=new o("git-commit",{fontCharacter:"\\eafc"}),o.gitCompare=new o("git-compare",{fontCharacter:"\\eafd"}),o.gitMerge=new o("git-merge",{fontCharacter:"\\eafe"}),o.githubAction=new o("github-action",{fontCharacter:"\\eaff"}),o.githubAlt=new o("github-alt",{fontCharacter:"\\eb00"}),o.globe=new o("globe",{fontCharacter:"\\eb01"}),o.grabber=new o("grabber",{fontCharacter:"\\eb02"}),o.graph=new o("graph",{fontCharacter:"\\eb03"}),o.gripper=new o("gripper",{fontCharacter:"\\eb04"}),o.heart=new o("heart",{fontCharacter:"\\eb05"}),o.home=new o("home",{fontCharacter:"\\eb06"}),o.horizontalRule=new o("horizontal-rule",{fontCharacter:"\\eb07"}),o.hubot=new o("hubot",{fontCharacter:"\\eb08"}),o.inbox=new o("inbox",{fontCharacter:"\\eb09"}),o.issueClosed=new o("issue-closed",{fontCharacter:"\\eba4"}),o.issueReopened=new o("issue-reopened",{fontCharacter:"\\eb0b"}),o.issues=new o("issues",{fontCharacter:"\\eb0c"}),o.italic=new o("italic",{fontCharacter:"\\eb0d"}),o.jersey=new o("jersey",{fontCharacter:"\\eb0e"}),o.json=new o("json",{fontCharacter:"\\eb0f"}),o.kebabVertical=new o("kebab-vertical",{fontCharacter:"\\eb10"}),o.key=new o("key",{fontCharacter:"\\eb11"}),o.law=new o("law",{fontCharacter:"\\eb12"}),o.lightbulbAutofix=new o("lightbulb-autofix",{fontCharacter:"\\eb13"}),o.linkExternal=new o("link-external",{fontCharacter:"\\eb14"}),o.link=new o("link",{fontCharacter:"\\eb15"}),o.listOrdered=new o("list-ordered",{fontCharacter:"\\eb16"}),o.listUnordered=new o("list-unordered",{fontCharacter:"\\eb17"}),o.liveShare=new o("live-share",{fontCharacter:"\\eb18"}),o.loading=new o("loading",{fontCharacter:"\\eb19"}),o.location=new o("location",{fontCharacter:"\\eb1a"}),o.mailRead=new o("mail-read",{fontCharacter:"\\eb1b"}),o.mail=new o("mail",{fontCharacter:"\\eb1c"}),o.markdown=new o("markdown",{fontCharacter:"\\eb1d"}),o.megaphone=new o("megaphone",{fontCharacter:"\\eb1e"}),o.mention=new o("mention",{fontCharacter:"\\eb1f"}),o.milestone=new o("milestone",{fontCharacter:"\\eb20"}),o.mortarBoard=new o("mortar-board",{fontCharacter:"\\eb21"}),o.move=new o("move",{fontCharacter:"\\eb22"}),o.multipleWindows=new o("multiple-windows",{fontCharacter:"\\eb23"}),o.mute=new o("mute",{fontCharacter:"\\eb24"}),o.noNewline=new o("no-newline",{fontCharacter:"\\eb25"}),o.note=new o("note",{fontCharacter:"\\eb26"}),o.octoface=new o("octoface",{fontCharacter:"\\eb27"}),o.openPreview=new o("open-preview",{fontCharacter:"\\eb28"}),o.package_=new o("package",{fontCharacter:"\\eb29"}),o.paintcan=new o("paintcan",{fontCharacter:"\\eb2a"}),o.pin=new o("pin",{fontCharacter:"\\eb2b"}),o.play=new o("play",{fontCharacter:"\\eb2c"}),o.run=new o("run",{fontCharacter:"\\eb2c"}),o.plug=new o("plug",{fontCharacter:"\\eb2d"}),o.preserveCase=new o("preserve-case",{fontCharacter:"\\eb2e"}),o.preview=new o("preview",{fontCharacter:"\\eb2f"}),o.project=new o("project",{fontCharacter:"\\eb30"}),o.pulse=new o("pulse",{fontCharacter:"\\eb31"}),o.question=new o("question",{fontCharacter:"\\eb32"}),o.quote=new o("quote",{fontCharacter:"\\eb33"}),o.radioTower=new o("radio-tower",{fontCharacter:"\\eb34"}),o.reactions=new o("reactions",{fontCharacter:"\\eb35"}),o.references=new o("references",{fontCharacter:"\\eb36"}),o.refresh=new o("refresh",{fontCharacter:"\\eb37"}),o.regex=new o("regex",{fontCharacter:"\\eb38"}),o.remoteExplorer=new o("remote-explorer",{fontCharacter:"\\eb39"}),o.remote=new o("remote",{fontCharacter:"\\eb3a"}),o.remove=new o("remove",{fontCharacter:"\\eb3b"}),o.replaceAll=new o("replace-all",{fontCharacter:"\\eb3c"}),o.replace=new o("replace",{fontCharacter:"\\eb3d"}),o.repoClone=new o("repo-clone",{fontCharacter:"\\eb3e"}),o.repoForcePush=new o("repo-force-push",{fontCharacter:"\\eb3f"}),o.repoPull=new o("repo-pull",{fontCharacter:"\\eb40"}),o.repoPush=new o("repo-push",{fontCharacter:"\\eb41"}),o.report=new o("report",{fontCharacter:"\\eb42"}),o.requestChanges=new o("request-changes",{fontCharacter:"\\eb43"}),o.rocket=new o("rocket",{fontCharacter:"\\eb44"}),o.rootFolderOpened=new o("root-folder-opened",{fontCharacter:"\\eb45"}),o.rootFolder=new o("root-folder",{fontCharacter:"\\eb46"}),o.rss=new o("rss",{fontCharacter:"\\eb47"}),o.ruby=new o("ruby",{fontCharacter:"\\eb48"}),o.saveAll=new o("save-all",{fontCharacter:"\\eb49"}),o.saveAs=new o("save-as",{fontCharacter:"\\eb4a"}),o.save=new o("save",{fontCharacter:"\\eb4b"}),o.screenFull=new o("screen-full",{fontCharacter:"\\eb4c"}),o.screenNormal=new o("screen-normal",{fontCharacter:"\\eb4d"}),o.searchStop=new o("search-stop",{fontCharacter:"\\eb4e"}),o.server=new o("server",{fontCharacter:"\\eb50"}),o.settingsGear=new o("settings-gear",{fontCharacter:"\\eb51"}),o.settings=new o("settings",{fontCharacter:"\\eb52"}),o.shield=new o("shield",{fontCharacter:"\\eb53"}),o.smiley=new o("smiley",{fontCharacter:"\\eb54"}),o.sortPrecedence=new o("sort-precedence",{fontCharacter:"\\eb55"}),o.splitHorizontal=new o("split-horizontal",{fontCharacter:"\\eb56"}),o.splitVertical=new o("split-vertical",{fontCharacter:"\\eb57"}),o.squirrel=new o("squirrel",{fontCharacter:"\\eb58"}),o.starFull=new o("star-full",{fontCharacter:"\\eb59"}),o.starHalf=new o("star-half",{fontCharacter:"\\eb5a"}),o.symbolClass=new o("symbol-class",{fontCharacter:"\\eb5b"}),o.symbolColor=new o("symbol-color",{fontCharacter:"\\eb5c"}),o.symbolConstant=new o("symbol-constant",{fontCharacter:"\\eb5d"}),o.symbolEnumMember=new o("symbol-enum-member",{fontCharacter:"\\eb5e"}),o.symbolField=new o("symbol-field",{fontCharacter:"\\eb5f"}),o.symbolFile=new o("symbol-file",{fontCharacter:"\\eb60"}),o.symbolInterface=new o("symbol-interface",{fontCharacter:"\\eb61"}),o.symbolKeyword=new o("symbol-keyword",{fontCharacter:"\\eb62"}),o.symbolMisc=new o("symbol-misc",{fontCharacter:"\\eb63"}),o.symbolOperator=new o("symbol-operator",{fontCharacter:"\\eb64"}),o.symbolProperty=new o("symbol-property",{fontCharacter:"\\eb65"}),o.wrench=new o("wrench",{fontCharacter:"\\eb65"}),o.wrenchSubaction=new o("wrench-subaction",{fontCharacter:"\\eb65"}),o.symbolSnippet=new o("symbol-snippet",{fontCharacter:"\\eb66"}),o.tasklist=new o("tasklist",{fontCharacter:"\\eb67"}),o.telescope=new o("telescope",{fontCharacter:"\\eb68"}),o.textSize=new o("text-size",{fontCharacter:"\\eb69"}),o.threeBars=new o("three-bars",{fontCharacter:"\\eb6a"}),o.thumbsdown=new o("thumbsdown",{fontCharacter:"\\eb6b"}),o.thumbsup=new o("thumbsup",{fontCharacter:"\\eb6c"}),o.tools=new o("tools",{fontCharacter:"\\eb6d"}),o.triangleDown=new o("triangle-down",{fontCharacter:"\\eb6e"}),o.triangleLeft=new o("triangle-left",{fontCharacter:"\\eb6f"}),o.triangleRight=new o("triangle-right",{fontCharacter:"\\eb70"}),o.triangleUp=new o("triangle-up",{fontCharacter:"\\eb71"}),o.twitter=new o("twitter",{fontCharacter:"\\eb72"}),o.unfold=new o("unfold",{fontCharacter:"\\eb73"}),o.unlock=new o("unlock",{fontCharacter:"\\eb74"}),o.unmute=new o("unmute",{fontCharacter:"\\eb75"}),o.unverified=new o("unverified",{fontCharacter:"\\eb76"}),o.verified=new o("verified",{fontCharacter:"\\eb77"}),o.versions=new o("versions",{fontCharacter:"\\eb78"}),o.vmActive=new o("vm-active",{fontCharacter:"\\eb79"}),o.vmOutline=new o("vm-outline",{fontCharacter:"\\eb7a"}),o.vmRunning=new o("vm-running",{fontCharacter:"\\eb7b"}),o.watch=new o("watch",{fontCharacter:"\\eb7c"}),o.whitespace=new o("whitespace",{fontCharacter:"\\eb7d"}),o.wholeWord=new o("whole-word",{fontCharacter:"\\eb7e"}),o.window=new o("window",{fontCharacter:"\\eb7f"}),o.wordWrap=new o("word-wrap",{fontCharacter:"\\eb80"}),o.zoomIn=new o("zoom-in",{fontCharacter:"\\eb81"}),o.zoomOut=new o("zoom-out",{fontCharacter:"\\eb82"}),o.listFilter=new o("list-filter",{fontCharacter:"\\eb83"}),o.listFlat=new o("list-flat",{fontCharacter:"\\eb84"}),o.listSelection=new o("list-selection",{fontCharacter:"\\eb85"}),o.selection=new o("selection",{fontCharacter:"\\eb85"}),o.listTree=new o("list-tree",{fontCharacter:"\\eb86"}),o.debugBreakpointFunctionUnverified=new o("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),o.debugBreakpointFunction=new o("debug-breakpoint-function",{fontCharacter:"\\eb88"}),o.debugBreakpointFunctionDisabled=new o("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),o.debugStackframeActive=new o("debug-stackframe-active",{fontCharacter:"\\eb89"}),o.debugStackframeDot=new o("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),o.debugStackframe=new o("debug-stackframe",{fontCharacter:"\\eb8b"}),o.debugStackframeFocused=new o("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),o.debugBreakpointUnsupported=new o("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),o.symbolString=new o("symbol-string",{fontCharacter:"\\eb8d"}),o.debugReverseContinue=new o("debug-reverse-continue",{fontCharacter:"\\eb8e"}),o.debugStepBack=new o("debug-step-back",{fontCharacter:"\\eb8f"}),o.debugRestartFrame=new o("debug-restart-frame",{fontCharacter:"\\eb90"}),o.callIncoming=new o("call-incoming",{fontCharacter:"\\eb92"}),o.callOutgoing=new o("call-outgoing",{fontCharacter:"\\eb93"}),o.menu=new o("menu",{fontCharacter:"\\eb94"}),o.expandAll=new o("expand-all",{fontCharacter:"\\eb95"}),o.feedback=new o("feedback",{fontCharacter:"\\eb96"}),o.groupByRefType=new o("group-by-ref-type",{fontCharacter:"\\eb97"}),o.ungroupByRefType=new o("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),o.account=new o("account",{fontCharacter:"\\eb99"}),o.bellDot=new o("bell-dot",{fontCharacter:"\\eb9a"}),o.debugConsole=new o("debug-console",{fontCharacter:"\\eb9b"}),o.library=new o("library",{fontCharacter:"\\eb9c"}),o.output=new o("output",{fontCharacter:"\\eb9d"}),o.runAll=new o("run-all",{fontCharacter:"\\eb9e"}),o.syncIgnored=new o("sync-ignored",{fontCharacter:"\\eb9f"}),o.pinned=new o("pinned",{fontCharacter:"\\eba0"}),o.githubInverted=new o("github-inverted",{fontCharacter:"\\eba1"}),o.debugAlt=new o("debug-alt",{fontCharacter:"\\eb91"}),o.serverProcess=new o("server-process",{fontCharacter:"\\eba2"}),o.serverEnvironment=new o("server-environment",{fontCharacter:"\\eba3"}),o.pass=new o("pass",{fontCharacter:"\\eba4"}),o.stopCircle=new o("stop-circle",{fontCharacter:"\\eba5"}),o.playCircle=new o("play-circle",{fontCharacter:"\\eba6"}),o.record=new o("record",{fontCharacter:"\\eba7"}),o.debugAltSmall=new o("debug-alt-small",{fontCharacter:"\\eba8"}),o.vmConnect=new o("vm-connect",{fontCharacter:"\\eba9"}),o.cloud=new o("cloud",{fontCharacter:"\\ebaa"}),o.merge=new o("merge",{fontCharacter:"\\ebab"}),o.exportIcon=new o("export",{fontCharacter:"\\ebac"}),o.graphLeft=new o("graph-left",{fontCharacter:"\\ebad"}),o.magnet=new o("magnet",{fontCharacter:"\\ebae"}),o.notebook=new o("notebook",{fontCharacter:"\\ebaf"}),o.redo=new o("redo",{fontCharacter:"\\ebb0"}),o.checkAll=new o("check-all",{fontCharacter:"\\ebb1"}),o.pinnedDirty=new o("pinned-dirty",{fontCharacter:"\\ebb2"}),o.passFilled=new o("pass-filled",{fontCharacter:"\\ebb3"}),o.circleLargeFilled=new o("circle-large-filled",{fontCharacter:"\\ebb4"}),o.circleLargeOutline=new o("circle-large-outline",{fontCharacter:"\\ebb5"}),o.combine=new o("combine",{fontCharacter:"\\ebb6"}),o.gather=new o("gather",{fontCharacter:"\\ebb6"}),o.table=new o("table",{fontCharacter:"\\ebb7"}),o.variableGroup=new o("variable-group",{fontCharacter:"\\ebb8"}),o.typeHierarchy=new o("type-hierarchy",{fontCharacter:"\\ebb9"}),o.typeHierarchySub=new o("type-hierarchy-sub",{fontCharacter:"\\ebba"}),o.typeHierarchySuper=new o("type-hierarchy-super",{fontCharacter:"\\ebbb"}),o.gitPullRequestCreate=new o("git-pull-request-create",{fontCharacter:"\\ebbc"}),o.runAbove=new o("run-above",{fontCharacter:"\\ebbd"}),o.runBelow=new o("run-below",{fontCharacter:"\\ebbe"}),o.notebookTemplate=new o("notebook-template",{fontCharacter:"\\ebbf"}),o.debugRerun=new o("debug-rerun",{fontCharacter:"\\ebc0"}),o.workspaceTrusted=new o("workspace-trusted",{fontCharacter:"\\ebc1"}),o.workspaceUntrusted=new o("workspace-untrusted",{fontCharacter:"\\ebc2"}),o.workspaceUnspecified=new o("workspace-unspecified",{fontCharacter:"\\ebc3"}),o.terminalCmd=new o("terminal-cmd",{fontCharacter:"\\ebc4"}),o.terminalDebian=new o("terminal-debian",{fontCharacter:"\\ebc5"}),o.terminalLinux=new o("terminal-linux",{fontCharacter:"\\ebc6"}),o.terminalPowershell=new o("terminal-powershell",{fontCharacter:"\\ebc7"}),o.terminalTmux=new o("terminal-tmux",{fontCharacter:"\\ebc8"}),o.terminalUbuntu=new o("terminal-ubuntu",{fontCharacter:"\\ebc9"}),o.terminalBash=new o("terminal-bash",{fontCharacter:"\\ebca"}),o.arrowSwap=new o("arrow-swap",{fontCharacter:"\\ebcb"}),o.copy=new o("copy",{fontCharacter:"\\ebcc"}),o.personAdd=new o("person-add",{fontCharacter:"\\ebcd"}),o.filterFilled=new o("filter-filled",{fontCharacter:"\\ebce"}),o.wand=new o("wand",{fontCharacter:"\\ebcf"}),o.debugLineByLine=new o("debug-line-by-line",{fontCharacter:"\\ebd0"}),o.inspect=new o("inspect",{fontCharacter:"\\ebd1"}),o.layers=new o("layers",{fontCharacter:"\\ebd2"}),o.layersDot=new o("layers-dot",{fontCharacter:"\\ebd3"}),o.layersActive=new o("layers-active",{fontCharacter:"\\ebd4"}),o.compass=new o("compass",{fontCharacter:"\\ebd5"}),o.compassDot=new o("compass-dot",{fontCharacter:"\\ebd6"}),o.compassActive=new o("compass-active",{fontCharacter:"\\ebd7"}),o.azure=new o("azure",{fontCharacter:"\\ebd8"}),o.issueDraft=new o("issue-draft",{fontCharacter:"\\ebd9"}),o.gitPullRequestClosed=new o("git-pull-request-closed",{fontCharacter:"\\ebda"}),o.gitPullRequestDraft=new o("git-pull-request-draft",{fontCharacter:"\\ebdb"}),o.debugAll=new o("debug-all",{fontCharacter:"\\ebdc"}),o.debugCoverage=new o("debug-coverage",{fontCharacter:"\\ebdd"}),o.runErrors=new o("run-errors",{fontCharacter:"\\ebde"}),o.folderLibrary=new o("folder-library",{fontCharacter:"\\ebdf"}),o.debugContinueSmall=new o("debug-continue-small",{fontCharacter:"\\ebe0"}),o.beakerStop=new o("beaker-stop",{fontCharacter:"\\ebe1"}),o.graphLine=new o("graph-line",{fontCharacter:"\\ebe2"}),o.graphScatter=new o("graph-scatter",{fontCharacter:"\\ebe3"}),o.pieChart=new o("pie-chart",{fontCharacter:"\\ebe4"}),o.bracket=new o("bracket",o.json.definition),o.bracketDot=new o("bracket-dot",{fontCharacter:"\\ebe5"}),o.bracketError=new o("bracket-error",{fontCharacter:"\\ebe6"}),o.lockSmall=new o("lock-small",{fontCharacter:"\\ebe7"}),o.azureDevops=new o("azure-devops",{fontCharacter:"\\ebe8"}),o.verifiedFilled=new o("verified-filled",{fontCharacter:"\\ebe9"})}(me||(me={}))},79881:function(vn,Et,A){"use strict";A.d(Et,{B8:function(){return D},Cp:function(){return fe},F0:function(){return ce},L6:function(){return x},VV:function(){return me},b1:function(){return o},dL:function(){return Te},ri:function(){return $}});class k{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+`
`+m.stack):m},0)}}emit(m){this.listeners.forEach(y=>{y(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const pe=new k;function Te(h){me(h)||pe.onUnexpectedError(h)}function fe(h){me(h)||pe.onUnexpectedExternalError(h)}function $(h){if(h instanceof Error){let{name:m,message:y}=h;const S=h.stacktrace||h.stack;return{$isError:!0,name:m,message:y,stack:S}}return h}const p="Canceled";function me(h){return h instanceof Error&&h.name===p&&h.message===p}function ce(){const h=new Error(p);return h.name=h.message,h}function o(h){return h?new Error(`Illegal argument: ${h}`):new Error("Illegal argument")}function x(h){return h?new Error(`Illegal state: ${h}`):new Error("Illegal state")}class D extends Error{constructor(m){super("NotSupported"),m&&(this.message=m)}}},4348:function(vn,Et,A){"use strict";A.d(Et,{D0:function(){return D},E7:function(){return h},K3:function(){return x},Q5:function(){return o},ZD:function(){return m},ju:function(){return $}});var k=A(79881),pe=A(69323),Te=A(34502),fe=A(95830),$;(function(y){y.None=()=>pe.JT.None;function S(j){return(X,ne=null,J)=>{let v=!1,g;return g=j(U=>{if(!v)return g?g.dispose():v=!0,X.call(ne,U)},null,J),v&&g.dispose(),g}}y.once=S;function M(j,X){return R((ne,J=null,v)=>j(g=>ne.call(J,X(g)),null,v))}y.map=M;function z(j,X){return R((ne,J=null,v)=>j(g=>{X(g),ne.call(J,g)},null,v))}y.forEach=z;function Y(j,X){return R((ne,J=null,v)=>j(g=>X(g)&&ne.call(J,g),null,v))}y.filter=Y;function L(j){return j}y.signal=L;function O(...j){return(X,ne=null,J)=>(0,pe.F8)(...j.map(v=>v(g=>X.call(ne,g),null,J)))}y.any=O;function T(j,X,ne){let J=ne;return M(j,v=>(J=X(J,v),J))}y.reduce=T;function R(j){let X;const ne=new o({onFirstListenerAdd(){X=j(ne.fire,ne)},onLastListenerRemove(){X.dispose()}});return ne.event}function se(j,X,ne=100,J=!1,v){let g,U,ie,Be=0;const Ze=new o({leakWarningThreshold:v,onFirstListenerAdd(){g=j(Qe=>{Be++,U=X(U,Qe),J&&!ie&&(Ze.fire(U),U=void 0),clearTimeout(ie),ie=setTimeout(()=>{const nt=U;U=void 0,ie=void 0,(!J||Be>1)&&Ze.fire(nt),Be=0},ne)})},onLastListenerRemove(){g.dispose()}});return Ze.event}y.debounce=se;function ae(j,X=(ne,J)=>ne===J){let ne=!0,J;return Y(j,v=>{const g=ne||!X(v,J);return ne=!1,J=v,g})}y.latch=ae;function q(j,X){return[y.filter(j,X),y.filter(j,ne=>!X(ne))]}y.split=q;function he(j,X=!1,ne=[]){let J=ne.slice(),v=j(ie=>{J?J.push(ie):U.fire(ie)});const g=()=>{J&&J.forEach(ie=>U.fire(ie)),J=null},U=new o({onFirstListenerAdd(){v||(v=j(ie=>U.fire(ie)))},onFirstListenerDidAdd(){J&&(X?setTimeout(g):g())},onLastListenerRemove(){v&&v.dispose(),v=null}});return U.event}y.buffer=he;class ve{constructor(X){this.event=X}map(X){return new ve(M(this.event,X))}forEach(X){return new ve(z(this.event,X))}filter(X){return new ve(Y(this.event,X))}reduce(X,ne){return new ve(T(this.event,X,ne))}latch(){return new ve(ae(this.event))}debounce(X,ne=100,J=!1,v){return new ve(se(this.event,X,ne,J,v))}on(X,ne,J){return this.event(X,ne,J)}once(X,ne,J){return S(this.event)(X,ne,J)}}function be(j){return new ve(j)}y.chain=be;function Oe(j,X,ne=J=>J){const J=(...ie)=>U.fire(ne(...ie)),v=()=>j.on(X,J),g=()=>j.removeListener(X,J),U=new o({onFirstListenerAdd:v,onLastListenerRemove:g});return U.event}y.fromNodeEventEmitter=Oe;function Q(j,X,ne=J=>J){const J=(...ie)=>U.fire(ne(...ie)),v=()=>j.addEventListener(X,J),g=()=>j.removeEventListener(X,J),U=new o({onFirstListenerAdd:v,onLastListenerRemove:g});return U.event}y.fromDOMEventEmitter=Q;function P(j){return new Promise(X=>S(j)(X))}y.toPromise=P})($||($={}));class p{constructor(S){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${S}_${p._idPool++}`}start(S){this._stopWatch=new fe.G(!0),this._listenerCount=S}stop(){if(this._stopWatch){const S=this._stopWatch.elapsed();this._elapsedOverall+=S,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${S.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}p._idPool=0;let me=-1;class ce{constructor(S,M=Math.random().toString(18).slice(2,5)){this.customThreshold=S,this.name=M,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(S){let M=me;if(typeof this.customThreshold=="number"&&(M=this.customThreshold),M<=0||S<M)return;this._stacks||(this._stacks=new Map);const z=new Error().stack.split(`
`).slice(3).join(`
`),Y=this._stacks.get(z)||0;if(this._stacks.set(z,Y+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=M*.5;let L,O=0;for(const[T,R]of this._stacks)(!L||O<R)&&(L=T,O=R);console.warn(`[${this.name}] potential listener LEAK detected, having ${S} listeners already. MOST frequent listener (${O}):`),console.warn(L)}return()=>{const L=this._stacks.get(z)||0;this._stacks.set(z,L-1)}}}class o{constructor(S){var M;this._disposed=!1,this._options=S,this._leakageMon=me>0?new ce(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((M=this._options)===null||M===void 0)&&M._profName?new p(this._options._profName):void 0}get event(){return this._event||(this._event=(S,M,z)=>{var Y;this._listeners||(this._listeners=new Te.S);const L=this._listeners.isEmpty();L&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const O=this._listeners.push(M?[S,M]:S);L&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,S,M);const T=(Y=this._leakageMon)===null||Y===void 0?void 0:Y.check(this._listeners.size),R=(0,pe.OF)(()=>{T&&T(),this._disposed||(O(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return z instanceof pe.SL?z.add(R):Array.isArray(z)&&z.push(R),R}),this._event}fire(S){var M,z;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Te.S);for(let Y of this._listeners)this._deliveryQueue.push([Y,S]);for((M=this._perfMon)===null||M===void 0||M.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[Y,L]=this._deliveryQueue.shift();try{typeof Y=="function"?Y.call(void 0,L):Y[0].call(Y[1],L)}catch(O){(0,k.dL)(O)}}(z=this._perfMon)===null||z===void 0||z.stop()}}dispose(){var S,M,z,Y,L;this._disposed||(this._disposed=!0,(S=this._listeners)===null||S===void 0||S.clear(),(M=this._deliveryQueue)===null||M===void 0||M.clear(),(Y=(z=this._options)===null||z===void 0?void 0:z.onLastListenerRemove)===null||Y===void 0||Y.call(z),(L=this._leakageMon)===null||L===void 0||L.dispose())}}class x extends o{constructor(S){super(S),this._isPaused=0,this._eventQueue=new Te.S,this._mergeFn=S==null?void 0:S.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const S=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(S))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(S){this._listeners&&(this._isPaused!==0?this._eventQueue.push(S):super.fire(S))}}class D extends x{constructor(S){var M;super(S),this._delay=(M=S.delay)!==null&&M!==void 0?M:100}fire(S){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(S)}}class h{constructor(){this.buffers=[]}wrapEvent(S){return(M,z,Y)=>S(L=>{const O=this.buffers[this.buffers.length-1];O?O.push(()=>M.call(z,L)):M.call(z,L)},void 0,Y)}bufferEvents(S){const M=[];this.buffers.push(M);const z=S();return this.buffers.pop(),M.forEach(Y=>Y()),z}}class m{constructor(){this.listening=!1,this.inputEvent=$.None,this.inputEventListener=pe.JT.None,this.emitter=new o({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(S){this.inputEvent=S,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=S(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(vn,Et,A){"use strict";A.d(Et,{I:function(){return k}});function k(pe){const Te=this;let fe=!1,$;return function(){return fe||(fe=!0,$=pe.apply(Te,arguments)),$}}},88226:function(vn,Et,A){"use strict";A.d(Et,{$:function(){return k}});var k;(function(pe){function Te(O){return O&&typeof O=="object"&&typeof O[Symbol.iterator]=="function"}pe.is=Te;const fe=Object.freeze([]);function $(){return fe}pe.empty=$;function*p(O){yield O}pe.single=p;function me(O){return O||fe}pe.from=me;function ce(O){return!O||O[Symbol.iterator]().next().done===!0}pe.isEmpty=ce;function o(O){return O[Symbol.iterator]().next().value}pe.first=o;function x(O,T){for(const R of O)if(T(R))return!0;return!1}pe.some=x;function D(O,T){for(const R of O)if(T(R))return R}pe.find=D;function*h(O,T){for(const R of O)T(R)&&(yield R)}pe.filter=h;function*m(O,T){let R=0;for(const se of O)yield T(se,R++)}pe.map=m;function*y(...O){for(const T of O)for(const R of T)yield R}pe.concat=y;function*S(O){for(const T of O)for(const R of T)yield R}pe.concatNested=S;function M(O,T,R){let se=R;for(const ae of O)se=T(se,ae);return se}pe.reduce=M;function*z(O,T,R=O.length){for(T<0&&(T+=O.length),R<0?R+=O.length:R>O.length&&(R=O.length);T<R;T++)yield O[T]}pe.slice=z;function Y(O,T=Number.POSITIVE_INFINITY){const R=[];if(T===0)return[R,O];const se=O[Symbol.iterator]();for(let ae=0;ae<T;ae++){const q=se.next();if(q.done)return[R,pe.empty()];R.push(q.value)}return[R,{[Symbol.iterator](){return se}}]}pe.consume=Y;function L(O,T,R=(se,ae)=>se===ae){const se=O[Symbol.iterator](),ae=T[Symbol.iterator]();for(;;){const q=se.next(),he=ae.next();if(q.done!==he.done)return!1;if(q.done)return!0;if(!R(q.value,he.value))return!1}}pe.equals=L})(k||(k={}))},69323:function(vn,Et,A){"use strict";A.d(Et,{B9:function(){return m},F8:function(){return y},JT:function(){return z},Jz:function(){return L},OF:function(){return S},SL:function(){return M},Wf:function(){return h},XK:function(){return Y},dk:function(){return x}});var k=A(17845),pe=A(88226);const Te=!1;let fe=null;function $(O){fe=O}if(Te){const O="__is_disposable_tracked__";$(new class{trackDisposable(T){const R=new Error("Potentially leaked disposable").stack;setTimeout(()=>{T[O]||console.log(R)},3e3)}setParent(T,R){if(T&&T!==z.None)try{T[O]=!0}catch(se){}}markAsDisposed(T){if(T&&T!==z.None)try{T[O]=!0}catch(R){}}markAsSingleton(T){}})}function p(O){return fe==null||fe.trackDisposable(O),O}function me(O){fe==null||fe.markAsDisposed(O)}function ce(O,T){fe==null||fe.setParent(O,T)}function o(O,T){if(fe)for(const R of O)fe.setParent(R,T)}function x(O){return fe==null||fe.markAsSingleton(O),O}class D extends Error{constructor(T){super(`Encountered errors while disposing of store. Errors: [${T.join(", ")}]`),this.errors=T}}function h(O){return typeof O.dispose=="function"&&O.dispose.length===0}function m(O){if(pe.$.is(O)){let T=[];for(const R of O)if(R)try{R.dispose()}catch(se){T.push(se)}if(T.length===1)throw T[0];if(T.length>1)throw new D(T);return Array.isArray(O)?[]:O}else if(O)return O.dispose(),O}function y(...O){const T=S(()=>m(O));return o(O,T),T}function S(O){const T=p({dispose:(0,k.I)(()=>{me(T),O()})});return T}class M{constructor(){this._toDispose=new Set,this._isDisposed=!1,p(this)}dispose(){this._isDisposed||(me(this),this._isDisposed=!0,this.clear())}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(T){if(!T)return T;if(T===this)throw new Error("Cannot register a disposable on itself!");return ce(T,this),this._isDisposed?M.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(T),T}}M.DISABLE_DISPOSED_WARNING=!1;class z{constructor(){this._store=new M,p(this),ce(this._store,this)}dispose(){me(this),this._store.dispose()}_register(T){if(T===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(T)}}z.None=Object.freeze({dispose(){}});class Y{constructor(){this._isDisposed=!1,p(this)}get value(){return this._isDisposed?void 0:this._value}set value(T){var R;this._isDisposed||T===this._value||((R=this._value)===null||R===void 0||R.dispose(),T&&ce(T,this),this._value=T)}clear(){this.value=void 0}dispose(){var T;this._isDisposed=!0,me(this),(T=this._value)===null||T===void 0||T.dispose(),this._value=void 0}clearAndLeak(){const T=this._value;return this._value=void 0,T&&ce(T,null),T}}class L{constructor(T){this.object=T}dispose(){}}},34502:function(vn,Et,A){"use strict";A.d(Et,{S:function(){return pe}});class k{constructor(fe){this.element=fe,this.next=k.Undefined,this.prev=k.Undefined}}k.Undefined=new k(void 0);class pe{constructor(){this._first=k.Undefined,this._last=k.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===k.Undefined}clear(){let fe=this._first;for(;fe!==k.Undefined;){const $=fe.next;fe.prev=k.Undefined,fe.next=k.Undefined,fe=$}this._first=k.Undefined,this._last=k.Undefined,this._size=0}unshift(fe){return this._insert(fe,!1)}push(fe){return this._insert(fe,!0)}_insert(fe,$){const p=new k(fe);if(this._first===k.Undefined)this._first=p,this._last=p;else if($){const ce=this._last;this._last=p,p.prev=ce,ce.next=p}else{const ce=this._first;this._first=p,p.next=ce,ce.prev=p}this._size+=1;let me=!1;return()=>{me||(me=!0,this._remove(p))}}shift(){if(this._first!==k.Undefined){const fe=this._first.element;return this._remove(this._first),fe}}pop(){if(this._last!==k.Undefined){const fe=this._last.element;return this._remove(this._last),fe}}_remove(fe){if(fe.prev!==k.Undefined&&fe.next!==k.Undefined){const $=fe.prev;$.next=fe.next,fe.next.prev=$}else fe.prev===k.Undefined&&fe.next===k.Undefined?(this._first=k.Undefined,this._last=k.Undefined):fe.next===k.Undefined?(this._last=this._last.prev,this._last.next=k.Undefined):fe.prev===k.Undefined&&(this._first=this._first.next,this._first.prev=k.Undefined);this._size-=1}*[Symbol.iterator](){let fe=this._first;for(;fe!==k.Undefined;)yield fe.element,fe=fe.next}}},23345:function(vn,Et,A){"use strict";A.d(Et,{$L:function(){return se},ED:function(){return L},IJ:function(){return T},OS:function(){return ve},WE:function(){return q},dz:function(){return O},gn:function(){return ae},li:function(){return S},r:function(){return Q},tY:function(){return R},xS:function(){return he}});var k=A(97671),pe;const Te="en";let fe=!1,$=!1,p=!1,me=!1,ce=!1,o=!1,x=!1,D,h=null,m=null,y;const S=typeof self=="object"?self:typeof A.g=="object"?A.g:{};let M;typeof S.vscode!="undefined"&&typeof S.vscode.process!="undefined"?M=S.vscode.process:typeof k!="undefined"&&(M=k);const z=typeof((pe=M==null?void 0:M.versions)===null||pe===void 0?void 0:pe.electron)=="string"&&M.type==="renderer";if(typeof navigator=="object"&&!z)y=navigator.userAgent,fe=y.indexOf("Windows")>=0,$=y.indexOf("Macintosh")>=0,x=(y.indexOf("Macintosh")>=0||y.indexOf("iPad")>=0||y.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,p=y.indexOf("Linux")>=0,o=!0,D=navigator.language,h=D;else if(typeof M=="object"){fe=M.platform==="win32",$=M.platform==="darwin",p=M.platform==="linux",me=p&&!!M.env.SNAP&&!!M.env.SNAP_REVISION,D=Te,h=Te;const P=M.env.VSCODE_NLS_CONFIG;if(P)try{const j=JSON.parse(P),X=j.availableLanguages["*"];D=j.locale,h=X||Te,m=j._translationsConfigFile}catch(j){}ce=!0}else console.error("Unable to resolve platform.");let Y=0;$?Y=1:fe?Y=3:p&&(Y=2);const L=fe,O=$,T=p,R=ce,se=o,ae=x,q=y,he=function(){if(S.setImmediate)return S.setImmediate.bind(S);if(typeof S.postMessage=="function"&&!S.importScripts){let X=[];S.addEventListener("message",J=>{if(J.data&&J.data.vscodeSetImmediateId)for(let v=0,g=X.length;v<g;v++){const U=X[v];if(U.id===J.data.vscodeSetImmediateId){X.splice(v,1),U.callback();return}}});let ne=0;return J=>{const v=++ne;X.push({id:v,callback:J}),S.postMessage({vscodeSetImmediateId:v},"*")}}if(typeof(M==null?void 0:M.nextTick)=="function")return M.nextTick.bind(M);const j=Promise.resolve();return X=>j.then(X)}(),ve=$||x?2:fe?1:3;let be=!0,Oe=!1;function Q(){if(!Oe){Oe=!0;const P=new Uint8Array(2);P[0]=1,P[1]=2,be=new Uint16Array(P.buffer)[0]===513}return be}},95830:function(vn,Et,A){"use strict";A.d(Et,{G:function(){return Te}});var k=A(23345);const pe=k.li.performance&&typeof k.li.performance.now=="function";class Te{constructor($){this._highResolution=pe&&$,this._startTime=this._now(),this._stopTime=-1}static create($=!0){return new Te($)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?k.li.performance.now():Date.now()}}},82983:function(vn,Et,A){"use strict";A.d(Et,{$i:function(){return Be},C8:function(){return _t},GF:function(){return D},HO:function(){return ne},IO:function(){return h},K7:function(){return At},Kw:function(){return zt},LC:function(){return S},Mh:function(){return he},P1:function(){return ve},PJ:function(){return Ct},Qe:function(){return Ze},R1:function(){return x},RP:function(){return U},S6:function(){return nn},TT:function(){return L},Ut:function(){return v},V8:function(){return M},WU:function(){return Te},YK:function(){return Oe},YU:function(){return fe},ZG:function(){return be},ZH:function(){return P},ab:function(){return Qe},c1:function(){return xe},df:function(){return se},ec:function(){return $},fi:function(){return qe},fy:function(){return p},j3:function(){return me},j_:function(){return T},m5:function(){return k},mK:function(){return R},mr:function(){return m},oH:function(){return K},oL:function(){return ce},ok:function(){return q},ow:function(){return z},qq:function(){return ae},qu:function(){return Y},rL:function(){return Q},uS:function(){return vt},un:function(){return o},uq:function(){return y},vH:function(){return X},xe:function(){return nt},zY:function(){return O}});function k(I){return!I||typeof I!="string"?!0:I.trim().length===0}const pe=/{(\d+)}/g;function Te(I,...F){return F.length===0?I:I.replace(pe,function(oe,w){const C=parseInt(w,10);return isNaN(C)||C<0||C>=F.length?oe:F[C]})}function fe(I){return I.replace(/[<>&]/g,function(F){switch(F){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return F}})}function $(I){return I.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function p(I,F=" "){const oe=me(I,F);return ce(oe,F)}function me(I,F){if(!I||!F)return I;const oe=F.length;if(oe===0||I.length===0)return I;let w=0;for(;I.indexOf(F,w)===w;)w=w+oe;return I.substring(w)}function ce(I,F){if(!I||!F)return I;const oe=F.length,w=I.length;if(oe===0||w===0)return I;let C=w,B=-1;for(;B=I.lastIndexOf(F,C-1),!(B===-1||B+oe!==C);){if(B===0)return"";C=B}return I.substring(0,C)}function o(I){return I.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function x(I){return I.replace(/\*/g,"")}function D(I,F,oe={}){if(!I)throw new Error("Cannot create regex from empty string");F||(I=$(I)),oe.wholeWord&&(/\B/.test(I.charAt(0))||(I="\\b"+I),/\B/.test(I.charAt(I.length-1))||(I=I+"\\b"));let w="";return oe.global&&(w+="g"),oe.matchCase||(w+="i"),oe.multiline&&(w+="m"),oe.unicode&&(w+="u"),new RegExp(I,w)}function h(I){return I.source==="^"||I.source==="^$"||I.source==="$"||I.source==="^\\s*$"?!1:!!(I.exec("")&&I.lastIndex===0)}function m(I){return(I.global?"g":"")+(I.ignoreCase?"i":"")+(I.multiline?"m":"")+(I.unicode?"u":"")}function y(I){return I.split(/\r\n|\r|\n/)}function S(I){for(let F=0,oe=I.length;F<oe;F++){const w=I.charCodeAt(F);if(w!==32&&w!==9)return F}return-1}function M(I,F=0,oe=I.length){for(let w=F;w<oe;w++){const C=I.charCodeAt(w);if(C!==32&&C!==9)return I.substring(F,w)}return I.substring(F,oe)}function z(I,F=I.length-1){for(let oe=F;oe>=0;oe--){const w=I.charCodeAt(oe);if(w!==32&&w!==9)return oe}return-1}function Y(I,F){return I<F?-1:I>F?1:0}function L(I,F,oe=0,w=I.length,C=0,B=F.length){for(;oe<w&&C<B;oe++,C++){let te=I.charCodeAt(oe),ue=F.charCodeAt(C);if(te<ue)return-1;if(te>ue)return 1}const W=w-oe,Z=B-C;return W<Z?-1:W>Z?1:0}function O(I,F){return T(I,F,0,I.length,0,F.length)}function T(I,F,oe=0,w=I.length,C=0,B=F.length){for(;oe<w&&C<B;oe++,C++){let te=I.charCodeAt(oe),ue=F.charCodeAt(C);if(te===ue)continue;if(te>=128||ue>=128)return L(I.toLowerCase(),F.toLowerCase(),oe,w,C,B);R(te)&&(te-=32),R(ue)&&(ue-=32);const ge=te-ue;if(ge!==0)return ge}const W=w-oe,Z=B-C;return W<Z?-1:W>Z?1:0}function R(I){return I>=97&&I<=122}function se(I){return I>=65&&I<=90}function ae(I,F){return I.length===F.length&&T(I,F)===0}function q(I,F){const oe=F.length;return F.length>I.length?!1:T(I,F,0,oe)===0}function he(I,F){let oe,w=Math.min(I.length,F.length);for(oe=0;oe<w;oe++)if(I.charCodeAt(oe)!==F.charCodeAt(oe))return oe;return w}function ve(I,F){let oe,w=Math.min(I.length,F.length);const C=I.length-1,B=F.length-1;for(oe=0;oe<w;oe++)if(I.charCodeAt(C-oe)!==F.charCodeAt(B-oe))return oe;return w}function be(I){return 55296<=I&&I<=56319}function Oe(I){return 56320<=I&&I<=57343}function Q(I,F){return(I-55296<<10)+(F-56320)+65536}function P(I,F,oe){const w=I.charCodeAt(oe);if(be(w)&&oe+1<F){const C=I.charCodeAt(oe+1);if(Oe(C))return Q(w,C)}return w}function j(I,F){const oe=I.charCodeAt(F-1);if(Oe(oe)&&F>1){const w=I.charCodeAt(F-2);if(be(w))return Q(w,oe)}return oe}function X(I,F){const oe=Re.getInstance(),w=F,C=I.length,B=P(I,C,F);F+=B>=65536?2:1;let W=oe.getGraphemeBreakType(B);for(;F<C;){const Z=P(I,C,F),te=oe.getGraphemeBreakType(Z);if(qe(W,te))break;F+=Z>=65536?2:1,W=te}return F-w}function ne(I,F){const oe=Re.getInstance(),w=F,C=j(I,F);F-=C>=65536?2:1;let B=oe.getGraphemeBreakType(C);for(;F>0;){const W=j(I,F),Z=oe.getGraphemeBreakType(W);if(qe(Z,B))break;F-=W>=65536?2:1,B=Z}return w-F}const J=/(?:[\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 v(I){return J.test(I)}const g=/(?:[\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 U(I){return g.test(I)}const ie=/^[\t\n\r\x20-\x7E]*$/;function Be(I){return ie.test(I)}const Ze=/[\u2028\u2029]/;function Qe(I){return Ze.test(I)}function nt(I){for(let F=0,oe=I.length;F<oe;F++)if(At(I.charCodeAt(F)))return!0;return!1}function At(I){return I=+I,I>=11904&&I<=55215||I>=63744&&I<=64255||I>=65281&&I<=65374}function _t(I){return I>=127462&&I<=127487||I===8986||I===8987||I===9200||I===9203||I>=9728&&I<=10175||I===11088||I===11093||I>=127744&&I<=128591||I>=128640&&I<=128764||I>=128992&&I<=129003||I>=129280&&I<=129535||I>=129648&&I<=129750}const xe="\uFEFF";function vt(I){return!!(I&&I.length>0&&I.charCodeAt(0)===65279)}function zt(I,F=!1){return I?(F&&(I=I.replace(/\\./g,"")),I.toLowerCase()!==I):!1}function Ct(I){return I=I%(2*26),I<26?String.fromCharCode(97+I):String.fromCharCode(65+I-26)}function nn(I){return Re.getInstance().getGraphemeBreakType(I)}function qe(I,F){return I===0?F!==5&&F!==7:I===2&&F===3?!1:I===4||I===2||I===3||F===4||F===2||F===3?!0:!(I===8&&(F===8||F===9||F===11||F===12)||(I===11||I===9)&&(F===9||F===10)||(I===12||I===10)&&F===10||F===5||F===13||F===7||I===1||I===13&&F===14||I===6&&F===6)}class Re{constructor(){this._data=we()}static getInstance(){return Re._INSTANCE||(Re._INSTANCE=new Re),Re._INSTANCE}getGraphemeBreakType(F){if(F<32)return F===10?3:F===13?2:4;if(F<127)return 0;const oe=this._data,w=oe.length/3;let C=1;for(;C<=w;)if(F<oe[3*C])C=2*C;else if(F>oe[3*C+1])C=2*C+1;else return oe[3*C+2];return 0}}Re._INSTANCE=null;function we(){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 K(I,F){if(I===0)return 0;const oe=Se(I,F);if(oe!==void 0)return oe;const w=j(F,I);return I-=Ne(w),I}function Se(I,F){let oe=j(F,I);for(I-=Ne(oe);V(oe)||oe===65039||oe===8419;){if(I===0)return;oe=j(F,I),I-=Ne(oe)}if(_t(oe)){if(I>=0){const w=j(F,I);w===8205&&(I-=Ne(w))}return I}}function Ne(I){return I>=65536?2:1}function V(I){return 127995<=I&&I<=127999}},72999:function(vn,Et,A){"use strict";A.d(Et,{$E:function(){return S},$K:function(){return me},D8:function(){return h},HD:function(){return pe},IU:function(){return M},Jp:function(){return ce},Kn:function(){return Te},cW:function(){return x},f6:function(){return z},hj:function(){return fe},jn:function(){return $},kJ:function(){return k},mf:function(){return D},o8:function(){return p},p_:function(){return o},vE:function(){return Y}});function k(L){return Array.isArray(L)}function pe(L){return typeof L=="string"}function Te(L){return typeof L=="object"&&L!==null&&!Array.isArray(L)&&!(L instanceof RegExp)&&!(L instanceof Date)}function fe(L){return typeof L=="number"&&!isNaN(L)}function $(L){return L===!0||L===!1}function p(L){return typeof L=="undefined"}function me(L){return!ce(L)}function ce(L){return p(L)||L===null}function o(L,O){if(!L)throw new Error(O?`Unexpected type, expected '${O}'`:"Unexpected type")}function x(L){if(ce(L))throw new Error("Assertion Failed: argument is undefined or null");return L}function D(L){return typeof L=="function"}function h(L,O){const T=Math.min(L.length,O.length);for(let R=0;R<T;R++)m(L[R],O[R])}function m(L,O){if(pe(O)){if(typeof L!==O)throw new Error(`argument does not match constraint: typeof ${O}`)}else if(D(O)){try{if(L instanceof O)return}catch(T){}if(!ce(L)&&L.constructor===O||O.length===1&&O.call(void 0,L)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function y(L){let O=[],T=Object.getPrototypeOf(L);for(;Object.prototype!==T;)O=O.concat(Object.getOwnPropertyNames(T)),T=Object.getPrototypeOf(T);return O}function S(L){const O=[];for(const T of y(L))typeof L[T]=="function"&&O.push(T);return O}function M(L,O){const T=se=>function(){const ae=Array.prototype.slice.call(arguments,0);return O(se,ae)};let R={};for(const se of L)R[se]=T(se);return R}function z(L){return L===null?void 0:L}function Y(L,O="Unreachable"){throw new Error(O)}},13268:function(vn,Et,A){"use strict";A.d(Et,{N:function(){return pe}});function k(Te,fe){let $;return fe.length===0?$=Te:$=Te.replace(/\{(\d+)\}/g,function(p,me){const ce=me[0];return typeof fe[ce]!="undefined"?fe[ce]:p}),$}function pe(Te,fe,...$){return k(fe,$)}},96236:function(vn,Et,A){"use strict";A.d(Et,{BH:function(){return M},NZ:function(){return z},U8:function(){return Y},co:function(){return S},eH:function(){return y},vr:function(){return m}});var k=A(75918),pe=A(52615),Te=A(4348),fe=A(88226),$=A(69323),p=A(34502),me=A(35884),ce=A(90689),o=A(16925),x=A(49055),D=function(L,O,T,R){var se=arguments.length,ae=se<3?O:R===null?R=Object.getOwnPropertyDescriptor(O,T):R,q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(L,O,T,R);else for(var he=L.length-1;he>=0;he--)(q=L[he])&&(ae=(se<3?q(ae):se>3?q(O,T,ae):q(O,T))||ae);return se>3&&ae&&Object.defineProperty(O,T,ae),ae},h=function(L,O){return function(T,R){O(T,R,L)}};function m(L){return L.command!==void 0}class y{constructor(O){this.id=y._idPool++,this._debugName=O}}y._idPool=0,y.CommandPalette=new y("CommandPalette"),y.EditorContext=new y("EditorContext"),y.SimpleEditorContext=new y("SimpleEditorContext"),y.EditorContextCopy=new y("EditorContextCopy"),y.EditorContextPeek=new y("EditorContextPeek"),y.MenubarEditMenu=new y("MenubarEditMenu"),y.MenubarCopy=new y("MenubarCopy"),y.MenubarGoMenu=new y("MenubarGoMenu"),y.MenubarSelectionMenu=new y("MenubarSelectionMenu"),y.InlineCompletionsActions=new y("InlineCompletionsActions");const S=(0,o.yh)("menuService"),M=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Te.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:L=>L===y.CommandPalette}}addCommand(L){return this.addCommands(fe.$.single(L))}addCommands(L){for(const O of L)this._commands.set(O.id,O);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,$.OF)(()=>{let O=!1;for(const T of L)O=this._commands.delete(T.id)||O;O&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(L){return this._commands.get(L)}getCommands(){const L=new Map;return this._commands.forEach((O,T)=>L.set(T,O)),L}appendMenuItem(L,O){return this.appendMenuItems(fe.$.single({id:L,item:O}))}appendMenuItems(L){const O=new Set,T=new p.S;for(const{id:R,item:se}of L){let ae=this._menuItems.get(R);ae||(ae=new p.S,this._menuItems.set(R,ae)),T.push(ae.push(se)),O.add(R)}return this._onDidChangeMenu.fire(O),(0,$.OF)(()=>{if(T.size>0){for(let R of T)R();this._onDidChangeMenu.fire(O),T.clear()}})}getMenuItems(L){let O;return this._menuItems.has(L)?O=[...this._menuItems.get(L)]:O=[],L===y.CommandPalette&&this._appendImplicitItems(O),O}_appendImplicitItems(L){const O=new Set;for(const T of L)m(T)&&(O.add(T.command.id),T.alt&&O.add(T.alt.id));this._commands.forEach((T,R)=>{O.has(R)||L.push({command:T})})}};class z extends k.wY{constructor(O,T,R,se){super(`submenuitem.${O.submenu.id}`,typeof O.title=="string"?O.title:O.title.value,[],"submenu"),this.item=O,this._menuService=T,this._contextKeyService=R,this._options=se}get actions(){const O=[],T=this._menuService.createMenu(this.item.submenu,this._contextKeyService),R=T.getActions(this._options);T.dispose();for(const[,se]of R)se.length>0&&(O.push(...se),O.push(new k.Z0));return O.length&&O.pop(),O}}let Y=class Jo{constructor(O,T,R,se,ae){var q,he;if(this._commandService=ae,this.id=O.id,this.label=R!=null&&R.renderShortTitle&&O.shortTitle?typeof O.shortTitle=="string"?O.shortTitle:O.shortTitle.value:typeof O.title=="string"?O.title:O.title.value,this.tooltip=(he=typeof O.tooltip=="string"?O.tooltip:(q=O.tooltip)===null||q===void 0?void 0:q.value)!==null&&he!==void 0?he:"",this.enabled=!O.precondition||se.contextMatchesRules(O.precondition),this.checked=void 0,O.toggled){const ve=O.toggled.condition?O.toggled:{condition:O.toggled};this.checked=se.contextMatchesRules(ve.condition),this.checked&&ve.tooltip&&(this.tooltip=typeof ve.tooltip=="string"?ve.tooltip:ve.tooltip.value),ve.title&&(this.label=typeof ve.title=="string"?ve.title:ve.title.value)}this.item=O,this.alt=T?new Jo(T,void 0,R,se,ae):void 0,this._options=R,x.kS.isThemeIcon(O.icon)&&(this.class=pe.dT.asClassName(O.icon))}dispose(){}run(...O){var T,R;let se=[];return!((T=this._options)===null||T===void 0)&&T.arg&&(se=[...se,this._options.arg]),!((R=this._options)===null||R===void 0)&&R.shouldForwardArgs&&(se=[...se,...O]),this._commandService.executeCommand(this.id,...se)}};Y=D([h(3,ce.i6),h(4,me.H)],Y)},35884:function(vn,Et,A){"use strict";A.d(Et,{H:function(){return me},P:function(){return ce}});var k=A(4348),pe=A(88226),Te=A(69323),fe=A(34502),$=A(72999),p=A(16925);const me=(0,p.yh)("commandService"),ce=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new k.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(o,x){if(!o)throw new Error("invalid command");if(typeof o=="string"){if(!x)throw new Error("invalid command");return this.registerCommand({id:o,handler:x})}if(o.description){const S=[];for(let z of o.description.args)S.push(z.constraint);const M=o.handler;o.handler=function(z,...Y){return(0,$.D8)(Y,S),M(z,...Y)}}const{id:D}=o;let h=this._commands.get(D);h||(h=new fe.S,this._commands.set(D,h));let m=h.unshift(o),y=(0,Te.OF)(()=>{m();const S=this._commands.get(D);S!=null&&S.isEmpty()&&this._commands.delete(D)});return this._onDidRegisterCommand.fire(D),y}registerCommandAlias(o,x){return ce.registerCommand(o,(D,...h)=>D.get(me).executeCommand(x,...h))}getCommand(o){const x=this._commands.get(o);if(!(!x||x.isEmpty()))return pe.$.first(x)}getCommands(){const o=new Map;for(const x of this._commands.keys()){const D=this.getCommand(x);D&&o.set(x,D)}return o}};ce.registerCommand("noop",()=>{})},90689:function(vn,Et,A){"use strict";A.d(Et,{Ao:function(){return me},Eq:function(){return Q},Fb:function(){return ce},K8:function(){return X},i6:function(){return Oe},uy:function(){return be}});var k=A(23345),pe=A(82983),Te=A(16925);let fe=k.WE||"";const $=new Map;$.set("false",!1),$.set("true",!0),$.set("isMac",k.dz),$.set("isLinux",k.IJ),$.set("isWindows",k.ED),$.set("isWeb",k.$L),$.set("isMacNative",k.dz&&!k.$L),$.set("isEdge",fe.indexOf("Edg/")>=0),$.set("isFirefox",fe.indexOf("Firefox")>=0),$.set("isChrome",fe.indexOf("Chrome")>=0),$.set("isSafari",fe.indexOf("Safari")>=0);const p=Object.prototype.hasOwnProperty;class me{static has(v){return h.create(v)}static equals(v,g){return m.create(v,g)}static regex(v,g){return se.create(v,g)}static not(v){return z.create(v)}static and(...v){return he.create(v,null)}static or(...v){return ve.create(v,null,!0)}static deserialize(v,g=!1){if(v)return this._deserializeOrExpression(v,g)}static _deserializeOrExpression(v,g){let U=v.split("||");return ve.create(U.map(ie=>this._deserializeAndExpression(ie,g)),null,!0)}static _deserializeAndExpression(v,g){let U=v.split("&&");return he.create(U.map(ie=>this._deserializeOne(ie,g)),null)}static _deserializeOne(v,g){if(v=v.trim(),v.indexOf("!=")>=0){let U=v.split("!=");return M.create(U[0].trim(),this._deserializeValue(U[1],g))}if(v.indexOf("==")>=0){let U=v.split("==");return m.create(U[0].trim(),this._deserializeValue(U[1],g))}if(v.indexOf("=~")>=0){let U=v.split("=~");return se.create(U[0].trim(),this._deserializeRegexValue(U[1],g))}if(v.indexOf(" in ")>=0){let U=v.split(" in ");return y.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(v)){const U=v.split(">=");return O.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(v)){const U=v.split(">");return L.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(v)){const U=v.split("<=");return R.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(v)){const U=v.split("<");return T.create(U[0].trim(),U[1].trim())}return/^\!\s*/.test(v)?z.create(v.substr(1).trim()):h.create(v)}static _deserializeValue(v,g){if(v=v.trim(),v==="true")return!0;if(v==="false")return!1;let U=/^'([^']*)'$/.exec(v);return U?U[1].trim():v}static _deserializeRegexValue(v,g){if((0,pe.m5)(v)){if(g)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let U=v.indexOf("/"),ie=v.lastIndexOf("/");if(U===ie||U<0){if(g)throw new Error(`bad regexp-value '${v}', missing /-enclosure`);return console.warn(`bad regexp-value '${v}', missing /-enclosure`),null}let Be=v.slice(U+1,ie),Ze=v[ie+1]==="i"?"i":"";try{return new RegExp(Be,Ze)}catch(Qe){if(g)throw new Error(`bad regexp-value '${v}', parse error: ${Qe}`);return console.warn(`bad regexp-value '${v}', parse error: ${Qe}`),null}}}function ce(J,v){const g=J?J.substituteConstants():void 0,U=v?v.substituteConstants():void 0;return!g&&!U?!0:!g||!U?!1:g.equals(U)}function o(J,v){return J.cmp(v)}class x{constructor(){this.type=0}cmp(v){return this.type-v.type}equals(v){return v.type===this.type}substituteConstants(){return this}evaluate(v){return!1}serialize(){return"false"}keys(){return[]}negate(){return D.INSTANCE}}x.INSTANCE=new x;class D{constructor(){this.type=1}cmp(v){return this.type-v.type}equals(v){return v.type===this.type}substituteConstants(){return this}evaluate(v){return!0}serialize(){return"true"}keys(){return[]}negate(){return x.INSTANCE}}D.INSTANCE=new D;class h{constructor(v,g){this.key=v,this.negated=g,this.type=2}static create(v,g=null){const U=$.get(v);return typeof U=="boolean"?U?D.INSTANCE:x.INSTANCE:new h(v,g)}cmp(v){return v.type!==this.type?this.type-v.type:P(this.key,v.key)}equals(v){return v.type===this.type?this.key===v.key:!1}substituteConstants(){const v=$.get(this.key);return typeof v=="boolean"?v?D.INSTANCE:x.INSTANCE:this}evaluate(v){return!!v.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=z.create(this.key,this)),this.negated}}class m{constructor(v,g,U){this.key=v,this.value=g,this.negated=U,this.type=4}static create(v,g,U=null){if(typeof g=="boolean")return g?h.create(v,U):z.create(v,U);const ie=$.get(v);return typeof ie=="boolean"?g===(ie?"true":"false")?D.INSTANCE:x.INSTANCE:new m(v,g,U)}cmp(v){return v.type!==this.type?this.type-v.type:j(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){const v=$.get(this.key);if(typeof v=="boolean"){const g=v?"true":"false";return this.value===g?D.INSTANCE:x.INSTANCE}return this}evaluate(v){return v.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=M.create(this.key,this.value,this)),this.negated}}class y{constructor(v,g){this.key=v,this.valueKey=g,this.type=10,this.negated=null}static create(v,g){return new y(v,g)}cmp(v){return v.type!==this.type?this.type-v.type:j(this.key,this.valueKey,v.key,v.valueKey)}equals(v){return v.type===this.type?this.key===v.key&&this.valueKey===v.valueKey:!1}substituteConstants(){return this}evaluate(v){const g=v.getValue(this.valueKey),U=v.getValue(this.key);return Array.isArray(g)?g.indexOf(U)>=0:typeof U=="string"&&typeof g=="object"&&g!==null?p.call(g,U):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=S.create(this)),this.negated}}class S{constructor(v){this._actual=v,this.type=11}static create(v){return new S(v)}cmp(v){return v.type!==this.type?this.type-v.type:this._actual.cmp(v._actual)}equals(v){return v.type===this.type?this._actual.equals(v._actual):!1}substituteConstants(){return this}evaluate(v){return!this._actual.evaluate(v)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class M{constructor(v,g,U){this.key=v,this.value=g,this.negated=U,this.type=5}static create(v,g,U=null){if(typeof g=="boolean")return g?z.create(v,U):h.create(v,U);const ie=$.get(v);return typeof ie=="boolean"?g===(ie?"true":"false")?x.INSTANCE:D.INSTANCE:new M(v,g,U)}cmp(v){return v.type!==this.type?this.type-v.type:j(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){const v=$.get(this.key);if(typeof v=="boolean"){const g=v?"true":"false";return this.value===g?x.INSTANCE:D.INSTANCE}return this}evaluate(v){return v.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class z{constructor(v,g){this.key=v,this.negated=g,this.type=3}static create(v,g=null){const U=$.get(v);return typeof U=="boolean"?U?x.INSTANCE:D.INSTANCE:new z(v,g)}cmp(v){return v.type!==this.type?this.type-v.type:P(this.key,v.key)}equals(v){return v.type===this.type?this.key===v.key:!1}substituteConstants(){const v=$.get(this.key);return typeof v=="boolean"?v?x.INSTANCE:D.INSTANCE:this}evaluate(v){return!v.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this)),this.negated}}function Y(J,v){if(typeof J=="string"){const g=parseFloat(J);isNaN(g)||(J=g)}return typeof J=="string"||typeof J=="number"?v(J):x.INSTANCE}class L{constructor(v,g,U){this.key=v,this.value=g,this.negated=U,this.type=12}static create(v,g,U=null){return Y(g,ie=>new L(v,ie,U))}cmp(v){return v.type!==this.type?this.type-v.type:j(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this.key,this.value,this)),this.negated}}class O{constructor(v,g,U){this.key=v,this.value=g,this.negated=U,this.type=13}static create(v,g,U=null){return Y(g,ie=>new O(v,ie,U))}cmp(v){return v.type!==this.type?this.type-v.type:j(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.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 T{constructor(v,g,U){this.key=v,this.value=g,this.negated=U,this.type=14}static create(v,g,U=null){return Y(g,ie=>new T(v,ie,U))}cmp(v){return v.type!==this.type?this.type-v.type:j(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=O.create(this.key,this.value,this)),this.negated}}class R{constructor(v,g,U){this.key=v,this.value=g,this.negated=U,this.type=15}static create(v,g,U=null){return Y(g,ie=>new R(v,ie,U))}cmp(v){return v.type!==this.type?this.type-v.type:j(this.key,this.value,v.key,v.value)}equals(v){return v.type===this.type?this.key===v.key&&this.value===v.value:!1}substituteConstants(){return this}evaluate(v){return typeof this.value=="string"?!1:parseFloat(v.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 se{constructor(v,g){this.key=v,this.regexp=g,this.type=7,this.negated=null}static create(v,g){return new se(v,g)}cmp(v){if(v.type!==this.type)return this.type-v.type;if(this.key<v.key)return-1;if(this.key>v.key)return 1;const g=this.regexp?this.regexp.source:"",U=v.regexp?v.regexp.source:"";return g<U?-1:g>U?1:0}equals(v){if(v.type===this.type){const g=this.regexp?this.regexp.source:"",U=v.regexp?v.regexp.source:"";return this.key===v.key&&g===U}return!1}substituteConstants(){return this}evaluate(v){let g=v.getValue(this.key);return this.regexp?this.regexp.test(g):!1}serialize(){const v=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${v}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ae.create(this)),this.negated}}class ae{constructor(v){this._actual=v,this.type=8}static create(v){return new ae(v)}cmp(v){return v.type!==this.type?this.type-v.type:this._actual.cmp(v._actual)}equals(v){return v.type===this.type?this._actual.equals(v._actual):!1}substituteConstants(){return this}evaluate(v){return!this._actual.evaluate(v)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function q(J){let v=null;for(let g=0,U=J.length;g<U;g++){const ie=J[g].substituteConstants();if(J[g]!==ie&&v===null){v=[];for(let Be=0;Be<g;Be++)v[Be]=J[Be]}v!==null&&(v[g]=ie)}return v===null?J:v}class he{constructor(v,g){this.expr=v,this.negated=g,this.type=6}static create(v,g){return he._normalizeArr(v,g)}cmp(v){if(v.type!==this.type)return this.type-v.type;if(this.expr.length<v.expr.length)return-1;if(this.expr.length>v.expr.length)return 1;for(let g=0,U=this.expr.length;g<U;g++){const ie=o(this.expr[g],v.expr[g]);if(ie!==0)return ie}return 0}equals(v){if(v.type===this.type){if(this.expr.length!==v.expr.length)return!1;for(let g=0,U=this.expr.length;g<U;g++)if(!this.expr[g].equals(v.expr[g]))return!1;return!0}return!1}substituteConstants(){const v=q(this.expr);return v===this.expr?this:he.create(v,this.negated)}evaluate(v){for(let g=0,U=this.expr.length;g<U;g++)if(!this.expr[g].evaluate(v))return!1;return!0}static _normalizeArr(v,g){const U=[];let ie=!1;for(const Be of v)if(Be){if(Be.type===1){ie=!0;continue}if(Be.type===0)return x.INSTANCE;if(Be.type===6){U.push(...Be.expr);continue}U.push(Be)}if(U.length===0&&ie)return D.INSTANCE;if(U.length!==0){if(U.length===1)return U[0];U.sort(o);for(let Be=1;Be<U.length;Be++)U[Be-1].equals(U[Be])&&(U.splice(Be,1),Be--);if(U.length===1)return U[0];for(;U.length>1;){const Be=U[U.length-1];if(Be.type!==9)break;U.pop();const Ze=U.pop(),Qe=U.length===0,nt=ve.create(Be.expr.map(At=>he.create([At,Ze],null)),null,Qe);nt&&(U.push(nt),U.sort(o))}return U.length===1?U[0]:new he(U,g)}}serialize(){return this.expr.map(v=>v.serialize()).join(" && ")}keys(){const v=[];for(let g of this.expr)v.push(...g.keys());return v}negate(){if(!this.negated){const v=[];for(let g of this.expr)v.push(g.negate());this.negated=ve.create(v,this,!0)}return this.negated}}class ve{constructor(v,g){this.expr=v,this.negated=g,this.type=9}static create(v,g,U){return ve._normalizeArr(v,g,U)}cmp(v){if(v.type!==this.type)return this.type-v.type;if(this.expr.length<v.expr.length)return-1;if(this.expr.length>v.expr.length)return 1;for(let g=0,U=this.expr.length;g<U;g++){const ie=o(this.expr[g],v.expr[g]);if(ie!==0)return ie}return 0}equals(v){if(v.type===this.type){if(this.expr.length!==v.expr.length)return!1;for(let g=0,U=this.expr.length;g<U;g++)if(!this.expr[g].equals(v.expr[g]))return!1;return!0}return!1}substituteConstants(){const v=q(this.expr);return v===this.expr?this:ve.create(v,this.negated,!1)}evaluate(v){for(let g=0,U=this.expr.length;g<U;g++)if(this.expr[g].evaluate(v))return!0;return!1}static _normalizeArr(v,g,U){let ie=[],Be=!1;if(v){for(let Ze=0,Qe=v.length;Ze<Qe;Ze++){const nt=v[Ze];if(nt){if(nt.type===0){Be=!0;continue}if(nt.type===1)return D.INSTANCE;if(nt.type===9){ie=ie.concat(nt.expr);continue}ie.push(nt)}}if(ie.length===0&&Be)return x.INSTANCE;ie.sort(o)}if(ie.length!==0){if(ie.length===1)return ie[0];for(let Ze=1;Ze<ie.length;Ze++)ie[Ze-1].equals(ie[Ze])&&(ie.splice(Ze,1),Ze--);if(ie.length===1)return ie[0];if(U){for(let Ze=0;Ze<ie.length;Ze++)for(let Qe=Ze+1;Qe<ie.length;Qe++)X(ie[Ze],ie[Qe])&&(ie.splice(Qe,1),Qe--);if(ie.length===1)return ie[0]}return new ve(ie,g)}}serialize(){return this.expr.map(v=>v.serialize()).join(" || ")}keys(){const v=[];for(let g of this.expr)v.push(...g.keys());return v}negate(){if(!this.negated){let v=[];for(let g of this.expr)v.push(g.negate());for(;v.length>1;){const g=v.shift(),U=v.shift(),ie=[];for(const Ze of ne(g))for(const Qe of ne(U))ie.push(he.create([Ze,Qe],null));const Be=v.length===0;v.unshift(ve.create(ie,null,Be))}this.negated=v[0]}return this.negated}}class be extends h{constructor(v,g,U){super(v,null),this._defaultValue=g,typeof U=="object"?be._info.push(Object.assign(Object.assign({},U),{key:v})):U!==!0&&be._info.push({key:v,description:U,type:g!=null?typeof g:void 0})}static all(){return be._info.values()}bindTo(v){return v.createKey(this.key,this._defaultValue)}getValue(v){return v.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(v){return m.create(this.key,v)}}be._info=[];const Oe=(0,Te.yh)("contextKeyService"),Q="setContext";function P(J,v){return J<v?-1:J>v?1:0}function j(J,v,g,U){return J<g?-1:J>g?1:v<U?-1:v>U?1:0}function X(J,v){if(v.type===6&&J.type!==9&&J.type!==6){for(const ie of v.expr)if(J.equals(ie))return!0}const g=J.negate(),U=ne(g).concat(ne(v));U.sort(o);for(let ie=0;ie<U.length;ie++){const Ze=U[ie].negate();for(let Qe=ie+1;Qe<U.length;Qe++){const nt=U[Qe];if(Ze.equals(nt))return!0}}return!1}function ne(J){return J.type===9?J.expr:[J]}},16925:function(vn,Et,A){"use strict";A.d(Et,{I8:function(){return k},TG:function(){return pe},jt:function(){return $},yh:function(){return fe}});var k;(function(p){p.serviceIds=new Map,p.DI_TARGET="$di$target",p.DI_DEPENDENCIES="$di$dependencies";function me(ce){return ce[p.DI_DEPENDENCIES]||[]}p.getServiceDependencies=me})(k||(k={}));const pe=fe("instantiationService");function Te(p,me,ce,o){me[k.DI_TARGET]===me?me[k.DI_DEPENDENCIES].push({id:p,index:ce,optional:o}):(me[k.DI_DEPENDENCIES]=[{id:p,index:ce,optional:o}],me[k.DI_TARGET]=me)}function fe(p){if(k.serviceIds.has(p))return k.serviceIds.get(p);const me=function(ce,o,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Te(me,ce,x,!1)};return me.toString=()=>p,k.serviceIds.set(p,me),me}function $(p){return function(me,ce,o){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");Te(p,me,o,!0)}}},44650:function(vn,Et,A){"use strict";A.d(Et,{B:function(){return fe}});var k=A(76068),pe=A(72999);class Te{constructor(){this.data=new Map}add(p,me){k.ok(pe.HD(p)),k.ok(pe.Kn(me)),k.ok(!this.data.has(p),"There is already an extension with this id"),this.data.set(p,me)}as(p){return this.data.get(p)||null}}const fe=new Te},66213:function(vn,Et,A){"use strict";A.d(Et,{e:function(){return k}});var k;(function(pe){pe.DARK="dark",pe.LIGHT="light",pe.HIGH_CONTRAST="hc"})(k||(k={}))},49055:function(vn,Et,A){"use strict";A.d(Et,{EN:function(){return o},IP:function(){return h},Ic:function(){return S},XE:function(){return me},bB:function(){return M},kS:function(){return x},m6:function(){return D}});var k=A(52615),pe=A(4348),Te=A(69323),fe=A(16925),$=A(44650),p=A(66213);const me=(0,fe.yh)("themeService");var ce;(function(z){function Y(L){return L&&typeof L=="object"&&typeof L.id=="string"}z.isThemeColor=Y})(ce||(ce={}));function o(z){return{id:z}}var x;(function(z){function Y(ae){return ae&&typeof ae=="object"&&typeof ae.id=="string"&&(typeof ae.color=="undefined"||ce.isThemeColor(ae.color))}z.isThemeIcon=Y;const L=new RegExp(`^\\$\\((${k.dT.iconNameExpression}(?:${k.dT.iconModifierExpression})?)\\)$`);function O(ae){const q=L.exec(ae);if(!q)return;let[,he]=q;return{id:he}}z.fromString=O;function T(ae,q){let he=ae.id;const ve=he.lastIndexOf("~");return ve!==-1&&(he=he.substring(0,ve)),q&&(he=`${he}~${q}`),{id:he}}z.modify=T;function R(ae,q){var he,ve;return ae.id===q.id&&((he=ae.color)===null||he===void 0?void 0:he.id)===((ve=q.color)===null||ve===void 0?void 0:ve.id)}z.isEqual=R;function se(ae,q){return{id:ae.id,color:q?o(q):void 0}}z.asThemeIcon=se,z.asClassNameArray=k.dT.asClassNameArray,z.asClassName=k.dT.asClassName,z.asCSSSelector=k.dT.asCSSSelector})(x||(x={}));function D(z){switch(z){case p.e.DARK:return"vs-dark";case p.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const h={ThemingContribution:"base.contributions.theming"};class m{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new pe.Q5}onColorThemeChange(Y){return this.themingParticipants.push(Y),this.onThemingParticipantAddedEmitter.fire(Y),(0,Te.OF)(()=>{const L=this.themingParticipants.indexOf(Y);this.themingParticipants.splice(L,1)})}getThemingParticipants(){return this.themingParticipants}}let y=new m;$.B.add(h.ThemingContribution,y);function S(z){return y.onColorThemeChange(z)}class M extends Te.JT{constructor(Y){super(),this.themeService=Y,this.theme=Y.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(L=>this.onThemeChange(L)))}onThemeChange(Y){this.theme=Y,this.updateStyles()}updateStyles(){}}},96478:function(vn,Et,A){"use strict";A.d(Et,{Z:function(){return ae}});var k=A(14809),pe=A(4635),Te=A(50298),fe=A(62646),$=A(65352),p=A(92310),me=A.n(p),ce=A(8654),o=A(59301),x=A(10228),D=A(16089),h=x.Z.ESC,m=x.Z.TAB;function y(q){var he=q.visible,ve=q.triggerRef,be=q.onVisibleChange,Oe=q.autoFocus,Q=q.overlayRef,P=o.useRef(!1),j=function(){if(he){var v,g;(v=ve.current)===null||v===void 0||(g=v.focus)===null||g===void 0||g.call(v),be==null||be(!1)}},X=function(){var v;return(v=Q.current)!==null&&v!==void 0&&v.focus?(Q.current.focus(),P.current=!0,!0):!1},ne=function(v){switch(v.keyCode){case h:j();break;case m:{var g=!1;P.current||(g=X()),g?v.preventDefault():j();break}}};o.useEffect(function(){return he?(window.addEventListener("keydown",ne),Oe&&(0,D.Z)(X,3),function(){window.removeEventListener("keydown",ne),P.current=!1}):function(){P.current=!1}},[he])}var S=(0,o.forwardRef)(function(q,he){var ve=q.overlay,be=q.arrow,Oe=q.prefixCls,Q=(0,o.useMemo)(function(){var j;return typeof ve=="function"?j=ve():j=ve,j},[ve]),P=(0,ce.sQ)(he,(0,ce.C4)(Q));return o.createElement(o.Fragment,null,be&&o.createElement("div",{className:"".concat(Oe,"-arrow")}),o.cloneElement(Q,{ref:(0,ce.Yr)(Q)?P:void 0}))}),M=S,z={adjustX:1,adjustY:1},Y=[0,0],L={topLeft:{points:["bl","tl"],overflow:z,offset:[0,-4],targetOffset:Y},top:{points:["bc","tc"],overflow:z,offset:[0,-4],targetOffset:Y},topRight:{points:["br","tr"],overflow:z,offset:[0,-4],targetOffset:Y},bottomLeft:{points:["tl","bl"],overflow:z,offset:[0,4],targetOffset:Y},bottom:{points:["tc","bc"],overflow:z,offset:[0,4],targetOffset:Y},bottomRight:{points:["tr","br"],overflow:z,offset:[0,4],targetOffset:Y}},O=L,T=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function R(q,he){var ve,be=q.arrow,Oe=be===void 0?!1:be,Q=q.prefixCls,P=Q===void 0?"rc-dropdown":Q,j=q.transitionName,X=q.animation,ne=q.align,J=q.placement,v=J===void 0?"bottomLeft":J,g=q.placements,U=g===void 0?O:g,ie=q.getPopupContainer,Be=q.showAction,Ze=q.hideAction,Qe=q.overlayClassName,nt=q.overlayStyle,At=q.visible,_t=q.trigger,xe=_t===void 0?["hover"]:_t,vt=q.autoFocus,zt=q.overlay,Ct=q.children,nn=q.onVisibleChange,qe=(0,fe.Z)(q,T),Re=o.useState(),we=(0,Te.Z)(Re,2),K=we[0],Se=we[1],Ne="visible"in q?At:K,V=o.useRef(null),I=o.useRef(null),F=o.useRef(null);o.useImperativeHandle(he,function(){return V.current});var oe=function(Ce){Se(Ce),nn==null||nn(Ce)};y({visible:Ne,triggerRef:F,onVisibleChange:oe,autoFocus:vt,overlayRef:I});var w=function(Ce){var De=q.onOverlayClick;Se(!1),De&&De(Ce)},C=function(){return o.createElement(M,{ref:I,overlay:zt,prefixCls:P,arrow:Oe})},B=function(){return typeof zt=="function"?C:C()},W=function(){var Ce=q.minOverlayWidthMatchTrigger,De=q.alignPoint;return"minOverlayWidthMatchTrigger"in q?Ce:!De},Z=function(){var Ce=q.openClassName;return Ce!==void 0?Ce:"".concat(P,"-open")},te=o.cloneElement(Ct,{className:me()((ve=Ct.props)===null||ve===void 0?void 0:ve.className,Ne&&Z()),ref:(0,ce.Yr)(Ct)?(0,ce.sQ)(F,(0,ce.C4)(Ct)):void 0}),ue=Ze;return!ue&&xe.indexOf("contextMenu")!==-1&&(ue=["click"]),o.createElement($.Z,(0,k.Z)({builtinPlacements:U},qe,{prefixCls:P,ref:V,popupClassName:me()(Qe,(0,pe.Z)({},"".concat(P,"-show-arrow"),Oe)),popupStyle:nt,action:xe,showAction:Be,hideAction:ue,popupPlacement:v,popupAlign:ne,popupTransitionName:j,popupAnimation:X,popupVisible:Ne,stretch:W()?"minWidth":"",popup:B(),onPopupVisibleChange:oe,onPopupClick:w,getPopupContainer:ie}),te)}var se=o.forwardRef(R),ae=se},66003:function(vn,Et,A){"use strict";A.d(Et,{Z:function(){return me}});var k=A(62646),pe=A(20439),Te=A(93664),fe=A(59301),$=["show"];function p(ce,o){if(!o.max)return!0;var x=o.strategy(ce);return x<=o.max}function me(ce,o){return fe.useMemo(function(){var x={};o&&(x.show=(0,Te.Z)(o)==="object"&&o.formatter?o.formatter:!!o),x=(0,pe.Z)((0,pe.Z)({},x),ce);var D=x,h=D.show,m=(0,k.Z)(D,$);return(0,pe.Z)((0,pe.Z)({},m),{},{show:!!h,showFormatter:typeof h=="function"?h:void 0,strategy:m.strategy||function(y){return y.length}})},[ce,o])}},36901:function(vn,Et,A){"use strict";A.r(Et),A.d(Et,{BaseInput:function(){return x},default:function(){return O}});var k=A(20439),pe=A(14809),Te=A(4635),fe=A(93664),$=A(92310),p=A.n($),me=A(59301),ce=A(30292),o=me.forwardRef(function(T,R){var se,ae,q,he=T.inputElement,ve=T.children,be=T.prefixCls,Oe=T.prefix,Q=T.suffix,P=T.addonBefore,j=T.addonAfter,X=T.className,ne=T.style,J=T.disabled,v=T.readOnly,g=T.focused,U=T.triggerFocus,ie=T.allowClear,Be=T.value,Ze=T.handleReset,Qe=T.hidden,nt=T.classes,At=T.classNames,_t=T.dataAttrs,xe=T.styles,vt=T.components,zt=T.onClear,Ct=ve!=null?ve:he,nn=(vt==null?void 0:vt.affixWrapper)||"span",qe=(vt==null?void 0:vt.groupWrapper)||"span",Re=(vt==null?void 0:vt.wrapper)||"span",we=(vt==null?void 0:vt.groupAddon)||"span",K=(0,me.useRef)(null),Se=function(Ve){var Ge;(Ge=K.current)!==null&&Ge!==void 0&&Ge.contains(Ve.target)&&(U==null||U())},Ne=(0,ce.X3)(T),V=(0,me.cloneElement)(Ct,{value:Be,className:p()((se=Ct.props)===null||se===void 0?void 0:se.className,!Ne&&(At==null?void 0:At.variant))||null}),I=(0,me.useRef)(null);if(me.useImperativeHandle(R,function(){return{nativeElement:I.current||K.current}}),Ne){var F=null;if(ie){var oe=!J&&!v&&Be,w="".concat(be,"-clear-icon"),C=(0,fe.Z)(ie)==="object"&&ie!==null&&ie!==void 0&&ie.clearIcon?ie.clearIcon:"\u2716";F=me.createElement("button",{type:"button",tabIndex:-1,onClick:function(Ve){Ze==null||Ze(Ve),zt==null||zt()},onMouseDown:function(Ve){return Ve.preventDefault()},className:p()(w,(0,Te.Z)((0,Te.Z)({},"".concat(w,"-hidden"),!oe),"".concat(w,"-has-suffix"),!!Q))},C)}var B="".concat(be,"-affix-wrapper"),W=p()(B,(0,Te.Z)((0,Te.Z)((0,Te.Z)((0,Te.Z)((0,Te.Z)({},"".concat(be,"-disabled"),J),"".concat(B,"-disabled"),J),"".concat(B,"-focused"),g),"".concat(B,"-readonly"),v),"".concat(B,"-input-with-clear-btn"),Q&&ie&&Be),nt==null?void 0:nt.affixWrapper,At==null?void 0:At.affixWrapper,At==null?void 0:At.variant),Z=(Q||ie)&&me.createElement("span",{className:p()("".concat(be,"-suffix"),At==null?void 0:At.suffix),style:xe==null?void 0:xe.suffix},F,Q);V=me.createElement(nn,(0,pe.Z)({className:W,style:xe==null?void 0:xe.affixWrapper,onClick:Se},_t==null?void 0:_t.affixWrapper,{ref:K}),Oe&&me.createElement("span",{className:p()("".concat(be,"-prefix"),At==null?void 0:At.prefix),style:xe==null?void 0:xe.prefix},Oe),V,Z)}if((0,ce.He)(T)){var te="".concat(be,"-group"),ue="".concat(te,"-addon"),ge="".concat(te,"-wrapper"),Ce=p()("".concat(be,"-wrapper"),te,nt==null?void 0:nt.wrapper,At==null?void 0:At.wrapper),De=p()(ge,(0,Te.Z)({},"".concat(ge,"-disabled"),J),nt==null?void 0:nt.group,At==null?void 0:At.groupWrapper);V=me.createElement(qe,{className:De,ref:I},me.createElement(Re,{className:Ce},P&&me.createElement(we,{className:ue},P),V,j&&me.createElement(we,{className:ue},j)))}return me.cloneElement(V,{className:p()((ae=V.props)===null||ae===void 0?void 0:ae.className,X)||null,style:(0,k.Z)((0,k.Z)({},(q=V.props)===null||q===void 0?void 0:q.style),ne),hidden:Qe})}),x=o,D=A(95190),h=A(50298),m=A(62646),y=A(18929),S=A(2738),M=A(66003),z=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],Y=(0,me.forwardRef)(function(T,R){var se=T.autoComplete,ae=T.onChange,q=T.onFocus,he=T.onBlur,ve=T.onPressEnter,be=T.onKeyDown,Oe=T.onKeyUp,Q=T.prefixCls,P=Q===void 0?"rc-input":Q,j=T.disabled,X=T.htmlSize,ne=T.className,J=T.maxLength,v=T.suffix,g=T.showCount,U=T.count,ie=T.type,Be=ie===void 0?"text":ie,Ze=T.classes,Qe=T.classNames,nt=T.styles,At=T.onCompositionStart,_t=T.onCompositionEnd,xe=(0,m.Z)(T,z),vt=(0,me.useState)(!1),zt=(0,h.Z)(vt,2),Ct=zt[0],nn=zt[1],qe=(0,me.useRef)(!1),Re=(0,me.useRef)(!1),we=(0,me.useRef)(null),K=(0,me.useRef)(null),Se=function(Ut){we.current&&(0,ce.nH)(we.current,Ut)},Ne=(0,y.Z)(T.defaultValue,{value:T.value}),V=(0,h.Z)(Ne,2),I=V[0],F=V[1],oe=I==null?"":String(I),w=(0,me.useState)(null),C=(0,h.Z)(w,2),B=C[0],W=C[1],Z=(0,M.Z)(U,g),te=Z.max||J,ue=Z.strategy(oe),ge=!!te&&ue>te;(0,me.useImperativeHandle)(R,function(){var ut;return{focus:Se,blur:function(){var Le;(Le=we.current)===null||Le===void 0||Le.blur()},setSelectionRange:function(Le,Ae,Ie){var H;(H=we.current)===null||H===void 0||H.setSelectionRange(Le,Ae,Ie)},select:function(){var Le;(Le=we.current)===null||Le===void 0||Le.select()},input:we.current,nativeElement:((ut=K.current)===null||ut===void 0?void 0:ut.nativeElement)||we.current}}),(0,me.useEffect)(function(){Re.current&&(Re.current=!1),nn(function(ut){return ut&&j?!1:ut})},[j]);var Ce=function(Ut,Le,Ae){var Ie=Le;if(!qe.current&&Z.exceedFormatter&&Z.max&&Z.strategy(Le)>Z.max){if(Ie=Z.exceedFormatter(Le,{max:Z.max}),Le!==Ie){var H,ee;W([((H=we.current)===null||H===void 0?void 0:H.selectionStart)||0,((ee=we.current)===null||ee===void 0?void 0:ee.selectionEnd)||0])}}else if(Ae.source==="compositionEnd")return;F(Ie),we.current&&(0,ce.rJ)(we.current,Ut,ae,Ie)};(0,me.useEffect)(function(){if(B){var ut;(ut=we.current)===null||ut===void 0||ut.setSelectionRange.apply(ut,(0,D.Z)(B))}},[B]);var De=function(Ut){Ce(Ut,Ut.target.value,{source:"change"})},Fe=function(Ut){qe.current=!1,Ce(Ut,Ut.currentTarget.value,{source:"compositionEnd"}),_t==null||_t(Ut)},Ve=function(Ut){ve&&Ut.key==="Enter"&&!Re.current&&(Re.current=!0,ve(Ut)),be==null||be(Ut)},Ge=function(Ut){Ut.key==="Enter"&&(Re.current=!1),Oe==null||Oe(Ut)},$e=function(Ut){nn(!0),q==null||q(Ut)},mt=function(Ut){Re.current&&(Re.current=!1),nn(!1),he==null||he(Ut)},xt=function(Ut){F(""),Se(),we.current&&(0,ce.rJ)(we.current,Ut,ae)},St=ge&&"".concat(P,"-out-of-range"),Lt=function(){var Ut=(0,S.Z)(T,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return me.createElement("input",(0,pe.Z)({autoComplete:se},Ut,{onChange:De,onFocus:$e,onBlur:mt,onKeyDown:Ve,onKeyUp:Ge,className:p()(P,(0,Te.Z)({},"".concat(P,"-disabled"),j),Qe==null?void 0:Qe.input),style:nt==null?void 0:nt.input,ref:we,size:X,type:Be,onCompositionStart:function(Ae){qe.current=!0,At==null||At(Ae)},onCompositionEnd:Fe}))},Ht=function(){var Ut=Number(te)>0;if(v||Z.show){var Le=Z.showFormatter?Z.showFormatter({value:oe,count:ue,maxLength:te}):"".concat(ue).concat(Ut?" / ".concat(te):"");return me.createElement(me.Fragment,null,Z.show&&me.createElement("span",{className:p()("".concat(P,"-show-count-suffix"),(0,Te.Z)({},"".concat(P,"-show-count-has-suffix"),!!v),Qe==null?void 0:Qe.count),style:(0,k.Z)({},nt==null?void 0:nt.count)},Le),v)}return null};return me.createElement(x,(0,pe.Z)({},xe,{prefixCls:P,className:p()(ne,St),handleReset:xt,value:oe,focused:Ct,triggerFocus:Se,suffix:Ht(),disabled:j,classes:Ze,classNames:Qe,styles:nt}),Lt())}),L=Y,O=L},30292:function(vn,Et,A){"use strict";A.d(Et,{He:function(){return k},X3:function(){return pe},nH:function(){return $},rJ:function(){return fe}});function k(p){return!!(p.addonBefore||p.addonAfter)}function pe(p){return!!(p.prefix||p.suffix||p.allowClear)}function Te(p,me,ce){var o=me.cloneNode(!0),x=Object.create(p,{target:{value:o},currentTarget:{value:o}});return o.value=ce,typeof me.selectionStart=="number"&&typeof me.selectionEnd=="number"&&(o.selectionStart=me.selectionStart,o.selectionEnd=me.selectionEnd),o.setSelectionRange=function(){me.setSelectionRange.apply(me,arguments)},x}function fe(p,me,ce,o){if(ce){var x=me;if(me.type==="click"){x=Te(me,p,""),ce(x);return}if(p.type!=="file"&&o!==void 0){x=Te(me,p,o),ce(x);return}ce(x)}}function $(p,me){if(p){p.focus(me);var ce=me||{},o=ce.cursor;if(o){var x=p.value.length;switch(o){case"start":p.setSelectionRange(0,0);break;case"end":p.setSelectionRange(x,x);break;default:p.setSelectionRange(0,x)}}}}},28321:function(vn,Et,A){"use strict";A.d(Et,{iz:function(){return Me},ck:function(){return Ie},BW:function(){return dt},sN:function(){return Ie},Wd:function(){return $n},ZP:function(){return yt},Xl:function(){return ve}});var k=A(14809),pe=A(4635),Te=A(20439),fe=A(95190),$=A(50298),p=A(62646),me=A(92310),ce=A.n(me),o=A(11780),x=A(18929),D=A(13697),h=A(48736),m=A(59301),y=A(4676),S=m.createContext(null);function M(ye,Ue){return ye===void 0?null:"".concat(ye,"-").concat(Ue)}function z(ye){var Ue=m.useContext(S);return M(Ue,ye)}var Y=A(80547),L=["children","locked"],O=m.createContext(null);function T(ye,Ue){var He=(0,Te.Z)({},ye);return Object.keys(Ue).forEach(function(je){var at=Ue[je];at!==void 0&&(He[je]=at)}),He}function R(ye){var Ue=ye.children,He=ye.locked,je=(0,p.Z)(ye,L),at=m.useContext(O),ct=(0,Y.Z)(function(){return T(at,je)},[at,je],function(lt,wt){return!He&&(lt[0]!==wt[0]||!(0,D.Z)(lt[1],wt[1],!0))});return m.createElement(O.Provider,{value:ct},Ue)}var se=[],ae=m.createContext(null);function q(){return m.useContext(ae)}var he=m.createContext(se);function ve(ye){var Ue=m.useContext(he);return m.useMemo(function(){return ye!==void 0?[].concat((0,fe.Z)(Ue),[ye]):Ue},[Ue,ye])}var be=m.createContext(null),Oe=m.createContext({}),Q=Oe,P=A(29194);function j(ye){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,P.Z)(ye)){var He=ye.nodeName.toLowerCase(),je=["input","select","textarea","button"].includes(He)||ye.isContentEditable||He==="a"&&!!ye.getAttribute("href"),at=ye.getAttribute("tabindex"),ct=Number(at),lt=null;return at&&!Number.isNaN(ct)?lt=ct:je&&lt===null&&(lt=0),je&&ye.disabled&&(lt=null),lt!==null&&(lt>=0||Ue&&lt<0)}return!1}function X(ye){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,He=(0,fe.Z)(ye.querySelectorAll("*")).filter(function(je){return j(je,Ue)});return j(ye,Ue)&&He.unshift(ye),He}var ne=null;function J(){ne=document.activeElement}function v(){ne=null}function g(){if(ne)try{ne.focus()}catch(ye){}}function U(ye,Ue){if(Ue.keyCode===9){var He=X(ye),je=He[Ue.shiftKey?0:He.length-1],at=je===document.activeElement||ye===document.activeElement;if(at){var ct=He[Ue.shiftKey?He.length-1:0];ct.focus(),Ue.preventDefault()}}}var ie=A(10228),Be=A(16089),Ze=ie.Z.LEFT,Qe=ie.Z.RIGHT,nt=ie.Z.UP,At=ie.Z.DOWN,_t=ie.Z.ENTER,xe=ie.Z.ESC,vt=ie.Z.HOME,zt=ie.Z.END,Ct=[nt,At,Ze,Qe];function nn(ye,Ue,He,je){var at,ct="prev",lt="next",wt="children",Ot="parent";if(ye==="inline"&&je===_t)return{inlineTrigger:!0};var $t=(0,pe.Z)((0,pe.Z)({},nt,ct),At,lt),pn=(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},Ze,He?lt:ct),Qe,He?ct:lt),At,wt),_t,wt),kt=(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},nt,ct),At,lt),_t,wt),xe,Ot),Ze,He?wt:Ot),Qe,He?Ot:wt),_n={inline:$t,horizontal:pn,vertical:kt,inlineSub:$t,horizontalSub:kt,verticalSub:kt},sn=(at=_n["".concat(ye).concat(Ue?"":"Sub")])===null||at===void 0?void 0:at[je];switch(sn){case ct:return{offset:-1,sibling:!0};case lt:return{offset:1,sibling:!0};case Ot:return{offset:-1,sibling:!1};case wt:return{offset:1,sibling:!1};default:return null}}function qe(ye){for(var Ue=ye;Ue;){if(Ue.getAttribute("data-menu-list"))return Ue;Ue=Ue.parentElement}return null}function Re(ye,Ue){for(var He=ye||document.activeElement;He;){if(Ue.has(He))return He;He=He.parentElement}return null}function we(ye,Ue){var He=X(ye,!0);return He.filter(function(je){return Ue.has(je)})}function K(ye,Ue,He){var je=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!ye)return null;var at=we(ye,Ue),ct=at.length,lt=at.findIndex(function(wt){return He===wt});return je<0?lt===-1?lt=ct-1:lt-=1:je>0&&(lt+=1),lt=(lt+ct)%ct,at[lt]}var Se=function(Ue,He){var je=new Set,at=new Map,ct=new Map;return Ue.forEach(function(lt){var wt=document.querySelector("[data-menu-id='".concat(M(He,lt),"']"));wt&&(je.add(wt),ct.set(wt,lt),at.set(lt,wt))}),{elements:je,key2element:at,element2key:ct}};function Ne(ye,Ue,He,je,at,ct,lt,wt,Ot,$t){var pn=m.useRef(),kt=m.useRef();kt.current=Ue;var _n=function(){Be.Z.cancel(pn.current)};return m.useEffect(function(){return function(){_n()}},[]),function(sn){var un=sn.which;if([].concat(Ct,[_t,xe,vt,zt]).includes(un)){var Nt=ct(),Mt=Se(Nt,je),qt=Mt,cn=qt.elements,ln=qt.key2element,an=qt.element2key,yn=ln.get(Ue),Vt=Re(yn,cn),Wt=an.get(Vt),Jn=nn(ye,lt(Wt,!0).length===1,He,un);if(!Jn&&un!==vt&&un!==zt)return;(Ct.includes(un)||[vt,zt].includes(un))&&sn.preventDefault();var Wn=function(En){if(En){var Dt=En,bt=En.querySelector("a");bt!=null&&bt.getAttribute("href")&&(Dt=bt);var Qt=an.get(En);wt(Qt),_n(),pn.current=(0,Be.Z)(function(){kt.current===Qt&&Dt.focus()})}};if([vt,zt].includes(un)||Jn.sibling||!Vt){var Bn;!Vt||ye==="inline"?Bn=at.current:Bn=qe(Vt);var Hn,qn=we(Bn,cn);un===vt?Hn=qn[0]:un===zt?Hn=qn[qn.length-1]:Hn=K(Bn,cn,Vt,Jn.offset),Wn(Hn)}else if(Jn.inlineTrigger)Ot(Wt);else if(Jn.offset>0)Ot(Wt,!0),_n(),pn.current=(0,Be.Z)(function(){Mt=Se(Nt,je);var ar=Vt.getAttribute("aria-controls"),En=document.getElementById(ar),Dt=K(En,Mt.elements);Wn(Dt)},5);else if(Jn.offset<0){var Vn=lt(Wt,!0),mr=Vn[Vn.length-2],nr=ln.get(mr);Ot(mr,!1),Wn(nr)}}$t==null||$t(sn)}}function V(ye){Promise.resolve().then(ye)}var I="__RC_UTIL_PATH_SPLIT__",F=function(Ue){return Ue.join(I)},oe=function(Ue){return Ue.split(I)},w="rc-menu-more";function C(){var ye=m.useState({}),Ue=(0,$.Z)(ye,2),He=Ue[1],je=(0,m.useRef)(new Map),at=(0,m.useRef)(new Map),ct=m.useState([]),lt=(0,$.Z)(ct,2),wt=lt[0],Ot=lt[1],$t=(0,m.useRef)(0),pn=(0,m.useRef)(!1),kt=function(){pn.current||He({})},_n=(0,m.useCallback)(function(ln,an){var yn=F(an);at.current.set(yn,ln),je.current.set(ln,yn),$t.current+=1;var Vt=$t.current;V(function(){Vt===$t.current&&kt()})},[]),sn=(0,m.useCallback)(function(ln,an){var yn=F(an);at.current.delete(yn),je.current.delete(ln)},[]),un=(0,m.useCallback)(function(ln){Ot(ln)},[]),Nt=(0,m.useCallback)(function(ln,an){var yn=je.current.get(ln)||"",Vt=oe(yn);return an&&wt.includes(Vt[0])&&Vt.unshift(w),Vt},[wt]),Mt=(0,m.useCallback)(function(ln,an){return ln.filter(function(yn){return yn!==void 0}).some(function(yn){var Vt=Nt(yn,!0);return Vt.includes(an)})},[Nt]),qt=function(){var an=(0,fe.Z)(je.current.keys());return wt.length&&an.push(w),an},cn=(0,m.useCallback)(function(ln){var an="".concat(je.current.get(ln)).concat(I),yn=new Set;return(0,fe.Z)(at.current.keys()).forEach(function(Vt){Vt.startsWith(an)&&yn.add(at.current.get(Vt))}),yn},[]);return m.useEffect(function(){return function(){pn.current=!0}},[]),{registerPath:_n,unregisterPath:sn,refreshOverflowKeys:un,isSubPathKey:Mt,getKeyPath:Nt,getKeys:qt,getSubPathKeys:cn}}function B(ye){var Ue=m.useRef(ye);Ue.current=ye;var He=m.useCallback(function(){for(var je,at=arguments.length,ct=new Array(at),lt=0;lt<at;lt++)ct[lt]=arguments[lt];return(je=Ue.current)===null||je===void 0?void 0:je.call.apply(je,[Ue].concat(ct))},[]);return ye?He:void 0}var W=Math.random().toFixed(5).toString().slice(2),Z=0;function te(ye){var Ue=(0,x.Z)(ye,{value:ye}),He=(0,$.Z)(Ue,2),je=He[0],at=He[1];return m.useEffect(function(){Z+=1;var ct="".concat(W,"-").concat(Z);at("rc-menu-uuid-".concat(ct))},[]),je}var ue=A(99153),ge=A(84851),Ce=A(19257),De=A(93046),Fe=A(2738),Ve=A(8654);function Ge(ye,Ue,He,je){var at=m.useContext(O),ct=at.activeKey,lt=at.onActive,wt=at.onInactive,Ot={active:ct===ye};return Ue||(Ot.onMouseEnter=function($t){He==null||He({key:ye,domEvent:$t}),lt(ye)},Ot.onMouseLeave=function($t){je==null||je({key:ye,domEvent:$t}),wt(ye)}),Ot}function $e(ye){var Ue=m.useContext(O),He=Ue.mode,je=Ue.rtl,at=Ue.inlineIndent;if(He!=="inline")return null;var ct=ye;return je?{paddingRight:ct*at}:{paddingLeft:ct*at}}function mt(ye){var Ue=ye.icon,He=ye.props,je=ye.children,at;return Ue===null||Ue===!1?null:(typeof Ue=="function"?at=m.createElement(Ue,(0,Te.Z)({},He)):typeof Ue!="boolean"&&(at=Ue),at||je||null)}var xt=["item"];function St(ye){var Ue=ye.item,He=(0,p.Z)(ye,xt);return Object.defineProperty(He,"item",{get:function(){return(0,h.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),Ue}}),He}var Lt=["title","attribute","elementRef"],Ht=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],ut=["active"],Ut=function(ye){(0,Ce.Z)(He,ye);var Ue=(0,De.Z)(He);function He(){return(0,ue.Z)(this,He),Ue.apply(this,arguments)}return(0,ge.Z)(He,[{key:"render",value:function(){var at=this.props,ct=at.title,lt=at.attribute,wt=at.elementRef,Ot=(0,p.Z)(at,Lt),$t=(0,Fe.Z)(Ot,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,h.ZP)(!lt,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),m.createElement(o.Z.Item,(0,k.Z)({},lt,{title:typeof ct=="string"?ct:void 0},$t,{ref:wt}))}}]),He}(m.Component),Le=m.forwardRef(function(ye,Ue){var He=ye.style,je=ye.className,at=ye.eventKey,ct=ye.warnKey,lt=ye.disabled,wt=ye.itemIcon,Ot=ye.children,$t=ye.role,pn=ye.onMouseEnter,kt=ye.onMouseLeave,_n=ye.onClick,sn=ye.onKeyDown,un=ye.onFocus,Nt=(0,p.Z)(ye,Ht),Mt=z(at),qt=m.useContext(O),cn=qt.prefixCls,ln=qt.onItemClick,an=qt.disabled,yn=qt.overflowDisabled,Vt=qt.itemIcon,Wt=qt.selectedKeys,Jn=qt.onActive,Wn=m.useContext(Q),Bn=Wn._internalRenderMenuItem,Hn="".concat(cn,"-item"),qn=m.useRef(),Vn=m.useRef(),mr=an||lt,nr=(0,Ve.x1)(Ue,Vn),ar=ve(at),En=function(bn){return{key:at,keyPath:(0,fe.Z)(ar).reverse(),item:qn.current,domEvent:bn}},Dt=wt||Vt,bt=Ge(at,mr,pn,kt),Qt=bt.active,Yt=(0,p.Z)(bt,ut),mn=Wt.includes(at),Yn=$e(ar.length),er=function(bn){if(!mr){var jn=En(bn);_n==null||_n(St(jn)),ln(jn)}},en=function(bn){if(sn==null||sn(bn),bn.which===ie.Z.ENTER){var jn=En(bn);_n==null||_n(St(jn)),ln(jn)}},xn=function(bn){Jn(at),un==null||un(bn)},Pn={};ye.role==="option"&&(Pn["aria-selected"]=mn);var kn=m.createElement(Ut,(0,k.Z)({ref:qn,elementRef:nr,role:$t===null?"none":$t||"menuitem",tabIndex:lt?null:-1,"data-menu-id":yn&&Mt?null:Mt},(0,Fe.Z)(Nt,["extra"]),Yt,Pn,{component:"li","aria-disabled":lt,style:(0,Te.Z)((0,Te.Z)({},Yn),He),className:ce()(Hn,(0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(Hn,"-active"),Qt),"".concat(Hn,"-selected"),mn),"".concat(Hn,"-disabled"),mr),je),onClick:er,onKeyDown:en,onFocus:xn}),Ot,m.createElement(mt,{props:(0,Te.Z)((0,Te.Z)({},ye),{},{isSelected:mn}),icon:Dt}));return Bn&&(kn=Bn(kn,ye,{selected:mn})),kn});function Ae(ye,Ue){var He=ye.eventKey,je=q(),at=ve(He);return m.useEffect(function(){if(je)return je.registerPath(He,at),function(){je.unregisterPath(He,at)}},[at]),je?null:m.createElement(Le,(0,k.Z)({},ye,{ref:Ue}))}var Ie=m.forwardRef(Ae),H=["className","children"],ee=function(Ue,He){var je=Ue.className,at=Ue.children,ct=(0,p.Z)(Ue,H),lt=m.useContext(O),wt=lt.prefixCls,Ot=lt.mode,$t=lt.rtl;return m.createElement("ul",(0,k.Z)({className:ce()(wt,$t&&"".concat(wt,"-rtl"),"".concat(wt,"-sub"),"".concat(wt,"-").concat(Ot==="inline"?"inline":"vertical"),je),role:"menu"},ct,{"data-menu-list":!0,ref:He}),at)},de=m.forwardRef(ee);de.displayName="SubMenuList";var re=de,_e=A(11592);function et(ye,Ue){return(0,_e.Z)(ye).map(function(He,je){if(m.isValidElement(He)){var at,ct,lt=He.key,wt=(at=(ct=He.props)===null||ct===void 0?void 0:ct.eventKey)!==null&&at!==void 0?at:lt,Ot=wt==null;Ot&&(wt="tmp_key-".concat([].concat((0,fe.Z)(Ue),[je]).join("-")));var $t={key:wt,eventKey:wt};return m.cloneElement(He,$t)}return He})}var Ye=A(65352),it={adjustX:1,adjustY:1},Rt={topLeft:{points:["bl","tl"],overflow:it},topRight:{points:["br","tr"],overflow:it},bottomLeft:{points:["tl","bl"],overflow:it},bottomRight:{points:["tr","br"],overflow:it},leftTop:{points:["tr","tl"],overflow:it},leftBottom:{points:["br","bl"],overflow:it},rightTop:{points:["tl","tr"],overflow:it},rightBottom:{points:["bl","br"],overflow:it}},on={topLeft:{points:["bl","tl"],overflow:it},topRight:{points:["br","tr"],overflow:it},bottomLeft:{points:["tl","bl"],overflow:it},bottomRight:{points:["tr","br"],overflow:it},rightTop:{points:["tr","tl"],overflow:it},rightBottom:{points:["br","bl"],overflow:it},leftTop:{points:["tl","tr"],overflow:it},leftBottom:{points:["bl","br"],overflow:it}},fn=null;function Pt(ye,Ue,He){if(Ue)return Ue;if(He)return He[ye]||He.other}var jt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function wn(ye){var Ue=ye.prefixCls,He=ye.visible,je=ye.children,at=ye.popup,ct=ye.popupStyle,lt=ye.popupClassName,wt=ye.popupOffset,Ot=ye.disabled,$t=ye.mode,pn=ye.onVisibleChange,kt=m.useContext(O),_n=kt.getPopupContainer,sn=kt.rtl,un=kt.subMenuOpenDelay,Nt=kt.subMenuCloseDelay,Mt=kt.builtinPlacements,qt=kt.triggerSubMenuAction,cn=kt.forceSubMenuRender,ln=kt.rootClassName,an=kt.motion,yn=kt.defaultMotions,Vt=m.useState(!1),Wt=(0,$.Z)(Vt,2),Jn=Wt[0],Wn=Wt[1],Bn=sn?(0,Te.Z)((0,Te.Z)({},on),Mt):(0,Te.Z)((0,Te.Z)({},Rt),Mt),Hn=jt[$t],qn=Pt($t,an,yn),Vn=m.useRef(qn);$t!=="inline"&&(Vn.current=qn);var mr=(0,Te.Z)((0,Te.Z)({},Vn.current),{},{leavedClassName:"".concat(Ue,"-hidden"),removeOnLeave:!1,motionAppear:!0}),nr=m.useRef();return m.useEffect(function(){return nr.current=(0,Be.Z)(function(){Wn(He)}),function(){Be.Z.cancel(nr.current)}},[He]),m.createElement(Ye.Z,{prefixCls:Ue,popupClassName:ce()("".concat(Ue,"-popup"),(0,pe.Z)({},"".concat(Ue,"-rtl"),sn),lt,ln),stretch:$t==="horizontal"?"minWidth":null,getPopupContainer:_n,builtinPlacements:Bn,popupPlacement:Hn,popupVisible:Jn,popup:at,popupStyle:ct,popupAlign:wt&&{offset:wt},action:Ot?[]:[qt],mouseEnterDelay:un,mouseLeaveDelay:Nt,onPopupVisibleChange:pn,forceRender:cn,popupMotion:mr,fresh:!0},je)}var Gn=A(77900);function An(ye){var Ue=ye.id,He=ye.open,je=ye.keyPath,at=ye.children,ct="inline",lt=m.useContext(O),wt=lt.prefixCls,Ot=lt.forceSubMenuRender,$t=lt.motion,pn=lt.defaultMotions,kt=lt.mode,_n=m.useRef(!1);_n.current=kt===ct;var sn=m.useState(!_n.current),un=(0,$.Z)(sn,2),Nt=un[0],Mt=un[1],qt=_n.current?He:!1;m.useEffect(function(){_n.current&&Mt(!1)},[kt]);var cn=(0,Te.Z)({},Pt(ct,$t,pn));je.length>1&&(cn.motionAppear=!1);var ln=cn.onVisibleChanged;return cn.onVisibleChanged=function(an){return!_n.current&&!an&&Mt(!0),ln==null?void 0:ln(an)},Nt?null:m.createElement(R,{mode:ct,locked:!_n.current},m.createElement(Gn.default,(0,k.Z)({visible:qt},cn,{forceRender:Ot,removeOnLeave:!1,leavedClassName:"".concat(wt,"-hidden")}),function(an){var yn=an.className,Vt=an.style;return m.createElement(re,{id:Ue,className:yn,style:Vt},at)}))}var Mn=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Cn=["active"],rn=m.forwardRef(function(ye,Ue){var He=ye.style,je=ye.className,at=ye.title,ct=ye.eventKey,lt=ye.warnKey,wt=ye.disabled,Ot=ye.internalPopupClose,$t=ye.children,pn=ye.itemIcon,kt=ye.expandIcon,_n=ye.popupClassName,sn=ye.popupOffset,un=ye.popupStyle,Nt=ye.onClick,Mt=ye.onMouseEnter,qt=ye.onMouseLeave,cn=ye.onTitleClick,ln=ye.onTitleMouseEnter,an=ye.onTitleMouseLeave,yn=(0,p.Z)(ye,Mn),Vt=z(ct),Wt=m.useContext(O),Jn=Wt.prefixCls,Wn=Wt.mode,Bn=Wt.openKeys,Hn=Wt.disabled,qn=Wt.overflowDisabled,Vn=Wt.activeKey,mr=Wt.selectedKeys,nr=Wt.itemIcon,ar=Wt.expandIcon,En=Wt.onItemClick,Dt=Wt.onOpenChange,bt=Wt.onActive,Qt=m.useContext(Q),Yt=Qt._internalRenderSubMenuItem,mn=m.useContext(be),Yn=mn.isSubPathKey,er=ve(),en="".concat(Jn,"-submenu"),xn=Hn||wt,Pn=m.useRef(),kn=m.useRef(),dr=pn!=null?pn:nr,bn=kt!=null?kt:ar,jn=Bn.includes(ct),Xn=!qn&&jn,tn=Yn(mr,ct),rr=Ge(ct,xn,ln,an),vr=rr.active,hr=(0,p.Z)(rr,Cn),Er=m.useState(!1),kr=(0,$.Z)(Er,2),Cr=kr[0],br=kr[1],Kn=function(lr){xn||br(lr)},Xr=function(lr){Kn(!0),Mt==null||Mt({key:ct,domEvent:lr})},Mr=function(lr){Kn(!1),qt==null||qt({key:ct,domEvent:lr})},zr=m.useMemo(function(){return vr||(Wn!=="inline"?Cr||Yn([Vn],ct):!1)},[Wn,vr,Vn,Cr,ct,Yn]),Tr=$e(er.length),ai=function(lr){xn||(cn==null||cn({key:ct,domEvent:lr}),Wn==="inline"&&Dt(ct,!jn))},ti=B(function(Fn){Nt==null||Nt(St(Fn)),En(Fn)}),Fr=function(lr){Wn!=="inline"&&Dt(ct,lr)},Wr=function(){bt(ct)},Zr=Vt&&"".concat(Vt,"-popup"),Nr=m.useMemo(function(){return m.createElement(mt,{icon:Wn!=="horizontal"?bn:void 0,props:(0,Te.Z)((0,Te.Z)({},ye),{},{isOpen:Xn,isSubMenu:!0})},m.createElement("i",{className:"".concat(en,"-arrow")}))},[Wn,bn,ye,Xn,en]),Ar=m.createElement("div",(0,k.Z)({role:"menuitem",style:Tr,className:"".concat(en,"-title"),tabIndex:xn?null:-1,ref:Pn,title:typeof at=="string"?at:null,"data-menu-id":qn&&Vt?null:Vt,"aria-expanded":Xn,"aria-haspopup":!0,"aria-controls":Zr,"aria-disabled":xn,onClick:ai,onFocus:Wr},hr),at,Nr),$r=m.useRef(Wn);if(Wn!=="inline"&&er.length>1?$r.current="vertical":$r.current=Wn,!qn){var Ir=$r.current;Ar=m.createElement(wn,{mode:Ir,prefixCls:en,visible:!Ot&&Xn&&Wn!=="inline",popupClassName:_n,popupOffset:sn,popupStyle:un,popup:m.createElement(R,{mode:Ir==="horizontal"?"vertical":Ir},m.createElement(re,{id:Zr,ref:kn},$t)),disabled:xn,onVisibleChange:Fr},Ar)}var _r=m.createElement(o.Z.Item,(0,k.Z)({ref:Ue,role:"none"},yn,{component:"li",style:He,className:ce()(en,"".concat(en,"-").concat(Wn),je,(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(en,"-open"),Xn),"".concat(en,"-active"),zr),"".concat(en,"-selected"),tn),"".concat(en,"-disabled"),xn)),onMouseEnter:Xr,onMouseLeave:Mr}),Ar,!qn&&m.createElement(An,{id:Zr,open:Xn,keyPath:er},$t));return Yt&&(_r=Yt(_r,ye,{selected:tn,active:zr,open:Xn,disabled:xn})),m.createElement(R,{onItemClick:ti,mode:Wn==="horizontal"?"vertical":Wn,itemIcon:dr,expandIcon:bn},_r)}),Tn=m.forwardRef(function(ye,Ue){var He=ye.eventKey,je=ye.children,at=ve(He),ct=et(je,at),lt=q();m.useEffect(function(){if(lt)return lt.registerPath(He,at),function(){lt.unregisterPath(He,at)}},[at]);var wt;return lt?wt=ct:wt=m.createElement(rn,(0,k.Z)({ref:Ue},ye),ct),m.createElement(he.Provider,{value:at},wt)}),$n=Tn,tr=A(93664);function Me(ye){var Ue=ye.className,He=ye.style,je=m.useContext(O),at=je.prefixCls,ct=q();return ct?null:m.createElement("li",{role:"separator",className:ce()("".concat(at,"-item-divider"),Ue),style:He})}var Pe=["className","title","eventKey","children"],Tt=m.forwardRef(function(ye,Ue){var He=ye.className,je=ye.title,at=ye.eventKey,ct=ye.children,lt=(0,p.Z)(ye,Pe),wt=m.useContext(O),Ot=wt.prefixCls,$t="".concat(Ot,"-item-group");return m.createElement("li",(0,k.Z)({ref:Ue,role:"presentation"},lt,{onClick:function(kt){return kt.stopPropagation()},className:ce()($t,He)}),m.createElement("div",{role:"presentation",className:"".concat($t,"-title"),title:typeof je=="string"?je:void 0},je),m.createElement("ul",{role:"group",className:"".concat($t,"-list")},ct))}),pt=m.forwardRef(function(ye,Ue){var He=ye.eventKey,je=ye.children,at=ve(He),ct=et(je,at),lt=q();return lt?ct:m.createElement(Tt,(0,k.Z)({ref:Ue},(0,Fe.Z)(ye,["warnKey"])),ct)}),dt=pt,Zt=["label","children","key","type","extra"];function ze(ye,Ue,He){var je=Ue.item,at=Ue.group,ct=Ue.submenu,lt=Ue.divider;return(ye||[]).map(function(wt,Ot){if(wt&&(0,tr.Z)(wt)==="object"){var $t=wt,pn=$t.label,kt=$t.children,_n=$t.key,sn=$t.type,un=$t.extra,Nt=(0,p.Z)($t,Zt),Mt=_n!=null?_n:"tmp-".concat(Ot);return kt||sn==="group"?sn==="group"?m.createElement(at,(0,k.Z)({key:Mt},Nt,{title:pn}),ze(kt,Ue,He)):m.createElement(ct,(0,k.Z)({key:Mt},Nt,{title:pn}),ze(kt,Ue,He)):sn==="divider"?m.createElement(lt,(0,k.Z)({key:Mt},Nt)):m.createElement(je,(0,k.Z)({key:Mt},Nt,{extra:un}),pn,(!!un||un===0)&&m.createElement("span",{className:"".concat(He,"-item-extra")},un))}return null}).filter(function(wt){return wt})}function tt(ye,Ue,He,je,at){var ct=ye,lt=(0,Te.Z)({divider:Me,item:Ie,group:dt,submenu:$n},je);return Ue&&(ct=ze(Ue,lt,at)),et(ct,He)}var ot=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],It=[],Ft=m.forwardRef(function(ye,Ue){var He,je=ye,at=je.prefixCls,ct=at===void 0?"rc-menu":at,lt=je.rootClassName,wt=je.style,Ot=je.className,$t=je.tabIndex,pn=$t===void 0?0:$t,kt=je.items,_n=je.children,sn=je.direction,un=je.id,Nt=je.mode,Mt=Nt===void 0?"vertical":Nt,qt=je.inlineCollapsed,cn=je.disabled,ln=je.disabledOverflow,an=je.subMenuOpenDelay,yn=an===void 0?.1:an,Vt=je.subMenuCloseDelay,Wt=Vt===void 0?.1:Vt,Jn=je.forceSubMenuRender,Wn=je.defaultOpenKeys,Bn=je.openKeys,Hn=je.activeKey,qn=je.defaultActiveFirst,Vn=je.selectable,mr=Vn===void 0?!0:Vn,nr=je.multiple,ar=nr===void 0?!1:nr,En=je.defaultSelectedKeys,Dt=je.selectedKeys,bt=je.onSelect,Qt=je.onDeselect,Yt=je.inlineIndent,mn=Yt===void 0?24:Yt,Yn=je.motion,er=je.defaultMotions,en=je.triggerSubMenuAction,xn=en===void 0?"hover":en,Pn=je.builtinPlacements,kn=je.itemIcon,dr=je.expandIcon,bn=je.overflowedIndicator,jn=bn===void 0?"...":bn,Xn=je.overflowedIndicatorPopupClassName,tn=je.getPopupContainer,rr=je.onClick,vr=je.onOpenChange,hr=je.onKeyDown,Er=je.openAnimation,kr=je.openTransitionName,Cr=je._internalRenderMenuItem,br=je._internalRenderSubMenuItem,Kn=je._internalComponents,Xr=(0,p.Z)(je,ot),Mr=m.useMemo(function(){return[tt(_n,kt,It,Kn,ct),tt(_n,kt,It,{},ct)]},[_n,kt,Kn]),zr=(0,$.Z)(Mr,2),Tr=zr[0],ai=zr[1],ti=m.useState(!1),Fr=(0,$.Z)(ti,2),Wr=Fr[0],Zr=Fr[1],Nr=m.useRef(),Ar=te(un),$r=sn==="rtl",Ir=(0,x.Z)(Wn,{value:Bn,postState:function(ft){return ft||It}}),_r=(0,$.Z)(Ir,2),Fn=_r[0],lr=_r[1],Sn=function(ft){var Dr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Hr(){lr(ft),vr==null||vr(ft)}Dr?(0,y.flushSync)(Hr):Hr()},Zn=m.useState(Fn),On=(0,$.Z)(Zn,2),Un=On[0],ur=On[1],yr=m.useRef(!1),gn=m.useMemo(function(){return(Mt==="inline"||Mt==="vertical")&&qt?["vertical",qt]:[Mt,!1]},[Mt,qt]),In=(0,$.Z)(gn,2),fr=In[0],or=In[1],pr=fr==="inline",Br=m.useState(fr),fi=(0,$.Z)(Br,2),Vr=fi[0],Qr=fi[1],oi=m.useState(or),Si=(0,$.Z)(oi,2),cs=Si[0],ni=Si[1];m.useEffect(function(){Qr(fr),ni(or),yr.current&&(pr?lr(Un):Sn(It))},[fr,or]);var _i=m.useState(0),Qi=(0,$.Z)(_i,2),Ai=Qi[0],Ji=Qi[1],ki=Ai>=Tr.length-1||Vr!=="horizontal"||ln;m.useEffect(function(){pr&&ur(Fn)},[Fn]),m.useEffect(function(){return yr.current=!0,function(){yr.current=!1}},[]);var di=C(),Gi=di.registerPath,Pi=di.unregisterPath,Vi=di.refreshOverflowKeys,Oi=di.isSubPathKey,li=di.getKeyPath,Mi=di.getKeys,zi=di.getSubPathKeys,qi=m.useMemo(function(){return{registerPath:Gi,unregisterPath:Pi}},[Gi,Pi]),fs=m.useMemo(function(){return{isSubPathKey:Oi}},[Oi]);m.useEffect(function(){Vi(ki?It:Tr.slice(Ai+1).map(function(Or){return Or.key}))},[Ai,ki]);var ds=(0,x.Z)(Hn||qn&&((He=Tr[0])===null||He===void 0?void 0:He.key),{value:Hn}),Wi=(0,$.Z)(ds,2),yi=Wi[0],cr=Wi[1],ir=B(function(Or){cr(Or)}),Ur=B(function(){cr(void 0)});(0,m.useImperativeHandle)(Ue,function(){return{list:Nr.current,focus:function(ft){var Dr,Hr=Mi(),jr=Se(Hr,Ar),ts=jr.elements,Hi=jr.key2element,Ss=jr.element2key,Ts=we(Nr.current,ts),ws=yi!=null?yi:Ts[0]?Ss.get(Ts[0]):(Dr=Tr.find(function(Ni){return!Ni.props.disabled}))===null||Dr===void 0?void 0:Dr.key,Ri=Hi.get(ws);if(ws&&Ri){var Ci;Ri==null||(Ci=Ri.focus)===null||Ci===void 0||Ci.call(Ri,ft)}}}});var Kr=(0,x.Z)(En||[],{value:Dt,postState:function(ft){return Array.isArray(ft)?ft:ft==null?It:[ft]}}),Lr=(0,$.Z)(Kr,2),Pr=Lr[0],ri=Lr[1],Jr=function(ft){if(mr){var Dr=ft.key,Hr=Pr.includes(Dr),jr;ar?Hr?jr=Pr.filter(function(Hi){return Hi!==Dr}):jr=[].concat((0,fe.Z)(Pr),[Dr]):jr=[Dr],ri(jr);var ts=(0,Te.Z)((0,Te.Z)({},ft),{},{selectedKeys:jr});Hr?Qt==null||Qt(ts):bt==null||bt(ts)}!ar&&Fn.length&&Vr!=="inline"&&Sn(It)},qr=B(function(Or){rr==null||rr(St(Or)),Jr(Or)}),Ei=B(function(Or,ft){var Dr=Fn.filter(function(jr){return jr!==Or});if(ft)Dr.push(Or);else if(Vr!=="inline"){var Hr=zi(Or);Dr=Dr.filter(function(jr){return!Hr.has(jr)})}(0,D.Z)(Fn,Dr,!0)||Sn(Dr,!0)}),hi=function(ft,Dr){var Hr=Dr!=null?Dr:!Fn.includes(ft);Ei(ft,Hr)},Di=Ne(Vr,yi,$r,Ar,Nr,Mi,li,cr,hi,hr);m.useEffect(function(){Zr(!0)},[]);var Fi=m.useMemo(function(){return{_internalRenderMenuItem:Cr,_internalRenderSubMenuItem:br}},[Cr,br]),xs=Vr!=="horizontal"||ln?Tr:Tr.map(function(Or,ft){return m.createElement(R,{key:Or.key,overflowDisabled:ft>Ai},Or)}),es=m.createElement(o.Z,(0,k.Z)({id:un,ref:Nr,prefixCls:"".concat(ct,"-overflow"),component:"ul",itemComponent:Ie,className:ce()(ct,"".concat(ct,"-root"),"".concat(ct,"-").concat(Vr),Ot,(0,pe.Z)((0,pe.Z)({},"".concat(ct,"-inline-collapsed"),cs),"".concat(ct,"-rtl"),$r),lt),dir:sn,style:wt,role:"menu",tabIndex:pn,data:xs,renderRawItem:function(ft){return ft},renderRawRest:function(ft){var Dr=ft.length,Hr=Dr?Tr.slice(-Dr):null;return m.createElement($n,{eventKey:w,title:jn,disabled:ki,internalPopupClose:Dr===0,popupClassName:Xn},Hr)},maxCount:Vr!=="horizontal"||ln?o.Z.INVALIDATE:o.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(ft){Ji(ft)},onKeyDown:Di},Xr));return m.createElement(Q.Provider,{value:Fi},m.createElement(S.Provider,{value:Ar},m.createElement(R,{prefixCls:ct,rootClassName:lt,mode:Vr,openKeys:Fn,rtl:$r,disabled:cn,motion:Wr?Yn:null,defaultMotions:Wr?er:null,activeKey:yi,onActive:ir,onInactive:Ur,selectedKeys:Pr,inlineIndent:mn,subMenuOpenDelay:yn,subMenuCloseDelay:Wt,forceSubMenuRender:Jn,builtinPlacements:Pn,triggerSubMenuAction:xn,getPopupContainer:tn,itemIcon:kn,expandIcon:dr,onItemClick:qr,onOpenChange:Ei},m.createElement(be.Provider,{value:fs},es),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(ae.Provider,{value:qi},ai)))))}),Xt=Ft,Bt=Xt;Bt.Item=Ie,Bt.SubMenu=$n,Bt.ItemGroup=dt,Bt.Divider=Me;var yt=Bt},11780:function(vn,Et,A){"use strict";A.d(Et,{Z:function(){return J}});var k=A(14809),pe=A(20439),Te=A(50298),fe=A(62646),$=A(59301),p=A(92310),me=A.n(p),ce=A(29301),o=A(34280),x=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],D=void 0;function h(v,g){var U=v.prefixCls,ie=v.invalidate,Be=v.item,Ze=v.renderItem,Qe=v.responsive,nt=v.responsiveDisabled,At=v.registerSize,_t=v.itemKey,xe=v.className,vt=v.style,zt=v.children,Ct=v.display,nn=v.order,qe=v.component,Re=qe===void 0?"div":qe,we=(0,fe.Z)(v,x),K=Qe&&!Ct;function Se(oe){At(_t,oe)}$.useEffect(function(){return function(){Se(null)}},[]);var Ne=Ze&&Be!==D?Ze(Be,{index:nn}):zt,V;ie||(V={opacity:K?0:1,height:K?0:D,overflowY:K?"hidden":D,order:Qe?nn:D,pointerEvents:K?"none":D,position:K?"absolute":D});var I={};K&&(I["aria-hidden"]=!0);var F=$.createElement(Re,(0,k.Z)({className:me()(!ie&&U,xe),style:(0,pe.Z)((0,pe.Z)({},V),vt)},I,we,{ref:g}),Ne);return Qe&&(F=$.createElement(ce.Z,{onResize:function(w){var C=w.offsetWidth;Se(C)},disabled:nt},F)),F}var m=$.forwardRef(h);m.displayName="Item";var y=m,S=A(6089),M=A(4676),z=A(16089);function Y(v){if(typeof MessageChannel=="undefined")(0,z.Z)(v);else{var g=new MessageChannel;g.port1.onmessage=function(){return v()},g.port2.postMessage(void 0)}}function L(){var v=$.useRef(null),g=function(ie){v.current||(v.current=[],Y(function(){(0,M.unstable_batchedUpdates)(function(){v.current.forEach(function(Be){Be()}),v.current=null})})),v.current.push(ie)};return g}function O(v,g){var U=$.useState(g),ie=(0,Te.Z)(U,2),Be=ie[0],Ze=ie[1],Qe=(0,S.Z)(function(nt){v(function(){Ze(nt)})});return[Be,Qe]}var T=$.createContext(null),R=["component"],se=["className"],ae=["className"],q=function(g,U){var ie=$.useContext(T);if(!ie){var Be=g.component,Ze=Be===void 0?"div":Be,Qe=(0,fe.Z)(g,R);return $.createElement(Ze,(0,k.Z)({},Qe,{ref:U}))}var nt=ie.className,At=(0,fe.Z)(ie,se),_t=g.className,xe=(0,fe.Z)(g,ae);return $.createElement(T.Provider,{value:null},$.createElement(y,(0,k.Z)({ref:U,className:me()(nt,_t)},At,xe)))},he=$.forwardRef(q);he.displayName="RawItem";var ve=he,be=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Oe="responsive",Q="invalidate";function P(v){return"+ ".concat(v.length," ...")}function j(v,g){var U=v.prefixCls,ie=U===void 0?"rc-overflow":U,Be=v.data,Ze=Be===void 0?[]:Be,Qe=v.renderItem,nt=v.renderRawItem,At=v.itemKey,_t=v.itemWidth,xe=_t===void 0?10:_t,vt=v.ssr,zt=v.style,Ct=v.className,nn=v.maxCount,qe=v.renderRest,Re=v.renderRawRest,we=v.suffix,K=v.component,Se=K===void 0?"div":K,Ne=v.itemComponent,V=v.onVisibleChange,I=(0,fe.Z)(v,be),F=vt==="full",oe=L(),w=O(oe,null),C=(0,Te.Z)(w,2),B=C[0],W=C[1],Z=B||0,te=O(oe,new Map),ue=(0,Te.Z)(te,2),ge=ue[0],Ce=ue[1],De=O(oe,0),Fe=(0,Te.Z)(De,2),Ve=Fe[0],Ge=Fe[1],$e=O(oe,0),mt=(0,Te.Z)($e,2),xt=mt[0],St=mt[1],Lt=O(oe,0),Ht=(0,Te.Z)(Lt,2),ut=Ht[0],Ut=Ht[1],Le=(0,$.useState)(null),Ae=(0,Te.Z)(Le,2),Ie=Ae[0],H=Ae[1],ee=(0,$.useState)(null),de=(0,Te.Z)(ee,2),re=de[0],_e=de[1],et=$.useMemo(function(){return re===null&&F?Number.MAX_SAFE_INTEGER:re||0},[re,B]),Ye=(0,$.useState)(!1),it=(0,Te.Z)(Ye,2),Rt=it[0],on=it[1],fn="".concat(ie,"-item"),Pt=Math.max(Ve,xt),jt=nn===Oe,wn=Ze.length&&jt,Gn=nn===Q,An=wn||typeof nn=="number"&&Ze.length>nn,Mn=(0,$.useMemo)(function(){var Bt=Ze;return wn?B===null&&F?Bt=Ze:Bt=Ze.slice(0,Math.min(Ze.length,Z/xe)):typeof nn=="number"&&(Bt=Ze.slice(0,nn)),Bt},[Ze,xe,B,nn,wn]),Cn=(0,$.useMemo)(function(){return wn?Ze.slice(et+1):Ze.slice(Mn.length)},[Ze,Mn,wn,et]),rn=(0,$.useCallback)(function(Bt,yt){var ye;return typeof At=="function"?At(Bt):(ye=At&&(Bt==null?void 0:Bt[At]))!==null&&ye!==void 0?ye:yt},[At]),Tn=(0,$.useCallback)(Qe||function(Bt){return Bt},[Qe]);function $n(Bt,yt,ye){re===Bt&&(yt===void 0||yt===Ie)||(_e(Bt),ye||(on(Bt<Ze.length-1),V==null||V(Bt)),yt!==void 0&&H(yt))}function tr(Bt,yt){W(yt.clientWidth)}function Me(Bt,yt){Ce(function(ye){var Ue=new Map(ye);return yt===null?Ue.delete(Bt):Ue.set(Bt,yt),Ue})}function Pe(Bt,yt){St(yt),Ge(xt)}function Tt(Bt,yt){Ut(yt)}function pt(Bt){return ge.get(rn(Mn[Bt],Bt))}(0,o.Z)(function(){if(Z&&typeof Pt=="number"&&Mn){var Bt=ut,yt=Mn.length,ye=yt-1;if(!yt){$n(0,null);return}for(var Ue=0;Ue<yt;Ue+=1){var He=pt(Ue);if(F&&(He=He||0),He===void 0){$n(Ue-1,void 0,!0);break}if(Bt+=He,ye===0&&Bt<=Z||Ue===ye-1&&Bt+pt(ye)<=Z){$n(ye,null);break}else if(Bt+Pt>Z){$n(Ue-1,Bt-He-ut+xt);break}}we&&pt(0)+ut>Z&&H(null)}},[Z,ge,xt,ut,rn,Mn]);var dt=Rt&&!!Cn.length,Zt={};Ie!==null&&wn&&(Zt={position:"absolute",left:Ie,top:0});var ze={prefixCls:fn,responsive:wn,component:Ne,invalidate:Gn},tt=nt?function(Bt,yt){var ye=rn(Bt,yt);return $.createElement(T.Provider,{key:ye,value:(0,pe.Z)((0,pe.Z)({},ze),{},{order:yt,item:Bt,itemKey:ye,registerSize:Me,display:yt<=et})},nt(Bt,yt))}:function(Bt,yt){var ye=rn(Bt,yt);return $.createElement(y,(0,k.Z)({},ze,{order:yt,key:ye,item:Bt,renderItem:Tn,itemKey:ye,registerSize:Me,display:yt<=et}))},ot={order:dt?et:Number.MAX_SAFE_INTEGER,className:"".concat(fn,"-rest"),registerSize:Pe,display:dt},It=qe||P,Ft=Re?$.createElement(T.Provider,{value:(0,pe.Z)((0,pe.Z)({},ze),ot)},Re(Cn)):$.createElement(y,(0,k.Z)({},ze,ot),typeof It=="function"?It(Cn):It),Xt=$.createElement(Se,(0,k.Z)({className:me()(!Gn&&ie,Ct),style:zt,ref:g},I),Mn.map(tt),An?Ft:null,we&&$.createElement(y,(0,k.Z)({},ze,{responsive:jt,responsiveDisabled:!wn,order:et,className:"".concat(fn,"-suffix"),registerSize:Tt,display:!0,style:Zt}),we));return jt?$.createElement(ce.Z,{onResize:tr,disabled:!wn},Xt):Xt}var X=$.forwardRef(j);X.displayName="Overflow",X.Item=ve,X.RESPONSIVE=Oe,X.INVALIDATE=Q;var ne=X,J=ne},29301:function(vn,Et,A){"use strict";A.d(Et,{Z:function(){return Q}});var k=A(14809),pe=A(59301),Te=A(11592),fe=A(48736),$=A(20439),p=A(93664),me=A(76846),ce=A(8654),o=pe.createContext(null);function x(P){var j=P.children,X=P.onBatchResize,ne=pe.useRef(0),J=pe.useRef([]),v=pe.useContext(o),g=pe.useCallback(function(U,ie,Be){ne.current+=1;var Ze=ne.current;J.current.push({size:U,element:ie,data:Be}),Promise.resolve().then(function(){Ze===ne.current&&(X==null||X(J.current),J.current=[])}),v==null||v(U,ie,Be)},[X,v]);return pe.createElement(o.Provider,{value:g},j)}var D=A(76374),h=new Map;function m(P){P.forEach(function(j){var X,ne=j.target;(X=h.get(ne))===null||X===void 0||X.forEach(function(J){return J(ne)})})}var y=new D.Z(m),S=null,M=null;function z(P,j){h.has(P)||(h.set(P,new Set),y.observe(P)),h.get(P).add(j)}function Y(P,j){h.has(P)&&(h.get(P).delete(j),h.get(P).size||(y.unobserve(P),h.delete(P)))}var L=A(99153),O=A(84851),T=A(19257),R=A(93046),se=function(P){(0,T.Z)(X,P);var j=(0,R.Z)(X);function X(){return(0,L.Z)(this,X),j.apply(this,arguments)}return(0,O.Z)(X,[{key:"render",value:function(){return this.props.children}}]),X}(pe.Component);function ae(P,j){var X=P.children,ne=P.disabled,J=pe.useRef(null),v=pe.useRef(null),g=pe.useContext(o),U=typeof X=="function",ie=U?X(J):X,Be=pe.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ze=!U&&pe.isValidElement(ie)&&(0,ce.Yr)(ie),Qe=Ze?(0,ce.C4)(ie):null,nt=(0,ce.x1)(Qe,J),At=function(){var zt;return(0,me.ZP)(J.current)||(J.current&&(0,p.Z)(J.current)==="object"?(0,me.ZP)((zt=J.current)===null||zt===void 0?void 0:zt.nativeElement):null)||(0,me.ZP)(v.current)};pe.useImperativeHandle(j,function(){return At()});var _t=pe.useRef(P);_t.current=P;var xe=pe.useCallback(function(vt){var zt=_t.current,Ct=zt.onResize,nn=zt.data,qe=vt.getBoundingClientRect(),Re=qe.width,we=qe.height,K=vt.offsetWidth,Se=vt.offsetHeight,Ne=Math.floor(Re),V=Math.floor(we);if(Be.current.width!==Ne||Be.current.height!==V||Be.current.offsetWidth!==K||Be.current.offsetHeight!==Se){var I={width:Ne,height:V,offsetWidth:K,offsetHeight:Se};Be.current=I;var F=K===Math.round(Re)?Re:K,oe=Se===Math.round(we)?we:Se,w=(0,$.Z)((0,$.Z)({},I),{},{offsetWidth:F,offsetHeight:oe});g==null||g(w,vt,nn),Ct&&Promise.resolve().then(function(){Ct(w,vt)})}},[]);return pe.useEffect(function(){var vt=At();return vt&&!ne&&z(vt,xe),function(){return Y(vt,xe)}},[J.current,ne]),pe.createElement(se,{ref:v},Ze?pe.cloneElement(ie,{ref:nt}):ie)}var q=pe.forwardRef(ae),he=q,ve="rc-observer-key";function be(P,j){var X=P.children,ne=typeof X=="function"?[X]:(0,Te.Z)(X);return ne.map(function(J,v){var g=(J==null?void 0:J.key)||"".concat(ve,"-").concat(v);return pe.createElement(he,(0,k.Z)({},P,{key:g,ref:v===0?j:void 0}),J)})}var Oe=pe.forwardRef(be);Oe.Collection=x;var Q=Oe},6551:function(vn,Et,A){"use strict";A.d(Et,{ZP:function(){return me}});var k=A(50298),pe=A(59301),Te=A(47273),fe=0,$=(0,Te.Z)();function p(){var ce;return $?(ce=fe,fe+=1):ce="TEST_OR_SSR",ce}function me(ce){var o=pe.useState(),x=(0,k.Z)(o,2),D=x[0],h=x[1];return pe.useEffect(function(){h("rc_select_".concat(p()))},[]),ce||D}},37463:function(vn,Et,A){"use strict";A.d(Et,{Ac:function(){return Fe},Xo:function(){return Ge},Wx:function(){return mt},ZP:function(){return tr},lk:function(){return O}});var k=A(14809),pe=A(95190),Te=A(4635),fe=A(20439),$=A(50298),p=A(62646),me=A(93664),ce=A(18929),o=A(48736),x=A(59301),D=A(92310),h=A.n(D),m=A(34280),y=A(49658),S=A(8654),M=function(Pe){var Tt=Pe.className,pt=Pe.customizeIcon,dt=Pe.customizeIconProps,Zt=Pe.children,ze=Pe.onMouseDown,tt=Pe.onClick,ot=typeof pt=="function"?pt(dt):pt;return x.createElement("span",{className:Tt,onMouseDown:function(Ft){Ft.preventDefault(),ze==null||ze(Ft)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:tt,"aria-hidden":!0},ot!==void 0?ot:x.createElement("span",{className:h()(Tt.split(/\s+/).map(function(It){return"".concat(It,"-icon")}))},Zt))},z=M,Y=function(Pe,Tt,pt,dt,Zt){var ze=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,tt=arguments.length>6?arguments[6]:void 0,ot=arguments.length>7?arguments[7]:void 0,It=x.useMemo(function(){if((0,me.Z)(dt)==="object")return dt.clearIcon;if(Zt)return Zt},[dt,Zt]),Ft=x.useMemo(function(){return!!(!ze&&dt&&(pt.length||tt)&&!(ot==="combobox"&&tt===""))},[dt,ze,pt.length,tt,ot]);return{allowClear:Ft,clearIcon:x.createElement(z,{className:"".concat(Pe,"-clear"),onMouseDown:Tt,customizeIcon:It},"\xD7")}},L=x.createContext(null);function O(){return x.useContext(L)}function T(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Pe=x.useState(!1),Tt=(0,$.Z)(Pe,2),pt=Tt[0],dt=Tt[1],Zt=x.useRef(null),ze=function(){window.clearTimeout(Zt.current)};x.useEffect(function(){return ze},[]);var tt=function(It,Ft){ze(),Zt.current=window.setTimeout(function(){dt(It),Ft&&Ft()},Me)};return[pt,tt,ze]}function R(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Pe=x.useRef(null),Tt=x.useRef(null);x.useEffect(function(){return function(){window.clearTimeout(Tt.current)}},[]);function pt(dt){(dt||Pe.current===null)&&(Pe.current=dt),window.clearTimeout(Tt.current),Tt.current=window.setTimeout(function(){Pe.current=null},Me)}return[function(){return Pe.current},pt]}function se(Me,Pe,Tt,pt){var dt=x.useRef(null);dt.current={open:Pe,triggerOpen:Tt,customizedTrigger:pt},x.useEffect(function(){function Zt(ze){var tt;if(!((tt=dt.current)!==null&&tt!==void 0&&tt.customizedTrigger)){var ot=ze.target;ot.shadowRoot&&ze.composed&&(ot=ze.composedPath()[0]||ot),dt.current.open&&Me().filter(function(It){return It}).every(function(It){return!It.contains(ot)&&It!==ot})&&dt.current.triggerOpen(!1)}}return window.addEventListener("mousedown",Zt),function(){return window.removeEventListener("mousedown",Zt)}},[])}var ae=A(10228);function q(Me){return Me&&![ae.Z.ESC,ae.Z.SHIFT,ae.Z.BACKSPACE,ae.Z.TAB,ae.Z.WIN_KEY,ae.Z.ALT,ae.Z.META,ae.Z.WIN_KEY_RIGHT,ae.Z.CTRL,ae.Z.SEMICOLON,ae.Z.EQUALS,ae.Z.CAPS_LOCK,ae.Z.CONTEXT_MENU,ae.Z.F1,ae.Z.F2,ae.Z.F3,ae.Z.F4,ae.Z.F5,ae.Z.F6,ae.Z.F7,ae.Z.F8,ae.Z.F9,ae.Z.F10,ae.Z.F11,ae.Z.F12].includes(Me)}var he=A(26112),ve=A(11780);function be(Me,Pe,Tt){var pt=(0,fe.Z)((0,fe.Z)({},Me),Tt?Pe:{});return Object.keys(Pe).forEach(function(dt){var Zt=Pe[dt];typeof Zt=="function"&&(pt[dt]=function(){for(var ze,tt=arguments.length,ot=new Array(tt),It=0;It<tt;It++)ot[It]=arguments[It];return Zt.apply(void 0,ot),(ze=Me[dt])===null||ze===void 0?void 0:ze.call.apply(ze,[Me].concat(ot))})}),pt}var Oe=be,Q=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],P=function(Pe,Tt){var pt=Pe.prefixCls,dt=Pe.id,Zt=Pe.inputElement,ze=Pe.autoFocus,tt=Pe.autoComplete,ot=Pe.editable,It=Pe.activeDescendantId,Ft=Pe.value,Xt=Pe.open,Bt=Pe.attrs,yt=(0,p.Z)(Pe,Q),ye=Zt||x.createElement("input",null),Ue=ye,He=Ue.ref,je=Ue.props;return(0,o.Kp)(!("maxLength"in ye.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),ye=x.cloneElement(ye,(0,fe.Z)((0,fe.Z)((0,fe.Z)({type:"search"},Oe(yt,je,!0)),{},{id:dt,ref:(0,S.sQ)(Tt,He),autoComplete:tt||"off",autoFocus:ze,className:h()("".concat(pt,"-selection-search-input"),je==null?void 0:je.className),role:"combobox","aria-expanded":Xt||!1,"aria-haspopup":"listbox","aria-owns":"".concat(dt,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(dt,"_list"),"aria-activedescendant":Xt?It:void 0},Bt),{},{value:ot?Ft:"",readOnly:!ot,unselectable:ot?null:"on",style:(0,fe.Z)((0,fe.Z)({},je.style),{},{opacity:ot?null:0})})),ye},j=x.forwardRef(P),X=j;function ne(Me){return Array.isArray(Me)?Me:Me!==void 0?[Me]:[]}var J=typeof window!="undefined"&&window.document&&window.document.documentElement,v=J;function g(Me){return Me!=null}function U(Me){return!Me&&Me!==0}function ie(Me){return["string","number"].includes((0,me.Z)(Me))}function Be(Me){var Pe=void 0;return Me&&(ie(Me.title)?Pe=Me.title.toString():ie(Me.label)&&(Pe=Me.label.toString())),Pe}function Ze(Me,Pe){v?x.useLayoutEffect(Me,Pe):x.useEffect(Me,Pe)}function Qe(Me){var Pe;return(Pe=Me.key)!==null&&Pe!==void 0?Pe:Me.value}var nt=function(Pe){Pe.preventDefault(),Pe.stopPropagation()},At=function(Pe){var Tt=Pe.id,pt=Pe.prefixCls,dt=Pe.values,Zt=Pe.open,ze=Pe.searchValue,tt=Pe.autoClearSearchValue,ot=Pe.inputRef,It=Pe.placeholder,Ft=Pe.disabled,Xt=Pe.mode,Bt=Pe.showSearch,yt=Pe.autoFocus,ye=Pe.autoComplete,Ue=Pe.activeDescendantId,He=Pe.tabIndex,je=Pe.removeIcon,at=Pe.maxTagCount,ct=Pe.maxTagTextLength,lt=Pe.maxTagPlaceholder,wt=lt===void 0?function(Qt){return"+ ".concat(Qt.length," ...")}:lt,Ot=Pe.tagRender,$t=Pe.onToggleOpen,pn=Pe.onRemove,kt=Pe.onInputChange,_n=Pe.onInputPaste,sn=Pe.onInputKeyDown,un=Pe.onInputMouseDown,Nt=Pe.onInputCompositionStart,Mt=Pe.onInputCompositionEnd,qt=Pe.onInputBlur,cn=x.useRef(null),ln=(0,x.useState)(0),an=(0,$.Z)(ln,2),yn=an[0],Vt=an[1],Wt=(0,x.useState)(!1),Jn=(0,$.Z)(Wt,2),Wn=Jn[0],Bn=Jn[1],Hn="".concat(pt,"-selection"),qn=Zt||Xt==="multiple"&&tt===!1||Xt==="tags"?ze:"",Vn=Xt==="tags"||Xt==="multiple"&&tt===!1||Bt&&(Zt||Wn);Ze(function(){Vt(cn.current.scrollWidth)},[qn]);var mr=function(Yt,mn,Yn,er,en){return x.createElement("span",{title:Be(Yt),className:h()("".concat(Hn,"-item"),(0,Te.Z)({},"".concat(Hn,"-item-disabled"),Yn))},x.createElement("span",{className:"".concat(Hn,"-item-content")},mn),er&&x.createElement(z,{className:"".concat(Hn,"-item-remove"),onMouseDown:nt,onClick:en,customizeIcon:je},"\xD7"))},nr=function(Yt,mn,Yn,er,en,xn){var Pn=function(dr){nt(dr),$t(!Zt)};return x.createElement("span",{onMouseDown:Pn},Ot({label:mn,value:Yt,disabled:Yn,closable:er,onClose:en,isMaxTag:!!xn}))},ar=function(Yt){var mn=Yt.disabled,Yn=Yt.label,er=Yt.value,en=!Ft&&!mn,xn=Yn;if(typeof ct=="number"&&(typeof Yn=="string"||typeof Yn=="number")){var Pn=String(xn);Pn.length>ct&&(xn="".concat(Pn.slice(0,ct),"..."))}var kn=function(bn){bn&&bn.stopPropagation(),pn(Yt)};return typeof Ot=="function"?nr(er,xn,mn,en,kn):mr(Yt,xn,mn,en,kn)},En=function(Yt){if(!dt.length)return null;var mn=typeof wt=="function"?wt(Yt):wt;return typeof Ot=="function"?nr(void 0,mn,!1,!1,void 0,!0):mr({title:mn},mn,!1)},Dt=x.createElement("div",{className:"".concat(Hn,"-search"),style:{width:yn},onFocus:function(){Bn(!0)},onBlur:function(){Bn(!1)}},x.createElement(X,{ref:ot,open:Zt,prefixCls:pt,id:Tt,inputElement:null,disabled:Ft,autoFocus:yt,autoComplete:ye,editable:Vn,activeDescendantId:Ue,value:qn,onKeyDown:sn,onMouseDown:un,onChange:kt,onPaste:_n,onCompositionStart:Nt,onCompositionEnd:Mt,onBlur:qt,tabIndex:He,attrs:(0,he.Z)(Pe,!0)}),x.createElement("span",{ref:cn,className:"".concat(Hn,"-search-mirror"),"aria-hidden":!0},qn,"\xA0")),bt=x.createElement(ve.Z,{prefixCls:"".concat(Hn,"-overflow"),data:dt,renderItem:ar,renderRest:En,suffix:Dt,itemKey:Qe,maxCount:at});return x.createElement("span",{className:"".concat(Hn,"-wrap")},bt,!dt.length&&!qn&&x.createElement("span",{className:"".concat(Hn,"-placeholder")},It))},_t=At,xe=function(Pe){var Tt=Pe.inputElement,pt=Pe.prefixCls,dt=Pe.id,Zt=Pe.inputRef,ze=Pe.disabled,tt=Pe.autoFocus,ot=Pe.autoComplete,It=Pe.activeDescendantId,Ft=Pe.mode,Xt=Pe.open,Bt=Pe.values,yt=Pe.placeholder,ye=Pe.tabIndex,Ue=Pe.showSearch,He=Pe.searchValue,je=Pe.activeValue,at=Pe.maxLength,ct=Pe.onInputKeyDown,lt=Pe.onInputMouseDown,wt=Pe.onInputChange,Ot=Pe.onInputPaste,$t=Pe.onInputCompositionStart,pn=Pe.onInputCompositionEnd,kt=Pe.onInputBlur,_n=Pe.title,sn=x.useState(!1),un=(0,$.Z)(sn,2),Nt=un[0],Mt=un[1],qt=Ft==="combobox",cn=qt||Ue,ln=Bt[0],an=He||"";qt&&je&&!Nt&&(an=je),x.useEffect(function(){qt&&Mt(!1)},[qt,je]);var yn=Ft!=="combobox"&&!Xt&&!Ue?!1:!!an,Vt=_n===void 0?Be(ln):_n,Wt=x.useMemo(function(){return ln?null:x.createElement("span",{className:"".concat(pt,"-selection-placeholder"),style:yn?{visibility:"hidden"}:void 0},yt)},[ln,yn,yt,pt]);return x.createElement("span",{className:"".concat(pt,"-selection-wrap")},x.createElement("span",{className:"".concat(pt,"-selection-search")},x.createElement(X,{ref:Zt,prefixCls:pt,id:dt,open:Xt,inputElement:Tt,disabled:ze,autoFocus:tt,autoComplete:ot,editable:cn,activeDescendantId:It,value:an,onKeyDown:ct,onMouseDown:lt,onChange:function(Wn){Mt(!0),wt(Wn)},onPaste:Ot,onCompositionStart:$t,onCompositionEnd:pn,onBlur:kt,tabIndex:ye,attrs:(0,he.Z)(Pe,!0),maxLength:qt?at:void 0})),!qt&&ln?x.createElement("span",{className:"".concat(pt,"-selection-item"),title:Vt,style:yn?{visibility:"hidden"}:void 0},ln.label):null,Wt)},vt=xe,zt=function(Pe,Tt){var pt=(0,x.useRef)(null),dt=(0,x.useRef)(!1),Zt=Pe.prefixCls,ze=Pe.open,tt=Pe.mode,ot=Pe.showSearch,It=Pe.tokenWithEnter,Ft=Pe.disabled,Xt=Pe.prefix,Bt=Pe.autoClearSearchValue,yt=Pe.onSearch,ye=Pe.onSearchSubmit,Ue=Pe.onToggleOpen,He=Pe.onInputKeyDown,je=Pe.onInputBlur,at=Pe.domRef;x.useImperativeHandle(Tt,function(){return{focus:function(Vt){pt.current.focus(Vt)},blur:function(){pt.current.blur()}}});var ct=R(0),lt=(0,$.Z)(ct,2),wt=lt[0],Ot=lt[1],$t=function(Vt){var Wt=Vt.which,Jn=pt.current instanceof HTMLTextAreaElement;!Jn&&ze&&(Wt===ae.Z.UP||Wt===ae.Z.DOWN)&&Vt.preventDefault(),He&&He(Vt),Wt===ae.Z.ENTER&&tt==="tags"&&!dt.current&&!ze&&(ye==null||ye(Vt.target.value)),!(Jn&&!ze&&~[ae.Z.UP,ae.Z.DOWN,ae.Z.LEFT,ae.Z.RIGHT].indexOf(Wt))&&q(Wt)&&Ue(!0)},pn=function(){Ot(!0)},kt=(0,x.useRef)(null),_n=function(Vt){yt(Vt,!0,dt.current)!==!1&&Ue(!0)},sn=function(){dt.current=!0},un=function(Vt){dt.current=!1,tt!=="combobox"&&_n(Vt.target.value)},Nt=function(Vt){var Wt=Vt.target.value;if(It&&kt.current&&/[\r\n]/.test(kt.current)){var Jn=kt.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");Wt=Wt.replace(Jn,kt.current)}kt.current=null,_n(Wt)},Mt=function(Vt){var Wt=Vt.clipboardData,Jn=Wt==null?void 0:Wt.getData("text");kt.current=Jn||""},qt=function(Vt){var Wt=Vt.target;if(Wt!==pt.current){var Jn=document.body.style.msTouchAction!==void 0;Jn?setTimeout(function(){pt.current.focus()}):pt.current.focus()}},cn=function(Vt){var Wt=wt();Vt.target!==pt.current&&!Wt&&!(tt==="combobox"&&Ft)&&Vt.preventDefault(),(tt!=="combobox"&&(!ot||!Wt)||!ze)&&(ze&&Bt!==!1&&yt("",!0,!1),Ue())},ln={inputRef:pt,onInputKeyDown:$t,onInputMouseDown:pn,onInputChange:Nt,onInputPaste:Mt,onInputCompositionStart:sn,onInputCompositionEnd:un,onInputBlur:je},an=tt==="multiple"||tt==="tags"?x.createElement(_t,(0,k.Z)({},Pe,ln)):x.createElement(vt,(0,k.Z)({},Pe,ln));return x.createElement("div",{ref:at,className:"".concat(Zt,"-selector"),onClick:qt,onMouseDown:cn},Xt&&x.createElement("div",{className:"".concat(Zt,"-prefix")},Xt),an)},Ct=x.forwardRef(zt),nn=Ct,qe=A(65352),Re=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],we=function(Pe){var Tt=Pe===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:Tt,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:Tt,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:Tt,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:Tt,adjustY:1},htmlRegion:"scroll"}}},K=function(Pe,Tt){var pt=Pe.prefixCls,dt=Pe.disabled,Zt=Pe.visible,ze=Pe.children,tt=Pe.popupElement,ot=Pe.animation,It=Pe.transitionName,Ft=Pe.dropdownStyle,Xt=Pe.dropdownClassName,Bt=Pe.direction,yt=Bt===void 0?"ltr":Bt,ye=Pe.placement,Ue=Pe.builtinPlacements,He=Pe.dropdownMatchSelectWidth,je=Pe.dropdownRender,at=Pe.dropdownAlign,ct=Pe.getPopupContainer,lt=Pe.empty,wt=Pe.getTriggerDOMNode,Ot=Pe.onPopupVisibleChange,$t=Pe.onPopupMouseEnter,pn=(0,p.Z)(Pe,Re),kt="".concat(pt,"-dropdown"),_n=tt;je&&(_n=je(tt));var sn=x.useMemo(function(){return Ue||we(He)},[Ue,He]),un=ot?"".concat(kt,"-").concat(ot):It,Nt=typeof He=="number",Mt=x.useMemo(function(){return Nt?null:He===!1?"minWidth":"width"},[He,Nt]),qt=Ft;Nt&&(qt=(0,fe.Z)((0,fe.Z)({},qt),{},{width:He}));var cn=x.useRef(null);return x.useImperativeHandle(Tt,function(){return{getPopupElement:function(){var an;return(an=cn.current)===null||an===void 0?void 0:an.popupElement}}}),x.createElement(qe.Z,(0,k.Z)({},pn,{showAction:Ot?["click"]:[],hideAction:Ot?["click"]:[],popupPlacement:ye||(yt==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:sn,prefixCls:kt,popupTransitionName:un,popup:x.createElement("div",{onMouseEnter:$t},_n),ref:cn,stretch:Mt,popupAlign:at,popupVisible:Zt,getPopupContainer:ct,popupClassName:h()(Xt,(0,Te.Z)({},"".concat(kt,"-empty"),lt)),popupStyle:qt,getTriggerDOMNode:wt,onPopupVisibleChange:Ot}),ze)},Se=x.forwardRef(K),Ne=Se,V=A(21696);function I(Me,Pe){var Tt=Me.key,pt;return"value"in Me&&(pt=Me.value),Tt!=null?Tt:pt!==void 0?pt:"rc-index-key-".concat(Pe)}function F(Me){return typeof Me!="undefined"&&!Number.isNaN(Me)}function oe(Me,Pe){var Tt=Me||{},pt=Tt.label,dt=Tt.value,Zt=Tt.options,ze=Tt.groupLabel,tt=pt||(Pe?"children":"label");return{label:tt,value:dt||"value",options:Zt||"options",groupLabel:ze||tt}}function w(Me){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Tt=Pe.fieldNames,pt=Pe.childrenAsData,dt=[],Zt=oe(Tt,!1),ze=Zt.label,tt=Zt.value,ot=Zt.options,It=Zt.groupLabel;function Ft(Xt,Bt){Array.isArray(Xt)&&Xt.forEach(function(yt){if(Bt||!(ot in yt)){var ye=yt[tt];dt.push({key:I(yt,dt.length),groupOption:Bt,data:yt,label:yt[ze],value:ye})}else{var Ue=yt[It];Ue===void 0&&pt&&(Ue=yt.label),dt.push({key:I(yt,dt.length),group:!0,data:yt,label:Ue}),Ft(yt[ot],!0)}})}return Ft(Me,!1),dt}function C(Me){var Pe=(0,fe.Z)({},Me);return"props"in Pe||Object.defineProperty(Pe,"props",{get:function(){return(0,o.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),Pe}}),Pe}var B=function(Pe,Tt,pt){if(!Tt||!Tt.length)return null;var dt=!1,Zt=function tt(ot,It){var Ft=(0,V.Z)(It),Xt=Ft[0],Bt=Ft.slice(1);if(!Xt)return[ot];var yt=ot.split(Xt);return dt=dt||yt.length>1,yt.reduce(function(ye,Ue){return[].concat((0,pe.Z)(ye),(0,pe.Z)(tt(Ue,Bt)))},[]).filter(Boolean)},ze=Zt(Pe,Tt);return dt?typeof pt!="undefined"?ze.slice(0,pt):ze:null},W=x.createContext(null),Z=W;function te(Me){var Pe=Me.visible,Tt=Me.values;if(!Pe)return null;var pt=50;return x.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(Tt.slice(0,pt).map(function(dt){var Zt=dt.label,ze=dt.value;return["number","string"].includes((0,me.Z)(Zt))?Zt:ze}).join(", ")),Tt.length>pt?", ...":null)}var ue=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],ge=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],Ce=function(Pe){return Pe==="tags"||Pe==="multiple"},De=x.forwardRef(function(Me,Pe){var Tt,pt=Me.id,dt=Me.prefixCls,Zt=Me.className,ze=Me.showSearch,tt=Me.tagRender,ot=Me.direction,It=Me.omitDomProps,Ft=Me.displayValues,Xt=Me.onDisplayValuesChange,Bt=Me.emptyOptions,yt=Me.notFoundContent,ye=yt===void 0?"Not Found":yt,Ue=Me.onClear,He=Me.mode,je=Me.disabled,at=Me.loading,ct=Me.getInputElement,lt=Me.getRawInputElement,wt=Me.open,Ot=Me.defaultOpen,$t=Me.onDropdownVisibleChange,pn=Me.activeValue,kt=Me.onActiveValueChange,_n=Me.activeDescendantId,sn=Me.searchValue,un=Me.autoClearSearchValue,Nt=Me.onSearch,Mt=Me.onSearchSplit,qt=Me.tokenSeparators,cn=Me.allowClear,ln=Me.prefix,an=Me.suffixIcon,yn=Me.clearIcon,Vt=Me.OptionList,Wt=Me.animation,Jn=Me.transitionName,Wn=Me.dropdownStyle,Bn=Me.dropdownClassName,Hn=Me.dropdownMatchSelectWidth,qn=Me.dropdownRender,Vn=Me.dropdownAlign,mr=Me.placement,nr=Me.builtinPlacements,ar=Me.getPopupContainer,En=Me.showAction,Dt=En===void 0?[]:En,bt=Me.onFocus,Qt=Me.onBlur,Yt=Me.onKeyUp,mn=Me.onKeyDown,Yn=Me.onMouseDown,er=(0,p.Z)(Me,ue),en=Ce(He),xn=(ze!==void 0?ze:en)||He==="combobox",Pn=(0,fe.Z)({},er);ge.forEach(function(cr){delete Pn[cr]}),It==null||It.forEach(function(cr){delete Pn[cr]});var kn=x.useState(!1),dr=(0,$.Z)(kn,2),bn=dr[0],jn=dr[1];x.useEffect(function(){jn((0,y.Z)())},[]);var Xn=x.useRef(null),tn=x.useRef(null),rr=x.useRef(null),vr=x.useRef(null),hr=x.useRef(null),Er=x.useRef(!1),kr=T(),Cr=(0,$.Z)(kr,3),br=Cr[0],Kn=Cr[1],Xr=Cr[2];x.useImperativeHandle(Pe,function(){var cr,ir;return{focus:(cr=vr.current)===null||cr===void 0?void 0:cr.focus,blur:(ir=vr.current)===null||ir===void 0?void 0:ir.blur,scrollTo:function(Kr){var Lr;return(Lr=hr.current)===null||Lr===void 0?void 0:Lr.scrollTo(Kr)},nativeElement:Xn.current||tn.current}});var Mr=x.useMemo(function(){var cr;if(He!=="combobox")return sn;var ir=(cr=Ft[0])===null||cr===void 0?void 0:cr.value;return typeof ir=="string"||typeof ir=="number"?String(ir):""},[sn,He,Ft]),zr=He==="combobox"&&typeof ct=="function"&&ct()||null,Tr=typeof lt=="function"&&lt(),ai=(0,S.x1)(tn,Tr==null||(Tt=Tr.props)===null||Tt===void 0?void 0:Tt.ref),ti=x.useState(!1),Fr=(0,$.Z)(ti,2),Wr=Fr[0],Zr=Fr[1];(0,m.Z)(function(){Zr(!0)},[]);var Nr=(0,ce.Z)(!1,{defaultValue:Ot,value:wt}),Ar=(0,$.Z)(Nr,2),$r=Ar[0],Ir=Ar[1],_r=Wr?$r:!1,Fn=!ye&&Bt;(je||Fn&&_r&&He==="combobox")&&(_r=!1);var lr=Fn?!1:_r,Sn=x.useCallback(function(cr){var ir=cr!==void 0?cr:!_r;je||(Ir(ir),_r!==ir&&($t==null||$t(ir)))},[je,_r,Ir,$t]),Zn=x.useMemo(function(){return(qt||[]).some(function(cr){return[`
`,`\r
`].includes(cr)})},[qt]),On=x.useContext(Z)||{},Un=On.maxCount,ur=On.rawValues,yr=function(ir,Ur,Kr){if(!(en&&F(Un)&&(ur==null?void 0:ur.size)>=Un)){var Lr=!0,Pr=ir;kt==null||kt(null);var ri=B(ir,qt,F(Un)?Un-ur.size:void 0),Jr=Kr?null:ri;return He!=="combobox"&&Jr&&(Pr="",Mt==null||Mt(Jr),Sn(!1),Lr=!1),Nt&&Mr!==Pr&&Nt(Pr,{source:Ur?"typing":"effect"}),Lr}},gn=function(ir){!ir||!ir.trim()||Nt(ir,{source:"submit"})};x.useEffect(function(){!_r&&!en&&He!=="combobox"&&yr("",!1,!1)},[_r]),x.useEffect(function(){$r&&je&&Ir(!1),je&&!Er.current&&Kn(!1)},[je]);var In=R(),fr=(0,$.Z)(In,2),or=fr[0],pr=fr[1],Br=x.useRef(!1),fi=function(ir){var Ur=or(),Kr=ir.key,Lr=Kr==="Enter";if(Lr&&(He!=="combobox"&&ir.preventDefault(),_r||Sn(!0)),pr(!!Mr),Kr==="Backspace"&&!Ur&&en&&!Mr&&Ft.length){for(var Pr=(0,pe.Z)(Ft),ri=null,Jr=Pr.length-1;Jr>=0;Jr-=1){var qr=Pr[Jr];if(!qr.disabled){Pr.splice(Jr,1),ri=qr;break}}ri&&Xt(Pr,{type:"remove",values:[ri]})}for(var Ei=arguments.length,hi=new Array(Ei>1?Ei-1:0),Di=1;Di<Ei;Di++)hi[Di-1]=arguments[Di];if(_r&&(!Lr||!Br.current)){var Fi;Lr&&(Br.current=!0),(Fi=hr.current)===null||Fi===void 0||Fi.onKeyDown.apply(Fi,[ir].concat(hi))}mn==null||mn.apply(void 0,[ir].concat(hi))},Vr=function(ir){for(var Ur=arguments.length,Kr=new Array(Ur>1?Ur-1:0),Lr=1;Lr<Ur;Lr++)Kr[Lr-1]=arguments[Lr];if(_r){var Pr;(Pr=hr.current)===null||Pr===void 0||Pr.onKeyUp.apply(Pr,[ir].concat(Kr))}ir.key==="Enter"&&(Br.current=!1),Yt==null||Yt.apply(void 0,[ir].concat(Kr))},Qr=function(ir){var Ur=Ft.filter(function(Kr){return Kr!==ir});Xt(Ur,{type:"remove",values:[ir]})},oi=function(){Br.current=!1},Si=x.useRef(!1),cs=function(){Kn(!0),je||(bt&&!Si.current&&bt.apply(void 0,arguments),Dt.includes("focus")&&Sn(!0)),Si.current=!0},ni=function(){Er.current=!0,Kn(!1,function(){Si.current=!1,Er.current=!1,Sn(!1)}),!je&&(Mr&&(He==="tags"?Nt(Mr,{source:"submit"}):He==="multiple"&&Nt("",{source:"blur"})),Qt&&Qt.apply(void 0,arguments))},_i=[];x.useEffect(function(){return function(){_i.forEach(function(cr){return clearTimeout(cr)}),_i.splice(0,_i.length)}},[]);var Qi=function(ir){var Ur,Kr=ir.target,Lr=(Ur=rr.current)===null||Ur===void 0?void 0:Ur.getPopupElement();if(Lr&&Lr.contains(Kr)){var Pr=setTimeout(function(){var Ei=_i.indexOf(Pr);if(Ei!==-1&&_i.splice(Ei,1),Xr(),!bn&&!Lr.contains(document.activeElement)){var hi;(hi=vr.current)===null||hi===void 0||hi.focus()}});_i.push(Pr)}for(var ri=arguments.length,Jr=new Array(ri>1?ri-1:0),qr=1;qr<ri;qr++)Jr[qr-1]=arguments[qr];Yn==null||Yn.apply(void 0,[ir].concat(Jr))},Ai=x.useState({}),Ji=(0,$.Z)(Ai,2),ki=Ji[1];function di(){ki({})}var Gi;Tr&&(Gi=function(ir){Sn(ir)}),se(function(){var cr;return[Xn.current,(cr=rr.current)===null||cr===void 0?void 0:cr.getPopupElement()]},lr,Sn,!!Tr);var Pi=x.useMemo(function(){return(0,fe.Z)((0,fe.Z)({},Me),{},{notFoundContent:ye,open:_r,triggerOpen:lr,id:pt,showSearch:xn,multiple:en,toggleOpen:Sn})},[Me,ye,lr,_r,pt,xn,en,Sn]),Vi=!!an||at,Oi;Vi&&(Oi=x.createElement(z,{className:h()("".concat(dt,"-arrow"),(0,Te.Z)({},"".concat(dt,"-arrow-loading"),at)),customizeIcon:an,customizeIconProps:{loading:at,searchValue:Mr,open:_r,focused:br,showSearch:xn}}));var li=function(){var ir;Ue==null||Ue(),(ir=vr.current)===null||ir===void 0||ir.focus(),Xt([],{type:"clear",values:Ft}),yr("",!1,!1)},Mi=Y(dt,li,Ft,cn,yn,je,Mr,He),zi=Mi.allowClear,qi=Mi.clearIcon,fs=x.createElement(Vt,{ref:hr}),ds=h()(dt,Zt,(0,Te.Z)((0,Te.Z)((0,Te.Z)((0,Te.Z)((0,Te.Z)((0,Te.Z)((0,Te.Z)((0,Te.Z)((0,Te.Z)((0,Te.Z)({},"".concat(dt,"-focused"),br),"".concat(dt,"-multiple"),en),"".concat(dt,"-single"),!en),"".concat(dt,"-allow-clear"),cn),"".concat(dt,"-show-arrow"),Vi),"".concat(dt,"-disabled"),je),"".concat(dt,"-loading"),at),"".concat(dt,"-open"),_r),"".concat(dt,"-customize-input"),zr),"".concat(dt,"-show-search"),xn)),Wi=x.createElement(Ne,{ref:rr,disabled:je,prefixCls:dt,visible:lr,popupElement:fs,animation:Wt,transitionName:Jn,dropdownStyle:Wn,dropdownClassName:Bn,direction:ot,dropdownMatchSelectWidth:Hn,dropdownRender:qn,dropdownAlign:Vn,placement:mr,builtinPlacements:nr,getPopupContainer:ar,empty:Bt,getTriggerDOMNode:function(ir){return tn.current||ir},onPopupVisibleChange:Gi,onPopupMouseEnter:di},Tr?x.cloneElement(Tr,{ref:ai}):x.createElement(nn,(0,k.Z)({},Me,{domRef:tn,prefixCls:dt,inputElement:zr,ref:vr,id:pt,prefix:ln,showSearch:xn,autoClearSearchValue:un,mode:He,activeDescendantId:_n,tagRender:tt,values:Ft,open:_r,onToggleOpen:Sn,activeValue:pn,searchValue:Mr,onSearch:yr,onSearchSubmit:gn,onRemove:Qr,tokenWithEnter:Zn,onInputBlur:oi}))),yi;return Tr?yi=Wi:yi=x.createElement("div",(0,k.Z)({className:ds},Pn,{ref:Xn,onMouseDown:Qi,onKeyDown:fi,onKeyUp:Vr,onFocus:cs,onBlur:ni}),x.createElement(te,{visible:br&&!_r,values:Ft}),Wi,Oi,zi&&qi),x.createElement(L.Provider,{value:Pi},yi)}),Fe=De,Ve=function(){return null};Ve.isSelectOptGroup=!0;var Ge=Ve,$e=function(){return null};$e.isSelectOption=!0;var mt=$e,xt=A(80547),St=A(2738),Lt=A(65283);function Ht(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var ut=["disabled","title","children","style","className"];function Ut(Me){return typeof Me=="string"||typeof Me=="number"}var Le=function(Pe,Tt){var pt=O(),dt=pt.prefixCls,Zt=pt.id,ze=pt.open,tt=pt.multiple,ot=pt.mode,It=pt.searchValue,Ft=pt.toggleOpen,Xt=pt.notFoundContent,Bt=pt.onPopupScroll,yt=x.useContext(Z),ye=yt.maxCount,Ue=yt.flattenOptions,He=yt.onActiveValue,je=yt.defaultActiveFirstOption,at=yt.onSelect,ct=yt.menuItemSelectedIcon,lt=yt.rawValues,wt=yt.fieldNames,Ot=yt.virtual,$t=yt.direction,pn=yt.listHeight,kt=yt.listItemHeight,_n=yt.optionRender,sn="".concat(dt,"-item"),un=(0,xt.Z)(function(){return Ue},[ze,Ue],function(En,Dt){return Dt[0]&&En[1]!==Dt[1]}),Nt=x.useRef(null),Mt=x.useMemo(function(){return tt&&F(ye)&&(lt==null?void 0:lt.size)>=ye},[tt,ye,lt==null?void 0:lt.size]),qt=function(Dt){Dt.preventDefault()},cn=function(Dt){var bt;(bt=Nt.current)===null||bt===void 0||bt.scrollTo(typeof Dt=="number"?{index:Dt}:Dt)},ln=x.useCallback(function(En){return ot==="combobox"?!1:lt.has(En)},[ot,(0,pe.Z)(lt).toString(),lt.size]),an=function(Dt){for(var bt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Qt=un.length,Yt=0;Yt<Qt;Yt+=1){var mn=(Dt+Yt*bt+Qt)%Qt,Yn=un[mn]||{},er=Yn.group,en=Yn.data;if(!er&&!(en!=null&&en.disabled)&&(ln(en.value)||!Mt))return mn}return-1},yn=x.useState(function(){return an(0)}),Vt=(0,$.Z)(yn,2),Wt=Vt[0],Jn=Vt[1],Wn=function(Dt){var bt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Jn(Dt);var Qt={source:bt?"keyboard":"mouse"},Yt=un[Dt];if(!Yt){He(null,-1,Qt);return}He(Yt.value,Dt,Qt)};(0,x.useEffect)(function(){Wn(je!==!1?an(0):-1)},[un.length,It]);var Bn=x.useCallback(function(En){return ot==="combobox"?String(En).toLowerCase()===It.toLowerCase():lt.has(En)},[ot,It,(0,pe.Z)(lt).toString(),lt.size]);(0,x.useEffect)(function(){var En=setTimeout(function(){if(!tt&&ze&&lt.size===1){var bt=Array.from(lt)[0],Qt=un.findIndex(function(Yt){var mn=Yt.data;return It?String(mn.value).startsWith(It):mn.value===bt});Qt!==-1&&(Wn(Qt),cn(Qt))}});if(ze){var Dt;(Dt=Nt.current)===null||Dt===void 0||Dt.scrollTo(void 0)}return function(){return clearTimeout(En)}},[ze,It]);var Hn=function(Dt){Dt!==void 0&&at(Dt,{selected:!lt.has(Dt)}),tt||Ft(!1)};if(x.useImperativeHandle(Tt,function(){return{onKeyDown:function(Dt){var bt=Dt.which,Qt=Dt.ctrlKey;switch(bt){case ae.Z.N:case ae.Z.P:case ae.Z.UP:case ae.Z.DOWN:{var Yt=0;if(bt===ae.Z.UP?Yt=-1:bt===ae.Z.DOWN?Yt=1:Ht()&&Qt&&(bt===ae.Z.N?Yt=1:bt===ae.Z.P&&(Yt=-1)),Yt!==0){var mn=an(Wt+Yt,Yt);cn(mn),Wn(mn,!0)}break}case ae.Z.TAB:case ae.Z.ENTER:{var Yn,er=un[Wt];er&&!(er!=null&&(Yn=er.data)!==null&&Yn!==void 0&&Yn.disabled)&&!Mt?Hn(er.value):Hn(void 0),ze&&Dt.preventDefault();break}case ae.Z.ESC:Ft(!1),ze&&Dt.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Dt){cn(Dt)}}}),un.length===0)return x.createElement("div",{role:"listbox",id:"".concat(Zt,"_list"),className:"".concat(sn,"-empty"),onMouseDown:qt},Xt);var qn=Object.keys(wt).map(function(En){return wt[En]}),Vn=function(Dt){return Dt.label};function mr(En,Dt){var bt=En.group;return{role:bt?"presentation":"option",id:"".concat(Zt,"_list_").concat(Dt)}}var nr=function(Dt){var bt=un[Dt];if(!bt)return null;var Qt=bt.data||{},Yt=Qt.value,mn=bt.group,Yn=(0,he.Z)(Qt,!0),er=Vn(bt);return bt?x.createElement("div",(0,k.Z)({"aria-label":typeof er=="string"&&!mn?er:null},Yn,{key:Dt},mr(bt,Dt),{"aria-selected":Bn(Yt)}),Yt):null},ar={role:"listbox",id:"".concat(Zt,"_list")};return x.createElement(x.Fragment,null,Ot&&x.createElement("div",(0,k.Z)({},ar,{style:{height:0,width:0,overflow:"hidden"}}),nr(Wt-1),nr(Wt),nr(Wt+1)),x.createElement(Lt.Z,{itemKey:"key",ref:Nt,data:un,height:pn,itemHeight:kt,fullHeight:!1,onMouseDown:qt,onScroll:Bt,virtual:Ot,direction:$t,innerProps:Ot?null:ar},function(En,Dt){var bt=En.group,Qt=En.groupOption,Yt=En.data,mn=En.label,Yn=En.value,er=Yt.key;if(bt){var en,xn=(en=Yt.title)!==null&&en!==void 0?en:Ut(mn)?mn.toString():void 0;return x.createElement("div",{className:h()(sn,"".concat(sn,"-group"),Yt.className),title:xn},mn!==void 0?mn:er)}var Pn=Yt.disabled,kn=Yt.title,dr=Yt.children,bn=Yt.style,jn=Yt.className,Xn=(0,p.Z)(Yt,ut),tn=(0,St.Z)(Xn,qn),rr=ln(Yn),vr=Pn||!rr&&Mt,hr="".concat(sn,"-option"),Er=h()(sn,hr,jn,(0,Te.Z)((0,Te.Z)((0,Te.Z)((0,Te.Z)({},"".concat(hr,"-grouped"),Qt),"".concat(hr,"-active"),Wt===Dt&&!vr),"".concat(hr,"-disabled"),vr),"".concat(hr,"-selected"),rr)),kr=Vn(En),Cr=!ct||typeof ct=="function"||rr,br=typeof kr=="number"?kr:kr||Yn,Kn=Ut(br)?br.toString():void 0;return kn!==void 0&&(Kn=kn),x.createElement("div",(0,k.Z)({},(0,he.Z)(tn),Ot?{}:mr(En,Dt),{"aria-selected":Bn(Yn),className:Er,title:Kn,onMouseMove:function(){Wt===Dt||vr||Wn(Dt)},onClick:function(){vr||Hn(Yn)},style:bn}),x.createElement("div",{className:"".concat(hr,"-content")},typeof _n=="function"?_n(En,{index:Dt}):br),x.isValidElement(ct)||rr,Cr&&x.createElement(z,{className:"".concat(sn,"-option-state"),customizeIcon:ct,customizeIconProps:{value:Yn,disabled:vr,isSelected:rr}},rr?"\u2713":null))}))},Ae=x.forwardRef(Le),Ie=Ae,H=function(Me,Pe){var Tt=x.useRef({values:new Map,options:new Map}),pt=x.useMemo(function(){var Zt=Tt.current,ze=Zt.values,tt=Zt.options,ot=Me.map(function(Xt){if(Xt.label===void 0){var Bt;return(0,fe.Z)((0,fe.Z)({},Xt),{},{label:(Bt=ze.get(Xt.value))===null||Bt===void 0?void 0:Bt.label})}return Xt}),It=new Map,Ft=new Map;return ot.forEach(function(Xt){It.set(Xt.value,Xt),Ft.set(Xt.value,Pe.get(Xt.value)||tt.get(Xt.value))}),Tt.current.values=It,Tt.current.options=Ft,ot},[Me,Pe]),dt=x.useCallback(function(Zt){return Pe.get(Zt)||Tt.current.options.get(Zt)},[Pe]);return[pt,dt]};function ee(Me,Pe){return ne(Me).join("").toUpperCase().includes(Pe)}var de=function(Me,Pe,Tt,pt,dt){return x.useMemo(function(){if(!Tt||pt===!1)return Me;var Zt=Pe.options,ze=Pe.label,tt=Pe.value,ot=[],It=typeof pt=="function",Ft=Tt.toUpperCase(),Xt=It?pt:function(yt,ye){return dt?ee(ye[dt],Ft):ye[Zt]?ee(ye[ze!=="children"?ze:"label"],Ft):ee(ye[tt],Ft)},Bt=It?function(yt){return C(yt)}:function(yt){return yt};return Me.forEach(function(yt){if(yt[Zt]){var ye=Xt(Tt,Bt(yt));if(ye)ot.push(yt);else{var Ue=yt[Zt].filter(function(He){return Xt(Tt,Bt(He))});Ue.length&&ot.push((0,fe.Z)((0,fe.Z)({},yt),{},(0,Te.Z)({},Zt,Ue)))}return}Xt(Tt,Bt(yt))&&ot.push(yt)}),ot},[Me,pt,dt,Tt,Pe])},re=A(6551),_e=A(11592),et=["children","value"],Ye=["children"];function it(Me){var Pe=Me,Tt=Pe.key,pt=Pe.props,dt=pt.children,Zt=pt.value,ze=(0,p.Z)(pt,et);return(0,fe.Z)({key:Tt,value:Zt!==void 0?Zt:Tt,children:dt},ze)}function Rt(Me){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,_e.Z)(Me).map(function(Tt,pt){if(!x.isValidElement(Tt)||!Tt.type)return null;var dt=Tt,Zt=dt.type.isSelectOptGroup,ze=dt.key,tt=dt.props,ot=tt.children,It=(0,p.Z)(tt,Ye);return Pe||!Zt?it(Tt):(0,fe.Z)((0,fe.Z)({key:"__RC_SELECT_GRP__".concat(ze===null?pt:ze,"__"),label:ze},It),{},{options:Rt(ot)})}).filter(function(Tt){return Tt})}var on=function(Pe,Tt,pt,dt,Zt){return x.useMemo(function(){var ze=Pe,tt=!Pe;tt&&(ze=Rt(Tt));var ot=new Map,It=new Map,Ft=function(yt,ye,Ue){Ue&&typeof Ue=="string"&&yt.set(ye[Ue],ye)},Xt=function Bt(yt){for(var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ue=0;Ue<yt.length;Ue+=1){var He=yt[Ue];!He[pt.options]||ye?(ot.set(He[pt.value],He),Ft(It,He,pt.label),Ft(It,He,dt),Ft(It,He,Zt)):Bt(He[pt.options],!0)}};return Xt(ze),{options:ze,valueOptions:ot,labelOptions:It}},[Pe,Tt,pt,dt,Zt])},fn=on;function Pt(Me){var Pe=x.useRef();Pe.current=Me;var Tt=x.useCallback(function(){return Pe.current.apply(Pe,arguments)},[]);return Tt}function jt(Me){var Pe=Me.mode,Tt=Me.options,pt=Me.children,dt=Me.backfill,Zt=Me.allowClear,ze=Me.placeholder,tt=Me.getInputElement,ot=Me.showSearch,It=Me.onSearch,Ft=Me.defaultOpen,Xt=Me.autoFocus,Bt=Me.labelInValue,yt=Me.value,ye=Me.inputValue,Ue=Me.optionLabelProp,He=isMultiple(Pe),je=ot!==void 0?ot:He||Pe==="combobox",at=Tt||convertChildrenToData(pt);if(warning(Pe!=="tags"||at.every(function(Ot){return!Ot.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Pe==="tags"||Pe==="combobox"){var ct=at.some(function(Ot){return Ot.options?Ot.options.some(function($t){return typeof("value"in $t?$t.value:$t.key)=="number"}):typeof("value"in Ot?Ot.value:Ot.key)=="number"});warning(!ct,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Pe!=="combobox"||!Ue,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Pe==="combobox"||!dt,"`backfill` only works with `combobox` mode."),warning(Pe==="combobox"||!tt,"`getInputElement` only work with `combobox` mode."),noteOnce(Pe!=="combobox"||!tt||!Zt||!ze,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),It&&!je&&Pe!=="combobox"&&Pe!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Ft||Xt,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),yt!=null){var lt=toArray(yt);warning(!Bt||lt.every(function(Ot){return _typeof(Ot)==="object"&&("key"in Ot||"value"in Ot)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!He||Array.isArray(yt),"`value` should be array when `mode` is `multiple` or `tags`")}if(pt){var wt=null;toNodeArray(pt).some(function(Ot){if(!React.isValidElement(Ot)||!Ot.type)return!1;var $t=Ot,pn=$t.type;if(pn.isSelectOption)return!1;if(pn.isSelectOptGroup){var kt=toNodeArray(Ot.props.children).every(function(_n){return!React.isValidElement(_n)||!Ot.type||_n.type.isSelectOption?!0:(wt=_n.type,!1)});return!kt}return wt=pn,!0}),wt&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(wt.displayName||wt.name||wt,"`.")),warning(ye===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function wn(Me,Pe){if(Me){var Tt=function pt(dt){for(var Zt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ze=0;ze<dt.length;ze++){var tt=dt[ze];if(tt[Pe==null?void 0:Pe.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!Zt&&Array.isArray(tt[Pe==null?void 0:Pe.options])&&pt(tt[Pe==null?void 0:Pe.options],!0))break}};Tt(Me)}}var Gn=null,An=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],Mn=["inputValue"];function Cn(Me){return!Me||(0,me.Z)(Me)!=="object"}var rn=x.forwardRef(function(Me,Pe){var Tt=Me.id,pt=Me.mode,dt=Me.prefixCls,Zt=dt===void 0?"rc-select":dt,ze=Me.backfill,tt=Me.fieldNames,ot=Me.inputValue,It=Me.searchValue,Ft=Me.onSearch,Xt=Me.autoClearSearchValue,Bt=Xt===void 0?!0:Xt,yt=Me.onSelect,ye=Me.onDeselect,Ue=Me.dropdownMatchSelectWidth,He=Ue===void 0?!0:Ue,je=Me.filterOption,at=Me.filterSort,ct=Me.optionFilterProp,lt=Me.optionLabelProp,wt=Me.options,Ot=Me.optionRender,$t=Me.children,pn=Me.defaultActiveFirstOption,kt=Me.menuItemSelectedIcon,_n=Me.virtual,sn=Me.direction,un=Me.listHeight,Nt=un===void 0?200:un,Mt=Me.listItemHeight,qt=Mt===void 0?20:Mt,cn=Me.labelRender,ln=Me.value,an=Me.defaultValue,yn=Me.labelInValue,Vt=Me.onChange,Wt=Me.maxCount,Jn=(0,p.Z)(Me,An),Wn=(0,re.ZP)(Tt),Bn=Ce(pt),Hn=!!(!wt&&$t),qn=x.useMemo(function(){return je===void 0&&pt==="combobox"?!1:je},[je,pt]),Vn=x.useMemo(function(){return oe(tt,Hn)},[JSON.stringify(tt),Hn]),mr=(0,ce.Z)("",{value:It!==void 0?It:ot,postState:function(Zn){return Zn||""}}),nr=(0,$.Z)(mr,2),ar=nr[0],En=nr[1],Dt=fn(wt,$t,Vn,ct,lt),bt=Dt.valueOptions,Qt=Dt.labelOptions,Yt=Dt.options,mn=x.useCallback(function(Sn){var Zn=ne(Sn);return Zn.map(function(On){var Un,ur,yr,gn,In;if(Cn(On))Un=On;else{var fr;yr=On.key,ur=On.label,Un=(fr=On.value)!==null&&fr!==void 0?fr:yr}var or=bt.get(Un);if(or){var pr;if(ur===void 0&&(ur=or==null?void 0:or[lt||Vn.label]),yr===void 0&&(yr=(pr=or==null?void 0:or.key)!==null&&pr!==void 0?pr:Un),gn=or==null?void 0:or.disabled,In=or==null?void 0:or.title,0)var Br}return{label:ur,value:Un,key:yr,disabled:gn,title:In}})},[Vn,lt,bt]),Yn=(0,ce.Z)(an,{value:ln}),er=(0,$.Z)(Yn,2),en=er[0],xn=er[1],Pn=x.useMemo(function(){var Sn,Zn=Bn&&en===null?[]:en,On=mn(Zn);return pt==="combobox"&&U((Sn=On[0])===null||Sn===void 0?void 0:Sn.value)?[]:On},[en,mn,pt,Bn]),kn=H(Pn,bt),dr=(0,$.Z)(kn,2),bn=dr[0],jn=dr[1],Xn=x.useMemo(function(){if(!pt&&bn.length===1){var Sn=bn[0];if(Sn.value===null&&(Sn.label===null||Sn.label===void 0))return[]}return bn.map(function(Zn){var On;return(0,fe.Z)((0,fe.Z)({},Zn),{},{label:(On=typeof cn=="function"?cn(Zn):Zn.label)!==null&&On!==void 0?On:Zn.value})})},[pt,bn,cn]),tn=x.useMemo(function(){return new Set(bn.map(function(Sn){return Sn.value}))},[bn]);x.useEffect(function(){if(pt==="combobox"){var Sn,Zn=(Sn=bn[0])===null||Sn===void 0?void 0:Sn.value;En(g(Zn)?String(Zn):"")}},[bn]);var rr=Pt(function(Sn,Zn){var On=Zn!=null?Zn:Sn;return(0,Te.Z)((0,Te.Z)({},Vn.value,Sn),Vn.label,On)}),vr=x.useMemo(function(){if(pt!=="tags")return Yt;var Sn=(0,pe.Z)(Yt),Zn=function(Un){return bt.has(Un)};return(0,pe.Z)(bn).sort(function(On,Un){return On.value<Un.value?-1:1}).forEach(function(On){var Un=On.value;Zn(Un)||Sn.push(rr(Un,On.label))}),Sn},[rr,Yt,bt,bn,pt]),hr=de(vr,Vn,ar,qn,ct),Er=x.useMemo(function(){return pt!=="tags"||!ar||hr.some(function(Sn){return Sn[ct||"value"]===ar})||hr.some(function(Sn){return Sn[Vn.value]===ar})?hr:[rr(ar)].concat((0,pe.Z)(hr))},[rr,ct,pt,hr,ar,Vn]),kr=function Sn(Zn){var On=(0,pe.Z)(Zn).sort(function(Un,ur){return at(Un,ur,{searchValue:ar})});return On.map(function(Un){return Array.isArray(Un.options)?(0,fe.Z)((0,fe.Z)({},Un),{},{options:Un.options.length>0?Sn(Un.options):Un.options}):Un})},Cr=x.useMemo(function(){return at?kr(Er):Er},[Er,at,ar]),br=x.useMemo(function(){return w(Cr,{fieldNames:Vn,childrenAsData:Hn})},[Cr,Vn,Hn]),Kn=function(Zn){var On=mn(Zn);if(xn(On),Vt&&(On.length!==bn.length||On.some(function(yr,gn){var In;return((In=bn[gn])===null||In===void 0?void 0:In.value)!==(yr==null?void 0:yr.value)}))){var Un=yn?On:On.map(function(yr){return yr.value}),ur=On.map(function(yr){return C(jn(yr.value))});Vt(Bn?Un:Un[0],Bn?ur:ur[0])}},Xr=x.useState(null),Mr=(0,$.Z)(Xr,2),zr=Mr[0],Tr=Mr[1],ai=x.useState(0),ti=(0,$.Z)(ai,2),Fr=ti[0],Wr=ti[1],Zr=pn!==void 0?pn:pt!=="combobox",Nr=x.useCallback(function(Sn,Zn){var On=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Un=On.source,ur=Un===void 0?"keyboard":Un;Wr(Zn),ze&&pt==="combobox"&&Sn!==null&&ur==="keyboard"&&Tr(String(Sn))},[ze,pt]),Ar=function(Zn,On,Un){var ur=function(){var Qr,oi=jn(Zn);return[yn?{label:oi==null?void 0:oi[Vn.label],value:Zn,key:(Qr=oi==null?void 0:oi.key)!==null&&Qr!==void 0?Qr:Zn}:Zn,C(oi)]};if(On&&yt){var yr=ur(),gn=(0,$.Z)(yr,2),In=gn[0],fr=gn[1];yt(In,fr)}else if(!On&&ye&&Un!=="clear"){var or=ur(),pr=(0,$.Z)(or,2),Br=pr[0],fi=pr[1];ye(Br,fi)}},$r=Pt(function(Sn,Zn){var On,Un=Bn?Zn.selected:!0;Un?On=Bn?[].concat((0,pe.Z)(bn),[Sn]):[Sn]:On=bn.filter(function(ur){return ur.value!==Sn}),Kn(On),Ar(Sn,Un),pt==="combobox"?Tr(""):(!Ce||Bt)&&(En(""),Tr(""))}),Ir=function(Zn,On){Kn(Zn);var Un=On.type,ur=On.values;(Un==="remove"||Un==="clear")&&ur.forEach(function(yr){Ar(yr.value,!1,Un)})},_r=function(Zn,On){if(En(Zn),Tr(null),On.source==="submit"){var Un=(Zn||"").trim();if(Un){var ur=Array.from(new Set([].concat((0,pe.Z)(tn),[Un])));Kn(ur),Ar(Un,!0),En("")}return}On.source!=="blur"&&(pt==="combobox"&&Kn(Zn),Ft==null||Ft(Zn))},Fn=function(Zn){var On=Zn;pt!=="tags"&&(On=Zn.map(function(ur){var yr=Qt.get(ur);return yr==null?void 0:yr.value}).filter(function(ur){return ur!==void 0}));var Un=Array.from(new Set([].concat((0,pe.Z)(tn),(0,pe.Z)(On))));Kn(Un),Un.forEach(function(ur){Ar(ur,!0)})},lr=x.useMemo(function(){var Sn=_n!==!1&&He!==!1;return(0,fe.Z)((0,fe.Z)({},Dt),{},{flattenOptions:br,onActiveValue:Nr,defaultActiveFirstOption:Zr,onSelect:$r,menuItemSelectedIcon:kt,rawValues:tn,fieldNames:Vn,virtual:Sn,direction:sn,listHeight:Nt,listItemHeight:qt,childrenAsData:Hn,maxCount:Wt,optionRender:Ot})},[Wt,Dt,br,Nr,Zr,$r,kt,tn,Vn,_n,He,sn,Nt,qt,Hn,Ot]);return x.createElement(Z.Provider,{value:lr},x.createElement(Fe,(0,k.Z)({},Jn,{id:Wn,prefixCls:Zt,ref:Pe,omitDomProps:Mn,mode:pt,displayValues:Xn,onDisplayValuesChange:Ir,direction:sn,searchValue:ar,onSearch:_r,autoClearSearchValue:Bt,onSearchSplit:Fn,dropdownMatchSelectWidth:He,OptionList:Ie,emptyOptions:!br.length,activeValue:zr,activeDescendantId:"".concat(Wn,"_list_").concat(Fr)})))}),Tn=rn;Tn.Option=mt,Tn.OptGroup=Ge;var $n=Tn,tr=$n},22711:function(vn,Et,A){"use strict";A.r(Et),A.d(Et,{ResizableTextArea:function(){return Oe},default:function(){return X}});var k=A(14809),pe=A(4635),Te=A(20439),fe=A(95190),$=A(50298),p=A(62646),me=A(92310),ce=A.n(me),o=A(36901),x=A(66003),D=A(30292),h=A(18929),m=A(59301),y=A(93664),S=A(29301),M=A(34280),z=A(16089),Y=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important;
pointer-events: none !important;
`,L=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],O={},T;function R(ne){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=ne.getAttribute("id")||ne.getAttribute("data-reactid")||ne.getAttribute("name");if(J&&O[v])return O[v];var g=window.getComputedStyle(ne),U=g.getPropertyValue("box-sizing")||g.getPropertyValue("-moz-box-sizing")||g.getPropertyValue("-webkit-box-sizing"),ie=parseFloat(g.getPropertyValue("padding-bottom"))+parseFloat(g.getPropertyValue("padding-top")),Be=parseFloat(g.getPropertyValue("border-bottom-width"))+parseFloat(g.getPropertyValue("border-top-width")),Ze=L.map(function(nt){return"".concat(nt,":").concat(g.getPropertyValue(nt))}).join(";"),Qe={sizingStyle:Ze,paddingSize:ie,borderSize:Be,boxSizing:U};return J&&v&&(O[v]=Qe),Qe}function se(ne){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;T||(T=document.createElement("textarea"),T.setAttribute("tab-index","-1"),T.setAttribute("aria-hidden","true"),T.setAttribute("name","hiddenTextarea"),document.body.appendChild(T)),ne.getAttribute("wrap")?T.setAttribute("wrap",ne.getAttribute("wrap")):T.removeAttribute("wrap");var U=R(ne,J),ie=U.paddingSize,Be=U.borderSize,Ze=U.boxSizing,Qe=U.sizingStyle;T.setAttribute("style","".concat(Qe,";").concat(Y)),T.value=ne.value||ne.placeholder||"";var nt=void 0,At=void 0,_t,xe=T.scrollHeight;if(Ze==="border-box"?xe+=Be:Ze==="content-box"&&(xe-=ie),v!==null||g!==null){T.value=" ";var vt=T.scrollHeight-ie;v!==null&&(nt=vt*v,Ze==="border-box"&&(nt=nt+ie+Be),xe=Math.max(nt,xe)),g!==null&&(At=vt*g,Ze==="border-box"&&(At=At+ie+Be),_t=xe>At?"":"hidden",xe=Math.min(At,xe))}var zt={height:xe,overflowY:_t,resize:"none"};return nt&&(zt.minHeight=nt),At&&(zt.maxHeight=At),zt}var ae=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],q=0,he=1,ve=2,be=m.forwardRef(function(ne,J){var v=ne,g=v.prefixCls,U=v.defaultValue,ie=v.value,Be=v.autoSize,Ze=v.onResize,Qe=v.className,nt=v.style,At=v.disabled,_t=v.onChange,xe=v.onInternalAutoSize,vt=(0,p.Z)(v,ae),zt=(0,h.Z)(U,{value:ie,postState:function(mt){return mt!=null?mt:""}}),Ct=(0,$.Z)(zt,2),nn=Ct[0],qe=Ct[1],Re=function(mt){qe(mt.target.value),_t==null||_t(mt)},we=m.useRef();m.useImperativeHandle(J,function(){return{textArea:we.current}});var K=m.useMemo(function(){return Be&&(0,y.Z)(Be)==="object"?[Be.minRows,Be.maxRows]:[]},[Be]),Se=(0,$.Z)(K,2),Ne=Se[0],V=Se[1],I=!!Be,F=function(){try{if(document.activeElement===we.current){var mt=we.current,xt=mt.selectionStart,St=mt.selectionEnd,Lt=mt.scrollTop;we.current.setSelectionRange(xt,St),we.current.scrollTop=Lt}}catch(Ht){}},oe=m.useState(ve),w=(0,$.Z)(oe,2),C=w[0],B=w[1],W=m.useState(),Z=(0,$.Z)(W,2),te=Z[0],ue=Z[1],ge=function(){B(q)};(0,M.Z)(function(){I&&ge()},[ie,Ne,V,I]),(0,M.Z)(function(){if(C===q)B(he);else if(C===he){var $e=se(we.current,!1,Ne,V);B(ve),ue($e)}else F()},[C]);var Ce=m.useRef(),De=function(){z.Z.cancel(Ce.current)},Fe=function(mt){C===ve&&(Ze==null||Ze(mt),Be&&(De(),Ce.current=(0,z.Z)(function(){ge()})))};m.useEffect(function(){return De},[]);var Ve=I?te:null,Ge=(0,Te.Z)((0,Te.Z)({},nt),Ve);return(C===q||C===he)&&(Ge.overflowY="hidden",Ge.overflowX="hidden"),m.createElement(S.Z,{onResize:Fe,disabled:!(Be||Ze)},m.createElement("textarea",(0,k.Z)({},vt,{ref:we,style:Ge,className:ce()(g,Qe,(0,pe.Z)({},"".concat(g,"-disabled"),At)),disabled:At,value:nn,onChange:Re})))}),Oe=be,Q=["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"],P=m.forwardRef(function(ne,J){var v,g=ne.defaultValue,U=ne.value,ie=ne.onFocus,Be=ne.onBlur,Ze=ne.onChange,Qe=ne.allowClear,nt=ne.maxLength,At=ne.onCompositionStart,_t=ne.onCompositionEnd,xe=ne.suffix,vt=ne.prefixCls,zt=vt===void 0?"rc-textarea":vt,Ct=ne.showCount,nn=ne.count,qe=ne.className,Re=ne.style,we=ne.disabled,K=ne.hidden,Se=ne.classNames,Ne=ne.styles,V=ne.onResize,I=ne.onClear,F=ne.onPressEnter,oe=ne.readOnly,w=ne.autoSize,C=ne.onKeyDown,B=(0,p.Z)(ne,Q),W=(0,h.Z)(g,{value:U,defaultValue:g}),Z=(0,$.Z)(W,2),te=Z[0],ue=Z[1],ge=te==null?"":String(te),Ce=m.useState(!1),De=(0,$.Z)(Ce,2),Fe=De[0],Ve=De[1],Ge=m.useRef(!1),$e=m.useState(null),mt=(0,$.Z)($e,2),xt=mt[0],St=mt[1],Lt=(0,m.useRef)(null),Ht=(0,m.useRef)(null),ut=function(){var Tn;return(Tn=Ht.current)===null||Tn===void 0?void 0:Tn.textArea},Ut=function(){ut().focus()};(0,m.useImperativeHandle)(J,function(){var rn;return{resizableTextArea:Ht.current,focus:Ut,blur:function(){ut().blur()},nativeElement:((rn=Lt.current)===null||rn===void 0?void 0:rn.nativeElement)||ut()}}),(0,m.useEffect)(function(){Ve(function(rn){return!we&&rn})},[we]);var Le=m.useState(null),Ae=(0,$.Z)(Le,2),Ie=Ae[0],H=Ae[1];m.useEffect(function(){if(Ie){var rn;(rn=ut()).setSelectionRange.apply(rn,(0,fe.Z)(Ie))}},[Ie]);var ee=(0,x.Z)(nn,Ct),de=(v=ee.max)!==null&&v!==void 0?v:nt,re=Number(de)>0,_e=ee.strategy(ge),et=!!de&&_e>de,Ye=function(Tn,$n){var tr=$n;!Ge.current&&ee.exceedFormatter&&ee.max&&ee.strategy($n)>ee.max&&(tr=ee.exceedFormatter($n,{max:ee.max}),$n!==tr&&H([ut().selectionStart||0,ut().selectionEnd||0])),ue(tr),(0,D.rJ)(Tn.currentTarget,Tn,Ze,tr)},it=function(Tn){Ge.current=!0,At==null||At(Tn)},Rt=function(Tn){Ge.current=!1,Ye(Tn,Tn.currentTarget.value),_t==null||_t(Tn)},on=function(Tn){Ye(Tn,Tn.target.value)},fn=function(Tn){Tn.key==="Enter"&&F&&F(Tn),C==null||C(Tn)},Pt=function(Tn){Ve(!0),ie==null||ie(Tn)},jt=function(Tn){Ve(!1),Be==null||Be(Tn)},wn=function(Tn){ue(""),Ut(),(0,D.rJ)(ut(),Tn,Ze)},Gn=xe,An;ee.show&&(ee.showFormatter?An=ee.showFormatter({value:ge,count:_e,maxLength:de}):An="".concat(_e).concat(re?" / ".concat(de):""),Gn=m.createElement(m.Fragment,null,Gn,m.createElement("span",{className:ce()("".concat(zt,"-data-count"),Se==null?void 0:Se.count),style:Ne==null?void 0:Ne.count},An)));var Mn=function(Tn){var $n;V==null||V(Tn),($n=ut())!==null&&$n!==void 0&&$n.style.height&&St(!0)},Cn=!w&&!Ct&&!Qe;return m.createElement(o.BaseInput,{ref:Lt,value:ge,allowClear:Qe,handleReset:wn,suffix:Gn,prefixCls:zt,classNames:(0,Te.Z)((0,Te.Z)({},Se),{},{affixWrapper:ce()(Se==null?void 0:Se.affixWrapper,(0,pe.Z)((0,pe.Z)({},"".concat(zt,"-show-count"),Ct),"".concat(zt,"-textarea-allow-clear"),Qe))}),disabled:we,focused:Fe,className:ce()(qe,et&&"".concat(zt,"-out-of-range")),style:(0,Te.Z)((0,Te.Z)({},Re),xt&&!Cn?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof An=="string"?An:void 0}},hidden:K,readOnly:oe,onClear:I},m.createElement(Oe,(0,k.Z)({},B,{autoSize:w,maxLength:nt,onKeyDown:fn,onChange:on,onFocus:Pt,onBlur:jt,onCompositionStart:it,onCompositionEnd:Rt,className:ce()(Se==null?void 0:Se.textarea),style:(0,Te.Z)((0,Te.Z)({},Ne==null?void 0:Ne.textarea),{},{resize:Re==null?void 0:Re.resize}),disabled:we,prefixCls:zt,onResize:Mn,ref:Ht,readOnly:oe})))}),j=P,X=j},29125:function(vn,Et,A){"use strict";A.d(Et,{G:function(){return fe},Z:function(){return Y}});var k=A(92310),pe=A.n(k),Te=A(59301);function fe(L){var O=L.children,T=L.prefixCls,R=L.id,se=L.overlayInnerStyle,ae=L.bodyClassName,q=L.className,he=L.style;return Te.createElement("div",{className:pe()("".concat(T,"-content"),q),style:he},Te.createElement("div",{className:pe()("".concat(T,"-inner"),ae),id:R,role:"tooltip",style:se},typeof O=="function"?O():O))}var $=A(14809),p=A(20439),me=A(62646),ce=A(65352),o={shiftX:64,adjustY:1},x={adjustX:1,shiftY:!0},D=[0,0],h={left:{points:["cr","cl"],overflow:x,offset:[-4,0],targetOffset:D},right:{points:["cl","cr"],overflow:x,offset:[4,0],targetOffset:D},top:{points:["bc","tc"],overflow:o,offset:[0,-4],targetOffset:D},bottom:{points:["tc","bc"],overflow:o,offset:[0,4],targetOffset:D},topLeft:{points:["bl","tl"],overflow:o,offset:[0,-4],targetOffset:D},leftTop:{points:["tr","tl"],overflow:x,offset:[-4,0],targetOffset:D},topRight:{points:["br","tr"],overflow:o,offset:[0,-4],targetOffset:D},rightTop:{points:["tl","tr"],overflow:x,offset:[4,0],targetOffset:D},bottomRight:{points:["tr","br"],overflow:o,offset:[0,4],targetOffset:D},rightBottom:{points:["bl","br"],overflow:x,offset:[4,0],targetOffset:D},bottomLeft:{points:["tl","bl"],overflow:o,offset:[0,4],targetOffset:D},leftBottom:{points:["br","bl"],overflow:x,offset:[-4,0],targetOffset:D}},m=null,y=A(80402),S=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],M=function(O,T){var R=O.overlayClassName,se=O.trigger,ae=se===void 0?["hover"]:se,q=O.mouseEnterDelay,he=q===void 0?0:q,ve=O.mouseLeaveDelay,be=ve===void 0?.1:ve,Oe=O.overlayStyle,Q=O.prefixCls,P=Q===void 0?"rc-tooltip":Q,j=O.children,X=O.onVisibleChange,ne=O.afterVisibleChange,J=O.transitionName,v=O.animation,g=O.motion,U=O.placement,ie=U===void 0?"right":U,Be=O.align,Ze=Be===void 0?{}:Be,Qe=O.destroyTooltipOnHide,nt=Qe===void 0?!1:Qe,At=O.defaultVisible,_t=O.getTooltipContainer,xe=O.overlayInnerStyle,vt=O.arrowContent,zt=O.overlay,Ct=O.id,nn=O.showArrow,qe=nn===void 0?!0:nn,Re=O.classNames,we=O.styles,K=(0,me.Z)(O,S),Se=(0,y.Z)(Ct),Ne=(0,Te.useRef)(null);(0,Te.useImperativeHandle)(T,function(){return Ne.current});var V=(0,p.Z)({},K);"visible"in O&&(V.popupVisible=O.visible);var I=function(){return Te.createElement(fe,{key:"content",prefixCls:P,id:Se,bodyClassName:Re==null?void 0:Re.body,overlayInnerStyle:(0,p.Z)((0,p.Z)({},xe),we==null?void 0:we.body)},zt)},F=function(){var w=Te.Children.only(j),C=(w==null?void 0:w.props)||{},B=(0,p.Z)((0,p.Z)({},C),{},{"aria-describedby":zt?Se:null});return Te.cloneElement(j,B)};return Te.createElement(ce.Z,(0,$.Z)({popupClassName:pe()(R,Re==null?void 0:Re.root),prefixCls:P,popup:I,action:ae,builtinPlacements:h,popupPlacement:ie,ref:Ne,popupAlign:Ze,getPopupContainer:_t,onPopupVisibleChange:X,afterPopupVisibleChange:ne,popupTransitionName:J,popupAnimation:v,popupMotion:g,defaultPopupVisible:At,autoDestroy:nt,mouseLeaveDelay:be,popupStyle:(0,p.Z)((0,p.Z)({},Oe),we==null?void 0:we.root),mouseEnterDelay:he,arrow:qe},V),F())},z=(0,Te.forwardRef)(M),Y=z},9940:function(vn,Et,A){"use strict";A.d(Et,{Qw:function(){return Ct},FJ:function(){return qe},hT:function(){return nn},OF:function(){return T},ZP:function(){return oe}});var k=A(14809),pe=A(95190),Te=A(20439),fe=A(50298),$=A(62646),p=A(93664),me=A(37463),ce=A(6551),o=A(34643),x=A(18929),D=A(48736),h=A(59301),m=function(w){var C=h.useRef({valueLabels:new Map});return h.useMemo(function(){var B=C.current.valueLabels,W=new Map,Z=w.map(function(te){var ue=te.value,ge=te.label,Ce=ge!=null?ge:B.get(ue);return W.set(ue,Ce),(0,Te.Z)((0,Te.Z)({},te),{},{label:Ce})});return C.current.valueLabels=W,[Z]},[w])},y=function(C,B,W,Z){return h.useMemo(function(){var te=function($e){return $e.map(function(mt){var xt=mt.value;return xt})},ue=te(C),ge=te(B),Ce=ue.filter(function(Ge){return!Z[Ge]}),De=ue,Fe=ge;if(W){var Ve=(0,o.S)(ue,!0,Z);De=Ve.checkedKeys,Fe=Ve.halfCheckedKeys}return[Array.from(new Set([].concat((0,pe.Z)(Ce),(0,pe.Z)(De)))),Fe]},[C,B,W,Z])},S=y,M=A(34061),z=function(w,C){return h.useMemo(function(){var B=(0,M.I8)(w,{fieldNames:C,initWrapper:function(Z){return(0,Te.Z)((0,Te.Z)({},Z),{},{valueEntities:new Map})},processEntity:function(Z,te){var ue=Z.node[C.value];if(0)var ge;te.valueEntities.set(ue,Z)}});return B},[w,C])},Y=A(4635),L=A(11592),O=function(){return null},T=O,R=["children","value"];function se(w){return(0,L.Z)(w).map(function(C){if(!h.isValidElement(C)||!C.type)return null;var B=C,W=B.key,Z=B.props,te=Z.children,ue=Z.value,ge=(0,$.Z)(Z,R),Ce=(0,Te.Z)({key:W,value:ue},ge),De=se(te);return De.length&&(Ce.children=De),Ce}).filter(function(C){return C})}function ae(w){if(!w)return w;var C=(0,Te.Z)({},w);return"props"in C||Object.defineProperty(C,"props",{get:function(){return(0,D.ZP)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),C}}),C}function q(w,C,B,W,Z,te){var ue=null,ge=null;function Ce(){function De(Fe){var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",Ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Fe.map(function($e,mt){var xt="".concat(Ve,"-").concat(mt),St=$e[te.value],Lt=B.includes(St),Ht=De($e[te.children]||[],xt,Lt),ut=h.createElement(T,$e,Ht.map(function(Le){return Le.node}));if(C===St&&(ue=ut),Lt){var Ut={pos:xt,node:ut,children:Ht};return Ge||ge.push(Ut),Ut}return null}).filter(function($e){return $e})}ge||(ge=[],De(W),ge.sort(function(Fe,Ve){var Ge=Fe.node.props.value,$e=Ve.node.props.value,mt=B.indexOf(Ge),xt=B.indexOf($e);return mt-xt}))}Object.defineProperty(w,"triggerNode",{get:function(){return(0,D.ZP)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),Ce(),ue}}),Object.defineProperty(w,"allCheckedNodes",{get:function(){return(0,D.ZP)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),Ce(),Z?ge:ge.map(function(Fe){var Ve=Fe.node;return Ve})}})}var he=function(C,B,W){var Z=W.fieldNames,te=W.treeNodeFilterProp,ue=W.filterTreeNode,ge=Z.children;return h.useMemo(function(){if(!B||ue===!1)return C;var Ce=typeof ue=="function"?ue:function(Fe,Ve){return String(Ve[te]).toUpperCase().includes(B.toUpperCase())},De=function Fe(Ve){var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Ve.reduce(function($e,mt){var xt=mt[ge],St=Ge||Ce(B,ae(mt)),Lt=Fe(xt||[],St);return(St||Lt.length)&&$e.push((0,Te.Z)((0,Te.Z)({},mt),{},(0,Y.Z)({isLeaf:void 0},ge,Lt))),$e},[])};return De(C)},[C,B,ge,te,ue])},ve=he;function be(w){var C=h.useRef();C.current=w;var B=h.useCallback(function(){return C.current.apply(C,arguments)},[]);return B}function Oe(w,C){var B=C.id,W=C.pId,Z=C.rootPId,te=new Map,ue=[];return w.forEach(function(ge){var Ce=ge[B],De=(0,Te.Z)((0,Te.Z)({},ge),{},{key:ge.key||Ce});te.set(Ce,De)}),te.forEach(function(ge){var Ce=ge[W],De=te.get(Ce);De?(De.children=De.children||[],De.children.push(ge)):(Ce===Z||Z===null)&&ue.push(ge)}),ue}function Q(w,C,B){return h.useMemo(function(){if(w){if(B){var W=(0,Te.Z)({id:"id",pId:"pId",rootPId:null},(0,p.Z)(B)==="object"?B:{});return Oe(w,W)}return w}return se(C)},[C,B,w])}var P=h.createContext(null),j=P,X=A(37530),ne=A(29530),J=A(10228),v=A(80547),g=h.createContext(null),U=g,ie=function(C){return Array.isArray(C)?C:C!==void 0?[C]:[]},Be=function(C){var B=C||{},W=B.label,Z=B.value,te=B.children;return{_title:W?[W]:["title","label"],value:Z||"value",key:Z||"value",children:te||"children"}},Ze=function(C){return!C||C.disabled||C.disableCheckbox||C.checkable===!1},Qe=function(C,B){var W=[],Z=function te(ue){ue.forEach(function(ge){var Ce=ge[B.children];Ce&&(W.push(ge[B.value]),te(Ce))})};return Z(C),W},nt=function(C){return C==null},At=A(70425),_t={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},xe=function(C,B){var W=(0,me.lk)(),Z=W.prefixCls,te=W.multiple,ue=W.searchValue,ge=W.toggleOpen,Ce=W.open,De=W.notFoundContent,Fe=h.useContext(U),Ve=Fe.virtual,Ge=Fe.listHeight,$e=Fe.listItemHeight,mt=Fe.listItemScrollOffset,xt=Fe.treeData,St=Fe.fieldNames,Lt=Fe.onSelect,Ht=Fe.dropdownMatchSelectWidth,ut=Fe.treeExpandAction,Ut=Fe.treeTitleRender,Le=Fe.onPopupScroll,Ae=Fe.leftMaxCount,Ie=Fe.leafCountOnly,H=Fe.valueEntities,ee=h.useContext(j),de=ee.checkable,re=ee.checkedKeys,_e=ee.halfCheckedKeys,et=ee.treeExpandedKeys,Ye=ee.treeDefaultExpandAll,it=ee.treeDefaultExpandedKeys,Rt=ee.onTreeExpand,on=ee.treeIcon,fn=ee.showTreeIcon,Pt=ee.switcherIcon,jt=ee.treeLine,wn=ee.treeNodeFilterProp,Gn=ee.loadData,An=ee.treeLoadedKeys,Mn=ee.treeMotion,Cn=ee.onTreeLoad,rn=ee.keyEntities,Tn=h.useRef(),$n=(0,v.Z)(function(){return xt},[Ce,xt],function(Nt,Mt){return Mt[0]&&Nt[1]!==Mt[1]}),tr=h.useMemo(function(){return de?{checked:re,halfChecked:_e}:null},[de,re,_e]);h.useEffect(function(){if(Ce&&!te&&re.length){var Nt;(Nt=Tn.current)===null||Nt===void 0||Nt.scrollTo({key:re[0]})}},[Ce]);var Me=function(Mt){Mt.preventDefault()},Pe=function(Mt,qt){var cn=qt.node;de&&Ze(cn)||(Lt(cn.key,{selected:!re.includes(cn.key)}),te||ge(!1))},Tt=h.useState(it),pt=(0,fe.Z)(Tt,2),dt=pt[0],Zt=pt[1],ze=h.useState(null),tt=(0,fe.Z)(ze,2),ot=tt[0],It=tt[1],Ft=h.useMemo(function(){return et?(0,pe.Z)(et):ue?ot:dt},[dt,ot,et,ue]),Xt=function(Mt){Zt(Mt),It(Mt),Rt&&Rt(Mt)},Bt=String(ue).toLowerCase(),yt=function(Mt){return Bt?String(Mt[wn]).toLowerCase().includes(Bt):!1};h.useEffect(function(){ue&&It(Qe(xt,St))},[ue]);var ye=h.useState(function(){return new Map}),Ue=(0,fe.Z)(ye,2),He=Ue[0],je=Ue[1];h.useEffect(function(){Ae&&je(new Map)},[Ae]);function at(Nt){var Mt=Nt[St.value];if(!He.has(Mt)){var qt=H.get(Mt),cn=(qt.children||[]).length===0;if(cn)He.set(Mt,!1);else{var ln=qt.children.filter(function(yn){return!yn.node.disabled&&!yn.node.disableCheckbox&&!re.includes(yn.node[St.value])}),an=ln.length;He.set(Mt,an>Ae)}}return He.get(Mt)}var ct=(0,At.zX)(function(Nt){var Mt=Nt[St.value];return re.includes(Mt)||Ae===null?!1:Ae<=0?!0:Ie&&Ae?at(Nt):!1}),lt=function Nt(Mt){var qt=(0,X.Z)(Mt),cn;try{for(qt.s();!(cn=qt.n()).done;){var ln=cn.value;if(!(ln.disabled||ln.selectable===!1)){if(ue){if(yt(ln))return ln}else return ln;if(ln[St.children]){var an=Nt(ln[St.children]);if(an)return an}}}}catch(yn){qt.e(yn)}finally{qt.f()}return null},wt=h.useState(null),Ot=(0,fe.Z)(wt,2),$t=Ot[0],pn=Ot[1],kt=rn[$t];h.useEffect(function(){if(Ce){var Nt=null,Mt=function(){var cn=lt($n);return cn?cn[St.value]:null};!te&&re.length&&!ue?Nt=re[0]:Nt=Mt(),pn(Nt)}},[Ce,ue]),h.useImperativeHandle(B,function(){var Nt;return{scrollTo:(Nt=Tn.current)===null||Nt===void 0?void 0:Nt.scrollTo,onKeyDown:function(qt){var cn,ln=qt.which;switch(ln){case J.Z.UP:case J.Z.DOWN:case J.Z.LEFT:case J.Z.RIGHT:(cn=Tn.current)===null||cn===void 0||cn.onKeyDown(qt);break;case J.Z.ENTER:{if(kt){var an=ct(kt.node),yn=(kt==null?void 0:kt.node)||{},Vt=yn.selectable,Wt=yn.value,Jn=yn.disabled;Vt!==!1&&!Jn&&!an&&Pe(null,{node:{key:$t},selected:!re.includes(Wt)})}break}case J.Z.ESC:ge(!1)}},onKeyUp:function(){}}});var _n=(0,v.Z)(function(){return!ue},[ue,et||dt],function(Nt,Mt){var qt=(0,fe.Z)(Nt,1),cn=qt[0],ln=(0,fe.Z)(Mt,2),an=ln[0],yn=ln[1];return cn!==an&&!!(an||yn)}),sn=_n?Gn:null;if($n.length===0)return h.createElement("div",{role:"listbox",className:"".concat(Z,"-empty"),onMouseDown:Me},De);var un={fieldNames:St};return An&&(un.loadedKeys=An),Ft&&(un.expandedKeys=Ft),h.createElement("div",{onMouseDown:Me},kt&&Ce&&h.createElement("span",{style:_t,"aria-live":"assertive"},kt.node.value),h.createElement(ne.y6.Provider,{value:{nodeDisabled:ct}},h.createElement(ne.ZP,(0,k.Z)({ref:Tn,focusable:!1,prefixCls:"".concat(Z,"-tree"),treeData:$n,height:Ge,itemHeight:$e,itemScrollOffset:mt,virtual:Ve!==!1&&Ht!==!1,multiple:te,icon:on,showIcon:fn,switcherIcon:Pt,showLine:jt,loadData:sn,motion:Mn,activeKey:$t,checkable:de,checkStrictly:!0,checkedKeys:tr,selectedKeys:de?[]:re,defaultExpandAll:Ye,titleRender:Ut},un,{onActiveChange:pn,onSelect:Pe,onCheck:Pe,onExpand:Xt,onLoad:Cn,filterTreeNode:yt,expandAction:ut,onScroll:Le}))))},vt=h.forwardRef(xe),zt=vt,Ct="SHOW_ALL",nn="SHOW_PARENT",qe="SHOW_CHILD";function Re(w,C,B,W){var Z=new Set(w);return C===qe?w.filter(function(te){var ue=B[te];return!ue||!ue.children||!ue.children.some(function(ge){var Ce=ge.node;return Z.has(Ce[W.value])})||!ue.children.every(function(ge){var Ce=ge.node;return Ze(Ce)||Z.has(Ce[W.value])})}):C===nn?w.filter(function(te){var ue=B[te],ge=ue?ue.parent:null;return!ge||Ze(ge.node)||!Z.has(ge.key)}):w}function we(w){var C=w.searchPlaceholder,B=w.treeCheckStrictly,W=w.treeCheckable,Z=w.labelInValue,te=w.value,ue=w.multiple,ge=w.showCheckedStrategy,Ce=w.maxCount;warning(!C,"`searchPlaceholder` has been removed."),B&&Z===!1&&warning(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(Z||B)&&warning(toArray(te).every(function(De){return De&&_typeof(De)==="object"&&"value"in De}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),B||ue||W?warning(!te||Array.isArray(te),"`value` should be an array when `TreeSelect` is checkable or multiple."):warning(!Array.isArray(te),"`value` should not be array when `TreeSelect` is single mode."),Ce&&(ge==="SHOW_ALL"&&!B||ge==="SHOW_PARENT")&&warning(!1,"`maxCount` not work with `showCheckedStrategy=SHOW_ALL` (when `treeCheckStrictly=false`) or `showCheckedStrategy=SHOW_PARENT`.")}var K=null,Se=["id","prefixCls","value","defaultValue","onChange","onSelect","onDeselect","searchValue","inputValue","onSearch","autoClearSearchValue","filterTreeNode","treeNodeFilterProp","showCheckedStrategy","treeNodeLabelProp","multiple","treeCheckable","treeCheckStrictly","labelInValue","maxCount","fieldNames","treeDataSimpleMode","treeData","children","loadData","treeLoadedKeys","onTreeLoad","treeDefaultExpandAll","treeExpandedKeys","treeDefaultExpandedKeys","onTreeExpand","treeExpandAction","virtual","listHeight","listItemHeight","listItemScrollOffset","onDropdownVisibleChange","dropdownMatchSelectWidth","treeLine","treeIcon","showTreeIcon","switcherIcon","treeMotion","treeTitleRender","onPopupScroll"];function Ne(w){return!w||(0,p.Z)(w)!=="object"}var V=h.forwardRef(function(w,C){var B=w.id,W=w.prefixCls,Z=W===void 0?"rc-tree-select":W,te=w.value,ue=w.defaultValue,ge=w.onChange,Ce=w.onSelect,De=w.onDeselect,Fe=w.searchValue,Ve=w.inputValue,Ge=w.onSearch,$e=w.autoClearSearchValue,mt=$e===void 0?!0:$e,xt=w.filterTreeNode,St=w.treeNodeFilterProp,Lt=St===void 0?"value":St,Ht=w.showCheckedStrategy,ut=w.treeNodeLabelProp,Ut=w.multiple,Le=w.treeCheckable,Ae=w.treeCheckStrictly,Ie=w.labelInValue,H=w.maxCount,ee=w.fieldNames,de=w.treeDataSimpleMode,re=w.treeData,_e=w.children,et=w.loadData,Ye=w.treeLoadedKeys,it=w.onTreeLoad,Rt=w.treeDefaultExpandAll,on=w.treeExpandedKeys,fn=w.treeDefaultExpandedKeys,Pt=w.onTreeExpand,jt=w.treeExpandAction,wn=w.virtual,Gn=w.listHeight,An=Gn===void 0?200:Gn,Mn=w.listItemHeight,Cn=Mn===void 0?20:Mn,rn=w.listItemScrollOffset,Tn=rn===void 0?0:rn,$n=w.onDropdownVisibleChange,tr=w.dropdownMatchSelectWidth,Me=tr===void 0?!0:tr,Pe=w.treeLine,Tt=w.treeIcon,pt=w.showTreeIcon,dt=w.switcherIcon,Zt=w.treeMotion,ze=w.treeTitleRender,tt=w.onPopupScroll,ot=(0,$.Z)(w,Se),It=(0,ce.ZP)(B),Ft=Le&&!Ae,Xt=Le||Ae,Bt=Ae||Ie,yt=Xt||Ut,ye=(0,x.Z)(ue,{value:te}),Ue=(0,fe.Z)(ye,2),He=Ue[0],je=Ue[1],at=h.useMemo(function(){return Le?Ht||qe:Ct},[Ht,Le]),ct=h.useMemo(function(){return Be(ee)},[JSON.stringify(ee)]),lt=(0,x.Z)("",{value:Fe!==void 0?Fe:Ve,postState:function(xn){return xn||""}}),wt=(0,fe.Z)(lt,2),Ot=wt[0],$t=wt[1],pn=function(xn){$t(xn),Ge==null||Ge(xn)},kt=Q(re,_e,de),_n=z(kt,ct),sn=_n.keyEntities,un=_n.valueEntities,Nt=h.useCallback(function(en){var xn=[],Pn=[];return en.forEach(function(kn){un.has(kn)?Pn.push(kn):xn.push(kn)}),{missingRawValues:xn,existRawValues:Pn}},[un]),Mt=ve(kt,Ot,{fieldNames:ct,treeNodeFilterProp:Lt,filterTreeNode:xt}),qt=h.useCallback(function(en){if(en){if(ut)return en[ut];for(var xn=ct._title,Pn=0;Pn<xn.length;Pn+=1){var kn=en[xn[Pn]];if(kn!==void 0)return kn}}},[ct,ut]),cn=h.useCallback(function(en){var xn=ie(en);return xn.map(function(Pn){return Ne(Pn)?{value:Pn}:Pn})},[]),ln=h.useCallback(function(en){var xn=cn(en);return xn.map(function(Pn){var kn=Pn.label,dr=Pn.value,bn=Pn.halfChecked,jn,Xn=un.get(dr);if(Xn){var tn;kn=ze?ze(Xn.node):(tn=kn)!==null&&tn!==void 0?tn:qt(Xn.node),jn=Xn.node.disabled}else if(kn===void 0){var rr=cn(He).find(function(vr){return vr.value===dr});kn=rr.label}return{label:kn,value:dr,halfChecked:bn,disabled:jn}})},[un,qt,cn,He]),an=h.useMemo(function(){return cn(He===null?[]:He)},[cn,He]),yn=h.useMemo(function(){var en=[],xn=[];return an.forEach(function(Pn){Pn.halfChecked?xn.push(Pn):en.push(Pn)}),[en,xn]},[an]),Vt=(0,fe.Z)(yn,2),Wt=Vt[0],Jn=Vt[1],Wn=h.useMemo(function(){return Wt.map(function(en){return en.value})},[Wt]),Bn=S(Wt,Jn,Ft,sn),Hn=(0,fe.Z)(Bn,2),qn=Hn[0],Vn=Hn[1],mr=h.useMemo(function(){var en=Re(qn,at,sn,ct),xn=en.map(function(bn){var jn,Xn;return(jn=(Xn=sn[bn])===null||Xn===void 0||(Xn=Xn.node)===null||Xn===void 0?void 0:Xn[ct.value])!==null&&jn!==void 0?jn:bn}),Pn=xn.map(function(bn){var jn=Wt.find(function(tn){return tn.value===bn}),Xn=Ie?jn==null?void 0:jn.label:ze==null?void 0:ze(jn);return{value:bn,label:Xn}}),kn=ln(Pn),dr=kn[0];return!yt&&dr&&nt(dr.value)&&nt(dr.label)?[]:kn.map(function(bn){var jn;return(0,Te.Z)((0,Te.Z)({},bn),{},{label:(jn=bn.label)!==null&&jn!==void 0?jn:bn.value})})},[ct,yt,qn,Wt,ln,at,sn]),nr=m(mr),ar=(0,fe.Z)(nr,1),En=ar[0],Dt=h.useMemo(function(){return yt&&(at==="SHOW_CHILD"||Ae||!Le)?H:null},[H,yt,Ae,at,Le]),bt=be(function(en,xn,Pn){var kn=Re(en,at,sn,ct);if(!(Dt&&kn.length>Dt)){var dr=ln(en);if(je(dr),mt&&$t(""),ge){var bn=en;Ft&&(bn=kn.map(function(br){var Kn=un.get(br);return Kn?Kn.node[ct.value]:br}));var jn=xn||{triggerValue:void 0,selected:void 0},Xn=jn.triggerValue,tn=jn.selected,rr=bn;if(Ae){var vr=Jn.filter(function(br){return!bn.includes(br.value)});rr=[].concat((0,pe.Z)(rr),(0,pe.Z)(vr))}var hr=ln(rr),Er={preValue:Wt,triggerValue:Xn},kr=!0;(Ae||Pn==="selection"&&!tn)&&(kr=!1),q(Er,Xn,en,kt,kr,ct),Xt?Er.checked=tn:Er.selected=tn;var Cr=Bt?hr:hr.map(function(br){return br.value});ge(yt?Cr:Cr[0],Bt?null:hr.map(function(br){return br.label}),Er)}}}),Qt=h.useCallback(function(en,xn){var Pn,kn=xn.selected,dr=xn.source,bn=sn[en],jn=bn==null?void 0:bn.node,Xn=(Pn=jn==null?void 0:jn[ct.value])!==null&&Pn!==void 0?Pn:en;if(!yt)bt([Xn],{selected:!0,triggerValue:Xn},"option");else{var tn=kn?[].concat((0,pe.Z)(Wn),[Xn]):qn.filter(function(Kn){return Kn!==Xn});if(Ft){var rr=Nt(tn),vr=rr.missingRawValues,hr=rr.existRawValues,Er=hr.map(function(Kn){return un.get(Kn).key}),kr;if(kn){var Cr=(0,o.S)(Er,!0,sn);kr=Cr.checkedKeys}else{var br=(0,o.S)(Er,{checked:!1,halfCheckedKeys:Vn},sn);kr=br.checkedKeys}tn=[].concat((0,pe.Z)(vr),(0,pe.Z)(kr.map(function(Kn){return sn[Kn].node[ct.value]})))}bt(tn,{selected:kn,triggerValue:Xn},dr||"option")}kn||!yt?Ce==null||Ce(Xn,ae(jn)):De==null||De(Xn,ae(jn))},[Nt,un,sn,ct,yt,Wn,bt,Ft,Ce,De,qn,Vn,H]),Yt=h.useCallback(function(en){if($n){var xn={};Object.defineProperty(xn,"documentClickClose",{get:function(){return(0,D.ZP)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),$n(en,xn)}},[$n]),mn=be(function(en,xn){var Pn=en.map(function(kn){return kn.value});if(xn.type==="clear"){bt(Pn,{},"selection");return}xn.values.length&&Qt(xn.values[0].value,{selected:!1,source:"selection"})}),Yn=h.useMemo(function(){return{virtual:wn,dropdownMatchSelectWidth:Me,listHeight:An,listItemHeight:Cn,listItemScrollOffset:Tn,treeData:Mt,fieldNames:ct,onSelect:Qt,treeExpandAction:jt,treeTitleRender:ze,onPopupScroll:tt,leftMaxCount:H===void 0?null:H-En.length,leafCountOnly:at==="SHOW_CHILD"&&!Ae&&!!Le,valueEntities:un}},[wn,Me,An,Cn,Tn,Mt,ct,Qt,jt,ze,tt,H,En.length,at,Ae,Le,un]),er=h.useMemo(function(){return{checkable:Xt,loadData:et,treeLoadedKeys:Ye,onTreeLoad:it,checkedKeys:qn,halfCheckedKeys:Vn,treeDefaultExpandAll:Rt,treeExpandedKeys:on,treeDefaultExpandedKeys:fn,onTreeExpand:Pt,treeIcon:Tt,treeMotion:Zt,showTreeIcon:pt,switcherIcon:dt,treeLine:Pe,treeNodeFilterProp:Lt,keyEntities:sn}},[Xt,et,Ye,it,qn,Vn,Rt,on,fn,Pt,Tt,Zt,pt,dt,Pe,Lt,sn]);return h.createElement(U.Provider,{value:Yn},h.createElement(j.Provider,{value:er},h.createElement(me.Ac,(0,k.Z)({ref:C},ot,{id:It,prefixCls:Z,mode:yt?"multiple":void 0,displayValues:En,onDisplayValuesChange:mn,searchValue:Ot,onSearch:pn,OptionList:zt,emptyOptions:!kt.length,onDropdownVisibleChange:Yt,dropdownMatchSelectWidth:Me}))))}),I=V;I.TreeNode=T,I.SHOW_ALL=Ct,I.SHOW_PARENT=nn,I.SHOW_CHILD=qe;var F=I,oe=F},639:function(vn,Et,A){"use strict";A.d(Et,{Z:function(){return O}});var k=A(14809),pe=A(4635),Te=A(20439),fe=A(50298),$=A(62646),p=A(59301),me=A(92310),ce=A.n(me),o=A(26112),x=A(30699),D=function(R){for(var se=R.prefixCls,ae=R.level,q=R.isStart,he=R.isEnd,ve="".concat(se,"-indent-unit"),be=[],Oe=0;Oe<ae;Oe+=1)be.push(p.createElement("span",{key:Oe,className:ce()(ve,(0,pe.Z)((0,pe.Z)({},"".concat(ve,"-start"),q[Oe]),"".concat(ve,"-end"),he[Oe]))}));return p.createElement("span",{"aria-hidden":"true",className:"".concat(se,"-indent")},be)},h=p.memo(D),m=A(65065),y=A(34061),S=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],M="open",z="close",Y="---",L=function(R){var se,ae,q,he=R.eventKey,ve=R.className,be=R.style,Oe=R.dragOver,Q=R.dragOverGapTop,P=R.dragOverGapBottom,j=R.isLeaf,X=R.isStart,ne=R.isEnd,J=R.expanded,v=R.selected,g=R.checked,U=R.halfChecked,ie=R.loading,Be=R.domRef,Ze=R.active,Qe=R.data,nt=R.onMouseMove,At=R.selectable,_t=(0,$.Z)(R,S),xe=p.useContext(x.k),vt=p.useContext(x.y),zt=p.useRef(null),Ct=p.useState(!1),nn=(0,fe.Z)(Ct,2),qe=nn[0],Re=nn[1],we=!!(xe.disabled||R.disabled||(se=vt.nodeDisabled)!==null&&se!==void 0&&se.call(vt,Qe)),K=p.useMemo(function(){return!xe.checkable||R.checkable===!1?!1:xe.checkable},[xe.checkable,R.checkable]),Se=function(_e){we||xe.onNodeSelect(_e,(0,y.F)(R))},Ne=function(_e){we||!K||R.disableCheckbox||xe.onNodeCheck(_e,(0,y.F)(R),!g)},V=p.useMemo(function(){return typeof At=="boolean"?At:xe.selectable},[At,xe.selectable]),I=function(_e){xe.onNodeClick(_e,(0,y.F)(R)),V?Se(_e):Ne(_e)},F=function(_e){xe.onNodeDoubleClick(_e,(0,y.F)(R))},oe=function(_e){xe.onNodeMouseEnter(_e,(0,y.F)(R))},w=function(_e){xe.onNodeMouseLeave(_e,(0,y.F)(R))},C=function(_e){xe.onNodeContextMenu(_e,(0,y.F)(R))},B=p.useMemo(function(){return!!(xe.draggable&&(!xe.draggable.nodeDraggable||xe.draggable.nodeDraggable(Qe)))},[xe.draggable,Qe]),W=function(_e){_e.stopPropagation(),Re(!0),xe.onNodeDragStart(_e,R);try{_e.dataTransfer.setData("text/plain","")}catch(et){}},Z=function(_e){_e.preventDefault(),_e.stopPropagation(),xe.onNodeDragEnter(_e,R)},te=function(_e){_e.preventDefault(),_e.stopPropagation(),xe.onNodeDragOver(_e,R)},ue=function(_e){_e.stopPropagation(),xe.onNodeDragLeave(_e,R)},ge=function(_e){_e.stopPropagation(),Re(!1),xe.onNodeDragEnd(_e,R)},Ce=function(_e){_e.preventDefault(),_e.stopPropagation(),Re(!1),xe.onNodeDrop(_e,R)},De=function(_e){ie||xe.onNodeExpand(_e,(0,y.F)(R))},Fe=p.useMemo(function(){var re=(0,m.Z)(xe.keyEntities,he)||{},_e=re.children;return!!(_e||[]).length},[xe.keyEntities,he]),Ve=p.useMemo(function(){return j===!1?!1:j||!xe.loadData&&!Fe||xe.loadData&&R.loaded&&!Fe},[j,xe.loadData,Fe,R.loaded]);p.useEffect(function(){ie||typeof xe.loadData=="function"&&J&&!Ve&&!R.loaded&&xe.onNodeLoad((0,y.F)(R))},[ie,xe.loadData,xe.onNodeLoad,J,Ve,R]);var Ge=p.useMemo(function(){var re;return(re=xe.draggable)!==null&&re!==void 0&&re.icon?p.createElement("span",{className:"".concat(xe.prefixCls,"-draggable-icon")},xe.draggable.icon):null},[xe.draggable]),$e=function(_e){var et=R.switcherIcon||xe.switcherIcon;return typeof et=="function"?et((0,Te.Z)((0,Te.Z)({},R),{},{isLeaf:_e})):et},mt=function(){if(Ve){var _e=$e(!0);return _e!==!1?p.createElement("span",{className:ce()("".concat(xe.prefixCls,"-switcher"),"".concat(xe.prefixCls,"-switcher-noop"))},_e):null}var et=$e(!1);return et!==!1?p.createElement("span",{onClick:De,className:ce()("".concat(xe.prefixCls,"-switcher"),"".concat(xe.prefixCls,"-switcher_").concat(J?M:z))},et):null},xt=p.useMemo(function(){if(!K)return null;var re=typeof K!="boolean"?K:null;return p.createElement("span",{className:ce()("".concat(xe.prefixCls,"-checkbox"),(0,pe.Z)((0,pe.Z)((0,pe.Z)({},"".concat(xe.prefixCls,"-checkbox-checked"),g),"".concat(xe.prefixCls,"-checkbox-indeterminate"),!g&&U),"".concat(xe.prefixCls,"-checkbox-disabled"),we||R.disableCheckbox)),onClick:Ne,role:"checkbox","aria-checked":U?"mixed":g,"aria-disabled":we||R.disableCheckbox,"aria-label":"Select ".concat(typeof R.title=="string"?R.title:"tree node")},re)},[K,g,U,we,R.disableCheckbox,R.title]),St=p.useMemo(function(){return Ve?null:J?M:z},[Ve,J]),Lt=p.useMemo(function(){return p.createElement("span",{className:ce()("".concat(xe.prefixCls,"-iconEle"),"".concat(xe.prefixCls,"-icon__").concat(St||"docu"),(0,pe.Z)({},"".concat(xe.prefixCls,"-icon_loading"),ie))})},[xe.prefixCls,St,ie]),Ht=p.useMemo(function(){var re=!!xe.draggable,_e=!R.disabled&&re&&xe.dragOverNodeKey===he;return _e?xe.dropIndicatorRender({dropPosition:xe.dropPosition,dropLevelOffset:xe.dropLevelOffset,indent:xe.indent,prefixCls:xe.prefixCls,direction:xe.direction}):null},[xe.dropPosition,xe.dropLevelOffset,xe.indent,xe.prefixCls,xe.direction,xe.draggable,xe.dragOverNodeKey,xe.dropIndicatorRender]),ut=p.useMemo(function(){var re=R.title,_e=re===void 0?Y:re,et="".concat(xe.prefixCls,"-node-content-wrapper"),Ye;if(xe.showIcon){var it=R.icon||xe.icon;Ye=it?p.createElement("span",{className:ce()("".concat(xe.prefixCls,"-iconEle"),"".concat(xe.prefixCls,"-icon__customize"))},typeof it=="function"?it(R):it):Lt}else xe.loadData&&ie&&(Ye=Lt);var Rt;return typeof _e=="function"?Rt=_e(Qe):xe.titleRender?Rt=xe.titleRender(Qe):Rt=_e,p.createElement("span",{ref:zt,title:typeof _e=="string"?_e:"",className:ce()(et,"".concat(et,"-").concat(St||"normal"),(0,pe.Z)({},"".concat(xe.prefixCls,"-node-selected"),!we&&(v||qe))),onMouseEnter:oe,onMouseLeave:w,onContextMenu:C,onClick:I,onDoubleClick:F},Ye,p.createElement("span",{className:"".concat(xe.prefixCls,"-title")},Rt),Ht)},[xe.prefixCls,xe.showIcon,R,xe.icon,Lt,xe.titleRender,Qe,St,oe,w,C,I,F]),Ut=(0,o.Z)(_t,{aria:!0,data:!0}),Le=(0,m.Z)(xe.keyEntities,he)||{},Ae=Le.level,Ie=ne[ne.length-1],H=!we&&B,ee=xe.draggingNodeKey===he,de=At!==void 0?{"aria-selected":!!At}:void 0;return p.createElement("div",(0,k.Z)({ref:Be,role:"treeitem","aria-expanded":j?void 0:J,className:ce()(ve,"".concat(xe.prefixCls,"-treenode"),(q={},(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)(q,"".concat(xe.prefixCls,"-treenode-disabled"),we),"".concat(xe.prefixCls,"-treenode-switcher-").concat(J?"open":"close"),!j),"".concat(xe.prefixCls,"-treenode-checkbox-checked"),g),"".concat(xe.prefixCls,"-treenode-checkbox-indeterminate"),U),"".concat(xe.prefixCls,"-treenode-selected"),v),"".concat(xe.prefixCls,"-treenode-loading"),ie),"".concat(xe.prefixCls,"-treenode-active"),Ze),"".concat(xe.prefixCls,"-treenode-leaf-last"),Ie),"".concat(xe.prefixCls,"-treenode-draggable"),B),"dragging",ee),(0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)((0,pe.Z)(q,"drop-target",xe.dropTargetKey===he),"drop-container",xe.dropContainerKey===he),"drag-over",!we&&Oe),"drag-over-gap-top",!we&&Q),"drag-over-gap-bottom",!we&&P),"filter-node",(ae=xe.filterTreeNode)===null||ae===void 0?void 0:ae.call(xe,(0,y.F)(R))),"".concat(xe.prefixCls,"-treenode-leaf"),Ve))),style:be,draggable:H,onDragStart:H?W:void 0,onDragEnter:B?Z:void 0,onDragOver:B?te:void 0,onDragLeave:B?ue:void 0,onDrop:B?Ce:void 0,onDragEnd:B?ge:void 0,onMouseMove:nt},de,Ut),p.createElement(h,{prefixCls:xe.prefixCls,level:Ae,isStart:X,isEnd:ne}),Ge,mt(),xt,ut)};L.isTreeNode=1;var O=L},30699:function(vn,Et,A){"use strict";A.d(Et,{k:function(){return pe},y:function(){return Te}});var k=A(59301),pe=k.createContext(null),Te=k.createContext({})},29530:function(vn,Et,A){"use strict";A.d(Et,{OF:function(){return he.Z},y6:function(){return z.y},ZP:function(){return we}});var k=A(14809),pe=A(93664),Te=A(20439),fe=A(95190),$=A(99153),p=A(84851),me=A(13028),ce=A(19257),o=A(93046),x=A(4635),D=A(92310),h=A.n(D),m=A(10228),y=A(26112),S=A(48736),M=A(59301),z=A(30699),Y=function(Se){var Ne=Se.dropPosition,V=Se.dropLevelOffset,I=Se.indent,F={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(Ne){case-1:F.top=0,F.left=-V*I;break;case 1:F.bottom=0,F.left=-V*I;break;case 0:F.bottom=0,F.left=I;break}return M.createElement("div",{style:F})},L=Y;function O(K){if(K==null)throw new TypeError("Cannot destructure "+K)}var T=A(50298),R=A(62646),se=A(34280),ae=A(65283),q=A(77900),he=A(639);function ve(K,Se){var Ne=M.useState(!1),V=(0,T.Z)(Ne,2),I=V[0],F=V[1];(0,se.Z)(function(){if(I)return K(),function(){Se()}},[I]),(0,se.Z)(function(){return F(!0),function(){F(!1)}},[])}var be=ve,Oe=A(34061),Q=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],P=M.forwardRef(function(K,Se){var Ne=K.className,V=K.style,I=K.motion,F=K.motionNodes,oe=K.motionType,w=K.onMotionStart,C=K.onMotionEnd,B=K.active,W=K.treeNodeRequiredProps,Z=(0,R.Z)(K,Q),te=M.useState(!0),ue=(0,T.Z)(te,2),ge=ue[0],Ce=ue[1],De=M.useContext(z.k),Fe=De.prefixCls,Ve=F&&oe!=="hide";(0,se.Z)(function(){F&&Ve!==ge&&Ce(Ve)},[F]);var Ge=function(){F&&w()},$e=M.useRef(!1),mt=function(){F&&!$e.current&&($e.current=!0,C())};be(Ge,mt);var xt=function(Lt){Ve===Lt&&mt()};return F?M.createElement(q.default,(0,k.Z)({ref:Se,visible:ge},I,{motionAppear:oe==="show",onVisibleChanged:xt}),function(St,Lt){var Ht=St.className,ut=St.style;return M.createElement("div",{ref:Lt,className:h()("".concat(Fe,"-treenode-motion"),Ht),style:ut},F.map(function(Ut){var Le=Object.assign({},(O(Ut.data),Ut.data)),Ae=Ut.title,Ie=Ut.key,H=Ut.isStart,ee=Ut.isEnd;delete Le.children;var de=(0,Oe.H8)(Ie,W);return M.createElement(he.Z,(0,k.Z)({},Le,de,{title:Ae,active:B,data:Ut.data,key:Ie,isStart:H,isEnd:ee}))}))}):M.createElement(he.Z,(0,k.Z)({domRef:Se,className:Ne,style:V},Z,{active:B}))}),j=P;function X(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ne=K.length,V=Se.length;if(Math.abs(Ne-V)!==1)return{add:!1,key:null};function I(F,oe){var w=new Map;F.forEach(function(B){w.set(B,!0)});var C=oe.filter(function(B){return!w.has(B)});return C.length===1?C[0]:null}return Ne<V?{add:!0,key:I(K,Se)}:{add:!1,key:I(Se,K)}}function ne(K,Se,Ne){var V=K.findIndex(function(w){return w.key===Ne}),I=K[V+1],F=Se.findIndex(function(w){return w.key===Ne});if(I){var oe=Se.findIndex(function(w){return w.key===I.key});return Se.slice(F+1,oe)}return Se.slice(F+1)}var J=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","scrollWidth","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],v={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},g=function(){},U="RC_TREE_MOTION_".concat(Math.random()),ie={key:U},Be={key:U,level:0,index:0,pos:"0",node:ie,nodes:[ie]},Ze={parent:null,children:[],pos:Be.pos,data:ie,title:null,key:U,isStart:[],isEnd:[]};function Qe(K,Se,Ne,V){return Se===!1||!Ne?K:K.slice(0,Math.ceil(Ne/V)+1)}function nt(K){var Se=K.key,Ne=K.pos;return(0,Oe.km)(Se,Ne)}function At(K){for(var Se=String(K.data.key),Ne=K;Ne.parent;)Ne=Ne.parent,Se="".concat(Ne.data.key," > ").concat(Se);return Se}var _t=M.forwardRef(function(K,Se){var Ne=K.prefixCls,V=K.data,I=K.selectable,F=K.checkable,oe=K.expandedKeys,w=K.selectedKeys,C=K.checkedKeys,B=K.loadedKeys,W=K.loadingKeys,Z=K.halfCheckedKeys,te=K.keyEntities,ue=K.disabled,ge=K.dragging,Ce=K.dragOverNodeKey,De=K.dropPosition,Fe=K.motion,Ve=K.height,Ge=K.itemHeight,$e=K.virtual,mt=K.scrollWidth,xt=K.focusable,St=K.activeItem,Lt=K.focused,Ht=K.tabIndex,ut=K.onKeyDown,Ut=K.onFocus,Le=K.onBlur,Ae=K.onActiveChange,Ie=K.onListChangeStart,H=K.onListChangeEnd,ee=(0,R.Z)(K,J),de=M.useRef(null),re=M.useRef(null);M.useImperativeHandle(Se,function(){return{scrollTo:function(tt){de.current.scrollTo(tt)},getIndentWidth:function(){return re.current.offsetWidth}}});var _e=M.useState(oe),et=(0,T.Z)(_e,2),Ye=et[0],it=et[1],Rt=M.useState(V),on=(0,T.Z)(Rt,2),fn=on[0],Pt=on[1],jt=M.useState(V),wn=(0,T.Z)(jt,2),Gn=wn[0],An=wn[1],Mn=M.useState([]),Cn=(0,T.Z)(Mn,2),rn=Cn[0],Tn=Cn[1],$n=M.useState(null),tr=(0,T.Z)($n,2),Me=tr[0],Pe=tr[1],Tt=M.useRef(V);Tt.current=V;function pt(){var ze=Tt.current;Pt(ze),An(ze),Tn([]),Pe(null),H()}(0,se.Z)(function(){it(oe);var ze=X(Ye,oe);if(ze.key!==null)if(ze.add){var tt=fn.findIndex(function(yt){var ye=yt.key;return ye===ze.key}),ot=Qe(ne(fn,V,ze.key),$e,Ve,Ge),It=fn.slice();It.splice(tt+1,0,Ze),An(It),Tn(ot),Pe("show")}else{var Ft=V.findIndex(function(yt){var ye=yt.key;return ye===ze.key}),Xt=Qe(ne(V,fn,ze.key),$e,Ve,Ge),Bt=V.slice();Bt.splice(Ft+1,0,Ze),An(Bt),Tn(Xt),Pe("hide")}else fn!==V&&(Pt(V),An(V))},[oe,V]),M.useEffect(function(){ge||pt()},[ge]);var dt=Fe?Gn:V,Zt={expandedKeys:oe,selectedKeys:w,loadedKeys:B,loadingKeys:W,checkedKeys:C,halfCheckedKeys:Z,dragOverNodeKey:Ce,dropPosition:De,keyEntities:te};return M.createElement(M.Fragment,null,Lt&&St&&M.createElement("span",{style:v,"aria-live":"assertive"},At(St)),M.createElement("div",null,M.createElement("input",{style:v,disabled:xt===!1||ue,tabIndex:xt!==!1?Ht:null,onKeyDown:ut,onFocus:Ut,onBlur:Le,value:"",onChange:g,"aria-label":"for screen reader"})),M.createElement("div",{className:"".concat(Ne,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},M.createElement("div",{className:"".concat(Ne,"-indent")},M.createElement("div",{ref:re,className:"".concat(Ne,"-indent-unit")}))),M.createElement(ae.Z,(0,k.Z)({},ee,{data:dt,itemKey:nt,height:Ve,fullHeight:!1,virtual:$e,itemHeight:Ge,scrollWidth:mt,prefixCls:"".concat(Ne,"-list"),ref:de,role:"tree",onVisibleChange:function(tt){tt.every(function(ot){return nt(ot)!==U})&&pt()}}),function(ze){var tt=ze.pos,ot=Object.assign({},(O(ze.data),ze.data)),It=ze.title,Ft=ze.key,Xt=ze.isStart,Bt=ze.isEnd,yt=(0,Oe.km)(Ft,tt);delete ot.key,delete ot.children;var ye=(0,Oe.H8)(yt,Zt);return M.createElement(j,(0,k.Z)({},ot,ye,{title:It,active:!!St&&Ft===St.key,pos:tt,data:ze.data,isStart:Xt,isEnd:Bt,motion:Fe,motionNodes:Ft===U?rn:null,motionType:Me,onMotionStart:Ie,onMotionEnd:pt,treeNodeRequiredProps:Zt,onMouseMove:function(){Ae(null)}}))}))}),xe=_t,vt=A(82661),zt=A(34643),Ct=A(65065),nn=10,qe=function(K){(0,ce.Z)(Ne,K);var Se=(0,o.Z)(Ne);function Ne(){var V;(0,$.Z)(this,Ne);for(var I=arguments.length,F=new Array(I),oe=0;oe<I;oe++)F[oe]=arguments[oe];return V=Se.call.apply(Se,[this].concat(F)),(0,x.Z)((0,me.Z)(V),"destroyed",!1),(0,x.Z)((0,me.Z)(V),"delayedDragEnterLogic",void 0),(0,x.Z)((0,me.Z)(V),"loadingRetryTimes",{}),(0,x.Z)((0,me.Z)(V),"state",{keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:(0,Oe.w$)()}),(0,x.Z)((0,me.Z)(V),"dragStartMousePosition",null),(0,x.Z)((0,me.Z)(V),"dragNodeProps",null),(0,x.Z)((0,me.Z)(V),"currentMouseOverDroppableNodeKey",null),(0,x.Z)((0,me.Z)(V),"listRef",M.createRef()),(0,x.Z)((0,me.Z)(V),"onNodeDragStart",function(w,C){var B=V.state,W=B.expandedKeys,Z=B.keyEntities,te=V.props.onDragStart,ue=C.eventKey;V.dragNodeProps=C,V.dragStartMousePosition={x:w.clientX,y:w.clientY};var ge=(0,vt._5)(W,ue);V.setState({draggingNodeKey:ue,dragChildrenKeys:(0,vt.wA)(ue,Z),indent:V.listRef.current.getIndentWidth()}),V.setExpandedKeys(ge),window.addEventListener("dragend",V.onWindowDragEnd),te==null||te({event:w,node:(0,Oe.F)(C)})}),(0,x.Z)((0,me.Z)(V),"onNodeDragEnter",function(w,C){var B=V.state,W=B.expandedKeys,Z=B.keyEntities,te=B.dragChildrenKeys,ue=B.flattenNodes,ge=B.indent,Ce=V.props,De=Ce.onDragEnter,Fe=Ce.onExpand,Ve=Ce.allowDrop,Ge=Ce.direction,$e=C.pos,mt=C.eventKey;if(V.currentMouseOverDroppableNodeKey!==mt&&(V.currentMouseOverDroppableNodeKey=mt),!V.dragNodeProps){V.resetDragState();return}var xt=(0,vt.OM)(w,V.dragNodeProps,C,ge,V.dragStartMousePosition,Ve,ue,Z,W,Ge),St=xt.dropPosition,Lt=xt.dropLevelOffset,Ht=xt.dropTargetKey,ut=xt.dropContainerKey,Ut=xt.dropTargetPos,Le=xt.dropAllowed,Ae=xt.dragOverNodeKey;if(te.includes(Ht)||!Le){V.resetDragState();return}if(V.delayedDragEnterLogic||(V.delayedDragEnterLogic={}),Object.keys(V.delayedDragEnterLogic).forEach(function(Ie){clearTimeout(V.delayedDragEnterLogic[Ie])}),V.dragNodeProps.eventKey!==C.eventKey&&(w.persist(),V.delayedDragEnterLogic[$e]=window.setTimeout(function(){if(V.state.draggingNodeKey!==null){var Ie=(0,fe.Z)(W),H=(0,Ct.Z)(Z,C.eventKey);H&&(H.children||[]).length&&(Ie=(0,vt.L0)(W,C.eventKey)),V.props.hasOwnProperty("expandedKeys")||V.setExpandedKeys(Ie),Fe==null||Fe(Ie,{node:(0,Oe.F)(C),expanded:!0,nativeEvent:w.nativeEvent})}},800)),V.dragNodeProps.eventKey===Ht&&Lt===0){V.resetDragState();return}V.setState({dragOverNodeKey:Ae,dropPosition:St,dropLevelOffset:Lt,dropTargetKey:Ht,dropContainerKey:ut,dropTargetPos:Ut,dropAllowed:Le}),De==null||De({event:w,node:(0,Oe.F)(C),expandedKeys:W})}),(0,x.Z)((0,me.Z)(V),"onNodeDragOver",function(w,C){var B=V.state,W=B.dragChildrenKeys,Z=B.flattenNodes,te=B.keyEntities,ue=B.expandedKeys,ge=B.indent,Ce=V.props,De=Ce.onDragOver,Fe=Ce.allowDrop,Ve=Ce.direction;if(V.dragNodeProps){var Ge=(0,vt.OM)(w,V.dragNodeProps,C,ge,V.dragStartMousePosition,Fe,Z,te,ue,Ve),$e=Ge.dropPosition,mt=Ge.dropLevelOffset,xt=Ge.dropTargetKey,St=Ge.dropContainerKey,Lt=Ge.dropTargetPos,Ht=Ge.dropAllowed,ut=Ge.dragOverNodeKey;W.includes(xt)||!Ht||(V.dragNodeProps.eventKey===xt&&mt===0?V.state.dropPosition===null&&V.state.dropLevelOffset===null&&V.state.dropTargetKey===null&&V.state.dropContainerKey===null&&V.state.dropTargetPos===null&&V.state.dropAllowed===!1&&V.state.dragOverNodeKey===null||V.resetDragState():$e===V.state.dropPosition&&mt===V.state.dropLevelOffset&&xt===V.state.dropTargetKey&&St===V.state.dropContainerKey&&Lt===V.state.dropTargetPos&&Ht===V.state.dropAllowed&&ut===V.state.dragOverNodeKey||V.setState({dropPosition:$e,dropLevelOffset:mt,dropTargetKey:xt,dropContainerKey:St,dropTargetPos:Lt,dropAllowed:Ht,dragOverNodeKey:ut}),De==null||De({event:w,node:(0,Oe.F)(C)}))}}),(0,x.Z)((0,me.Z)(V),"onNodeDragLeave",function(w,C){V.currentMouseOverDroppableNodeKey===C.eventKey&&!w.currentTarget.contains(w.relatedTarget)&&(V.resetDragState(),V.currentMouseOverDroppableNodeKey=null);var B=V.props.onDragLeave;B==null||B({event:w,node:(0,Oe.F)(C)})}),(0,x.Z)((0,me.Z)(V),"onWindowDragEnd",function(w){V.onNodeDragEnd(w,null,!0),window.removeEventListener("dragend",V.onWindowDragEnd)}),(0,x.Z)((0,me.Z)(V),"onNodeDragEnd",function(w,C){var B=V.props.onDragEnd;V.setState({dragOverNodeKey:null}),V.cleanDragState(),B==null||B({event:w,node:(0,Oe.F)(C)}),V.dragNodeProps=null,window.removeEventListener("dragend",V.onWindowDragEnd)}),(0,x.Z)((0,me.Z)(V),"onNodeDrop",function(w,C){var B,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Z=V.state,te=Z.dragChildrenKeys,ue=Z.dropPosition,ge=Z.dropTargetKey,Ce=Z.dropTargetPos,De=Z.dropAllowed;if(De){var Fe=V.props.onDrop;if(V.setState({dragOverNodeKey:null}),V.cleanDragState(),ge!==null){var Ve=(0,Te.Z)((0,Te.Z)({},(0,Oe.H8)(ge,V.getTreeNodeRequiredProps())),{},{active:((B=V.getActiveItem())===null||B===void 0?void 0:B.key)===ge,data:(0,Ct.Z)(V.state.keyEntities,ge).node}),Ge=te.includes(ge);(0,S.ZP)(!Ge,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var $e=(0,vt.yx)(Ce),mt={event:w,node:(0,Oe.F)(Ve),dragNode:V.dragNodeProps?(0,Oe.F)(V.dragNodeProps):null,dragNodesKeys:[V.dragNodeProps.eventKey].concat(te),dropToGap:ue!==0,dropPosition:ue+Number($e[$e.length-1])};W||Fe==null||Fe(mt),V.dragNodeProps=null}}}),(0,x.Z)((0,me.Z)(V),"cleanDragState",function(){var w=V.state.draggingNodeKey;w!==null&&V.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),V.dragStartMousePosition=null,V.currentMouseOverDroppableNodeKey=null}),(0,x.Z)((0,me.Z)(V),"triggerExpandActionExpand",function(w,C){var B=V.state,W=B.expandedKeys,Z=B.flattenNodes,te=C.expanded,ue=C.key,ge=C.isLeaf;if(!(ge||w.shiftKey||w.metaKey||w.ctrlKey)){var Ce=Z.filter(function(Fe){return Fe.key===ue})[0],De=(0,Oe.F)((0,Te.Z)((0,Te.Z)({},(0,Oe.H8)(ue,V.getTreeNodeRequiredProps())),{},{data:Ce.data}));V.setExpandedKeys(te?(0,vt._5)(W,ue):(0,vt.L0)(W,ue)),V.onNodeExpand(w,De)}}),(0,x.Z)((0,me.Z)(V),"onNodeClick",function(w,C){var B=V.props,W=B.onClick,Z=B.expandAction;Z==="click"&&V.triggerExpandActionExpand(w,C),W==null||W(w,C)}),(0,x.Z)((0,me.Z)(V),"onNodeDoubleClick",function(w,C){var B=V.props,W=B.onDoubleClick,Z=B.expandAction;Z==="doubleClick"&&V.triggerExpandActionExpand(w,C),W==null||W(w,C)}),(0,x.Z)((0,me.Z)(V),"onNodeSelect",function(w,C){var B=V.state.selectedKeys,W=V.state,Z=W.keyEntities,te=W.fieldNames,ue=V.props,ge=ue.onSelect,Ce=ue.multiple,De=C.selected,Fe=C[te.key],Ve=!De;Ve?Ce?B=(0,vt.L0)(B,Fe):B=[Fe]:B=(0,vt._5)(B,Fe);var Ge=B.map(function($e){var mt=(0,Ct.Z)(Z,$e);return mt?mt.node:null}).filter(Boolean);V.setUncontrolledState({selectedKeys:B}),ge==null||ge(B,{event:"select",selected:Ve,node:C,selectedNodes:Ge,nativeEvent:w.nativeEvent})}),(0,x.Z)((0,me.Z)(V),"onNodeCheck",function(w,C,B){var W=V.state,Z=W.keyEntities,te=W.checkedKeys,ue=W.halfCheckedKeys,ge=V.props,Ce=ge.checkStrictly,De=ge.onCheck,Fe=C.key,Ve,Ge={event:"check",node:C,checked:B,nativeEvent:w.nativeEvent};if(Ce){var $e=B?(0,vt.L0)(te,Fe):(0,vt._5)(te,Fe),mt=(0,vt._5)(ue,Fe);Ve={checked:$e,halfChecked:mt},Ge.checkedNodes=$e.map(function(Ut){return(0,Ct.Z)(Z,Ut)}).filter(Boolean).map(function(Ut){return Ut.node}),V.setUncontrolledState({checkedKeys:$e})}else{var xt=(0,zt.S)([].concat((0,fe.Z)(te),[Fe]),!0,Z),St=xt.checkedKeys,Lt=xt.halfCheckedKeys;if(!B){var Ht=new Set(St);Ht.delete(Fe);var ut=(0,zt.S)(Array.from(Ht),{checked:!1,halfCheckedKeys:Lt},Z);St=ut.checkedKeys,Lt=ut.halfCheckedKeys}Ve=St,Ge.checkedNodes=[],Ge.checkedNodesPositions=[],Ge.halfCheckedKeys=Lt,St.forEach(function(Ut){var Le=(0,Ct.Z)(Z,Ut);if(Le){var Ae=Le.node,Ie=Le.pos;Ge.checkedNodes.push(Ae),Ge.checkedNodesPositions.push({node:Ae,pos:Ie})}}),V.setUncontrolledState({checkedKeys:St},!1,{halfCheckedKeys:Lt})}De==null||De(Ve,Ge)}),(0,x.Z)((0,me.Z)(V),"onNodeLoad",function(w){var C,B=w.key,W=V.state.keyEntities,Z=(0,Ct.Z)(W,B);if(!(Z!=null&&(C=Z.children)!==null&&C!==void 0&&C.length)){var te=new Promise(function(ue,ge){V.setState(function(Ce){var De=Ce.loadedKeys,Fe=De===void 0?[]:De,Ve=Ce.loadingKeys,Ge=Ve===void 0?[]:Ve,$e=V.props,mt=$e.loadData,xt=$e.onLoad;if(!mt||Fe.includes(B)||Ge.includes(B))return null;var St=mt(w);return St.then(function(){var Lt=V.state.loadedKeys,Ht=(0,vt.L0)(Lt,B);xt==null||xt(Ht,{event:"load",node:w}),V.setUncontrolledState({loadedKeys:Ht}),V.setState(function(ut){return{loadingKeys:(0,vt._5)(ut.loadingKeys,B)}}),ue()}).catch(function(Lt){if(V.setState(function(ut){return{loadingKeys:(0,vt._5)(ut.loadingKeys,B)}}),V.loadingRetryTimes[B]=(V.loadingRetryTimes[B]||0)+1,V.loadingRetryTimes[B]>=nn){var Ht=V.state.loadedKeys;(0,S.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),V.setUncontrolledState({loadedKeys:(0,vt.L0)(Ht,B)}),ue()}ge(Lt)}),{loadingKeys:(0,vt.L0)(Ge,B)}})});return te.catch(function(){}),te}}),(0,x.Z)((0,me.Z)(V),"onNodeMouseEnter",function(w,C){var B=V.props.onMouseEnter;B==null||B({event:w,node:C})}),(0,x.Z)((0,me.Z)(V),"onNodeMouseLeave",function(w,C){var B=V.props.onMouseLeave;B==null||B({event:w,node:C})}),(0,x.Z)((0,me.Z)(V),"onNodeContextMenu",function(w,C){var B=V.props.onRightClick;B&&(w.preventDefault(),B({event:w,node:C}))}),(0,x.Z)((0,me.Z)(V),"onFocus",function(){var w=V.props.onFocus;V.setState({focused:!0});for(var C=arguments.length,B=new Array(C),W=0;W<C;W++)B[W]=arguments[W];w==null||w.apply(void 0,B)}),(0,x.Z)((0,me.Z)(V),"onBlur",function(){var w=V.props.onBlur;V.setState({focused:!1}),V.onActiveChange(null);for(var C=arguments.length,B=new Array(C),W=0;W<C;W++)B[W]=arguments[W];w==null||w.apply(void 0,B)}),(0,x.Z)((0,me.Z)(V),"getTreeNodeRequiredProps",function(){var w=V.state,C=w.expandedKeys,B=w.selectedKeys,W=w.loadedKeys,Z=w.loadingKeys,te=w.checkedKeys,ue=w.halfCheckedKeys,ge=w.dragOverNodeKey,Ce=w.dropPosition,De=w.keyEntities;return{expandedKeys:C||[],selectedKeys:B||[],loadedKeys:W||[],loadingKeys:Z||[],checkedKeys:te||[],halfCheckedKeys:ue||[],dragOverNodeKey:ge,dropPosition:Ce,keyEntities:De}}),(0,x.Z)((0,me.Z)(V),"setExpandedKeys",function(w){var C=V.state,B=C.treeData,W=C.fieldNames,Z=(0,Oe.oH)(B,w,W);V.setUncontrolledState({expandedKeys:w,flattenNodes:Z},!0)}),(0,x.Z)((0,me.Z)(V),"onNodeExpand",function(w,C){var B=V.state.expandedKeys,W=V.state,Z=W.listChanging,te=W.fieldNames,ue=V.props,ge=ue.onExpand,Ce=ue.loadData,De=C.expanded,Fe=C[te.key];if(!Z){var Ve=B.includes(Fe),Ge=!De;if((0,S.ZP)(De&&Ve||!De&&!Ve,"Expand state not sync with index check"),B=Ge?(0,vt.L0)(B,Fe):(0,vt._5)(B,Fe),V.setExpandedKeys(B),ge==null||ge(B,{node:C,expanded:Ge,nativeEvent:w.nativeEvent}),Ge&&Ce){var $e=V.onNodeLoad(C);$e&&$e.then(function(){var mt=(0,Oe.oH)(V.state.treeData,B,te);V.setUncontrolledState({flattenNodes:mt})}).catch(function(){var mt=V.state.expandedKeys,xt=(0,vt._5)(mt,Fe);V.setExpandedKeys(xt)})}}}),(0,x.Z)((0,me.Z)(V),"onListChangeStart",function(){V.setUncontrolledState({listChanging:!0})}),(0,x.Z)((0,me.Z)(V),"onListChangeEnd",function(){setTimeout(function(){V.setUncontrolledState({listChanging:!1})})}),(0,x.Z)((0,me.Z)(V),"onActiveChange",function(w){var C=V.state.activeKey,B=V.props,W=B.onActiveChange,Z=B.itemScrollOffset,te=Z===void 0?0:Z;C!==w&&(V.setState({activeKey:w}),w!==null&&V.scrollTo({key:w,offset:te}),W==null||W(w))}),(0,x.Z)((0,me.Z)(V),"getActiveItem",function(){var w=V.state,C=w.activeKey,B=w.flattenNodes;return C===null?null:B.find(function(W){var Z=W.key;return Z===C})||null}),(0,x.Z)((0,me.Z)(V),"offsetActiveKey",function(w){var C=V.state,B=C.flattenNodes,W=C.activeKey,Z=B.findIndex(function(ge){var Ce=ge.key;return Ce===W});Z===-1&&w<0&&(Z=B.length),Z=(Z+w+B.length)%B.length;var te=B[Z];if(te){var ue=te.key;V.onActiveChange(ue)}else V.onActiveChange(null)}),(0,x.Z)((0,me.Z)(V),"onKeyDown",function(w){var C=V.state,B=C.activeKey,W=C.expandedKeys,Z=C.checkedKeys,te=C.fieldNames,ue=V.props,ge=ue.onKeyDown,Ce=ue.checkable,De=ue.selectable;switch(w.which){case m.Z.UP:{V.offsetActiveKey(-1),w.preventDefault();break}case m.Z.DOWN:{V.offsetActiveKey(1),w.preventDefault();break}}var Fe=V.getActiveItem();if(Fe&&Fe.data){var Ve=V.getTreeNodeRequiredProps(),Ge=Fe.data.isLeaf===!1||!!(Fe.data[te.children]||[]).length,$e=(0,Oe.F)((0,Te.Z)((0,Te.Z)({},(0,Oe.H8)(B,Ve)),{},{data:Fe.data,active:!0}));switch(w.which){case m.Z.LEFT:{Ge&&W.includes(B)?V.onNodeExpand({},$e):Fe.parent&&V.onActiveChange(Fe.parent.key),w.preventDefault();break}case m.Z.RIGHT:{Ge&&!W.includes(B)?V.onNodeExpand({},$e):Fe.children&&Fe.children.length&&V.onActiveChange(Fe.children[0].key),w.preventDefault();break}case m.Z.ENTER:case m.Z.SPACE:{Ce&&!$e.disabled&&$e.checkable!==!1&&!$e.disableCheckbox?V.onNodeCheck({},$e,!Z.includes(B)):!Ce&&De&&!$e.disabled&&$e.selectable!==!1&&V.onNodeSelect({},$e);break}}}ge==null||ge(w)}),(0,x.Z)((0,me.Z)(V),"setUncontrolledState",function(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!V.destroyed){var W=!1,Z=!0,te={};Object.keys(w).forEach(function(ue){if(V.props.hasOwnProperty(ue)){Z=!1;return}W=!0,te[ue]=w[ue]}),W&&(!C||Z)&&V.setState((0,Te.Z)((0,Te.Z)({},te),B))}}),(0,x.Z)((0,me.Z)(V),"scrollTo",function(w){V.listRef.current.scrollTo(w)}),V}return(0,p.Z)(Ne,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var I=this.props,F=I.activeKey,oe=I.itemScrollOffset,w=oe===void 0?0:oe;F!==void 0&&F!==this.state.activeKey&&(this.setState({activeKey:F}),F!==null&&this.scrollTo({key:F,offset:w}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var I=this.state,F=I.focused,oe=I.flattenNodes,w=I.keyEntities,C=I.draggingNodeKey,B=I.activeKey,W=I.dropLevelOffset,Z=I.dropContainerKey,te=I.dropTargetKey,ue=I.dropPosition,ge=I.dragOverNodeKey,Ce=I.indent,De=this.props,Fe=De.prefixCls,Ve=De.className,Ge=De.style,$e=De.showLine,mt=De.focusable,xt=De.tabIndex,St=xt===void 0?0:xt,Lt=De.selectable,Ht=De.showIcon,ut=De.icon,Ut=De.switcherIcon,Le=De.draggable,Ae=De.checkable,Ie=De.checkStrictly,H=De.disabled,ee=De.motion,de=De.loadData,re=De.filterTreeNode,_e=De.height,et=De.itemHeight,Ye=De.scrollWidth,it=De.virtual,Rt=De.titleRender,on=De.dropIndicatorRender,fn=De.onContextMenu,Pt=De.onScroll,jt=De.direction,wn=De.rootClassName,Gn=De.rootStyle,An=(0,y.Z)(this.props,{aria:!0,data:!0}),Mn;Le&&((0,pe.Z)(Le)==="object"?Mn=Le:typeof Le=="function"?Mn={nodeDraggable:Le}:Mn={});var Cn={prefixCls:Fe,selectable:Lt,showIcon:Ht,icon:ut,switcherIcon:Ut,draggable:Mn,draggingNodeKey:C,checkable:Ae,checkStrictly:Ie,disabled:H,keyEntities:w,dropLevelOffset:W,dropContainerKey:Z,dropTargetKey:te,dropPosition:ue,dragOverNodeKey:ge,indent:Ce,direction:jt,dropIndicatorRender:on,loadData:de,filterTreeNode:re,titleRender:Rt,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return M.createElement(z.k.Provider,{value:Cn},M.createElement("div",{className:h()(Fe,Ve,wn,(0,x.Z)((0,x.Z)((0,x.Z)({},"".concat(Fe,"-show-line"),$e),"".concat(Fe,"-focused"),F),"".concat(Fe,"-active-focused"),B!==null)),style:Gn},M.createElement(xe,(0,k.Z)({ref:this.listRef,prefixCls:Fe,style:Ge,data:oe,disabled:H,selectable:Lt,checkable:!!Ae,motion:ee,dragging:C!==null,height:_e,itemHeight:et,virtual:it,focusable:mt,focused:F,tabIndex:St,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:fn,onScroll:Pt,scrollWidth:Ye},this.getTreeNodeRequiredProps(),An))))}}],[{key:"getDerivedStateFromProps",value:function(I,F){var oe=F.prevProps,w={prevProps:I};function C(St){return!oe&&I.hasOwnProperty(St)||oe&&oe[St]!==I[St]}var B,W=F.fieldNames;if(C("fieldNames")&&(W=(0,Oe.w$)(I.fieldNames),w.fieldNames=W),C("treeData")?B=I.treeData:C("children")&&((0,S.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),B=(0,Oe.zn)(I.children)),B){w.treeData=B;var Z=(0,Oe.I8)(B,{fieldNames:W});w.keyEntities=(0,Te.Z)((0,x.Z)({},U,Be),Z.keyEntities)}var te=w.keyEntities||F.keyEntities;if(C("expandedKeys")||oe&&C("autoExpandParent"))w.expandedKeys=I.autoExpandParent||!oe&&I.defaultExpandParent?(0,vt.r7)(I.expandedKeys,te):I.expandedKeys;else if(!oe&&I.defaultExpandAll){var ue=(0,Te.Z)({},te);delete ue[U];var ge=[];Object.keys(ue).forEach(function(St){var Lt=ue[St];Lt.children&&Lt.children.length&&ge.push(Lt.key)}),w.expandedKeys=ge}else!oe&&I.defaultExpandedKeys&&(w.expandedKeys=I.autoExpandParent||I.defaultExpandParent?(0,vt.r7)(I.defaultExpandedKeys,te):I.defaultExpandedKeys);if(w.expandedKeys||delete w.expandedKeys,B||w.expandedKeys){var Ce=(0,Oe.oH)(B||F.treeData,w.expandedKeys||F.expandedKeys,W);w.flattenNodes=Ce}if(I.selectable&&(C("selectedKeys")?w.selectedKeys=(0,vt.BT)(I.selectedKeys,I):!oe&&I.defaultSelectedKeys&&(w.selectedKeys=(0,vt.BT)(I.defaultSelectedKeys,I))),I.checkable){var De;if(C("checkedKeys")?De=(0,vt.E6)(I.checkedKeys)||{}:!oe&&I.defaultCheckedKeys?De=(0,vt.E6)(I.defaultCheckedKeys)||{}:B&&(De=(0,vt.E6)(I.checkedKeys)||{checkedKeys:F.checkedKeys,halfCheckedKeys:F.halfCheckedKeys}),De){var Fe=De,Ve=Fe.checkedKeys,Ge=Ve===void 0?[]:Ve,$e=Fe.halfCheckedKeys,mt=$e===void 0?[]:$e;if(!I.checkStrictly){var xt=(0,zt.S)(Ge,!0,te);Ge=xt.checkedKeys,mt=xt.halfCheckedKeys}w.checkedKeys=Ge,w.halfCheckedKeys=mt}}return C("loadedKeys")&&(w.loadedKeys=I.loadedKeys),w}}]),Ne}(M.Component);(0,x.Z)(qe,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:L,allowDrop:function(){return!0},expandAction:!1}),(0,x.Z)(qe,"TreeNode",he.Z);var Re=qe,we=Re},82661:function(vn,Et,A){"use strict";A.d(Et,{BT:function(){return M},E6:function(){return L},L0:function(){return x},OM:function(){return S},_5:function(){return o},r7:function(){return O},wA:function(){return h},yx:function(){return D}});var k=A(95190),pe=A(93664),Te=A(48736),fe=A(59301),$=A(639),p=A(65065),me=A(34061),ce=null;function o(T,R){if(!T)return[];var se=T.slice(),ae=se.indexOf(R);return ae>=0&&se.splice(ae,1),se}function x(T,R){var se=(T||[]).slice();return se.indexOf(R)===-1&&se.push(R),se}function D(T){return T.split("-")}function h(T,R){var se=[],ae=(0,p.Z)(R,T);function q(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];he.forEach(function(ve){var be=ve.key,Oe=ve.children;se.push(be),q(Oe)})}return q(ae.children),se}function m(T){if(T.parent){var R=D(T.pos);return Number(R[R.length-1])===T.parent.children.length-1}return!1}function y(T){var R=D(T.pos);return Number(R[R.length-1])===0}function S(T,R,se,ae,q,he,ve,be,Oe,Q){var P,j=T.clientX,X=T.clientY,ne=T.target.getBoundingClientRect(),J=ne.top,v=ne.height,g=(Q==="rtl"?-1:1)*(((q==null?void 0:q.x)||0)-j),U=(g-12)/ae,ie=Oe.filter(function(we){var K;return(K=be[we])===null||K===void 0||(K=K.children)===null||K===void 0?void 0:K.length}),Be=(0,p.Z)(be,se.eventKey);if(X<J+v/2){var Ze=ve.findIndex(function(we){return we.key===Be.key}),Qe=Ze<=0?0:Ze-1,nt=ve[Qe].key;Be=(0,p.Z)(be,nt)}var At=Be.key,_t=Be,xe=Be.key,vt=0,zt=0;if(!ie.includes(At))for(var Ct=0;Ct<U&&m(Be);Ct+=1)Be=Be.parent,zt+=1;var nn=R.data,qe=Be.node,Re=!0;return y(Be)&&Be.level===0&&X<J+v/2&&he({dragNode:nn,dropNode:qe,dropPosition:-1})&&Be.key===se.eventKey?vt=-1:(_t.children||[]).length&&ie.includes(xe)?he({dragNode:nn,dropNode:qe,dropPosition:0})?vt=0:Re=!1:zt===0?U>-1.5?he({dragNode:nn,dropNode:qe,dropPosition:1})?vt=1:Re=!1:he({dragNode:nn,dropNode:qe,dropPosition:0})?vt=0:he({dragNode:nn,dropNode:qe,dropPosition:1})?vt=1:Re=!1:he({dragNode:nn,dropNode:qe,dropPosition:1})?vt=1:Re=!1,{dropPosition:vt,dropLevelOffset:zt,dropTargetKey:Be.key,dropTargetPos:Be.pos,dragOverNodeKey:xe,dropContainerKey:vt===0?null:((P=Be.parent)===null||P===void 0?void 0:P.key)||null,dropAllowed:Re}}function M(T,R){if(T){var se=R.multiple;return se?T.slice():T.length?[T[0]]:T}}var z=function(R){return R};function Y(T,R){if(!T)return[];var se=R||{},ae=se.processProps,q=ae===void 0?z:ae,he=Array.isArray(T)?T:[T];return he.map(function(ve){var be=ve.children,Oe=_objectWithoutProperties(ve,ce),Q=Y(be,R);return React.createElement(TreeNode,_extends({key:Oe.key},q(Oe)),Q)})}function L(T){if(!T)return null;var R;if(Array.isArray(T))R={checkedKeys:T,halfCheckedKeys:void 0};else if((0,pe.Z)(T)==="object")R={checkedKeys:T.checked||void 0,halfCheckedKeys:T.halfChecked||void 0};else return(0,Te.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return R}function O(T,R){var se=new Set;function ae(q){if(!se.has(q)){var he=(0,p.Z)(R,q);if(he){se.add(q);var ve=he.parent,be=he.node;be.disabled||ve&&ae(ve.key)}}}return(T||[]).forEach(function(q){ae(q)}),(0,k.Z)(se)}},34643:function(vn,Et,A){"use strict";A.d(Et,{S:function(){return me}});var k=A(48736),pe=A(65065);function Te(ce,o){var x=new Set;return ce.forEach(function(D){o.has(D)||x.add(D)}),x}function fe(ce){var o=ce||{},x=o.disabled,D=o.disableCheckbox,h=o.checkable;return!!(x||D)||h===!1}function $(ce,o,x,D){for(var h=new Set(ce),m=new Set,y=0;y<=x;y+=1){var S=o.get(y)||new Set;S.forEach(function(L){var O=L.key,T=L.node,R=L.children,se=R===void 0?[]:R;h.has(O)&&!D(T)&&se.filter(function(ae){return!D(ae.node)}).forEach(function(ae){h.add(ae.key)})})}for(var M=new Set,z=x;z>=0;z-=1){var Y=o.get(z)||new Set;Y.forEach(function(L){var O=L.parent,T=L.node;if(!(D(T)||!L.parent||M.has(L.parent.key))){if(D(L.parent.node)){M.add(O.key);return}var R=!0,se=!1;(O.children||[]).filter(function(ae){return!D(ae.node)}).forEach(function(ae){var q=ae.key,he=h.has(q);R&&!he&&(R=!1),!se&&(he||m.has(q))&&(se=!0)}),R&&h.add(O.key),se&&m.add(O.key),M.add(O.key)}})}return{checkedKeys:Array.from(h),halfCheckedKeys:Array.from(Te(m,h))}}function p(ce,o,x,D,h){for(var m=new Set(ce),y=new Set(o),S=0;S<=D;S+=1){var M=x.get(S)||new Set;M.forEach(function(O){var T=O.key,R=O.node,se=O.children,ae=se===void 0?[]:se;!m.has(T)&&!y.has(T)&&!h(R)&&ae.filter(function(q){return!h(q.node)}).forEach(function(q){m.delete(q.key)})})}y=new Set;for(var z=new Set,Y=D;Y>=0;Y-=1){var L=x.get(Y)||new Set;L.forEach(function(O){var T=O.parent,R=O.node;if(!(h(R)||!O.parent||z.has(O.parent.key))){if(h(O.parent.node)){z.add(T.key);return}var se=!0,ae=!1;(T.children||[]).filter(function(q){return!h(q.node)}).forEach(function(q){var he=q.key,ve=m.has(he);se&&!ve&&(se=!1),!ae&&(ve||y.has(he))&&(ae=!0)}),se||m.delete(T.key),ae&&y.add(T.key),z.add(T.key)}})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(Te(y,m))}}function me(ce,o,x,D){var h=[],m;D?m=D:m=fe;var y=new Set(ce.filter(function(Y){var L=!!(0,pe.Z)(x,Y);return L||h.push(Y),L})),S=new Map,M=0;Object.keys(x).forEach(function(Y){var L=x[Y],O=L.level,T=S.get(O);T||(T=new Set,S.set(O,T)),T.add(L),M=Math.max(M,O)}),(0,k.ZP)(!h.length,"Tree missing follow keys: ".concat(h.slice(0,100).map(function(Y){return"'".concat(Y,"'")}).join(", ")));var z;return o===!0?z=$(y,S,M,m):z=p(y,o.halfCheckedKeys,S,M,m),z}},65065:function(vn,Et,A){"use strict";A.d(Et,{Z:function(){return k}});function k(pe,Te){return pe[Te]}},34061:function(vn,Et,A){"use strict";A.d(Et,{F:function(){return O},H8:function(){return L},I8:function(){return Y},km:function(){return h},oH:function(){return M},w$:function(){return m},zn:function(){return S}});var k=A(93664),pe=A(95190),Te=A(20439),fe=A(62646),$=A(11592),p=A(2738),me=A(48736),ce=A(65065),o=["children"];function x(T,R){return"".concat(T,"-").concat(R)}function D(T){return T&&T.type&&T.type.isTreeNode}function h(T,R){return T!=null?T:R}function m(T){var R=T||{},se=R.title,ae=R._title,q=R.key,he=R.children,ve=se||"title";return{title:ve,_title:ae||[ve],key:q||"key",children:he||"children"}}function y(T,R){var se=new Map;function ae(q){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(q||[]).forEach(function(ve){var be=ve[R.key],Oe=ve[R.children];warning(be!=null,"Tree node must have a certain key: [".concat(he).concat(be,"]"));var Q=String(be);warning(!se.has(Q)||be===null||be===void 0,"Same 'key' exist in the Tree: ".concat(Q)),se.set(Q,!0),ae(Oe,"".concat(he).concat(Q," > "))})}ae(T)}function S(T){function R(se){var ae=(0,$.Z)(se);return ae.map(function(q){if(!D(q))return(0,me.ZP)(!q,"Tree/TreeNode can only accept TreeNode as children."),null;var he=q.key,ve=q.props,be=ve.children,Oe=(0,fe.Z)(ve,o),Q=(0,Te.Z)({key:he},Oe),P=R(be);return P.length&&(Q.children=P),Q}).filter(function(q){return q})}return R(T)}function M(T,R,se){var ae=m(se),q=ae._title,he=ae.key,ve=ae.children,be=new Set(R===!0?[]:R),Oe=[];function Q(P){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return P.map(function(X,ne){for(var J=x(j?j.pos:"0",ne),v=h(X[he],J),g,U=0;U<q.length;U+=1){var ie=q[U];if(X[ie]!==void 0){g=X[ie];break}}var Be=Object.assign((0,p.Z)(X,[].concat((0,pe.Z)(q),[he,ve])),{title:g,key:v,parent:j,pos:J,children:null,data:X,isStart:[].concat((0,pe.Z)(j?j.isStart:[]),[ne===0]),isEnd:[].concat((0,pe.Z)(j?j.isEnd:[]),[ne===P.length-1])});return Oe.push(Be),R===!0||be.has(v)?Be.children=Q(X[ve]||[],Be):Be.children=[],Be})}return Q(T),Oe}function z(T,R,se){var ae={};(0,k.Z)(se)==="object"?ae=se:ae={externalGetKey:se},ae=ae||{};var q=ae,he=q.childrenPropName,ve=q.externalGetKey,be=q.fieldNames,Oe=m(be),Q=Oe.key,P=Oe.children,j=he||P,X;ve?typeof ve=="string"?X=function(v){return v[ve]}:typeof ve=="function"&&(X=function(v){return ve(v)}):X=function(v,g){return h(v[Q],g)};function ne(J,v,g,U){var ie=J?J[j]:T,Be=J?x(g.pos,v):"0",Ze=J?[].concat((0,pe.Z)(U),[J]):[];if(J){var Qe=X(J,Be),nt={node:J,index:v,pos:Be,key:Qe,parentPos:g.node?g.pos:null,level:g.level+1,nodes:Ze};R(nt)}ie&&ie.forEach(function(At,_t){ne(At,_t,{node:J,pos:Be,level:g?g.level+1:-1},Ze)})}ne(null)}function Y(T){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},se=R.initWrapper,ae=R.processEntity,q=R.onProcessFinished,he=R.externalGetKey,ve=R.childrenPropName,be=R.fieldNames,Oe=arguments.length>2?arguments[2]:void 0,Q=he||Oe,P={},j={},X={posEntities:P,keyEntities:j};return se&&(X=se(X)||X),z(T,function(ne){var J=ne.node,v=ne.index,g=ne.pos,U=ne.key,ie=ne.parentPos,Be=ne.level,Ze=ne.nodes,Qe={node:J,nodes:Ze,index:v,key:U,pos:g,level:Be},nt=h(U,g);P[g]=Qe,j[nt]=Qe,Qe.parent=P[ie],Qe.parent&&(Qe.parent.children=Qe.parent.children||[],Qe.parent.children.push(Qe)),ae&&ae(Qe,X)},{externalGetKey:Q,childrenPropName:ve,fieldNames:be}),q&&q(X),X}function L(T,R){var se=R.expandedKeys,ae=R.selectedKeys,q=R.loadedKeys,he=R.loadingKeys,ve=R.checkedKeys,be=R.halfCheckedKeys,Oe=R.dragOverNodeKey,Q=R.dropPosition,P=R.keyEntities,j=(0,ce.Z)(P,T),X={eventKey:T,expanded:se.indexOf(T)!==-1,selected:ae.indexOf(T)!==-1,loaded:q.indexOf(T)!==-1,loading:he.indexOf(T)!==-1,checked:ve.indexOf(T)!==-1,halfChecked:be.indexOf(T)!==-1,pos:String(j?j.pos:""),dragOver:Oe===T&&Q===0,dragOverGapTop:Oe===T&&Q===-1,dragOverGapBottom:Oe===T&&Q===1};return X}function O(T){var R=T.data,se=T.expanded,ae=T.selected,q=T.checked,he=T.loaded,ve=T.loading,be=T.halfChecked,Oe=T.dragOver,Q=T.dragOverGapTop,P=T.dragOverGapBottom,j=T.pos,X=T.active,ne=T.eventKey,J=(0,Te.Z)((0,Te.Z)({},R),{},{expanded:se,selected:ae,checked:q,loaded:he,loading:ve,halfChecked:be,dragOver:Oe,dragOverGapTop:Q,dragOverGapBottom:P,pos:j,active:X,key:ne});return"props"in J||Object.defineProperty(J,"props",{get:function(){return(0,me.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),T}}),J}},49658:function(vn,Et){"use strict";Et.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var A=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(A)||/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(A==null?void 0:A.substr(0,4))}},65283:function(vn,Et,A){"use strict";A.d(Et,{Z:function(){return nn}});var k=A(14809),pe=A(93664),Te=A(20439),fe=A(4635),$=A(50298),p=A(62646),me=A(92310),ce=A.n(me),o=A(29301),x=A(70425),D=A(34280),h=A(59301),m=A(4676),y=h.forwardRef(function(qe,Re){var we=qe.height,K=qe.offsetY,Se=qe.offsetX,Ne=qe.children,V=qe.prefixCls,I=qe.onInnerResize,F=qe.innerProps,oe=qe.rtl,w=qe.extra,C={},B={display:"flex",flexDirection:"column"};return K!==void 0&&(C={height:we,position:"relative",overflow:"hidden"},B=(0,Te.Z)((0,Te.Z)({},B),{},(0,fe.Z)((0,fe.Z)((0,fe.Z)((0,fe.Z)((0,fe.Z)({transform:"translateY(".concat(K,"px)")},oe?"marginRight":"marginLeft",-Se),"position","absolute"),"left",0),"right",0),"top",0))),h.createElement("div",{style:C},h.createElement(o.Z,{onResize:function(Z){var te=Z.offsetHeight;te&&I&&I()}},h.createElement("div",(0,k.Z)({style:B,className:ce()((0,fe.Z)({},"".concat(V,"-holder-inner"),V)),ref:Re},F),Ne,w)))});y.displayName="Filler";var S=y;function M(qe){var Re=qe.children,we=qe.setRef,K=h.useCallback(function(Se){we(Se)},[]);return h.cloneElement(Re,{ref:K})}function z(qe,Re,we,K,Se,Ne,V,I){var F=I.getKey;return qe.slice(Re,we+1).map(function(oe,w){var C=Re+w,B=V(oe,C,{style:{width:K},offsetX:Se}),W=F(oe);return h.createElement(M,{key:W,setRef:function(te){return Ne(oe,te)}},B)})}function Y(qe,Re,we,K){var Se=we-qe,Ne=Re-we,V=Math.min(Se,Ne)*2;if(K<=V){var I=Math.floor(K/2);return K%2?we+I+1:we-I}return Se>Ne?we-(K-Ne):we+(K-Se)}function L(qe,Re,we){var K=qe.length,Se=Re.length,Ne,V;if(K===0&&Se===0)return null;K<Se?(Ne=qe,V=Re):(Ne=Re,V=qe);var I={__EMPTY_ITEM__:!0};function F(Z){return Z!==void 0?we(Z):I}for(var oe=null,w=Math.abs(K-Se)!==1,C=0;C<V.length;C+=1){var B=F(Ne[C]),W=F(V[C]);if(B!==W){oe=C,w=w||B!==F(V[C+1]);break}}return oe===null?null:{index:oe,multiple:w}}function O(qe,Re,we){var K=h.useState(qe),Se=(0,$.Z)(K,2),Ne=Se[0],V=Se[1],I=h.useState(null),F=(0,$.Z)(I,2),oe=F[0],w=F[1];return h.useEffect(function(){var C=L(Ne||[],qe||[],Re);(C==null?void 0:C.index)!==void 0&&(we==null||we(C.index),w(qe[C.index])),V(qe)},[qe]),[oe]}var T=A(16089),R=(typeof navigator=="undefined"?"undefined":(0,pe.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),se=R,ae=function(qe,Re,we,K){var Se=(0,h.useRef)(!1),Ne=(0,h.useRef)(null);function V(){clearTimeout(Ne.current),Se.current=!0,Ne.current=setTimeout(function(){Se.current=!1},50)}var I=(0,h.useRef)({top:qe,bottom:Re,left:we,right:K});return I.current.top=qe,I.current.bottom=Re,I.current.left=we,I.current.right=K,function(F,oe){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,C=F?oe<0&&I.current.left||oe>0&&I.current.right:oe<0&&I.current.top||oe>0&&I.current.bottom;return w&&C?(clearTimeout(Ne.current),Se.current=!1):(!C||Se.current)&&V(),!Se.current&&C}};function q(qe,Re,we,K,Se,Ne,V){var I=(0,h.useRef)(0),F=(0,h.useRef)(null),oe=(0,h.useRef)(null),w=(0,h.useRef)(!1),C=ae(Re,we,K,Se);function B(Ce,De){if(T.Z.cancel(F.current),!C(!1,De)){var Fe=Ce;if(!Fe._virtualHandled)Fe._virtualHandled=!0;else return;I.current+=De,oe.current=De,se||Fe.preventDefault(),F.current=(0,T.Z)(function(){var Ve=w.current?10:1;V(I.current*Ve,!1),I.current=0})}}function W(Ce,De){V(De,!0),se||Ce.preventDefault()}var Z=(0,h.useRef)(null),te=(0,h.useRef)(null);function ue(Ce){if(qe){T.Z.cancel(te.current),te.current=(0,T.Z)(function(){Z.current=null},2);var De=Ce.deltaX,Fe=Ce.deltaY,Ve=Ce.shiftKey,Ge=De,$e=Fe;(Z.current==="sx"||!Z.current&&Ve&&Fe&&!De)&&(Ge=Fe,$e=0,Z.current="sx");var mt=Math.abs(Ge),xt=Math.abs($e);Z.current===null&&(Z.current=Ne&&mt>xt?"x":"y"),Z.current==="y"?B(Ce,$e):W(Ce,Ge)}}function ge(Ce){qe&&(w.current=Ce.detail===oe.current)}return[ue,ge]}function he(qe,Re,we,K){var Se=h.useMemo(function(){return[new Map,[]]},[qe,we.id,K]),Ne=(0,$.Z)(Se,2),V=Ne[0],I=Ne[1],F=function(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w,B=V.get(w),W=V.get(C);if(B===void 0||W===void 0)for(var Z=qe.length,te=I.length;te<Z;te+=1){var ue,ge=qe[te],Ce=Re(ge);V.set(Ce,te);var De=(ue=we.get(Ce))!==null&&ue!==void 0?ue:K;if(I[te]=(I[te-1]||0)+De,Ce===w&&(B=te),Ce===C&&(W=te),B!==void 0&&W!==void 0)break}return{top:I[B-1]||0,bottom:I[W]}};return F}var ve=A(99153),be=A(84851),Oe=function(){function qe(){(0,ve.Z)(this,qe),(0,fe.Z)(this,"maps",void 0),(0,fe.Z)(this,"id",0),(0,fe.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,be.Z)(qe,[{key:"set",value:function(we,K){this.diffRecords.set(we,this.maps[we]),this.maps[we]=K,this.id+=1}},{key:"get",value:function(we){return this.maps[we]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),qe}(),Q=Oe;function P(qe){var Re=parseFloat(qe);return isNaN(Re)?0:Re}function j(qe,Re,we){var K=h.useState(0),Se=(0,$.Z)(K,2),Ne=Se[0],V=Se[1],I=(0,h.useRef)(new Map),F=(0,h.useRef)(new Q),oe=(0,h.useRef)(0);function w(){oe.current+=1}function C(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;w();var Z=function(){var ge=!1;I.current.forEach(function(Ce,De){if(Ce&&Ce.offsetParent){var Fe=Ce.offsetHeight,Ve=getComputedStyle(Ce),Ge=Ve.marginTop,$e=Ve.marginBottom,mt=P(Ge),xt=P($e),St=Fe+mt+xt;F.current.get(De)!==St&&(F.current.set(De,St),ge=!0)}}),ge&&V(function(Ce){return Ce+1})};if(W)Z();else{oe.current+=1;var te=oe.current;Promise.resolve().then(function(){te===oe.current&&Z()})}}function B(W,Z){var te=qe(W),ue=I.current.get(te);Z?(I.current.set(te,Z),C()):I.current.delete(te),!ue!=!Z&&(Z?Re==null||Re(W):we==null||we(W))}return(0,h.useEffect)(function(){return w},[]),[B,C,F.current,Ne]}var X=14/15;function ne(qe,Re,we){var K=(0,h.useRef)(!1),Se=(0,h.useRef)(0),Ne=(0,h.useRef)(0),V=(0,h.useRef)(null),I=(0,h.useRef)(null),F,oe=function(W){if(K.current){var Z=Math.ceil(W.touches[0].pageX),te=Math.ceil(W.touches[0].pageY),ue=Se.current-Z,ge=Ne.current-te,Ce=Math.abs(ue)>Math.abs(ge);Ce?Se.current=Z:Ne.current=te;var De=we(Ce,Ce?ue:ge,!1,W);De&&W.preventDefault(),clearInterval(I.current),De&&(I.current=setInterval(function(){Ce?ue*=X:ge*=X;var Fe=Math.floor(Ce?ue:ge);(!we(Ce,Fe,!0)||Math.abs(Fe)<=.1)&&clearInterval(I.current)},16))}},w=function(){K.current=!1,F()},C=function(W){F(),W.touches.length===1&&!K.current&&(K.current=!0,Se.current=Math.ceil(W.touches[0].pageX),Ne.current=Math.ceil(W.touches[0].pageY),V.current=W.target,V.current.addEventListener("touchmove",oe,{passive:!1}),V.current.addEventListener("touchend",w,{passive:!0}))};F=function(){V.current&&(V.current.removeEventListener("touchmove",oe),V.current.removeEventListener("touchend",w))},(0,D.Z)(function(){return qe&&Re.current.addEventListener("touchstart",C,{passive:!0}),function(){var B;(B=Re.current)===null||B===void 0||B.removeEventListener("touchstart",C),F(),clearInterval(I.current)}},[qe])}function J(qe){return Math.floor(Math.pow(qe,.5))}function v(qe,Re){var we="touches"in qe?qe.touches[0]:qe;return we[Re?"pageX":"pageY"]-window[Re?"scrollX":"scrollY"]}function g(qe,Re,we){h.useEffect(function(){var K=Re.current;if(qe&&K){var Se=!1,Ne,V,I=function(){T.Z.cancel(Ne)},F=function B(){I(),Ne=(0,T.Z)(function(){we(V),B()})},oe=function(W){if(!(W.target.draggable||W.button!==0)){var Z=W;Z._virtualHandled||(Z._virtualHandled=!0,Se=!0)}},w=function(){Se=!1,I()},C=function(W){if(Se){var Z=v(W,!1),te=K.getBoundingClientRect(),ue=te.top,ge=te.bottom;if(Z<=ue){var Ce=ue-Z;V=-J(Ce),F()}else if(Z>=ge){var De=Z-ge;V=J(De),F()}else I()}};return K.addEventListener("mousedown",oe),K.ownerDocument.addEventListener("mouseup",w),K.ownerDocument.addEventListener("mousemove",C),function(){K.removeEventListener("mousedown",oe),K.ownerDocument.removeEventListener("mouseup",w),K.ownerDocument.removeEventListener("mousemove",C),I()}}},[qe])}var U=10;function ie(qe,Re,we,K,Se,Ne,V,I){var F=h.useRef(),oe=h.useState(null),w=(0,$.Z)(oe,2),C=w[0],B=w[1];return(0,D.Z)(function(){if(C&&C.times<U){if(!qe.current){B(function(ee){return(0,Te.Z)({},ee)});return}Ne();var W=C.targetAlign,Z=C.originAlign,te=C.index,ue=C.offset,ge=qe.current.clientHeight,Ce=!1,De=W,Fe=null;if(ge){for(var Ve=W||Z,Ge=0,$e=0,mt=0,xt=Math.min(Re.length-1,te),St=0;St<=xt;St+=1){var Lt=Se(Re[St]);$e=Ge;var Ht=we.get(Lt);mt=$e+(Ht===void 0?K:Ht),Ge=mt}for(var ut=Ve==="top"?ue:ge-ue,Ut=xt;Ut>=0;Ut-=1){var Le=Se(Re[Ut]),Ae=we.get(Le);if(Ae===void 0){Ce=!0;break}if(ut-=Ae,ut<=0)break}switch(Ve){case"top":Fe=$e-ue;break;case"bottom":Fe=mt-ge+ue;break;default:{var Ie=qe.current.scrollTop,H=Ie+ge;$e<Ie?De="top":mt>H&&(De="bottom")}}Fe!==null&&V(Fe),Fe!==C.lastTop&&(Ce=!0)}Ce&&B((0,Te.Z)((0,Te.Z)({},C),{},{times:C.times+1,targetAlign:De,lastTop:Fe}))}},[C,qe.current]),function(W){if(W==null){I();return}if(T.Z.cancel(F.current),typeof W=="number")V(W);else if(W&&(0,pe.Z)(W)==="object"){var Z,te=W.align;"index"in W?Z=W.index:Z=Re.findIndex(function(Ce){return Se(Ce)===W.key});var ue=W.offset,ge=ue===void 0?0:ue;B({times:0,index:Z,offset:ge,originAlign:te})}}}var Be=h.forwardRef(function(qe,Re){var we=qe.prefixCls,K=qe.rtl,Se=qe.scrollOffset,Ne=qe.scrollRange,V=qe.onStartMove,I=qe.onStopMove,F=qe.onScroll,oe=qe.horizontal,w=qe.spinSize,C=qe.containerSize,B=qe.style,W=qe.thumbStyle,Z=qe.showScrollBar,te=h.useState(!1),ue=(0,$.Z)(te,2),ge=ue[0],Ce=ue[1],De=h.useState(null),Fe=(0,$.Z)(De,2),Ve=Fe[0],Ge=Fe[1],$e=h.useState(null),mt=(0,$.Z)($e,2),xt=mt[0],St=mt[1],Lt=!K,Ht=h.useRef(),ut=h.useRef(),Ut=h.useState(Z),Le=(0,$.Z)(Ut,2),Ae=Le[0],Ie=Le[1],H=h.useRef(),ee=function(){Z===!0||Z===!1||(clearTimeout(H.current),Ie(!0),H.current=setTimeout(function(){Ie(!1)},3e3))},de=Ne-C||0,re=C-w||0,_e=h.useMemo(function(){if(Se===0||de===0)return 0;var wn=Se/de;return wn*re},[Se,de,re]),et=function(Gn){Gn.stopPropagation(),Gn.preventDefault()},Ye=h.useRef({top:_e,dragging:ge,pageY:Ve,startTop:xt});Ye.current={top:_e,dragging:ge,pageY:Ve,startTop:xt};var it=function(Gn){Ce(!0),Ge(v(Gn,oe)),St(Ye.current.top),V(),Gn.stopPropagation(),Gn.preventDefault()};h.useEffect(function(){var wn=function(Cn){Cn.preventDefault()},Gn=Ht.current,An=ut.current;return Gn.addEventListener("touchstart",wn,{passive:!1}),An.addEventListener("touchstart",it,{passive:!1}),function(){Gn.removeEventListener("touchstart",wn),An.removeEventListener("touchstart",it)}},[]);var Rt=h.useRef();Rt.current=de;var on=h.useRef();on.current=re,h.useEffect(function(){if(ge){var wn,Gn=function(Cn){var rn=Ye.current,Tn=rn.dragging,$n=rn.pageY,tr=rn.startTop;T.Z.cancel(wn);var Me=Ht.current.getBoundingClientRect(),Pe=C/(oe?Me.width:Me.height);if(Tn){var Tt=(v(Cn,oe)-$n)*Pe,pt=tr;!Lt&&oe?pt-=Tt:pt+=Tt;var dt=Rt.current,Zt=on.current,ze=Zt?pt/Zt:0,tt=Math.ceil(ze*dt);tt=Math.max(tt,0),tt=Math.min(tt,dt),wn=(0,T.Z)(function(){F(tt,oe)})}},An=function(){Ce(!1),I()};return window.addEventListener("mousemove",Gn,{passive:!0}),window.addEventListener("touchmove",Gn,{passive:!0}),window.addEventListener("mouseup",An,{passive:!0}),window.addEventListener("touchend",An,{passive:!0}),function(){window.removeEventListener("mousemove",Gn),window.removeEventListener("touchmove",Gn),window.removeEventListener("mouseup",An),window.removeEventListener("touchend",An),T.Z.cancel(wn)}}},[ge]),h.useEffect(function(){return ee(),function(){clearTimeout(H.current)}},[Se]),h.useImperativeHandle(Re,function(){return{delayHidden:ee}});var fn="".concat(we,"-scrollbar"),Pt={position:"absolute",visibility:Ae?null:"hidden"},jt={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return oe?(Pt.height=8,Pt.left=0,Pt.right=0,Pt.bottom=0,jt.height="100%",jt.width=w,Lt?jt.left=_e:jt.right=_e):(Pt.width=8,Pt.top=0,Pt.bottom=0,Lt?Pt.right=0:Pt.left=0,jt.width="100%",jt.height=w,jt.top=_e),h.createElement("div",{ref:Ht,className:ce()(fn,(0,fe.Z)((0,fe.Z)((0,fe.Z)({},"".concat(fn,"-horizontal"),oe),"".concat(fn,"-vertical"),!oe),"".concat(fn,"-visible"),Ae)),style:(0,Te.Z)((0,Te.Z)({},Pt),B),onMouseDown:et,onMouseMove:ee},h.createElement("div",{ref:ut,className:ce()("".concat(fn,"-thumb"),(0,fe.Z)({},"".concat(fn,"-thumb-moving"),ge)),style:(0,Te.Z)((0,Te.Z)({},jt),W),onMouseDown:it}))}),Ze=Be,Qe=20;function nt(){var qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,we=qe/Re*qe;return isNaN(we)&&(we=0),we=Math.max(we,Qe),Math.floor(we)}var At=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],_t=[],xe={overflowY:"auto",overflowAnchor:"none"};function vt(qe,Re){var we=qe.prefixCls,K=we===void 0?"rc-virtual-list":we,Se=qe.className,Ne=qe.height,V=qe.itemHeight,I=qe.fullHeight,F=I===void 0?!0:I,oe=qe.style,w=qe.data,C=qe.children,B=qe.itemKey,W=qe.virtual,Z=qe.direction,te=qe.scrollWidth,ue=qe.component,ge=ue===void 0?"div":ue,Ce=qe.onScroll,De=qe.onVirtualScroll,Fe=qe.onVisibleChange,Ve=qe.innerProps,Ge=qe.extraRender,$e=qe.styles,mt=qe.showScrollBar,xt=mt===void 0?"optional":mt,St=(0,p.Z)(qe,At),Lt=h.useCallback(function(Dt){return typeof B=="function"?B(Dt):Dt==null?void 0:Dt[B]},[B]),Ht=j(Lt,null,null),ut=(0,$.Z)(Ht,4),Ut=ut[0],Le=ut[1],Ae=ut[2],Ie=ut[3],H=!!(W!==!1&&Ne&&V),ee=h.useMemo(function(){return Object.values(Ae.maps).reduce(function(Dt,bt){return Dt+bt},0)},[Ae.id,Ae.maps]),de=H&&w&&(Math.max(V*w.length,ee)>Ne||!!te),re=Z==="rtl",_e=ce()(K,(0,fe.Z)({},"".concat(K,"-rtl"),re),Se),et=w||_t,Ye=(0,h.useRef)(),it=(0,h.useRef)(),Rt=(0,h.useRef)(),on=(0,h.useState)(0),fn=(0,$.Z)(on,2),Pt=fn[0],jt=fn[1],wn=(0,h.useState)(0),Gn=(0,$.Z)(wn,2),An=Gn[0],Mn=Gn[1],Cn=(0,h.useState)(!1),rn=(0,$.Z)(Cn,2),Tn=rn[0],$n=rn[1],tr=function(){$n(!0)},Me=function(){$n(!1)},Pe={getKey:Lt};function Tt(Dt){jt(function(bt){var Qt;typeof Dt=="function"?Qt=Dt(bt):Qt=Dt;var Yt=pn(Qt);return Ye.current.scrollTop=Yt,Yt})}var pt=(0,h.useRef)({start:0,end:et.length}),dt=(0,h.useRef)(),Zt=O(et,Lt),ze=(0,$.Z)(Zt,1),tt=ze[0];dt.current=tt;var ot=h.useMemo(function(){if(!H)return{scrollHeight:void 0,start:0,end:et.length-1,offset:void 0};if(!de){var Dt;return{scrollHeight:((Dt=it.current)===null||Dt===void 0?void 0:Dt.offsetHeight)||0,start:0,end:et.length-1,offset:void 0}}for(var bt=0,Qt,Yt,mn,Yn=et.length,er=0;er<Yn;er+=1){var en=et[er],xn=Lt(en),Pn=Ae.get(xn),kn=bt+(Pn===void 0?V:Pn);kn>=Pt&&Qt===void 0&&(Qt=er,Yt=bt),kn>Pt+Ne&&mn===void 0&&(mn=er),bt=kn}return Qt===void 0&&(Qt=0,Yt=0,mn=Math.ceil(Ne/V)),mn===void 0&&(mn=et.length-1),mn=Math.min(mn+1,et.length-1),{scrollHeight:bt,start:Qt,end:mn,offset:Yt}},[de,H,Pt,et,Ie,Ne]),It=ot.scrollHeight,Ft=ot.start,Xt=ot.end,Bt=ot.offset;pt.current.start=Ft,pt.current.end=Xt,h.useLayoutEffect(function(){var Dt=Ae.getRecord();if(Dt.size===1){var bt=Array.from(Dt.keys())[0],Qt=Dt.get(bt),Yt=et[Ft];if(Yt&&Qt===void 0){var mn=Lt(Yt);if(mn===bt){var Yn=Ae.get(bt),er=Yn-V;Tt(function(en){return en+er})}}}Ae.resetRecord()},[It]);var yt=h.useState({width:0,height:Ne}),ye=(0,$.Z)(yt,2),Ue=ye[0],He=ye[1],je=function(bt){He({width:bt.offsetWidth,height:bt.offsetHeight})},at=(0,h.useRef)(),ct=(0,h.useRef)(),lt=h.useMemo(function(){return nt(Ue.width,te)},[Ue.width,te]),wt=h.useMemo(function(){return nt(Ue.height,It)},[Ue.height,It]),Ot=It-Ne,$t=(0,h.useRef)(Ot);$t.current=Ot;function pn(Dt){var bt=Dt;return Number.isNaN($t.current)||(bt=Math.min(bt,$t.current)),bt=Math.max(bt,0),bt}var kt=Pt<=0,_n=Pt>=Ot,sn=An<=0,un=An>=te,Nt=ae(kt,_n,sn,un),Mt=function(){return{x:re?-An:An,y:Pt}},qt=(0,h.useRef)(Mt()),cn=(0,x.zX)(function(Dt){if(De){var bt=(0,Te.Z)((0,Te.Z)({},Mt()),Dt);(qt.current.x!==bt.x||qt.current.y!==bt.y)&&(De(bt),qt.current=bt)}});function ln(Dt,bt){var Qt=Dt;bt?((0,m.flushSync)(function(){Mn(Qt)}),cn()):Tt(Qt)}function an(Dt){var bt=Dt.currentTarget.scrollTop;bt!==Pt&&Tt(bt),Ce==null||Ce(Dt),cn()}var yn=function(bt){var Qt=bt,Yt=te?te-Ue.width:0;return Qt=Math.max(Qt,0),Qt=Math.min(Qt,Yt),Qt},Vt=(0,x.zX)(function(Dt,bt){bt?((0,m.flushSync)(function(){Mn(function(Qt){var Yt=Qt+(re?-Dt:Dt);return yn(Yt)})}),cn()):Tt(function(Qt){var Yt=Qt+Dt;return Yt})}),Wt=q(H,kt,_n,sn,un,!!te,Vt),Jn=(0,$.Z)(Wt,2),Wn=Jn[0],Bn=Jn[1];ne(H,Ye,function(Dt,bt,Qt,Yt){var mn=Yt;return Nt(Dt,bt,Qt)?!1:!mn||!mn._virtualHandled?(mn&&(mn._virtualHandled=!0),Wn({preventDefault:function(){},deltaX:Dt?bt:0,deltaY:Dt?0:bt}),!0):!1}),g(de,Ye,function(Dt){Tt(function(bt){return bt+Dt})}),(0,D.Z)(function(){function Dt(Qt){var Yt=kt&&Qt.detail<0,mn=_n&&Qt.detail>0;H&&!Yt&&!mn&&Qt.preventDefault()}var bt=Ye.current;return bt.addEventListener("wheel",Wn,{passive:!1}),bt.addEventListener("DOMMouseScroll",Bn,{passive:!0}),bt.addEventListener("MozMousePixelScroll",Dt,{passive:!1}),function(){bt.removeEventListener("wheel",Wn),bt.removeEventListener("DOMMouseScroll",Bn),bt.removeEventListener("MozMousePixelScroll",Dt)}},[H,kt,_n]),(0,D.Z)(function(){if(te){var Dt=yn(An);Mn(Dt),cn({x:Dt})}},[Ue.width,te]);var Hn=function(){var bt,Qt;(bt=at.current)===null||bt===void 0||bt.delayHidden(),(Qt=ct.current)===null||Qt===void 0||Qt.delayHidden()},qn=ie(Ye,et,Ae,V,Lt,function(){return Le(!0)},Tt,Hn);h.useImperativeHandle(Re,function(){return{nativeElement:Rt.current,getScrollInfo:Mt,scrollTo:function(bt){function Qt(Yt){return Yt&&(0,pe.Z)(Yt)==="object"&&("left"in Yt||"top"in Yt)}Qt(bt)?(bt.left!==void 0&&Mn(yn(bt.left)),qn(bt.top)):qn(bt)}}}),(0,D.Z)(function(){if(Fe){var Dt=et.slice(Ft,Xt+1);Fe(Dt,et)}},[Ft,Xt,et]);var Vn=he(et,Lt,Ae,V),mr=Ge==null?void 0:Ge({start:Ft,end:Xt,virtual:de,offsetX:An,offsetY:Bt,rtl:re,getSize:Vn}),nr=z(et,Ft,Xt,te,An,Ut,C,Pe),ar=null;Ne&&(ar=(0,Te.Z)((0,fe.Z)({},F?"height":"maxHeight",Ne),xe),H&&(ar.overflowY="hidden",te&&(ar.overflowX="hidden"),Tn&&(ar.pointerEvents="none")));var En={};return re&&(En.dir="rtl"),h.createElement("div",(0,k.Z)({ref:Rt,style:(0,Te.Z)((0,Te.Z)({},oe),{},{position:"relative"}),className:_e},En,St),h.createElement(o.Z,{onResize:je},h.createElement(ge,{className:"".concat(K,"-holder"),style:ar,ref:Ye,onScroll:an,onMouseEnter:Hn},h.createElement(S,{prefixCls:K,height:It,offsetX:An,offsetY:Bt,scrollWidth:te,onInnerResize:Le,ref:it,innerProps:Ve,rtl:re,extra:mr},nr))),de&&It>Ne&&h.createElement(Ze,{ref:at,prefixCls:K,scrollOffset:Pt,scrollRange:It,rtl:re,onScroll:ln,onStartMove:tr,onStopMove:Me,spinSize:wt,containerSize:Ue.height,style:$e==null?void 0:$e.verticalScrollBar,thumbStyle:$e==null?void 0:$e.verticalScrollBarThumb,showScrollBar:xt}),de&&te>Ue.width&&h.createElement(Ze,{ref:ct,prefixCls:K,scrollOffset:An,scrollRange:te,rtl:re,onScroll:ln,onStartMove:tr,onStopMove:Me,spinSize:lt,containerSize:Ue.width,horizontal:!0,style:$e==null?void 0:$e.horizontalScrollBar,thumbStyle:$e==null?void 0:$e.horizontalScrollBarThumb,showScrollBar:xt}))}var zt=h.forwardRef(vt);zt.displayName="List";var Ct=zt,nn=Ct},83145:function(vn,Et,A){"use strict";Object.defineProperty(Et,"__esModule",{value:!0}),Et.CopyToClipboard=void 0;var k=Te(A(59301)),pe=Te(A(25769));function Te(L){return L&&L.__esModule?L:{default:L}}function fe(L){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(T){return typeof T}:fe=function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},fe(L)}function $(L,O){var T=Object.keys(L);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(L);O&&(R=R.filter(function(se){return Object.getOwnPropertyDescriptor(L,se).enumerable})),T.push.apply(T,R)}return T}function p(L){for(var O=1;O<arguments.length;O++){var T=arguments[O]!=null?arguments[O]:{};O%2?$(T,!0).forEach(function(R){z(L,R,T[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(L,Object.getOwnPropertyDescriptors(T)):$(T).forEach(function(R){Object.defineProperty(L,R,Object.getOwnPropertyDescriptor(T,R))})}return L}function me(L,O){if(L==null)return{};var T=ce(L,O),R,se;if(Object.getOwnPropertySymbols){var ae=Object.getOwnPropertySymbols(L);for(se=0;se<ae.length;se++)R=ae[se],!(O.indexOf(R)>=0)&&Object.prototype.propertyIsEnumerable.call(L,R)&&(T[R]=L[R])}return T}function ce(L,O){if(L==null)return{};var T={},R=Object.keys(L),se,ae;for(ae=0;ae<R.length;ae++)se=R[ae],!(O.indexOf(se)>=0)&&(T[se]=L[se]);return T}function o(L,O){if(!(L instanceof O))throw new TypeError("Cannot call a class as a function")}function x(L,O){for(var T=0;T<O.length;T++){var R=O[T];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(L,R.key,R)}}function D(L,O,T){return O&&x(L.prototype,O),T&&x(L,T),L}function h(L,O){return O&&(fe(O)==="object"||typeof O=="function")?O:y(L)}function m(L){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},m(L)}function y(L){if(L===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L}function S(L,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");L.prototype=Object.create(O&&O.prototype,{constructor:{value:L,writable:!0,configurable:!0}}),O&&M(L,O)}function M(L,O){return M=Object.setPrototypeOf||function(R,se){return R.__proto__=se,R},M(L,O)}function z(L,O,T){return O in L?Object.defineProperty(L,O,{value:T,enumerable:!0,configurable:!0,writable:!0}):L[O]=T,L}var Y=function(L){S(O,L);function O(){var T,R;o(this,O);for(var se=arguments.length,ae=new Array(se),q=0;q<se;q++)ae[q]=arguments[q];return R=h(this,(T=m(O)).call.apply(T,[this].concat(ae))),z(y(R),"onClick",function(he){var ve=R.props,be=ve.text,Oe=ve.onCopy,Q=ve.children,P=ve.options,j=k.default.Children.only(Q),X=(0,pe.default)(be,P);Oe&&Oe(be,X),j&&j.props&&typeof j.props.onClick=="function"&&j.props.onClick(he)}),R}return D(O,[{key:"render",value:function(){var R=this.props,se=R.text,ae=R.onCopy,q=R.options,he=R.children,ve=me(R,["text","onCopy","options","children"]),be=k.default.Children.only(he);return k.default.cloneElement(be,p({},ve,{onClick:this.onClick}))}}]),O}(k.default.PureComponent);Et.CopyToClipboard=Y,z(Y,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(vn,Et,A){"use strict";var k=A(83145),pe=k.CopyToClipboard;pe.CopyToClipboard=pe,vn.exports=pe},76374:function(vn,Et,A){"use strict";var k=function(){if(typeof Map!="undefined")return Map;function Q(P,j){var X=-1;return P.some(function(ne,J){return ne[0]===j?(X=J,!0):!1}),X}return function(){function P(){this.__entries__=[]}return Object.defineProperty(P.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),P.prototype.get=function(j){var X=Q(this.__entries__,j),ne=this.__entries__[X];return ne&&ne[1]},P.prototype.set=function(j,X){var ne=Q(this.__entries__,j);~ne?this.__entries__[ne][1]=X:this.__entries__.push([j,X])},P.prototype.delete=function(j){var X=this.__entries__,ne=Q(X,j);~ne&&X.splice(ne,1)},P.prototype.has=function(j){return!!~Q(this.__entries__,j)},P.prototype.clear=function(){this.__entries__.splice(0)},P.prototype.forEach=function(j,X){X===void 0&&(X=null);for(var ne=0,J=this.__entries__;ne<J.length;ne++){var v=J[ne];j.call(X,v[1],v[0])}},P}()}(),pe=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,Te=function(){return typeof A.g!="undefined"&&A.g.Math===Math?A.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),fe=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Te):function(Q){return setTimeout(function(){return Q(Date.now())},1e3/60)}}(),$=2;function p(Q,P){var j=!1,X=!1,ne=0;function J(){j&&(j=!1,Q()),X&&g()}function v(){fe(J)}function g(){var U=Date.now();if(j){if(U-ne<$)return;X=!0}else j=!0,X=!1,setTimeout(v,P);ne=U}return g}var me=20,ce=["top","right","bottom","left","width","height","size","weight"],o=typeof MutationObserver!="undefined",x=function(){function Q(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=p(this.refresh.bind(this),me)}return Q.prototype.addObserver=function(P){~this.observers_.indexOf(P)||this.observers_.push(P),this.connected_||this.connect_()},Q.prototype.removeObserver=function(P){var j=this.observers_,X=j.indexOf(P);~X&&j.splice(X,1),!j.length&&this.connected_&&this.disconnect_()},Q.prototype.refresh=function(){var P=this.updateObservers_();P&&this.refresh()},Q.prototype.updateObservers_=function(){var P=this.observers_.filter(function(j){return j.gatherActive(),j.hasActive()});return P.forEach(function(j){return j.broadcastActive()}),P.length>0},Q.prototype.connect_=function(){!pe||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),o?(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)},Q.prototype.disconnect_=function(){!pe||!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)},Q.prototype.onTransitionEnd_=function(P){var j=P.propertyName,X=j===void 0?"":j,ne=ce.some(function(J){return!!~X.indexOf(J)});ne&&this.refresh()},Q.getInstance=function(){return this.instance_||(this.instance_=new Q),this.instance_},Q.instance_=null,Q}(),D=function(Q,P){for(var j=0,X=Object.keys(P);j<X.length;j++){var ne=X[j];Object.defineProperty(Q,ne,{value:P[ne],enumerable:!1,writable:!1,configurable:!0})}return Q},h=function(Q){var P=Q&&Q.ownerDocument&&Q.ownerDocument.defaultView;return P||Te},m=se(0,0,0,0);function y(Q){return parseFloat(Q)||0}function S(Q){for(var P=[],j=1;j<arguments.length;j++)P[j-1]=arguments[j];return P.reduce(function(X,ne){var J=Q["border-"+ne+"-width"];return X+y(J)},0)}function M(Q){for(var P=["top","right","bottom","left"],j={},X=0,ne=P;X<ne.length;X++){var J=ne[X],v=Q["padding-"+J];j[J]=y(v)}return j}function z(Q){var P=Q.getBBox();return se(0,0,P.width,P.height)}function Y(Q){var P=Q.clientWidth,j=Q.clientHeight;if(!P&&!j)return m;var X=h(Q).getComputedStyle(Q),ne=M(X),J=ne.left+ne.right,v=ne.top+ne.bottom,g=y(X.width),U=y(X.height);if(X.boxSizing==="border-box"&&(Math.round(g+J)!==P&&(g-=S(X,"left","right")+J),Math.round(U+v)!==j&&(U-=S(X,"top","bottom")+v)),!O(Q)){var ie=Math.round(g+J)-P,Be=Math.round(U+v)-j;Math.abs(ie)!==1&&(g-=ie),Math.abs(Be)!==1&&(U-=Be)}return se(ne.left,ne.top,g,U)}var L=function(){return typeof SVGGraphicsElement!="undefined"?function(Q){return Q instanceof h(Q).SVGGraphicsElement}:function(Q){return Q instanceof h(Q).SVGElement&&typeof Q.getBBox=="function"}}();function O(Q){return Q===h(Q).document.documentElement}function T(Q){return pe?L(Q)?z(Q):Y(Q):m}function R(Q){var P=Q.x,j=Q.y,X=Q.width,ne=Q.height,J=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,v=Object.create(J.prototype);return D(v,{x:P,y:j,width:X,height:ne,top:j,right:P+X,bottom:ne+j,left:P}),v}function se(Q,P,j,X){return{x:Q,y:P,width:j,height:X}}var ae=function(){function Q(P){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=se(0,0,0,0),this.target=P}return Q.prototype.isActive=function(){var P=T(this.target);return this.contentRect_=P,P.width!==this.broadcastWidth||P.height!==this.broadcastHeight},Q.prototype.broadcastRect=function(){var P=this.contentRect_;return this.broadcastWidth=P.width,this.broadcastHeight=P.height,P},Q}(),q=function(){function Q(P,j){var X=R(j);D(this,{target:P,contentRect:X})}return Q}(),he=function(){function Q(P,j,X){if(this.activeObservations_=[],this.observations_=new k,typeof P!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=P,this.controller_=j,this.callbackCtx_=X}return Q.prototype.observe=function(P){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(P instanceof h(P).Element))throw new TypeError('parameter 1 is not of type "Element".');var j=this.observations_;j.has(P)||(j.set(P,new ae(P)),this.controller_.addObserver(this),this.controller_.refresh())}},Q.prototype.unobserve=function(P){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(P instanceof h(P).Element))throw new TypeError('parameter 1 is not of type "Element".');var j=this.observations_;j.has(P)&&(j.delete(P),j.size||this.controller_.removeObserver(this))}},Q.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},Q.prototype.gatherActive=function(){var P=this;this.clearActive(),this.observations_.forEach(function(j){j.isActive()&&P.activeObservations_.push(j)})},Q.prototype.broadcastActive=function(){if(this.hasActive()){var P=this.callbackCtx_,j=this.activeObservations_.map(function(X){return new q(X.target,X.broadcastRect())});this.callback_.call(P,j,P),this.clearActive()}},Q.prototype.clearActive=function(){this.activeObservations_.splice(0)},Q.prototype.hasActive=function(){return this.activeObservations_.length>0},Q}(),ve=typeof WeakMap!="undefined"?new WeakMap:new k,be=function(){function Q(P){if(!(this instanceof Q))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var j=x.getInstance(),X=new he(P,j,this);ve.set(this,X)}return Q}();["observe","unobserve","disconnect"].forEach(function(Q){be.prototype[Q]=function(){var P;return(P=ve.get(this))[Q].apply(P,arguments)}});var Oe=function(){return typeof Te.ResizeObserver!="undefined"?Te.ResizeObserver:be}();Et.Z=Oe},98040:function(vn){vn.exports=function(){var Et=document.getSelection();if(!Et.rangeCount)return function(){};for(var A=document.activeElement,k=[],pe=0;pe<Et.rangeCount;pe++)k.push(Et.getRangeAt(pe));switch(A.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":A.blur();break;default:A=null;break}return Et.removeAllRanges(),function(){Et.type==="Caret"&&Et.removeAllRanges(),Et.rangeCount||k.forEach(function(Te){Et.addRange(Te)}),A&&A.focus()}}},93314:function(vn){"use strict";vn.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=="},37530:function(vn,Et,A){"use strict";A.d(Et,{Z:function(){return pe}});var k=A(58750);function pe(Te,fe){var $=typeof Symbol!="undefined"&&Te[Symbol.iterator]||Te["@@iterator"];if(!$){if(Array.isArray(Te)||($=(0,k.Z)(Te))||fe&&Te&&typeof Te.length=="number"){$&&(Te=$);var p=0,me=function(){};return{s:me,n:function(){return p>=Te.length?{done:!0}:{done:!1,value:Te[p++]}},e:function(h){throw h},f:me}}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 ce,o=!0,x=!1;return{s:function(){$=$.call(Te)},n:function(){var h=$.next();return o=h.done,h},e:function(h){x=!0,ce=h},f:function(){try{o||$.return==null||$.return()}finally{if(x)throw ce}}}}},15360:function(vn,Et,A){"use strict";A.d(Et,{ZP:function(){return Ki}});const k=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},pe=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=Te},Te=Number.MAX_SAFE_INTEGER||9007199254740991;let fe=function(a){return a.NETWORK_ERROR="networkError",a.MEDIA_ERROR="mediaError",a.KEY_SYSTEM_ERROR="keySystemError",a.MUX_ERROR="muxError",a.OTHER_ERROR="otherError",a}({}),$=function(a){return a.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",a.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",a.KEY_SYSTEM_NO_SESSION="keySystemNoSession",a.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",a.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",a.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",a.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",a.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",a.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",a.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",a.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",a.MANIFEST_LOAD_ERROR="manifestLoadError",a.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",a.MANIFEST_PARSING_ERROR="manifestParsingError",a.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",a.LEVEL_EMPTY_ERROR="levelEmptyError",a.LEVEL_LOAD_ERROR="levelLoadError",a.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",a.LEVEL_PARSING_ERROR="levelParsingError",a.LEVEL_SWITCH_ERROR="levelSwitchError",a.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",a.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",a.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",a.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",a.FRAG_LOAD_ERROR="fragLoadError",a.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",a.FRAG_DECRYPT_ERROR="fragDecryptError",a.FRAG_PARSING_ERROR="fragParsingError",a.FRAG_GAP="fragGap",a.REMUX_ALLOC_ERROR="remuxAllocError",a.KEY_LOAD_ERROR="keyLoadError",a.KEY_LOAD_TIMEOUT="keyLoadTimeOut",a.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",a.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",a.BUFFER_APPEND_ERROR="bufferAppendError",a.BUFFER_APPENDING_ERROR="bufferAppendingError",a.BUFFER_STALLED_ERROR="bufferStalledError",a.BUFFER_FULL_ERROR="bufferFullError",a.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",a.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",a.ASSET_LIST_LOAD_ERROR="assetListLoadError",a.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",a.ASSET_LIST_PARSING_ERROR="assetListParsingError",a.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",a.INTERNAL_EXCEPTION="internalException",a.INTERNAL_ABORTED="aborted",a.ATTACH_MEDIA_ERROR="attachMediaError",a.UNKNOWN="unknown",a}({}),p=function(a){return a.MEDIA_ATTACHING="hlsMediaAttaching",a.MEDIA_ATTACHED="hlsMediaAttached",a.MEDIA_DETACHING="hlsMediaDetaching",a.MEDIA_DETACHED="hlsMediaDetached",a.MEDIA_ENDED="hlsMediaEnded",a.STALL_RESOLVED="hlsStallResolved",a.BUFFER_RESET="hlsBufferReset",a.BUFFER_CODECS="hlsBufferCodecs",a.BUFFER_CREATED="hlsBufferCreated",a.BUFFER_APPENDING="hlsBufferAppending",a.BUFFER_APPENDED="hlsBufferAppended",a.BUFFER_EOS="hlsBufferEos",a.BUFFERED_TO_END="hlsBufferedToEnd",a.BUFFER_FLUSHING="hlsBufferFlushing",a.BUFFER_FLUSHED="hlsBufferFlushed",a.MANIFEST_LOADING="hlsManifestLoading",a.MANIFEST_LOADED="hlsManifestLoaded",a.MANIFEST_PARSED="hlsManifestParsed",a.LEVEL_SWITCHING="hlsLevelSwitching",a.LEVEL_SWITCHED="hlsLevelSwitched",a.LEVEL_LOADING="hlsLevelLoading",a.LEVEL_LOADED="hlsLevelLoaded",a.LEVEL_UPDATED="hlsLevelUpdated",a.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",a.LEVELS_UPDATED="hlsLevelsUpdated",a.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",a.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",a.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",a.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",a.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",a.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",a.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",a.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",a.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",a.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",a.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",a.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",a.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",a.CUES_PARSED="hlsCuesParsed",a.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",a.INIT_PTS_FOUND="hlsInitPtsFound",a.FRAG_LOADING="hlsFragLoading",a.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",a.FRAG_LOADED="hlsFragLoaded",a.FRAG_DECRYPTED="hlsFragDecrypted",a.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",a.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",a.FRAG_PARSING_METADATA="hlsFragParsingMetadata",a.FRAG_PARSED="hlsFragParsed",a.FRAG_BUFFERED="hlsFragBuffered",a.FRAG_CHANGED="hlsFragChanged",a.FPS_DROP="hlsFpsDrop",a.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",a.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",a.ERROR="hlsError",a.DESTROYING="hlsDestroying",a.KEY_LOADING="hlsKeyLoading",a.KEY_LOADED="hlsKeyLoaded",a.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",a.BACK_BUFFER_REACHED="hlsBackBufferReached",a.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",a.ASSET_LIST_LOADING="hlsAssetListLoading",a.ASSET_LIST_LOADED="hlsAssetListLoaded",a.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",a.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",a.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",a.INTERSTITIAL_STARTED="hlsInterstitialStarted",a.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",a.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",a.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",a.INTERSTITIAL_ENDED="hlsInterstitialEnded",a.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",a.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",a.EVENT_CUE_ENTER="hlsEventCueEnter",a}({});var me={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},ce={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class o{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class x{constructor(e,t,n,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new o(e),this.fast_=new o(t),this.defaultTTFB_=r,this.ttfb_=new o(e)}update(e,t){const{slow_:n,fast_:r,ttfb_:i}=this;n.halfLife!==e&&(this.slow_=new o(e,n.getEstimate(),n.getTotalWeight())),r.halfLife!==t&&(this.fast_=new o(t,r.getEstimate(),r.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new o(e,i.getEstimate(),i.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,r=e/1e3,i=n/r;this.fast_.sample(r,i),this.slow_.sample(r,i)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function D(a,e,t){return(e=M(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function h(){return h=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},h.apply(null,arguments)}function m(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),t.push.apply(t,n)}return t}function y(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?m(Object(t),!0).forEach(function(n){D(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function S(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function M(a){var e=S(a,"string");return typeof e=="symbol"?e:e+""}class z{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const n=`[${e}]:`;this.trace=Y,this.debug=t.debug.bind(null,n),this.log=t.log.bind(null,n),this.warn=t.warn.bind(null,n),this.info=t.info.bind(null,n),this.error=t.error.bind(null,n)}}const Y=function(){},L={trace:Y,debug:Y,log:Y,warn:Y,info:Y,error:Y};function O(){return h({},L)}function T(a,e){const t=self.console[a];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${a}] >`):Y}function R(a,e,t){return e[a]?e[a].bind(e):T(a,t)}const se=O();function ae(a,e,t){const n=O();if(typeof console=="object"&&a===!0||typeof a=="object"){const r=["debug","log","info","warn","error"];r.forEach(i=>{n[i]=R(i,a,t)});try{n.log(`Debug logs enabled for "${e}" in hls.js version 1.6.5`)}catch(i){return O()}r.forEach(i=>{se[i]=R(i,a)})}else h(se,n);return n}const q=se;function he(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function ve(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}function be(a,e){const t=Object.keys(a),n=Object.keys(e),r=t.length,i=n.length;return!r||!i||r===i&&!t.some(s=>n.indexOf(s)===-1)}function Oe(a,e=!1){if(typeof TextDecoder!="undefined"){const u=new TextDecoder("utf-8").decode(a);if(e){const f=u.indexOf("\0");return f!==-1?u.substring(0,f):u}return u.replace(/\0/g,"")}const t=a.length;let n,r,i,s="",l=0;for(;l<t;){if(n=a[l++],n===0&&e)return s;if(n===0||n===3)continue;switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(n);break;case 12:case 13:r=a[l++],s+=String.fromCharCode((n&31)<<6|r&63);break;case 14:r=a[l++],i=a[l++],s+=String.fromCharCode((n&15)<<12|(r&63)<<6|(i&63)<<0);break}}return s}const Q={hexDump:function(a){let e="";for(let t=0;t<a.length;t++){let n=a[t].toString(16);n.length<2&&(n="0"+n),e+=n}return e}};function P(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var j={exports:{}},X;function ne(){return X||(X=1,function(a,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,l={buildAbsoluteURL:function(c,u,f){if(f=f||{},c=c.trim(),u=u.trim(),!u){if(!f.alwaysNormalize)return c;var d=l.parseURL(c);if(!d)throw new Error("Error trying to parse base URL.");return d.path=l.normalizePath(d.path),l.buildURLFromParts(d)}var _=l.parseURL(u);if(!_)throw new Error("Error trying to parse relative URL.");if(_.scheme)return f.alwaysNormalize?(_.path=l.normalizePath(_.path),l.buildURLFromParts(_)):u;var b=l.parseURL(c);if(!b)throw new Error("Error trying to parse base URL.");if(!b.netLoc&&b.path&&b.path[0]!=="/"){var E=r.exec(b.path);b.netLoc=E[1],b.path=E[2]}b.netLoc&&!b.path&&(b.path="/");var G={scheme:b.scheme,netLoc:_.netLoc,path:null,params:_.params,query:_.query,fragment:_.fragment};if(!_.netLoc&&(G.netLoc=b.netLoc,_.path[0]!=="/"))if(!_.path)G.path=b.path,_.params||(G.params=b.params,_.query||(G.query=b.query));else{var N=b.path,le=N.substring(0,N.lastIndexOf("/")+1)+_.path;G.path=l.normalizePath(le)}return G.path===null&&(G.path=f.alwaysNormalize?l.normalizePath(_.path):_.path),l.buildURLFromParts(G)},parseURL:function(c){var u=n.exec(c);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(i,"");c.length!==(c=c.replace(s,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};a.exports=l})()}(j)),j.exports}var J=ne();class v{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 g={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class U{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e=="string"&&(e={url:e}),this.base=e,nt(this,"stats")}setByteRange(e,t){const n=e.split("@",2);let r;n.length===1?r=(t==null?void 0:t.byteRangeEndOffset)||0:r=parseInt(n[1]),this._byteRange=[r,parseInt(n[0])+r]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[g.AUDIO]:null,[g.VIDEO]:null,[g.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 v),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=J.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[g.AUDIO]=null,e[g.VIDEO]=null,e[g.AUDIOVIDEO]=null}}function ie(a){return a.sn!=="initSegment"}class Be extends U{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange){const e=this.byteRange[0],t=this.byteRange[1];if(k(e)&&k(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const n=Object.keys(this.levelkeys);if(n.length===1)return this._decryptdata=this.levelkeys[n[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=k(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),n=t.length;if(n>1||n===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!k(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return ie(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,r,i,s=!1){const{elementaryStreams:l}=this,c=l[e];if(!c){l[e]={startPTS:t,endPTS:n,startDTS:r,endDTS:i,partial:s};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,n),c.startDTS=Math.min(c.startDTS,r),c.endDTS=Math.max(c.endDTS,i)}}class Ze extends U{constructor(e,t,n,r,i){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=r;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,i),i&&(this.fragOffset=i.fragOffset+i.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 Qe(a,e){const t=Object.getPrototypeOf(a);if(t){const n=Object.getOwnPropertyDescriptor(t,e);return n||Qe(t,e)}}function nt(a,e){const t=Qe(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const At=Math.pow(2,32)-1,_t=[].push,xe={video:1,audio:2,id3:3,text:4};function vt(a){return String.fromCharCode.apply(null,a)}function zt(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function Ct(a,e){const t=qe(a,e);return t<0?4294967296+t:t}function nn(a,e){let t=Ct(a,e);return t*=Math.pow(2,32),t+=Ct(a,e+4),t}function qe(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function Re(a,e,t){a[e]=t>>24,a[e+1]=t>>16&255,a[e+2]=t>>8&255,a[e+3]=t&255}function we(a){const e=a.byteLength;for(let t=0;t<e;){const n=Ct(a,t);if(n>8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=n>1?t+n:e}return!1}function K(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let r=0;r<n;){const i=Ct(a,r),s=vt(a.subarray(r+4,r+8)),l=i>1?r+i:n;if(s===e[0])if(e.length===1)t.push(a.subarray(r+8,l));else{const c=K(a.subarray(r+8,l),e.slice(1));c.length&&_t.apply(t,c)}r=l}return t}function Se(a){const e=[],t=a[0];let n=8;const r=Ct(a,n);n+=4;let i=0,s=0;t===0?(i=Ct(a,n),s=Ct(a,n+4),n+=8):(i=nn(a,n),s=nn(a,n+8),n+=16),n+=2;let l=a.length+s;const c=zt(a,n);n+=2;for(let u=0;u<c;u++){let f=n;const d=Ct(a,f);f+=4;const _=d&2147483647;if((d&2147483648)>>>31===1)return q.warn("SIDX has hierarchical references (not supported)"),null;const E=Ct(a,f);f+=4,e.push({referenceSize:_,subsegmentDuration:E,info:{duration:E/r,start:l,end:l+_-1}}),l+=_,f+=4,n=f}return{earliestPresentationTime:i,timescale:r,version:t,referencesCount:c,references:e}}function Ne(a){const e=[],t=K(a,["moov","trak"]);for(let r=0;r<t.length;r++){const i=t[r],s=K(i,["tkhd"])[0];if(s){let l=s[0];const c=Ct(s,l===0?12:20),u=K(i,["mdia","mdhd"])[0];if(u){l=u[0];const f=Ct(u,l===0?12:20),d=K(i,["mdia","hdlr"])[0];if(d){const _=vt(d.subarray(8,12)),b={soun:g.AUDIO,vide:g.VIDEO}[_],E=K(i,["mdia","minf","stbl","stsd"])[0],G=V(E);b?(e[c]={timescale:f,type:b,stsd:G},e[b]=y({timescale:f,id:c},G)):e[c]={timescale:f,type:_,stsd:G}}}}}return K(a,["moov","mvex","trex"]).forEach(r=>{const i=Ct(r,4),s=e[i];s&&(s.default={duration:Ct(r,12),flags:Ct(r,20)})}),e}function V(a){const e=a.subarray(8),t=e.subarray(86),n=vt(e.subarray(4,8));let r=n,i;const s=n==="enca"||n==="encv";if(s){const u=K(e,[n])[0].subarray(n==="enca"?28:78);K(u,["sinf"]).forEach(d=>{const _=K(d,["schm"])[0];if(_){const b=vt(_.subarray(4,8));if(b==="cbcs"||b==="cenc"){const E=K(d,["frma"])[0];E&&(r=vt(E))}}})}const l=r;switch(r){case"avc1":case"avc2":case"avc3":case"avc4":{const c=K(t,["avcC"])[0];c&&c.length>3&&(r+="."+w(c[1])+w(c[2])+w(c[3]),i=I(l==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=K(e,[n])[0],u=K(c.subarray(28),["esds"])[0];if(u&&u.length>7){let f=4;if(u[f++]!==3)break;f=oe(u,f),f+=2;const d=u[f++];if(d&128&&(f+=2),d&64&&(f+=u[f++]),u[f++]!==4)break;f=oe(u,f);const _=u[f++];if(_===64)r+="."+w(_);else break;if(f+=12,u[f++]!==5)break;f=oe(u,f);const b=u[f++];let E=(b&248)>>3;E===31&&(E+=1+((b&7)<<3)+((u[f]&224)>>5)),r+="."+E}break}case"hvc1":case"hev1":{const c=K(t,["hvcC"])[0];if(c&&c.length>12){const u=c[1],f=["","A","B","C"][u>>6],d=u&31,_=Ct(c,2),b=(u&32)>>5?"H":"L",E=c[12],G=c.subarray(6,12);r+="."+f+d,r+="."+F(_).toString(16).toUpperCase(),r+="."+b+E;let N="";for(let le=G.length;le--;){const ke=G[le];(ke||N)&&(N="."+ke.toString(16).toUpperCase()+N)}r+=N}i=I(l=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{r=I(r,t)||r;break}case"vp09":{const c=K(t,["vpcC"])[0];if(c&&c.length>6){const u=c[4],f=c[5],d=c[6]>>4&15;r+="."+C(u)+"."+C(f)+"."+C(d)}break}case"av01":{const c=K(t,["av1C"])[0];if(c&&c.length>2){const u=c[1]>>>5,f=c[1]&31,d=c[2]>>>7?"H":"M",_=(c[2]&64)>>6,b=(c[2]&32)>>5,E=u===2&&_?b?12:10:_?10:8,G=(c[2]&16)>>4,N=(c[2]&8)>>3,le=(c[2]&4)>>2,ke=c[2]&3;r+="."+u+"."+C(f)+d+"."+C(E)+"."+G+"."+N+le+ke+"."+C(1)+"."+C(1)+"."+C(1)+"."+0,i=I("dav1",t)}break}}return{codec:r,encrypted:s,supplemental:i}}function I(a,e){const t=K(e,["dvvC"]),n=t.length?t[0]:K(e,["dvcC"])[0];if(n){const r=n[2]>>1&127,i=n[2]<<5&32|n[3]>>3&31;return a+"."+C(r)+"."+C(i)}}function F(a){let e=0;for(let t=0;t<32;t++)e|=(a>>t&1)<<31-t;return e>>>0}function oe(a,e){const t=e+5;for(;a[e++]&128&&e<t;);return e}function w(a){return("0"+a.toString(16).toUpperCase()).slice(-2)}function C(a){return(a<10?"0":"")+a}function B(a,e){if(!a||!e)return a;const t=e.keyId;return t&&e.isCommonEncryption&&K(a,["moov","trak"]).forEach(r=>{const s=K(r,["mdia","minf","stbl","stsd"])[0].subarray(8);let l=K(s,["enca"]);const c=l.length>0;c||(l=K(s,["encv"])),l.forEach(u=>{const f=c?u.subarray(28):u.subarray(78);K(f,["sinf"]).forEach(_=>{const b=W(_);if(b){const E=b.subarray(8,24);E.some(G=>G!==0)||(q.log(`[eme] Patching keyId in 'enc${c?"a":"v"}>sinf>>tenc' box: ${Q.hexDump(E)} -> ${Q.hexDump(t)}`),b.set(t,8))}})})}),a}function W(a){const e=K(a,["schm"])[0];if(e){const t=vt(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return K(a,["schi","tenc"])[0]}return null}function Z(a,e,t){const n={},r=K(a,["moof","traf"]);for(let i=0;i<r.length;i++){const s=r[i],l=K(s,["tfhd"])[0],c=Ct(l,4),u=e[c];if(!u)continue;const f=n[c]||(n[c]={start:NaN,duration:0,sampleCount:0,timescale:u.timescale,type:u.type}),d=K(s,["tfdt"])[0];if(d){const Ee=d[0];let Ke=Ct(d,4);Ee===1&&(Ke===At?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(Ke*=At+1,Ke+=Ct(d,8))),k(Ke)&&(!k(f.start)||Ke<f.start)&&(f.start=Ke)}const _=u.default,b=Ct(l,0)|(_==null?void 0:_.flags);let E=(_==null?void 0:_.duration)||0;b&8&&(b&2?E=Ct(l,12):E=Ct(l,8));const G=K(s,["trun"]);let N=f.start||0,le=0,ke=E;for(let Ee=0;Ee<G.length;Ee++){const Ke=G[Ee],We=Ct(Ke,4),gt=f.sampleCount;f.sampleCount+=We;const Xe=Ke[3]&1,st=Ke[3]&4,ht=Ke[2]&1,Je=Ke[2]&2,Kt=Ke[2]&4,dn=Ke[2]&8;let zn=8,Dn=We;for(Xe&&(zn+=4),st&&We&&(!(Ke[zn+1]&1)&&f.keyFrameIndex===void 0&&(f.keyFrameIndex=gt),zn+=4,ht?(ke=Ct(Ke,zn),zn+=4):ke=E,Je&&(zn+=4),dn&&(zn+=4),N+=ke,le+=ke,Dn--);Dn--;)ht?(ke=Ct(Ke,zn),zn+=4):ke=E,Je&&(zn+=4),Kt&&(Ke[zn+1]&1||f.keyFrameIndex===void 0&&(f.keyFrameIndex=f.sampleCount-(Dn+1),f.keyFrameStart=N),zn+=4),dn&&(zn+=4),N+=ke,le+=ke;!le&&E&&(le+=E*We)}f.duration+=le}if(!Object.keys(n).some(i=>n[i].duration)){let i=1/0,s=0;const l=K(a,["sidx"]);for(let c=0;c<l.length;c++){const u=Se(l[c]);if(u!=null&&u.references){i=Math.min(i,u.earliestPresentationTime/u.timescale);const f=u.references.reduce((d,_)=>d+_.info.duration||0,0);s=Math.max(s,f+u.earliestPresentationTime/u.timescale)}}s&&k(s)&&Object.keys(n).forEach(c=>{n[c].duration||(n[c].duration=s*n[c].timescale-n[c].start)})}return n}function te(a,e,t){K(e,["moof","traf"]).forEach(n=>{K(n,["tfhd"]).forEach(r=>{const i=Ct(r,4),s=a[i];if(!s)return;const l=s.timescale||9e4;K(n,["tfdt"]).forEach(c=>{const u=c[0],f=t*l;if(f){let d=Ct(c,4);if(u===0)d-=f,d=Math.max(d,0),Re(c,4,d);else{d*=Math.pow(2,32),d+=Ct(c,8),d-=f,d=Math.max(d,0);const _=Math.floor(d/(At+1)),b=Math.floor(d%(At+1));Re(c,4,_),Re(c,8,b)}}})})})}function ue(a){const e={valid:null,remainder:null},t=K(a,["moof"]);if(t.length<2)return e.remainder=a,e;const n=t[t.length-1];return e.valid=a.slice(0,n.byteOffset-8),e.remainder=a.slice(n.byteOffset-8),e}function ge(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function Ce(a,e){const t=[],n=e.samples,r=e.timescale,i=e.id;let s=!1;return K(n,["moof"]).map(c=>{const u=c.byteOffset-8;K(c,["traf"]).map(d=>{const _=K(d,["tfdt"]).map(b=>{const E=b[0];let G=Ct(b,4);return E===1&&(G*=Math.pow(2,32),G+=Ct(b,8)),G/r})[0];return _!==void 0&&(a=_),K(d,["tfhd"]).map(b=>{const E=Ct(b,4),G=Ct(b,0)&16777215,N=(G&1)!==0,le=(G&2)!==0,ke=(G&8)!==0;let Ee=0;const Ke=(G&16)!==0;let We=0;const gt=(G&32)!==0;let Xe=8;E===i&&(N&&(Xe+=8),le&&(Xe+=4),ke&&(Ee=Ct(b,Xe),Xe+=4),Ke&&(We=Ct(b,Xe),Xe+=4),gt&&(Xe+=4),e.type==="video"&&(s=De(e.codec)),K(d,["trun"]).map(st=>{const ht=st[0],Je=Ct(st,0)&16777215,Kt=(Je&1)!==0;let dn=0;const zn=(Je&4)!==0,Dn=(Je&256)!==0;let Rn=0;const hn=(Je&512)!==0;let Ln=0;const Nn=(Je&1024)!==0,Gt=(Je&2048)!==0;let Jt=0;const sr=Ct(st,4);let Qn=8;Kt&&(dn=Ct(st,Qn),Qn+=4),zn&&(Qn+=4);let gr=dn+u;for(let xr=0;xr<sr;xr++){if(Dn?(Rn=Ct(st,Qn),Qn+=4):Rn=Ee,hn?(Ln=Ct(st,Qn),Qn+=4):Ln=We,Nn&&(Qn+=4),Gt&&(ht===0?Jt=Ct(st,Qn):Jt=qe(st,Qn),Qn+=4),e.type===g.VIDEO){let wr=0;for(;wr<Ln;){const Rr=Ct(n,gr);if(gr+=4,Fe(s,n[gr])){const ei=n.subarray(gr,gr+Rr);Ve(ei,s?2:1,a+Jt/r,t)}gr+=Rr,wr+=Rr+4}}a+=Rn/r}}))})})}),t}function De(a){if(!a)return!1;const e=a.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function Fe(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function Ve(a,e,t,n){const r=Ge(a);let i=0;i+=e;let s=0,l=0,c=0;for(;i<r.length;){s=0;do{if(i>=r.length)break;c=r[i++],s+=c}while(c===255);l=0;do{if(i>=r.length)break;c=r[i++],l+=c}while(c===255);const u=r.length-i;let f=i;if(l<u)i+=l;else if(l>u){q.error(`Malformed SEI payload. ${l} is too small, only ${u} bytes left to parse.`);break}if(s===4){if(r[f++]===181){const _=zt(r,f);if(f+=2,_===49){const b=Ct(r,f);if(f+=4,b===1195456820){const E=r[f++];if(E===3){const G=r[f++],N=31&G,le=64&G,ke=le?2+N*3:0,Ee=new Uint8Array(ke);if(le){Ee[0]=G;for(let Ke=1;Ke<ke;Ke++)Ee[Ke]=r[f++]}n.push({type:E,payloadType:s,pts:t,bytes:Ee})}}}}}else if(s===5&&l>16){const d=[];for(let E=0;E<16;E++){const G=r[f++].toString(16);d.push(G.length==1?"0"+G:G),(E===3||E===5||E===7||E===9)&&d.push("-")}const _=l-16,b=new Uint8Array(_);for(let E=0;E<_;E++)b[E]=r[f++];n.push({payloadType:s,pts:t,uuid:d.join(""),userData:Oe(b),userDataBytes:b})}}}function Ge(a){const e=a.byteLength,t=[];let n=1;for(;n<e-2;)a[n]===0&&a[n+1]===0&&a[n+2]===3?(t.push(n+2),n+=2):n++;if(t.length===0)return a;const r=e-t.length,i=new Uint8Array(r);let s=0;for(n=0;n<r;s++,n++)s===t[0]&&(s++,t.shift()),i[n]=a[s];return i}function $e(a){const e=a[0];let t="",n="",r=0,i=0,s=0,l=0,c=0,u=0;if(e===0){for(;vt(a.subarray(u,u+1))!=="\0";)t+=vt(a.subarray(u,u+1)),u+=1;for(t+=vt(a.subarray(u,u+1)),u+=1;vt(a.subarray(u,u+1))!=="\0";)n+=vt(a.subarray(u,u+1)),u+=1;n+=vt(a.subarray(u,u+1)),u+=1,r=Ct(a,12),i=Ct(a,16),l=Ct(a,20),c=Ct(a,24),u=28}else if(e===1){u+=4,r=Ct(a,u),u+=4;const d=Ct(a,u);u+=4;const _=Ct(a,u);for(u+=4,s=Xo(2,32)*d+_,pe(s)||(s=Number.MAX_SAFE_INTEGER,q.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=Ct(a,u),u+=4,c=Ct(a,u),u+=4;vt(a.subarray(u,u+1))!=="\0";)t+=vt(a.subarray(u,u+1)),u+=1;for(t+=vt(a.subarray(u,u+1)),u+=1;vt(a.subarray(u,u+1))!=="\0";)n+=vt(a.subarray(u,u+1)),u+=1;n+=vt(a.subarray(u,u+1)),u+=1}const f=a.subarray(u,a.byteLength);return{schemeIdUri:t,value:n,timeScale:r,presentationTime:s,presentationTimeDelta:i,eventDuration:l,id:c,payload:f}}function mt(a,...e){const t=e.length;let n=8,r=t;for(;r--;)n+=e[r].byteLength;const i=new Uint8Array(n);for(i[0]=n>>24&255,i[1]=n>>16&255,i[2]=n>>8&255,i[3]=n&255,i.set(a,4),r=0,n=8;r<t;r++)i.set(e[r],n),n+=e[r].byteLength;return i}function xt(a,e,t){if(a.byteLength!==16)throw new RangeError("Invalid system id");let n,r;n=0,r=new Uint8Array;let i;n>0?(i=new Uint8Array(4),e.length>0&&new DataView(i.buffer).setUint32(0,e.length,!1)):i=new Uint8Array;const s=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),mt([112,115,115,104],new Uint8Array([n,0,0,0]),a,i,r,s,t||new Uint8Array)}function St(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let n=0;for(;n+32<t;){const r=new DataView(a,n),i=Lt(r);e.push(i),n+=i.size}}return e}function Lt(a){const e=a.getUint32(0),t=a.byteOffset,n=a.byteLength;if(n<e)return{offset:t,size:n};if(a.getUint32(4)!==1886614376)return{offset:t,size:e};const i=a.getUint32(8)>>>24;if(i!==0&&i!==1)return{offset:t,size:e};const s=a.buffer,l=Q.hexDump(new Uint8Array(s,t+12,16)),c=a.getUint32(28);let u=null,f=null;if(i===0){if(e-32<c||c<22)return{offset:t,size:e};f=new Uint8Array(s,t+32,c)}else if(i===1){if(!c||n<t+32+c*16+16)return{offset:t,size:e};u=[];for(let d=0;d<c;d++)u.push(new Uint8Array(s,t+32+d*16,16))}return{version:i,systemId:l,kids:u,data:f,offset:t,size:e}}const Ht=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),ut={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 Ut(a,e){const t=ut[e];return!!t&&!!t[a.slice(0,4)]}function Le(a,e,t=!0){return!a.split(",").some(n=>!Ae(n,e,t))}function Ae(a,e,t=!0){var n;const r=he(t);return(n=r==null?void 0:r.isTypeSupported(Ie(a,e)))!=null?n:!1}function Ie(a,e){return`${e}/mp4;codecs=${a}`}function H(a){if(a){const e=a.substring(0,4);return ut.video[e]}return 2}function ee(a){const e=Ht();return a.split(",").reduce((t,n)=>{const i=e&&De(n)?9:ut.video[n];return i?(i*2+t)/(t?3:2):(ut.audio[n]+t)/(t?2:1)},0)}const de={};function re(a,e=!0){if(de[a])return de[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[a];for(let r=0;r<t.length;r++){var n;if(Ae(t[r],"audio",e))return de[a]=t[r],t[r];if(t[r]==="mp3"&&(n=he(e))!=null&&n.isTypeSupported("audio/mpeg"))return""}return a}const _e=/flac|opus|mp4a\.40\.34/i;function et(a,e=!0){return a.replace(_e,t=>re(t.toLowerCase(),e))}function Ye(a,e){const t=[];if(a){const n=a.split(",");for(let r=0;r<n.length;r++)Ut(n[r],"video")||t.push(n[r])}return e&&t.push(e),t.join(",")}function it(a,e){if(a&&(a.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1))return a;if(e){const t=e.split(",");if(t.length>1){if(a){for(let n=t.length;n--;)if(t[n].substring(0,4)===a.substring(0,4))return t[n]}return t[0]}}return e||a}function Rt(a){const e=a.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");n.length>2&&n[0]==="avc1"&&(e[t]=`avc1.${parseInt(n[1]).toString(16)}${("000"+parseInt(n[2]).toString(16)).slice(-4)}`)}return e.join(",")}function on(a){if(a.startsWith("av01.")){const e=a.split("."),t=["0","111","01","01","01","0"];for(let n=e.length;n>4&&n<10;n++)e[n]=t[n-4];return e.join(".")}return a}function fn(a){const e=he(a)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Pt(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const jt={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function wn(a,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:a}}const Gn={};function An(a,e,t,n,r,i){const s=a.audioCodec?a.audioGroups:null,l=i==null?void 0:i.audioCodec,c=i==null?void 0:i.channels,u=c?parseInt(c):l?1/0:2;let f=null;if(s!=null&&s.length)try{s.length===1&&s[0]?f=e.groups[s[0]].channels:f=s.reduce((d,_)=>{if(_){const b=e.groups[_];if(!b)throw new Error(`Audio track group ${_} not found`);Object.keys(b.channels).forEach(E=>{d[E]=(d[E]||0)+b.channels[E]})}return d},{2:0})}catch(d){return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(n,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(r,8e6))||!!f&&k(u)&&Object.keys(f).some(d=>parseInt(d)>u)}function Mn(a,e,t){const n=a.videoCodec,r=a.audioCodec;if(!n&&!r||!t)return Promise.resolve(jt);const i=[];if(n){const s={width:a.width,height:a.height,bitrate:Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)),framerate:a.frameRate||30},l=a.videoRange;l!=="SDR"&&(s.transferFunction=l.toLowerCase());const c=n.split(","),u=navigator.userAgent;if(c.some(f=>De(f))&&Ht())return Promise.resolve(wn(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent sting: (${u})`),i));i.push.apply(i,c.map(f=>({type:"media-source",video:y(y({},s),{},{contentType:Ie(on(f),"video")})})))}return r&&a.audioGroups&&a.audioGroups.forEach(s=>{var l;s&&((l=e.groups[s])==null||l.tracks.forEach(c=>{if(c.groupId===s){const u=c.channels||"",f=parseFloat(u);k(f)&&f>2&&i.push.apply(i,r.split(",").map(d=>({type:"media-source",audio:{contentType:Ie(d,"audio"),channels:""+f}})))}}))}),Promise.all(i.map(s=>{const l=Cn(s);return Gn[l]||(Gn[l]=t.decodingInfo(s))})).then(s=>({supported:!s.some(l=>!l.supported),configurations:i,decodingInfoResults:s})).catch(s=>({supported:!1,configurations:i,decodingInfoResults:[],error:s}))}function Cn(a){const{audio:e,video:t}=a,n=t||e;if(n){const r=Pt(n.contentType);if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${r}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${r}`}return""}const rn=["NONE","TYPE-0","TYPE-1",null];function Tn(a){return rn.indexOf(a)>-1}const $n=["SDR","PQ","HLG"];function tr(a){return!!a&&$n.indexOf(a)>-1}var Me={No:"",Yes:"YES",v2:"v2"};function Pe(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,r=n<e/2;return e&&r?t?Me.v2:Me.Yes:Me.No}class Tt{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class pt{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(n=>!!n).map(n=>n.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const n=(t=e.supplemental)==null?void 0:t.videoCodec;n&&n!==e.videoCodec&&(this.codecSet+=`,${n.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return dt(this._audioGroups,e)}hasSubtitleGroup(e){return dt(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let n=this._audioGroups;n||(n=this._audioGroups=[]),n.indexOf(t)===-1&&n.push(t)}else if(e==="text"){let n=this._subtitleGroups;n||(n=this._subtitleGroups=[]),n.indexOf(t)===-1&&n.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function dt(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function Zt(){if(typeof matchMedia=="function"){const a=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(a.media!==e.media)return a.matches===!0}return!1}function ze(a,e){let t=!1,n=[];if(a&&(t=a!=="SDR",n=[a]),e){n=e.allowedVideoRanges||$n.slice(0);const r=n.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:r&&Zt(),t||(n=["SDR"])}return{preferHDR:t,allowedVideoRanges:n}}const tt=a=>{const e=new WeakSet;return(t,n)=>{if(a&&(n=a(t,n)),typeof n=="object"&&n!==null){if(e.has(n))return;e.add(n)}return n}},ot=(a,e)=>JSON.stringify(a,tt(e));function It(a,e,t,n,r){const i=Object.keys(a),s=n==null?void 0:n.channels,l=n==null?void 0:n.audioCodec,c=r==null?void 0:r.videoCodec,u=s&&parseInt(s)===2;let f=!1,d=!1,_=1/0,b=1/0,E=1/0,G=1/0,N=0,le=[];const{preferHDR:ke,allowedVideoRanges:Ee}=ze(e,r);for(let st=i.length;st--;){const ht=a[i[st]];f||(f=ht.channels[2]>0),_=Math.min(_,ht.minHeight),b=Math.min(b,ht.minFramerate),E=Math.min(E,ht.minBitrate),Ee.filter(Kt=>ht.videoRanges[Kt]>0).length>0&&(d=!0)}_=k(_)?_:0,b=k(b)?b:0;const Ke=Math.max(1080,_),We=Math.max(30,b);E=k(E)?E:t,t=Math.max(E,t),d||(e=void 0);const gt=i.length>1;return{codecSet:i.reduce((st,ht)=>{const Je=a[ht];if(ht===st)return st;if(le=d?Ee.filter(Kt=>Je.videoRanges[Kt]>0):[],gt){if(Je.minBitrate>t)return Ft(ht,`min bitrate of ${Je.minBitrate} > current estimate of ${t}`),st;if(!Je.hasDefaultAudio)return Ft(ht,"no renditions with default or auto-select sound found"),st;if(l&&ht.indexOf(l.substring(0,4))%5!==0)return Ft(ht,`audio codec preference "${l}" not found`),st;if(s&&!u){if(!Je.channels[s])return Ft(ht,`no renditions with ${s} channel sound found (channels options: ${Object.keys(Je.channels)})`),st}else if((!l||u)&&f&&Je.channels[2]===0)return Ft(ht,"no renditions with stereo sound found"),st;if(Je.minHeight>Ke)return Ft(ht,`min resolution of ${Je.minHeight} > maximum of ${Ke}`),st;if(Je.minFramerate>We)return Ft(ht,`min framerate of ${Je.minFramerate} > maximum of ${We}`),st;if(!le.some(Kt=>Je.videoRanges[Kt]>0))return Ft(ht,`no variants with VIDEO-RANGE of ${ot(le)} found`),st;if(c&&ht.indexOf(c.substring(0,4))%5!==0)return Ft(ht,`video codec preference "${c}" not found`),st;if(Je.maxScore<N)return Ft(ht,`max score of ${Je.maxScore} < selected max of ${N}`),st}return st&&(ee(ht)>=ee(st)||Je.fragmentError>a[st].fragmentError)?st:(G=Je.minIndex,N=Je.maxScore,ht)},void 0),videoRanges:le,preferHDR:ke,minFramerate:b,minBitrate:E,minIndex:G}}function Ft(a,e){q.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function Xt(a){return a.reduce((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const r=t.channels||"2";return n.channels[r]=(n.channels[r]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Bt(a,e,t,n){return a.slice(t,n+1).reduce((r,i,s)=>{if(!i.codecSet)return r;const l=i.audioGroups;let c=r[i.codecSet];c||(r[i.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:s,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!l,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,i.bitrate);const u=Math.min(i.height,i.width);return c.minHeight=Math.min(c.minHeight,u),c.minFramerate=Math.min(c.minFramerate,i.frameRate),c.minIndex=Math.min(c.minIndex,s),c.maxScore=Math.max(c.maxScore,i.score),c.fragmentError+=i.fragmentError,c.videoRanges[i.videoRange]=(c.videoRanges[i.videoRange]||0)+1,l&&l.forEach(f=>{if(!f)return;const d=e.groups[f];d&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?d.hasDefault:d.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(d.channels).forEach(_=>{c.channels[_]=(c.channels[_]||0)+d.channels[_]}))}),r},{})}function yt(a){if(!a)return a;const{lang:e,assocLang:t,characteristics:n,channels:r,audioCodec:i}=a;return{lang:e,assocLang:t,characteristics:n,channels:r,audioCodec:i}}function ye(a,e,t){if("attrs"in a){const n=e.indexOf(a);if(n!==-1)return n}for(let n=0;n<e.length;n++){const r=e[n];if(Ue(a,r,t))return n}return-1}function Ue(a,e,t){const{groupId:n,name:r,lang:i,assocLang:s,default:l}=a,c=a.forced;return(n===void 0||e.groupId===n)&&(r===void 0||e.name===r)&&(i===void 0||He(i,e.lang))&&(i===void 0||e.assocLang===s)&&(l===void 0||e.default===l)&&(c===void 0||e.forced===c)&&(!("characteristics"in a)||je(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function He(a,e="--"){return a.length===e.length?a===e:a.startsWith(e)||e.startsWith(a)}function je(a,e=""){const t=a.split(","),n=e.split(",");return t.length===n.length&&!t.some(r=>n.indexOf(r)===-1)}function at(a,e){const{audioCodec:t,channels:n}=a;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(n===void 0||n===(e.channels||"2"))}function ct(a,e,t,n,r){const i=e[n],l=e.reduce((_,b,E)=>{const G=b.uri;return(_[G]||(_[G]=[])).push(E),_},{})[i.uri];l.length>1&&(n=Math.max.apply(Math,l));const c=i.videoRange,u=i.frameRate,f=i.codecSet.substring(0,4),d=lt(e,n,_=>{if(_.videoRange!==c||_.frameRate!==u||_.codecSet.substring(0,4)!==f)return!1;const b=_.audioGroups,E=t.filter(G=>!b||b.indexOf(G.groupId)!==-1);return ye(a,E,r)>-1});return d>-1?d:lt(e,n,_=>{const b=_.audioGroups,E=t.filter(G=>!b||b.indexOf(G.groupId)!==-1);return ye(a,E,r)>-1})}function lt(a,e,t){for(let n=e;n>-1;n--)if(t(a[n]))return n;for(let n=e+1;n<a.length;n++)if(t(a[n]))return n;return-1}function wt(a,e){var t;return!!a&&a!==((t=e.loadLevelObj)==null?void 0:t.uri)}class Ot extends z{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var n;const{fragCurrent:r,partCurrent:i,hls:s}=this,{autoLevelEnabled:l,media:c}=s;if(!r||!c)return;const u=performance.now(),f=i?i.stats:r.stats,d=i?i.duration:r.duration,_=u-f.loading.start,b=s.minAutoLevel,E=r.level,G=this._nextAutoLevel;if(f.aborted||f.loaded&&f.loaded===f.total||E<=b){this.clearTimer(),this._nextAutoLevel=-1;return}if(!l)return;const N=G>-1&&G!==E,le=!!t||N;if(!le&&(c.paused||!c.playbackRate||!c.readyState))return;const ke=s.mainForwardBufferInfo;if(!le&&ke===null)return;const Ee=this.bwEstimator.getEstimateTTFB(),Ke=Math.abs(c.playbackRate);if(_<=Math.max(Ee,1e3*(d/(Ke*2))))return;const We=ke?ke.len/Ke:0,gt=f.loading.first?f.loading.first-f.loading.start:-1,Xe=f.loaded&&gt>-1,st=this.getBwEstimate(),ht=s.levels,Je=ht[E],Kt=Math.max(f.loaded,Math.round(d*(r.bitrate||Je.averageBitrate)/8));let dn=Xe?_-gt:_;dn<1&&Xe&&(dn=Math.min(_,f.loaded*8/st));const zn=Xe?f.loaded*1e3/dn:0,Dn=Ee/1e3,Rn=zn?(Kt-f.loaded)/zn:Kt*8/st+Dn;if(Rn<=We)return;const hn=zn?zn*8:st,Ln=((n=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:n.live)===!0,Nn=this.hls.config.abrBandWidthUpFactor;let Gt=Number.POSITIVE_INFINITY,Jt;for(Jt=E-1;Jt>b;Jt--){const xr=ht[Jt].maxBitrate,wr=!ht[Jt].details||Ln;if(Gt=this.getTimeToLoadFrag(Dn,hn,d*xr,wr),Gt<Math.min(We,d+Dn))break}if(Gt>=Rn||Gt>d*10)return;Xe?this.bwEstimator.sample(_-Math.min(Ee,gt),f.loaded):this.bwEstimator.sampleTTFB(_);const sr=ht[Jt].maxBitrate;this.getBwEstimate()*Nn>sr&&this.resetEstimator(sr);const Qn=this.findBestLevel(sr,b,Jt,0,We,1,1);Qn>-1&&(Jt=Qn),this.warn(`Fragment ${r.sn}${i?" part "+i.index:""} of level ${E} is loading too slowly;
Fragment duration: ${r.duration.toFixed(3)}
Time to underbuffer: ${We.toFixed(3)} s
Estimated load time for current fragment: ${Rn.toFixed(3)} s
Estimated load time for down switch fragment: ${Gt.toFixed(3)} s
TTFB estimate: ${gt|0} ms
Current BW estimate: ${k(st)?st|0:"Unknown"} bps
New BW estimate: ${this.getBwEstimate()|0} bps
Switching to level ${Jt} @ ${sr|0} bps`),s.nextLoadLevel=s.nextAutoLevel=Jt,this.clearTimer();const gr=()=>{if(this.clearTimer(),this.fragCurrent===r&&this.hls.loadLevel===Jt&&Jt>0){const xr=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${Jt>0?"and switching down":""}
Fragment duration: ${r.duration.toFixed(3)} s
Time to underbuffer: ${xr.toFixed(3)} s`),r.abortRequests(),this.fragCurrent=this.partCurrent=null,Jt>b){let wr=this.findBestLevel(this.hls.levels[b].bitrate,b,Jt,0,xr,1,1);wr===-1&&(wr=b),this.hls.nextLoadLevel=this.hls.nextAutoLevel=wr,this.resetEstimator(this.hls.levels[wr].bitrate)}}};N||Rn>Gt*2?gr():this.timer=self.setInterval(gr,Gt*1e3),s.trigger(p.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,part:i,stats:f})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new x(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(p.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var r;this.fragCurrent=n,this.partCurrent=(r=t.part)!=null?r:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case $.BUFFER_ADD_CODEC_ERROR:case $.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case $.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:r,partCurrent:i}=this;if(n&&r&&n.sn===r.sn&&n.level===r.level){const s=performance.now(),l=i?i.stats:n.stats,c=s-l.loading.start,u=l.loading.first?l.loading.first-l.loading.start:-1;if(l.loaded&&u>-1){const d=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(d,u),l.loaded)}else this.bwEstimator.sampleTTFB(c)}break}}}getTimeToLoadFrag(e,t,n,r){const i=e+n/t,s=r?e+this.lastLevelLoadSec:0;return i+s}onLevelLoaded(e,t){const n=this.hls.config,{loading:r}=t.stats,i=r.end-r.first;k(i)&&(this.lastLevelLoadSec=i/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:n}){const r=n?n.stats:t.stats;if(t.type===ce.MAIN&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const i=n?n.duration:t.duration,s=this.hls.levels[t.level],l=(s.loaded?s.loaded.bytes:0)+r.loaded,c=(s.loaded?s.loaded.duration:0)+i;s.loaded={bytes:l,duration:c},s.realBitrate=Math.round(8*l/c)}if(t.bitrateTest){const i={stats:r,frag:t,part:n,id:t.type};this.onFragBuffered(p.FRAG_BUFFERED,i),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:r}=t,i=r!=null&&r.stats.loaded?r.stats:n.stats;if(i.aborted||this.ignoreFragment(n))return;const s=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,i.loaded),i.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==ce.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),r=this.hls.config.maxStarvationDelay,i=this.findBestLevel(n,t,e,0,r,1,1);if(i>-1)return i;const s=this.hls.firstLevel,l=Math.min(Math.max(s,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${l}`),l}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),r=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!r||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const i=n&&r?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const s=this.hls.levels;if(s.length>Math.max(e,i)&&s[e].loadError<=s[i].loadError)return e}return this._nextAutoLevel=i,this.nextAutoLevelKey=this.getAutoLevelKey(),i}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:r,config:i,minAutoLevel:s}=n,l=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),u=this.getStarvationDelay();let f=i.abrBandWidthFactor,d=i.abrBandWidthUpFactor;if(u){const N=this.findBestLevel(c,s,r,u,0,f,d);if(N>=0)return this.rebufferNotice=-1,N}let _=l?Math.min(l,i.maxStarvationDelay):i.maxStarvationDelay;if(!u){const N=this.bitrateTestDelay;N&&(_=(l?Math.min(l,i.maxLoadingDelay):i.maxLoadingDelay)-N,this.info(`bitrate test took ${Math.round(1e3*N)}ms, set first fragment max fetchDuration to ${Math.round(1e3*_)} ms`),f=d=1)}const b=this.findBestLevel(c,s,r,u,_,f,d);if(this.rebufferNotice!==b&&(this.rebufferNotice=b,this.info(`${u?"rebuffering expected":"buffer is empty"}, optimal quality level ${b}`)),b>-1)return b;const E=n.levels[s],G=n.loadLevelObj;return G&&(E==null?void 0:E.bitrate)<G.bitrate?s:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,r=e.mainForwardBufferInfo;return(r?r.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,r,i,s,l){var c;const u=r+i,f=this.lastLoadedFragLevel,d=f===-1?this.hls.firstLevel:f,{fragCurrent:_,partCurrent:b}=this,{levels:E,allAudioTracks:G,loadLevel:N,config:le}=this.hls;if(E.length===1)return 0;const ke=E[d],Ee=!!((c=this.hls.latestLevelDetails)!=null&&c.live),Ke=N===-1||f===-1;let We,gt="SDR",Xe=(ke==null?void 0:ke.frameRate)||0;const{audioPreference:st,videoPreference:ht}=le,Je=this.audioTracksByGroup||(this.audioTracksByGroup=Xt(G));let Kt=-1;if(Ke){if(this.firstSelection!==-1)return this.firstSelection;const hn=this.codecTiers||(this.codecTiers=Bt(E,Je,t,n)),Ln=It(hn,gt,e,st,ht),{codecSet:Nn,videoRanges:Gt,minFramerate:Jt,minBitrate:sr,minIndex:Qn,preferHDR:gr}=Ln;Kt=Qn,We=Nn,gt=gr?Gt[Gt.length-1]:Gt[0],Xe=Jt,e=Math.max(e,sr),this.log(`picked start tier ${ot(Ln)}`)}else We=ke==null?void 0:ke.codecSet,gt=ke==null?void 0:ke.videoRange;const dn=b?b.duration:_?_.duration:0,zn=this.bwEstimator.getEstimateTTFB()/1e3,Dn=[];for(let hn=n;hn>=t;hn--){var Rn;const Ln=E[hn],Nn=hn>d;if(!Ln)continue;if(le.useMediaCapabilities&&!Ln.supportedResult&&!Ln.supportedPromise){const wr=navigator.mediaCapabilities;typeof(wr==null?void 0:wr.decodingInfo)=="function"&&(An(Ln,Je,gt,Xe,e,st)||De(Ln.videoCodec))?(Ln.supportedPromise=Mn(Ln,Je,wr),Ln.supportedPromise.then(Rr=>{if(!this.hls)return;Ln.supportedResult=Rr;const ei=this.hls.levels,si=ei.indexOf(Ln);Rr.error?this.warn(`MediaCapabilities decodingInfo error: "${Rr.error}" for level ${si} ${ot(Rr)}`):Rr.supported||(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${si} ${ot(Rr)}`),si>-1&&ei.length>1&&(this.log(`Removing unsupported level ${si}`),this.hls.removeLevel(si),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):Ln.supportedResult=jt}if((We&&Ln.codecSet!==We||gt&&Ln.videoRange!==gt||Nn&&Xe>Ln.frameRate||!Nn&&Xe>0&&Xe<Ln.frameRate||Ln.supportedResult&&!((Rn=Ln.supportedResult.decodingInfoResults)!=null&&Rn[0].smooth))&&(!Ke||hn!==Kt)){Dn.push(hn);continue}const Gt=Ln.details,Jt=(b?Gt==null?void 0:Gt.partTarget:Gt==null?void 0:Gt.averagetargetduration)||dn;let sr;Nn?sr=l*e:sr=s*e;const Qn=dn&&r>=dn*2&&i===0?Ln.averageBitrate:Ln.maxBitrate,gr=this.getTimeToLoadFrag(zn,sr,Qn*Jt,Gt===void 0);if(sr>=Qn&&(hn===f||Ln.loadError===0&&Ln.fragmentError===0)&&(gr<=zn||!k(gr)||Ee&&!this.bitrateTestDelay||gr<u)){const wr=this.forcedAutoLevel;return hn!==N&&(wr===-1||wr!==N)&&(Dn.length&&this.trace(`Skipped level(s) ${Dn.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${E[Dn[0]].codecs}" ${E[Dn[0]].videoRange}; not compatible with "${We}" ${gt}`),this.info(`switch candidate:${d}->${hn} adjustedbw(${Math.round(sr)})-bitrate=${Math.round(sr-Qn)} ttfb:${zn.toFixed(1)} avgDuration:${Jt.toFixed(1)} maxFetchDuration:${u.toFixed(1)} fetchDuration:${gr.toFixed(1)} firstSelection:${Ke} codecSet:${Ln.codecSet} videoRange:${Ln.videoRange} hls.loadLevel:${N}`)),Ke&&(this.firstSelection=hn),hn}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls;return Math.min(Math.max(e,n),t)}}const $t={search:function(a,e){let t=0,n=a.length-1,r=null,i=null;for(;t<=n;){r=(t+n)/2|0,i=a[r];const s=e(i);if(s>0)t=r+1;else if(s<0)n=r-1;else return i}return null}};function pn(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!k(e))return null;const n=a[0].programDateTime;if(e<(n||0))return null;const r=a[a.length-1].endProgramDateTime;if(e>=(r||0))return null;for(let i=0;i<a.length;++i){const s=a[i];if(un(e,t,s))return s}return null}function kt(a,e,t=0,n=0,r=.005){let i=null;if(a){i=e[1+a.sn-e[0].sn]||null;const l=a.endDTS-t;l>0&&l<15e-7&&(t+=15e-7),i&&a.level!==i.level&&i.end<=a.end&&(i=e[2+a.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(i=e[0]);if(i&&((!a||a.level===i.level)&&sn(t,n,i)===0||_n(i,a,Math.min(r,n))))return i;const s=$t.search(e,sn.bind(null,t,n));return s&&(s!==a||!i)?s:i}function _n(a,e,t){if(e&&e.start===0&&e.level<a.level&&(e.endPTS||0)>0){const n=e.tagList.reduce((r,i)=>(i[0]==="INF"&&(r+=parseFloat(i[1])),r),t);return a.start<=n}return!1}function sn(a=0,e=0,t){if(t.start<=a&&t.start+t.duration>a)return 0;const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-n<=a?1:t.start-n>a&&t.start?-1:0}function un(a,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>a}function Nt(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){let n=a.fragments;const{fragmentHint:r}=a;r&&(n=n.concat(r));let i;return $t.search(n,s=>s.cc<e?1:s.cc>e?-1:(i=s,s.end<=t?1:s.start>t?-1:0)),i||null}return null}function Mt(a){switch(a.details){case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_TIMEOUT:case $.LEVEL_LOAD_TIMEOUT:case $.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function qt(a,e){const t=Mt(e);return a.default[`${t?"timeout":"error"}Retry`]}function cn(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function ln(a){return y(y({},a),{errorRetry:null,timeoutRetry:null})}function an(a,e,t,n){if(!a)return!1;const r=n==null?void 0:n.code,i=e<a.maxNumRetry&&(yn(r)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,n,i):i}function yn(a){return a===0&&navigator.onLine===!1||!!a&&(a<400||a>499)}var Vt={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Wt={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Jn extends z{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.ERROR,this.onError,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.ERROR,this.onError,this),e.off(p.ERROR,this.onErrorOut,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===ce.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;const r=this.hls,i=t.context;switch(t.details){case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case $.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction=Wn();return}case $.FRAG_GAP:case $.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Vt.SendAlternateToPenaltyBox;return}case $.LEVEL_EMPTY_ERROR:case $.LEVEL_PARSING_ERROR:{var s,l;const u=t.parent===ce.MAIN?t.level:r.loadLevel;t.details===$.LEVEL_EMPTY_ERROR&&((s=t.context)!=null&&(l=s.levelDetails)!=null&&l.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,u):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,u))}return;case $.LEVEL_LOAD_ERROR:case $.LEVEL_LOAD_TIMEOUT:typeof(i==null?void 0:i.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.level));return;case $.AUDIO_TRACK_LOAD_ERROR:case $.AUDIO_TRACK_LOAD_TIMEOUT:case $.SUBTITLE_LOAD_ERROR:case $.SUBTITLE_TRACK_LOAD_TIMEOUT:if(i){const u=r.loadLevelObj;if(u&&(i.type===me.AUDIO_TRACK&&u.hasAudioGroup(i.groupId)||i.type===me.SUBTITLE_TRACK&&u.hasSubtitleGroup(i.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=Vt.SendAlternateToPenaltyBox,t.errorAction.flags=Wt.MoveAllAlternatesMatchingHost;return}}return;case $.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const u=r.loadLevelObj,f=u==null?void 0:u.attrs["HDCP-LEVEL"];f?t.errorAction={action:Vt.SendAlternateToPenaltyBox,flags:Wt.MoveAllAlternatesMatchingHDCP,hdcpLevel:f}:this.keySystemError(t)}return;case $.BUFFER_ADD_CODEC_ERROR:case $.REMUX_ALLOC_ERROR:case $.BUFFER_APPEND_ERROR:if(!t.errorAction){var c;t.errorAction=this.getLevelSwitchAction(t,(c=t.level)!=null?c:r.loadLevel)}return;case $.INTERNAL_EXCEPTION:case $.BUFFER_APPENDING_ERROR:case $.BUFFER_FULL_ERROR:case $.LEVEL_SWITCH_ERROR:case $.BUFFER_STALLED_ERROR:case $.BUFFER_SEEK_OVER_HOLE:case $.BUFFER_NUDGE_ON_STALL:t.errorAction=Wn();return}t.type===fe.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,r=qt(n.config.playlistLoadPolicy,e),i=this.playlistError++;if(an(r,i,Mt(e),e.response))return{action:Vt.RetryRequest,flags:Wt.None,retryConfig:r,retryCount:i};const l=this.getLevelSwitchAction(e,t);return r&&(l.retryConfig=r,l.retryCount=i),l}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),r=t.levels[n],{fragLoadPolicy:i,keyLoadPolicy:s}=t.config,l=qt(e.details.startsWith("key")?s:i,e),c=t.levels.reduce((f,d)=>f+d.fragmentError,0);if(r&&(e.details!==$.FRAG_GAP&&r.fragmentError++,an(l,c,Mt(e),e.response)))return{action:Vt.RetryRequest,flags:Wt.None,retryConfig:l,retryCount:c};const u=this.getLevelSwitchAction(e,n);return l&&(u.retryConfig=l,u.retryCount=c),u}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const r=this.hls.levels[t];if(r){var i,s;const u=e.details;r.loadError++,u===$.BUFFER_APPEND_ERROR&&r.fragmentError++;let f=-1;const{levels:d,loadLevel:_,minAutoLevel:b,maxAutoLevel:E}=n;!n.autoLevelEnabled&&!n.config.preserveManualLevelOnError&&(n.loadLevel=-1);const G=(i=e.frag)==null?void 0:i.type,le=(G===ce.AUDIO&&u===$.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(u===$.BUFFER_ADD_CODEC_ERROR||u===$.BUFFER_APPEND_ERROR))&&d.some(({audioCodec:gt})=>r.audioCodec!==gt),Ee=e.sourceBufferName==="video"&&(u===$.BUFFER_ADD_CODEC_ERROR||u===$.BUFFER_APPEND_ERROR)&&d.some(({codecSet:gt,audioCodec:Xe})=>r.codecSet!==gt&&r.audioCodec===Xe),{type:Ke,groupId:We}=(s=e.context)!=null?s:{};for(let gt=d.length;gt--;){const Xe=(gt+_)%d.length;if(Xe!==_&&Xe>=b&&Xe<=E&&d[Xe].loadError===0){var l,c;const st=d[Xe];if(u===$.FRAG_GAP&&G===ce.MAIN&&e.frag){const ht=d[Xe].details;if(ht){const Je=kt(e.frag,ht.fragments,e.frag.start);if(Je!=null&&Je.gap)continue}}else{if(Ke===me.AUDIO_TRACK&&st.hasAudioGroup(We)||Ke===me.SUBTITLE_TRACK&&st.hasSubtitleGroup(We))continue;if(G===ce.AUDIO&&(l=r.audioGroups)!=null&&l.some(ht=>st.hasAudioGroup(ht))||G===ce.SUBTITLE&&(c=r.subtitleGroups)!=null&&c.some(ht=>st.hasSubtitleGroup(ht))||le&&r.audioCodec===st.audioCodec||!le&&r.audioCodec!==st.audioCodec||Ee&&r.codecSet===st.codecSet)continue}f=Xe;break}}if(f>-1&&n.loadLevel!==f)return e.levelRetry=!0,this.playlistError=0,{action:Vt.SendAlternateToPenaltyBox,flags:Wt.None,nextAutoLevel:f}}return{action:Vt.SendAlternateToPenaltyBox,flags:Wt.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case Vt.DoNothing:break;case Vt.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==$.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 Vt.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:r,hdcpLevel:i,nextAutoLevel:s}=n;switch(r){case Wt.None:this.switchLevel(e,s);break;case Wt.MoveAllAlternatesMatchingHDCP:i&&(t.maxHdcpLevel=rn[rn.indexOf(i)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}n.resolved||this.switchLevel(e,s)}switchLevel(e,t){if(t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===$.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const n=Pt(e.mimeType),r=this.hls.levels;for(let i=r.length;i--;)r[i][`${e.sourceBufferName}Codec`]===n&&this.hls.removeLevel(i)}}}function Wn(a){const e={action:Vt.DoNothing,flags:Wt.None};return a&&(e.resolved=!0),e}var Bn={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class Hn{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.BUFFER_APPENDED,this.onBufferAppended,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let r=n.length;r--;){const i=n[r];if(!i)break;const s=i.end;if(i.start<=e&&s!==null&&e<=s)return i}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,n){const{fragments:r}=this,i=Object.keys(r);for(let s=i.length;s--;){const l=r[i[s]];if((l==null?void 0:l.body.type)===t&&(!n||l.buffered)){const c=l.body;if(c.start<=e&&e<=c.end)return c}}return null}detectEvictedFragments(e,t,n,r,i){this.timeRanges&&(this.timeRanges[e]=t);const s=(r==null?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach(l=>{const c=this.fragments[l];if(!c||s>=c.body.sn)return;if(!c.buffered&&(!c.loaded||i)){c.body.type===n&&this.removeFragment(c.body);return}const u=c.range[e];if(u){if(u.time.length===0){this.removeFragment(c.body);return}u.time.some(f=>{const d=!this.isTimeBuffered(f.startPTS,f.endPTS,t);return d&&this.removeFragment(c.body),d})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const n=e.frag,r=Vn(n),i=this.fragments[r];if(!i||i.buffered&&n.gap)return;const s=!n.relurl;Object.keys(t).forEach(l=>{const c=n.elementaryStreams[l];if(!c)return;const u=t[l],f=s||c.partial===!0;i.range[l]=this.getBufferedTimes(n,e.part,f,u)}),i.loaded=null,Object.keys(i.range).length?(i.buffered=!0,(i.body.endList=n.endList||i.body.endList)&&(this.endListFragments[i.body.type]=i),qn(i)||this.removeParts(n.sn-1,n.type)):this.removeFragment(i.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=mr(n,r=>r.fragment.sn>=e))}fragBuffered(e,t){const n=Vn(e);let r=this.fragments[n];!r&&t&&(r=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)}getBufferedTimes(e,t,n,r){const i={time:[],partial:n},s=e.start,l=e.end,c=e.minEndPTS||l,u=e.maxStartPTS||s;for(let f=0;f<r.length;f++){const d=r.start(f)-this.bufferPadding,_=r.end(f)+this.bufferPadding;if(u>=d&&c<=_){i.time.push({startPTS:Math.max(s,r.start(f)),endPTS:Math.min(l,r.end(f))});break}else if(s<_&&l>d){const b=Math.max(s,r.start(f)),E=Math.min(l,r.end(f));E>b&&(i.partial=!0,i.time.push({startPTS:b,endPTS:E}))}else if(l<=d)break}return i}getPartialFragment(e){let t=null,n,r,i,s=0;const{bufferPadding:l,fragments:c}=this;return Object.keys(c).forEach(u=>{const f=c[u];f&&qn(f)&&(r=f.body.start-l,i=f.body.end+l,e>=r&&e<=i&&(n=Math.min(e-r,i-e),s<=n&&(t=f.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||qn(t))}getState(e){const t=Vn(e),n=this.fragments[t];return n?n.buffered?qn(n)?Bn.PARTIAL:Bn.OK:Bn.APPENDING:Bn.NOT_LOADED}isTimeBuffered(e,t,n){let r,i;for(let s=0;s<n.length;s++){if(r=n.start(s)-this.bufferPadding,i=n.end(s)+this.bufferPadding,e>=r&&t<=i)return!0;if(t<=r)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const n=t.frag,r=t.part?null:t,i=Vn(n);this.fragments[i]={body:n,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:r,timeRanges:i,type:s}=t;if(n.sn==="initSegment")return;const l=n.type;if(r){let u=this.activePartLists[l];u||(this.activePartLists[l]=u=[]),u.push(r)}this.timeRanges=i;const c=i[s];this.detectEvictedFragments(s,c,l,r)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Vn(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,n=Object.keys(t);if(!e)return n.length>0;for(let r=n.length;r--;){const i=t[n[r]];if((i==null?void 0:i.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,r,i){r&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const l=this.fragments[s];if(!l)return;const c=l.body;c.type!==n||r&&!c.gap||c.start<t&&c.end>e&&(l.buffered||i)&&this.removeFragment(c)})}removeFragment(e){const t=Vn(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const r=e.sn;this.activePartLists[e.type]=mr(n,i=>i.fragment.sn!==r)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e,t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const n=(e=this.hls)==null||(t=e.latestLevelDetails)==null?void 0:t.partList;n&&n.forEach(r=>r.clearElementaryStreamInfo())}}function qn(a){var e,t,n;return a.buffered&&(a.body.gap||((e=a.range.video)==null?void 0:e.partial)||((t=a.range.audio)==null?void 0:t.partial)||((n=a.range.audiovideo)==null?void 0:n.partial))}function Vn(a){return`${a.type}_${a.level}_${a.sn}`}function mr(a,e){return a.filter(t=>{const n=e(t);return n||t.clearElementaryStreamInfo(),n})}var nr={cbc:0,ctr:1};class ar{constructor(e,t,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=n}decrypt(e,t){switch(this.aesMode){case nr.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case nr.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 En(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class Dt{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let r=0;r<4;r++)n[r]=t.getUint32(r*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,r=n[0],i=n[1],s=n[2],l=n[3],c=this.invSubMix,u=c[0],f=c[1],d=c[2],_=c[3],b=new Uint32Array(256);let E=0,G=0,N=0;for(N=0;N<256;N++)N<128?b[N]=N<<1:b[N]=N<<1^283;for(N=0;N<256;N++){let le=G^G<<1^G<<2^G<<3^G<<4;le=le>>>8^le&255^99,e[E]=le,t[le]=E;const ke=b[E],Ee=b[ke],Ke=b[Ee];let We=b[le]*257^le*16843008;r[E]=We<<24|We>>>8,i[E]=We<<16|We>>>16,s[E]=We<<8|We>>>24,l[E]=We,We=Ke*16843009^Ee*65537^ke*257^E*16843008,u[le]=We<<24|We>>>8,f[le]=We<<16|We>>>16,d[le]=We<<8|We>>>24,_[le]=We,E?(E=ke^b[b[b[Ke^ke]]],G^=b[b[G]]):E=G=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,r=0;for(;r<t.length&&n;)n=t[r]===this.key[r],r++;if(n)return;this.key=t;const i=this.keySize=t.length;if(i!==4&&i!==6&&i!==8)throw new Error("Invalid aes key size="+i);const s=this.ksRows=(i+6+1)*4;let l,c;const u=this.keySchedule=new Uint32Array(s),f=this.invKeySchedule=new Uint32Array(s),d=this.sBox,_=this.rcon,b=this.invSubMix,E=b[0],G=b[1],N=b[2],le=b[3];let ke,Ee;for(l=0;l<s;l++){if(l<i){ke=u[l]=t[l];continue}Ee=ke,l%i===0?(Ee=Ee<<8|Ee>>>24,Ee=d[Ee>>>24]<<24|d[Ee>>>16&255]<<16|d[Ee>>>8&255]<<8|d[Ee&255],Ee^=_[l/i|0]<<24):i>6&&l%i===4&&(Ee=d[Ee>>>24]<<24|d[Ee>>>16&255]<<16|d[Ee>>>8&255]<<8|d[Ee&255]),u[l]=ke=(u[l-i]^Ee)>>>0}for(c=0;c<s;c++)l=s-c,c&3?Ee=u[l]:Ee=u[l-4],c<4||l<=4?f[c]=Ee:f[c]=E[d[Ee>>>24]]^G[d[Ee>>>16&255]]^N[d[Ee>>>8&255]]^le[d[Ee&255]],f[c]=f[c]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){const r=this.keySize+6,i=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,c=l[0],u=l[1],f=l[2],d=l[3],_=this.uint8ArrayToUint32Array_(n);let b=_[0],E=_[1],G=_[2],N=_[3];const le=new Int32Array(e),ke=new Int32Array(le.length);let Ee,Ke,We,gt,Xe,st,ht,Je,Kt,dn,zn,Dn,Rn,hn;const Ln=this.networkToHostOrderSwap;for(;t<le.length;){for(Kt=Ln(le[t]),dn=Ln(le[t+1]),zn=Ln(le[t+2]),Dn=Ln(le[t+3]),Xe=Kt^i[0],st=Dn^i[1],ht=zn^i[2],Je=dn^i[3],Rn=4,hn=1;hn<r;hn++)Ee=c[Xe>>>24]^u[st>>16&255]^f[ht>>8&255]^d[Je&255]^i[Rn],Ke=c[st>>>24]^u[ht>>16&255]^f[Je>>8&255]^d[Xe&255]^i[Rn+1],We=c[ht>>>24]^u[Je>>16&255]^f[Xe>>8&255]^d[st&255]^i[Rn+2],gt=c[Je>>>24]^u[Xe>>16&255]^f[st>>8&255]^d[ht&255]^i[Rn+3],Xe=Ee,st=Ke,ht=We,Je=gt,Rn=Rn+4;Ee=s[Xe>>>24]<<24^s[st>>16&255]<<16^s[ht>>8&255]<<8^s[Je&255]^i[Rn],Ke=s[st>>>24]<<24^s[ht>>16&255]<<16^s[Je>>8&255]<<8^s[Xe&255]^i[Rn+1],We=s[ht>>>24]<<24^s[Je>>16&255]<<16^s[Xe>>8&255]<<8^s[st&255]^i[Rn+2],gt=s[Je>>>24]<<24^s[Xe>>16&255]<<16^s[st>>8&255]<<8^s[ht&255]^i[Rn+3],ke[t]=Ln(Ee^b),ke[t+1]=Ln(gt^E),ke[t+2]=Ln(We^G),ke[t+3]=Ln(Ke^N),b=Kt,E=dn,G=zn,N=Dn,t=t+4}return ke.buffer}}class bt{constructor(e,t,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=n}expandKey(){const e=Qt(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function Qt(a){switch(a){case nr.cbc:return"AES-CBC";case nr.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${a}`)}}const Yt=16;class mn{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(n){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?En(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n,r){return this.useSoftware?new Promise((i,s)=>{const l=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(l,t,n,r);const c=this.flush();c?i(c.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n,r)}softwareDecrypt(e,t,n,r){const{currentIV:i,currentResult:s,remainderData:l}=this;if(r!==nr.cbc||t.byteLength!==16)return q.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),l&&(e=ge(l,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;i&&(n=i);let u=this.softwareDecrypter;u||(u=this.softwareDecrypter=new Dt),u.expandKey(t);const f=s;return this.currentResult=u.decrypt(c.buffer,0,n),this.currentIV=c.slice(-16).buffer,f||null}webCryptoDecrypt(e,t,n,r){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n,r));this.key=t,this.fastAesKey=new bt(this.subtle,t,r)}return this.fastAesKey.expandKey().then(i=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new ar(this.subtle,new Uint8Array(n),r).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(q.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,n,r)))}onWebCryptoError(e,t,n,r){const i=this.enableSoftwareAES;if(i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,r);const s=this.flush();if(s)return s.buffer}throw new Error("WebCrypto"+(i?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%Yt;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(q.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Yn=Math.pow(2,17);class er{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const n=e.url;if(!n)return Promise.reject(new kn({type:fe.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${n?"part list":"url"}`),networkDetails:null}));this.abort();const r=this.config,i=r.fLoader,s=r.loader;return new Promise((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(E=>E[0]==="GAP")){c(xn(e));return}else e.gap=!1;const u=this.loader=i?new i(r):new s(r),f=en(e);e.loader=u;const d=ln(r.fragLoadPolicy.default),_={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:Yn};e.stats=u.stats;const b={onSuccess:(E,G,N,le)=>{this.resetLoader(e,u);let ke=E.data;N.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(ke.slice(0,16)),ke=ke.slice(16)),l({frag:e,part:null,payload:ke,networkDetails:le})},onError:(E,G,N,le)=>{this.resetLoader(e,u),c(new kn({type:fe.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:y({url:n,data:void 0},E),error:new Error(`HTTP Error ${E.code} ${E.text}`),networkDetails:N,stats:le}))},onAbort:(E,G,N)=>{this.resetLoader(e,u),c(new kn({type:fe.NETWORK_ERROR,details:$.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:N,stats:E}))},onTimeout:(E,G,N)=>{this.resetLoader(e,u),c(new kn({type:fe.NETWORK_ERROR,details:$.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${_.timeout}ms`),networkDetails:N,stats:E}))}};t&&(b.onProgress=(E,G,N,le)=>t({frag:e,part:null,payload:N,networkDetails:le})),u.load(f,_,b)})}loadPart(e,t,n){this.abort();const r=this.config,i=r.fLoader,s=r.loader;return new Promise((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(xn(e,t));return}const u=this.loader=i?new i(r):new s(r),f=en(e,t);e.loader=u;const d=ln(r.fragLoadPolicy.default),_={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Yn};t.stats=u.stats,u.load(f,_,{onSuccess:(b,E,G,N)=>{this.resetLoader(e,u),this.updateStatsFromPart(e,t);const le={frag:e,part:t,payload:b.data,networkDetails:N};n(le),l(le)},onError:(b,E,G,N)=>{this.resetLoader(e,u),c(new kn({type:fe.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:y({url:f.url,data:void 0},b),error:new Error(`HTTP Error ${b.code} ${b.text}`),networkDetails:G,stats:N}))},onAbort:(b,E,G)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,u),c(new kn({type:fe.NETWORK_ERROR,details:$.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:G,stats:b}))},onTimeout:(b,E,G)=>{this.resetLoader(e,u),c(new kn({type:fe.NETWORK_ERROR,details:$.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${_.timeout}ms`),networkDetails:G,stats:b}))}})})}updateStatsFromPart(e,t){const n=e.stats,r=t.stats,i=r.total;if(n.loaded+=r.loaded,i){const c=Math.round(e.duration/t.duration),u=Math.min(Math.round(n.loaded/i),c),d=(c-u)*Math.round(n.loaded/u);n.total=n.loaded+d}else n.total=Math.max(n.loaded,n.total);const s=n.loading,l=r.loading;s.start?s.first+=l.first-l.start:(s.start=l.start,s.first=l.first),s.end=l.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function en(a,e=null){const t=e||a,n={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},r=t.byteRangeStartOffset,i=t.byteRangeEndOffset;if(k(r)&&k(i)){var s;let l=r,c=i;if(a.sn==="initSegment"&&Pn((s=a.decryptdata)==null?void 0:s.method)){const u=i-r;u%16&&(c=i+(16-u%16)),r!==0&&(n.resetIV=!0,l=r-16)}n.rangeStart=l,n.rangeEnd=c}return n}function xn(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:fe.MEDIA_ERROR,details:$.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new kn(n)}function Pn(a){return a==="AES-128"||a==="AES-256"}class kn extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class dr extends z{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 bn{constructor(e,t,n,r=0,i=-1,s=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=jn(),this.buffering={audio:jn(),video:jn(),audiovideo:jn()},this.level=e,this.sn=t,this.id=n,this.size=r,this.part=i,this.partial=s}}function jn(){return{start:0,executeStart:0,executeEnd:0,end:0}}const Xn={length:0,start:()=>0,end:()=>0};class tn{static isBuffered(e,t){if(e){const n=tn.getBuffered(e);for(let r=n.length;r--;)if(t>=n.start(r)&&t<=n.end(r))return!0}return!1}static bufferedRanges(e){if(e){const t=tn.getBuffered(e);return tn.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}static bufferInfo(e,t,n){if(e){const r=tn.bufferedRanges(e);if(r.length)return tn.bufferedInfo(r,t,n)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.length>1&&e.sort((f,d)=>f.start-d.start||d.end-f.end);let r=-1,i=[];if(n)for(let f=0;f<e.length;f++){t>=e[f].start&&t<=e[f].end&&(r=f);const d=i.length;if(d){const _=i[d-1].end;e[f].start-_<n?e[f].end>_&&(i[d-1].end=e[f].end):i.push(e[f])}else i.push(e[f])}else i=e;let s=0,l,c=t,u=t;for(let f=0;f<i.length;f++){const d=i[f].start,_=i[f].end;if(r===-1&&t>=d&&t<=_&&(r=f),t+n>=d&&t<_)c=d,u=_,s=u-t;else if(t+n<d){l=d;break}}return{len:s,start:c||0,end:u||0,nextStart:l,buffered:e,bufferedIndex:r}}static getBuffered(e){try{return e.buffered||Xn}catch(t){return q.log("failed to get media.buffered",t),Xn}}}const rr=/\{\$([a-zA-Z0-9-_]+)\}/g;function vr(a){return rr.test(a)}function hr(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(rr,n=>{const r=n.substring(2,n.length-1),i=t==null?void 0:t[r];return i===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),n):i})}return e}function Er(a,e,t){let n=a.variableList;n||(a.variableList=n={});let r,i;if("QUERYPARAM"in e){r=e.QUERYPARAM;try{const s=new self.URL(t).searchParams;if(s.has(r))i=s.get(r);else throw new Error(`"${r}" does not match any query parameter in URI: "${t}"`)}catch(s){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${s.message}`))}}else r=e.NAME,i=e.VALUE;r in n?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):n[r]=i||""}function kr(a,e,t){const n=e.IMPORT;if(t&&n in t){let r=a.variableList;r||(a.variableList=r={}),r[n]=t[n]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}const Cr=/^(\d+)x(\d+)$/,br=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Kn{constructor(e,t){typeof e=="string"&&(e=Kn.parseAttrList(e,t)),h(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const n=new Uint8Array(t.length/2);for(let r=0;r<t.length/2;r++)n[r]=parseInt(t.slice(r*2,r*2+2),16);return n}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const n=this[e];return(n?n.split(/[ ,]+/):[]).reduce((r,i)=>(r[i.toLowerCase()]=!0,r),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Cr.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let n;const r={},i='"';for(br.lastIndex=0;(n=br.exec(e))!==null;){const s=n[1].trim();let l=n[2];const c=l.indexOf(i)===0&&l.lastIndexOf(i)===l.length-1;let u=!1;if(c)l=l.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":u=!0}if(t&&(c||u))l=hr(t,l);else if(!u&&!c)switch(s){case"CLOSED-CAPTIONS":if(l==="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":q.warn(`${e}: attribute ${s} is missing quotes`)}r[s]=l}return r}}const Xr="com.apple.hls.interstitial";function Mr(a){return a!=="ID"&&a!=="CLASS"&&a!=="CUE"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function zr(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class Tr{constructor(e,t,n=0){var r;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(t==null?void 0:t.tagAnchor)||null,this.tagOrder=(r=t==null?void 0:t.tagOrder)!=null?r:n,t){const i=t.attr;for(const s in i)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]!==i[s]){q.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=h(new Kn({}),i,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 i=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);k(i.getTime())&&(this._endDate=i)}}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?(q.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return t!==null?this._dateAtEnd=new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(k(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return this.class===Xr}get isValid(){return!!this.id&&!this._badValueForSameId&&k(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}const ai=10;class ti{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}get hasProgramDateTime(){return this.fragments.length?k(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||ai}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let n=e.length;n--;)if(e[n].index>t)return e[n].index;return t}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function Fr(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function Wr(a){switch(a){case"AES-128":case"AES-256":return nr.cbc;case"AES-256-CTR":return nr.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function Zr(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function Nr(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function Ar(a){const e=Nr(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function $r(a){const e=function(n,r,i){const s=n[r];n[r]=n[i],n[i]=s};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function Ir(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),r=n[n.length-1].split(",");if(r.length===2){const i=r[0]==="base64",s=r[1];i?(n.splice(-1,1),t=Zr(s)):t=Ar(s)}}return t}const _r=typeof self!="undefined"?self:void 0;var Fn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},lr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Sn(a){switch(a){case lr.FAIRPLAY:return Fn.FAIRPLAY;case lr.PLAYREADY:return Fn.PLAYREADY;case lr.WIDEVINE:return Fn.WIDEVINE;case lr.CLEARKEY:return Fn.CLEARKEY}}var Zn={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function On(a){if(a===Zn.WIDEVINE)return Fn.WIDEVINE;if(a===Zn.PLAYREADY)return Fn.PLAYREADY;if(a===Zn.CENC||a===Zn.CLEARKEY)return Fn.CLEARKEY}function Un(a){switch(a){case Fn.FAIRPLAY:return lr.FAIRPLAY;case Fn.PLAYREADY:return lr.PLAYREADY;case Fn.WIDEVINE:return lr.WIDEVINE;case Fn.CLEARKEY:return lr.CLEARKEY}}function ur(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[Fn.FAIRPLAY,Fn.WIDEVINE,Fn.PLAYREADY,Fn.CLEARKEY].filter(r=>!!e[r]):[];return!n[Fn.WIDEVINE]&&t&&n.push(Fn.WIDEVINE),n}const yr=function(a){return _r!=null&&(a=_r.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function gn(a,e,t,n){let r;switch(a){case Fn.FAIRPLAY:r=["cenc","sinf"];break;case Fn.WIDEVINE:case Fn.PLAYREADY:r=["cenc"];break;case Fn.CLEARKEY:r=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return In(r,e,t,n)}function In(a,e,t,n){return[{initDataTypes:a,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(i=>({contentType:`audio/mp4; codecs=${i}`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:t.map(i=>({contentType:`video/mp4; codecs=${i}`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function fr(a){var e;return a.sessionType==="persistent-license"||!!((e=a.sessionTypes)!=null&&e.some(t=>t==="persistent-license"))}function or(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),n=t.substring(t.indexOf("<"),t.length),s=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(s){const l=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(l){const c=Zr(l).subarray(0,16);return $r(c),c}}return null}let pr={};class Br{static clearKeyUriToKeyIdMap(){pr={}}constructor(e,t,n,r=[1],i=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=r,this.iv=i,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!Fr(e)}isSupported(){if(this.method){if(Fr(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case lr.FAIRPLAY:case lr.WIDEVINE:case lr.PLAYREADY:case lr.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(Fr(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(q.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=fi(e);return new Br(this.method,this.uri,"identity",this.keyFormatVersions,n)}const t=Ir(this.uri);if(t)switch(this.keyFormat){case lr.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case lr.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=xt(n,null,t),this.keyId=or(t);break}default:{let n=t.subarray(0,16);if(n.length!==16){const r=new Uint8Array(16);r.set(n,16-n.length),n=r}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n=pr[this.uri];if(!n){const r=Object.keys(pr).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,r),pr[this.uri]=n}this.keyId=n}return this}}function fi(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const Vr=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Qr=/#EXT-X-MEDIA:(.*)/g,oi=/^#EXT(?:INF|-X-TARGETDURATION):/m,Si=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),cs=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 ni{static findGroup(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r.id===t)return r}}static resolve(e,t){return J.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return oi.test(e)}static parseMasterPlaylist(e,t){const n=vr(e),r={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},i=[];Vr.lastIndex=0;let s;for(;(s=Vr.exec(e))!=null;)if(s[1]){var l;const u=new Kn(s[1],r),f=hr(r,s[2]),d={attrs:u,bitrate:u.decimalInteger("BANDWIDTH")||u.decimalInteger("AVERAGE-BANDWIDTH"),name:u.NAME,url:ni.resolve(f,t)},_=u.decimalResolution("RESOLUTION");_&&(d.width=_.width,d.height=_.height),ki(u.CODECS,d);const b=u["SUPPLEMENTAL-CODECS"];b&&(d.supplemental={},ki(b,d.supplemental)),(l=d.unknownCodecs)!=null&&l.length||i.push(d),r.levels.push(d)}else if(s[3]){const u=s[3],f=s[4];switch(u){case"SESSION-DATA":{const d=new Kn(f,r),_=d["DATA-ID"];_&&(r.sessionData===null&&(r.sessionData={}),r.sessionData[_]=d);break}case"SESSION-KEY":{const d=Ai(f,t,r);d.encrypted&&d.isSupported()?(r.sessionKeys===null&&(r.sessionKeys=[]),r.sessionKeys.push(d)):q.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${f}"`);break}case"DEFINE":{{const d=new Kn(f,r);Er(r,d,t)}break}case"CONTENT-STEERING":{const d=new Kn(f,r);r.contentSteering={uri:ni.resolve(d["SERVER-URI"],t),pathwayId:d["PATHWAY-ID"]||"."};break}case"START":{r.startTimeOffset=Ji(f);break}}}const c=i.length>0&&i.length<r.levels.length;return r.levels=c?i:r.levels,r.levels.length===0&&(r.playlistParsingError=new Error("no levels found in manifest")),r}static parseMasterPlaylistMedia(e,t,n){let r;const i={},s=n.levels,l={AUDIO:s.map(u=>({id:u.attrs.AUDIO,audioCodec:u.audioCodec})),SUBTITLES:s.map(u=>({id:u.attrs.SUBTITLES,textCodec:u.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(Qr.lastIndex=0;(r=Qr.exec(e))!==null;){const u=new Kn(r[1],n),f=u.TYPE;if(f){const d=l[f],_=i[f]||[];i[f]=_;const b=u.LANGUAGE,E=u["ASSOC-LANGUAGE"],G=u.CHANNELS,N=u.CHARACTERISTICS,le=u["INSTREAM-ID"],ke={attrs:u,bitrate:0,id:c++,groupId:u["GROUP-ID"]||"",name:u.NAME||b||"",type:f,default:u.bool("DEFAULT"),autoselect:u.bool("AUTOSELECT"),forced:u.bool("FORCED"),lang:b,url:u.URI?ni.resolve(u.URI,t):""};if(E&&(ke.assocLang=E),G&&(ke.channels=G),N&&(ke.characteristics=N),le&&(ke.instreamId=le),d!=null&&d.length){const Ee=ni.findGroup(d,ke.groupId)||d[0];di(ke,Ee,"audioCodec"),di(ke,Ee,"textCodec")}_.push(ke)}}return i}static parseLevelPlaylist(e,t,n,r,i,s){var l;const c={url:t},u=new ti(t),f=u.fragments,d=[];let _=null,b=0,E=0,G=0,N=0,le=0,ke=null,Ee=new Be(r,c),Ke,We,gt,Xe=-1,st=!1,ht=null,Je;if(Si.lastIndex=0,u.m3u8=e,u.hasVariableRefs=vr(e),((l=Si.exec(e))==null?void 0:l[0])!=="#EXTM3U")return u.playlistParsingError=new Error("Missing format identifier #EXTM3U"),u;for(;(Ke=Si.exec(e))!==null;){st&&(st=!1,Ee=new Be(r,c),Ee.playlistOffset=G,Ee.start=G,Ee.sn=b,Ee.cc=N,le&&(Ee.bitrate=le),Ee.level=n,_&&(Ee.initSegment=_,_.rawProgramDateTime&&(Ee.rawProgramDateTime=_.rawProgramDateTime,_.rawProgramDateTime=null),ht&&(Ee.setByteRange(ht),ht=null)));const Dn=Ke[1];if(Dn){Ee.duration=parseFloat(Dn);const Rn=(" "+Ke[2]).slice(1);Ee.title=Rn||null,Ee.tagList.push(Rn?["INF",Dn,Rn]:["INF",Dn])}else if(Ke[3]){if(k(Ee.duration)){Ee.playlistOffset=G,Ee.start=G,gt&&Oi(Ee,gt,u),Ee.sn=b,Ee.level=n,Ee.cc=N,f.push(Ee);const Rn=(" "+Ke[3]).slice(1);Ee.relurl=hr(u,Rn),Pi(Ee,ke,d),ke=Ee,G+=Ee.duration,b++,E=0,st=!0}}else{if(Ke=Ke[0].match(cs),!Ke){q.warn("No matches on slow regex match for level playlist!");continue}for(We=1;We<Ke.length&&Ke[We]===void 0;We++);const Rn=(" "+Ke[We]).slice(1),hn=(" "+Ke[We+1]).slice(1),Ln=Ke[We+2]?(" "+Ke[We+2]).slice(1):null;switch(Rn){case"BYTERANGE":ke?Ee.setByteRange(hn,ke):Ee.setByteRange(hn);break;case"PROGRAM-DATE-TIME":Ee.rawProgramDateTime=hn,Ee.tagList.push(["PROGRAM-DATE-TIME",hn]),Xe===-1&&(Xe=f.length);break;case"PLAYLIST-TYPE":u.type&&li(u,Rn,Ke),u.type=hn.toUpperCase();break;case"MEDIA-SEQUENCE":u.startSN!==0?li(u,Rn,Ke):f.length>0&&Mi(u,Rn,Ke),b=u.startSN=parseInt(hn);break;case"SKIP":{u.skippedSegments&&li(u,Rn,Ke);const Nn=new Kn(hn,u),Gt=Nn.decimalInteger("SKIPPED-SEGMENTS");if(k(Gt)){u.skippedSegments+=Gt;for(let sr=Gt;sr--;)f.push(null);b+=Gt}const Jt=Nn.enumeratedString("RECENTLY-REMOVED-DATERANGES");Jt&&(u.recentlyRemovedDateranges=(u.recentlyRemovedDateranges||[]).concat(Jt.split(" ")));break}case"TARGETDURATION":u.targetduration!==0&&li(u,Rn,Ke),u.targetduration=Math.max(parseInt(hn),1);break;case"VERSION":u.version!==null&&li(u,Rn,Ke),u.version=parseInt(hn);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":u.live||li(u,Rn,Ke),u.live=!1;break;case"#":(hn||Ln)&&Ee.tagList.push(Ln?[hn,Ln]:[hn]);break;case"DISCONTINUITY":N++,Ee.tagList.push(["DIS"]);break;case"GAP":Ee.gap=!0,Ee.tagList.push([Rn]);break;case"BITRATE":Ee.tagList.push([Rn,hn]),le=parseInt(hn)*1e3,k(le)?Ee.bitrate=le:le=0;break;case"DATERANGE":{const Nn=new Kn(hn,u),Gt=new Tr(Nn,u.dateRanges[Nn.ID],u.dateRangeTagCount);u.dateRangeTagCount++,Gt.isValid||u.skippedSegments?u.dateRanges[Gt.id]=Gt:q.warn(`Ignoring invalid DATERANGE tag: "${hn}"`),Ee.tagList.push(["EXT-X-DATERANGE",hn]);break}case"DEFINE":{{const Nn=new Kn(hn,u);"IMPORT"in Nn?kr(u,Nn,s):Er(u,Nn,t)}break}case"DISCONTINUITY-SEQUENCE":u.startCC!==0?li(u,Rn,Ke):f.length>0&&Mi(u,Rn,Ke),u.startCC=N=parseInt(hn);break;case"KEY":{const Nn=Ai(hn,t,u);if(Nn.isSupported()){if(Nn.method==="NONE"){gt=void 0;break}gt||(gt={}),gt[Nn.keyFormat]&&(gt=h({},gt)),gt[Nn.keyFormat]=Nn}else q.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${hn}"`);break}case"START":u.startTimeOffset=Ji(hn);break;case"MAP":{const Nn=new Kn(hn,u);if(Ee.duration){const Gt=new Be(r,c);Vi(Gt,Nn,n,gt),_=Gt,Ee.initSegment=_,_.rawProgramDateTime&&!Ee.rawProgramDateTime&&(Ee.rawProgramDateTime=_.rawProgramDateTime)}else{const Gt=Ee.byteRangeEndOffset;if(Gt){const Jt=Ee.byteRangeStartOffset;ht=`${Gt-Jt}@${Jt}`}else ht=null;Vi(Ee,Nn,n,gt),_=Ee,st=!0}_.cc=N;break}case"SERVER-CONTROL":{Je&&li(u,Rn,Ke),Je=new Kn(hn),u.canBlockReload=Je.bool("CAN-BLOCK-RELOAD"),u.canSkipUntil=Je.optionalFloat("CAN-SKIP-UNTIL",0),u.canSkipDateRanges=u.canSkipUntil>0&&Je.bool("CAN-SKIP-DATERANGES"),u.partHoldBack=Je.optionalFloat("PART-HOLD-BACK",0),u.holdBack=Je.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{u.partTarget&&li(u,Rn,Ke);const Nn=new Kn(hn);u.partTarget=Nn.decimalFloatingPoint("PART-TARGET");break}case"PART":{let Nn=u.partList;Nn||(Nn=u.partList=[]);const Gt=E>0?Nn[Nn.length-1]:void 0,Jt=E++,sr=new Kn(hn,u),Qn=new Ze(sr,Ee,c,Jt,Gt);Nn.push(Qn),Ee.duration+=Qn.duration;break}case"PRELOAD-HINT":{const Nn=new Kn(hn,u);u.preloadHint=Nn;break}case"RENDITION-REPORT":{const Nn=new Kn(hn,u);u.renditionReports=u.renditionReports||[],u.renditionReports.push(Nn);break}default:q.warn(`line parsed but not handled: ${Ke}`);break}}}ke&&!ke.relurl?(f.pop(),G-=ke.duration,u.partList&&(u.fragmentHint=ke)):u.partList&&(Pi(Ee,ke,d),Ee.cc=N,u.fragmentHint=Ee,gt&&Oi(Ee,gt,u)),u.targetduration||(u.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const Kt=f.length,dn=f[0],zn=f[Kt-1];if(G+=u.skippedSegments*u.targetduration,G>0&&Kt&&zn){u.averagetargetduration=G/Kt;const Dn=zn.sn;u.endSN=Dn!=="initSegment"?Dn:0,u.live||(zn.endList=!0),dn&&u.startCC===void 0&&(u.startCC=dn.cc),Xe>0&&(Gi(f,Xe),dn&&d.unshift(dn))}else u.endSN=0,u.startCC=0;return u.fragmentHint&&(G+=u.fragmentHint.duration),u.totalduration=G,d.length&&u.dateRangeTagCount&&dn&&_i(d,u),u.endCC=N,u}}function _i(a,e){const t=a.length;if(!t)return;const n=a[t-1],r=e.live?1/0:e.totalduration,i=Object.keys(e.dateRanges);for(let s=i.length;s--;){const l=e.dateRanges[i[s]],c=l.startDate.getTime();l.tagAnchor=n.ref;for(let u=t;u--;){const f=Qi(e,c,a,u,r);if(f!==-1){l.tagAnchor=e.fragments[f].ref;break}}}}function Qi(a,e,t,n,r){const i=t[n];if(i){const l=i.programDateTime;if(e>=l||n===0){var s;const c=(((s=t[n+1])==null?void 0:s.start)||r)-i.start;if(e<=l+c*1e3){const u=t[n].sn-a.startSN,f=a.fragments;if(f.length>t.length){const _=(t[n+1]||f[f.length-1]).sn-a.startSN;for(let b=_;b>u;b--){const E=f[b].programDateTime;if(e>=E&&e<E+f[b].duration*1e3)return b}}return u}}}return-1}function Ai(a,e,t){var n,r;const i=new Kn(a,t),s=(n=i.METHOD)!=null?n:"",l=i.URI,c=i.hexadecimalInteger("IV"),u=i.KEYFORMATVERSIONS,f=(r=i.KEYFORMAT)!=null?r:"identity";l&&i.IV&&!c&&q.error(`Invalid IV: ${i.IV}`);const d=l?ni.resolve(l,e):"",_=(u||"1").split("/").map(Number).filter(Number.isFinite);return new Br(s,d,f,_,c)}function Ji(a){const t=new Kn(a).decimalFloatingPoint("TIME-OFFSET");return k(t)?t:null}function ki(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const r=t.filter(i=>Ut(i,n));r.length&&(e[`${n}Codec`]=r.map(i=>i.split("/")[0]).join(","),t=t.filter(i=>r.indexOf(i)===-1))}),e.unknownCodecs=t}function di(a,e,t){const n=e[t];n&&(a[t]=n)}function Gi(a,e){let t=a[e];for(let n=e;n--;){const r=a[n];if(!r)return;r.programDateTime=t.programDateTime-r.duration*1e3,t=r}}function Pi(a,e,t){a.rawProgramDateTime?t.push(a):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime)}function Vi(a,e,t,n){a.relurl=e.URI,e.BYTERANGE&&a.setByteRange(e.BYTERANGE),a.level=t,a.sn="initSegment",n&&(a.levelkeys=n),a.initSegment=null}function Oi(a,e,t){a.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(r=>e[r].isCommonEncryption)&&n.push(a)}function li(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function Mi(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function zi(a,e){const t=e.startPTS;if(k(t)){let n=0,r;e.sn>a.sn?(n=t-a.start,r=a):(n=a.start-t,r=e),r.duration!==n&&r.setDuration(n)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.setStart(a.start+(a.minEndPTS-a.start)):e.setStart(a.start+a.duration):e.setStart(Math.max(a.start-e.duration,0))}function qi(a,e,t,n,r,i){n-t<=0&&(q.warn("Fragment should have a positive duration",e),n=t+e.duration,i=r+e.duration);let l=t,c=n;const u=e.startPTS,f=e.endPTS;if(k(u)){const N=Math.abs(u-t);k(e.deltaPTS)?e.deltaPTS=Math.max(N,e.deltaPTS):e.deltaPTS=N,l=Math.max(t,u),t=Math.min(t,u),r=Math.min(r,e.startDTS),c=Math.min(n,f),n=Math.max(n,f),i=Math.max(i,e.endDTS)}const d=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(n-e.start),e.startPTS=t,e.maxStartPTS=l,e.startDTS=r,e.endPTS=n,e.minEndPTS=c,e.endDTS=i;const _=e.sn;if(!a||_<a.startSN||_>a.endSN)return 0;let b;const E=_-a.startSN,G=a.fragments;for(G[E]=e,b=E;b>0;b--)zi(G[b],G[b-1]);for(b=E;b<G.length-1;b++)zi(G[b],G[b+1]);return a.fragmentHint&&zi(G[G.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,d}function fs(a,e){if(a===e)return;let t=null;const n=a.fragments;for(let u=n.length-1;u>=0;u--){const f=n[u].initSegment;if(f){t=f;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let r;yi(a,e,(u,f,d,_)=>{if((!e.startCC||e.skippedSegments)&&f.cc!==u.cc){const b=u.cc-f.cc;for(let E=d;E<_.length;E++)_[E].cc+=b;e.endCC=_[_.length-1].cc}k(u.startPTS)&&k(u.endPTS)&&(f.setStart(f.startPTS=u.startPTS),f.startDTS=u.startDTS,f.maxStartPTS=u.maxStartPTS,f.endPTS=u.endPTS,f.endDTS=u.endDTS,f.minEndPTS=u.minEndPTS,f.setDuration(u.endPTS-u.startPTS),f.duration&&(r=f),e.PTSKnown=e.alignedSliding=!0),u.hasStreams&&(f.elementaryStreams=u.elementaryStreams),f.loader=u.loader,u.hasStats&&(f.stats=u.stats),u.initSegment&&(f.initSegment=u.initSegment,t=u.initSegment)});const i=e.fragments,s=e.fragmentHint?i.concat(e.fragmentHint):i;if(t&&s.forEach(u=>{var f;u&&(!u.initSegment||u.initSegment.relurl===((f=t)==null?void 0:f.relurl))&&(u.initSegment=t)}),e.skippedSegments){if(e.deltaUpdateFailed=i.some(u=>!u),e.deltaUpdateFailed){q.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let u=e.skippedSegments;u--;)i.shift();e.startSN=i[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=ds(a.dateRanges,e));const u=a.fragments.filter(f=>f.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let f=1;f<s.length;f++)s[f].programDateTime===null&&Pi(s[f],s[f-1],u);_i(u,e)}e.endCC=i[i.length-1].cc}if(!e.startCC){var l;const u=Lr(a,e.startSN-1);e.startCC=(l=u==null?void 0:u.cc)!=null?l:i[0].cc}Wi(a.partList,e.partList,(u,f)=>{f.elementaryStreams=u.elementaryStreams,f.stats=u.stats}),r?qi(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS):ir(a,e),i.length&&(e.totalduration=e.edge-i[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const c=e.advancedDateTime;if(e.advanced&&c){const u=e.edge;e.driftStart||(e.driftStartTime=c,e.driftStart=u),e.driftEndTime=c,e.driftEnd=u}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function ds(a,e){const{dateRanges:t,recentlyRemovedDateranges:n}=e,r=h({},a);n&&n.forEach(l=>{delete r[l]});const s=Object.keys(r).length;return s&&Object.keys(t).forEach(l=>{const c=r[l],u=new Tr(t[l].attr,c);u.isValid?(r[l]=u,c||(u.tagOrder+=s)):q.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${ot(t[l].attr)}"`)}),r}function Wi(a,e,t){if(a&&e){let n=0;for(let r=0,i=a.length;r<=i;r++){const s=a[r],l=e[r+n];s&&l&&s.index===l.index&&s.fragment.sn===l.fragment.sn?t(s,l):n--}}}function yi(a,e,t){const n=e.skippedSegments,r=Math.max(a.startSN,e.startSN)-e.startSN,i=(a.fragmentHint?1:0)+(n?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,s=e.startSN-a.startSN,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let u=r;u<=i;u++){const f=c[s+u];let d=l[u];if(n&&!d&&f&&(d=e.fragments[u]=f),f&&d){if(t(f,d,u,l),f.url&&f.url!==d.url){e.playlistParsingError=cr(`media sequence mismatch ${d.sn}:`,a,e,f,d);return}else if(f.cc!==d.cc){e.playlistParsingError=cr(`discontinuity sequence mismatch (${f.cc}!=${d.cc})`,a,e,f,d);return}}}}function cr(a,e,t,n,r){return new Error(`${a} ${r.url}
Playlist starting @${e.startSN}
${e.m3u8}
Playlist starting @${t.startSN}
${t.m3u8}`)}function ir(a,e,t=!0){const n=e.startSN+e.skippedSegments-a.startSN,r=a.fragments,i=n>=0;let s=0;if(i&&n<r.length)s=r[n].start;else if(i&&e.startSN===a.endSN+1)s=a.fragmentEnd;else if(i&&t)s=a.fragmentStart+n*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)s=a.fragmentStart;else return;Ur(e,s)}function Ur(a,e){if(e){const t=a.fragments;for(let n=a.skippedSegments;n<t.length;n++)t[n].addStart(e);a.fragmentHint&&a.fragmentHint.addStart(e)}}function Kr(a,e=1/0){let t=1e3*a.targetduration;if(a.updated){const n=a.fragments;if(n.length&&t*4>e){const i=n[n.length-1].duration*1e3;i<t&&(t=i)}}else t/=2;return Math.round(t)}function Lr(a,e,t){if(!a)return null;let n=a.fragments[e-a.startSN];return n||(n=a.fragmentHint,n&&n.sn===e)?n:e<a.startSN&&t&&t.sn===e?t:null}function Pr(a,e,t){return a?ri(a.partList,e,t):null}function ri(a,e,t){if(a)for(let n=a.length;n--;){const r=a[n];if(r.index===t&&r.fragment.sn===e)return r}return null}function Jr(a){a.forEach((e,t)=>{var n;(n=e.details)==null||n.fragments.forEach(r=>{r.level=t,r.initSegment&&(r.initSegment.level=t)})})}function qr(a,e){for(let n=0,r=a.length;n<r;n++){var t;if(((t=a[n])==null?void 0:t.cc)===e)return a[n]}return null}function Ei(a,e){return!!(a&&e.startCC<a.endCC&&e.endCC>a.startCC)}function hi(a,e){if(a){const t=a.start+e;a.start=a.startPTS=t,a.endPTS=t+a.duration}}function Di(a,e){const t=e.fragments;for(let n=0,r=t.length;n<r;n++)hi(t[n],a);e.fragmentHint&&hi(e.fragmentHint,a),e.alignedSliding=!0}function Fi(a,e){a&&(xs(e,a),!e.alignedSliding&&a&&es(e,a),!e.alignedSliding&&a&&!e.skippedSegments&&ir(a,e,!1))}function xs(a,e){if(!Ei(e,a))return;const t=Math.min(e.endCC,a.endCC),n=qr(e.fragments,t),r=qr(a.fragments,t);if(!n||!r)return;q.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const i=n.start-r.start;Di(i,a)}function es(a,e){if(!a.hasProgramDateTime||!e.hasProgramDateTime)return;const t=a.fragments,n=e.fragments;if(!t.length||!n.length)return;let r,i;const s=Math.min(e.endCC,a.endCC);e.startCC<s&&a.startCC<s&&(r=qr(n,s),i=qr(t,s)),(!r||!i)&&(r=n[Math.floor(n.length/2)],i=qr(t,r.cc)||t[Math.floor(t.length/2)]);const l=r.programDateTime,c=i.programDateTime;if(!l||!c)return;const u=(c-l)/1e3-(i.start-r.start);Di(u,a)}const Or={toString:function(a){let e="";const t=a.length;for(let n=0;n<t;n++)e+=`[${a.start(n).toFixed(3)}-${a.end(n).toFixed(3)}]`;return e}},ft={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class Dr extends dr{constructor(e,t,n,r,i){super(r,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=ft.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:s,fragCurrent:l,media:c,mediaBuffer:u,state:f}=this,d=c?c.currentTime:0,_=tn.bufferInfo(u||c,d,s.maxBufferHole);if(this.log(`media seeking to ${k(d)?d.toFixed(3):d}, state: ${f}`),this.state===ft.ENDED)this.resetLoadingState();else if(l){const b=s.maxFragLookUpTolerance,E=l.start-b,G=l.start+l.duration+b;if(!_.len||G<_.start||E>_.end){const N=d>G;(d<E||N)&&(N&&l.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),l.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(c){this.fragmentTracker.removeFragmentsInRange(d,1/0,this.playlistType,!0);const b=this.lastCurrentTime;if(d>b&&(this.lastCurrentTime=d),!this.loadingParts){const E=Math.max(_.end,d),G=this.shouldLoadParts(this.getLevelDetails(),E);G&&(this.log(`LL-Part loading ON after seeking to ${d.toFixed(2)} with buffer @${E.toFixed(2)}`),this.loadingParts=G)}}!this.hls.hasEnoughToStart&&!_.len&&(this.log(`setting startPosition to ${d} because of seek before start`),this.nextLoadPosition=this.startPosition=d),this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=i,this.hls=e,this.fragmentLoader=new er(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new mn(e.config)}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===ft.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=ft.STOPPED}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return t===-1&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const n=e.end||0,r=this.config.timelineOffset||0;if(n<=r)return!1;const i=e.buffered;this.config.maxBufferHole&&i&&i.length>1&&(e=tn.bufferedInfo(i,e.start,0));const s=e.nextStart;if(s&&s>r&&s<t.edge||this.media.currentTime<e.start)return!1;const c=t.partList;if(c!=null&&c.length){const f=c[c.length-1];return tn.isBuffered(this.media,f.start+f.duration/2)}const u=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(u)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levelLastLoaded)==null?void 0:e.details}}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;n.removeEventListener("seeking",this.onMediaSeeking),n.removeEventListener("ended",this.onMediaEnded),n.addEventListener("seeking",this.onMediaSeeking),n.addEventListener("ended",this.onMediaEnded);const r=this.config;this.levels&&r.autoStartLoad&&this.state===ft.STOPPED&&this.startLoad(r.startPosition)}onMediaDetaching(e,t){const n=!!t.transferMedia,r=this.media;if(r!==null){if(r.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),r.removeEventListener("seeking",this.onMediaSeeking),r.removeEventListener("ended",this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=ft.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this.startFragRequested=!0,this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const r=i=>{const s=i.frag;if(this.fragContextChanged(s)){this.warn(`${s.type} sn: ${s.sn}${i.part?" part: "+i.part.index:""} of ${this.fragInfo(s,!1,i.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(s);return}s.stats.chunkCount++,this._handleFragmentLoadProgress(i)};this._doFragLoad(e,t,n,r).then(i=>{if(!i)return;const s=this.state,l=i.frag;if(this.fragContextChanged(l)){(s===ft.FRAG_LOADING||!this.fragCurrent&&s===ft.PARSING)&&(this.fragmentTracker.removeFragment(l),this.state=ft.IDLE);return}"payload"in i&&(this.log(`Loaded ${l.type} sn: ${l.sn} of ${this.playlistLabel()} ${l.level}`),this.hls.trigger(p.FRAG_LOADED,i)),this._handleFragmentLoadComplete(i)}).catch(i=>{this.state===ft.STOPPED||this.state===ft.ERROR||(this.warn(`Frag error: ${(i==null?void 0:i.message)||i}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===Bn.APPENDING){const i=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,i),l=Math.max(e.duration,s?s.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.sn:0)===1||this.reduceMaxBufferLength(l,e.duration))&&n.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===Bn.PARTIAL&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(t==null?void 0:t.live)&&t.type!=="EVENT"&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const r={startOffset:e,endOffset:t,type:n};this.hls.trigger(p.BUFFER_FLUSHING,r)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{const r=n==null?void 0:n.frag;if(!r||this.fragContextChanged(r)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:r}=this,{frag:i,payload:s}=n,l=i.decryptdata;if(s&&s.byteLength>0&&l!=null&&l.key&&l.iv&&Fr(l.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),l.key.buffer,l.iv.buffer,Wr(l.method)).catch(u=>{throw r.trigger(p.ERROR,{type:fe.MEDIA_ERROR,details:$.FRAG_DECRYPT_ERROR,fatal:!1,error:u,reason:u.message,frag:i}),u}).then(u=>{const f=self.performance.now();return r.trigger(p.FRAG_DECRYPTED,{frag:i,payload:u,stats:{tstart:c,tdecrypt:f}}),n.payload=u,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===ft.STOPPED||this.state===ft.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const n=e.frag.stats;this.state!==ft.STOPPED&&(this.state=ft.IDLE),e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${n?Or.toString(tn.getBuffered(n)):"(detached)"})`),ie(e)){var r;if(e.type!==ce.SUBTITLE){const s=e.elementaryStreams;if(!Object.keys(s).some(l=>!!s[l])){this.state=ft.IDLE;return}}const i=(r=this.levels)==null?void 0:r[e.level];i!=null&&i.fragmentError&&(this.log(`Resetting level fragment error count of ${i.fragmentError} on frag buffered`),i.fragmentError=0)}this.state=ft.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:r,partsLoaded:i}=e,s=!i||i.length===0||i.some(c=>!c),l=new bn(n.level,n.sn,n.stats.chunkCount+1,0,r?r.index:-1,!s);t.flush(l)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,r){var i;this.fragCurrent=e;const s=t==null?void 0:t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let l=null;e.encrypted&&!((i=e.decryptdata)!=null&&i.key)?(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=ft.KEY_LOADING,this.fragCurrent=e,l=this.keyLoader.load(e).then(d=>{if(!this.fragContextChanged(d.frag))return this.hls.trigger(p.KEY_LOADED,d),this.state===ft.KEY_LOADING&&(this.state=ft.IDLE),d}),this.hls.trigger(p.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(l=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):e.encrypted||(l=this.keyLoader.loadClear(e,s.encryptedFragments),l&&this.log("[eme] blocking frag load until media-keys acquired"));const c=this.fragPrevious;if(ie(e)&&(!c||e.sn!==c.sn)){const d=this.shouldLoadParts(t.details,e.end);d!==this.loadingParts&&(this.log(`LL-Part loading ${d?"ON":"OFF"} loading sn ${c==null?void 0:c.sn}->${e.sn}`),this.loadingParts=d)}if(n=Math.max(e.start,n||0),this.loadingParts&&ie(e)){const d=s.partList;if(d&&r){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const _=this.getNextPart(d,e,n);if(_>-1){const b=d[_];e=this.fragCurrent=b.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${b.index} (${_}/${d.length-1}) of ${this.fragInfo(e,!1,b)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=b.start+b.duration,this.state=ft.FRAG_LOADING;let E;return l?E=l.then(G=>!G||this.fragContextChanged(G.frag)?null:this.doFragPartsLoad(e,b,t,r)).catch(G=>this.handleFragLoadError(G)):E=this.doFragPartsLoad(e,b,t,r).catch(G=>this.handleFragLoadError(G)),this.hls.trigger(p.FRAG_LOADING,{frag:e,part:b,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):E}else if(!e.url||this.loadedEndOfParts(d,n))return Promise.resolve(null)}}if(ie(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)}`),this.loadingParts=!1;else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${s?"["+s.startSN+"-"+s.endSN+"]":""}, target: ${parseFloat(n.toFixed(3))}`),k(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=ft.FRAG_LOADING;const u=this.config.progressive;let f;return u&&l?f=l.then(d=>!d||this.fragContextChanged(d==null?void 0:d.frag)?null:this.fragmentLoader.load(e,r)).catch(d=>this.handleFragLoadError(d)):f=Promise.all([this.fragmentLoader.load(e,u?r:void 0),l]).then(([d])=>(!u&&d&&r&&r(d),d)).catch(d=>this.handleFragLoadError(d)),this.hls.trigger(p.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):f}doFragPartsLoad(e,t,n,r){return new Promise((i,s)=>{var l;const c=[],u=(l=n.details)==null?void 0:l.partList,f=d=>{this.fragmentLoader.loadPart(e,d,r).then(_=>{c[d.index]=_;const b=_.part;this.hls.trigger(p.FRAG_LOADED,_);const E=Pr(n.details,e.sn,d.index+1)||ri(u,e.sn,d.index+1);if(E)f(E);else return i({frag:e,part:b,partsLoaded:c})}).catch(s)};f(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===$.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(p.ERROR,t)}else this.hls.trigger(p.ERROR,{type:fe.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==ft.PARSING){!this.fragCurrent&&this.state!==ft.STOPPED&&this.state!==ft.ERROR&&(this.state=ft.IDLE);return}const{frag:n,part:r,level:i}=t,s=self.performance.now();n.stats.parsing.end=s,r&&(r.stats.parsing.end=s);const l=this.getLevelDetails(),u=l&&n.sn>l.endSN||this.shouldLoadParts(l,n.end);u!==this.loadingParts&&(this.log(`LL-Part loading ${u?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=u),this.updateLevelTiming(n,r,i,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e!=null&&e.partList){var n;const i=e.partList[0],s=i.end+(((n=e.fragmentHint)==null?void 0:n.duration)||0);if(t>=s){var r;if((this.hls.hasEnoughToStart?((r=this.media)==null?void 0:r.currentTime)||this.lastCurrentTime:this.getLoadPosition())>i.start-i.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:r,sn:i,part:s}=e;if(!(t!=null&&t[r]))return this.warn(`Levels object was unset while buffering fragment ${i} of ${this.playlistLabel()} ${r}. The current chunk will not be buffered.`),null;const l=t[r],c=l.details,u=s>-1?Pr(c,i,s):null,f=u?u.fragment:Lr(c,i,n);return f?(n&&n!==f&&(f.stats=n.stats),{frag:f,part:u,level:l}):null}bufferFragmentData(e,t,n,r,i){var s;if(!e||this.state!==ft.PARSING)return;const{data1:l,data2:c}=e;let u=l;if(l&&c&&(u=ge(l,c)),!((s=u)!=null&&s.length))return;const f={type:e.type,frag:t,part:n,chunkMeta:r,parent:t.type,data:u};if(this.hls.trigger(p.BUFFER_APPENDING,f),e.dropped&&e.independent&&!n){if(i)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!tn.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,r=tn.bufferInfo(t,n,0),i=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,i*.25),l=Math.max(Math.min(e.start-s,r.end-s),n+s);e.start-l>s&&this.flushMainBuffer(l,e.start)}getFwdBufferInfo(e,t){var n;const r=this.getLoadPosition();if(!k(r))return null;const s=this.lastCurrentTime>r||(n=this.media)!=null&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,r,t,s)}getFwdBufferInfoAtPos(e,t,n,r){const i=tn.bufferInfo(e,t,r);if(i.len===0&&i.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,n);if(s&&(i.nextStart<=s.end||s.gap)){const l=Math.max(Math.min(i.nextStart,s.end)-t,r);return tn.bufferInfo(e,t,l)}}return i}getMaxBufferLength(e){const{config:t}=this;let n;return e?n=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):n=t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const n=this.config,r=Math.max(Math.min(e-t,n.maxBufferLength),t),i=Math.max(e-t*3,n.maxMaxBufferLength/2,r);return i>=r?(n.maxMaxBufferLength=i,this.warn(`Reduce max buffer length to ${i}s`),!0):!1}getAppendedFrag(e,t=ce.MAIN){var n;const r=(n=this.fragmentTracker)==null?void 0:n.getAppendedFrag(e,t);return r&&"fragment"in r?r.fragment:r}getNextFragment(e,t){const n=t.fragments,r=n.length;if(!r)return null;const{config:i}=this,s=n[0].start,l=i.lowLatencyMode&&!!t.partList;let c=null;if(t.live){const d=i.initialLiveManifestSize;if(r<d)return this.warn(`Not enough fragments to start playback (have: ${r}, need: ${d})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s){var u;l&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),c=this.getInitialLiveFragment(t);const _=this.hls.startPosition,b=this.hls.liveSyncPosition,E=c?(_!==-1&&_>=s?_:b)||c.start:e;this.log(`Setting startPosition to ${E} to match start frag at live edge. mainStart: ${_} liveSyncPosition: ${b} frag.start: ${(u=c)==null?void 0:u.start}`),this.startPosition=this.nextLoadPosition=E}}else e<=s&&(c=n[0]);if(!c){const d=this.loadingParts?t.partEnd:t.fragmentEnd;c=this.getFragmentAtPosition(e,d,t)}let f=this.filterReplacedPrimary(c,t);if(!f&&c){const d=c.sn-t.startSN;f=this.filterReplacedPrimary(n[d+1]||null,t)}return this.mapToInitFragWhenRequired(f)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===Bn.OK||n===Bn.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,r,i){let s=null;if(e.gap&&(s=this.getNextFragment(this.nextLoadPosition,t),s&&!s.gap&&n.nextStart)){const l=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,r,0);if(l!==null&&n.len+l.len>=i){const c=s.sn;return this.loopSn!==c&&(this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${c}`),this.loopSn=c),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(Hr(this.hls.config)){var e,t;if((e=this.hls.interstitialsManager)==null||(t=e.playingItem)==null?void 0:t.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(Hr(this.hls.config)&&e.type!==ce.SUBTITLE){const n=this.hls.interstitialsManager,r=n==null?void 0:n.bufferingItem;if(r){const s=r.event;if(s){if(s.appendInPlace||Math.abs(e.start-r.start)>1||r.start===0)return null}else if(e.end<=r.start&&(t==null?void 0:t.live)===!1||e.start>r.end&&r.nextEvent&&(r.nextEvent.appendInPlace||e.start-r.end>1))return null}const i=n==null?void 0:n.playerQueue;if(i)for(let s=i.length;s--;){const l=i[s].interstitial;if(l.appendInPlace&&e.start>=l.startTime&&e.end<=l.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,n){let r=-1,i=!1,s=!0;for(let l=0,c=e.length;l<c;l++){const u=e[l];if(s=s&&!u.independent,r>-1&&n<u.start)break;const f=u.loaded;f?r=-1:(i||u.independent||s)&&u.fragment===t&&(r=l),i=f}return r}loadedEndOfParts(e,t){const n=e[e.length-1];return n&&t>n.start&&n.loaded}getInitialLiveFragment(e){const t=e.fragments,n=this.fragPrevious;let r=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),r=pn(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){const i=n.sn+1;if(i>=e.startSN&&i<=e.endSN){const s=t[i-e.startSN];n.cc===s.cc&&(r=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=Nt(e,n.cc,n.end),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{const i=this.hls.liveSyncPosition;i!==null&&(r=this.getFragmentAtPosition(i,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}getFragmentAtPosition(e,t,n){const{config:r}=this;let{fragPrevious:i}=this,{fragments:s,endSN:l}=n;const{fragmentHint:c}=n,{maxFragLookUpTolerance:u}=r,f=n.partList,d=!!(this.loadingParts&&f!=null&&f.length&&c);d&&c&&!this.bitrateTest&&f[f.length-1].fragment.sn===c.sn&&(s=s.concat(c),l=c.sn);let _;if(e<t){var b;const G=e<this.lastCurrentTime||e>t-u||(b=this.media)!=null&&b.paused||!this.startFragRequested?0:u;_=kt(i,s,e,G)}else _=s[s.length-1];if(_){const E=_.sn-n.startSN,G=this.fragmentTracker.getState(_);if((G===Bn.OK||G===Bn.PARTIAL&&_.gap)&&(i=_),i&&_.sn===i.sn&&(!d||f[0].fragment.sn>_.sn||!n.live&&!d)&&i&&_.level===i.level){const le=s[E+1];_.sn<l&&this.fragmentTracker.getState(le)!==Bn.OK?_=le:_=null}}return _}alignPlaylists(e,t,n){const r=e.fragments.length;if(!r)return this.warn("No fragments in live playlist"),0;const i=e.fragmentStart,s=!t,l=e.alignedSliding&&k(i);if(s||!l&&!i){Fi(n,e);const c=e.fragmentStart;return this.log(`Live playlist sliding: ${c.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${r}`),c}return i}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;n<t&&(n=-1);const r=this.timelineOffset;if(n===-1){const i=this.startTimeOffset!==null,s=i?this.startTimeOffset:e.startTimeOffset;s!==null&&k(s)?(n=t+s,s<0&&(n+=e.edge),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${s} found in ${i?"multivariant":"media"} playlist`),this.startPosition=n):e.live?(n=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=n=0),this.lastCurrentTime=n+r}this.nextLoadPosition=n+r}getLoadPosition(){var e;const{media:t}=this;let n=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?n=t.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&ie(e)&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==ft.FRAG_LOADING_WAITING_RETRY)&&(this.state=ft.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const E=this.getCurrentContext(t.chunkMeta);E&&(t.frag=E.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){var r;this.warn(`Frag load error must match current frag to retry ${n.url} > ${(r=this.fragCurrent)==null?void 0:r.url}`);return}const i=t.details===$.FRAG_GAP;i&&this.fragmentTracker.fragBuffered(n,!0);const s=t.errorAction,{action:l,flags:c,retryCount:u=0,retryConfig:f}=s||{},d=!!s&&!!f,_=d&&l===Vt.RetryRequest,b=d&&!s.resolved&&c===Wt.MoveAllAlternatesMatchingHost;if(!_&&b&&ie(n)&&!n.endList)this.resetFragmentErrors(e),this.treatAsGap(n),s.resolved=!0;else if((_||b)&&u<f.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const E=cn(f,u);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${u+1}/${f.maxNumRetry} in ${E}ms`),s.resolved=!0,this.retryDate=self.performance.now()+E,this.state=ft.FRAG_LOADING_WAITING_RETRY}else if(f&&s)if(this.resetFragmentErrors(e),u<f.maxNumRetry)!i&&l!==Vt.RemoveAlternatePermanently&&(s.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${u})`);return}else l===Vt.SendAlternateToPenaltyBox?this.state=ft.WAITING_LEVEL:this.state=ft.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===ft.PARSING||this.state===ft.PARSED){const t=e.frag,n=e.parent,r=this.getFwdBufferInfo(this.mediaBuffer,n),i=r&&r.len>.5;i&&this.reduceMaxBufferLength(r.len,(t==null?void 0:t.duration)||10);const s=!i;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===ce.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==ft.STOPPED&&(this.state=ft.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const r=tn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,n),this.state===ft.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==ft.STOPPED&&(this.state=ft.IDLE)}resetStartWhenNotLoaded(e){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of ${this.playlistLabel()} ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,r){const i=n.details;if(!i){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((c,u)=>{const f=e.elementaryStreams[u];if(f){const d=f.endPTS-f.startPTS;if(d<=0)return this.warn(`Could not parse fragment ${e.sn} ${u} duration reliably (${d})`),c||!1;const _=r?0:qi(i,e,f.startPTS,f.endPTS,f.startDTS,f.endDTS);return this.hls.trigger(p.LEVEL_PTS_UPDATED,{details:i,level:n,drift:_,type:u,frag:e,start:f.startPTS,end:f.endPTS}),!0}return c},!1)){var l;if(n.fragmentError===0&&this.treatAsGap(e,n),((l=this.transmuxer)==null?void 0:l.error)===null){const c=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(c.message),this.hls.trigger(p.ERROR,{type:fe.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,error:c,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=ft.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(p.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===ce.MAIN?"level":"track"}fragInfo(e,t=!0,n){var r,i;return`${this.playlistLabel()} ${e.level} (${n?"part":"frag"}:[${((r=t&&!n?e.startPTS:(n||e).start)!=null?r:NaN).toFixed(3)}-${((i=t&&!n?e.endPTS:(n||e).end)!=null?i:NaN).toFixed(3)}]${n&&e.type==="main"?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function Hr(a){return!!a.interstitialsController&&a.enableInterstitialPlayback!==!1}class jr{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let n;if(e.length)e.length===1?n=e[0]:n=ts(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function ts(a,e){const t=new Uint8Array(e);let n=0;for(let r=0;r<a.length;r++){const i=a[r];t.set(i,n),n+=i.length}return t}var Hi={exports:{}},Ss;function Ts(){return Ss||(Ss=1,function(a){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function r(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function i(c,u,f,d,_){if(typeof f!="function")throw new TypeError("The listener must be a function");var b=new r(f,d||c,_),E=t?t+u:u;return c._events[E]?c._events[E].fn?c._events[E]=[c._events[E],b]:c._events[E].push(b):(c._events[E]=b,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,d;if(this._eventsCount===0)return u;for(d in f=this._events)e.call(f,d)&&u.push(t?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=t?t+u:u,d=this._events[f];if(!d)return[];if(d.fn)return[d.fn];for(var _=0,b=d.length,E=new Array(b);_<b;_++)E[_]=d[_].fn;return E},l.prototype.listenerCount=function(u){var f=t?t+u:u,d=this._events[f];return d?d.fn?1:d.length:0},l.prototype.emit=function(u,f,d,_,b,E){var G=t?t+u:u;if(!this._events[G])return!1;var N=this._events[G],le=arguments.length,ke,Ee;if(N.fn){switch(N.once&&this.removeListener(u,N.fn,void 0,!0),le){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,f),!0;case 3:return N.fn.call(N.context,f,d),!0;case 4:return N.fn.call(N.context,f,d,_),!0;case 5:return N.fn.call(N.context,f,d,_,b),!0;case 6:return N.fn.call(N.context,f,d,_,b,E),!0}for(Ee=1,ke=new Array(le-1);Ee<le;Ee++)ke[Ee-1]=arguments[Ee];N.fn.apply(N.context,ke)}else{var Ke=N.length,We;for(Ee=0;Ee<Ke;Ee++)switch(N[Ee].once&&this.removeListener(u,N[Ee].fn,void 0,!0),le){case 1:N[Ee].fn.call(N[Ee].context);break;case 2:N[Ee].fn.call(N[Ee].context,f);break;case 3:N[Ee].fn.call(N[Ee].context,f,d);break;case 4:N[Ee].fn.call(N[Ee].context,f,d,_);break;default:if(!ke)for(We=1,ke=new Array(le-1);We<le;We++)ke[We-1]=arguments[We];N[Ee].fn.apply(N[Ee].context,ke)}}return!0},l.prototype.on=function(u,f,d){return i(this,u,f,d,!1)},l.prototype.once=function(u,f,d){return i(this,u,f,d,!0)},l.prototype.removeListener=function(u,f,d,_){var b=t?t+u:u;if(!this._events[b])return this;if(!f)return s(this,b),this;var E=this._events[b];if(E.fn)E.fn===f&&(!_||E.once)&&(!d||E.context===d)&&s(this,b);else{for(var G=0,N=[],le=E.length;G<le;G++)(E[G].fn!==f||_&&!E[G].once||d&&E[G].context!==d)&&N.push(E[G]);N.length?this._events[b]=N.length===1?N[0]:N:s(this,b)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=t?t+u:u,this._events[f]&&s(this,f)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,a.exports=l}(Hi)),Hi.exports}var ws=Ts(),Ri=P(ws);const Ci="1.6.5",Ni={};function qo(){return typeof __HLS_WORKER_BUNDLE__=="function"}function el(){const a=Ni[Ci];if(a)return a.clientCount++,a;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e),r={worker:new self.Worker(t),objectURL:t,clientCount:1};return Ni[Ci]=r,r}function tl(a){const e=Ni[a];if(e)return e.clientCount++,e;const t=new self.URL(a,self.location.href).href,r={worker:new self.Worker(t),scriptURL:t,clientCount:1};return Ni[a]=r,r}function nl(a){const e=Ni[a||Ci];if(e&&e.clientCount--===1){const{worker:n,objectURL:r}=e;delete Ni[a||Ci],r&&self.URL.revokeObjectURL(r),n.terminate()}}function wa(a,e){return e+10<=a.length&&a[e]===51&&a[e+1]===68&&a[e+2]===73&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128}function Gs(a,e){return e+10<=a.length&&a[e]===73&&a[e+1]===68&&a[e+2]===51&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128}function As(a,e){let t=0;return t=(a[e]&127)<<21,t|=(a[e+1]&127)<<14,t|=(a[e+2]&127)<<7,t|=a[e+3]&127,t}function hs(a,e){const t=e;let n=0;for(;Gs(a,e);){n+=10;const r=As(a,e+6);n+=r,wa(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)}function rl(a,e,t,n){const r=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],i=e[t+2],s=i>>2&15;if(s>12){const b=new Error(`invalid ADTS sampling index:${s}`);a.emit(p.ERROR,p.ERROR,{type:fe.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!0,error:b,reason:b.message});return}const l=(i>>6&3)+1,c=e[t+3]>>6&3|(i&1)<<2,u="mp4a.40."+l,f=r[s];let d=s;(l===5||l===29)&&(d-=3);const _=[l<<3|(d&14)>>1,(d&1)<<7|c<<3];return q.log(`manifest codec:${n}, parsed codec:${u}, channels:${c}, rate:${f} (ADTS object type:${l} sampling index:${s})`),{config:_,samplerate:f,channelCount:c,codec:u,parsedCodec:u,manifestCodec:n}}function Aa(a,e){return a[e]===255&&(a[e+1]&246)===240}function Da(a,e){return a[e+1]&1?7:9}function Vs(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function il(a,e){return e+5<a.length}function Ds(a,e){return e+1<a.length&&Aa(a,e)}function sl(a,e){return il(a,e)&&Aa(a,e)&&Vs(a,e)<=a.length-e}function al(a,e){if(Ds(a,e)){const t=Da(a,e);if(e+t>=a.length)return!1;const n=Vs(a,e);if(n<=t)return!1;const r=e+n;return r===a.length||Ds(a,r)}return!1}function Ra(a,e,t,n,r){if(!a.samplerate){const i=rl(e,t,n,r);if(!i)return;h(a,i)}}function Ca(a){return 1024*9e4/a}function ol(a,e){const t=Da(a,e);if(e+t<=a.length){const n=Vs(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function Ia(a,e,t,n,r){const i=Ca(a.samplerate),s=n+r*i,l=ol(e,t);let c;if(l){const{frameLength:d,headerLength:_}=l,b=_+d,E=Math.max(0,t+b-e.length);E?(c=new Uint8Array(b-_),c.set(e.subarray(t+_,e.length),0)):c=e.subarray(t+_,t+b);const G={unit:c,pts:s};return E||a.samples.push(G),{sample:G,length:b,missing:E}}const u=e.length-t;return c=new Uint8Array(u),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:s},length:u,missing:-1}}function ll(a,e){return Gs(a,e)&&As(a,e+6)+10<=a.length-e}function ul(a){return a instanceof ArrayBuffer?a:a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer}function zs(a,e=0,t=1/0){return cl(a,e,t,Uint8Array)}function cl(a,e,t,n){const r=fl(a);let i=1;"BYTES_PER_ELEMENT"in n&&(i=n.BYTES_PER_ELEMENT);const s=dl(a)?a.byteOffset:0,l=(s+a.byteLength)/i,c=(s+e)/i,u=Math.floor(Math.max(0,Math.min(c,l))),f=Math.floor(Math.min(u+Math.max(t,0),l));return new n(r,u,f-u)}function fl(a){return a instanceof ArrayBuffer?a:a.buffer}function dl(a){return a&&a.buffer instanceof ArrayBuffer&&a.byteLength!==void 0&&a.byteOffset!==void 0}function hl(a){const e={key:a.type,description:"",data:"",mimeType:null,pictureType:null},t=3;if(a.size<2)return;if(a.data[0]!==t){console.log("Ignore frame with unrecognized character encoding");return}const n=a.data.subarray(1).indexOf(0);if(n===-1)return;const r=Oe(zs(a.data,1,n)),i=a.data[2+n],s=a.data.subarray(3+n).indexOf(0);if(s===-1)return;const l=Oe(zs(a.data,3+n,s));let c;return r==="-->"?c=Oe(zs(a.data,4+n+s)):c=ul(a.data.subarray(4+n+s)),e.mimeType=r,e.pictureType=i,e.description=l,e.data=c,e}function pl(a){if(a.size<2)return;const e=Oe(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}}function gl(a){if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=Oe(a.data.subarray(t),!0);t+=n.length+1;const r=Oe(a.data.subarray(t));return{key:a.type,info:n,data:r}}const e=Oe(a.data.subarray(1));return{key:a.type,info:"",data:e}}function ml(a){if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=Oe(a.data.subarray(t),!0);t+=n.length+1;const r=Oe(a.data.subarray(t));return{key:a.type,info:n,data:r}}const e=Oe(a.data);return{key:a.type,info:"",data:e}}function vl(a){return a.type==="PRIV"?pl(a):a.type[0]==="W"?ml(a):a.type==="APIC"?hl(a):gl(a)}function _l(a){const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=As(a,4),n=10;return{type:e,size:t,data:a.subarray(n,n+t)}}const Rs=10,yl=10;function La(a){let e=0;const t=[];for(;Gs(a,e);){const n=As(a,e+6);a[e+5]>>6&1&&(e+=Rs),e+=Rs;const r=e+n;for(;e+yl<r;){const i=_l(a.subarray(e)),s=vl(i);s&&t.push(s),e+=i.size+Rs}wa(a,e)&&(e+=Rs)}return t}function ka(a){return a&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp"}function El(a){if(a.data.byteLength===8){const e=new Uint8Array(a.data),t=e[3]&1;let n=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return n/=45,t&&(n+=4772185884e-2),Math.round(n)}}function Ws(a){const e=La(a);for(let t=0;t<e.length;t++){const n=e[t];if(ka(n))return El(n)}}let ui=function(a){return a.audioId3="org.id3",a.dateRange="com.apple.quicktime.HLS",a.emsg="https://aomedia.org/emsg/ID3",a.misbklv="urn:misb:KLV:bin:1910.1",a}({});function Ti(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class Hs{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,n,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&(e=ge(this.cachedData,e),this.cachedData=null);let n=hs(e,0),r=n?n.length:0,i;const s=this._audioTrack,l=this._id3Track,c=n?Ws(n):void 0,u=e.length;for((this.basePTS===null||this.frameIndex===0&&k(c))&&(this.basePTS=bl(c,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:ui.audioId3,duration:Number.POSITIVE_INFINITY});r<u;){if(this.canParse(e,r)){const f=this.appendFrame(s,e,r);f?(this.frameIndex++,this.lastPTS=f.sample.pts,r+=f.length,i=r):r=u}else ll(e,r)?(n=hs(e,r),l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:ui.audioId3,duration:Number.POSITIVE_INFINITY}),r+=n.length,i=r):r++;if(r===u&&i!==u){const f=e.slice(i);this.cachedData?this.cachedData=ge(this.cachedData,f):this.cachedData=f}}return{audioTrack:s,videoTrack:Ti(),id3Track:l,textTrack:Ti()}}demuxSampleAes(e,t,n){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Ti(),id3Track:this._id3Track,textTrack:Ti()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const bl=(a,e,t)=>{if(k(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};let Cs=null;const xl=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],Sl=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Tl=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],wl=[0,1,1,4];function Pa(a,e,t,n,r){if(t+24>e.length)return;const i=Oa(e,t);if(i&&t+i.frameLength<=e.length){const s=i.samplesPerFrame*9e4/i.sampleRate,l=n+r*s,c={unit:e.subarray(t,t+i.frameLength),pts:l,dts:l};return a.config=[],a.channelCount=i.channelCount,a.samplerate=i.sampleRate,a.samples.push(c),{sample:c,length:i.frameLength,missing:0}}}function Oa(a,e){const t=a[e+1]>>3&3,n=a[e+1]>>1&3,r=a[e+2]>>4&15,i=a[e+2]>>2&3;if(t!==1&&r!==0&&r!==15&&i!==3){const s=a[e+2]>>1&1,l=a[e+3]>>6,c=t===3?3-n:n===3?3:4,u=xl[c*14+r-1]*1e3,d=Sl[(t===3?0:t===2?1:2)*3+i],_=l===3?1:2,b=Tl[t][n],E=wl[n],G=b*8*E,N=Math.floor(b*u/d+s)*E;if(Cs===null){const Ee=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Cs=Ee?parseInt(Ee[1]):0}return!!Cs&&Cs<=87&&n===2&&u>=224e3&&l===0&&(a[e+3]=a[e+3]|128),{sampleRate:d,channelCount:_,frameLength:N,samplesPerFrame:G}}}function js(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function Ma(a,e){return e+1<a.length&&js(a,e)}function Al(a,e){return js(a,e)&&4<=a.length-e}function Fa(a,e){if(e+1<a.length&&js(a,e)){const n=Oa(a,e);let r=4;n!=null&&n.frameLength&&(r=n.frameLength);const i=e+r;return i===a.length||Ma(a,i)}return!1}class Dl extends Hs{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const n=hs(e,0);let r=(n==null?void 0:n.length)||0;if(Fa(e,r))return!1;for(let i=e.length;r<i;r++)if(al(e,r))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return sl(e,t)}appendFrame(e,t,n){Ra(e,this.observer,t,n,e.manifestCodec);const r=Ia(e,t,n,this.basePTS,this.frameIndex);if(r&&r.missing===0)return r}}const Na=(a,e)=>{let t=0,n=5;e+=n;const r=new Uint32Array(1),i=new Uint32Array(1),s=new Uint8Array(1);for(;n>0;){s[0]=a[e];const l=Math.min(n,8),c=8-l;i[0]=4278190080>>>24+c<<c,r[0]=(s[0]&i[0])>>c,t=t?t<<l|r[0]:r[0],e+=1,n-=l}return t};class Rl extends Hs{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const r=Ba(e,t,n,this.basePTS,this.frameIndex);if(r!==-1)return{sample:e.samples[e.samples.length-1],length:r,missing:0}}static probe(e){if(!e)return!1;const t=hs(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&Ws(t)!==void 0&&Na(e,n)<16}}function Ba(a,e,t,n,r){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const i=e[t+4]>>6;if(i>=3)return-1;const l=[48e3,44100,32e3][i],c=e[t+4]&63,f=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][c*3+i]*2;if(t+f>e.length)return-1;const d=e[t+6]>>5;let _=0;d===2?_+=2:(d&1&&d!==1&&(_+=2),d&4&&(_+=2));const b=(e[t+6]<<8|e[t+7])>>12-_&1,G=[2,1,2,3,3,4,4,5][d]+b,N=e[t+5]>>3,le=e[t+5]&7,ke=new Uint8Array([i<<6|N<<1|le>>2,(le&3)<<6|d<<3|b<<2|c>>4,c<<4&224]),Ee=1536/l*9e4,Ke=n+r*Ee,We=e.subarray(t,t+f);return a.config=ke,a.channelCount=G,a.samplerate=l,a.samples.push({unit:We,pts:Ke}),f}class Cl extends Hs{resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=hs(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&Ws(t)!==void 0&&Na(e,n)<=16)return!1;for(let r=e.length;n<r;n++)if(Fa(e,n))return q.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return Al(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Pa(e,t,n,this.basePTS,this.frameIndex)}}const Il=/\/emsg[-/]ID3/i;class Ll{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,r){const i=this.videoTrack=Ti("video",1),s=this.audioTrack=Ti("audio",1),l=this.txtTrack=Ti("text",1);if(this.id3Track=Ti("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=Ne(e);if(c.video){const{id:u,timescale:f,codec:d,supplemental:_}=c.video;i.id=u,i.timescale=l.timescale=f,i.codec=d,i.supplemental=_}if(c.audio){const{id:u,timescale:f,codec:d}=c.audio;s.id=u,s.timescale=f,s.codec=d}l.id=xe.text,i.sampleDuration=0,i.duration=s.duration=r}resetContiguity(){this.remainderData=null}static probe(e){return we(e)}demux(e,t){this.timeOffset=t;let n=e;const r=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=ge(this.remainderData,e));const l=ue(n);this.remainderData=l.remainder,r.samples=l.valid||new Uint8Array}else r.samples=n;const s=this.extractID3Track(r,t);return i.samples=Ce(t,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const r=this.extractID3Track(t,this.timeOffset);return n.samples=Ce(e,t),{videoTrack:t,audioTrack:Ti(),id3Track:r,textTrack:Ti()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const r=K(e.samples,["emsg"]);r&&r.forEach(i=>{const s=$e(i);if(Il.test(s.schemeIdUri)){const l=Ua(s,t);let c=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const u=s.payload;n.samples.push({data:u,len:u.byteLength,dts:l,pts:l,type:ui.emsg,duration:c})}else if(this.config.enableEmsgKLVMetadata&&s.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const l=Ua(s,t);n.samples.push({data:s.payload,len:s.payload.byteLength,dts:l,pts:l,type:ui.misbklv,duration:Number.POSITIVE_INFINITY})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}}function Ua(a,e){return k(a.presentationTime)?a.presentationTime/a.timeScale:e+a.presentationTimeDelta/a.timeScale}class kl{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new mn(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,nr.cbc)}decryptAacSample(e,t,n){const r=e[t].unit;if(r.length<=16)return;const i=r.subarray(16,r.length-r.length%16),s=i.buffer.slice(i.byteOffset,i.byteOffset+i.length);this.decryptBuffer(s).then(l=>{const c=new Uint8Array(l);r.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let r=0;for(let i=32;i<e.length-16;i+=160,r+=16)n.set(e.subarray(i,i+16),r);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let r=0;for(let i=32;i<e.length-16;i+=160,r+=16)e.set(n.subarray(r,r+16),i);return e}decryptAvcSample(e,t,n,r,i){const s=Ge(i.data),l=this.getAvcEncryptedData(s);this.decryptBuffer(l.buffer).then(c=>{i.data=this.getAvcDecryptedUnit(s,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,r)})}decryptAvcSamples(e,t,n,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){r();return}const i=e[t].units;for(;!(n>=i.length);n++){const s=i[n];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,t,n,r,s),!this.decrypter.isSync()))return}}}}class $a{constructor(){this.VideoSample=null}createVideoSample(e,t,n){return{key:e,frame:!1,pts:t,dts:n,units:[],length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,r;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const i=n.units;r=i[i.length-1]}return r}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,r=n.length;if(r){const i=n[r-1];e.pts=i.pts,e.dts=i.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,n){const r=t.byteLength;let i=e.naluState||0;const s=i,l=[];let c=0,u,f,d,_=-1,b=0;for(i===-1&&(_=0,b=this.getNALuType(t,0),i=0,c=1);c<r;){if(u=t[c++],!i){i=u?0:1;continue}if(i===1){i=u?0:2;continue}if(!u)i=3;else if(u===1){if(f=c-i-1,_>=0){const E={data:t.subarray(_,f),type:b};l.push(E)}else{const E=this.getLastNalUnit(e.samples);E&&(s&&c<=4-s&&E.state&&(E.data=E.data.subarray(0,E.data.byteLength-s)),f>0&&(E.data=ge(E.data,t.subarray(0,f)),E.state=0))}c<r?(d=this.getNALuType(t,c),_=c,b=d,i=0):i=-1}else i=0}if(_>=0&&i>=0){const E={data:t.subarray(_,r),type:b,state:i};l.push(E)}if(l.length===0){const E=this.getLastNalUnit(e.samples);E&&(E.data=ge(E.data,t))}return e.naluState=i,l}}class ps{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,r=new Uint8Array(4),i=Math.min(4,t);if(i===0)throw new Error("no bytes available");r.set(e.subarray(n,n+i)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=i*8,this.bytesAvailable-=i}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&q.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class Ka extends $a{parsePES(e,t,n,r){const i=this.parseNALu(e,n.data,r);let s=this.VideoSample,l,c=!1;n.data=null,s&&i.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),i.forEach(u=>{var f,d;switch(u.type){case 1:{let G=!1;l=!0;const N=u.data;if(c&&N.length>4){const le=this.readSliceType(N);(le===2||le===4||le===7||le===9)&&(G=!0)}if(G){var _;(_=s)!=null&&_.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.frame=!0,s.key=G;break}case 5:l=!0,(f=s)!=null&&f.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 6:{l=!0,Ve(u.data,1,n.pts,t.samples);break}case 7:{var b,E;l=!0,c=!0;const G=u.data,N=this.readSPS(G);if(!e.sps||e.width!==N.width||e.height!==N.height||((b=e.pixelRatio)==null?void 0:b[0])!==N.pixelRatio[0]||((E=e.pixelRatio)==null?void 0:E[1])!==N.pixelRatio[1]){e.width=N.width,e.height=N.height,e.pixelRatio=N.pixelRatio,e.sps=[G];const le=G.subarray(1,4);let ke="avc1.";for(let Ee=0;Ee<3;Ee++){let Ke=le[Ee].toString(16);Ke.length<2&&(Ke="0"+Ke),ke+=Ke}e.codec=ke}break}case 8:l=!0,e.pps=[u.data];break;case 9:l=!0,e.audFound=!0,(d=s)!=null&&d.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:l=!0;break;default:l=!1;break}s&&l&&s.units.push(u)}),r&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new ps(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let n=8,r=8,i;for(let s=0;s<e;s++)r!==0&&(i=t.readEG(),r=(n+i+256)%256),n=r===0?n:r}readSPS(e){const t=new ps(e);let n=0,r=0,i=0,s=0,l,c,u;const f=t.readUByte.bind(t),d=t.readBits.bind(t),_=t.readUEG.bind(t),b=t.readBoolean.bind(t),E=t.skipBits.bind(t),G=t.skipEG.bind(t),N=t.skipUEG.bind(t),le=this.skipScalingList.bind(this);f();const ke=f();if(d(5),E(3),f(),N(),ke===100||ke===110||ke===122||ke===244||ke===44||ke===83||ke===86||ke===118||ke===128){const st=_();if(st===3&&E(1),N(),N(),E(1),b())for(c=st!==3?8:12,u=0;u<c;u++)b()&&(u<6?le(16,t):le(64,t))}N();const Ee=_();if(Ee===0)_();else if(Ee===1)for(E(1),G(),G(),l=_(),u=0;u<l;u++)G();N(),E(1);const Ke=_(),We=_(),gt=d(1);gt===0&&E(1),E(1),b()&&(n=_(),r=_(),i=_(),s=_());let Xe=[1,1];if(b()&&b())switch(f()){case 1:Xe=[1,1];break;case 2:Xe=[12,11];break;case 3:Xe=[10,11];break;case 4:Xe=[16,11];break;case 5:Xe=[40,33];break;case 6:Xe=[24,11];break;case 7:Xe=[20,11];break;case 8:Xe=[32,11];break;case 9:Xe=[80,33];break;case 10:Xe=[18,11];break;case 11:Xe=[15,11];break;case 12:Xe=[64,33];break;case 13:Xe=[160,99];break;case 14:Xe=[4,3];break;case 15:Xe=[3,2];break;case 16:Xe=[2,1];break;case 255:{Xe=[f()<<8|f(),f()<<8|f()];break}}return{width:Math.ceil((Ke+1)*16-n*2-r*2),height:(2-gt)*(We+1)*16-(gt?2:4)*(i+s),pixelRatio:Xe}}}class Za extends $a{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,r){const i=this.parseNALu(e,n.data,r);let s=this.VideoSample,l,c=!1;n.data=null,s&&i.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),i.forEach(u=>{var f,d;switch(u.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),s.frame=!0,l=!0;break;case 16:case 17:case 18:case 21:if(l=!0,c){var _;(_=s)!=null&&_.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 19:case 20:l=!0,(f=s)!=null&&f.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 39:l=!0,Ve(u.data,2,n.pts,t.samples);break;case 32:l=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=h(e.params,this.readVPS(u.data)),this.initVPS=u.data),e.vps=[u.data];break;case 33:if(l=!0,c=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],u.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const b=this.readSPS(u.data);e.width=b.width,e.height=b.height,e.pixelRatio=b.pixelRatio,e.codec=b.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const E in b.params)e.params[E]=b.params[E]}this.pushParameterSet(e.sps,u.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0;break;case 34:if(l=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const b=this.readPPS(u.data);for(const E in b)e.params[E]=b[E]}this.pushParameterSet(e.pps,u.data,e.vps)}break;case 35:l=!0,e.audFound=!0,(d=s)!=null&&d.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:l=!1;break}s&&l&&s.units.push(u)}),r&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}pushParameterSet(e,t,n){(n&&n[0]===this.initVPS||!n&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let n=0;for(let r=0;r<e.byteLength;r++)r>=2&&e[r]===3&&e[r-1]===0&&e[r-2]===0||(t[n]=e[r],n++);return new Uint8Array(t.buffer,0,n)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new ps(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const n=t.readBits(3),r=t.readBoolean();return{numTemporalLayers:n+1,temporalIdNested:r}}readSPS(e){const t=new ps(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const n=t.readBits(3);t.readBoolean();const r=t.readBits(2),i=t.readBoolean(),s=t.readBits(5),l=t.readUByte(),c=t.readUByte(),u=t.readUByte(),f=t.readUByte(),d=t.readUByte(),_=t.readUByte(),b=t.readUByte(),E=t.readUByte(),G=t.readUByte(),N=t.readUByte(),le=t.readUByte(),ke=[],Ee=[];for(let Sr=0;Sr<n;Sr++)ke.push(t.readBoolean()),Ee.push(t.readBoolean());if(n>0)for(let Sr=n;Sr<8;Sr++)t.readBits(2);for(let Sr=0;Sr<n;Sr++)ke[Sr]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),Ee[Sr]&&t.readUByte();t.readUEG();const Ke=t.readUEG();Ke==3&&t.skipBits(1);const We=t.readUEG(),gt=t.readUEG(),Xe=t.readBoolean();let st=0,ht=0,Je=0,Kt=0;Xe&&(st+=t.readUEG(),ht+=t.readUEG(),Je+=t.readUEG(),Kt+=t.readUEG());const dn=t.readUEG(),zn=t.readUEG(),Dn=t.readUEG(),Rn=t.readBoolean();for(let Sr=Rn?0:n;Sr<=n;Sr++)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 Yr=0;Yr<4;Yr++)for(let vi=0;vi<(Yr===3?2:6);vi++)if(!t.readBoolean())t.readUEG();else{const xi=Math.min(64,1<<4+(Yr<<1));Yr>1&&t.readEG();for(let us=0;us<xi;us++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const Nn=t.readUEG();let Gt=0;for(let Sr=0;Sr<Nn;Sr++){let Yr=!1;if(Sr!==0&&(Yr=t.readBoolean()),Yr){Sr===Nn&&t.readUEG(),t.readBoolean(),t.readUEG();let vi=0;for(let Yi=0;Yi<=Gt;Yi++){const xi=t.readBoolean();let us=!1;xi||(us=t.readBoolean()),(xi||us)&&vi++}Gt=vi}else{const vi=t.readUEG(),Yi=t.readUEG();Gt=vi+Yi;for(let xi=0;xi<vi;xi++)t.readUEG(),t.readBoolean();for(let xi=0;xi<Yi;xi++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const Sr=t.readUEG();for(let Yr=0;Yr<Sr;Yr++){for(let vi=0;vi<Dn+4;vi++)t.readBits(1);t.readBits(1)}}let sr=0,Qn=1,gr=1,xr=!0,wr=1,Rr=0;t.readBoolean(),t.readBoolean();let ei=!1;if(t.readBoolean()){if(t.readBoolean()){const Xi=t.readUByte(),zo=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Zs=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Xi>0&&Xi<16?(Qn=zo[Xi-1],gr=Zs[Xi-1]):Xi===255&&(Qn=t.readBits(16),gr=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(),ei=t.readBoolean(),ei&&(st+=t.readUEG(),ht+=t.readUEG(),Je+=t.readUEG(),Kt+=t.readUEG()),t.readBoolean()&&(wr=t.readBits(32),Rr=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const Zs=t.readBoolean(),Wo=t.readBoolean();let Es=!1;(Zs||Wo)&&(Es=t.readBoolean(),Es&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),Es&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let Ho=0;Ho<=n;Ho++){xr=t.readBoolean();const nf=xr||t.readBoolean();let jo=!1;nf?t.readEG():jo=t.readBoolean();const Yo=jo?1:t.readUEG()+1;if(Zs)for(let bs=0;bs<Yo;bs++)t.readUEG(),t.readUEG(),Es&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(Wo)for(let bs=0;bs<Yo;bs++)t.readUEG(),t.readUEG(),Es&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),sr=t.readUEG())}let Zi=We,Vo=gt;if(Xe||ei){let Sr=1,Yr=1;Ke===1?Sr=Yr=2:Ke==2&&(Sr=2),Zi=We-Sr*ht-Sr*st,Vo=gt-Yr*Kt-Yr*Je}const ef=r?["A","B","C"][r]:"",tf=l<<24|c<<16|u<<8|f;let Sa=0;for(let Sr=0;Sr<32;Sr++)Sa=(Sa|(tf>>Sr&1)<<31-Sr)>>>0;let Ta=Sa.toString(16);return s===1&&Ta==="2"&&(Ta="6"),{codecString:`hvc1.${ef}${s}.${Ta}.${i?"H":"L"}${le}.B0`,params:{general_tier_flag:i,general_profile_idc:s,general_profile_space:r,general_profile_compatibility_flags:[l,c,u,f],general_constraint_indicator_flags:[d,_,b,E,G,N],general_level_idc:le,bit_depth:dn+8,bit_depth_luma_minus8:dn,bit_depth_chroma_minus8:zn,min_spatial_segmentation_idc:sr,chroma_format_idc:Ke,frame_rate:{fixed:xr,fps:Rr/wr}},width:Zi,height:Vo,pixelRatio:[Qn,gr]}}readPPS(e){const t=new ps(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const r=t.readBoolean(),i=t.readBoolean();let s=1;return i&&r?s=0:i?s=3:r&&(s=2),{parallelismType:s}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const Gr=188;class Bi{constructor(e,t,n,r){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=r,this.videoParser=null}static probe(e,t){const n=Bi.syncOffset(e);return n>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${n}`),n!==-1}static syncOffset(e){const t=e.length;let n=Math.min(Gr*5,t-Gr)+1,r=0;for(;r<n;){let i=!1,s=-1,l=0;for(let c=r;c<t;c+=Gr)if(e[c]===71&&(t-c===Gr||e[c+Gr]===71)){if(l++,s===-1&&(s=c,s!==0&&(n=Math.min(s+Gr*99,e.length-Gr)+1)),i||(i=Ys(e,c)===0),i&&l>1&&(s===0&&l>2||c+Gr>n))return s}else{if(l)return-1;break}r++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:xe[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,n,r){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Bi.createTrack("video"),this._videoTrack.duration=r,this._audioTrack=Bi.createTrack("audio",r),this._id3Track=Bi.createTrack("id3"),this._txtTrack=Bi.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,r=!1){n||(this.sampleAes=null);let i;const s=this._videoTrack,l=this._audioTrack,c=this._id3Track,u=this._txtTrack;let f=s.pid,d=s.pesData,_=l.pid,b=c.pid,E=l.pesData,G=c.pesData,N=null,le=this.pmtParsed,ke=this._pmtId,Ee=e.length;if(this.remainderData&&(e=ge(this.remainderData,e),Ee=e.length,this.remainderData=null),Ee<Gr&&!r)return this.remainderData=e,{audioTrack:l,videoTrack:s,id3Track:c,textTrack:u};const Ke=Math.max(0,Bi.syncOffset(e));Ee-=(Ee-Ke)%Gr,Ee<e.byteLength&&!r&&(this.remainderData=new Uint8Array(e.buffer,Ee,e.buffer.byteLength-Ee));let We=0;for(let Xe=Ke;Xe<Ee;Xe+=Gr)if(e[Xe]===71){const st=!!(e[Xe+1]&64),ht=Ys(e,Xe),Je=(e[Xe+3]&48)>>4;let Kt;if(Je>1){if(Kt=Xe+5+e[Xe+4],Kt===Xe+Gr)continue}else Kt=Xe+4;switch(ht){case f:if(st){if(d&&(i=ns(d,this.logger))){if(this.videoParser===null)switch(s.segmentCodec){case"avc":this.videoParser=new Ka;break;case"hevc":this.videoParser=new Za;break}this.videoParser!==null&&this.videoParser.parsePES(s,u,i,!1)}d={data:[],size:0}}d&&(d.data.push(e.subarray(Kt,Xe+Gr)),d.size+=Xe+Gr-Kt);break;case _:if(st){if(E&&(i=ns(E,this.logger)))switch(l.segmentCodec){case"aac":this.parseAACPES(l,i);break;case"mp3":this.parseMPEGPES(l,i);break;case"ac3":this.parseAC3PES(l,i);break}E={data:[],size:0}}E&&(E.data.push(e.subarray(Kt,Xe+Gr)),E.size+=Xe+Gr-Kt);break;case b:st&&(G&&(i=ns(G,this.logger))&&this.parseID3PES(c,i),G={data:[],size:0}),G&&(G.data.push(e.subarray(Kt,Xe+Gr)),G.size+=Xe+Gr-Kt);break;case 0:st&&(Kt+=e[Kt]+1),ke=this._pmtId=Pl(e,Kt);break;case ke:{st&&(Kt+=e[Kt]+1);const dn=Ol(e,Kt,this.typeSupported,n,this.observer,this.logger);f=dn.videoPid,f>0&&(s.pid=f,s.segmentCodec=dn.segmentVideoCodec),_=dn.audioPid,_>0&&(l.pid=_,l.segmentCodec=dn.segmentAudioCodec),b=dn.id3Pid,b>0&&(c.pid=b),N!==null&&!le&&(this.logger.warn(`MPEG-TS PMT found at ${Xe} after unknown PID '${N}'. Backtracking to sync byte @${Ke} to parse all TS packets.`),N=null,Xe=Ke-188),le=this.pmtParsed=!0;break}case 17:case 8191:break;default:N=ht;break}}else We++;We>0&&Xs(this.observer,new Error(`Found ${We} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=d,l.pesData=E,c.pesData=G;const gt={audioTrack:l,videoTrack:s,id3Track:c,textTrack:u};return r&&this.extractRemainingSamples(gt),gt}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:r,textTrack:i}=e,s=n.pesData,l=t.pesData,c=r.pesData;let u;if(s&&(u=ns(s,this.logger))){if(this.videoParser===null)switch(n.segmentCodec){case"avc":this.videoParser=new Ka;break;case"hevc":this.videoParser=new Za;break}this.videoParser!==null&&(this.videoParser.parsePES(n,i,u,!0),n.pesData=null)}else n.pesData=s;if(l&&(u=ns(l,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,u);break;case"mp3":this.parseMPEGPES(t,u);break;case"ac3":this.parseAC3PES(t,u);break}t.pesData=null}else l!=null&&l.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=l;c&&(u=ns(c,this.logger))?(this.parseID3PES(r,u),r.pesData=null):r.pesData=c}demuxSampleAes(e,t,n){const r=this.demux(e,n,!0,!this.config.progressive),i=this.sampleAes=new kl(this.observer,this.config,t);return this.decrypt(r,i)}decrypt(e,t){return new Promise(n=>{const{audioTrack:r,videoTrack:i}=e;r.samples&&r.segmentCodec==="aac"?t.decryptAacSamples(r.samples,0,()=>{i.samples?t.decryptAvcSamples(i.samples,0,0,()=>{n(e)}):n(e)}):i.samples&&t.decryptAvcSamples(i.samples,0,0,()=>{n(e)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let n=0;const r=this.aacOverFlow;let i=t.data;if(r){this.aacOverFlow=null;const d=r.missing,_=r.sample.unit.byteLength;if(d===-1)i=ge(r.sample.unit,i);else{const b=_-d;r.sample.unit.set(i.subarray(0,d),b),e.samples.push(r.sample),n=r.missing}}let s,l;for(s=n,l=i.length;s<l-1&&!Ds(i,s);s++);if(s!==n){let d;const _=s<l-1;if(_?d=`AAC PES did not start with ADTS header,offset:${s}`:d="No ADTS header found in AAC PES",Xs(this.observer,new Error(d),_,this.logger),!_)return}Ra(e,this.observer,i,s,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(r){const d=Ca(e.samplerate);c=r.sample.pts+d}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let u=0,f;for(;s<l;)if(f=Ia(e,i,s,c,u),s+=f.length,f.missing){this.aacOverFlow=f;break}else for(u++;s<l-1&&!Ds(i,s);s++);}parseMPEGPES(e,t){const n=t.data,r=n.length;let i=0,s=0;const l=t.pts;if(l===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<r;)if(Ma(n,s)){const c=Pa(e,n,s,l,i);if(c)s+=c.length,i++;else break}else s++}parseAC3PES(e,t){{const n=t.data,r=t.pts;if(r===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const i=n.length;let s=0,l=0,c;for(;l<i&&(c=Ba(e,n,l,r,s++))>0;)l+=c}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=h({},t,{type:this._videoTrack?ui.emsg:ui.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function Ys(a,e){return((a[e+1]&31)<<8)+a[e+2]}function Pl(a,e){return(a[e+10]&31)<<8|a[e+11]}function Ol(a,e,t,n,r,i){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},l=(a[e+1]&15)<<8|a[e+2],c=e+3+l-4,u=(a[e+10]&15)<<8|a[e+11];for(e+=12+u;e<c;){const f=Ys(a,e),d=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!n){Qs("ADTS AAC",i);break}case 15:s.audioPid===-1&&(s.audioPid=f);break;case 21:s.id3Pid===-1&&(s.id3Pid=f);break;case 219:if(!n){Qs("H.264",i);break}case 27:s.videoPid===-1&&(s.videoPid=f);break;case 3:case 4:!t.mpeg&&!t.mp3?i.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=f,s.segmentAudioCodec="mp3");break;case 193:if(!n){Qs("AC-3",i);break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=f,s.segmentAudioCodec="ac3"):i.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&d>0){let _=e+5,b=d;for(;b>2;){switch(a[_]){case 106:t.ac3!==!0?i.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=f,s.segmentAudioCodec="ac3");break}const G=a[_+1]+2;_+=G,b-=G}}break;case 194:case 135:return Xs(r,new Error("Unsupported EC-3 in M2TS found"),void 0,i),s;case 36:s.videoPid===-1&&(s.videoPid=f,s.segmentVideoCodec="hevc",i.log("HEVC in M2TS found"));break}e+=d+5}return s}function Xs(a,e,t,n){n.warn(`parsing error: ${e.message}`),a.emit(p.ERROR,p.ERROR,{type:fe.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function Qs(a,e){e.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function ns(a,e){let t=0,n,r,i,s,l;const c=a.data;if(!a||a.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=ge(c[0],c[1]),c.splice(1,1);if(n=c[0],(n[0]<<16)+(n[1]<<8)+n[2]===1){if(r=(n[4]<<8)+n[5],r&&r>a.size-6)return null;const f=n[7];f&192&&(s=(n[9]&14)*536870912+(n[10]&255)*4194304+(n[11]&254)*16384+(n[12]&255)*128+(n[13]&254)/2,f&64?(l=(n[14]&14)*536870912+(n[15]&255)*4194304+(n[16]&254)*16384+(n[17]&255)*128+(n[18]&254)/2,s-l>60*9e4&&(e.warn(`${Math.round((s-l)/9e4)}s delta between PTS and DTS, align them`),s=l)):l=s),i=n[8];let d=i+9;if(a.size<=d)return null;a.size-=d;const _=new Uint8Array(a.size);for(let b=0,E=c.length;b<E;b++){n=c[b];let G=n.byteLength;if(d)if(d>G){d-=G;continue}else n=n.subarray(d),G-=d,d=0;_.set(n,t),t+=G}return r&&(r-=i+3),{data:_,pts:s,dts:l,len:r}}return null}class Ml{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 Ui=Math.pow(2,32)-1;class rt{static init(){rt.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 rt.types)rt.types.hasOwnProperty(e)&&(rt.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);rt.HDLR_TYPES={video:t,audio:n};const r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i=new Uint8Array([0,0,0,0,0,0,0,0]);rt.STTS=rt.STSC=rt.STCO=i,rt.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),rt.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),rt.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),rt.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);rt.FTYP=rt.box(rt.types.ftyp,s,c,s,l),rt.DINF=rt.box(rt.types.dinf,rt.box(rt.types.dref,r))}static box(e,...t){let n=8,r=t.length;const i=r;for(;r--;)n+=t[r].byteLength;const s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(e,4),r=0,n=8;r<i;r++)s.set(t[r],n),n+=t[r].byteLength;return s}static hdlr(e){return rt.box(rt.types.hdlr,rt.HDLR_TYPES[e])}static mdat(e){return rt.box(rt.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(Ui+1)),r=Math.floor(t%(Ui+1));return rt.box(rt.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))}static mdia(e){return rt.box(rt.types.mdia,rt.mdhd(e.timescale||0,e.duration||0),rt.hdlr(e.type),rt.minf(e))}static mfhd(e){return rt.box(rt.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"?rt.box(rt.types.minf,rt.box(rt.types.smhd,rt.SMHD),rt.DINF,rt.stbl(e)):rt.box(rt.types.minf,rt.box(rt.types.vmhd,rt.VMHD),rt.DINF,rt.stbl(e))}static moof(e,t,n){return rt.box(rt.types.moof,rt.mfhd(e),rt.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=rt.trak(e[t]);return rt.box.apply(null,[rt.types.moov,rt.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(rt.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=rt.trex(e[t]);return rt.box.apply(null,[rt.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(Ui+1)),r=Math.floor(t%(Ui+1)),i=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,r>>24,r>>16&255,r>>8&255,r&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return rt.box(rt.types.mvhd,i)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let r,i;for(r=0;r<t.length;r++)i=t[r].flags,n[r+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return rt.box(rt.types.sdtp,n)}static stbl(e){return rt.box(rt.types.stbl,rt.stsd(e),rt.box(rt.types.stts,rt.STTS),rt.box(rt.types.stsc,rt.STSC),rt.box(rt.types.stsz,rt.STSZ),rt.box(rt.types.stco,rt.STCO))}static avc1(e){let t=[],n=[],r,i,s;for(r=0;r<e.sps.length;r++)i=e.sps[r],s=i.byteLength,t.push(s>>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(i));for(r=0;r<e.pps.length;r++)i=e.pps[r],s=i.byteLength,n.push(s>>>8&255),n.push(s&255),n=n.concat(Array.prototype.slice.call(i));const l=rt.box(rt.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),c=e.width,u=e.height,f=e.pixelRatio[0],d=e.pixelRatio[1];return rt.box(rt.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,c>>8&255,c&255,u>>8&255,u&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l,rt.box(rt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),rt.box(rt.types.pasp,new Uint8Array([f>>24,f>>16&255,f>>8&255,f&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 rt.box(rt.types.mp4a,rt.audioStsd(e),rt.box(rt.types.esds,rt.esds(e)))}static mp3(e){return rt.box(rt.types[".mp3"],rt.audioStsd(e))}static ac3(e){return rt.box(rt.types["ac-3"],rt.audioStsd(e),rt.box(rt.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return rt.box(rt.types.stsd,rt.STSD,rt.mp4a(e));if(t==="ac3"&&e.config)return rt.box(rt.types.stsd,rt.STSD,rt.ac3(e));if(t==="mp3"&&e.codec==="mp3")return rt.box(rt.types.stsd,rt.STSD,rt.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return rt.box(rt.types.stsd,rt.STSD,rt.avc1(e));if(t==="hevc"&&e.vps)return rt.box(rt.types.stsd,rt.STSD,rt.hvc1(e))}else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,n=(e.duration||0)*(e.timescale||0),r=e.width||0,i=e.height||0,s=Math.floor(n/(Ui+1)),l=Math.floor(n%(Ui+1));return rt.box(rt.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,l>>24,l>>16&255,l>>8&255,l&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>8&255,r&255,0,0,i>>8&255,i&255,0,0]))}static traf(e,t){const n=rt.sdtp(e),r=e.id,i=Math.floor(t/(Ui+1)),s=Math.floor(t%(Ui+1));return rt.box(rt.types.traf,rt.box(rt.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),rt.box(rt.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,s>>24,s>>16&255,s>>8&255,s&255])),rt.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,rt.box(rt.types.trak,rt.tkhd(e),rt.mdia(e))}static trex(e){const t=e.id;return rt.box(rt.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],r=n.length,i=12+16*r,s=new Uint8Array(i);let l,c,u,f,d,_;for(t+=8+i,s.set([e.type==="video"?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),l=0;l<r;l++)c=n[l],u=c.duration,f=c.size,d=c.flags,_=c.cts,s.set([u>>>24&255,u>>>16&255,u>>>8&255,u&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.paddingValue<<1|d.isNonSync,d.degradPrio&61440,d.degradPrio&15,_>>>24&255,_>>>16&255,_>>>8&255,_&255],12+16*l);return rt.box(rt.types.trun,s)}static initSegment(e){rt.types||rt.init();const t=rt.moov(e);return ge(rt.FTYP,t)}static hvc1(e){const t=e.params,n=[e.vps,e.sps,e.pps],r=4,i=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),r-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),n.length]);let s=i.length;for(let E=0;E<n.length;E+=1){s+=3;for(let G=0;G<n[E].length;G+=1)s+=2+n[E][G].length}const l=new Uint8Array(s);l.set(i,0),s=i.length;const c=n.length-1;for(let E=0;E<n.length;E+=1){l.set(new Uint8Array([32+E|(E===c?128:0),0,n[E].length]),s),s+=3;for(let G=0;G<n[E].length;G+=1)l.set(new Uint8Array([n[E][G].length>>8,n[E][G].length&255]),s),s+=2,l.set(n[E][G],s),s+=n[E][G].length}const u=rt.box(rt.types.hvcC,l),f=e.width,d=e.height,_=e.pixelRatio[0],b=e.pixelRatio[1];return rt.box(rt.types.hvc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,f>>8&255,f&255,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]),u,rt.box(rt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),rt.box(rt.types.pasp,new Uint8Array([_>>24,_>>16&255,_>>8&255,_&255,b>>24,b>>16&255,b>>8&255,b&255])))}}rt.types=void 0,rt.HDLR_TYPES=void 0,rt.STTS=void 0,rt.STSC=void 0,rt.STCO=void 0,rt.STSZ=void 0,rt.VMHD=void 0,rt.SMHD=void 0,rt.STSD=void 0,rt.FTYP=void 0,rt.DINF=void 0;const Ga=9e4;function Js(a,e,t=1,n=!1){const r=a*e*t;return n?Math.round(r):r}function Fl(a,e,t=1,n=!1){return Js(a,e,1/t,n)}function gs(a,e=!1){return Js(a,1e3,1/Ga,e)}function Nl(a,e=1){return Js(a,Ga,1/e)}const Bl=10*1e3,Ul=1024,$l=1152,Kl=1536;let rs=null,qs=null;function Va(a,e,t,n){return{duration:e,size:t,cts:n,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:a?2:1,isNonSync:a?0:1}}}class Is{constructor(e,t,n,r){if(this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=r,this.ISGenerated=!1,rs===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);rs=s?parseInt(s[1]):0}if(qs===null){const i=navigator.userAgent.match(/Safari\/(\d+)/i);qs=i?parseInt(i[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,r=e.reduce((i,s)=>{let l=s.pts,c=l-i;return c<-4294967296&&(t=!0,l=pi(l,n),c=l-i),c>0?i:l},n);return t&&this.logger.debug("PTS rollover detected"),r}remux(e,t,n,r,i,s,l,c){let u,f,d,_,b,E,G=i,N=i;const le=e.pid>-1,ke=t.pid>-1,Ee=t.samples.length,Ke=e.samples.length>0,We=l&&Ee>0||Ee>1;if((!le||Ke)&&(!ke||We)||this.ISGenerated||l){if(this.ISGenerated){var Xe,st,ht,Je;const Dn=this.videoTrackConfig;(Dn&&(t.width!==Dn.width||t.height!==Dn.height||((Xe=t.pixelRatio)==null?void 0:Xe[0])!==((st=Dn.pixelRatio)==null?void 0:st[0])||((ht=t.pixelRatio)==null?void 0:ht[1])!==((Je=Dn.pixelRatio)==null?void 0:Je[1]))||!Dn&&We||this.nextAudioPts===null&&Ke)&&this.resetInitSegment()}this.ISGenerated||(d=this.generateIS(e,t,i,s));const Kt=this.isVideoContiguous;let dn=-1,zn;if(We&&(dn=Zl(t.samples),!Kt&&this.config.forceKeyFrameOnDiscontinuity))if(E=!0,dn>0){this.logger.warn(`[mp4-remuxer]: Dropped ${dn} out of ${Ee} video samples due to a missing keyframe`);const Dn=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(dn),t.dropped+=dn,N+=(t.samples[0].pts-Dn)/t.inputTimeScale,zn=N}else dn===-1&&(this.logger.warn(`[mp4-remuxer]: No keyframe found out of ${Ee} video samples`),E=!1);if(this.ISGenerated){if(Ke&&We){const Dn=this.getVideoStartPts(t.samples),hn=(pi(e.samples[0].pts,Dn)-Dn)/t.inputTimeScale;G+=Math.max(0,hn),N+=Math.max(0,-hn)}if(Ke){if(e.samplerate||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),d=this.generateIS(e,t,i,s)),f=this.remuxAudio(e,G,this.isAudioContiguous,s,ke||We||c===ce.AUDIO?N:void 0),We){const Dn=f?f.endPTS-f.startPTS:0;t.inputTimeScale||(this.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),d=this.generateIS(e,t,i,s)),u=this.remuxVideo(t,N,Kt,Dn)}}else We&&(u=this.remuxVideo(t,N,Kt,0));u&&(u.firstKeyFrame=dn,u.independent=dn!==-1,u.firstKeyFramePTS=zn)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(b=za(n,i,this._initPTS,this._initDTS)),r.samples.length&&(_=Wa(r,i,this._initPTS))),{audio:f,video:u,initSegment:d,independent:E,text:_,id3:b}}generateIS(e,t,n,r){const i=e.samples,s=t.samples,l=this.typeSupported,c={},u=this._initPTS;let f=!u||r,d="audio/mp4",_,b,E,G;if(f&&(_=b=1/0),e.config&&i.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":l.mpeg?(d="audio/mpeg",e.codec=""):l.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}c.audio={id:"audio",container:d,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&l.mpeg?new Uint8Array(0):rt.initSegment([e]),metadata:{channelCount:e.channelCount}},f&&(G=e.id,E=e.inputTimeScale,!u||E!==u.timescale?_=b=i[0].pts-Math.round(E*n):f=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:rt.initSegment([t]),metadata:{width:t.width,height:t.height}},f)if(G=t.id,E=t.inputTimeScale,!u||E!==u.timescale){const N=this.getVideoStartPts(s),le=Math.round(E*n);b=Math.min(b,pi(s[0].dts,N)-le),_=Math.min(_,N-le)}else f=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,f?(this._initPTS={baseTime:_,timescale:E},this._initDTS={baseTime:b,timescale:E}):_=E=void 0,{tracks:c,initPTS:_,timescale:E,trackId:G}}remuxVideo(e,t,n,r){const i=e.inputTimeScale,s=e.samples,l=[],c=s.length,u=this._initPTS;let f=this.nextAvcDts,d=8,_=this.videoSampleDuration,b,E,G=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY,le=!1;if(!n||f===null){const Gt=t*i,Jt=s[0].pts-pi(s[0].dts,s[0].pts);rs&&f!==null&&Math.abs(Gt-Jt-f)<15e3?n=!0:f=Gt-Jt}const ke=u.baseTime*i/u.timescale;for(let Gt=0;Gt<c;Gt++){const Jt=s[Gt];Jt.pts=pi(Jt.pts-ke,f),Jt.dts=pi(Jt.dts-ke,f),Jt.dts<s[Gt>0?Gt-1:Gt].dts&&(le=!0)}le&&s.sort(function(Gt,Jt){const sr=Gt.dts-Jt.dts,Qn=Gt.pts-Jt.pts;return sr||Qn}),b=s[0].dts,E=s[s.length-1].dts;const Ee=E-b,Ke=Ee?Math.round(Ee/(c-1)):_||e.inputTimeScale/30;if(n){const Gt=b-f,Jt=Gt>Ke,sr=Gt<-1;if((Jt||sr)&&(Jt?this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${gs(Gt,!0)} ms (${Gt}dts) hole between fragments detected at ${t.toFixed(3)}`):this.logger.warn(`${(e.segmentCodec||"").toUpperCase()}: ${gs(-Gt,!0)} ms (${Gt}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!sr||f>=s[0].pts||rs)){b=f;const Qn=s[0].pts-Gt;if(Jt)s[0].dts=b,s[0].pts=Qn;else{let gr=!0;for(let xr=0;xr<s.length&&!(s[xr].dts>Qn&&gr);xr++){const wr=s[xr].pts;if(s[xr].dts-=Gt,s[xr].pts-=Gt,xr<s.length-1){const Rr=s[xr+1].pts,ei=s[xr].pts,si=Rr<=ei,Zi=Rr<=wr;gr=si==Zi}}}this.logger.log(`Video: Initial PTS/DTS adjusted: ${gs(Qn,!0)}/${gs(b,!0)}, delta: ${gs(Gt,!0)} ms`)}}b=Math.max(0,b);let We=0,gt=0,Xe=b;for(let Gt=0;Gt<c;Gt++){const Jt=s[Gt],sr=Jt.units,Qn=sr.length;let gr=0;for(let xr=0;xr<Qn;xr++)gr+=sr[xr].data.length;gt+=gr,We+=Qn,Jt.length=gr,Jt.dts<Xe?(Jt.dts=Xe,Xe+=Ke/4|0||1):Xe=Jt.dts,G=Math.min(Jt.pts,G),N=Math.max(Jt.pts,N)}E=s[c-1].dts;const st=gt+4*We+8;let ht;try{ht=new Uint8Array(st)}catch(Gt){this.observer.emit(p.ERROR,p.ERROR,{type:fe.MUX_ERROR,details:$.REMUX_ALLOC_ERROR,fatal:!1,error:Gt,bytes:st,reason:`fail allocating video mdat ${st}`});return}const Je=new DataView(ht.buffer);Je.setUint32(0,st),ht.set(rt.types.mdat,4);let Kt=!1,dn=Number.POSITIVE_INFINITY,zn=Number.POSITIVE_INFINITY,Dn=Number.NEGATIVE_INFINITY,Rn=Number.NEGATIVE_INFINITY;for(let Gt=0;Gt<c;Gt++){const Jt=s[Gt],sr=Jt.units;let Qn=0;for(let wr=0,Rr=sr.length;wr<Rr;wr++){const ei=sr[wr],si=ei.data,Zi=ei.data.byteLength;Je.setUint32(d,Zi),d+=4,ht.set(si,d),d+=Zi,Qn+=4+Zi}let gr;if(Gt<c-1)_=s[Gt+1].dts-Jt.dts,gr=s[Gt+1].pts-Jt.pts;else{const wr=this.config,Rr=Gt>0?Jt.dts-s[Gt-1].dts:Ke;if(gr=Gt>0?Jt.pts-s[Gt-1].pts:Ke,wr.stretchShortVideoTrack&&this.nextAudioPts!==null){const ei=Math.floor(wr.maxBufferHole*i),si=(r?G+r*i:this.nextAudioPts)-Jt.pts;si>ei?(_=si-Rr,_<0?_=Rr:Kt=!0,this.logger.log(`[mp4-remuxer]: It is approximately ${si/90} ms to the next segment; using duration ${_/90} ms for the last video frame.`)):_=Rr}else _=Rr}const xr=Math.round(Jt.pts-Jt.dts);dn=Math.min(dn,_),Dn=Math.max(Dn,_),zn=Math.min(zn,gr),Rn=Math.max(Rn,gr),l.push(Va(Jt.key,_,Qn,xr))}if(l.length){if(rs){if(rs<70){const Gt=l[0].flags;Gt.dependsOn=2,Gt.isNonSync=0}}else if(qs&&Rn-zn<Dn-dn&&Ke/Dn<.025&&l[0].cts===0){this.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let Gt=b;for(let Jt=0,sr=l.length;Jt<sr;Jt++){const Qn=Gt+l[Jt].duration,gr=Gt+l[Jt].cts;if(Jt<sr-1){const xr=Qn+l[Jt+1].cts;l[Jt].duration=xr-gr}else l[Jt].duration=Jt?l[Jt-1].duration:Ke;l[Jt].cts=0,Gt=Qn}}}_=Kt||!_?Ke:_,this.nextAvcDts=f=E+_,this.videoSampleDuration=_,this.isVideoContiguous=!0;const Nn={data1:rt.moof(e.sequenceNumber++,b,h(e,{samples:l})),data2:ht,startPTS:G/i,endPTS:(N+_)/i,startDTS:b/i,endDTS:f/i,type:"video",hasAudio:!1,hasVideo:!0,nb:l.length,dropped:e.dropped};return e.samples=[],e.dropped=0,Nn}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return $l;case"ac3":return Kl;default:return Ul}}remuxAudio(e,t,n,r,i){const s=e.inputTimeScale,l=e.samplerate?e.samplerate:s,c=s/l,u=this.getSamplesPerFrame(e),f=u*c,d=this._initPTS,_=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,b=[],E=i!==void 0;let G=e.samples,N=_?0:8,le=this.nextAudioPts||-1;const ke=t*s,Ee=d.baseTime*s/d.timescale;if(this.isAudioContiguous=n=n||G.length&&le>0&&(r&&Math.abs(ke-le)<9e3||Math.abs(pi(G[0].pts-Ee,ke)-le)<20*f),G.forEach(function(hn){hn.pts=pi(hn.pts-Ee,ke)}),!n||le<0){if(G=G.filter(hn=>hn.pts>=0),!G.length)return;i===0?le=0:r&&!E?le=Math.max(0,ke):le=G[0].pts}if(e.segmentCodec==="aac"){const hn=this.config.maxAudioFramesDrift;for(let Ln=0,Nn=le;Ln<G.length;Ln++){const Gt=G[Ln],Jt=Gt.pts,sr=Jt-Nn,Qn=Math.abs(1e3*sr/s);if(sr<=-hn*f&&E)Ln===0&&(this.logger.warn(`Audio frame @ ${(Jt/s).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*sr/s)} ms.`),this.nextAudioPts=le=Nn=Jt);else if(sr>=hn*f&&Qn<Bl&&E){let gr=Math.round(sr/f);Nn=Jt-gr*f,Nn<0&&(gr--,Nn+=f),Ln===0&&(this.nextAudioPts=le=Nn),this.logger.warn(`[mp4-remuxer]: Injecting ${gr} audio frame @ ${(Nn/s).toFixed(3)}s due to ${Math.round(1e3*sr/s)} ms gap.`);for(let xr=0;xr<gr;xr++){const wr=Math.max(Nn,0);let Rr=Ml.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);Rr||(this.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Rr=Gt.unit.subarray()),G.splice(Ln,0,{unit:Rr,pts:wr}),Nn+=f,Ln++}}Gt.pts=Nn,Nn+=f}}let Ke=null,We=null,gt,Xe=0,st=G.length;for(;st--;)Xe+=G[st].unit.byteLength;for(let hn=0,Ln=G.length;hn<Ln;hn++){const Nn=G[hn],Gt=Nn.unit;let Jt=Nn.pts;if(We!==null){const Qn=b[hn-1];Qn.duration=Math.round((Jt-We)/c)}else if(n&&e.segmentCodec==="aac"&&(Jt=le),Ke=Jt,Xe>0){Xe+=N;try{gt=new Uint8Array(Xe)}catch(Qn){this.observer.emit(p.ERROR,p.ERROR,{type:fe.MUX_ERROR,details:$.REMUX_ALLOC_ERROR,fatal:!1,error:Qn,bytes:Xe,reason:`fail allocating audio mdat ${Xe}`});return}_||(new DataView(gt.buffer).setUint32(0,Xe),gt.set(rt.types.mdat,4))}else return;gt.set(Gt,N);const sr=Gt.byteLength;N+=sr,b.push(Va(!0,u,sr,0)),We=Jt}const ht=b.length;if(!ht)return;const Je=b[b.length-1];this.nextAudioPts=le=We+c*Je.duration;const Kt=_?new Uint8Array(0):rt.moof(e.sequenceNumber++,Ke/c,h({},e,{samples:b}));e.samples=[];const dn=Ke/s,zn=le/s,Rn={data1:Kt,data2:gt,startPTS:dn,endPTS:zn,startDTS:dn,endDTS:zn,type:"audio",hasAudio:!0,hasVideo:!1,nb:ht};return this.isAudioContiguous=!0,Rn}}function pi(a,e){let t;if(e===null)return a;for(e<a?t=-8589934592:t=8589934592;Math.abs(a-e)>4294967296;)a+=t;return a}function Zl(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function za(a,e,t,n){const r=a.samples.length;if(!r)return;const i=a.inputTimeScale;for(let l=0;l<r;l++){const c=a.samples[l];c.pts=pi(c.pts-t.baseTime*i/t.timescale,e*i)/i,c.dts=pi(c.dts-n.baseTime*i/n.timescale,e*i)/i}const s=a.samples;return a.samples=[],{samples:s}}function Wa(a,e,t){const n=a.samples.length;if(!n)return;const r=a.inputTimeScale;for(let s=0;s<n;s++){const l=a.samples[s];l.pts=pi(l.pts-t.baseTime*r/t.timescale,e*r)/r}a.samples.sort((s,l)=>s.pts-l.pts);const i=a.samples;return a.samples=[],{samples:i}}class Gl{constructor(e,t,n,r){this.logger=void 0,this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1,this.logger=r}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,n,r){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(B(e,r)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const r=this.initData=Ne(e);r.audio&&(t=Ha(r.audio,g.AUDIO,this.logger)),r.video&&(n=Ha(r.video,g.VIDEO,this.logger));const i={};r.audio&&r.video?i.audiovideo={container:"video/mp4",codec:t+","+n,supplemental:r.video.supplemental,initSegment:e,id:"main"}:r.audio?i.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:r.video?i.video={container:"video/mp4",codec:n,supplemental:r.video.supplemental,initSegment:e,id:"main"}:this.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i}remux(e,t,n,r,i,s){var l,c;let{initPTS:u,lastEndTime:f}=this;const d={audio:void 0,video:void 0,text:r,id3:n,initSegment:void 0};k(f)||(f=this.lastEndTime=i||0);const _=t.samples;if(!(_!=null&&_.length))return d;const b={initPTS:void 0,timescale:void 0,trackId:void 0};let E=this.initData;if((l=E)!=null&&l.length||(this.generateInitSegment(_),E=this.initData),!((c=E)!=null&&c.length))return this.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),d;this.emitInitSegment&&(b.tracks=this.initTracks,this.emitInitSegment=!1);const G=Z(_,E,this.logger),N=E.audio?G[E.audio.id]:null,le=E.video?G[E.video.id]:null,ke=Ls(le,1/0),Ee=Ls(N,1/0),Ke=Ls(le,0,!0),We=Ls(N,0,!0);let gt,Xe=i,st=0;if(N&&(!le||!u&&Ee<ke||u&&u.trackId===E.audio.id)?(b.trackId=E.audio.id,gt=N,st=We-Ee):le&&(b.trackId=E.video.id,gt=le,st=Ke-ke),gt){const hn=gt.timescale;Xe=gt.start/hn,b.timescale=hn,u||(b.initPTS=gt.start-i*hn,this.initPTS=u={baseTime:b.initPTS,timescale:hn,trackId:b.trackId})}(s||!u)&&(Vl(u,Xe,i,st)||b.timescale!==u.timescale)&&(b.initPTS=Xe-i,u&&u.timescale===1&&this.logger.warn(`Adjusting initPTS @${i} from ${u.baseTime/u.timescale} to ${b.initPTS}`),this.initPTS=u={baseTime:b.initPTS,timescale:1});const ht=e?Xe-u.baseTime/u.timescale:f;te(E,_,u.baseTime/u.timescale);const Je=ht+st;st>0?this.lastEndTime=Je:(this.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const Kt=!!E.audio,dn=!!E.video;let zn="";Kt&&(zn+="audio"),dn&&(zn+="video");const Dn={data1:_,startPTS:ht,startDTS:ht,endPTS:Je,endDTS:Je,type:zn,hasAudio:Kt,hasVideo:dn,nb:1,dropped:0};d.audio=Kt&&!dn?Dn:void 0,d.video=dn?Dn:void 0;const Rn=le==null?void 0:le.sampleCount;if(Rn){const hn=le.keyFrameIndex,Ln=hn!==-1;Dn.nb=Rn,Dn.dropped=hn===0||this.isVideoContiguous?0:Ln?hn:Rn,Dn.independent=Ln,Dn.firstKeyFrame=hn,Ln&&le.keyFrameStart&&(Dn.firstKeyFramePTS=le.keyFrameStart-u.baseTime/u.timescale),this.isVideoContiguous||(d.independent=Ln),this.isVideoContiguous||(this.isVideoContiguous=Ln),Dn.dropped&&this.logger.warn(`fmp4 does not start with IDR: firstIDR ${hn}/${Rn} dropped: ${Dn.dropped} pts: ${Dn.firstKeyFramePTS||"NA"}`)}return d.initSegment=b,d.id3=za(n,i,u,u),r.samples.length&&(d.text=Wa(r,i,u)),d}}function Ls(a,e,t=!1){return(a==null?void 0:a.start)!==void 0?(a.start+(t?a.duration:0))/a.timescale:e}function Vl(a,e,t,n){if(a===null)return!0;const r=Math.max(n,1),i=e-a.baseTime/a.timescale;return Math.abs(i-t)>r}function Ha(a,e,t){const n=a==null?void 0:a.codec;return n&&n.length>4?n:e===g.AUDIO?n==="ec-3"||n==="ac-3"||n==="alac"?n:n==="fLaC"||n==="Opus"?et(n,!1):(t.warn(`Unhandled audio codec "${n}" in mp4 MAP`),n||"mp4a"):(t.warn(`Unhandled video codec "${n}" in mp4 MAP`),n||"avc1")}let Ii;try{Ii=self.performance.now.bind(self.performance)}catch(a){Ii=Date.now}const ks=[{demux:Ll,remux:Gl},{demux:Bi,remux:Is},{demux:Dl,remux:Is},{demux:Cl,remux:Is}];ks.splice(2,0,{demux:Rl,remux:Is});class ja{constructor(e,t,n,r,i,s){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.id=i,this.logger=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,r){const i=n.transmuxing;i.executeStart=Ii();let s=new Uint8Array(e);const{currentTransmuxState:l,transmuxConfig:c}=this;r&&(this.currentTransmuxState=r);const{contiguous:u,discontinuity:f,trackSwitch:d,accurateTimeOffset:_,timeOffset:b,initSegmentChange:E}=r||l,{audioCodec:G,videoCodec:N,defaultInitPts:le,duration:ke,initSegmentData:Ee}=c,Ke=zl(s,t);if(Ke&&Fr(Ke.method)){const st=this.getDecrypter(),ht=Wr(Ke.method);if(st.isSync()){let Je=st.softwareDecrypt(s,Ke.key.buffer,Ke.iv.buffer,ht);if(n.part>-1){const dn=st.flush();Je=dn&&dn.buffer}if(!Je)return i.executeEnd=Ii(),ea(n);s=new Uint8Array(Je)}else return this.asyncResult=!0,this.decryptionPromise=st.webCryptoDecrypt(s,Ke.key.buffer,Ke.iv.buffer,ht).then(Je=>{const Kt=this.push(Je,null,n);return this.decryptionPromise=null,Kt}),this.decryptionPromise}const We=this.needsProbing(f,d);if(We){const st=this.configureTransmuxer(s);if(st)return this.logger.warn(`[transmuxer] ${st.message}`),this.observer.emit(p.ERROR,p.ERROR,{type:fe.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,error:st,reason:st.message}),i.executeEnd=Ii(),ea(n)}(f||d||E||We)&&this.resetInitSegment(Ee,G,N,ke,t),(f||E||We)&&this.resetInitialTimestamp(le),u||this.resetContiguity();const gt=this.transmux(s,Ke,b,_,n);this.asyncResult=ms(gt);const Xe=this.currentTransmuxState;return Xe.contiguous=!0,Xe.discontinuity=!1,Xe.trackSwitch=!1,i.executeEnd=Ii(),gt}flush(e){const t=e.transmuxing;t.executeStart=Ii();const{decrypter:n,currentTransmuxState:r,decryptionPromise:i}=this;if(i)return this.asyncResult=!0,i.then(()=>this.flush(e));const s=[],{timeOffset:l}=r;if(n){const d=n.flush();d&&s.push(this.push(d.buffer,null,e))}const{demuxer:c,remuxer:u}=this;if(!c||!u){t.executeEnd=Ii();const d=[ea(e)];return this.asyncResult?Promise.resolve(d):d}const f=c.flush(l);return ms(f)?(this.asyncResult=!0,f.then(d=>(this.flushRemux(s,d,e),s))):(this.flushRemux(s,f,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,n){const{audioTrack:r,videoTrack:i,id3Track:s,textTrack:l}=t,{accurateTimeOffset:c,timeOffset:u}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===ce.MAIN?"level":"track"} ${n.level}`);const f=this.remuxer.remux(r,i,s,l,u,c,!0,this.id);e.push({remuxResult:f,chunkMeta:n}),n.transmuxing.executeEnd=Ii()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;!t||!n||(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,r,i){const{demuxer:s,remuxer:l}=this;!s||!l||(s.resetInitSegment(e,t,n,r),l.resetInitSegment(e,t,n,i))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,r,i){let s;return t&&t.method==="SAMPLE-AES"?s=this.transmuxSampleAes(e,t,n,r,i):s=this.transmuxUnencrypted(e,n,r,i),s}transmuxUnencrypted(e,t,n,r){const{audioTrack:i,videoTrack:s,id3Track:l,textTrack:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(i,s,l,c,t,n,!1,this.id),chunkMeta:r}}transmuxSampleAes(e,t,n,r,i){return this.demuxer.demuxSampleAes(e,t,n).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,n,r,!1,this.id),chunkMeta:i}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:r}=this;let i;for(let d=0,_=ks.length;d<_;d++){var s;if((s=ks[d].demux)!=null&&s.probe(e,this.logger)){i=ks[d];break}}if(!i)return new Error("Failed to find demuxer by probing fragment data");const l=this.demuxer,c=this.remuxer,u=i.remux,f=i.demux;(!c||!(c instanceof u))&&(this.remuxer=new u(n,t,r,this.logger)),(!l||!(l instanceof f))&&(this.demuxer=new f(n,t,r,this.logger),this.probe=f.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new mn(this.config)),e}}function zl(a,e){let t=null;return a.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const ea=a=>({remuxResult:{},chunkMeta:a});function ms(a){return"then"in a&&a.then instanceof Function}class Wl{constructor(e,t,n,r,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=r,this.defaultInitPts=i||null}}class Hl{constructor(e,t,n,r,i,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=r,this.timeOffset=i,this.initSegmentChange=s}}let Ya=0;class Xa{constructor(e,t,n,r){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Ya++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=c=>{const u=c.data,f=this.hls;if(!(!f||!(u!=null&&u.event)||u.instanceNo!==this.instanceNo))switch(u.event){case"init":{var d;const _=(d=this.workerContext)==null?void 0:d.objectURL;_&&self.URL.revokeObjectURL(_);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}case"workerLog":{f.logger[u.data.logType]&&f.logger[u.data.logType](u.data.message);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.part=this.part,u.data.id=this.id,f.trigger(u.event,u.data);break}}},this.onWorkerError=c=>{if(!this.hls)return;const u=new Error(`${c.message} (${c.filename}:${c.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(p.ERROR,{type:fe.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:u})};const i=e.config;this.hls=e,this.id=t,this.useWorker=!!i.enableWorker,this.onTransmuxComplete=n,this.onFlush=r;const s=(c,u)=>{u=u||{},u.frag=this.frag||void 0,c===p.ERROR&&(u=u,u.parent=this.id,u.part=this.part,this.error=u.error),this.hls.trigger(c,u)};this.observer=new Ri,this.observer.on(p.FRAG_DECRYPTED,s),this.observer.on(p.ERROR,s);const l=fn(i.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const c=this.hls.logger;if(i.workerPath||qo()){try{i.workerPath?(c.log(`loading Web Worker ${i.workerPath} for "${t}"`),this.workerContext=tl(i.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=el());const{worker:f}=this.workerContext;f.addEventListener("message",this.onWorkerMessage),f.addEventListener("error",this.onWorkerError),f.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:l,id:t,config:ot(i)})}catch(f){c.warn(`Error setting up "${t}" Web Worker, fallback to inline`,f),this.terminateWorker(),this.error=null,this.transmuxer=new ja(this.observer,l,i,"",t,e.logger)}return}}this.transmuxer=new ja(this.observer,l,i,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=Ya++;const t=this.hls.config,n=fn(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:ot(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),nl(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,n,r,i,s,l,c,u,f){var d,_;u.transmuxing.start=self.performance.now();const{instanceNo:b,transmuxer:E}=this,G=s?s.start:i.start,N=i.decryptdata,le=this.frag,ke=!(le&&i.cc===le.cc),Ee=!(le&&u.level===le.level),Ke=le?u.sn-le.sn:-1,We=this.part?u.part-this.part.index:-1,gt=Ke===0&&u.id>1&&u.id===(le==null?void 0:le.stats.chunkCount),Xe=!Ee&&(Ke===1||Ke===0&&(We===1||gt&&We<=0)),st=self.performance.now();(Ee||Ke||i.stats.parsing.start===0)&&(i.stats.parsing.start=st),s&&(We||!Xe)&&(s.stats.parsing.start=st);const ht=!(le&&((d=i.initSegment)==null?void 0:d.url)===((_=le.initSegment)==null?void 0:_.url)),Je=new Hl(ke,Xe,c,Ee,G,ht);if(!Xe||ke||ht){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${i.type} sn: ${u.sn}${u.part>-1?" part: "+u.part:""} ${this.id===ce.MAIN?"level":"track"}: ${u.level} id: ${u.id}
discontinuity: ${ke}
trackSwitch: ${Ee}
contiguous: ${Xe}
accurateTimeOffset: ${c}
timeOffset: ${G}
initSegmentChange: ${ht}`);const Kt=new Wl(n,r,t,l,f);this.configureTransmuxer(Kt)}if(this.frag=i,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:b,cmd:"demux",data:e,decryptdata:N,chunkMeta:u,state:Je},e instanceof ArrayBuffer?[e]:[]);else if(E){const Kt=E.push(e,N,u,Je);ms(Kt)?Kt.then(dn=>{this.handleTransmuxComplete(dn)}).catch(dn=>{this.transmuxerError(dn,u,"transmuxer-interface push error")}):this.handleTransmuxComplete(Kt)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(n){const r=n.flush(e);ms(r)?r.then(i=>{this.handleFlushResult(i,e)}).catch(i=>{this.transmuxerError(i,e,"transmuxer-interface flush error")}):this.handleFlushResult(r,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(p.ERROR,{type:fe.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):n&&n.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const Qa=100;class jl extends Dr{constructor(e,t,n){super(e,t,n,"audio-stream-controller",ce.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:i}){if(n===ce.MAIN){const s=t.cc,l=this.fragCurrent;if(this.initPTS[s]={baseTime:r,timescale:i},this.log(`InitPTS for cc: ${s} found from main: ${r}/${i}`),this.mainAnchor=t,this.state===ft.WAITING_INIT_PTS){const c=this.waitingData;(!c&&!this.loadingParts||c&&c.frag.cc!==s)&&this.syncWithAnchor(t,c==null?void 0:c.frag)}else!this.hls.hasEnoughToStart&&l&&l.cc!==s?(l.abortRequests(),this.syncWithAnchor(t,l)):this.state===ft.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var n;const r=((n=this.mainFragLoading)==null?void 0:n.frag)||null;if(t&&(r==null?void 0:r.cc)===t.cc)return;const i=(r||e).cc,s=this.getLevelDetails(),l=this.getLoadPosition(),c=Nt(s,i,l);c&&(this.log(`Waiting fragment cc (${t==null?void 0:t.cc}) cancelled because video is at cc ${e.cc}`),this.startFragRequested=!1,this.nextLoadPosition=c.start,this.resetLoadingState(),this.state===ft.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=ft.STOPPED;return}const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(Qa),n>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=ft.IDLE):this.state=ft.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case ft.IDLE:this.doTickIdle();break;case ft.WAITING_TRACK:{const{levels:t,trackId:n}=this,r=t==null?void 0:t[n],i=r==null?void 0:r.details;if(i&&!this.waitForLive(r)){if(this.waitForCdnTuneIn(i))break;this.state=ft.WAITING_INIT_PTS}break}case ft.FRAG_LOADING_WAITING_RETRY:{var e;const t=performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:r,trackId:i}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((r==null?void 0:r[i])||null),this.state=ft.IDLE}break}case ft.WAITING_INIT_PTS:{const t=this.waitingData;if(t){const{frag:n,part:r,cache:i,complete:s}=t,l=this.mainAnchor;if(this.initPTS[n.cc]!==void 0){this.waitingData=null,this.state=ft.FRAG_LOADING;const c=i.flush().buffer,u={frag:n,part:r,payload:c,networkDetails:null};this._handleFragmentLoadProgress(u),s&&super._handleFragmentLoadComplete(u)}else l&&l.cc!==t.frag.cc&&this.syncWithAnchor(l,t.frag)}else this.state=ft.IDLE}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:n,media:r,trackId:i}=this,s=t.config;if(!this.buffering||!r&&!this.primaryPrefetch&&(this.startFragRequested||!s.startFragPrefetch)||!(n!=null&&n[i]))return;const l=n[i],c=l.details;if(!c||this.waitForLive(l)||this.waitForCdnTuneIn(c)){this.state=ft.WAITING_TRACK,this.startFragRequested=!1;return}const u=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&u&&(this.bufferFlushed=!1,this.afterBufferFlushed(u,g.AUDIO,ce.AUDIO));const f=this.getFwdBufferInfo(u,ce.AUDIO);if(f===null)return;if(!this.switchingTrack&&this._streamEnded(f,c)){t.trigger(p.BUFFER_EOS,{type:"audio"}),this.state=ft.ENDED;return}const d=f.len,_=t.maxBufferLength,b=c.fragments,E=b[0].start,G=this.getLoadPosition(),N=this.flushing?G:f.end;if(this.switchingTrack&&r){const Ee=G;c.PTSKnown&&Ee<E&&(f.end>E||f.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=E+.05)}if(d>=_&&!this.switchingTrack&&N<b[b.length-1].start)return;let le=this.getNextFragment(N,c);if(le&&this.isLoopLoading(le,N)&&(le=this.getNextFragmentLoopLoading(le,c,f,ce.MAIN,_)),!le){this.bufferFlushed=!0;return}let ke=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&ke&&ie(le)&&!le.endList&&(!c.live||!this.loadingParts&&N<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(ke)===Bn.OK&&(this.mainFragLoading=ke=null),ke&&ie(ke))){if(le.start>ke.end){const Ke=this.fragmentTracker.getFragAtPos(N,ce.MAIN);Ke&&Ke.end>ke.end&&(ke=Ke,this.mainFragLoading={frag:Ke,targetBufferTime:null})}if(le.start>ke.end)return}this.loadFragment(le,l,N)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new pt(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==ft.STOPPED&&(this.setInterval(Qa),this.state=ft.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(p.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:r}=this,{details:i,id:s,groupId:l,track:c}=t;if(!r){this.warn(`Audio tracks reset while loading track ${s} "${c.name}" of "${l}"`);return}const u=this.mainDetails;if(!u||i.endCC>u.endCC||u.expired){this.cachedTrackLoadedData=t,this.state!==ft.STOPPED&&(this.state=ft.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${c.name}" of "${l}" loaded [${i.startSN},${i.endSN}]${i.lastPartSn?`[part-${i.lastPartSn}-${i.lastPartIndex}]`:""},duration:${i.totalduration}`);const f=r[s];let d=0;if(i.live||(n=f.details)!=null&&n.live){if(this.checkLiveUpdate(i),i.deltaUpdateFailed)return;if(f.details){var _;d=this.alignPlaylists(i,f.details,(_=this.levelLastLoaded)==null?void 0:_.details)}i.alignedSliding||(xs(i,u),i.alignedSliding||es(i,u),d=i.fragmentStart)}f.details=i,this.levelLastLoaded=f,this.startFragRequested||this.setStartPosition(u,d),this.hls.trigger(p.AUDIO_TRACK_UPDATED,{details:i,id:s,groupId:t.groupId}),this.state===ft.WAITING_TRACK&&!this.waitForCdnTuneIn(i)&&(this.state=ft.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:r,payload:i}=e,{config:s,trackId:l,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const u=c[l];if(!u){this.warn("Audio track is undefined on fragment load progress");return}const f=u.details;if(!f){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const d=s.defaultAudioCodec||u.audioCodec||"mp4a.40.2";let _=this.transmuxer;_||(_=this.transmuxer=new Xa(this.hls,ce.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const b=this.initPTS[n.cc],E=(t=n.initSegment)==null?void 0:t.data;if(b!==void 0){const N=r?r.index:-1,le=N!==-1,ke=new bn(n.level,n.sn,n.stats.chunkCount,i.byteLength,N,le);_.push(i,E,d,"",n,r,f.totalduration,!1,ke,b)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${f.startSN} ,${f.endSN}],track ${l}`);const{cache:G}=this.waitingData=this.waitingData||{frag:n,part:r,cache:new jr,complete:!1};G.push(new Uint8Array(i)),this.state!==ft.STOPPED&&(this.state=ft.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===ce.MAIN&&ie(t.frag)&&(this.mainFragLoading=t,this.state===ft.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:n,part:r}=t;if(n.type!==ce.AUDIO){!this.audioOnly&&n.type===ce.MAIN&&!n.elementaryStreams.video&&!n.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(ie(n)){this.fragPrevious=n;const i=this.switchingTrack;i&&(this.bufferedTrack=i,this.switchingTrack=null,this.hls.trigger(p.AUDIO_TRACK_SWITCHED,y({},i)))}this.fragBufferedComplete(n,r),this.media&&this.tick()}onError(e,t){var n;if(t.fatal){this.state=ft.ERROR;return}switch(t.details){case $.FRAG_GAP:case $.FRAG_PARSING_ERROR:case $.FRAG_DECRYPT_ERROR:case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ce.AUDIO,t);break;case $.AUDIO_TRACK_LOAD_ERROR:case $.AUDIO_TRACK_LOAD_TIMEOUT:case $.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===ft.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===me.AUDIO_TRACK&&(this.state=ft.IDLE);break;case $.BUFFER_ADD_CODEC_ERROR:case $.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.resetLoadingState();break;case $.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case $.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==g.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==g.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===ft.ENDED&&(this.state=ft.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,ce.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:r}=this,{remuxResult:i,chunkMeta:s}=e,l=this.getCurrentContext(s);if(!l){this.resetWhenMissingContext(s);return}const{frag:c,part:u,level:f}=l,{details:d}=f,{audio:_,text:b,id3:E,initSegment:G}=i;if(this.fragContextChanged(c)||!d){this.fragmentTracker.removeFragment(c);return}if(this.state=ft.PARSING,this.switchingTrack&&_&&this.completeAudioSwitch(this.switchingTrack),G!=null&&G.tracks){const N=c.initSegment||c;this._bufferInitSegment(f,G.tracks,N,s),r.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:N,id:n,tracks:G.tracks})}if(_){const{startPTS:N,endPTS:le,startDTS:ke,endDTS:Ee}=_;u&&(u.elementaryStreams[g.AUDIO]={startPTS:N,endPTS:le,startDTS:ke,endDTS:Ee}),c.setElementaryStreamInfo(g.AUDIO,N,le,ke,Ee),this.bufferFragmentData(_,c,u,s)}if(E!=null&&(t=E.samples)!=null&&t.length){const N=h({id:n,frag:c,details:d},E);r.trigger(p.FRAG_PARSING_METADATA,N)}if(b){const N=h({id:n,frag:c,details:d},b);r.trigger(p.FRAG_PARSING_USERDATA,N)}}_bufferInitSegment(e,t,n,r){if(this.state!==ft.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const i=t.audio;i.id=ce.AUDIO;const s=e.audioCodec;this.log(`Init audio buffer, container:${i.container}, codecs[level/parsed]=[${s}/${i.codec}]`),s&&s.split(",").length===1&&(i.levelCodec=s),this.hls.trigger(p.BUFFER_CODECS,t);const l=i.initSegment;if(l!=null&&l.byteLength){const c={type:"audio",frag:n,part:null,chunkMeta:r,parent:n.type,data:l};this.hls.trigger(p.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);if(this.switchingTrack||r===Bn.NOT_LOADED||r===Bn.PARTIAL){var i;if(!ie(e))this._loadInitSegment(e,t);else if((i=t.details)!=null&&i.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=ft.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragmentStart!==t.details.fragmentStart&&es(t.details,s)}else super.loadFragment(e,t,n)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:n,assocLang:r,characteristics:i,audioCodec:s,channels:l}=this.bufferedTrack;Ue({name:t,lang:n,assocLang:r,characteristics:i,audioCodec:s,channels:l},e,at)||(wt(e.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(p.AUDIO_TRACK_SWITCHED,y({},e))}}class ta extends z{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const r=t==null?void 0:t.renditionReports;if(r){let i=-1;for(let s=0;s<r.length;s++){const l=r[s];let c;try{c=new self.URL(l.URI,t.url).href}catch(u){this.warn(`Could not construct new URL for Rendition Report: ${u}`),c=l.URI||""}if(c===e){i=s;break}else c===e.substring(0,c.length)&&(i=s)}if(i!==-1){const s=r[i],l=parseInt(s["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let c=parseInt(s["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const f=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&f>t.partTarget&&(c+=1)}const u=n&&Pe(n);return new Tt(l,c>=0?c:void 0,u)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}return e}playlistLoaded(e,t,n){const{details:r,stats:i}=t,s=self.performance.now(),l=i.loading.first?Math.max(0,s-i.loading.first):0;r.advancedDateTime=Date.now()-l;const c=this.hls.config.timelineOffset;if(c!==r.appliedTimelineOffset){const f=Math.max(c||0,0);r.appliedTimelineOffset=f,r.fragments.forEach(d=>{d.start=d.playlistOffset+f})}if(r.live||n!=null&&n.live){const f="levelInfo"in t?t.levelInfo:t.track;if(r.reloaded(n),n&&r.fragments.length>0){fs(n,r);const ke=r.playlistParsingError;if(ke){this.warn(ke);const Ee=this.hls;if(!Ee.config.ignorePlaylistParsingErrors){var u;const{networkDetails:Ke}=t;Ee.trigger(p.ERROR,{type:fe.NETWORK_ERROR,details:$.LEVEL_PARSING_ERROR,fatal:!1,url:r.url,error:ke,reason:ke.message,level:t.level||void 0,parent:(u=r.fragments[0])==null?void 0:u.type,networkDetails:Ke,stats:i});return}r.playlistParsingError=null}}r.requestScheduled===-1&&(r.requestScheduled=i.loading.start);const d=this.hls.mainForwardBufferInfo,_=d?d.end-d.len:0,b=(r.edge-_)*1e3,E=Kr(r,b);if(r.requestScheduled+E<s?r.requestScheduled=s:r.requestScheduled+=E,this.log(`live playlist ${e} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:r.updated?"UPDATED":"MISSED"}`),!this.canLoad||!r.live)return;let G,N,le;if(r.canBlockReload&&r.endSN&&r.advanced){const ke=this.hls.config.lowLatencyMode,Ee=r.lastPartSn,Ke=r.endSN,We=r.lastPartIndex,gt=We!==-1,Xe=Ee===Ke;gt?Xe?(N=Ke+1,le=ke?0:We):(N=Ee,le=ke?We+1:r.maxPartIndex):N=Ke+1;const st=r.age,ht=st+r.ageHeader;let Je=Math.min(ht-r.partTarget,r.targetduration*1.5);if(Je>0){if(ht>r.targetduration*3)this.log(`Playlist last advanced ${st.toFixed(2)}s ago. Omitting segment and part directives.`),N=void 0,le=void 0;else if(n!=null&&n.tuneInGoal&&ht-r.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${Je} with playlist age: ${r.age}`),Je=0;else{const Kt=Math.floor(Je/r.targetduration);if(N+=Kt,le!==void 0){const dn=Math.round(Je%r.targetduration/r.partTarget);le+=dn}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${st.toFixed(2)}s goal: ${Je} skip sn ${Kt} to part ${le}`)}r.tuneInGoal=Je}if(G=this.getDeliveryDirectives(r,t.deliveryDirectives,N,le),ke||!Xe){r.requestScheduled=s,this.loadingPlaylist(f,G);return}}else(r.canBlockReload||r.canSkipUntil)&&(G=this.getDeliveryDirectives(r,t.deliveryDirectives,N,le));G&&N!==void 0&&r.canBlockReload&&(r.requestScheduled=i.loading.first+Math.max(E-l*2,E/2)),this.scheduleLoading(f,G,r)}else this.clearTimer()}scheduleLoading(e,t,n){const r=n||e.details;if(!r){this.loadingPlaylist(e,t);return}const i=self.performance.now(),s=r.requestScheduled;if(i>=s){this.loadingPlaylist(e,t);return}const l=s-i;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(l)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),l)}getDeliveryDirectives(e,t,n,r){let i=Pe(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,r=t.part,i=Me.No),new Tt(n,r,i)}checkRetry(e){const t=e.details,n=Mt(e),r=e.errorAction,{action:i,retryCount:s=0,retryConfig:l}=r||{},c=!!r&&!!l&&(i===Vt.RetryRequest||!r.resolved&&i===Vt.SendAlternateToPenaltyBox);if(c){var u;if(s>=l.maxNumRetry)return!1;if(n&&(u=e.context)!=null&&u.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const f=cn(l,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),f),this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" in ${f}ms`)}e.levelRetry=!0,r.resolved=!0}return c}}function Ja(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!vs(a[t].attrs,e[t].attrs))return!1;return!0}function vs(a,e,t){const n=a["STABLE-RENDITION-ID"];return n&&!t?n===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(r=>a[r]!==e[r])}function na(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class Yl extends ta{constructor(e){super(e,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:r,details:i}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==r){this.warn(`Audio track with id:${n} and group:${r} not found in active group ${s==null?void 0:s.groupId}`);return}const l=s.details;s.details=t.details,this.log(`Audio track ${n} "${s.name}" lang:${s.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,l)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,r=this.groupIds;let i=this.currentTrack;if(!n||(r==null?void 0:r.length)!==(n==null?void 0:n.length)||n!=null&&n.some(l=>(r==null?void 0:r.indexOf(l))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const l=this.tracks.filter(_=>!n||n.indexOf(_.groupId)!==-1);if(l.length)this.selectDefaultTrack&&!l.some(_=>_.default)&&(this.selectDefaultTrack=!1),l.forEach((_,b)=>{_.id=b});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=l;const c=this.hls.config.audioPreference;if(!i&&c){const _=ye(c,l,at);if(_>-1)i=l[_];else{const b=ye(c,this.tracks);i=this.tracks[b]}}let u=this.findTrackId(i);u===-1&&i&&(u=this.findTrackId(null));const f={audioTracks:l};this.log(`Updating audio tracks, ${l.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(p.AUDIO_TRACKS_UPDATED,f);const d=this.trackId;if(u!==-1&&d===-1)this.setAudioTrack(u);else if(l.length&&d===-1){var s;const _=new Error(`No audio track selected for current audio group-ID(s): ${(s=this.groupIds)==null?void 0:s.join(",")} track count: ${l.length}`);this.warn(_.message),this.hls.trigger(p.ERROR,{type:fe.MEDIA_ERROR,details:$.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:_})}}}onError(e,t){t.fatal||!t.context||t.context.type===me.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const r=this.currentTrack;if(r&&Ue(e,r,at))return r;const i=ye(e,this.tracksInGroup,at);if(i>-1){const s=this.tracksInGroup[i];return this.setAudioTrack(i),s}else if(r){let s=t.loadLevel;s===-1&&(s=t.firstAutoLevel);const l=ct(e,t.levels,n,s,at);if(l===-1)return null;t.nextLoadLevel=l}if(e.channels||e.audioCodec){const s=ye(e,n);if(s>-1)return n[s]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,r=t[e],i=r.details&&!r.details.live;if(e===this.trackId&&r===n&&i||(this.log(`Switching to audio-track ${e} "${r.name}" lang:${r.lang} group:${r.groupId} channels:${r.channels}`),this.trackId=e,this.currentTrack=r,this.hls.trigger(p.AUDIO_TRACK_SWITCHING,y({},r)),i))return;const s=this.switchParams(r.url,n==null?void 0:n.details,r.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const r=t[n];if(!(this.selectDefaultTrack&&!r.default)&&(!e||Ue(e,r,at)))return n}if(e){const{name:n,lang:r,assocLang:i,characteristics:s,audioCodec:l,channels:c}=e;for(let u=0;u<t.length;u++){const f=t[u];if(Ue({name:n,lang:r,assocLang:i,characteristics:s,audioCodec:l,channels:c},f,at))return u}for(let u=0;u<t.length;u++){const f=t[u];if(vs(e.attrs,f.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return u}for(let u=0;u<t.length;u++){const f=t[u];if(vs(e.attrs,f.attrs,["LANGUAGE"]))return u}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&wt(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,r=e.groupId,i=this.getUrlWithDirectives(e.url,t),s=e.details,l=s==null?void 0:s.age;this.log(`Loading audio-track ${n} "${e.name}" lang:${e.lang} group:${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${l&&s.live?" age "+l.toFixed(1)+(s.type?" "+s.type||0:""):""} ${i}`),this.hls.trigger(p.AUDIO_TRACK_LOADING,{url:i,id:n,groupId:r,deliveryDirectives:t||null,track:e})}}class Xl{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,n){if(this.queues===null||this.tracks===null)return;const r=this.queues[t];r.push(e),r.length===1&&!n&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const n={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const n={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(n)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const n=(t=e[0])==null?void 0:t.label;(n==="async-blocker"||n==="async-blocker-prepend")&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(this.queues===null)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(this.queues===null||this.tracks===null)return;const t=this.queues[e];if(t.length){const r=t[0];try{r.execute()}catch(i){var n;if(r.onError(i),this.queues===null||this.tracks===null)return;const s=(n=this.tracks[e])==null?void 0:n.buffer;s!=null&&s.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues!==null&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return((t=this.queues)==null?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return e===null||t===null?"<destroyed>":`
${this.list("video")}
${this.list("audio")}
${this.list("audiovideo")}}`}list(e){var t,n;return(t=this.queues)!=null&&t[e]||(n=this.tracks)!=null&&n[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const n=(t=this.tracks)==null?void 0:t[e],r=n==null?void 0:n.buffer;return r?`SourceBuffer${r.updating?" updating":""}${n.ended?" ended":""}${n.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(n=>n.label).join(", "))||""}}const qa=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,eo="HlsJsTrackRemovedError";class Ql extends Error{constructor(e){super(e),this.name=eo}}class Jl extends z{constructor(e,t){super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=n=>{var r;this.hls&&((r=this.mediaSource)==null?void 0:r.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=n=>{const{media:r,mediaSource:i}=this;n&&this.log("Media source opened"),!(!r||!i)&&(i.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(p.MEDIA_ATTACHED,{media:r,mediaSource:i}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:r}=this;n!==r&&this.error(`Media element src was set while attaching MediaSource (${r} > ${n})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=ve(he(e.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_APPENDING,this.onBufferAppending,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.BUFFER_EOS,this.onBufferEos,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.FRAG_PARSED,this.onFragParsed,this),e.on(p.FRAG_CHANGED,this.onFragChanged,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_APPENDING,this.onBufferAppending,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_EOS,this.onBufferEos,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.FRAG_PARSED,this.onFragParsed,this),e.off(p.FRAG_CHANGED,this.onFragChanged,this),e.off(p.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const n={};if(this.operationQueue){const i=this.isUpdating();i||this.operationQueue.removeBlockers();const s=this.isQueued();(i||s)&&this.warn(`Transfering MediaSource with${s?" operations in queue":""}${i?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const r=this.transferData;return!this.sourceBufferCount&&r&&r.mediaSource===t?h(n,r.tracks):this.sourceBuffers.forEach(i=>{const[s]=i;s&&(n[s]=h({},this.tracks[s]),this.removeBuffer(s)),i[0]=i[1]=null}),{media:e,mediaSource:t,tracks:n}}initTracks(){const e={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=e,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var n;let r=2;(t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsTotal=r,this.log(`${r} bufferCodec event(s) expected.`),(n=this.transferData)!=null&&n.mediaSource&&this.sourceBufferCount&&r&&this.bufferCreated()}onMediaAttaching(e,t){const n=this.media=t.media,r=he(this.appendSource);if(this.transferData=this.overrides=void 0,n&&r){const i=!!t.mediaSource;(i||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const s=this.mediaSource=t.mediaSource||new r;if(this.assignMediaSource(s),i)this._objectUrl=n.src,this.attachTransferred();else{const l=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{n.removeAttribute("src");const c=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||c&&s instanceof c,to(n),ql(n,l),n.load()}catch(c){n.src=l}else n.src=l}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,n;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(n=e.constructor)==null?void 0:n.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const n=this.tracks,r=t.tracks,i=r?Object.keys(r):null,s=i?i.length:0,l=()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()};if(r&&i&&s){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
required tracks: ${ot(n,(c,u)=>c==="initSegment"?void 0:u)};
transfer tracks: ${ot(r,(c,u)=>c==="initSegment"?void 0:u)}}`),!be(r,n)){t.mediaSource=null,t.tracks=void 0;const c=e.currentTime,u=this.details,f=Math.max(c,(u==null?void 0:u.fragments[0].start)||0);if(f-c>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${c} -> ${f}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(r)}"->"${Object.keys(n)}") start time: ${f} currentTime: ${c}`),this.onMediaDetaching(p.MEDIA_DETACHING,{}),this.onMediaAttaching(p.MEDIA_ATTACHING,t),e.currentTime=f;return}this.transferData=void 0,i.forEach(c=>{const u=c,f=r[u];if(f){const d=f.buffer;if(d){const _=this.fragmentTracker,b=f.id;if(_.hasFragments(b)||_.hasParts(b)){const N=tn.getBuffered(d);_.detectEvictedFragments(u,N,b,null,!0)}const E=ra(u),G=[u,d];this.sourceBuffers[E]=G,d.updating&&this.operationQueue&&this.operationQueue.prependBlocker(u),this.trackSourceBuffer(u,f)}}}),l(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),l()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const n=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:r,mediaSource:i,_objectUrl:s}=this;if(i){if(this.log(`media source ${n?"transferring":"detaching"}`),n)this.sourceBuffers.forEach(([l])=>{l&&this.removeBuffer(l)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const l=i.readyState==="open";try{const c=i.sourceBuffers;for(let u=c.length;u--;)l&&c[u].abort(),i.removeSourceBuffer(c[u]);l&&i.endOfStream()}catch(c){this.warn(`onMediaDetaching: ${c.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(i.removeEventListener("startstreaming",this._onStartStreaming),i.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}r&&(r.removeEventListener("emptied",this._onMediaEmptied),n||(s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(r.removeAttribute("src"),this.appendSource&&to(r),r.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(p.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const n=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),n)try{var r;(r=this.mediaSource)!=null&&r.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(i){this.warn(`onBufferReset ${e}`,i)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[ra(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new Xl(this.tracks)}onBufferCodecs(e,t){const n=this.tracks,r=Object.keys(t);this.log(`BUFFER_CODECS: "${r}" (current SB count ${this.sourceBufferCount})`);const i="audiovideo"in t&&(n.audio||n.video)||n.audiovideo&&("audio"in t||"video"in t),s=!i&&this.sourceBufferCount&&this.media&&r.some(l=>!n[l]);if(i||s){this.warn(`Unsupported transition between "${Object.keys(n)}" and "${r}" SourceBuffers`);return}r.forEach(l=>{var c,u,f;const d=t[l],{id:_,codec:b,levelCodec:E,container:G,metadata:N,supplemental:le}=d;let ke=n[l];const Ee=(c=this.transferData)==null||(u=c.tracks)==null?void 0:u[l],Ke=Ee!=null&&Ee.buffer?Ee:ke,We=(Ke==null?void 0:Ke.pendingCodec)||(Ke==null?void 0:Ke.codec),gt=Ke==null?void 0:Ke.levelCodec;ke||(ke=n[l]={buffer:void 0,listeners:[],codec:b,supplemental:le,container:G,levelCodec:E,metadata:N,id:_});const Xe=it(We,gt),st=Xe==null?void 0:Xe.replace(qa,"$1");let ht=it(b,E);const Je=(f=ht)==null?void 0:f.replace(qa,"$1");ht&&Xe&&st!==Je&&(l.slice(0,5)==="audio"&&(ht=et(ht,this.appendSource)),this.log(`switching codec ${We} to ${ht}`),ht!==(ke.pendingCodec||ke.codec)&&(ke.pendingCodec=ht),ke.container=G,this.appendChangeType(l,G,ht))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&this.mediaSourceOpenOrEnded&&this.checkPendingTracks()}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{const n=this.tracks[t];return e[t]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},e},{})}appendChangeType(e,t,n){const r=`${t};codecs=${n}`,i={label:`change-type=${r}`,execute:()=>{const s=this.tracks[e];if(s){const l=s.buffer;l!=null&&l.changeType&&(this.log(`changing ${e} sourceBuffer type to ${r}`),l.changeType(r),s.codec=n,s.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:s=>{this.warn(`Failed to change ${e} SourceBuffer type`,s)}};this.append(i,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const n=e.start,r=n+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(n,ce.MAIN))==null?void 0:t.gap)===!0)return;const s={label:"block-audio",execute:()=>{var l;const c=this.tracks.video;(this.lastVideoAppendEnd>r||c!=null&&c.buffer&&tn.isBuffered(c.buffer,r)||((l=this.fragmentTracker.getAppendedFrag(r,ce.MAIN))==null?void 0:l.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:l=>{this.warn("Error executing block-audio operation",l)}};this.blockedAudioAppend={op:s,frag:e},this.append(s,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:n}=this,{data:r,type:i,parent:s,frag:l,part:c,chunkMeta:u}=t,f=u.buffering[i],d=l.sn,_=self.performance.now();f.start=_;const b=l.stats.buffering,E=c?c.stats.buffering:null;b.start===0&&(b.start=_),E&&E.start===0&&(E.start=_);const G=n.audio;let N=!1;i==="audio"&&(G==null?void 0:G.container)==="audio/mpeg"&&(N=!this.lastMpegAudioChunk||u.id===1||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);const le=this.tracks.video,ke=le==null?void 0:le.buffer;if(ke&&d!=="initSegment"){const We=c||l,gt=this.blockedAudioAppend;if(i==="audio"&&s!=="main"&&!this.blockedAudioAppend){const st=We.start+We.duration*.05,ht=ke.buffered,Je=this.currentOp("video");!ht.length&&!Je?this.blockAudio(We):!Je&&!tn.isBuffered(ke,st)&&this.lastVideoAppendEnd<st&&this.blockAudio(We)}else if(i==="video"){const Xe=We.end;if(gt){const st=gt.frag.start;(Xe>st||Xe<this.lastVideoAppendEnd||tn.isBuffered(ke,st))&&this.unblockAudio()}this.lastVideoAppendEnd=Xe}}const Ee=(c||l).start,Ke={label:`append-${i}`,execute:()=>{if(f.executeStart=self.performance.now(),N){const We=this.tracks[i];if(We){const gt=We.buffer;if(gt){const Xe=Ee-gt.timestampOffset;Math.abs(Xe)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${Ee} (delta: ${Xe}) sn: ${d})`),gt.timestampOffset=Ee)}}}this.appendExecutor(r,i)},onStart:()=>{},onComplete:()=>{const We=self.performance.now();f.executeEnd=f.end=We,b.first===0&&(b.first=We),E&&E.first===0&&(E.first=We);const gt={};this.sourceBuffers.forEach(([Xe,st])=>{Xe&&(gt[Xe]=tn.getBuffered(st))}),this.appendErrors[i]=0,i==="audio"||i==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(p.BUFFER_APPENDED,{type:i,frag:l,part:c,chunkMeta:u,parent:l.type,timeRanges:gt})},onError:We=>{var gt;const Xe={type:fe.MEDIA_ERROR,parent:l.type,details:$.BUFFER_APPEND_ERROR,sourceBufferName:i,frag:l,part:c,chunkMeta:u,error:We,err:We,fatal:!1},st=(gt=this.media)==null?void 0:gt.error;if(We.code===DOMException.QUOTA_EXCEEDED_ERR)Xe.details=$.BUFFER_FULL_ERROR;else if(We.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!st)Xe.errorAction=Wn(!0);else if(We.name===eo&&this.sourceBufferCount===0)Xe.errorAction=Wn(!0);else{const ht=++this.appendErrors[i];this.warn(`Failed ${ht}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${i}" sourceBuffer (${st||"no media error"})`),(ht>=this.hls.config.appendErrorMaxRetry||st)&&(Xe.fatal=!0)}this.hls.trigger(p.ERROR,Xe)}};this.append(Ke,i,this.isPending(this.tracks[i]))}getFlushOp(e,t,n){return this.log(`queuing "${e}" remove ${t}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(p.BUFFER_FLUSHED,{type:e})},onError:r=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,r)}}}onBufferFlushing(e,t){const{type:n,startOffset:r,endOffset:i}=t;n?this.append(this.getFlushOp(n,r,i),n):this.sourceBuffers.forEach(([s])=>{s&&this.append(this.getFlushOp(s,r,i),s)})}onFragParsed(e,t){const{frag:n,part:r}=t,i=[],s=r?r.elementaryStreams:n.elementaryStreams;s[g.AUDIOVIDEO]?i.push("audiovideo"):(s[g.AUDIO]&&i.push("audio"),s[g.VIDEO]&&i.push("video"));const l=()=>{const c=self.performance.now();n.stats.buffering.end=c,r&&(r.stats.buffering.end=c);const u=r?r.stats:n.stats;this.hls.trigger(p.FRAG_BUFFERED,{frag:n,part:r,stats:u,id:n.type})};i.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(l,i).catch(c=>{this.warn(`Fragment buffered callback ${c}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{var t,n;return e&&(!((t=this.tracks[e])!=null&&t.ended)||((n=this.tracks[e])==null?void 0:n.ending))})}onBufferEos(e,t){var n;this.sourceBuffers.forEach(([s])=>{if(s){const l=this.tracks[s];(!t.type||t.type===s)&&(l.ending=!0,l.ended||(l.ended=!0,this.log(`${s} buffer reached EOS`)))}});const r=((n=this.overrides)==null?void 0:n.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([s])=>{var l;return s&&!((l=this.tracks[s])!=null&&l.ended)})&&(r?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:s}=this;if(!s||s.readyState!=="open"){s&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${s.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),s.endOfStream(),this.hls.trigger(p.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(p.BUFFERED_TO_END,void 0)))}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){const e=this.getDurationAndRange();e&&this.blockUntilOpen(()=>this.updateMediaSource(e))}onError(e,t){if(t.details===$.BUFFER_APPEND_ERROR&&t.frag){var n;const r=(n=t.errorAction)==null?void 0:n.nextAutoLevel;k(r)&&r!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.sourceBufferCount)return;const r=e.config,i=n.currentTime,s=t.levelTargetDuration,l=t.live&&r.liveBackBufferLength!==null?r.liveBackBufferLength:r.backBufferLength;if(k(l)&&l>=0){const c=Math.max(l,s),u=Math.floor(i/s)*s-c;this.flushBackBuffer(i,s,u)}if(k(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const c=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),u=Math.max(c,s),f=Math.floor(i/s)*s+u;this.flushFrontBuffer(i,s,f)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach(([r,i])=>{if(i){const l=tn.getBuffered(i);if(l.length>0&&n>l.start(0)){var s;this.hls.trigger(p.BACK_BUFFER_REACHED,{bufferEnd:n});const c=this.tracks[r];if((s=this.details)!=null&&s.live)this.hls.trigger(p.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(c!=null&&c.ended){this.log(`Cannot flush ${r} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:r})}}})}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach(([r,i])=>{if(i){const s=tn.getBuffered(i),l=s.length;if(l<2)return;const c=s.start(l-1),u=s.end(l-1);if(n>c||e>=c&&e<=u)return;this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:r})}})}getDurationAndRange(){var e;const{details:t,mediaSource:n}=this;if(!t||!this.media||(n==null?void 0:n.readyState)!=="open")return null;const r=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&t.live&&n.setLiveSeekableRange){const u=Math.max(0,t.fragmentStart),f=Math.max(u,r);return{duration:1/0,start:u,end:f}}return{duration:1/0}}const i=(e=this.overrides)==null?void 0:e.duration;if(i)return k(i)?{duration:i}:null;const s=this.media.duration,l=k(n.duration)?n.duration:0;return r>l&&r>s||!k(s)?{duration:r}:null}updateMediaSource({duration:e,start:t,end:n}){const r=this.mediaSource;!this.media||!r||r.readyState!=="open"||(r.duration!==e&&(k(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),r.duration=e),t!==void 0&&n!==void 0&&(this.log(`MediaSource duration is set to ${r.duration}. Setting seekable range to ${t}-${n}.`),r.setLiveSeekableRange(t,n)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${ot(n)}`),this.tracksReady){var r;const i=(r=this.transferData)==null?void 0:r.tracks;i&&Object.keys(i).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,n])=>{if(t){const r=this.tracks[t];e[t]={buffer:n,container:r.container,codec:r.codec,supplemental:r.supplemental,levelCodec:r.levelCodec,id:r.id,metadata:r.metadata}}}),this.hls.trigger(p.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([t])=>{this.executeNext(t)})}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(p.ERROR,{type:fe.MEDIA_ERROR,details:$.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const i in e){const s=i,l=e[s];if(this.isPending(l)){const c=this.getTrackCodec(l,s),u=`${l.container};codecs=${c}`;l.codec=c,this.log(`creating sourceBuffer(${u})${this.currentOp(s)?" Queued":""} ${ot(l)}`);try{const f=n.addSourceBuffer(u),d=ra(s),_=[s,f];t[d]=_,l.buffer=f}catch(f){var r;this.error(`error while trying to add sourceBuffer: ${f.message}`),this.shiftAndExecuteNext(s),(r=this.operationQueue)==null||r.removeBlockers(),delete this.tracks[s],this.hls.trigger(p.ERROR,{type:fe.MEDIA_ERROR,details:$.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,sourceBufferName:s,mimeType:u,parent:l.id});return}this.trackSourceBuffer(s,l)}}this.bufferCreated()}getTrackCodec(e,t){const n=e.supplemental;let r=e.codec;n&&(t==="video"||t==="audiovideo")&&Le(n,"video")&&(r=Ye(r,n));const i=it(r,e.levelCodec);return i?t.slice(0,5)==="audio"?et(i,this.appendSource):i:""}trackSourceBuffer(e,t){const n=t.buffer;if(!n)return;const r=this.getTrackCodec(t,e);this.tracks[e]={buffer:n,codec:r,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(i,s)=>{const l=s.removedRanges;l!=null&&l.length&&this.hls.trigger(p.BUFFER_FLUSHED,{type:i})})}get mediaSrc(){var e,t;const n=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return n==null?void 0:n.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const n=this.currentOp(e);n&&(n.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var n;const r=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${r}`,t),this.hls.trigger(p.ERROR,{type:fe.MEDIA_ERROR,details:$.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:r,fatal:!1});const i=this.currentOp(e);i&&i.onError(r)}removeExecutor(e,t,n){const{media:r,mediaSource:i}=this,s=this.tracks[e],l=s==null?void 0:s.buffer;if(!r||!i||!l){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const c=k(r.duration)?r.duration:1/0,u=k(i.duration)?i.duration:1/0,f=Math.max(0,t),d=Math.min(n,c,u);d>f&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${f},${d}] from the ${e} SourceBuffer`),l.remove(f,d)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],r=n==null?void 0:n.buffer;if(!r)throw new Ql(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,r.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:n}=this,r=t.map(s=>this.appendBlocker(s));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(r).then(s=>{n===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var n;const r=(n=this.tracks[t])==null?void 0:n.buffer;!r||r.updating||this.shiftAndExecuteNext(t)})}append(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((e,t)=>e+(this.isPending(this.tracks[t])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[t])=>e+(t?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,t,n){const r=this.tracks[e];if(!r)return;const i=r.buffer;if(!i)return;const s=n.bind(this,e);r.listeners.push({event:t,listener:s}),i.addEventListener(t,s)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const n=t.buffer;n&&(t.listeners.forEach(r=>{n.removeEventListener(r.event,r.listener)}),t.listeners.length=0)}}function to(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function ql(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}function ra(a){return a==="audio"?1:0}class ia{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(p.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(p.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&k(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter((r,i)=>this.isLevelAllowed(r)&&i<=e);return this.clientRect=null,ia.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,!t.width&&!t.height&&(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(t){}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some(n=>e.bitrate===n.bitrate&&e.width===n.width&&e.height===n.height)}static getMaxLevelByMediaSize(e,t,n){if(!(e!=null&&e.length))return-1;const r=(l,c)=>c?l.width!==c.width||l.height!==c.height:!0;let i=e.length-1;const s=Math.max(t,n);for(let l=0;l<e.length;l+=1){const c=e[l];if((c.width>=s||c.height>=s)&&r(c,e[l+1])){i=l;break}}return i}}const ii={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},eu={HLS:"h"},_s={OBJECT:"CMCD-Object",REQUEST:"CMCD-Request",SESSION:"CMCD-Session",STATUS:"CMCD-Status"},tu={[_s.OBJECT]:["br","d","ot","tb"],[_s.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[_s.SESSION]:["cid","pr","sf","sid","st","v"],[_s.STATUS]:["bs","rtp"]};class is{constructor(e,t){Array.isArray(e)&&(e=e.map(n=>n instanceof is?n:new is(n))),this.value=e,this.params=t}}const nu="Dict";function ru(a){return Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":typeof a=="object"?JSON.stringify(a):String(a)}function iu(a,e,t,n){return new Error(`failed to ${a} "${ru(e)}" as ${t}`,{cause:n})}function wi(a,e,t){return iu("serialize",a,e,t)}class no{constructor(e){this.description=e}}const ro="Bare Item",su="Boolean";function au(a){if(typeof a!="boolean")throw wi(a,su);return a?"?1":"?0"}function ou(a){return btoa(String.fromCharCode(...a))}const lu="Byte Sequence";function uu(a){if(ArrayBuffer.isView(a)===!1)throw wi(a,lu);return`:${ou(a)}:`}const cu="Integer";function fu(a){return a<-999999999999999||999999999999999<a}function io(a){if(fu(a))throw wi(a,cu);return a.toString()}function du(a){return`@${io(a.getTime()/1e3)}`}function so(a,e){if(a<0)return-so(-a,e);const t=Math.pow(10,e);if(Math.abs(a*t%1-.5)<Number.EPSILON){const r=Math.floor(a*t);return(r%2===0?r:r+1)/t}else return Math.round(a*t)/t}const hu="Decimal";function pu(a){const e=so(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw wi(a,hu);const t=e.toString();return t.includes(".")?t:`${t}.0`}const gu="String",mu=/[\x00-\x1f\x7f]+/;function vu(a){if(mu.test(a))throw wi(a,gu);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function _u(a){return a.description||a.toString().slice(7,-1)}const yu="Token";function ao(a){const e=_u(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw wi(e,yu);return e}function sa(a){switch(typeof a){case"number":if(!k(a))throw wi(a,ro);return Number.isInteger(a)?io(a):pu(a);case"string":return vu(a);case"symbol":return ao(a);case"boolean":return au(a);case"object":if(a instanceof Date)return du(a);if(a instanceof Uint8Array)return uu(a);if(a instanceof no)return ao(a);default:throw wi(a,ro)}}const Eu="Key";function aa(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw wi(a,Eu);return a}function oa(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${aa(e)}`:`;${aa(e)}=${sa(t)}`).join("")}function oo(a){return a instanceof is?`${sa(a.value)}${oa(a.params)}`:sa(a)}function bu(a){return`(${a.value.map(oo).join(" ")})${oa(a.params)}`}function xu(a,e={whitespace:!0}){if(typeof a!="object")throw wi(a,nu);const t=a instanceof Map?a.entries():Object.entries(a),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([r,i])=>{i instanceof is||(i=new is(i));let s=aa(r);return i.value===!0?s+=oa(i.params):(s+="=",Array.isArray(i.value)?s+=bu(i):s+=oo(i)),s}).join(`,${n}`)}function Su(a,e){return xu(a,e)}function Tu(a){return a==="ot"||a==="sf"||a==="st"}function wu(a){return typeof a=="number"?k(a):a!=null&&a!==""&&a!==!1}function Au(a,e){const t=new URL(a),n=new URL(e);if(t.origin!==n.origin)return a;const r=t.pathname.split("/").slice(1),i=n.pathname.split("/").slice(1,-1);for(;r[0]===i[0];)r.shift(),i.shift();for(;i.length;)i.shift(),r.unshift("..");return r.join("/")}const Ps=a=>Math.round(a),Du=(a,e)=>(e!=null&&e.baseUrl&&(a=Au(a,e.baseUrl)),encodeURIComponent(a)),Os=a=>Ps(a/100)*100,Ru={br:Ps,d:Ps,bl:Os,dl:Os,mtp:Os,nor:Du,rtp:Os,tb:Ps};function Cu(a,e){const t={};if(a==null||typeof a!="object")return t;const n=Object.keys(a).sort(),r=h({},Ru,e==null?void 0:e.formatters),i=e==null?void 0:e.filter;return n.forEach(s=>{if(i!=null&&i(s))return;let l=a[s];const c=r[s];c&&(l=c(l,e)),!(s==="v"&&l===1)&&(s=="pr"&&l===1||wu(l)&&(Tu(s)&&typeof l=="string"&&(l=new no(l)),t[s]=l))}),t}function lo(a,e={}){return a?Su(Cu(a,e),h({whitespace:!1},e)):""}function Iu(a,e={}){const t={};if(!a)return t;const n=Object.entries(a),r=Object.entries(tu).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=n.reduce((s,l)=>{var c,u;const[f,d]=l,_=((c=r.find(b=>b[1].includes(f)))===null||c===void 0?void 0:c[0])||_s.REQUEST;return(u=s[_])!==null&&u!==void 0||(s[_]={}),s[_][f]=d,s},{});return Object.entries(i).reduce((s,[l,c])=>(s[l]=lo(c,e),s),t)}function Lu(a,e,t){return h(a,Iu(e,t))}const ku="CMCD";function Pu(a,e={}){if(!a)return"";const t=lo(a,e);return`${ku}=${encodeURIComponent(t)}`}const uo=/CMCD=[^&#]+/;function Ou(a,e,t){const n=Pu(e,t);if(!n)return a;if(uo.test(a))return a.replace(uo,n);const r=a.includes("?")?"&":"?";return`${a}${r}${n}`}class Mu{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=r=>{try{this.apply(r,{ot:ii.MANIFEST,su:!this.initialized})}catch(i){this.hls.logger.warn("Could not generate manifest CMCD data.",i)}},this.applyFragmentData=r=>{try{const{frag:i,part:s}=r,l=this.hls.levels[i.level],c=this.getObjectType(i),u={d:(s||i).duration*1e3,ot:c};(c===ii.VIDEO||c===ii.AUDIO||c==ii.MUXED)&&(u.br=l.bitrate/1e3,u.tb=this.getTopBandwidth(c)/1e3,u.bl=this.getBufferLength(c));const f=s?this.getNextPart(s):this.getNextFrag(i);f!=null&&f.url&&f.url!==i.url&&(u.nor=f.url),this.apply(r,u)}catch(i){this.hls.logger.warn("Could not generate segment CMCD data.",i)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||e.sessionId,this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHED,this.onMediaDetached,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHED,this.onMediaDetached,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,r;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(r=t.tracks.video)==null?void 0:r.buffer}createData(){var e;return{v:1,sf:eu.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){h(t,this.createData());const n=t.ot===ii.INIT||t.ot===ii.VIDEO||t.ot===ii.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:r}=this;r&&(t=Object.keys(t).reduce((s,l)=>(r.includes(l)&&(s[l]=t[l]),s),{}));const i={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),Lu(e.headers,t,i)):e.url=Ou(e.url,t,i)}getNextFrag(e){var t;const n=(t=this.hls.levels[e.level])==null?void 0:t.details;if(n){const r=e.sn-n.startSN;return n.fragments[r+1]}}getNextPart(e){var t,n;const{index:r,fragment:i}=e,s=(t=this.hls.levels[i.level])==null||(n=t.details)==null?void 0:n.partList;if(s){const{sn:l}=i;for(let c=s.length-1;c>=0;c--){const u=s[c];if(u.index===r&&u.fragment.sn===l)return s[c+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return ii.TIMED_TEXT;if(e.sn==="initSegment")return ii.INIT;if(t==="audio")return ii.AUDIO;if(t==="main")return this.hls.audioTracks.length?ii.VIDEO:ii.MUXED}getTopBandwidth(e){let t=0,n;const r=this.hls;if(e===ii.AUDIO)n=r.audioTracks;else{const i=r.maxAutoLevel,s=i>-1?i+1:r.levels.length;n=r.levels.slice(0,s)}return n.forEach(i=>{i.bitrate>t&&(t=i.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,n=e===ii.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:tn.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(i){this.loader=void 0,this.loader=new n(i)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(i,s,l){t(i),this.loader.load(i,s,l)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(i){this.loader=void 0,this.loader=new n(i)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(i,s,l){t(i),this.loader.load(i,s,l)}}}}const Fu=3e5;class Nu extends z{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,t)=>(e.indexOf(t.pathwayId)===-1&&e.push(t.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(n=>n!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:n}=t;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((n==null?void 0:n.action)===Vt.SendAlternateToPenaltyBox&&n.flags===Wt.MoveAllAlternatesMatchingHost){const r=this.levels;let i=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:l,pathwayId:c,type:u}=t.context;l&&r?s=this.getPathwayForGroupId(l,u,s):c&&(s=c)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!i&&r&&(i=this.pathways()),i&&i.length>1&&(this.updatePathwayPriority(i),n.resolved=this.pathwayId!==s),n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${r&&r.length} priorities: ${ot(i)} penalized: ${ot(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this._pathwayPriority=e;let t;const n=this.penalizedPathways,r=performance.now();Object.keys(n).forEach(i=>{r-n[i]>Fu&&delete n[i]});for(let i=0;i<e.length;i++){const s=e[i];if(s in n)continue;if(s===this.pathwayId)return;const l=this.hls.nextLoadLevel,c=this.hls.levels[l];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,Jr(t),this.hls.trigger(p.LEVELS_UPDATED,{levels:t});const u=this.hls.levels[l];c&&u&&this.levels&&(u.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&u.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${u.bitrate}`),this.hls.nextLoadLevel=l);break}}}getPathwayForGroupId(e,t,n){const r=this.getLevelsForPathway(n).concat(this.levels||[]);for(let i=0;i<r.length;i++)if(t===me.AUDIO_TRACK&&r[i].hasAudioGroup(e)||t===me.SUBTITLE_TRACK&&r[i].hasSubtitleGroup(e))return r[i].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},r={};e.forEach(i=>{const{ID:s,"BASE-ID":l,"URI-REPLACEMENT":c}=i;if(t.some(f=>f.pathwayId===s))return;const u=this.getLevelsForPathway(l).map(f=>{const d=new Kn(f.attrs);d["PATHWAY-ID"]=s;const _=d.AUDIO&&`${d.AUDIO}_clone_${s}`,b=d.SUBTITLES&&`${d.SUBTITLES}_clone_${s}`;_&&(n[d.AUDIO]=_,d.AUDIO=_),b&&(r[d.SUBTITLES]=b,d.SUBTITLES=b);const E=fo(f.uri,d["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),G=new pt({attrs:d,audioCodec:f.audioCodec,bitrate:f.bitrate,height:f.height,name:f.name,url:E,videoCodec:f.videoCodec,width:f.width});if(f.audioGroups)for(let N=1;N<f.audioGroups.length;N++)G.addGroupId("audio",`${f.audioGroups[N]}_clone_${s}`);if(f.subtitleGroups)for(let N=1;N<f.subtitleGroups.length;N++)G.addGroupId("text",`${f.subtitleGroups[N]}_clone_${s}`);return G});t.push(...u),co(this.audioTracks,n,c,s),co(this.subtitleTracks,r,c,s)})}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);let r;try{r=new self.URL(e)}catch(f){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(r.protocol!=="data:"){const f=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;r.searchParams.set("_HLS_pathway",this.pathwayId),r.searchParams.set("_HLS_throughput",""+f)}const i={responseType:"json",url:r.href},s=t.steeringManifestLoadPolicy.default,l=s.errorRetry||s.timeoutRetry||{},c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},u={onSuccess:(f,d,_,b)=>{this.log(`Loaded steering manifest: "${r}"`);const E=f.data;if((E==null?void 0:E.VERSION)!==1){this.log(`Steering VERSION ${E.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=E.TTL;const{"RELOAD-URI":G,"PATHWAY-CLONES":N,"PATHWAY-PRIORITY":le}=E;if(G)try{this.uri=new self.URL(G,r).href}catch(Ee){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${G}`);return}this.scheduleRefresh(this.uri||_.url),N&&this.clonePathways(N);const ke={steeringManifest:E,url:r.toString()};this.hls.trigger(p.STEERING_MANIFEST_LOADED,ke),le&&this.updatePathwayPriority(le)},onError:(f,d,_,b)=>{if(this.log(`Error loading steering manifest: ${f.code} ${f.text} (${d.url})`),this.stopLoad(),f.code===410){this.enabled=!1,this.log(`Steering manifest ${d.url} no longer available`);return}let E=this.timeToLoad*1e3;if(f.code===429){const G=this.loader;if(typeof(G==null?void 0:G.getResponseHeader)=="function"){const N=G.getResponseHeader("Retry-After");N&&(E=parseFloat(N)*1e3)}this.log(`Steering manifest ${d.url} rate limited`);return}this.scheduleRefresh(this.uri||d.url,E)},onTimeout:(f,d,_)=>{this.log(`Timeout loading steering manifest (${d.url})`),this.scheduleRefresh(this.uri||d.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(i,c,u)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const r=(n=this.hls)==null?void 0:n.media;if(r&&!r.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function co(a,e,t,n){a&&Object.keys(e).forEach(r=>{const i=a.filter(s=>s.groupId===r).map(s=>{const l=h({},s);return l.details=void 0,l.attrs=new Kn(l.attrs),l.url=l.attrs.URI=fo(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),l.groupId=l.attrs["GROUP-ID"]=e[r],l.attrs["PATHWAY-ID"]=n,l});a.push(...i)})}function fo(a,e,t,n){const{HOST:r,PARAMS:i,[t]:s}=n;let l;e&&(l=s==null?void 0:s[e],l&&(a=l));const c=new self.URL(a);return r&&!l&&(c.host=r),i&&Object.keys(i).sort().forEach(u=>{u&&c.searchParams.set(u,i[u])}),c.href}function ci(a,e,t){gi(a,e,t),a.addEventListener(e,t)}function gi(a,e,t){a.removeEventListener(e,t)}class ss extends z{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=ss.CDMCleanupPromise?[ss.CDMCleanupPromise]:[],this.onMediaEncrypted=t=>{const{initDataType:n,initData:r}=t,i=`"${t.type}" event: init data type: "${n}"`;if(this.debug(i),r!==null){if(!this.keyFormatPromise){let s=Object.keys(this.keySystemAccessPromises);s.length||(s=ur(this.config));const l=s.map(Un).filter(c=>!!c);this.keyFormatPromise=this.getKeyFormatPromise(l)}this.keyFormatPromise.then(s=>{const l=Sn(s);let c,u;if(n==="sinf"){if(l!==Fn.FAIRPLAY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const E=vt(new Uint8Array(r));try{const G=Zr(JSON.parse(E).sinf),N=W(G);if(!N)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=new Uint8Array(N.subarray(8,24)),u=Fn.FAIRPLAY}catch(G){this.warn(`${i} Failed to parse sinf: ${G}`);return}}else{if(l!==Fn.WIDEVINE&&l!==Fn.PLAYREADY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const E=St(r),G=E.filter(le=>!!le.systemId&&On(le.systemId)===l);G.length>1&&this.warn(`${i} Using first of ${G.length} pssh found for selected key-system ${l}`);const N=G[0];if(!N){E.length===0||E.some(le=>!le.systemId)?this.warn(`${i} contains incomplete or invalid pssh data`):this.log(`ignoring ${i} for ${E.map(le=>On(le.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(u=On(N.systemId),N.version===0&&N.data)if(u===Fn.WIDEVINE){const le=N.data.length-22;c=new Uint8Array(N.data.subarray(le,le+16))}else u===Fn.PLAYREADY&&(c=or(N.data))}if(!u||!c)return;const f=Q.hexDump(c),{keyIdToKeySessionPromise:d,mediaKeySessions:_}=this;let b=d[f];for(let E=0;E<_.length;E++){const G=_[E],N=G.decryptdata;if(!N.keyId)continue;const le=Q.hexDump(N.keyId);if(f===le||N.uri.replace(/-/g,"").indexOf(f)!==-1){if(b=d[le],N.pssh)break;delete d[le],N.pssh=new Uint8Array(r),N.keyId=c,b=d[f]=b.then(()=>this.generateRequestWithPreferredKeySession(G,n,r,"encrypted-event-key-match")),b.catch(ke=>this.handleError(ke));break}}if(!b){if(u!==l){this.log(`Ignoring "${t.type}" event with ${u} init data for selected key-system ${l}`);return}b=d[f]=this.getKeySystemSelectionPromise([u]).then(({keySystem:E,mediaKeys:G})=>{var N;this.throwIfDestroyed();const le=new Br("ISO-23001-7",f,(N=Un(E))!=null?N:"");return le.pssh=new Uint8Array(r),le.keyId=c,this.attemptSetMediaKeys(E,G).then(()=>{this.throwIfDestroyed();const ke=this.createMediaKeySessionContext({decryptdata:le,keySystem:E,mediaKeys:G});return this.generateRequestWithPreferredKeySession(ke,n,r,"encrypted-event-no-match")})}),b.catch(E=>this.handleError(E))}})}},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(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(p.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(p.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,r=t[e];if(r)return r.licenseUrl;if(e===Fn.WIDEVINE&&n)return n}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(t===void 0)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(s,l,c)=>!!s&&c.indexOf(s)===l,r=t.map(s=>s.audioCodec).filter(n),i=t.map(s=>s.videoCodec).filter(n);return r.length+i.length===0&&i.push("avc1.42e01e"),new Promise((s,l)=>{const c=u=>{const f=u.shift();this.getMediaKeysPromise(f,r,i).then(d=>s({keySystem:f,mediaKeys:d})).catch(d=>{u.length?c(u):d instanceof mi?l(d):l(new mi({type:fe.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_ACCESS,error:d,fatal:!0},d.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let r=`Configured requestMediaKeySystemAccess is not a function ${n}`;return yr===null&&self.location.protocol==="http:"&&(r=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(r))}return n(e,t)}getMediaKeysPromise(e,t,n){const r=gn(e,t,n,this.config.drmSystemOptions),i=this.keySystemAccessPromises[e];let s=i==null?void 0:i.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${ot(r)}`),s=this.requestMediaKeySystemAccess(e,r);const l=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch(c=>{this.log(`Failed to obtain access to key-system "${e}": ${c}`)}),s.then(c=>{this.log(`Access for key-system "${c.keySystem}" obtained`);const u=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),l.mediaKeys=c.createMediaKeys().then(f=>(this.log(`Media-keys created for "${e}"`),l.hasMediaKeys=!0,u.then(d=>d?this.setMediaKeysServerCertificate(f,e,d):f))),l.mediaKeys.catch(f=>{this.error(`Failed to create media-keys for "${e}"}: ${f}`)}),l.mediaKeys})}return s.then(()=>i.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${Q.hexDump(e.keyId||[])}`);const r=n.createSession(),i={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(i),i}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),r=this.getKeyIdString(t),i="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(n,i,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Q.hexDump(e.keyId)}updateKeySession(e,t){var n;const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyID ${Q.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])}
} (data length: ${t&&t.byteLength})`),r.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>Un(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:n})=>this.attemptSetMediaKeys(t,n))}selectKeySystem(e){return new Promise((t,n)=>this.getKeySystemSelectionPromise(e).then(({keySystem:r})=>{const i=Un(r);i?t(i):n(new Error(`Unable to find format for key-system "${r}"`))}).catch(n))}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=ur(this.config),n=e.map(Sn).filter(r=>!!r&&t.indexOf(r)!==-1);return this.selectKeySystem(n)}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),r=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${r}`);let i=this.keyIdToKeySessionPromise[n];return i||(i=this.getKeySystemForKeyPromise(t).then(({keySystem:l,mediaKeys:c})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${r}`),this.attemptSetMediaKeys(l,c).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:l,mediaKeys:c,decryptdata:t}))))),(this.keyIdToKeySessionPromise[n]=i.then(l=>{const c="cenc",u=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(l,c,u,"playlist-key")})).catch(l=>this.handleError(l))),i}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof mi?this.hls.trigger(p.ERROR,e.data):this.hls.trigger(p.ERROR,{type:fe.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const r=Sn(e.keyFormat),i=r?[r]:ur(this.config);return this.attemptKeySystemAccess(i)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=ur(this.config)),e.length===0)throw new mi({type:fe.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${ot({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaKeys===t)return Promise.resolve();const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const r=Promise.all(n).then(()=>{if(!this.media)throw this.mediaKeys=null,new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.mediaKeys=t,this.setMediaKeysQueue.push(r),r.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(i=>n.indexOf(i)===-1)})}generateRequestWithPreferredKeySession(e,t,n,r){var i,s;const l=(i=this.config.drmSystems)==null||(s=i[e.keySystem])==null?void 0:s.generateRequest;if(l)try{const E=l.call(this.hls,t,n,e);if(!E)throw new Error("Invalid response from configured generateRequest filter");t=E.initDataType,n=E.initData?E.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(E){var c;if(this.warn(E.message),(c=this.hls)!=null&&c.config.debug)throw E}if(n===null)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(e);const u=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${r}": ${u} (init data type: ${t} length: ${n?n.byteLength:null})`);const f=new Ri,d=e._onmessage=E=>{const G=e.mediaKeysSession;if(!G){f.emit("error",new Error("invalid state"));return}const{messageType:N,message:le}=E;this.log(`"${N}" message event for session "${G.sessionId}" message size: ${le.byteLength}`),N==="license-request"||N==="license-renewal"?this.renewLicense(e,le).catch(ke=>{f.eventNames().length?f.emit("error",ke):this.handleError(ke)}):N==="license-release"?e.keySystem===Fn.FAIRPLAY&&(this.updateKeySession(e,Nr("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${N}"`)},_=e._onkeystatuseschange=E=>{if(!e.mediaKeysSession){f.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const N=e.keyStatus;f.emit("keyStatus",N),N==="expired"&&(this.warn(`${e.keySystem} expired for key ${u}`),this.renewKeySession(e))};ci(e.mediaKeysSession,"message",d),ci(e.mediaKeysSession,"keystatuseschange",_);const b=new Promise((E,G)=>{f.on("error",G),f.on("keyStatus",N=>{N.startsWith("usable")?E():N==="output-restricted"?G(new mi({type:fe.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):N==="internal-error"?G(new mi({type:fe.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${N}"`)):N==="expired"?G(new Error("key expired while generating request")):this.warn(`unhandled key status change "${N}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var E;this.log(`Request generated for key-session "${(E=e.mediaKeysSession)==null?void 0:E.sessionId}" keyId: ${u}`)}).catch(E=>{throw new mi({type:fe.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_SESSION,error:E,fatal:!1},`Error generating key-session request: ${E}`)}).then(()=>b).catch(E=>{throw f.removeAllListeners(),this.removeSession(e),E}).then(()=>(f.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{if(typeof n=="string"&&typeof t=="object"){const r=n;n=t,t=r}this.log(`key status change "${t}" for keyStatuses keyId: ${Q.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${Q.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,n=t.loader,r=new n(t),i=this.getServerCertificateUrl(e);return i?(this.log(`Fetching server certificate for "${e}"`),new Promise((s,l)=>{const c={responseType:"arraybuffer",url:i},u=t.certLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(_,b,E,G)=>{s(_.data)},onError:(_,b,E,G)=>{l(new mi({type:fe.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:E,response:y({url:c.url,data:void 0},_)},`"${e}" certificate request failed (${i}). Status: ${_.code} (${_.text})`))},onTimeout:(_,b,E)=>{l(new mi({type:fe.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:E,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${i})`))},onAbort:(_,b,E)=>{l(new Error("aborted"))}};r.load(c,f,d)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((r,i)=>{e.setServerCertificate(n).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${n==null?void 0:n.byteLength}) on "${t}"`),r(e)}).catch(s=>{i(new mi({type:fe.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:s,fatal:!0},s.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(r=>{throw new mi({type:fe.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:r,fatal:!0},r.message)}))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const r=new DOMParser().parseFromString(n,"application/xml"),i=r.querySelectorAll("HttpHeader");if(i.length>0){let f;for(let d=0,_=i.length;d<_;d++){var s,l;f=i[d];const b=(s=f.querySelector("name"))==null?void 0:s.textContent,E=(l=f.querySelector("value"))==null?void 0:l.textContent;b&&E&&e.setRequestHeader(b,E)}}const c=r.querySelector("Challenge"),u=c==null?void 0:c.textContent;if(!u)throw new Error("Cannot find <Challenge> in key message");return Nr(atob(u))}setupLicenseXHR(e,t,n,r){const i=this.config.licenseXhrSetup;return i?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return i.call(this.hls,e,t,n,r)}).catch(s=>{if(!n.decryptdata)throw s;return e.open("POST",t,!0),i.call(this.hls,e,t,n,r)}).then(s=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:s||r})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((r,i)=>{const s=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${s}`);const l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return i(new Error("invalid state"));if(l.readyState===4)if(l.status===200){this._requestLicenseFailureCount=0;let c=l.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const u=this.config.licenseResponseCallback;if(u)try{c=u.call(this.hls,l,s,e)}catch(f){this.error(f)}r(c)}else{const c=n.errorRetry,u=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||l.status>=400&&l.status<500)i(new mi({type:fe.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:l,response:{url:s,data:void 0,code:l.status,text:l.statusText}},`License Request XHR failed (${s}). Status: ${l.status} (${l.statusText})`));else{const f=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${f} attempts left`),this.requestLicense(e,t).then(r,i)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,s,e,t).then(({xhr:c,licenseChallenge:u})=>{e.keySystem==Fn.PLAYREADY&&(u=this.unpackPlayReadyKeyMessage(c,u)),c.send(u)})})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,ci(n,"encrypted",this.onMediaEncrypted),ci(n,"waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(gi(e,"encrypted",this.onMediaEncrypted),gi(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;if(this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},!this.mediaKeys&&!this.mediaKeySessions.length)return;const t=this.media,n=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,Br.clearKeyUriToKeyIdMap();const r=n.length;ss.CDMCleanupPromise=Promise.all(n.map(i=>this.removeSession(i)).concat(t==null||(e=t.setMediaKeys(null))==null?void 0:e.catch(i=>{var s;this.log(`Could not clear media keys: ${i}`),(s=this.hls)==null||s.trigger(p.ERROR,{type:fe.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${i}`)})}))).catch(i=>{var s;this.log(`Could not close sessions and clear media keys: ${i}`),(s=this.hls)==null||s.trigger(p.ERROR,{type:fe.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${i}`)})}).then(()=>{r&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=t.reduce((r,i)=>(r.indexOf(i.keyFormat)===-1&&r.push(i.keyFormat),r),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const r=this.mediaKeySessions.indexOf(e);r>-1&&this.mediaKeySessions.splice(r,1);const{drmSystemOptions:i}=this.config;return(fr(i)?new Promise((l,c)=>{self.setTimeout(()=>c(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(l)}):Promise.resolve()).catch(l=>{var c;this.log(`Could not remove session: ${l}`),(c=this.hls)==null||c.trigger(p.ERROR,{type:fe.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${l}`)})}).then(()=>t.close()).catch(l=>{var c;this.log(`Could not close session: ${l}`),(c=this.hls)==null||c.trigger(p.ERROR,{type:fe.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${l}`)})})}}}ss.CDMCleanupPromise=void 0;class mi extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}class Bu{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(p.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(p.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const r=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=r,r&&typeof r.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,n){const r=performance.now();if(t){if(this.lastTime){const i=r-this.lastTime,s=n-this.lastDroppedFrames,l=t-this.lastDecodedFrames,c=1e3*s/i,u=this.hls;if(u.trigger(p.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:n}),c>0&&s>u.config.fpsDroppedMonitoringThreshold*l){let f=u.currentLevel;u.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+f),f>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=f)&&(f=f-1,u.trigger(p.FPS_DROP_LEVEL_CAPPING,{level:f,droppedLevel:u.currentLevel}),u.autoLevelCapping=f,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}function ho(a,e){let t;try{t=new Event("addtrack")}catch(n){t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=a,e.dispatchEvent(t)}function po(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues&&!a.cues.getCueById(e.id))try{if(a.addCue(e),!a.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(n){q.debug(`[texttrack-utils]: ${n}`);try{const r=new self.TextTrackCue(e.startTime,e.endTime,e.text);r.id=e.id,a.addCue(r)}catch(r){q.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${r}`)}}t==="disabled"&&(a.mode=t)}function as(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues)for(let n=a.cues.length;n--;)e&&a.cues[n].removeEventListener("enter",e),a.removeCue(a.cues[n]);t==="disabled"&&(a.mode=t)}function la(a,e,t,n){const r=a.mode;if(r==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const i=$u(a.cues,e,t);for(let s=0;s<i.length;s++)(!n||n(i[s]))&&a.removeCue(i[s])}r==="disabled"&&(a.mode=r)}function Uu(a,e){if(e<=a[0].startTime)return 0;const t=a.length-1;if(e>a[t].endTime)return-1;let n=0,r=t,i;for(;n<=r;)if(i=Math.floor((r+n)/2),e<a[i].startTime)r=i-1;else if(e>a[i].startTime&&n<t)n=i+1;else return i;return a[n].startTime-e<e-a[r].startTime?n:r}function $u(a,e,t){const n=[],r=Uu(a,e);if(r>-1)for(let i=r,s=a.length;i<s;i++){const l=a[i];if(l.startTime>=e&&l.endTime<=t)n.push(l);else if(l.startTime>t)return n}return n}function Ms(a){const e=[];for(let t=0;t<a.length;t++){const n=a[t];(n.kind==="subtitles"||n.kind==="captions")&&n.label&&e.push(a[t])}return e}class Ku extends ta{constructor(e){super(e,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const n=Ms(this.media.textTracks);for(let i=0;i<n.length;i++)if(n[i].mode==="hidden")t=n[i];else if(n[i].mode==="showing"){t=n[i];break}const r=this.findTrackForTextTrack(t);this.subtitleTrack!==r&&this.setSubtitleTrack(r)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const n=this.media;if(!n)return;const r=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,r)return;Ms(n.textTracks).forEach(s=>{as(s)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:r,details:i}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==r){this.warn(`Subtitle track with id:${n} and group:${r} not found in active group ${s==null?void 0:s.groupId}`);return}const l=s.details;s.details=t.details,this.log(`Subtitle track ${n} "${s.name}" lang:${s.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,l)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,r=this.groupIds;let i=this.currentTrack;if(!n||(r==null?void 0:r.length)!==(n==null?void 0:n.length)||n!=null&&n.some(s=>(r==null?void 0:r.indexOf(s))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const s=this.tracks.filter(f=>!n||n.indexOf(f.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(f=>f.default)&&(this.selectDefaultTrack=!1),s.forEach((f,d)=>{f.id=d});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const l=this.hls.config.subtitlePreference;if(!i&&l){this.selectDefaultTrack=!1;const f=ye(l,s);if(f>-1)i=s[f];else{const d=ye(l,this.tracks);i=this.tracks[d]}}let c=this.findTrackId(i);c===-1&&i&&(c=this.findTrackId(null));const u={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(p.SUBTITLE_TRACKS_UPDATED,u),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let r=0;r<t.length;r++){const i=t[r];if(!(n&&!i.default||!n&&!e)&&(!e||Ue(i,e)))return r}if(e){for(let r=0;r<t.length;r++){const i=t[r];if(vs(e.attrs,i.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return r}for(let r=0;r<t.length;r++){const i=t[r];if(vs(e.attrs,i.attrs,["LANGUAGE"]))return r}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const r=t[n];if(na(r,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===me.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(e.id===-1)return this.setSubtitleTrack(-1),null;const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&Ue(e,n))return n;const r=ye(e,this.tracksInGroup);if(r>-1){const i=this.tracksInGroup[r];return this.setSubtitleTrack(r),i}else{if(n)return null;{const i=ye(e,t);if(i>-1)return t[i]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,r=e.groupId,i=this.getUrlWithDirectives(e.url,t),s=e.details,l=s==null?void 0:s.age;this.log(`Loading subtitle ${n} "${e.name}" lang:${e.lang} group:${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${l&&s.live?" age "+l.toFixed(1)+(s.type?" "+s.type||0:""):""} ${i}`),this.hls.trigger(p.SUBTITLE_TRACK_LOADING,{url:i,id:n,groupId:r,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Ms(e.textTracks),n=this.currentTrack;let r;if(n&&(r=t.filter(i=>na(n,i))[0],r||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(i=>{i.mode!=="disabled"&&i!==r&&(i.mode="disabled")}),r){const i=this.subtitleDisplay?"showing":"hidden";r.mode!==i&&(r.mode=i)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!k(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,r=t[e]||null;if(this.trackId=e,this.currentTrack=r,this.toggleTrackModes(),!r){this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:e});return}const i=!!r.details&&!r.details.live;if(e===this.trackId&&r===n&&i)return;this.log(`Switching to subtitle-track ${e}`+(r?` "${r.name}" lang:${r.lang} group:${r.groupId}`:""));const{id:s,groupId:l="",name:c,type:u,url:f}=r;this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:s,groupId:l,name:c,type:u,url:f});const d=this.switchParams(r.url,n==null?void 0:n.details,r.details);this.loadPlaylist(d)}}function Zu(){try{return crypto.randomUUID()}catch(a){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const i=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(r=="x"?i:i&3|8).toString(16)})}}}function ys(a){let e=5381,t=a.length;for(;t;)e=e*33^a.charCodeAt(--t);return(e>>>0).toString()}const os=.025;let Fs=function(a){return a[a.Point=0]="Point",a[a.Range=1]="Range",a}({});function Gu(a,e,t){return`${a.identifier}-${t+1}-${ys(e)}`}class Vu{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var t;if(e>0&&e>=this.assetList.length)return!0;const n=this.playoutLimit;return e<=0||isNaN(n)?!1:n===0?!0:(((t=this.assetList[e])==null?void 0:t.startOffset)||0)>n}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return ua(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const t=this.dateRange.startTime,n=ua(t,e);return t-n<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=k(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const t=this.resumeAnchor;if(t)return ua(e,t)}return e}get appendInPlace(){return this.appendInPlaceStarted?!0:this.appendInPlaceDisabled?!1:!!(!this.cue.once&&!this.cue.pre&&this.startIsAligned&&(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<os))}set appendInPlace(e){if(this.appendInPlaceStarted){this.resetOnResume=!e;return}this.appendInPlaceDisabled=!e}get timelineStart(){return this._timelineStart!==null?this._timelineStart:this.startTime}set timelineStart(e){this._timelineStart=e}get duration(){const e=this.playoutLimit;let t;return this._duration!==null?t=this._duration:this.dateRange.duration?t=this.dateRange.duration:t=this.dateRange.plannedDuration||0,!isNaN(e)&&e<t&&(t=e),t}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr["X-TIMELINE-OCCUPIES"]==="RANGE"?Fs.Range:Fs.Point}get supplementsPrimary(){return this.dateRange.attr["X-TIMELINE-STYLE"]==="PRIMARY"}get contentMayVary(){return this.dateRange.attr["X-CONTENT-MAY-VARY"]!=="NO"}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||this.assetListResponse!==null}toString(){return zu(this)}}function ua(a,e){return a-e.start<e.duration/2&&!(Math.abs(a-(e.start+e.duration))<os)?e.start:e.start+e.duration}function go(a,e,t){const n=new self.URL(a,t);return n.protocol!=="data:"&&n.searchParams.set("_HLS_primary_id",e),n}function ca(a,e){for(;(t=a.assetList[++e])!=null&&t.error;)var t;return e}function zu(a){return`["${a.identifier}" ${a.cue.pre?"<pre>":a.cue.post?"<post>":""}${a.timelineStart.toFixed(2)}-${a.resumeTime.toFixed(2)}]`}function ls(a){const e=a.timelineStart,t=a.duration||0;return`["${a.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class Wu{constructor(e,t,n,r){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls.trigger(p.PLAYOUT_LIMIT_REACHED,{})};const i=this.hls=new e(t);this.interstitial=n,this.assetItem=r;let s=r.uri;try{s=go(s,t.primarySessionId).href}catch(c){}i.loadSource(s);const l=()=>{this.hasDetails=!0};i.once(p.LEVEL_LOADED,l),i.once(p.AUDIO_TRACK_LOADED,l),i.once(p.SUBTITLE_TRACK_LOADED,l),i.on(p.MEDIA_ATTACHING,(c,{media:u})=>{this.removeMediaListeners(),this.mediaAttached=u,this.interstitial.playoutLimit&&(u.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&i.on(p.BUFFER_APPENDED,()=>{const d=this.bufferedEnd;this.reachedPlayout(d)&&(this._bufferedEosTime=d,i.trigger(p.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){var e;return((e=this.interstitial)==null?void 0:e.appendInPlace)||!1}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e||!this._bufferedEosTime)return!1;const n=this.timelineOffset,r=tn.bufferInfo(e,n,0);return this.getAssetTime(r.end)>=this._bufferedEosTime-.02}reachedPlayout(e){const n=this.interstitial.playoutLimit;return this.startOffset+e>=n}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return((e=this.hls)==null?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=tn.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;return e||0}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const n=e-t;if(Math.abs(n)>1/9e4){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,e-t),n)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls.destroy(),this.hls=this.interstitial=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){this.hls.attachMedia(e)}detachMedia(){this.removeMediaListeners(),this.mediaAttached=null,this.hls.detachMedia()}resumeBuffering(){this.hls.resumeBuffering()}pauseBuffering(){this.hls.pauseBuffering()}transferMedia(){return this.bufferSnapShot(),this.hls.transferMedia()}resetDetails(){const e=this.hls;if(this.hasDetails){e.stopLoad();const t=n=>delete n.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,n){this.hls.on(e,t)}once(e,t,n){this.hls.once(e,t)}off(e,t,n){this.hls.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${ls(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const mo=.033;class Hu extends z{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((n,r)=>e<=r.startOffset&&t>r.startOffset?(delete r.error,n+1):n,0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let n=-1;e.nextEvent?n=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(n=this.findEventIndex(e.previousEvent.identifier)+1);const r=this.items;if(r)for(r[n]||(t===void 0&&(t=e.start),n=this.findItemIndexAtTime(t));n>=0&&(i=r[n])!=null&&i.event;){var i;n--}return n}findItemIndexAtTime(e,t){const n=this.items;if(n)for(let r=0;r<n.length;r++){let i=n[r];if(t&&t!=="primary"&&(i=i[t]),e===i.start||e>i.start&&e<i.end)return r}return-1}findJumpRestrictedIndex(e,t){const n=this.items;if(n)for(let r=e;r<=t&&n[r];r++){const i=n[r].event;if(i!=null&&i.restrictions.jump&&!i.appendInPlace)return r}return-1}findEventIndex(e){const t=this.items;if(t)for(let r=t.length;r--;){var n;if(((n=t[r].event)==null?void 0:n.identifier)===e)return r}return-1}findAssetIndex(e,t){const n=e.assetList,r=n.length;if(r>1)for(let i=0;i<r;i++){const s=n[i];if(!s.error){const l=s.timelineStart;if(t===l||t>l&&t<l+(s.duration||0))return i}}return 0}get assetIdAtEnd(){var e,t;const n=(e=this.items)==null||(t=e[this.length-1])==null?void 0:t.event;if(n){const r=n.assetList,i=r[r.length-1];if(i)return i.identifier}return null}parseInterstitialDateRanges(e,t){const n=e.main.details,{dateRanges:r}=n,i=this.events,s=this.parseDateRanges(r,{url:n.url},t),l=Object.keys(r),c=i?i.filter(u=>!l.includes(u.identifier)):[];s.length&&s.sort((u,f)=>{const d=u.cue.pre,_=u.cue.post,b=f.cue.pre,E=f.cue.post;if(d&&!b)return-1;if(b&&!d||_&&!E)return 1;if(E&&!_)return-1;if(!d&&!b&&!_&&!E){const G=u.startTime,N=f.startTime;if(G!==N)return G-N}return u.dateRange.tagOrder-f.dateRange.tagOrder}),this.events=s,c.forEach(u=>{this.removeEvent(u)}),this.updateSchedule(e,c)}updateSchedule(e,t=[]){const n=this.events||[];if(n.length||t.length||this.length<2){const r=this.items,i=this.parseSchedule(n,e);(t.length||(r==null?void 0:r.length)!==i.length||i.some((l,c)=>Math.abs(l.playout.start-r[c].playout.start)>.005||Math.abs(l.playout.end-r[c].playout.end)>.005))&&(this.items=i,this.onScheduleUpdate(t,r))}}parseDateRanges(e,t,n){const r=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const l=i[s],c=e[l];if(c.isInterstitial){let u=this.eventMap[l];u?u.setDateRange(c):(u=new Vu(c,t),this.eventMap[l]=u,n===!1&&(u.appendInPlace=n)),r.push(u)}}return r}parseSchedule(e,t){const n=[],r=t.main.details,i=r.live?1/0:r.edge;let s=0;if(e=e.filter(c=>!c.error&&!(c.cue.once&&c.hasPlayed)),e.length){this.resolveOffsets(e,t);let c=0,u=0;if(e.forEach((f,d)=>{const _=f.cue.pre,b=f.cue.post,E=e[d-1]||null,G=f.appendInPlace,N=b?i:f.startOffset,le=f.duration,ke=f.timelineOccupancy===Fs.Range?le:0,Ee=f.resumptionOffset,Ke=(E==null?void 0:E.startTime)===N,We=N+f.cumulativeDuration;let gt=G?We+le:N+Ee;if(_||!b&&N<=0){const st=u;u+=ke,f.timelineStart=We;const ht=s;s+=le,n.push({event:f,start:We,end:gt,playout:{start:ht,end:s},integrated:{start:st,end:u}})}else if(N<=i){if(!Ke){const Je=N-c;if(Je>mo){const Kt=c,dn=u;u+=Je;const zn=s;s+=Je;const Dn={previousEvent:e[d-1]||null,nextEvent:f,start:Kt,end:Kt+Je,playout:{start:zn,end:s},integrated:{start:dn,end:u}};n.push(Dn)}else Je>0&&E&&(E.cumulativeDuration+=Je,n[n.length-1].end=N)}b&&(gt=We),f.timelineStart=We;const st=u;u+=ke;const ht=s;s+=le,n.push({event:f,start:We,end:gt,playout:{start:ht,end:s},integrated:{start:st,end:u}})}else return;const Xe=f.resumeTime;b||Xe>i?c=i:c=Xe}),c<i){var l;const f=c,d=u,_=i-c;u+=_;const b=s;s+=_,n.push({previousEvent:((l=n[n.length-1])==null?void 0:l.event)||null,nextEvent:null,start:c,end:f+_,playout:{start:b,end:s},integrated:{start:d,end:u}})}this.setDurations(i,s,u)}else n.push({previousEvent:null,nextEvent:null,start:0,end:i,playout:{start:0,end:i},integrated:{start:0,end:i}}),this.setDurations(i,i,i);return n}setDurations(e,t,n){this.durations={primary:e,playout:t,integrated:n}}resolveOffsets(e,t){const n=t.main.details,r=n.live?1/0:n.edge;let i=0,s=-1;e.forEach((l,c)=>{const u=l.cue.pre,f=l.cue.post,d=u?0:f?r:l.startTime;this.updateAssetDurations(l),s===d?l.cumulativeDuration=i:(i=0,s=d),!f&&l.snapOptions.in&&(l.resumeAnchor=kt(null,n.fragments,l.startOffset+l.resumptionOffset,0,0)||void 0),l.appendInPlace&&!l.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(l,t)||(l.appendInPlace=!1)),!l.appendInPlace&&c+1<e.length&&e[c+1].startTime-e[c].resumeTime<mo&&(e[c+1].appendInPlace=!1,e[c+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${l}`));const b=k(l.resumeOffset)?l.resumeOffset:l.duration;i+=b})}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,r=e.startTime+e.resumptionOffset;return Math.abs(n-r)>os?(this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${r}`),!1):t?!Object.keys(t).some(s=>{const l=t[s].details,c=l.edge;if(n>=c)return this.log(`"${e.identifier}" resumption ${n} past ${s} playlist end ${c}`),!1;const u=kt(null,l.fragments,n);if(!u)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${s} playlist (${l.fragStart}-${l.fragmentEnd})`),!0;const f=s==="audio"?.175:0;return Math.abs(u.start-n)<os+f||Math.abs(u.end-n)<os+f?!1:(this.log(`"${e.identifier}" resumption ${n} not aligned with ${s} fragment bounds (${u.start}-${u.end} sn: ${u.sn} cc: ${u.cc})`),!0)}):(this.log(`"${e.identifier}" resumption ${n} can not be aligned with media (none selected)`),!1)}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let n=0,r=!1,i=!1;e.assetList.forEach((s,l)=>{const c=t+n;s.startOffset=n,s.timelineStart=c,r||(r=s.duration===null),i||(i=!!s.error);const u=s.error?0:s.duration||0;n+=u}),r&&!i?e.duration=Math.max(n,e.duration):e.duration=n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function $i(a){return`[${a.event?'"'+a.event.identifier+'"':"primary"}: ${a.start.toFixed(2)}-${a.end.toFixed(2)}]`}class ju{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let r;try{r=go(n,this.hls.sessionId,e.baseUrl)}catch(_){const b=this.assignAssetListError(e,$.ASSET_LIST_LOAD_ERROR,_,n);this.hls.trigger(p.ERROR,b);return}t&&r.protocol!=="data:"&&r.searchParams.set("_HLS_start_offset",""+t);const i=this.hls.config,s=i.loader,l=new s(i),c={responseType:"json",url:r.href},u=i.interstitialAssetListLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(_,b,E,G)=>{const N=_.data,le=N==null?void 0:N.ASSETS;if(!Array.isArray(le)){const ke=this.assignAssetListError(e,$.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),E.url,b,G);this.hls.trigger(p.ERROR,ke);return}e.assetListResponse=N,this.hls.trigger(p.ASSET_LIST_LOADED,{event:e,assetListResponse:N,networkDetails:G})},onError:(_,b,E,G)=>{const N=this.assignAssetListError(e,$.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${_.code} ${_.text} (${b.url})`),b.url,G,E);this.hls.trigger(p.ERROR,N)},onTimeout:(_,b,E)=>{const G=this.assignAssetListError(e,$.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${b.url})`),b.url,_,E);this.hls.trigger(p.ERROR,G)}};return l.load(c,f,d),this.hls.trigger(p.ASSET_LIST_LOADING,{event:e}),l}assignAssetListError(e,t,n,r,i,s){return e.error=n,{type:fe.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:r,error:n,networkDetails:s,stats:i}}}function vo(a){a==null||a.play().catch(()=>{})}class Yu extends z{constructor(e,t){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;const r=n-this.timelinePos;if(Math.abs(r)<1/7056e5)return;const s=r<=-.01;this.timelinePos=n,this.bufferedPos=n;const l=this.playingItem;if(!l){this.checkBuffer();return}if(s&&this.schedule.resetErrorsInRange(n,n-r)&&this.updateSchedule(),this.checkBuffer(),s&&n<l.start||n>=l.end){var c;const _=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(l)&&(c=this.media)!=null&&c.paused&&(this.shouldPlay=!1),!s){const b=this.findItemIndex(l);if(_>b){const E=this.schedule.findJumpRestrictedIndex(b+1,_);if(E>b){this.setSchedulePosition(E);return}}}this.setSchedulePosition(_);return}const u=this.playingAsset;if(!u){if(this.playingLastItem&&this.isInterstitial(l)){const _=l.event.assetList[0];_&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(n,_))}return}const f=u.timelineStart,d=u.duration||0;(s&&n<f||n>=f+d)&&this.setScheduleToAssetAtTime(n,u)},this.onTimeupdate=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;if(n>this.timelinePos)this.timelinePos=n,n>this.bufferedPos&&this.checkBuffer();else return;const r=this.playingItem;if(!r||this.playingLastItem)return;if(n>=r.end){this.timelinePos=r.end;const l=this.findItemIndex(r);this.setSchedulePosition(l+1)}const i=this.playingAsset;if(!i)return;const s=i.timelineStart+(i.duration||0);n>=s&&this.setScheduleToAssetAtTime(n,i)},this.onScheduleUpdate=(n,r)=>{const i=this.schedule,s=this.playingItem,l=i.events||[],c=i.items||[],u=i.durations,f=n.map(E=>E.identifier),d=!!(l.length||f.length);(d||r)&&this.log(`INTERSTITIALS_UPDATED (${l.length}): ${l}
Schedule: ${c.map(E=>$i(E))} pos: ${this.timelinePos}`),f.length&&this.log(`Removed events ${f}`),this.playerQueue.forEach(E=>{if(E.interstitial.appendInPlace){const G=E.assetItem.timelineStart,N=E.timelineOffset-G;if(N)try{E.timelineOffset=G}catch(le){Math.abs(N)>os&&this.warn(`${le} ("${E.assetId}" ${E.timelineOffset}->${G})`)}}});let _=null;if(s){const E=this.updateItem(s,this.timelinePos);this.itemsMatch(s,E)&&(this.playingItem=E,this.waitingItem=this.endedItem=null,_=()=>this.trimInPlace(E,s))}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const b=this.bufferingItem;if(b){const E=this.updateItem(b,this.bufferedPos);this.itemsMatch(b,E)?(this.bufferingItem=E,_||(_=()=>this.trimInPlace(E,b))):b.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(b.event,null))}if(n.forEach(E=>{E.assetList.forEach(G=>{this.clearAssetPlayer(G.identifier,null)})}),d||r){if(this.hls.trigger(p.INTERSTITIALS_UPDATED,{events:l.slice(0),schedule:c.slice(0),durations:u,removedIds:f}),this.isInterstitial(s)&&f.includes(s.event.identifier)){this.warn(`Interstitial "${s.event.identifier}" removed while playing`),this.primaryFallback(s.event);return}_&&_(),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new ju(e),this.schedule=new Hu(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(p.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(p.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(p.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(p.MEDIA_ENDED,this.onMediaEnded,this),e.on(p.ERROR,this.onError,this),e.on(p.DESTROYING,this.onDestroying,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(p.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(p.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(p.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_APPENDED,this.onBufferAppended,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(p.MEDIA_ENDED,this.onMediaEnded,this),e.off(p.ERROR,this.onError,this),e.off(p.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.manager=null,this.hls=this.HlsPlayerClass=this.schedule=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){gi(e,"play",this.onPlay),gi(e,"pause",this.onPause),gi(e,"seeking",this.onSeeking),gi(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;ci(n,"seeking",this.onSeeking),ci(n,"timeupdate",this.onTimeupdate),ci(n,"play",this.onPlay),ci(n,"pause",this.onPause)}onMediaAttached(e,t){const n=this.effectivePlayingItem,r=this.detachedData;if(this.detachedData=null,n===null)this.checkStart();else if(!r){this.clearScheduleState();const i=this.findItemIndex(n);this.setSchedulePosition(i)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const n=!!t.transferMedia,r=this.media;if(this.media=null,!n&&(r&&this.removeMediaListeners(r),this.detachedData)){const i=this.getBufferingPlayer();i&&(this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,i.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.manager){if(!this.hls)return null;const e=this,t=()=>e.bufferingItem||e.waitingItem,n=d=>d&&e.getAssetPlayer(d.identifier),r=(d,_,b,E,G)=>{if(d){let N=d[_].start;const le=d.event;if(le){if(_==="playout"||le.timelineOccupancy!==Fs.Point){const ke=n(b);(ke==null?void 0:ke.interstitial)===le&&(N+=ke.assetItem.startOffset+ke[G])}}else{const ke=E==="bufferedPos"?s():e[E];N+=ke-d.start}return N}return 0},i=(d,_)=>{if(d!==0&&_!=="primary"&&e.schedule.length){var b;const E=e.schedule.findItemIndexAtTime(d),G=(b=e.schedule.items)==null?void 0:b[E];if(G){const N=G[_].start-G.start;return d+N}}return d},s=()=>{const d=e.bufferedPos;return d===Number.MAX_VALUE?l("primary"):Math.max(d,0)},l=d=>{var _;return(_=e.primaryDetails)!=null&&_.live?e.primaryDetails.edge:e.schedule.durations[d]},c=(d,_)=>{var b,E;const G=e.effectivePlayingItem;if(G!=null&&(b=G.event)!=null&&b.restrictions.skip)return;e.log(`seek to ${d} "${_}"`);const N=e.effectivePlayingItem,le=e.schedule.findItemIndexAtTime(d,_),ke=(E=e.schedule.items)==null?void 0:E[le],Ee=e.getBufferingPlayer(),Ke=Ee==null?void 0:Ee.interstitial,We=Ke==null?void 0:Ke.appendInPlace,gt=N&&e.itemsMatch(N,ke);if(N&&(We||gt)){const st=n(e.playingAsset),ht=(st==null?void 0:st.media)||e.primaryMedia;if(ht){const Je=_==="primary"?ht.currentTime:r(N,_,e.playingAsset,"timelinePos","currentTime"),Kt=d-Je,dn=(We?Je:ht.currentTime)+Kt;if(dn>=0&&(!st||We||dn<=st.duration)){ht.currentTime=dn;return}}}if(ke){let st=d;if(_!=="primary"){const Je=ke[_].start,Kt=d-Je;st=ke.start+Kt}const ht=!e.isInterstitial(ke);if((!e.isInterstitial(N)||N.event.appendInPlace)&&(ht||ke.event.appendInPlace)){const Je=e.media||(We?Ee==null?void 0:Ee.media:null);Je&&(Je.currentTime=st)}else if(N){const Je=e.findItemIndex(N);if(le>Je){const dn=e.schedule.findJumpRestrictedIndex(Je+1,le);if(dn>Je){e.setSchedulePosition(dn);return}}let Kt=0;if(ht)e.timelinePos=st,e.checkBuffer();else{var Xe;const dn=ke==null||(Xe=ke.event)==null?void 0:Xe.assetList;if(dn){const zn=d-(ke[_]||ke).start;for(let Dn=dn.length;Dn--;){const Rn=dn[Dn];if(Rn.duration&&zn>=Rn.startOffset&&zn<Rn.startOffset+Rn.duration){Kt=Dn;break}}}}e.setSchedulePosition(le,Kt)}}},u=()=>{const d=e.effectivePlayingItem;if(e.isInterstitial(d))return d;const _=t();return e.isInterstitial(_)?_:null},f={get currentTime(){const d=u(),_=e.effectivePlayingItem;return _&&_===d?r(_,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-_.playout.start:0},set currentTime(d){const _=u(),b=e.effectivePlayingItem;b&&b===_&&c(d+b.playout.start,"playout")},get duration(){const d=u();return d?d.playout.end-d.playout.start:0},get assetPlayers(){var d;const _=(d=u())==null?void 0:d.event.assetList;return _?_.map(b=>e.getAssetPlayer(b.identifier)):[]},get playingIndex(){var d;const _=(d=u())==null?void 0:d.event;return _&&e.effectivePlayingAsset?_.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return u()}};this.manager={get events(){var d,_;return((d=e.schedule)==null||(_=d.events)==null?void 0:_.slice(0))||[]},get schedule(){var d,_;return((d=e.schedule)==null||(_=d.items)==null?void 0:_.slice(0))||[]},get interstitialPlayer(){return u()?f:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const 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 s()},get currentTime(){const d=e.timelinePos;return d>0?d:0},set currentTime(d){c(d,"primary")},get duration(){return l("primary")},get seekableStart(){var d;return((d=e.primaryDetails)==null?void 0:d.fragmentStart)||0}},integrated:{get bufferedEnd(){return r(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return r(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(d){c(d,"integrated")},get duration(){return l("integrated")},get seekableStart(){var d;return i(((d=e.primaryDetails)==null?void 0:d.fragmentStart)||0,"integrated")}},skip:()=>{const d=e.effectivePlayingItem,_=d==null?void 0:d.event;if(_&&!_.restrictions.skip){const b=e.findItemIndex(d);if(_.appendInPlace){const E=d.playout.start+d.event.duration;c(E+.001,"playout")}else e.advanceAfterAssetEnded(_,b,1/0)}}}}return this.manager}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,n=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!n?!1:this.findItemIndex(t)===n.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t,n;if(this.mediaSelection===null)return;const r=this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&!r.event.appendInPlace)return;let i=this.media;!i&&(e=this.bufferingItem)!=null&&(t=e.event)!=null&&t.appendInPlace&&(i=this.primaryMedia);const s=(n=i)==null?void 0:n.currentTime;if(!(s===void 0||!k(s)))return s}get primaryMedia(){var e;return this.media||((e=this.detachedData)==null?void 0:e.media)||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,t){const n=this.getAssetPlayer(e);n&&this.transferMediaFromPlayer(n,t)}transferMediaFromPlayer(e,t){const n=e.interstitial.appendInPlace,r=e.media;if(n&&r===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&r){this.detachedData={media:r};return}const i=e.transferMedia();this.log(`transfer MediaSource from ${e} ${ot(i)}`),this.detachedData=i}else t&&r&&(this.shouldPlay||(this.shouldPlay=!r.paused))}transferMediaTo(e,t){var n,r;if(e.media===t)return;let i=null;const s=this.hls,l=e!==s,c=l&&e.interstitial.appendInPlace,u=(n=this.detachedData)==null?void 0:n.mediaSource;let f;if(s.media)c&&(i=s.transferMedia(),this.detachedData=i),f="Primary";else if(u){const b=this.getBufferingPlayer();b?(i=b.transferMedia(),f=`${b}`):f="detached MediaSource"}else f="detached media";if(!i){if(u)i=this.detachedData,this.log(`using detachedData: MediaSource ${ot(i)}`);else if(!this.detachedData||s.media===t){const b=this.playerQueue;b.length>1&&b.forEach(E=>{if(l&&E.interstitial.appendInPlace!==c){const G=E.interstitial;this.clearInterstitial(E.interstitial,null),G.appendInPlace=!1,G.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${G}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const d=i&&"mediaSource"in i&&((r=i.mediaSource)==null?void 0:r.readyState)!=="closed",_=d&&i?i:t;if(this.log(`${d?"transfering MediaSource":"attaching media"} to ${l?e:"Primary"} from ${f}`),_===i){const b=l&&e.assetId===this.schedule.assetIdAtEnd;_.overrides={duration:this.schedule.duration,endOfStream:!l||b,cueRemoval:!l}}e.attachMedia(_)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const n=this.timelinePos,r=this.effectivePlayingItem;if(n===-1){const i=this.hls.startPosition;if(this.timelinePos=i,t.length&&t[0].cue.pre){const s=e.findEventIndex(t[0].identifier);this.setSchedulePosition(s)}else if(i>=0||!this.primaryLive){const s=this.timelinePos=i>0?i:0,l=e.findItemIndexAtTime(s);this.setSchedulePosition(l)}}else if(r&&!this.playingItem){const i=e.findItemIndex(r);this.setSchedulePosition(i)}}advanceAfterAssetEnded(e,t,n){const r=ca(e,n);if(!e.isAssetPastPlayoutLimit(r))this.setSchedulePosition(t,r);else{const i=this.schedule.items;if(i){const s=t+1,l=i.length;if(s>=l){this.setSchedulePosition(-1);return}const c=e.resumeTime;this.timelinePos<c&&(this.timelinePos=c,this.checkBuffer()),this.setSchedulePosition(s)}}}setScheduleToAssetAtTime(e,t){const n=this.schedule,r=t.parentIdentifier,i=n.getEvent(r);if(i){const s=n.findEventIndex(r),l=n.findAssetIndex(i,e);this.advanceAfterAssetEnded(i,s,l-1)}}setSchedulePosition(e,t){const n=this.schedule.items;if(!n||this.playbackDisabled)return;this.log(`setSchedulePosition ${e}, ${t}`);const r=e>=0?n[e]:null,i=this.playingItem,s=this.playingLastItem;if(this.isInterstitial(i)){var l;const u=i.event,f=this.playingAsset,d=f==null?void 0:f.identifier,_=d?this.getAssetPlayer(d):null;if(_&&d&&(!this.eventItemsMatch(i,r)||t!==void 0&&d!==((l=u.assetList)==null?void 0:l[t].identifier))){var c;const b=u.findAssetIndex(f);this.log(`INTERSTITIAL_ASSET_ENDED ${b+1}/${u.assetList.length} ${ls(f)}`),this.endedAsset=f,this.playingAsset=null,this.hls.trigger(p.INTERSTITIAL_ASSET_ENDED,{asset:f,assetListIndex:b,event:u,schedule:n.slice(0),scheduleIndex:e,player:_}),this.retreiveMediaSource(d,r),_.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&_.detachMedia()}if(!this.eventItemsMatch(i,r)&&(this.endedItem=i,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${u} ${$i(i)}`),u.hasPlayed=!0,this.hls.trigger(p.INTERSTITIAL_ENDED,{event:u,schedule:n.slice(0),scheduleIndex:e}),u.cue.once)){this.updateSchedule();const b=this.schedule.items;if(r&&b){const E=this.schedule.findItemIndex(r);this.advanceSchedule(E,b,t,i,s)}return}}this.advanceSchedule(e,n,t,i,s)}advanceSchedule(e,t,n,r,i){const s=e>=0?t[e]:null,l=this.primaryMedia,c=this.playerQueue;if(c.length&&c.forEach(u=>{const f=u.interstitial,d=this.schedule.findEventIndex(f.identifier);(d<e||d>e+1)&&this.clearInterstitial(f,s)}),this.isInterstitial(s)){this.timelinePos=Math.min(Math.max(this.timelinePos,s.start),s.end);const u=s.event;if(n===void 0){n=this.schedule.findAssetIndex(u,this.timelinePos);const b=ca(u,n-1);if(u.isAssetPastPlayoutLimit(b)){this.advanceAfterAssetEnded(u,e,n);return}n=b}const f=this.waitingItem;this.assetsBuffered(s,l)||this.setBufferingItem(s);let d=this.preloadAssets(u,n);if(this.eventItemsMatch(s,f||r)||(this.waitingItem=s,this.log(`INTERSTITIAL_STARTED ${$i(s)} ${u.appendInPlace?"append in place":""}`),this.hls.trigger(p.INTERSTITIAL_STARTED,{event:u,schedule:t.slice(0),scheduleIndex:e})),!u.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${u}`);return}if(u.assetListLoader&&(u.assetListLoader.destroy(),u.assetListLoader=void 0),!l){this.log(`Waiting for attachMedia to start Interstitial ${u}`);return}this.waitingItem=this.endedItem=null,this.playingItem=s;const _=u.assetList[n];if(!_){const b=t[e+1],E=this.media;b&&E&&!this.isInterstitial(b)&&E.currentTime<b.start&&(E.currentTime=this.timelinePos=b.start),this.advanceAfterAssetEnded(u,e,n||0);return}if(d||(d=this.getAssetPlayer(_.identifier)),d===null||d.destroyed){const b=u.assetList.length;this.warn(`asset ${n+1}/${b} player destroyed ${u}`),d=this.createAssetPlayer(u,_,n)}if(!this.eventItemsMatch(s,this.bufferingItem)&&u.appendInPlace&&this.isAssetBuffered(_))return;this.startAssetPlayer(d,n,t,e,l),this.shouldPlay&&vo(d.media)}else s!==null?(this.resumePrimary(s,e,r),this.shouldPlay&&vo(this.hls.media)):i&&this.isInterstitial(r)&&(this.endedItem=null,this.playingItem=r,r.event.appendInPlace||this.attachPrimary(this.schedule.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e,t;return(e=this.mediaSelection)==null||(t=e.main)==null?void 0:t.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,n){var r;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${$i(e)}`),!((r=this.detachedData)!=null&&r.mediaSource)){let s=this.timelinePos;(s<e.start||s>=e.end)&&(s=this.getPrimaryResumption(e,t),this.timelinePos=s),this.attachPrimary(s,e)}if(!n)return;const i=this.schedule.items;i&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${$i(e)}`),this.hls.trigger(p.INTERSTITIALS_PRIMARY_RESUMED,{schedule:i.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const n=e.start;if(this.primaryLive){const r=this.primaryDetails;if(t===0)return this.hls.startPosition;if(r&&(n<r.fragmentStart||n>r.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:tn.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,n){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const r=this.primaryMedia;if(!r)return;const i=this.hls;i.media?this.checkBuffer():(this.transferMediaTo(i,r),n&&this.startLoadingPrimaryAt(e,n)),n||(this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}startLoadingPrimaryAt(e,t){var n;const r=this.hls;!r.loadingEnabled||!r.media||Math.abs((((n=r.mainForwardBufferInfo)==null?void 0:n.start)||r.media.currentTime)-e)>.5?r.startLoad(e,t):r.bufferingEnabled||r.resumeBuffering()}onManifestLoading(){this.stopLoad(),this.schedule.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(p.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(p.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1)return;const n=this.hls.levels[t.level],r=y(y({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=r,this.schedule.parseInterstitialDateRanges(r,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const n=this.hls.audioTracks[t.id],r=this.mediaSelection;if(!r){this.altSelection=y(y({},this.altSelection),{},{audio:n});return}const i=y(y({},r),{},{audio:n});this.mediaSelection=i}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],r=this.mediaSelection;if(!r){this.altSelection=y(y({},this.altSelection),{},{subtitles:n});return}const i=y(y({},r),{},{subtitles:n});this.mediaSelection=i}onAudioTrackSwitching(e,t){const n=yt(t);this.playerQueue.forEach(r=>r.hls.setAudioOption(t)||r.hls.setAudioOption(n))}onSubtitleTrackSwitch(e,t){const n=yt(t);this.playerQueue.forEach(r=>r.hls.setSubtitleOption(t)||t.id!==-1&&r.hls.setSubtitleOption(n))}onBufferCodecs(e,t){const n=t.tracks;n&&(this.requiredTracks=n)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const r=this.timelinePos;this.bufferedPos=r,this.checkBuffer()}}onBufferedToEnd(e){const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let r=0;r<t.length;r++){const i=t[r];if(i.cue.post){var n;const s=this.schedule.findEventIndex(i.identifier),l=(n=this.schedule.items)==null?void 0:n[s];this.isInterstitial(l)&&this.eventItemsMatch(l,this.bufferingItem)&&this.bufferedToItem(l,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const n=this.findItemIndex(t);this.setSchedulePosition(n+1)}else this.shouldPlay=!1}updateItem(e,t){const n=this.schedule.items;if(e&&n){const r=this.findItemIndex(e,t);return n[r]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((i,s)=>{e.event.isAssetPastPlayoutLimit(s)&&this.clearAssetPlayer(i.identifier,null)});const n=e.end+.25,r=tn.bufferInfo(this.primaryMedia,n,0);(r.end>n||(r.nextStart||0)>n)&&(this.attachPrimary(n,null),this.flushFrontBuffer(n))}}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var n;return!!t&&(e===t||e.event.identifier===((n=t.event)==null?void 0:n.identifier))}findItemIndex(e,t){return e?this.schedule.findItemIndex(e,t):-1}updateSchedule(){const e=this.mediaSelection;e&&this.schedule.updateSchedule(e,[])}checkBuffer(e){const t=this.schedule.items;if(!t)return;const n=tn.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=n.len<1),this.updateBufferedPos(n.end,t,e)}updateBufferedPos(e,t,n){const r=this.schedule,i=this.bufferingItem;if(this.bufferedPos>e)return;if(t.length===1&&this.itemsMatch(t[0],i)){this.bufferedPos=e;return}const s=this.playingItem,l=this.findItemIndex(s);let c=r.findItemIndexAtTime(e);if(this.bufferedPos<e){var u,f;const d=this.findItemIndex(i),_=Math.min(d+1,t.length-1),b=t[_];if((c===-1&&i&&e>=i.end||(u=b.event)!=null&&u.appendInPlace&&e+.01>=b.start)&&(c=_),_-l>1&&(i==null||(f=i.event)==null?void 0:f.appendInPlace)===!1)return;if(this.bufferedPos=e,c>d&&c>l)this.bufferedToItem(b);else{const E=this.primaryDetails;this.primaryLive&&E&&e>E.edge-E.targetduration&&b.start<E.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(b)&&this.preloadAssets(b.event,0)}}else n&&s&&!this.itemsMatch(s,i)&&(c===l?this.bufferedToItem(s):c===l+1&&this.bufferedToItem(t[c]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(r=>{const i=this.getAssetPlayer(r.identifier);return!(i!=null&&i.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,n=this.schedule;if(this.itemsMatch(e,t))this.bufferingItem!==e&&(this.bufferingItem=e);else{const{items:r,events:i}=n;if(!r||!i)return t;const s=this.isInterstitial(e),l=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const c=l?l.remaining:t?t.end-this.timelinePos:0;this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${$i(e)}`+(t?` (${c.toFixed(2)} remaining)`:"")),this.playbackDisabled||(s?e.event.assetList.forEach(u=>{const f=this.getAssetPlayer(u.identifier);f&&f.resumeBuffering()}):(this.hls.resumeBuffering(),this.playerQueue.forEach(u=>u.pauseBuffering()))),this.hls.trigger(p.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:i.slice(0),schedule:r.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}return t}bufferedToItem(e,t=0){const n=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(n!==null){this.bufferingAsset=null;const r=this.detachedData;r?r.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),n=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(n)}bufferedToEvent(e,t){const n=e.event,r=n.assetList.length===0&&!n.assetListLoader,i=n.cue.once;if(r||!i){const s=this.preloadAssets(n,t);if(s!=null&&s.interstitial.appendInPlace){const l=n.assetList[t],c=this.primaryMedia;l&&c&&this.bufferAssetPlayer(s,c)}}}preloadAssets(e,t){const n=e.assetUrl,r=e.assetList.length,i=r===0&&!e.assetListLoader,s=e.cue.once;if(i){const c=e.timelineStart;if(e.appendInPlace){var l;const _=this.playingItem;!this.isInterstitial(_)&&(_==null||(l=_.nextEvent)==null?void 0:l.identifier)===e.identifier&&this.flushFrontBuffer(c+.25)}let u,f=0;if(!this.playingItem&&this.primaryLive&&(f=this.hls.startPosition,f===-1&&(f=this.hls.liveSyncPosition||0)),f&&!(e.cue.pre||e.cue.post)){const _=f-c;_>0&&(u=Math.round(_*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:r} ${e}${u?` live-start: ${f} start-offset: ${u}`:""}`),n)return this.createAsset(e,0,0,c,e.duration,n);const d=this.assetListLoader.loadAssetList(e,u);d&&(e.assetListLoader=d)}else if(!s&&r){for(let c=t;c<r;c++){const u=e.assetList[c],f=this.getAssetPlayerQueueIndex(u.identifier);(f===-1||this.playerQueue[f].destroyed)&&!u.error&&this.createAssetPlayer(e,u,c)}return this.getAssetPlayer(e.assetList[t].identifier)}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(r=>{this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:r})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let n=0;n<t.length;n++)if(e===t[n].assetId)return n;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t){for(let n=0;n<e.length;n++)if(e[n].media===t)return e[n]}return null}createAsset(e,t,n,r,i,s){const l={parentIdentifier:e.identifier,identifier:Gu(e,s,t),duration:i,startOffset:n,timelineStart:r,uri:s};return this.createAssetPlayer(e,l,t)}createAssetPlayer(e,t,n){const r=this.hls,i=r.userConfig;let s=i.videoPreference;const l=r.loadLevelObj||r.levels[r.currentLevel];(s||l)&&(s=h({},s),l.videoCodec&&(s.videoCodec=l.videoCodec),l.videoRange&&(s.allowedVideoRanges=[l.videoRange]));const c=r.audioTracks[r.audioTrack],u=r.subtitleTracks[r.subtitleTrack];let f=0;if(this.primaryLive||e.appendInPlace){const Ee=this.timelinePos-t.timelineStart;if(Ee>1){const Ke=t.duration;Ke&&Ee<Ke&&(f=Ee)}}const d=t.identifier,_=y(y({},i),{},{autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:r.sessionId,assetPlayerId:d,abrEwmaDefaultEstimate:r.bandwidthEstimate,interstitialsController:void 0,startPosition:f,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:c||i.audioPreference,subtitlePreference:u||i.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(_.timelineOffset=t.timelineStart));const b=_.cmcd;b!=null&&b.sessionId&&b.contentId&&(_.cmcd=h({},b,{contentId:ys(t.uri)})),this.getAssetPlayer(d)&&this.warn(`Duplicate date range identifier ${e} and asset ${d}`);const E=new Wu(this.HlsPlayerClass,_,e,t);this.playerQueue.push(E),e.assetList[n]=t;const G=Ee=>{if(Ee.live){const gt=new Error(`Interstitials MUST be VOD assets ${e}`),Xe={fatal:!0,type:fe.OTHER_ERROR,details:$.INTERSTITIAL_ASSET_ITEM_ERROR,error:gt};this.handleAssetItemError(Xe,e,this.schedule.findEventIndex(e.identifier),n,gt.message);return}const Ke=Ee.edge-Ee.fragmentStart,We=t.duration;(We===null||Ke>We)&&(this.log(`Interstitial asset "${d}" duration change ${We} > ${Ke}`),t.duration=Ke,this.updateSchedule())};E.on(p.LEVEL_UPDATED,(Ee,{details:Ke})=>G(Ke)),E.on(p.LEVEL_PTS_UPDATED,(Ee,{details:Ke})=>G(Ke));const N=(Ee,Ke)=>{const We=this.getAssetPlayer(d);if(We&&Ke.tracks){We.off(p.BUFFER_CODECS,N),We.tracks=Ke.tracks;const gt=this.primaryMedia;this.bufferingAsset===We.assetItem&&gt&&!We.media&&this.bufferAssetPlayer(We,gt)}};E.on(p.BUFFER_CODECS,N);const le=()=>{var Ee;const Ke=this.getAssetPlayer(d);if(this.log(`buffered to end of asset ${Ke}`),!Ke)return;const We=this.schedule.findEventIndex(e.identifier),gt=(Ee=this.schedule.items)==null?void 0:Ee[We];if(this.isInterstitial(gt)){const st=e.findAssetIndex(t),ht=ca(e,st);if(!e.isAssetPastPlayoutLimit(ht))this.bufferedToItem(gt,ht);else{var Xe;const Je=(Xe=this.schedule.items)==null?void 0:Xe[We+1];Je&&this.bufferedToItem(Je)}}};E.on(p.BUFFERED_TO_END,le);const ke=Ee=>()=>{if(!this.getAssetPlayer(d))return;this.shouldPlay=!0;const We=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,We,Ee)};return E.once(p.MEDIA_ENDED,ke(n)),E.once(p.PLAYOUT_LIMIT_REACHED,ke(1/0)),E.on(p.ERROR,(Ee,Ke)=>{const We=this.getAssetPlayer(d);if(Ke.details===$.BUFFER_STALLED_ERROR){if(We!=null&&We.media){const gt=We.currentTime,Xe=We.duration-gt;gt&&e.appendInPlace&&Xe/We.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${d} ${e} at ${We.media.currentTime}`),le()):(this.warn(`Stalled at ${gt} of ${gt+Xe} in asset ${d} ${e}`),this.onTimeupdate(),this.checkBuffer(!0))}return}this.handleAssetItemError(Ke,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${Ke.error} ${e}`)}),E.on(p.DESTROYING,()=>{if(!this.getAssetPlayer(d))return;const Ke=new Error(`Asset player destroyed unexpectedly ${d}`),We={fatal:!0,type:fe.OTHER_ERROR,details:$.INTERSTITIAL_ASSET_ITEM_ERROR,error:Ke};this.handleAssetItemError(We,e,this.schedule.findEventIndex(e.identifier),n,Ke.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${ls(t)}`),this.hls.trigger(p.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:E}),E}clearInterstitial(e,t){e.assetList.forEach(n=>{this.clearAssetPlayer(n.identifier,t)}),e.reset()}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);const n=this.playerQueue[t];this.transferMediaFromPlayer(n,null),n.resetDetails()}}clearAssetPlayer(e,t){const n=this.getAssetPlayerQueueIndex(e);if(n!==-1){this.log(`clear asset player "${e}" toSegment: ${t&&$i(t)}`);const r=this.playerQueue[n];this.transferMediaFromPlayer(r,t),this.playerQueue.splice(n,1),r.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,n,r,i){const{interstitial:s,assetItem:l,assetId:c}=e,u=s.assetList.length,f=this.playingAsset;this.endedAsset=null,this.playingAsset=l,(!f||f.identifier!==c)&&(f&&(this.clearAssetPlayer(f.identifier,n[r]),delete f.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${u} ${ls(l)}`),this.hls.trigger(p.INTERSTITIAL_ASSET_STARTED,{asset:l,assetListIndex:t,event:s,schedule:n.slice(0),scheduleIndex:r,player:e})),this.bufferAssetPlayer(e,i)}bufferAssetPlayer(e,t){var n,r;const{interstitial:i,assetItem:s}=e,l=this.schedule.findEventIndex(i.identifier),c=(n=this.schedule.items)==null?void 0:n[l];if(!c)return;this.setBufferingItem(c),this.bufferingAsset=s;const u=this.getBufferingPlayer();if(u===e)return;const f=i.appendInPlace;if(f&&(u==null?void 0:u.interstitial.appendInPlace)===!1)return;const d=(u==null?void 0:u.tracks)||((r=this.detachedData)==null?void 0:r.tracks)||this.requiredTracks;if(f&&s!==this.playingAsset){if(!e.tracks)return;if(d&&!be(d,e.tracks)){const _=new Error(`Asset ${ls(s)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(d)}')`),b={fatal:!0,type:fe.OTHER_ERROR,details:$.INTERSTITIAL_ASSET_ITEM_ERROR,error:_},E=i.findAssetIndex(s);this.handleAssetItemError(b,i,l,E,_.message);return}}this.transferMediaTo(e,t)}handleAssetItemError(e,t,n,r,i){if(e.details===$.BUFFER_STALLED_ERROR)return;const s=t.assetList[r];this.warn(`INTERSTITIAL_ASSET_ERROR ${s&&ls(s)} ${e.error}`);const l=s==null?void 0:s.identifier,c=this.getAssetPlayerQueueIndex(l),u=this.playerQueue[c]||null,f=this.schedule.items,d=h({},e,{fatal:!1,errorAction:Wn(!0),asset:s,assetListIndex:r,event:t,schedule:f,scheduleIndex:n,player:u});if(this.hls.trigger(p.INTERSTITIAL_ASSET_ERROR,d),!e.fatal)return;const _=this.playingAsset,b=new Error(i);if(s&&(this.clearAssetPlayer(l,null),s.error=b),!t.assetList.some(E=>!E.error))t.error=b;else if(t.appendInPlace){for(let E=r;E<t.assetList.length;E++)this.resetAssetPlayer(t.assetList[E].identifier);this.updateSchedule()}t.error?this.primaryFallback(t):_&&_.identifier===l&&this.advanceAfterAssetEnded(t,n,r)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem;if(this.updateSchedule(),n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${n?$i(n):"<none>"} error: ${e.error}`);let r=this.timelinePos;r===-1&&(r=this.hls.startPosition);const i=this.updateItem(n,r);this.itemsMatch(n,i)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t));const s=this.schedule.findItemIndexAtTime(r);this.setSchedulePosition(s)}else this.checkStart()}onAssetListLoaded(e,t){var n;const r=t.event,i=r.identifier,s=t.assetListResponse.ASSETS;if(!this.schedule.hasEvent(i))return;const l=r.timelineStart,c=r.duration;let u=0;s.forEach((E,G)=>{const N=parseFloat(E.DURATION);this.createAsset(r,G,u,l+u,N,E.URI),u+=N}),r.duration=u,this.log(`Loaded asset-list with duration: ${u} (was: ${c}) ${r}`);const f=this.waitingItem,d=(f==null?void 0:f.event.identifier)===i;this.updateSchedule();const _=(n=this.bufferingItem)==null?void 0:n.event;if(d){var b;const E=this.schedule.findEventIndex(i),G=(b=this.schedule.items)==null?void 0:b[E];if(G){if(!this.playingItem&&this.timelinePos>G.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==E){r.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${r}`),this.primaryFallback(r);return}this.setBufferingItem(G)}this.setSchedulePosition(E)}else if((_==null?void 0:_.identifier)===i&&_.appendInPlace){const E=r.assetList[0],G=this.getAssetPlayer(E.identifier),N=this.primaryMedia;E&&G&&N&&this.bufferAssetPlayer(G,N)}}onError(e,t){switch(t.details){case $.ASSET_LIST_PARSING_ERROR:case $.ASSET_LIST_LOAD_ERROR:case $.ASSET_LIST_LOAD_TIMEOUT:{const n=t.interstitial;n&&this.primaryFallback(n);break}case $.BUFFER_STALLED_ERROR:{this.onTimeupdate(),this.checkBuffer(!0);break}}}}const _o=500;class Xu extends Dr{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",ce.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(p.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=ft.IDLE,this.setInterval(_o),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:r}=t;if(ie(n)&&(this.fragPrevious=n),this.state=ft.IDLE,!r)return;const i=this.tracksBuffered[this.currentTrackId];if(!i)return;let s;const l=n.start;for(let u=0;u<i.length;u++)if(l>=i[u].start&&l<=i[u].end){s=i[u];break}const c=n.start+n.duration;s?s.end=c:(s={start:l,end:c},i.push(s)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:n,endOffset:r}=t;if(n===0&&r!==Number.POSITIVE_INFINITY){const i=r-1;if(i<=0)return;t.endOffsetSubtitles=Math.max(0,i),this.tracksBuffered.forEach(s=>{for(let l=0;l<s.length;){if(s[l].end<=i){s.shift();continue}else if(s[l].start<i)s[l].start=i;else break;l++}}),this.fragmentTracker.removeFragmentsInRange(n,i,ce.SUBTITLE)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===ce.SUBTITLE&&(t.details===$.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==ft.STOPPED&&(this.state=ft.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&Ja(this.levels,t)){this.levels=t.map(n=>new pt(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const r=new pt(n);return this.tracksBuffered[r.id]=[],r}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,ce.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}const r=this.levels[this.currentTrackId];r!=null&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.state!==ft.STOPPED&&this.setInterval(_o)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:r,levels:i}=this,{details:s,id:l}=t;if(!i){this.warn(`Subtitle tracks were reset while loading level ${l}`);return}const c=i[l];if(l>=i.length||!c)return;this.log(`Subtitle track ${l} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let u=0;if(s.live||(n=c.details)!=null&&n.live){const d=this.mainDetails;if(s.deltaUpdateFailed||!d)return;const _=d.fragments[0];if(!c.details)s.hasProgramDateTime&&d.hasProgramDateTime?(es(s,d),u=s.fragmentStart):_&&(u=_.start,Ur(s,u));else{var f;u=this.alignPlaylists(s,c.details,(f=this.levelLastLoaded)==null?void 0:f.details),u===0&&_&&(u=_.start,Ur(s,u))}}c.details=s,this.levelLastLoaded=c,l===r&&(this.hls.trigger(p.SUBTITLE_TRACK_UPDATED,{details:s,id:l,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===ft.IDLE&&(kt(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),c.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,r=t.decryptdata,i=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&r!=null&&r.key&&r.iv&&Fr(r.method)){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),r.key.buffer,r.iv.buffer,Wr(r.method)).catch(l=>{throw i.trigger(p.ERROR,{type:fe.MEDIA_ERROR,details:$.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:t}),l}).then(l=>{const c=performance.now();i.trigger(p.FRAG_DECRYPTED,{frag:t,payload:l,stats:{tstart:s,tdecrypt:c}})}).catch(l=>{this.warn(`${l.name}: ${l.message}`),this.state=ft.IDLE})}}doTick(){if(!this.media){this.state=ft.IDLE;return}if(this.state===ft.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details||this.waitForLive(n))return;const{config:r}=this,i=this.getLoadPosition(),s=tn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,r.maxBufferHole),{end:l,len:c}=s,u=n.details,f=this.hls.maxBufferLength+u.levelTargetDuration;if(c>f)return;const d=u.fragments,_=d.length,b=u.edge;let E=null;const G=this.fragPrevious;if(l<b){const ke=r.maxFragLookUpTolerance,Ee=l>b-ke?0:ke;E=kt(G,d,Math.max(d[0].start,l),Ee),!E&&G&&G.start<d[0].start&&(E=d[0])}else E=d[_-1];if(E=this.filterReplacedPrimary(E,n.details),!E)return;const N=E.sn-u.startSN,le=d[N-1];if(le&&le.cc===E.cc&&this.fragmentTracker.getState(le)===Bn.NOT_LOADED&&(E=le),this.fragmentTracker.getState(E)===Bn.NOT_LOADED){const ke=this.mapToInitFragWhenRequired(E);ke&&this.loadFragment(ke,n,l)}}}loadFragment(e,t,n){ie(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Qu(this.tracksBuffered[this.currentTrackId]||[])}}class Qu{constructor(e){this.buffered=void 0;const t=(n,r,i)=>{if(r=r>>>0,r>i-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${r}) is greater than the maximum bound (${i})`);return e[r][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}const Ju={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},yo=a=>String.fromCharCode(Ju[a]||a),bi=15,Li=100,qu={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},ec={17:2,18:4,21:6,22:8,23:10,19:13,20:15},tc={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},nc={25:2,26:4,29:6,30:8,31:10,27:13,28:15},rc=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class ic{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;q.log(`${this.time} [${e}] ${n}`)}}}const ji=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class Eo{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let n=0;n<t.length;n++){const r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class sc{constructor(){this.uchar=" ",this.penState=new Eo}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class ac{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Eo,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<Li;t++)this.chars.push(new sc);this.logger=e}equals(e){for(let t=0;t<Li;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<Li;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<Li;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>Li&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Li)}moveCursor(e){const t=this.pos+e;if(e>1)for(let n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=yo(e);if(this.pos>=Li){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<Li;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let n=0;n<Li;n++){const r=this.chars[n].uchar;r!==" "&&(t=!1),e.push(r)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class fa{constructor(e){this.rows=[],this.currRow=bi-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<bi;t++)this.rows.push(new ac(e));this.logger=e}reset(){for(let e=0;e<bi;e++)this.rows[e].clear();this.currRow=bi-1}equals(e){let t=!0;for(let n=0;n<bi;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<bi;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<bi;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 = "+ot(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let l=0;l<bi;l++)this.rows[l].clear();const i=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const l=s.rows[i].cueStartTime,c=this.logger.time;if(l!==null&&c!==null&&l<c)for(let u=0;u<this.nrRollUpRows;u++)this.rows[t-this.nrRollUpRows+u+1].copy(s.rows[i+u])}}this.currRow=t;const n=this.rows[this.currRow];if(e.indent!==null){const i=e.indent,s=Math.max(i-1,0);n.setCursor(e.indent),e.color=n.chars[s].penState.foreground}const r={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(r)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+ot(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",r=-1;for(let i=0;i<bi;i++){const s=this.rows[i].getTextString();s&&(r=i+1,e?t.push("Row "+r+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(e?n="["+t.join(" | ")+"]":n=t.join(`
`)),n}getTextAndFormat(){return this.rows}}class bo{constructor(e,t,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new fa(n),this.nonDisplayedMemory=new fa(n),this.lastOutputScreen=new fa(n),this.currRollUpRow=this.displayedMemory.rows[bi-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[bi-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let n=0;n<e.length;n++)this.writeScreen.insertChar(e[n]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[n]}this.logger.log(2,"MIDROW: "+ot(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 xo{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=lc(),this.logger=void 0;const r=this.logger=new ic;this.channels=[null,new bo(e,t,r),new bo(e+1,n,r)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n<t.length;n+=2){const r=t[n]&127,i=t[n+1]&127;let s=!1,l=null;if(r===0&&i===0)continue;this.logger.log(3,()=>"["+ji([t[n],t[n+1]])+"] -> ("+ji([r,i])+")");const c=this.cmdHistory;if(r>=16&&r<=31){if(oc(r,i,c)){Ns(null,null,c),this.logger.log(3,()=>"Repeated command ("+ji([r,i])+") is dropped");continue}Ns(r,i,this.cmdHistory),s=this.parseCmd(r,i),s||(s=this.parseMidrow(r,i)),s||(s=this.parsePAC(r,i)),s||(s=this.parseBackgroundAttributes(r,i))}else Ns(null,null,c);if(!s&&(l=this.parseChars(r,i),l)){const f=this.currentChannel;f&&f>0?this.channels[f].insertChars(l):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!l&&this.logger.log(2,()=>"Couldn't parse cleaned data "+ji([r,i])+" orig: "+ji([t[n],t[n+1]]))}}parseCmd(e,t){const n=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,r=(e===23||e===31)&&t>=33&&t<=35;if(!(n||r))return!1;const i=e===20||e===21||e===23?1:2,s=this.channels[i];return e===20||e===21||e===28||e===29?t===32?s.ccRCL():t===33?s.ccBS():t===34?s.ccAOF():t===35?s.ccAON():t===36?s.ccDER():t===37?s.ccRU(2):t===38?s.ccRU(3):t===39?s.ccRU(4):t===40?s.ccFON():t===41?s.ccRDC():t===42?s.ccTR():t===43?s.ccRTD():t===44?s.ccEDM():t===45?s.ccCR():t===46?s.ccENM():t===47&&s.ccEOC():s.ccTO(t-32),this.currentChannel=i,!0}parseMidrow(e,t){let n=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?n=1:n=2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const r=this.channels[n];return r?(r.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+ji([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let n;const r=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,i=(e===16||e===24)&&t>=64&&t<=95;if(!(r||i))return!1;const s=e<=23?1:2;t>=64&&t<=95?n=s===1?qu[e]:tc[e]:n=s===1?ec[e]:nc[e];const l=this.channels[s];return l?(l.setPAC(this.interpretPAC(n,t)),this.currentChannel=s,!0):!1}interpretPAC(e,t){let n;const r={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-64,r.underline=(n&1)===1,n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=Math.floor((n-16)/2)*4,r}parseChars(e,t){let n,r=null,i=null;if(e>=25?(n=2,i=e-8):(n=1,i=e),i>=17&&i<=19){let s;i===17?s=t+80:i===18?s=t+112:s=t+144,this.logger.log(2,()=>"Special char '"+yo(s)+"' in channel "+n),r=[s]}else e>=32&&e<=127&&(r=t===0?[e]:[e,t]);return r&&this.logger.log(3,()=>"Char codes = "+ji(r).join(",")),r}parseBackgroundAttributes(e,t){const n=(e===16||e===24)&&t>=32&&t<=47,r=(e===23||e===31)&&t>=45&&t<=47;if(!(n||r))return!1;let i;const s={};e===16||e===24?(i=Math.floor((t-32)/2),s.background=rc[i],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const l=e<=23?1:2;return this.channels[l].setBkgData(s),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}Ns(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const n=this.channels[t];n&&n.cueSplitAtTime(e)}}}function Ns(a,e,t){t.a=a,t.b=e}function oc(a,e,t){return t.a===a&&t.b===e}function lc(){return{a:null,b:null}}var da=function(){if(_r!=null&&_r.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(l,c){if(typeof c!="string"||!Array.isArray(l))return!1;const u=c.toLowerCase();return~l.indexOf(u)?u:!1}function n(l){return t(a,l)}function r(l){return t(e,l)}function i(l,...c){let u=1;for(;u<arguments.length;u++){const f=arguments[u];for(const d in f)l[d]=f[d]}return l}function s(l,c,u){const f=this,d={enumerable:!0};f.hasBeenReset=!1;let _="",b=!1,E=l,G=c,N=u,le=null,ke="",Ee=!0,Ke="auto",We="start",gt=50,Xe="middle",st=50,ht="middle";Object.defineProperty(f,"id",i({},d,{get:function(){return _},set:function(Je){_=""+Je}})),Object.defineProperty(f,"pauseOnExit",i({},d,{get:function(){return b},set:function(Je){b=!!Je}})),Object.defineProperty(f,"startTime",i({},d,{get:function(){return E},set:function(Je){if(typeof Je!="number")throw new TypeError("Start time must be set to a number.");E=Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"endTime",i({},d,{get:function(){return G},set:function(Je){if(typeof Je!="number")throw new TypeError("End time must be set to a number.");G=Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"text",i({},d,{get:function(){return N},set:function(Je){N=""+Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"region",i({},d,{get:function(){return le},set:function(Je){le=Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"vertical",i({},d,{get:function(){return ke},set:function(Je){const Kt=n(Je);if(Kt===!1)throw new SyntaxError("An invalid or illegal string was specified.");ke=Kt,this.hasBeenReset=!0}})),Object.defineProperty(f,"snapToLines",i({},d,{get:function(){return Ee},set:function(Je){Ee=!!Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"line",i({},d,{get:function(){return Ke},set:function(Je){if(typeof Je!="number"&&Je!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");Ke=Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"lineAlign",i({},d,{get:function(){return We},set:function(Je){const Kt=r(Je);if(!Kt)throw new SyntaxError("An invalid or illegal string was specified.");We=Kt,this.hasBeenReset=!0}})),Object.defineProperty(f,"position",i({},d,{get:function(){return gt},set:function(Je){if(Je<0||Je>100)throw new Error("Position must be between 0 and 100.");gt=Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"positionAlign",i({},d,{get:function(){return Xe},set:function(Je){const Kt=r(Je);if(!Kt)throw new SyntaxError("An invalid or illegal string was specified.");Xe=Kt,this.hasBeenReset=!0}})),Object.defineProperty(f,"size",i({},d,{get:function(){return st},set:function(Je){if(Je<0||Je>100)throw new Error("Size must be between 0 and 100.");st=Je,this.hasBeenReset=!0}})),Object.defineProperty(f,"align",i({},d,{get:function(){return ht},set:function(Je){const Kt=r(Je);if(!Kt)throw new SyntaxError("An invalid or illegal string was specified.");ht=Kt,this.hasBeenReset=!0}})),f.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class uc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function So(a){function e(n,r,i,s){return(n|0)*3600+(r|0)*60+(i|0)+parseFloat(s||0)}const t=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class cc{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let r=0;r<n.length;++r)if(t===n[r]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function To(a,e,t,n){const r=n?a.split(n):[a];for(const i in r){if(typeof r[i]!="string")continue;const s=r[i].split(t);if(s.length!==2)continue;const l=s[0],c=s[1];e(l,c)}}const ha=new da(0,0,""),Bs=ha.align==="middle"?"middle":"center";function fc(a,e,t){const n=a;function r(){const l=So(a);if(l===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),l}function i(l,c){const u=new cc;To(l,function(_,b){let E;switch(_){case"region":for(let G=t.length-1;G>=0;G--)if(t[G].id===b){u.set(_,t[G].region);break}break;case"vertical":u.alt(_,b,["rl","lr"]);break;case"line":E=b.split(","),u.integer(_,E[0]),u.percent(_,E[0])&&u.set("snapToLines",!1),u.alt(_,E[0],["auto"]),E.length===2&&u.alt("lineAlign",E[1],["start",Bs,"end"]);break;case"position":E=b.split(","),u.percent(_,E[0]),E.length===2&&u.alt("positionAlign",E[1],["start",Bs,"end","line-left","line-right","auto"]);break;case"size":u.percent(_,b);break;case"align":u.alt(_,b,["start",Bs,"end","left","right"]);break}},/:/,/\s/),c.region=u.get("region",null),c.vertical=u.get("vertical","");let f=u.get("line","auto");f==="auto"&&ha.line===-1&&(f=-1),c.line=f,c.lineAlign=u.get("lineAlign","start"),c.snapToLines=u.get("snapToLines",!0),c.size=u.get("size",100),c.align=u.get("align",Bs);let d=u.get("position","auto");d==="auto"&&ha.position===50&&(d=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=d}function s(){a=a.replace(/^\s+/,"")}if(s(),e.startTime=r(),s(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);a=a.slice(3),s(),e.endTime=r(),s(),i(a,e)}function wo(a){return a.replace(/<br(?: \/)?>/gi,`
`)}class dc{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new uc,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function n(){let i=t.buffer,s=0;for(i=wo(i);s<i.length&&i[s]!=="\r"&&i[s]!==`
`;)++s;const l=i.slice(0,s);return i[s]==="\r"&&++s,i[s]===`
`&&++s,t.buffer=i.slice(s),l}function r(i){To(i,function(s,l){},/:/)}try{let i="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;i=n();const l=i.match(/^()?WEBVTT([ \t].*)?$/);if(!(l!=null&&l[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let s=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1:i=n(),t.state){case"HEADER":/:/.test(i)?r(i):i||(t.state="ID");continue;case"NOTE":i||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){t.state="NOTE";break}if(!i)continue;if(t.cue=new da(0,0,""),t.state="CUE",i.indexOf("-->")===-1){t.cue.id=i;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{fc(i,t.cue,t.regionList)}catch(l){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const l=i.indexOf("-->")!==-1;if(!i||l&&(s=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
`),t.cue.text+=i}continue;case"BADCUE":i||(t.state="ID")}}}catch(i){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 hc=/\r\n|\n\r|\n|\r/g,pa=function(e,t,n=0){return e.slice(n,n+t.length)===t},pc=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),i=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!k(t)||!k(n)||!k(r)||!k(i))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*r,t+=60*60*1e3*i,t};function ga(a,e,t){return ys(a.toString())+ys(e.toString())+ys(t)}const gc=function(e,t,n){let r=e[t],i=e[r.prevCC];if(!i||!i.new&&r.new){e.ccOffset=e.presentationOffset=r.start,r.new=!1;return}for(;(s=i)!=null&&s.new;){var s;e.ccOffset+=r.start-i.start,r.new=!1,r=i,i=e[r.prevCC]}e.presentationOffset=n};function mc(a,e,t,n,r,i,s){const l=new dc,c=Oe(new Uint8Array(a)).trim().replace(hc,`
`).split(`
`),u=[],f=e?Nl(e.baseTime,e.timescale):0;let d="00:00.000",_=0,b=0,E,G=!0;l.oncue=function(N){const le=t[n];let ke=t.ccOffset;const Ee=(_-f)/9e4;if(le!=null&&le.new&&(b!==void 0?ke=t.ccOffset=le.start:gc(t,n,Ee)),Ee){if(!e){E=new Error("Missing initPTS for VTT MPEGTS");return}ke=Ee-t.presentationOffset}const Ke=N.endTime-N.startTime,We=pi((N.startTime+ke-b)*9e4,r*9e4)/9e4;N.startTime=Math.max(We,0),N.endTime=Math.max(We+Ke,0);const gt=N.text.trim();N.text=decodeURIComponent(encodeURIComponent(gt)),N.id||(N.id=ga(N.startTime,N.endTime,gt)),N.endTime>0&&u.push(N)},l.onparsingerror=function(N){E=N},l.onflush=function(){if(E){s(E);return}i(u)},c.forEach(N=>{if(G)if(pa(N,"X-TIMESTAMP-MAP=")){G=!1,N.slice(16).split(",").forEach(le=>{pa(le,"LOCAL:")?d=le.slice(6):pa(le,"MPEGTS:")&&(_=parseInt(le.slice(7)))});try{b=pc(d)/1e3}catch(le){E=le}return}else N===""&&(G=!1);l.parse(N+`
`)}),l.flush()}const ma="stpp.ttml.im1t",Ao=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Do=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,vc={left:"start",center:"center",right:"end",start:"start",end:"end"};function Ro(a,e,t,n){const r=K(new Uint8Array(a),["mdat"]);if(r.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const i=r.map(l=>Oe(l)),s=Fl(e.baseTime,1,e.timescale);try{i.forEach(l=>t(_c(l,s)))}catch(l){n(l)}}function _c(a,e){const r=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");const i={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(i).reduce((d,_)=>(d[_]=r.getAttribute(`ttp:${_}`)||i[_],d),{}),l=r.getAttribute("xml:space")!=="preserve",c=Co(va(r,"styling","style")),u=Co(va(r,"layout","region")),f=va(r,"body","[begin]");return[].map.call(f,d=>{const _=Io(d,l);if(!_||!d.hasAttribute("begin"))return null;const b=ya(d.getAttribute("begin"),s),E=ya(d.getAttribute("dur"),s);let G=ya(d.getAttribute("end"),s);if(b===null)throw Lo(d);if(G===null){if(E===null)throw Lo(d);G=b+E}const N=new da(b-e,G-e,_);N.id=ga(N.startTime,N.endTime,N.text);const le=u[d.getAttribute("region")],ke=c[d.getAttribute("style")],Ee=yc(le,ke,c),{textAlign:Ke}=Ee;if(Ke){const We=vc[Ke];We&&(N.lineAlign=We),N.align=Ke}return h(N,Ee),N}).filter(d=>d!==null)}function va(a,e,t){const n=a.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Co(a){return a.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function Io(a,e){return[].slice.call(a.childNodes).reduce((t,n,r)=>{var i;return n.nodeName==="br"&&r?t+`
`:(i=n.childNodes)!=null&&i.length?Io(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function yc(a,e,t){const n="http://www.w3.org/ns/ttml#styling";let r=null;const i=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return s&&t.hasOwnProperty(s)&&(r=t[s]),i.reduce((l,c)=>{const u=_a(e,n,c)||_a(a,n,c)||_a(r,n,c);return u&&(l[c]=u),l},{})}function _a(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function Lo(a){return new Error(`Could not parse ttml timestamp ${a}`)}function ya(a,e){if(!a)return null;let t=So(a);return t===null&&(Ao.test(a)?t=Ec(a,e):Do.test(a)&&(t=bc(a,e))),t}function Ec(a,e){const t=Ao.exec(a),n=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+n/e.frameRate}function bc(a,e){const t=Do.exec(a),n=Number(t[1]);switch(t[2]){case"h":return n*3600;case"m":return n*60;case"ms":return n*1e3;case"f":return n/e.frameRate;case"t":return n/e.tickRate}return n}class Us{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class xc{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Oo(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new Us(this,"textTrack1"),t=new Us(this,"textTrack2"),n=new Us(this,"textTrack3"),r=new Us(this,"textTrack4");this.cea608Parser1=new xo(1,e,t),this.cea608Parser2=new xo(3,n,r)}addCues(e,t,n,r,i){let s=!1;for(let l=i.length;l--;){const c=i[l],u=Sc(c[0],c[1],t,n);if(u>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],n),s=!0,u/(n-t)>.5))return}if(s||i.push([t,n]),this.config.renderTextTracksNatively){const l=this.captionsTracks[e];this.Cues.newCue(l,t,n,r)}else{const l=this.Cues.newCue(null,t,n,r);this.hls.trigger(p.CUES_PARSED,{type:"captions",cues:l,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:i}){const{unparsedVttFrags:s}=this;n===ce.MAIN&&(this.initPTS[t.cc]={baseTime:r,timescale:i}),s.length&&(this.unparsedVttFrags=[],s.forEach(l=>{this.onFragLoaded(p.FRAG_LOADED,l)}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let r=0;r<n.textTracks.length;r++){const i=n.textTracks[r];if(Po(i,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return i}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:r}=this,{label:i,languageCode:s}=t[e],l=this.getExistingTrack(i,s);if(l)n[e]=l,as(n[e]),ho(n[e],r);else{const c=this.createTextTrack("captions",i,s);c&&(c[e]=!0,n[e]=c)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n=t.label,r={_id:e,label:n,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=r,this.hls.trigger(p.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[r]})}createTextTrack(e,t,n){const r=this.media;if(r)return r.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const n=!!t.transferMedia;if(this.media=null,n)return;const{captionsTracks:r}=this;Object.keys(r).forEach(i=>{as(r[i]),delete r[i]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Oo(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let n=0;n<t.length;n++)as(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],r=n.some(i=>i.textCodec===ma);if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(Ja(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,l=s?Ms(s.textTracks):null;if(this.tracks.forEach((c,u)=>{let f;if(l){let d=null;for(let _=0;_<l.length;_++)if(l[_]&&Po(l[_],c)){d=l[_],l[_]=null;break}d&&(f=d)}if(f)as(f);else{const d=ko(c);f=this.createTextTrack(d,c.name,c.lang),f&&(f.mode="disabled")}f&&this.textTracks.push(f)}),l!=null&&l.length){const c=l.filter(u=>u!==null).map(u=>u.label);c.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${c.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const s=this.tracks.map(l=>({label:l.name,kind:l.type.toLowerCase(),default:l.default,subtitleTrack:l}));this.hls.trigger(p.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(n=>{const r=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!r)return;const i=`textTrack${r[1]}`,s=this.captionsProperties[i];s&&(s.label=n.name,n.lang&&(s.languageCode=n.lang),s.media=n)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===ce.MAIN){var n,r;const{cea608Parser1:i,cea608Parser2:s,lastSn:l}=this,{cc:c,sn:u}=t.frag,f=(n=(r=t.part)==null?void 0:r.index)!=null?n:-1;i&&s&&(u!==l+1||u===l&&f!==this.lastPartIndex+1||c!==this.lastCc)&&(i.reset(),s.reset()),this.lastCc=c,this.lastSn=u,this.lastPartIndex=f}}onFragLoaded(e,t){const{frag:n,payload:r}=t;if(n.type===ce.SUBTITLE)if(r.byteLength){const i=n.decryptdata,s="stats"in t;if(i==null||!i.encrypted||s){const l=this.tracks[n.level],c=this.vttCCs;c[n.cc]||(c[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),l&&l.textCodec===ma?this._parseIMSC1(n,r):this._parseVTTs(t)}}else this.hls.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;Ro(t,this.initPTS[e.cc],r=>{this._appendCues(r,e.level),n.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},r=>{n.logger.log(`Failed to parse IMSC1: ${r}`),n.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:r})})}_parseVTTs(e){var t;const{frag:n,payload:r}=e,{initPTS:i,unparsedVttFrags:s}=this,l=i.length-1;if(!i[n.cc]&&l===-1){s.push(e);return}const c=this.hls,u=(t=n.initSegment)!=null&&t.data?ge(n.initSegment.data,new Uint8Array(r)).buffer:r;mc(u,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,f=>{this._appendCues(f,n.level),c.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},f=>{const d=f.message==="Missing initPTS for VTT MPEGTS";d?s.push(e):this._fallbackToIMSC1(n,r),c.logger.log(`Failed to parse VTT cue: ${f}`),!(d&&l>n.cc)&&c.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:f})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||Ro(t,this.initPTS[e.cc],()=>{n.textCodec=ma,this._parseIMSC1(e,t)},()=>{n.textCodec="wvtt"})}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const r=this.textTracks[t];if(!r||r.mode==="disabled")return;e.forEach(i=>po(r,i))}else{const r=this.tracks[t];if(!r)return;const i=r.default?"default":"subtitles"+t;n.trigger(p.CUES_PARSED,{type:"subtitles",cues:e,track:i})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===ce.SUBTITLE&&this.onFragLoaded(p.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:r}=t;if(!(n.type===ce.MAIN&&this.closedCaptionsForLevel(n)==="NONE"))for(let i=0;i<r.length;i++){const s=r[i].bytes;if(s){this.cea608Parser1||this.initCea608Parsers();const l=this.extractCea608Data(s);this.cea608Parser1.addData(r[i].pts,l[0]),this.cea608Parser2.addData(r[i].pts,l[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:r,type:i}){const{media:s}=this;if(!(!s||s.currentTime<n)){if(!i||i==="video"){const{captionsTracks:l}=this;Object.keys(l).forEach(c=>la(l[c],t,n))}if(this.config.renderTextTracksNatively&&t===0&&r!==void 0){const{textTracks:l}=this;Object.keys(l).forEach(c=>la(l[c],t,r))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let r=2;for(let i=0;i<n;i++){const s=e[r++],l=127&e[r++],c=127&e[r++];if(l===0&&c===0)continue;if((4&s)!==0){const f=3&s;(f===0||f===1)&&(t[f].push(l),t[f].push(c))}}return t}}function ko(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function Po(a,e){return!!a&&a.kind===ko(e)&&na(e,a)}function Sc(a,e,t,n){return Math.min(e,n)-Math.max(a,t)}function Oo(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const Tc=/\s/,wc={newCue(a,e,t,n){const r=[];let i,s,l,c,u;const f=self.VTTCue||self.TextTrackCue;for(let _=0;_<n.rows.length;_++)if(i=n.rows[_],l=!0,c=0,u="",!i.isEmpty()){var d;for(let G=0;G<i.chars.length;G++)Tc.test(i.chars[G].uchar)&&l?c++:(u+=i.chars[G].uchar,l=!1);i.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const b=wo(u.trim()),E=ga(e,t,b);a!=null&&(d=a.cues)!=null&&d.getCueById(E)||(s=new f(e,t,b),s.id=E,s.line=_+1,s.align="left",s.position=10+Math.min(80,Math.floor(c*8/32)*10),r.push(s))}return a&&r.length&&(r.sort((_,b)=>_.line==="auto"||b.line==="auto"?0:_.line>8&&b.line>8?b.line-_.line:_.line-b.line),r.forEach(_=>po(a,_))),r}};function Ac(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const Dc=/(\d+)-(\d+)\/(\d+)/;class Mo{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||Lc,this.controller=new self.AbortController,this.stats=new v}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();const i=Rc(e,this.controller.signal),s=e.responseType==="arraybuffer",l=s?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:u}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=c&&k(c)?c:u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},t.timeout),(ms(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(d=>{var _;this.response=this.loader=d;const b=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},u-(b-r.loading.start)),!d.ok){const{status:G,statusText:N}=d;throw new kc(N||"fetch, bad network response",G,d)}r.loading.first=b,r.total=Ic(d.headers)||r.total;const E=(_=this.callbacks)==null?void 0:_.onProgress;return E&&k(t.highWaterMark)?this.loadProgressively(d,r,e,t.highWaterMark,E):s?d.arrayBuffer():e.responseType==="json"?d.json():d.text()}).then(d=>{var _,b;const E=this.response;if(!E)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const G=d[l];G&&(r.loaded=r.total=G);const N={url:E.url,data:d,code:E.status},le=(_=this.callbacks)==null?void 0:_.onProgress;le&&!k(t.highWaterMark)&&le(r,e,d,E),(b=this.callbacks)==null||b.onSuccess(N,r,e,E)}).catch(d=>{var _;if(self.clearTimeout(this.requestTimeout),r.aborted)return;const b=d&&d.code||0,E=d?d.message:null;(_=this.callbacks)==null||_.onError({code:b,text:E},e,d?d.details:null,r)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,r=0,i){const s=new jr,l=e.body.getReader(),c=()=>l.read().then(u=>{if(u.done)return s.dataLength&&i(t,n,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const f=u.value,d=f.length;return t.loaded+=d,d<r||s.dataLength?(s.push(f),s.dataLength>=r&&i(t,n,s.flush().buffer,e)):i(t,n,f.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function Rc(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(h({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function Cc(a){const e=Dc.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function Ic(a){const e=a.get("Content-Range");if(e){const n=Cc(e);if(k(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function Lc(a,e){return new self.Request(a.url,e)}class kc extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const Pc=/^age:\s*[\d.]+\s*$/im;class Fo{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 v,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;const i=this.xhrSetup;i?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return i(n,t.url)}).catch(s=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),i(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(s=>{var l;(l=this.callbacks)==null||l.onError({code:n.status,text:s.message},t,n,r)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const r=t.headers,{maxTimeToFirstByteMs:i,maxLoadTimeMs:s}=n.loadPolicy;if(r)for(const l in r)e.setRequestHeader(l,r[l]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=i&&k(i)?i:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const r=t.readyState,i=this.config;if(!n.aborted&&r>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),r===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const u=t.status,f=t.responseType==="text"?t.responseText:null;if(u>=200&&u<300){const E=f!=null?f:t.response;if(E!=null){var s,l;n.loading.end=Math.max(self.performance.now(),n.loading.first);const G=t.responseType==="arraybuffer"?E.byteLength:E.length;n.loaded=n.total=G,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);const N=(s=this.callbacks)==null?void 0:s.onProgress;N&&N(n,e,E,t);const le={url:t.responseURL,data:E,code:u};(l=this.callbacks)==null||l.onSuccess(le,n,e,t);return}}const d=i.loadPolicy.errorRetry,_=n.retry,b={url:e.url,data:void 0,code:u};if(an(d,_,!1,b))this.retry(d);else{var c;q.error(`${u} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:u,text:t.statusText},e,t,n)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(an(e,t,!0))this.retry(e);else{var n;q.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=cn(e,n.retry),n.retry++,q.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&Pc.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const Oc={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Mc=y(y({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:Fo,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Ot,bufferController:Jl,capLevelController:ia,errorController:Jn,fpsController:Bu,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:yr,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:Oc},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},Fc()),{},{subtitleStreamController:Xu,subtitleTrackController:Ku,timelineController:xc,audioStreamController:jl,audioTrackController:Yl,emeController:ss,cmcdController:Mu,contentSteeringController:Nu,interstitialsController:Yu});function Fc(){return{cueHandler:wc,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function Nc(a,e,t){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const n=Ea(a),r=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return r.forEach(s=>{const l=`${s==="level"?"playlist":s}LoadPolicy`,c=e[l]===void 0,u=[];i.forEach(f=>{const d=`${s}Loading${f}`,_=e[d];if(_!==void 0&&c){u.push(d);const b=n[l].default;switch(e[l]={default:b},f){case"TimeOut":b.maxLoadTimeMs=_,b.maxTimeToFirstByteMs=_;break;case"MaxRetry":b.errorRetry.maxNumRetry=_,b.timeoutRetry.maxNumRetry=_;break;case"RetryDelay":b.errorRetry.retryDelayMs=_,b.timeoutRetry.retryDelayMs=_;break;case"MaxRetryTimeout":b.errorRetry.maxRetryDelayMs=_,b.timeoutRetry.maxRetryDelayMs=_;break}}}),u.length&&t.warn(`hls.js config: "${u.join('", "')}" setting(s) are deprecated, use "${l}": ${ot(e[l])}`)}),y(y({},n),e)}function Ea(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(Ea):Object.keys(a).reduce((e,t)=>(e[t]=Ea(a[t]),e),{}):a}function Bc(a,e){const t=a.loader;t!==Mo&&t!==Fo?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):Ac()&&(a.loader=Mo,a.progressive=!0,a.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const $s=2,Uc=.1,$c=.05,Kc=100;class Zc extends dr{constructor(e,t){super("gap-controller",e.logger),this.hls=null,this.fragmentTracker=null,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var n;(n=this.media)!=null&&n.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var n;this.ended=((n=this.media)==null?void 0:n.currentTime)||1,this.hls.trigger(p.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(Kc),this.mediaSource=t.mediaSource;const n=this.media=t.media;ci(n,"playing",this.onMediaPlaying),ci(n,"waiting",this.onMediaWaiting),ci(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(gi(n,"playing",this.onMediaPlaying),gi(n,"waiting",this.onMediaWaiting),gi(n,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var n,r;const i=(n=this.hls)==null?void 0:n.config;if(!i)return;const s=this.media;if(!s)return;const{seeking:l}=s,c=this.seeking&&!l,u=!this.seeking&&l,f=s.paused&&!l||s.ended||s.playbackRate===0;if(this.seeking=l,e!==t){t&&(this.ended=0),this.moved=!0,l||(this.nudgeRetry=0,i.nudgeOnVideoHole&&!f&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(u||c){c&&this.stallResolved(e);return}if(f){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&s.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(p.MEDIA_ENDED,{stalled:!1}));return}if(!tn.getBuffered(s).length){this.nudgeRetry=0;return}const d=tn.bufferInfo(s,e,0),_=d.nextStart||0,b=this.fragmentTracker;if(l&&b&&this.hls){const gt=No(this.hls.inFlightFragments,e),Xe=d.len>$s,st=!_||gt||_-e>$s&&!b.getPartialFragment(e);if(Xe||st)return;this.moved=!1}const E=(r=this.hls)==null?void 0:r.latestLevelDetails;if(!this.moved&&this.stalled!==null&&b){if(!(d.len>0)&&!_)return;const Xe=Math.max(_,d.start||0)-e,ht=!!(E!=null&&E.live)?E.targetduration*2:$s,Je=b.getPartialFragment(e);if(Xe>0&&(Xe<=ht||Je)){s.paused||this._trySkipBufferHole(Je);return}}const G=i.detectStallWithCurrentTimeMs,N=self.performance.now(),le=this.waiting;let ke=this.stalled;if(ke===null)if(le>0&&N-le<G)ke=this.stalled=le;else{this.stalled=N;return}const Ee=N-ke;if(!l&&(Ee>=G||le)&&this.hls){var Ke;if(((Ke=this.mediaSource)==null?void 0:Ke.readyState)==="ended"&&!(E!=null&&E.live)&&Math.abs(e-((E==null?void 0:E.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(p.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(d),!this.media||!this.hls)return}const We=tn.bufferInfo(s,e,i.maxBufferHole);this._tryFixBufferStall(We,Ee,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(p.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;const r=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(n=this.buffered.audio)!=null&&n.length&&r&&r.length>1&&e>r.end(0)){const i=tn.bufferedInfo(tn.timeRangesToArray(this.buffered.audio),e,0);if(i.len>1&&t>=i.start){const s=tn.timeRangesToArray(r),l=tn.bufferedInfo(s,t,0).bufferedIndex;if(l>-1&&l<s.length-1){const c=tn.bufferedInfo(s,e,0).bufferedIndex,u=s[l].end,f=s[l+1].start;if((c===-1||c>l)&&f-u<1&&e-u<2){const d=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${u} -> ${f} buffered index: ${c}`);this.warn(d.message),this.media.currentTime+=1e-6;const _=this.fragmentTracker.getPartialFragment(e)||void 0,b=tn.bufferInfo(this.media,e,0);this.hls.trigger(p.ERROR,{type:fe.MEDIA_ERROR,details:$.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:d,reason:d.message,frag:_,buffer:b.len,bufferInfo:b})}}}}}_tryFixBufferStall(e,t,n){var r,i;const{fragmentTracker:s,media:l}=this,c=(r=this.hls)==null?void 0:r.config;if(!l||!s||!c)return;const u=(i=this.hls)==null?void 0:i.latestLevelDetails,f=s.getPartialFragment(n);if((f||u!=null&&u.live&&n<u.fragmentStart)&&(this._trySkipBufferHole(f)||!this.media))return;const d=e.buffered,_=this.adjacentTraversal(e,n);(d&&d.length>1&&e.len>c.maxBufferHole||e.nextStart&&(e.nextStart-n<c.maxBufferHole||_))&&(t>c.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const n=this.fragmentTracker,r=e.nextStart;if(n&&r){const i=n.getFragAtPos(t,ce.MAIN),s=n.getFragAtPos(r,ce.MAIN);if(i&&s)return s.sn-i.sn<2}return!1}_reportStall(e){const{hls:t,media:n,stallReported:r,stalled:i}=this;if(!r&&i!==null&&n&&t){this.stallReported=!0;const s=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${ot(e)})`);this.warn(s.message),t.trigger(p.ERROR,{type:fe.MEDIA_ERROR,details:$.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:e.len,bufferInfo:e,stalled:{start:i}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:n,media:r}=this,i=(t=this.hls)==null?void 0:t.config;if(!r||!n||!i)return 0;const s=r.currentTime,l=tn.bufferInfo(r,s,0),c=s<l.start?l.start:l.nextStart;if(c&&this.hls){const f=l.len<=i.maxBufferHole,d=l.len>0&&l.len<1&&r.readyState<3,_=c-s;if(_>0&&(f||d)){if(_>i.maxBufferHole){let E=!1;if(s===0){const G=n.getAppendedFrag(0,ce.MAIN);G&&c<G.end&&(E=!0)}if(!E){const G=e||n.getAppendedFrag(s,ce.MAIN);if(G){var u;if(!((u=this.hls.loadLevelObj)!=null&&u.details)||No(this.hls.inFlightFragments,c))return 0;let le=!1,ke=G.end;for(;ke<c;){const Ee=n.getPartialFragment(ke);if(Ee)ke+=Ee.duration;else{le=!0;break}}if(le)return 0}}}const b=Math.max(c+$c,s+Uc);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${b}`),this.moved=!0,r.currentTime=b,!(e!=null&&e.gap)){const E=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${b}`);this.hls.trigger(p.ERROR,{type:fe.MEDIA_ERROR,details:$.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:E,reason:E.message,frag:e||void 0,buffer:l.len,bufferInfo:l})}return b}}return 0}_tryNudgeBuffer(e){const{hls:t,media:n,nudgeRetry:r}=this,i=t==null?void 0:t.config;if(!n||!i)return 0;const s=n.currentTime;if(this.nudgeRetry++,r<i.nudgeMaxRetry){const l=s+(r+1)*i.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${s} to ${l}`);this.warn(c.message),n.currentTime=l,t.trigger(p.ERROR,{type:fe.MEDIA_ERROR,details:$.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const l=new Error(`Playhead still not moving while enough data buffered @${s} after ${i.nudgeMaxRetry} nudges`);this.error(l.message),t.trigger(p.ERROR,{type:fe.MEDIA_ERROR,details:$.BUFFER_STALLED_ERROR,error:l,fatal:!0,buffer:e.len,bufferInfo:e})}}}function No(a,e){const t=Bo(a.main);if(t&&t.start<=e)return t;const n=Bo(a.audio);return n&&n.start<=e?n:null}function Bo(a){if(!a)return null;switch(a.state){case ft.IDLE:case ft.STOPPED:case ft.ENDED:case ft.ERROR:return null}return a.frag}const Gc=.25;function ba(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Uo(a,e,t,n,r){let i=new a(e,t,"");try{i.value=n,r&&(i.type=r)}catch(s){i=new a(e,t,ot(r?y({type:r},n):n))}return i}const Ks=(()=>{const a=ba();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Vc(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class zc{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(p.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}onMediaAttaching(e,t){var n;this.media=t.media,((n=t.overrides)==null?void 0:n.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){const e=this.hls.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&as(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const n=e[t];if(n.kind==="metadata"&&n.label==="id3")return ho(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:r}}}=this;if(!n&&!r)return;const{samples:i}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=ba();if(s)for(let l=0;l<i.length;l++){const c=i[l].type;if(c===ui.emsg&&!n||!r)continue;const u=La(i[l].data);if(u){const f=i[l].pts;let d=f+i[l].duration;d>Ks&&(d=Ks),d-f<=0&&(d=f+Gc);for(let b=0;b<u.length;b++){const E=u[b];if(!ka(E)){this.updateId3CueEnds(f,c);const G=Uo(s,f,d,E,c);G&&this.id3Track.addCue(G)}}}}}updateId3CueEnds(e,t){var n;const r=(n=this.id3Track)==null?void 0:n.cues;if(r)for(let i=r.length;i--;){const s=r[i];s.type===t&&s.startTime<e&&s.endTime===Ks&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:r}){const{id3Track:i,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:l,enableID3MetadataCues:c}}=s;if(i&&(l||c)){let u;r==="audio"?u=f=>f.type===ui.audioId3&&c:r==="video"?u=f=>f.type===ui.emsg&&l:u=f=>f.type===ui.audioId3&&c||f.type===ui.emsg&&l,la(i,t,n,u)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.media||!e.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{id3Track:n}=this,{dateRanges:r}=e,i=Object.keys(r);let s=this.dateRangeCuesAppended;if(n&&t){var l;if((l=n.cues)!=null&&l.length){const f=Object.keys(s).filter(d=>!i.includes(d));for(let d=f.length;d--;){const _=f[d],b=s[_].cues;delete s[_],Object.keys(b).forEach(E=>{try{const G=b[E];G.removeEventListener("enter",this.onEventCueEnter),n.removeCue(G)}catch(G){}})}}else s=this.dateRangeCuesAppended={}}const c=e.fragments[e.fragments.length-1];if(i.length===0||!k(c==null?void 0:c.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const u=ba();for(let f=0;f<i.length;f++){const d=i[f],_=r[d],b=_.startTime,E=s[d],G=(E==null?void 0:E.cues)||{};let N=(E==null?void 0:E.durationKnown)||!1,le=Ks;const{duration:ke,endDate:Ee}=_;if(Ee&&ke!==null)le=b+ke,N=!0;else if(_.endOnNext&&!N){const We=i.reduce((gt,Xe)=>{if(Xe!==_.id){const st=r[Xe];if(st.class===_.class&&st.startDate>_.startDate&&(!gt||_.startDate<gt.startDate))return st}return gt},null);We&&(le=We.startTime,N=!0)}const Ke=Object.keys(_.attr);for(let We=0;We<Ke.length;We++){const gt=Ke[We];if(!Mr(gt))continue;const Xe=G[gt];if(Xe)N&&!E.durationKnown?Xe.endTime=le:Math.abs(Xe.startTime-b)>.01&&(Xe.startTime=b,Xe.endTime=le);else if(u){let st=_.attr[gt];zr(gt)&&(st=Vc(st));const Je=Uo(u,b,le,{key:gt,data:st},ui.dateRange);Je&&(Je.id=d,this.id3Track.addCue(Je),G[gt]=Je,this.hls.config.interstitialsController&&(gt==="X-ASSET-LIST"||gt==="X-ASSET-URL")&&Je.addEventListener("enter",this.onEventCueEnter))}}s[d]={cues:G,dateRange:_,durationKnown:N}}}}class Wc{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,n=this.levelDetails;if(!t||!n)return;this.currentTime=t.currentTime;const r=this.computeLatency();if(r===null)return;this._latency=r;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:s}=this.config;if(!i||s===1||!n.live)return;const l=this.targetLatency;if(l===null)return;const c=r-l,u=Math.min(this.maxLatency,l+n.targetduration);if(c<u&&c>.05&&this.forwardBufferLength>1){const d=Math.min(2,Math.max(1,s)),_=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,b=Math.min(d,Math.max(1,_));this.changeMediaPlaybackRate(t,b)}else t.playbackRate!==1&&t.playbackRate!==0&&this.changeMediaPlaybackRate(t,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return((e=this.hls)==null?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:t,partHoldBack:n,targetduration:r}=e,{liveSyncDuration:i,liveSyncDurationCount:s,lowLatencyMode:l}=this.config,c=this.hls.userConfig;let u=l&&n||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||u===0)&&(u=i!==void 0?i:s*r);const f=r;return u+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,f)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;const n=this.levelDetails;if(n===null)return null;const r=n.edge,i=e-t-this.edgeStalled,s=r-n.totalduration,l=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,i),l)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var n;t.details===$.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(n=this.levelDetails)!=null&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var n,r;e.playbackRate!==t&&((n=this.hls)==null||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(r=this.targetLatency)==null?void 0:r.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class Hc extends ta{constructor(e,t){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,r=[],i={},s={};let l=!1,c=!1,u=!1;t.levels.forEach(f=>{const d=f.attrs;let{audioCodec:_,videoCodec:b}=f;_&&(f.audioCodec=_=et(_,n)||void 0),b&&(b=f.videoCodec=Rt(b));const{width:E,height:G,unknownCodecs:N}=f;let le=N?N.length:0;if(N)for(let Je=le;Je--;){const Kt=N[Je];this.isAudioSupported(Kt)?(f.audioCodec=_=_?`${_},${Kt}`:Kt,le--,ut.audio[_.substring(0,4)]=2):this.isVideoSupported(Kt)&&(f.videoCodec=b=b?`${b},${Kt}`:Kt,le--,ut.video[b.substring(0,4)]=2)}if(l||(l=!!(E&&G)),c||(c=!!b),u||(u=!!_),le||_&&!this.isAudioSupported(_)||b&&!this.isVideoSupported(b)){this.log(`Some or all CODECS not supported "${d.CODECS}"`);return}const{CODECS:ke,"FRAME-RATE":Ee,"HDCP-LEVEL":Ke,"PATHWAY-ID":We,RESOLUTION:gt,"VIDEO-RANGE":Xe}=d,ht=`${`${We||"."}-`}${f.bitrate}-${gt}-${Ee}-${ke}-${Xe}-${Ke}`;if(i[ht])if(i[ht].uri!==f.url&&!f.attrs["PATHWAY-ID"]){const Je=s[ht]+=1;f.attrs["PATHWAY-ID"]=new Array(Je+1).join(".");const Kt=this.createLevel(f);i[ht]=Kt,r.push(Kt)}else i[ht].addGroupId("audio",d.AUDIO),i[ht].addGroupId("text",d.SUBTITLES);else{const Je=this.createLevel(f);i[ht]=Je,s[ht]=1,r.push(Je)}}),this.filterAndSortMediaOptions(r,t,l,c,u)}createLevel(e){const t=new pt(e),n=e.supplemental;if(n!=null&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const r=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(r.message),t.supportedResult=wn(r,[])}return t}isAudioSupported(e){return Le(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Le(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,r,i){let s=[],l=[],c=e;if((n||r)&&i&&(c=c.filter(({videoCodec:N,videoRange:le,width:ke,height:Ee})=>(!!N||!!(ke&&Ee))&&tr(le))),c.length===0){Promise.resolve().then(()=>{if(this.hls){let N="no level with compatible codecs found in manifest",le=N;t.levels.length&&(le=`one or more CODECS in variant not supported: ${ot(t.levels.map(Ee=>Ee.attrs.CODECS).filter((Ee,Ke,We)=>We.indexOf(Ee)===Ke))}`,this.warn(le),N+=` (${le})`);const ke=new Error(N);this.hls.trigger(p.ERROR,{type:fe.MEDIA_ERROR,details:$.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:ke,reason:le})}});return}t.audioTracks&&(s=t.audioTracks.filter(N=>!N.audioCodec||this.isAudioSupported(N.audioCodec)),$o(s)),t.subtitles&&(l=t.subtitles,$o(l));const u=c.slice(0);c.sort((N,le)=>{if(N.attrs["HDCP-LEVEL"]!==le.attrs["HDCP-LEVEL"])return(N.attrs["HDCP-LEVEL"]||"")>(le.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&N.height!==le.height)return N.height-le.height;if(N.frameRate!==le.frameRate)return N.frameRate-le.frameRate;if(N.videoRange!==le.videoRange)return $n.indexOf(N.videoRange)-$n.indexOf(le.videoRange);if(N.videoCodec!==le.videoCodec){const ke=H(N.videoCodec),Ee=H(le.videoCodec);if(ke!==Ee)return Ee-ke}if(N.uri===le.uri&&N.codecSet!==le.codecSet){const ke=ee(N.codecSet),Ee=ee(le.codecSet);if(ke!==Ee)return Ee-ke}return N.averageBitrate!==le.averageBitrate?N.averageBitrate-le.averageBitrate:0});let f=u[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==u.length)){for(let N=0;N<u.length;N++)if(u[N].pathwayId===c[0].pathwayId){f=u[N];break}}this._levels=c;for(let N=0;N<c.length;N++)if(c[N]===f){var d;this._firstLevel=N;const le=f.bitrate,ke=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${c.length} level(s) found, first bitrate: ${le}`),((d=this.hls.userConfig)==null?void 0:d.abrEwmaDefaultEstimate)===void 0){const Ee=Math.min(le,this.hls.config.abrEwmaDefaultEstimateMax);Ee>ke&&ke===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=Ee)}break}const _=i&&!r,b=this.hls.config,E=!!(b.audioStreamController&&b.audioTrackController),G={levels:c,audioTracks:s,subtitleTracks:l,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:r,altAudio:E&&!_&&s.some(N=>!!N.url)};this.hls.trigger(p.MANIFEST_PARSED,G)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const f=new Error("invalid level idx"),d=e<0;if(this.hls.trigger(p.ERROR,{type:fe.OTHER_ERROR,details:$.LEVEL_SWITCH_ERROR,level:e,fatal:d,error:f,reason:f.message}),d)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,r=this.currentLevel,i=r?r.attrs["PATHWAY-ID"]:void 0,s=t[e],l=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,n===e&&r&&i===l)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${l?" with Pathway "+l:""} from level ${n}${i?" with Pathway "+i:""}`);const c={level:e,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width,height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError,name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(p.LEVEL_SWITCHING,c);const u=s.details;if(!u||u.live){const f=this.switchParams(s.uri,r==null?void 0:r.details,u);this.loadPlaylist(f)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),n=e.filter(r=>t.indexOf(r)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=n}}onError(e,t){t.fatal||!t.context||t.context.type===me.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===ce.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(i=>!!n[i]))return;const r=this._levels[t.level];r!=null&&r.loadError&&(this.log(`Resetting level error count of ${r.loadError} on frag buffered`),r.loadError=0)}}onLevelLoaded(e,t){var n;const{level:r,details:i}=t,s=t.levelInfo;if(!s){var l;this.warn(`Invalid level index ${r}`),(l=t.deliveryDirectives)!=null&&l.skip&&(i.deltaUpdateFailed=!0);return}if(s===this.currentLevel||t.withoutMultiVariant){s.fragmentError===0&&(s.loadError=0);let c=s.details;c===t.details&&c.advanced&&(c=void 0),this.playlistLoaded(r,t,c)}else(n=t.deliveryDirectives)!=null&&n.skip&&(i.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=this.getUrlWithDirectives(e.uri,t),r=this.currentLevelIndex,i=e.attrs["PATHWAY-ID"],s=e.details,l=s==null?void 0:s.age;this.log(`Loading level index ${r}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${i?" Pathway "+i:""}${l&&s.live?" age "+l.toFixed(1)+(s.type?" "+s.type||0:""):""} ${n}`),this.hls.trigger(p.LEVEL_LOADING,{url:n,level:r,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const n=this._levels.filter((i,s)=>s!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(l=>l.level=-1)),!1));Jr(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const r=n.length-1;this._firstLevel=Math.min(this._firstLevel,r),this._startLevel&&(this._startLevel=Math.min(this._startLevel,r)),this.hls.trigger(p.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(p.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function $o(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}function Ko(){return self.SourceBuffer||self.WebKitSourceBuffer}function Zo(){if(!he())return!1;const e=Ko();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function jc(){if(!Zo())return!1;const a=he();return typeof(a==null?void 0:a.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>a.isTypeSupported(Ie(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(Ie(e,"audio"))))}function Yc(){var a;const e=Ko();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const Xc=100;class Qc extends Dr{constructor(e,t,n){super(e,t,n,"stream-controller",ce.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const r=this.media,i=r?r.currentTime:null;if(i===null||!k(i)||(this.log(`Media seeked to ${i.toFixed(3)}`),!this.getBufferedFrag(i)))return;const s=this.getFwdBufferInfoAtPos(r,i,ce.MAIN,0);if(s===null||s.len===0){this.warn(`Main forward buffer length at ${i} on "seeked" event ${s?s.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:n,hls:r}=this;if(this.stopLoad(),this.setInterval(Xc),this.level=-1,!this.startFragRequested){let i=r.startLevel;i===-1&&(r.config.testBandwidth&&this.levels.length>1?(i=0,this.bitrateTest=!0):i=r.firstAutoLevel),r.nextLoadLevel=i,this.level=r.loadLevel,this._hasEnoughToStart=!!t}n>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=ft.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=ft.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case ft.WAITING_LEVEL:{const{levels:t,level:n}=this,r=t==null?void 0:t[n],i=r==null?void 0:r.details;if(i&&(!i.live||this.levelLastLoaded===r&&!this.waitForLive(r))){if(this.waitForCdnTuneIn(i))break;this.state=ft.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=ft.IDLE;break}break}case ft.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:r,level:i}=this,s=r==null?void 0:r[i];this.resetStartWhenNotLoaded(s||null),this.state=ft.IDLE}}break}this.state===ft.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:r}=this;if(t===null||!r&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const i=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[i]))return;const s=n[i],l=this.getMainFwdBufferInfo();if(l===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(l,c)){const G={};this.altAudio===2&&(G.type="video"),this.hls.trigger(p.BUFFER_EOS,G),this.state=ft.ENDED;return}if(!this.buffering)return;e.loadLevel!==i&&e.manualLevel===-1&&this.log(`Adapting to level ${i} from level ${this.level}`),this.level=e.nextLoadLevel=i;const u=s.details;if(!u||this.state===ft.WAITING_LEVEL||this.waitForLive(s)){this.level=i,this.state=ft.WAITING_LEVEL,this.startFragRequested=!1;return}const f=l.len,d=this.getMaxBufferLength(s.maxBitrate);if(f>=d)return;this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);const _=this.backtrackFragment?this.backtrackFragment.start:l.end;let b=this.getNextFragment(_,u);if(this.couldBacktrack&&!this.fragPrevious&&b&&ie(b)&&this.fragmentTracker.getState(b)!==Bn.OK){var E;const N=((E=this.backtrackFragment)!=null?E:b).sn-u.startSN,le=u.fragments[N-1];le&&b.cc===le.cc&&(b=le,this.fragmentTracker.removeFragment(le))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(b&&this.isLoopLoading(b,_)){if(!b.gap){const N=this.audioOnly&&!this.altAudio?g.AUDIO:g.VIDEO,le=(N===g.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;le&&this.afterBufferFlushed(le,N,ce.MAIN)}b=this.getNextFragmentLoopLoading(b,u,l,ce.MAIN,d)}b&&(b.initSegment&&!b.initSegment.data&&!this.bitrateTest&&(b=b.initSegment),this.loadFragment(b,s,_))}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);r===Bn.NOT_LOADED||r===Bn.PARTIAL?ie(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,n):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,ce.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let n;const r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);const i=this.getLevelDetails();if(i!=null&&i.live){const l=this.getMainFwdBufferInfo();if(!l||l.len<i.targetduration*2)return}if(!t.paused&&e){const l=this.hls.nextLoadLevel,c=e[l],u=this.fragLastKbps;u&&this.fragCurrent?n=this.fragCurrent.duration*c.maxBitrate/(1e3*u)+1:n=0}else n=0;const s=this.getBufferedFrag(t.currentTime+n);if(s){const l=this.followingBufferedFrag(s);if(l){this.abortCurrentFrag();const c=l.maxStartPTS?l.maxStartPTS:l.start,u=l.duration,f=Math.max(s.end,c+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,u*(this.couldBacktrack?.5:.125)),u*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(f,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case ft.KEY_LOADING:case ft.FRAG_LOADING:case ft.FRAG_LOADING_WAITING_RETRY:case ft.PARSING:case ft.PARSED:this.state=ft.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;ci(n,"playing",this.onMediaPlaying),ci(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(gi(n,"playing",this.onMediaPlaying),gi(n,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(p.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let n=!1,r=!1;t.levels.forEach(i=>{const s=i.audioCodec;s&&(n=n||s.indexOf("mp4a.40.2")!==-1,r=r||s.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=n&&r&&!Yc(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:n}=this;if(!n||this.state!==ft.IDLE)return;const r=t.levelInfo;(!r.details||r.details.live&&(this.levelLastLoaded!==r||r.details.expired)||this.waitForCdnTuneIn(r.details))&&(this.state=ft.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:r,startFragRequested:i}=this,s=t.level,l=t.details,c=l.totalduration;if(!r){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${l.startSN},${l.endSN}]${l.lastPartSn?`[part-${l.lastPartSn}-${l.lastPartIndex}]`:""}, cc [${l.startCC}, ${l.endCC}] duration:${c}`);const u=t.levelInfo,f=this.fragCurrent;f&&(this.state===ft.FRAG_LOADING||this.state===ft.FRAG_LOADING_WAITING_RETRY)&&f.level!==t.level&&f.loader&&this.abortCurrentFrag();let d=0;if(l.live||(n=u.details)!=null&&n.live){var _;if(this.checkLiveUpdate(l),l.deltaUpdateFailed)return;d=this.alignPlaylists(l,u.details,(_=this.levelLastLoaded)==null?void 0:_.details)}if(u.details=l,this.levelLastLoaded=u,i||this.setStartPosition(l,d),this.hls.trigger(p.LEVEL_UPDATED,{details:l,level:s}),this.state===ft.WAITING_LEVEL){if(this.waitForCdnTuneIn(l))return;this.state=ft.IDLE}i&&l.live&&this.synchronizeToLiveEdge(l),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const r=this.hls.liveSyncPosition,i=this.getLoadPosition(),s=e.fragmentStart,l=e.edge,c=i>=s-t.maxFragLookUpTolerance&&i<=l;if(r!==null&&n.duration>r&&(i<r||!c)){const f=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!c&&n.readyState<4||i<l-f)&&(this._hasEnoughToStart||(this.nextLoadPosition=r),n.readyState))if(this.warn(`Playback: ${i.toFixed(3)} is located too far from the end of live sliding playlist: ${l}, reset currentTime to : ${r.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var u;const d=tn.bufferInfo(n,r,0);if(!(d!=null&&(u=d.buffered)!=null&&u.length)){n.currentTime=r;return}if(d.start<=i){n.currentTime=r;return}const{nextStart:b}=tn.bufferedInfo(d.buffered,i,0);b&&(n.currentTime=b)}else n.currentTime=r}}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:r,payload:i}=e,{levels:s}=this;if(!s){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const l=s[n.level];if(!l){this.warn(`Level ${n.level} not found on progress`);return}const c=l.details;if(!c){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const u=l.videoCodec,f=c.PTSKnown||!c.live,d=(t=n.initSegment)==null?void 0:t.data,_=this._getAudioCodec(l),b=this.transmuxer=this.transmuxer||new Xa(this.hls,ce.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),E=r?r.index:-1,G=E!==-1,N=new bn(n.level,n.sn,n.stats.chunkCount,i.byteLength,E,G),le=this.initPTS[n.cc];b.push(i,d,_,u,n,r,c.totalduration,f,N,le)}onAudioTrackSwitching(e,t){const n=this.hls,r=this.altAudio===2;if(wt(t.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const s=this.fragCurrent;s&&(this.log("Switching to main audio track, cancel main fragment load"),s.abortRequests(),this.fragmentTracker.removeFragment(s)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(r){this.fragmentTracker.removeAllFragments(),n.once(p.BUFFER_FLUSHED,()=>{var s;(s=this.hls)==null||s.trigger(p.AUDIO_TRACK_SWITCHED,t)}),n.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}n.trigger(p.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=wt(t.url,this.hls);if(n){const r=this.videoBuffer;r&&this.mediaBuffer!==r&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){const n=t.tracks;let r,i,s=!1;for(const l in n){const c=n[l];if(c.id==="main"){if(i=l,r=c,l==="video"){const u=n[l];u&&(this.videoBuffer=u.buffer)}}else s=!0}s&&r?(this.log(`Alternate track found, use ${i}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:r}=t,i=n.type===ce.MAIN;if(i){if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===ft.PARSED&&(this.state=ft.IDLE);return}const l=r?r.stats:n.stats;this.fragLastKbps=Math.round(8*l.total/(l.buffering.end-l.loading.first)),ie(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,r)}const s=this.media;s&&(!this._hasEnoughToStart&&tn.getBuffered(s).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),i&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var n;if(t.fatal){this.state=ft.ERROR;return}switch(t.details){case $.FRAG_GAP:case $.FRAG_PARSING_ERROR:case $.FRAG_DECRYPT_ERROR:case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ce.MAIN,t);break;case $.LEVEL_LOAD_ERROR:case $.LEVEL_LOAD_TIMEOUT:case $.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===ft.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===me.LEVEL&&(this.state=ft.IDLE);break;case $.BUFFER_ADD_CODEC_ERROR:case $.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.resetLoadingState();break;case $.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case $.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=ft.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==g.AUDIO||!this.altAudio){const n=(t===g.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;n&&(this.afterBufferFlushed(n,t,ce.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}const r=this.timelineOffset;r&&n&&(n+=r);const i=this.getLevelDetails(),s=tn.getBuffered(e),l=s.length?s.start(0):0,c=l-n,u=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||c>0&&(c<u||this.loadingParts&&c<2*((i==null?void 0:i.partTarget)||0)))&&(this.log(`adjusting start position by ${c} to match buffer start`),n+=c,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${l}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(n=>{const{hls:r}=this,i=n==null?void 0:n.frag;if(!i||this.fragContextChanged(i))return;t.fragmentError=0,this.state=ft.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=i.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),r.trigger(p.FRAG_LOADED,n),i.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const n=this.playlistType,{hls:r}=this,{remuxResult:i,chunkMeta:s}=e,l=this.getCurrentContext(s);if(!l){this.resetWhenMissingContext(s);return}const{frag:c,part:u,level:f}=l,{video:d,text:_,id3:b,initSegment:E}=i,{details:G}=f,N=this.altAudio?void 0:i.audio;if(this.fragContextChanged(c)){this.fragmentTracker.removeFragment(c);return}if(this.state=ft.PARSING,E){if(E!=null&&E.tracks){const Ee=c.initSegment||c;this._bufferInitSegment(f,E.tracks,Ee,s),r.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:Ee,id:n,tracks:E.tracks})}const le=E.initPTS,ke=E.timescale;k(le)&&(this.initPTS[c.cc]={baseTime:le,timescale:ke},r.trigger(p.INIT_PTS_FOUND,{frag:c,id:n,initPTS:le,timescale:ke}))}if(d&&G){N&&d.type==="audiovideo"&&this.logMuxedErr(c);const le=G.fragments[c.sn-1-G.startSN],ke=c.sn===G.startSN,Ee=!le||c.cc>le.cc;if(i.independent!==!1){const{startPTS:Ke,endPTS:We,startDTS:gt,endDTS:Xe}=d;if(u)u.elementaryStreams[d.type]={startPTS:Ke,endPTS:We,startDTS:gt,endDTS:Xe};else if(d.firstKeyFrame&&d.independent&&s.id===1&&!Ee&&(this.couldBacktrack=!0),d.dropped&&d.independent){const st=this.getMainFwdBufferInfo(),ht=(st?st.end:this.getLoadPosition())+this.config.maxBufferHole,Je=d.firstKeyFramePTS?d.firstKeyFramePTS:Ke;if(!ke&&ht<Je-this.config.maxBufferHole&&!Ee){this.backtrack(c);return}else Ee&&(c.gap=!0);c.setElementaryStreamInfo(d.type,c.start,We,c.start,Xe,!0)}else ke&&Ke-(G.appliedTimelineOffset||0)>$s&&(c.gap=!0);c.setElementaryStreamInfo(d.type,Ke,We,gt,Xe),this.backtrackFragment&&(this.backtrackFragment=c),this.bufferFragmentData(d,c,u,s,ke||Ee)}else if(ke||Ee)c.gap=!0;else{this.backtrack(c);return}}if(N){const{startPTS:le,endPTS:ke,startDTS:Ee,endDTS:Ke}=N;u&&(u.elementaryStreams[g.AUDIO]={startPTS:le,endPTS:ke,startDTS:Ee,endDTS:Ke}),c.setElementaryStreamInfo(g.AUDIO,le,ke,Ee,Ke),this.bufferFragmentData(N,c,u,s)}if(G&&b!=null&&(t=b.samples)!=null&&t.length){const le={id:n,frag:c,details:G,samples:b.samples};r.trigger(p.FRAG_PARSING_METADATA,le)}if(G&&_){const le={id:n,frag:c,details:G,samples:_.samples};r.trigger(p.FRAG_PARSING_USERDATA,le)}}logMuxedErr(e){this.warn(`${ie(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,r){if(this.state!==ft.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));const{audio:i,video:s,audiovideo:l}=t;if(i){let u=it(i.codec,e.audioCodec);u==="mp4a"&&(u="mp4a.40.5");const f=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){u&&(u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5");const d=i.metadata;d&&"channelCount"in d&&(d.channelCount||1)!==1&&f.indexOf("firefox")===-1&&(u="mp4a.40.5")}u&&u.indexOf("mp4a.40.5")!==-1&&f.indexOf("android")!==-1&&i.container!=="audio/mpeg"&&(u="mp4a.40.2",this.log(`Android: force audio codec to ${u}`)),e.audioCodec&&e.audioCodec!==u&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${u}"`),i.levelCodec=u,i.id=ce.MAIN,this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${u||""}/${e.audioCodec||""}/${i.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=ce.MAIN;const u=s.codec;if((u==null?void 0:u.length)===4)switch(u){case"hvc1":case"hev1":s.codec="hvc1.1.6.L120.90";break;case"av01":s.codec="av01.0.04M.08";break;case"avc1":s.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${u}]${s.codec!==u?" parsed-corrected="+s.codec:""}${s.supplemental?" supplemental="+s.supplemental:""}`),delete t.audiovideo}l&&(this.log(`Init audiovideo buffer, container:${l.container}, codecs[level/parsed]=[${e.codecs}/${l.codec}]`),delete t.video,delete t.audio);const c=Object.keys(t);if(c.length){if(this.hls.trigger(p.BUFFER_CODECS,t),!this.hls)return;c.forEach(u=>{const d=t[u].initSegment;d!=null&&d.byteLength&&this.hls.trigger(p.BUFFER_APPENDING,{type:u,data:d,frag:n,part:null,chunkMeta:r,parent:n.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,ce.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,n=e==null?void 0:e[t];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=ft.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(tn.isBuffered(e,n)?t=this.getAppendedFrag(n):tn.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const r=this.fragPlaying,i=t.level;(!r||t.sn!==r.sn||r.level!==i)&&(this.fragPlaying=t,this.hls.trigger(p.FRAG_CHANGED,{frag:t}),(!r||r.level!==i)&&this.hls.trigger(p.LEVEL_SWITCHED,{level:i}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return k(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(k(t)){const n=this.getLevelDetails(),r=this.currentFrag||(n?kt(null,n.fragments,t):null);if(r){const i=r.programDateTime;if(i!==null){const s=i+(t-r.start)*1e3;return new Date(s)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Jc{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const r=this.keyUriToKeyInfo[n].loader;if(r){var t;if(e&&e!==((t=r.context)==null?void 0:t.frag.type))return;r.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=$.KEY_LOAD_ERROR,n,r,i){return new kn({type:fe.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:n,networkDetails:r})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length){const{sn:n,cc:r}=e;for(let i=0;i<t.length;i++){const s=t[i];if(r<=s.cc&&(n==="initSegment"||s.sn==="initSegment"||n<s.sn))return this.emeController.selectKeySystemFormat(s).then(l=>{if(s.setKeyFormat(l),this.emeController&&this.config.requireKeySystemAccessOnStart){const c=Sn(l);if(c)return this.emeController.getKeySystemAccess([c])}})}}else if(this.config.requireKeySystemAccessOnStart){const n=ur(this.config);if(n.length)return this.emeController.getKeySystemAccess(n)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,r;t&&e.setKeyFormat(t);const i=e.decryptdata;if(!i){const u=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,u))}const s=i.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let l=this.keyUriToKeyInfo[s];if((n=l)!=null&&n.decryptdata.key)return i.key=l.decryptdata.key,Promise.resolve({frag:e,keyInfo:l});if((r=l)!=null&&r.keyLoadPromise){var c;switch((c=l.mediaKeySessionContext)==null?void 0:c.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return l.keyLoadPromise.then(u=>(i.key=u.keyInfo.decryptdata.key,{frag:e,keyInfo:l}))}}switch(l=this.keyUriToKeyInfo[s]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return i.keyFormat==="identity"?this.loadKeyHTTP(l,e):this.loadKeyEME(l,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(l,e);default:return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${i.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const r=this.emeController.loadKey(n);if(r)return(e.keyLoadPromise=r.then(i=>(e.mediaKeySessionContext=i,n))).catch(i=>{throw e.keyLoadPromise=null,i})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,r=n.loader,i=new r(n);return t.keyLoader=e.loader=i,e.keyLoadPromise=new Promise((s,l)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},u=n.keyLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(_,b,E,G)=>{const{frag:N,keyInfo:le,url:ke}=E;if(!N.decryptdata||le!==this.keyUriToKeyInfo[ke])return l(this.createKeyLoadError(N,$.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),G));le.decryptdata.key=N.decryptdata.key=new Uint8Array(_.data),N.keyLoader=null,le.loader=null,s({frag:N,keyInfo:le})},onError:(_,b,E,G)=>{this.resetLoader(b),l(this.createKeyLoadError(t,$.KEY_LOAD_ERROR,new Error(`HTTP Error ${_.code} loading key ${_.text}`),E,y({url:c.url,data:void 0},_)))},onTimeout:(_,b,E)=>{this.resetLoader(b),l(this.createKeyLoadError(t,$.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),E))},onAbort:(_,b,E)=>{this.resetLoader(b),l(this.createKeyLoadError(t,$.INTERNAL_ABORTED,new Error("key loading aborted"),E))}};i.load(c,f,d)})}resetLoader(e){const{frag:t,keyInfo:n,url:r}=e,i=n.loader;t.keyLoader===i&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[r],i&&i.destroy()}}function Go(a){const{type:e}=a;switch(e){case me.AUDIO_TRACK:return ce.AUDIO;case me.SUBTITLE_TRACK:return ce.SUBTITLE;default:return ce.MAIN}}function xa(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class qc{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,r=t.loader,i=n||r,s=new i(t);return this.loaders[e.type]=s,s}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:me.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:r,pathwayId:i,url:s,deliveryDirectives:l,levelInfo:c}=t;this.load({id:n,level:r,pathwayId:i,responseType:"text",type:me.LEVEL,url:s,deliveryDirectives:l,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:n,groupId:r,url:i,deliveryDirectives:s,track:l}=t;this.load({id:n,groupId:r,level:null,responseType:"text",type:me.AUDIO_TRACK,url:i,deliveryDirectives:s,levelOrTrack:l})}onSubtitleTrackLoading(e,t){const{id:n,groupId:r,url:i,deliveryDirectives:s,track:l}=t;this.load({id:n,groupId:r,level:null,responseType:"text",type:me.SUBTITLE_TRACK,url:i,deliveryDirectives:s,levelOrTrack:l})}onLevelsUpdated(e,t){const n=this.loaders[me.LEVEL];if(n){const r=n.context;r&&!t.levels.some(i=>i===r.levelOrTrack)&&(n.abort(),delete this.loaders[me.LEVEL])}}load(e){var t;const n=this.hls.config;let r=this.getInternalLoader(e);if(r){const u=this.hls.logger,f=r.context;if(f&&f.levelOrTrack===e.levelOrTrack&&(f.url===e.url||f.deliveryDirectives&&!e.deliveryDirectives)){f.url===e.url?u.log(`[playlist-loader]: ignore ${e.url} ongoing request`):u.log(`[playlist-loader]: ignore ${e.url} in favor of ${f.url}`);return}u.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),r.abort()}let i;if(e.type===me.MANIFEST?i=n.manifestLoadPolicy.default:i=h({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),r=this.createInternalLoader(e),k((t=e.deliveryDirectives)==null?void 0:t.part)){let u;if(e.type===me.LEVEL&&e.level!==null?u=this.hls.levels[e.level].details:e.type===me.AUDIO_TRACK&&e.id!==null?u=this.hls.audioTracks[e.id].details:e.type===me.SUBTITLE_TRACK&&e.id!==null&&(u=this.hls.subtitleTracks[e.id].details),u){const f=u.partTarget,d=u.targetduration;if(f&&d){const _=Math.max(f*3,d*.8)*1e3;i=h({},i,{maxTimeToFirstByteMs:Math.min(_,i.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(_,i.maxTimeToFirstByteMs)})}}}const s=i.errorRetry||i.timeoutRetry||{},l={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},c={onSuccess:(u,f,d,_)=>{const b=this.getInternalLoader(d);this.resetInternalLoader(d.type);const E=u.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,d,new Error("no EXTM3U delimiter"),_||null,f);return}f.parsing.start=performance.now(),ni.isMediaPlaylist(E)||d.type!==me.MANIFEST?this.handleTrackOrLevelPlaylist(u,f,d,_||null,b):this.handleMasterPlaylist(u,f,d,_)},onError:(u,f,d,_)=>{this.handleNetworkError(f,d,!1,u,_)},onTimeout:(u,f,d)=>{this.handleNetworkError(f,d,!0,void 0,u)}};r.load(e,l,c)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,r){const i=this.hls,s=e.data,l=xa(e,n),c=ni.parseMasterPlaylist(s,l);if(c.playlistParsingError){this.handleManifestParsingError(e,n,c.playlistParsingError,r,t);return}const{contentSteering:u,levels:f,sessionData:d,sessionKeys:_,startTimeOffset:b,variableList:E}=c;this.variableList=E;const{AUDIO:G=[],SUBTITLES:N,"CLOSED-CAPTIONS":le}=ni.parseMasterPlaylistMedia(s,l,c);G.length&&!G.some(Ee=>!Ee.url)&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),G.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Kn({}),bitrate:0,url:""})),i.trigger(p.MANIFEST_LOADED,{levels:f,audioTracks:G,subtitles:N,captions:le,contentSteering:u,url:l,stats:t,networkDetails:r,sessionData:d,sessionKeys:_,startTimeOffset:b,variableList:E})}handleTrackOrLevelPlaylist(e,t,n,r,i){const s=this.hls,{id:l,level:c,type:u}=n,f=xa(e,n),d=k(c)?c:k(l)?l:0,_=Go(n),b=ni.parseLevelPlaylist(e.data,f,d,_,0,this.variableList);if(u===me.MANIFEST){const E={attrs:new Kn({}),bitrate:0,details:b,name:"",url:f};b.requestScheduled=t.loading.start+Kr(b,0),s.trigger(p.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:f,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=b,this.handlePlaylistLoaded(b,e,t,n,r,i)}handleManifestParsingError(e,t,n,r,i){this.hls.trigger(p.ERROR,{type:fe.NETWORK_ERROR,details:$.MANIFEST_PARSING_ERROR,fatal:t.type===me.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:r,stats:i})}handleNetworkError(e,t,n=!1,r,i){let s=`A network ${n?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${e.type}`;e.type===me.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===me.AUDIO_TRACK||e.type===me.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const l=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let c=$.UNKNOWN,u=!1;const f=this.getInternalLoader(e);switch(e.type){case me.MANIFEST:c=n?$.MANIFEST_LOAD_TIMEOUT:$.MANIFEST_LOAD_ERROR,u=!0;break;case me.LEVEL:c=n?$.LEVEL_LOAD_TIMEOUT:$.LEVEL_LOAD_ERROR,u=!1;break;case me.AUDIO_TRACK:c=n?$.AUDIO_TRACK_LOAD_TIMEOUT:$.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case me.SUBTITLE_TRACK:c=n?$.SUBTITLE_TRACK_LOAD_TIMEOUT:$.SUBTITLE_LOAD_ERROR,u=!1;break}f&&this.resetInternalLoader(e.type);const d={type:fe.NETWORK_ERROR,details:c,fatal:u,url:e.url,loader:f,context:e,error:l,networkDetails:t,stats:i};if(r){const _=(t==null?void 0:t.url)||e.url;d.response=y({url:_,data:void 0},r)}this.hls.trigger(p.ERROR,d)}handlePlaylistLoaded(e,t,n,r,i,s){const l=this.hls,{type:c,level:u,id:f,groupId:d,deliveryDirectives:_}=r,b=xa(t,r),E=Go(r),G=typeof r.level=="number"&&E===ce.MAIN?u:void 0;if(!e.fragments.length){const le=e.playlistParsingError=new Error("No Segments found in Playlist");l.trigger(p.ERROR,{type:fe.NETWORK_ERROR,details:$.LEVEL_EMPTY_ERROR,fatal:!1,url:b,error:le,reason:le.message,response:t,context:r,level:G,parent:E,networkDetails:i,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const N=e.playlistParsingError;if(N){if(this.hls.logger.warn(N),!l.config.ignorePlaylistParsingErrors){l.trigger(p.ERROR,{type:fe.NETWORK_ERROR,details:$.LEVEL_PARSING_ERROR,fatal:!1,url:b,error:N,reason:N.message,response:t,context:r,level:G,parent:E,networkDetails:i,stats:n});return}e.playlistParsingError=null}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case me.MANIFEST:case me.LEVEL:l.trigger(p.LEVEL_LOADED,{details:e,levelInfo:r.levelOrTrack||l.levels[0],level:G||0,id:f||0,stats:n,networkDetails:i,deliveryDirectives:_,withoutMultiVariant:c===me.MANIFEST});break;case me.AUDIO_TRACK:l.trigger(p.AUDIO_TRACK_LOADED,{details:e,track:r.levelOrTrack,id:f||0,groupId:d||"",stats:n,networkDetails:i,deliveryDirectives:_});break;case me.SUBTITLE_TRACK:l.trigger(p.SUBTITLE_TRACK_LOADED,{details:e,track:r.levelOrTrack,id:f||0,groupId:d||"",stats:n,networkDetails:i,deliveryDirectives:_});break}}}class Ki{static get version(){return Ci}static isMSESupported(){return Zo()}static isSupported(){return jc()}static getMediaSource(){return he()}static get Events(){return p}static get MetadataSchema(){return ui}static get ErrorTypes(){return fe}static get ErrorDetails(){return $}static get DefaultConfig(){return Ki.defaultConfig?Ki.defaultConfig:Mc}static set DefaultConfig(e){Ki.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 Ri,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=ae(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=Nc(Ki.DefaultConfig,e,t);this.userConfig=e,n.progressive&&Bc(n,t);const{abrController:r,bufferController:i,capLevelController:s,errorController:l,fpsController:c}=n,u=new l(this),f=this.abrController=new r(this),d=new Hn(this),_=n.interstitialsController,b=_?this.interstitialsController=new _(this,Ki):null,E=this.bufferController=new i(this,d),G=this.capLevelController=new s(this),N=new c(this),le=new qc(this),ke=n.contentSteeringController,Ee=ke?new ke(this):null,Ke=this.levelController=new Hc(this,Ee),We=new zc(this),gt=new Jc(this.config),Xe=this.streamController=new Qc(this,d,gt),st=this.gapController=new Zc(this,d);G.setStreamController(Xe),N.setStreamController(Xe);const ht=[le,Ke,Xe];b&&ht.splice(1,0,b),Ee&&ht.splice(1,0,Ee),this.networkControllers=ht;const Je=[f,E,st,G,N,We,d];this.audioTrackController=this.createController(n.audioTrackController,ht);const Kt=n.audioStreamController;Kt&&ht.push(this.audioStreamController=new Kt(this,d,gt)),this.subtitleTrackController=this.createController(n.subtitleTrackController,ht);const dn=n.subtitleStreamController;dn&&ht.push(this.subtititleStreamController=new dn(this,d,gt)),this.createController(n.timelineController,Je),gt.emeController=this.emeController=this.createController(n.emeController,Je),this.cmcdController=this.createController(n.cmcdController,Je),this.latencyController=this.createController(Wc,Je),this.coreComponents=Je,ht.push(u);const zn=u.onErrorOut;typeof zn=="function"&&this.on(p.ERROR,zn,u),this.on(p.MANIFEST_LOADED,le.onManifestLoaded,le)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,r){this._emitter.off(e,t,n,r)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const r=e===p.ERROR;this.trigger(p.ERROR,{type:fe.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,fatal:r,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(p.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const i=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(p.ERROR,{type:fe.OTHER_ERROR,details:$.ATTACH_MEDIA_ERROR,fatal:!0,error:i});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,n=t?e.media:e,r=t?e:{media:n};this._media=n,this.trigger(p.MEDIA_ATTACHING,r)}detachMedia(){this.logger.log("detachMedia"),this.trigger(p.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(p.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,r=this._url=J.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${r}`),t&&n&&(n!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(p.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),!(!this.started||!this.networkControllers));n++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[ce.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[ce.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[ce.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=e==null?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=Zu()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Tn(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let r=0;r<n;r++)if(e[r].maxBitrate>=t)return r;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let r;if(t===-1&&e!=null&&e.length?r=e.length-1:r=t,n)for(let i=r;i--;){const s=e[i].attrs["HDCP-LEVEL"];if(s&&s<=n)return i}return r}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const n=Xt(t);return Mn(e,n,navigator.mediaCapabilities)}}Ki.defaultConfig=void 0},16722:function(vn,Et,A){"use strict";A.d(Et,{Z:function(){return ce}});const k=o=>typeof o=="object"&&o!=null&&o.nodeType===1,pe=(o,x)=>(!x||o!=="hidden")&&o!=="visible"&&o!=="clip",Te=(o,x)=>{if(o.clientHeight<o.scrollHeight||o.clientWidth<o.scrollWidth){const D=getComputedStyle(o,null);return pe(D.overflowY,x)||pe(D.overflowX,x)||(h=>{const m=(y=>{if(!y.ownerDocument||!y.ownerDocument.defaultView)return null;try{return y.ownerDocument.defaultView.frameElement}catch(S){return null}})(h);return!!m&&(m.clientHeight<h.scrollHeight||m.clientWidth<h.scrollWidth)})(o)}return!1},fe=(o,x,D,h,m,y,S,M)=>y<o&&S>x||y>o&&S<x?0:y<=o&&M<=D||S>=x&&M>=D?y-o-h:S>x&&M<D||y<o&&M>D?S-x+m:0,$=o=>{const x=o.parentElement;return x==null?o.getRootNode().host||null:x},p=(o,x)=>{var D,h,m,y;if(typeof document=="undefined")return[];const{scrollMode:S,block:M,inline:z,boundary:Y,skipOverflowHiddenElements:L}=x,O=typeof Y=="function"?Y:Ze=>Ze!==Y;if(!k(o))throw new TypeError("Invalid target");const T=document.scrollingElement||document.documentElement,R=[];let se=o;for(;k(se)&&O(se);){if(se=$(se),se===T){R.push(se);break}se!=null&&se===document.body&&Te(se)&&!Te(document.documentElement)||se!=null&&Te(se,L)&&R.push(se)}const ae=(h=(D=window.visualViewport)==null?void 0:D.width)!=null?h:innerWidth,q=(y=(m=window.visualViewport)==null?void 0:m.height)!=null?y:innerHeight,{scrollX:he,scrollY:ve}=window,{height:be,width:Oe,top:Q,right:P,bottom:j,left:X}=o.getBoundingClientRect(),{top:ne,right:J,bottom:v,left:g}=(Ze=>{const Qe=window.getComputedStyle(Ze);return{top:parseFloat(Qe.scrollMarginTop)||0,right:parseFloat(Qe.scrollMarginRight)||0,bottom:parseFloat(Qe.scrollMarginBottom)||0,left:parseFloat(Qe.scrollMarginLeft)||0}})(o);let U=M==="start"||M==="nearest"?Q-ne:M==="end"?j+v:Q+be/2-ne+v,ie=z==="center"?X+Oe/2-g+J:z==="end"?P+J:X-g;const Be=[];for(let Ze=0;Ze<R.length;Ze++){const Qe=R[Ze],{height:nt,width:At,top:_t,right:xe,bottom:vt,left:zt}=Qe.getBoundingClientRect();if(S==="if-needed"&&Q>=0&&X>=0&&j<=q&&P<=ae&&(Qe===T&&!Te(Qe)||Q>=_t&&j<=vt&&X>=zt&&P<=xe))return Be;const Ct=getComputedStyle(Qe),nn=parseInt(Ct.borderLeftWidth,10),qe=parseInt(Ct.borderTopWidth,10),Re=parseInt(Ct.borderRightWidth,10),we=parseInt(Ct.borderBottomWidth,10);let K=0,Se=0;const Ne="offsetWidth"in Qe?Qe.offsetWidth-Qe.clientWidth-nn-Re:0,V="offsetHeight"in Qe?Qe.offsetHeight-Qe.clientHeight-qe-we:0,I="offsetWidth"in Qe?Qe.offsetWidth===0?0:At/Qe.offsetWidth:0,F="offsetHeight"in Qe?Qe.offsetHeight===0?0:nt/Qe.offsetHeight:0;if(T===Qe)K=M==="start"?U:M==="end"?U-q:M==="nearest"?fe(ve,ve+q,q,qe,we,ve+U,ve+U+be,be):U-q/2,Se=z==="start"?ie:z==="center"?ie-ae/2:z==="end"?ie-ae:fe(he,he+ae,ae,nn,Re,he+ie,he+ie+Oe,Oe),K=Math.max(0,K+ve),Se=Math.max(0,Se+he);else{K=M==="start"?U-_t-qe:M==="end"?U-vt+we+V:M==="nearest"?fe(_t,vt,nt,qe,we+V,U,U+be,be):U-(_t+nt/2)+V/2,Se=z==="start"?ie-zt-nn:z==="center"?ie-(zt+At/2)+Ne/2:z==="end"?ie-xe+Re+Ne:fe(zt,xe,At,nn,Re+Ne,ie,ie+Oe,Oe);const{scrollLeft:oe,scrollTop:w}=Qe;K=F===0?0:Math.max(0,Math.min(w+K/F,Qe.scrollHeight-nt/F+V)),Se=I===0?0:Math.max(0,Math.min(oe+Se/I,Qe.scrollWidth-At/I+Ne)),U+=w-K,ie+=oe-Se}Be.push({el:Qe,top:K,left:Se})}return Be},me=o=>o===!1?{block:"end",inline:"nearest"}:(x=>x===Object(x)&&Object.keys(x).length!==0)(o)?o:{block:"start",inline:"nearest"};function ce(o,x){if(!o.isConnected||!(m=>{let y=m;for(;y&&y.parentNode;){if(y.parentNode===document)return!0;y=y.parentNode instanceof ShadowRoot?y.parentNode.host:y.parentNode}return!1})(o))return;const D=(m=>{const y=window.getComputedStyle(m);return{top:parseFloat(y.scrollMarginTop)||0,right:parseFloat(y.scrollMarginRight)||0,bottom:parseFloat(y.scrollMarginBottom)||0,left:parseFloat(y.scrollMarginLeft)||0}})(o);if((m=>typeof m=="object"&&typeof m.behavior=="function")(x))return x.behavior(p(o,x));const h=typeof x=="boolean"||x==null?void 0:x.behavior;for(const{el:m,top:y,left:S}of p(o,me(x))){const M=y-D.top+D.bottom,z=S-D.left+D.right;m.scroll({top:M,left:z,behavior:h})}}}}]);
}());