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.
159 lines
1.2 MiB
159 lines
1.2 MiB
!(function(){var Sl=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[6444],{70557:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return ne}});var x=S(60499),de=S(59301),me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},ue=me,G=S(7657),p=function(K,P){return de.createElement(G.Z,(0,x.Z)({},K,{ref:P,icon:ue}))},se=de.forwardRef(p),ne=se},18785:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return ne}});var x=S(60499),de=S(59301),me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},ue=me,G=S(7657),p=function(K,P){return de.createElement(G.Z,(0,x.Z)({},K,{ref:P,icon:ue}))},se=de.forwardRef(p),ne=se},52671:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return ne}});var x=S(60499),de=S(59301),me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},ue=me,G=S(7657),p=function(K,P){return de.createElement(G.Z,(0,x.Z)({},K,{ref:P,icon:ue}))},se=de.forwardRef(p),ne=se},8657:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return ne}});var x=S(60499),de=S(59301),me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},ue=me,G=S(7657),p=function(K,P){return de.createElement(G.Z,(0,x.Z)({},K,{ref:P,icon:ue}))},se=de.forwardRef(p),ne=se},56082:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return ne}});var x=S(60499),de=S(59301),me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},ue=me,G=S(7657),p=function(K,P){return de.createElement(G.Z,(0,x.Z)({},K,{ref:P,icon:ue}))},se=de.forwardRef(p),ne=se},33853:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return ne}});var x=S(60499),de=S(59301),me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},ue=me,G=S(7657),p=function(K,P){return de.createElement(G.Z,(0,x.Z)({},K,{ref:P,icon:ue}))},se=de.forwardRef(p),ne=se},15075:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return ne}});var x=S(60499),de=S(59301),me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},ue=me,G=S(7657),p=function(K,P){return de.createElement(G.Z,(0,x.Z)({},K,{ref:P,icon:ue}))},se=de.forwardRef(p),ne=se},43531:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return ne}});var x=S(60499),de=S(59301),me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},ue=me,G=S(7657),p=function(K,P){return de.createElement(G.Z,(0,x.Z)({},K,{ref:P,icon:ue}))},se=de.forwardRef(p),ne=se},68196:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return De}});var x=S(85899),de=S(72190),me=S(42244),ue=S(43403),G=S(92310),p=S.n(G),se=S(29301),ne=S(76846),l=S(96452),K=S(6089),P=S(80402),m=S(34280),_=S(49658),E=S(59301),w=S(60499),F=S(77900),k=S(8654);function N(ve){var Le=ve.prefixCls,re=ve.align,Re=ve.arrow,fe=ve.arrowPos,B=Re||{},A=B.className,U=B.content,X=fe.x,W=X===void 0?0:X,$=fe.y,ee=$===void 0?0:$,le=E.useRef();if(!re||!re.points)return null;var ge={position:"absolute"};if(re.autoArrow!==!1){var we=re.points[0],ze=re.points[1],Ue=we[0],Ye=we[1],Fe=ze[0],Ve=ze[1];Ue===Fe||!["t","b"].includes(Ue)?ge.top=ee:Ue==="t"?ge.top=0:ge.bottom=0,Ye===Ve||!["l","r"].includes(Ye)?ge.left=W:Ye==="l"?ge.left=0:ge.right=0}return E.createElement("div",{ref:le,className:p()("".concat(Le,"-arrow"),A),style:ge},U)}function L(ve){var Le=ve.prefixCls,re=ve.open,Re=ve.zIndex,fe=ve.mask,B=ve.motion;return fe?E.createElement(F.default,(0,w.Z)({},B,{motionAppear:!0,visible:re,removeOnLeave:!0}),function(A){var U=A.className;return E.createElement("div",{style:{zIndex:Re},className:p()("".concat(Le,"-mask"),U)})}):null}var O=E.memo(function(ve){var Le=ve.children;return Le},function(ve,Le){return Le.cache}),D=O,C=E.forwardRef(function(ve,Le){var re=ve.popup,Re=ve.className,fe=ve.prefixCls,B=ve.style,A=ve.target,U=ve.onVisibleChanged,X=ve.open,W=ve.keepDom,$=ve.fresh,ee=ve.onClick,le=ve.mask,ge=ve.arrow,we=ve.arrowPos,ze=ve.align,Ue=ve.motion,Ye=ve.maskMotion,Fe=ve.forceRender,Ve=ve.getPopupContainer,Qe=ve.autoDestroy,Ie=ve.portal,tt=ve.zIndex,Nt=ve.onMouseEnter,Et=ve.onMouseLeave,Rt=ve.onPointerEnter,ht=ve.onPointerDownCapture,qt=ve.ready,Vt=ve.offsetX,bt=ve.offsetY,zt=ve.offsetR,Tt=ve.offsetB,_t=ve.onAlign,Ot=ve.onPrepare,St=ve.stretch,Jt=ve.targetWidth,Pt=ve.targetHeight,xt=typeof re=="function"?re():re,Dt=X||W,un=(Ve==null?void 0:Ve.length)>0,Ft=E.useState(!Ve||!un),Ht=(0,de.Z)(Ft,2),It=Ht[0],rt=Ht[1];if((0,m.Z)(function(){!It&&un&&A&&rt(!0)},[It,un,A]),!It)return null;var d="auto",g={left:"-1000vw",top:"-1000vh",right:d,bottom:d};if(qt||!X){var T,j=ze.points,te=ze.dynamicInset||((T=ze._experimental)===null||T===void 0?void 0:T.dynamicInset),Ee=te&&j[0][1]==="r",Ce=te&&j[0][0]==="b";Ee?(g.right=zt,g.left=d):(g.left=Vt,g.right=d),Ce?(g.bottom=Tt,g.top=d):(g.top=bt,g.bottom=d)}var Xe={};return St&&(St.includes("height")&&Pt?Xe.height=Pt:St.includes("minHeight")&&Pt&&(Xe.minHeight=Pt),St.includes("width")&&Jt?Xe.width=Jt:St.includes("minWidth")&&Jt&&(Xe.minWidth=Jt)),X||(Xe.pointerEvents="none"),E.createElement(Ie,{open:Fe||Dt,getContainer:Ve&&function(){return Ve(A)},autoDestroy:Qe},E.createElement(L,{prefixCls:fe,open:X,zIndex:tt,mask:le,motion:Ye}),E.createElement(se.Z,{onResize:_t,disabled:!X},function(Ze){return E.createElement(F.default,(0,w.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Fe,leavedClassName:"".concat(fe,"-hidden")},Ue,{onAppearPrepare:Ot,onEnterPrepare:Ot,visible:X,onVisibleChanged:function(ft){var Lt;Ue==null||(Lt=Ue.onVisibleChanged)===null||Lt===void 0||Lt.call(Ue,ft),U(ft)}}),function(ut,ft){var Lt=ut.className,vt=ut.style,Kt=p()(fe,Lt,Re);return E.createElement("div",{ref:(0,k.sQ)(Ze,Le,ft),className:Kt,style:(0,x.Z)((0,x.Z)((0,x.Z)((0,x.Z)({"--arrow-x":"".concat(we.x||0,"px"),"--arrow-y":"".concat(we.y||0,"px")},g),Xe),vt),{},{boxSizing:"border-box",zIndex:tt},B),onMouseEnter:Nt,onMouseLeave:Et,onPointerEnter:Rt,onClick:ee,onPointerDownCapture:ht},ge&&E.createElement(N,{prefixCls:fe,arrow:ge,arrowPos:we,align:ze}),E.createElement(D,{cache:!X&&!$},xt))})}))}),Q=C,ce=E.forwardRef(function(ve,Le){var re=ve.children,Re=ve.getTriggerDOMNode,fe=(0,k.Yr)(re),B=E.useCallback(function(U){(0,k.mH)(Le,Re?Re(U):U)},[Re]),A=(0,k.x1)(B,(0,k.C4)(re));return fe?E.cloneElement(re,{ref:A}):re}),ae=ce,Se=E.createContext(null),Ne=Se;function Te(ve){return ve?Array.isArray(ve)?ve:[ve]:[]}function je(ve,Le,re,Re){return E.useMemo(function(){var fe=Te(re!=null?re:Le),B=Te(Re!=null?Re:Le),A=new Set(fe),U=new Set(B);return ve&&(A.has("hover")&&(A.delete("hover"),A.add("click")),U.has("hover")&&(U.delete("hover"),U.add("click"))),[A,U]},[ve,Le,re,Re])}var ie=S(29194);function M(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],re=arguments.length>2?arguments[2]:void 0;return re?ve[0]===Le[0]:ve[0]===Le[0]&&ve[1]===Le[1]}function z(ve,Le,re,Re){for(var fe=re.points,B=Object.keys(ve),A=0;A<B.length;A+=1){var U,X=B[A];if(M((U=ve[X])===null||U===void 0?void 0:U.points,fe,Re))return"".concat(Le,"-placement-").concat(X)}return""}function H(ve,Le,re,Re){return Le||(re?{motionName:"".concat(ve,"-").concat(re)}:Re?{motionName:Re}:null)}function Z(ve){return ve.ownerDocument.defaultView}function Y(ve){for(var Le=[],re=ve==null?void 0:ve.parentElement,Re=["hidden","scroll","clip","auto"];re;){var fe=Z(re).getComputedStyle(re),B=fe.overflowX,A=fe.overflowY,U=fe.overflow;[B,A,U].some(function(X){return Re.includes(X)})&&Le.push(re),re=re.parentElement}return Le}function b(ve){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(ve)?Le:ve}function y(ve){return b(parseFloat(ve),0)}function V(ve,Le){var re=(0,x.Z)({},ve);return(Le||[]).forEach(function(Re){if(!(Re instanceof HTMLBodyElement||Re instanceof HTMLHtmlElement)){var fe=Z(Re).getComputedStyle(Re),B=fe.overflow,A=fe.overflowClipMargin,U=fe.borderTopWidth,X=fe.borderBottomWidth,W=fe.borderLeftWidth,$=fe.borderRightWidth,ee=Re.getBoundingClientRect(),le=Re.offsetHeight,ge=Re.clientHeight,we=Re.offsetWidth,ze=Re.clientWidth,Ue=y(U),Ye=y(X),Fe=y(W),Ve=y($),Qe=b(Math.round(ee.width/we*1e3)/1e3),Ie=b(Math.round(ee.height/le*1e3)/1e3),tt=(we-ze-Fe-Ve)*Qe,Nt=(le-ge-Ue-Ye)*Ie,Et=Ue*Ie,Rt=Ye*Ie,ht=Fe*Qe,qt=Ve*Qe,Vt=0,bt=0;if(B==="clip"){var zt=y(A);Vt=zt*Qe,bt=zt*Ie}var Tt=ee.x+ht-Vt,_t=ee.y+Et-bt,Ot=Tt+ee.width+2*Vt-ht-qt-tt,St=_t+ee.height+2*bt-Et-Rt-Nt;re.left=Math.max(re.left,Tt),re.top=Math.max(re.top,_t),re.right=Math.min(re.right,Ot),re.bottom=Math.min(re.bottom,St)}}),re}function he(ve){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,re="".concat(Le),Re=re.match(/^(.*)\%$/);return Re?ve*(parseFloat(Re[1])/100):parseFloat(re)}function be(ve,Le){var re=Le||[],Re=(0,de.Z)(re,2),fe=Re[0],B=Re[1];return[he(ve.width,fe),he(ve.height,B)]}function Pe(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[ve[0],ve[1]]}function oe(ve,Le){var re=Le[0],Re=Le[1],fe,B;return re==="t"?B=ve.y:re==="b"?B=ve.y+ve.height:B=ve.y+ve.height/2,Re==="l"?fe=ve.x:Re==="r"?fe=ve.x+ve.width:fe=ve.x+ve.width/2,{x:fe,y:B}}function Ae(ve,Le){var re={t:"b",b:"t",l:"r",r:"l"};return ve.map(function(Re,fe){return fe===Le?re[Re]||"c":Re}).join("")}function ke(ve,Le,re,Re,fe,B,A){var U=E.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:fe[Re]||{}}),X=(0,de.Z)(U,2),W=X[0],$=X[1],ee=E.useRef(0),le=E.useMemo(function(){return Le?Y(Le):[]},[Le]),ge=E.useRef({}),we=function(){ge.current={}};ve||we();var ze=(0,K.Z)(function(){if(Le&&re&&ve){let li=function(mi,yi){var Ui=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Bt,Pi=Dt.x+mi,ur=Dt.y+yi,gr=Pi+Ce,ir=ur+Ee,Ir=Math.max(Pi,Ui.left),sn=Math.max(ur,Ui.top),vn=Math.min(gr,Ui.right),jn=Math.min(ir,Ui.bottom);return Math.max(0,(vn-Ir)*(jn-sn))},ti=function(){ii=Dt.y+yn,ei=ii+Ee,Cn=Dt.x+pn,kn=Cn+Ce};var Fe,Ve,Qe,Ie,tt=Le,Nt=tt.ownerDocument,Et=Z(tt),Rt=Et.getComputedStyle(tt),ht=Rt.position,qt=tt.style.left,Vt=tt.style.top,bt=tt.style.right,zt=tt.style.bottom,Tt=tt.style.overflow,_t=(0,x.Z)((0,x.Z)({},fe[Re]),B),Ot=Nt.createElement("div");(Fe=tt.parentElement)===null||Fe===void 0||Fe.appendChild(Ot),Ot.style.left="".concat(tt.offsetLeft,"px"),Ot.style.top="".concat(tt.offsetTop,"px"),Ot.style.position=ht,Ot.style.height="".concat(tt.offsetHeight,"px"),Ot.style.width="".concat(tt.offsetWidth,"px"),tt.style.left="0",tt.style.top="0",tt.style.right="auto",tt.style.bottom="auto",tt.style.overflow="hidden";var St;if(Array.isArray(re))St={x:re[0],y:re[1],width:0,height:0};else{var Jt,Pt,xt=re.getBoundingClientRect();xt.x=(Jt=xt.x)!==null&&Jt!==void 0?Jt:xt.left,xt.y=(Pt=xt.y)!==null&&Pt!==void 0?Pt:xt.top,St={x:xt.x,y:xt.y,width:xt.width,height:xt.height}}var Dt=tt.getBoundingClientRect(),un=Et.getComputedStyle(tt),Ft=un.height,Ht=un.width;Dt.x=(Ve=Dt.x)!==null&&Ve!==void 0?Ve:Dt.left,Dt.y=(Qe=Dt.y)!==null&&Qe!==void 0?Qe:Dt.top;var It=Nt.documentElement,rt=It.clientWidth,d=It.clientHeight,g=It.scrollWidth,T=It.scrollHeight,j=It.scrollTop,te=It.scrollLeft,Ee=Dt.height,Ce=Dt.width,Xe=St.height,Ze=St.width,ut={left:0,top:0,right:rt,bottom:d},ft={left:-te,top:-j,right:g-te,bottom:T-j},Lt=_t.htmlRegion,vt="visible",Kt="visibleFirst";Lt!=="scroll"&&Lt!==Kt&&(Lt=vt);var $t=Lt===Kt,gt=V(ft,le),mt=V(ut,le),Bt=Lt===vt?mt:gt,kt=$t?mt:Bt;tt.style.left="auto",tt.style.top="auto",tt.style.right="0",tt.style.bottom="0";var hn=tt.getBoundingClientRect();tt.style.left=qt,tt.style.top=Vt,tt.style.right=bt,tt.style.bottom=zt,tt.style.overflow=Tt,(Ie=tt.parentElement)===null||Ie===void 0||Ie.removeChild(Ot);var En=b(Math.round(Ce/parseFloat(Ht)*1e3)/1e3),Wt=b(Math.round(Ee/parseFloat(Ft)*1e3)/1e3);if(En===0||Wt===0||(0,ne.Sh)(re)&&!(0,ie.Z)(re))return;var Mt=_t.offset,Qt=_t.targetOffset,gn=be(Dt,Mt),Be=(0,de.Z)(gn,2),Ke=Be[0],pt=Be[1],lt=be(St,Qt),st=(0,de.Z)(lt,2),ct=st[0],At=st[1];St.x-=ct,St.y-=At;var Ut=_t.points||[],cn=(0,de.Z)(Ut,2),tn=cn[0],xn=cn[1],an=Pe(xn),_n=Pe(tn),Sn=oe(St,an),Ln=oe(Dt,_n),Pn=(0,x.Z)({},_t),pn=Sn.x-Ln.x+Ke,yn=Sn.y-Ln.y+pt,Rn=li(pn,yn),In=li(pn,yn,mt),wn=oe(St,["t","l"]),$n=oe(Dt,["t","l"]),Dn=oe(St,["b","r"]),Nn=oe(Dt,["b","r"]),Xn=_t.overflow||{},Gn=Xn.adjustX,si=Xn.adjustY,Zn=Xn.shiftX,Qn=Xn.shiftY,ni=function(yi){return typeof yi=="boolean"?yi:yi>=0},ii,ei,Cn,kn;ti();var rn=ni(si),Gt=_n[0]===an[0];if(rn&&_n[0]==="t"&&(ei>kt.bottom||ge.current.bt)){var en=yn;Gt?en-=Ee-Xe:en=wn.y-Nn.y-pt;var Bn=li(pn,en),Un=li(pn,en,mt);Bn>Rn||Bn===Rn&&(!$t||Un>=In)?(ge.current.bt=!0,yn=en,pt=-pt,Pn.points=[Ae(_n,0),Ae(an,0)]):ge.current.bt=!1}if(rn&&_n[0]==="b"&&(ii<kt.top||ge.current.tb)){var Jn=yn;Gt?Jn+=Ee-Xe:Jn=Dn.y-$n.y-pt;var oi=li(pn,Jn),Hn=li(pn,Jn,mt);oi>Rn||oi===Rn&&(!$t||Hn>=In)?(ge.current.tb=!0,yn=Jn,pt=-pt,Pn.points=[Ae(_n,0),Ae(an,0)]):ge.current.tb=!1}var ci=ni(Gn),Ti=_n[1]===an[1];if(ci&&_n[1]==="l"&&(kn>kt.right||ge.current.rl)){var di=pn;Ti?di-=Ce-Ze:di=wn.x-Nn.x-Ke;var bi=li(di,yn),ai=li(di,yn,mt);bi>Rn||bi===Rn&&(!$t||ai>=In)?(ge.current.rl=!0,pn=di,Ke=-Ke,Pn.points=[Ae(_n,1),Ae(an,1)]):ge.current.rl=!1}if(ci&&_n[1]==="r"&&(Cn<kt.left||ge.current.lr)){var hi=pn;Ti?hi+=Ce-Ze:hi=Dn.x-$n.x-Ke;var gi=li(hi,yn),Mi=li(hi,yn,mt);gi>Rn||gi===Rn&&(!$t||Mi>=In)?(ge.current.lr=!0,pn=hi,Ke=-Ke,Pn.points=[Ae(_n,1),Ae(an,1)]):ge.current.lr=!1}ti();var fi=Zn===!0?0:Zn;typeof fi=="number"&&(Cn<mt.left&&(pn-=Cn-mt.left-Ke,St.x+Ze<mt.left+fi&&(pn+=St.x-mt.left+Ze-fi)),kn>mt.right&&(pn-=kn-mt.right-Ke,St.x>mt.right-fi&&(pn+=St.x-mt.right+fi)));var _i=Qn===!0?0:Qn;typeof _i=="number"&&(ii<mt.top&&(yn-=ii-mt.top-pt,St.y+Xe<mt.top+_i&&(yn+=St.y-mt.top+Xe-_i)),ei>mt.bottom&&(yn-=ei-mt.bottom-pt,St.y>mt.bottom-_i&&(yn+=St.y-mt.bottom+_i)));var Ci=Dt.x+pn,Fi=Ci+Ce,vi=Dt.y+yn,zi=vi+Ee,$i=St.x,Di=$i+Ze,qi=St.y,bn=qi+Xe,Wi=Math.max(Ci,$i),Si=Math.min(Fi,Di),er=(Wi+Si)/2,or=er-Ci,tr=Math.max(vi,qi),lr=Math.min(zi,bn),Zi=(tr+lr)/2,Vn=Zi-vi;A==null||A(Le,Pn);var pi=hn.right-Dt.x-(pn+Dt.width),Oi=hn.bottom-Dt.y-(yn+Dt.height);En===1&&(pn=Math.floor(pn),pi=Math.floor(pi)),Wt===1&&(yn=Math.floor(yn),Oi=Math.floor(Oi));var nr={ready:!0,offsetX:pn/En,offsetY:yn/Wt,offsetR:pi/En,offsetB:Oi/Wt,arrowX:or/En,arrowY:Vn/Wt,scaleX:En,scaleY:Wt,align:Pn};$(nr)}}),Ue=function(){ee.current+=1;var Ve=ee.current;Promise.resolve().then(function(){ee.current===Ve&&ze()})},Ye=function(){$(function(Ve){return(0,x.Z)((0,x.Z)({},Ve),{},{ready:!1})})};return(0,m.Z)(Ye,[Re]),(0,m.Z)(function(){ve||Ye()},[ve]),[W.ready,W.offsetX,W.offsetY,W.offsetR,W.offsetB,W.arrowX,W.arrowY,W.scaleX,W.scaleY,W.align,Ue]}var et=S(77654);function Oe(ve,Le,re,Re,fe){(0,m.Z)(function(){if(ve&&Le&&re){let ee=function(){Re(),fe()};var B=Le,A=re,U=Y(B),X=Y(A),W=Z(A),$=new Set([W].concat((0,et.Z)(U),(0,et.Z)(X)));return $.forEach(function(le){le.addEventListener("scroll",ee,{passive:!0})}),W.addEventListener("resize",ee,{passive:!0}),Re(),function(){$.forEach(function(le){le.removeEventListener("scroll",ee),W.removeEventListener("resize",ee)})}}},[ve,Le,re])}var qe=S(48736);function xe(ve,Le,re,Re,fe,B,A,U){var X=E.useRef(ve);X.current=ve;var W=E.useRef(!1);E.useEffect(function(){if(Le&&Re&&(!fe||B)){var ee=function(){W.current=!1},le=function(Qe){var Ie;X.current&&!A(((Ie=Qe.composedPath)===null||Ie===void 0||(Ie=Ie.call(Qe))===null||Ie===void 0?void 0:Ie[0])||Qe.target)&&!W.current&&U(!1)},ge=Z(Re);ge.addEventListener("pointerdown",ee,!0),ge.addEventListener("mousedown",le,!0),ge.addEventListener("contextmenu",le,!0);var we=(0,l.A)(re);if(we&&(we.addEventListener("mousedown",le,!0),we.addEventListener("contextmenu",le,!0)),0)var ze,Ue,Ye,Fe;return function(){ge.removeEventListener("pointerdown",ee,!0),ge.removeEventListener("mousedown",le,!0),ge.removeEventListener("contextmenu",le,!0),we&&(we.removeEventListener("mousedown",le,!0),we.removeEventListener("contextmenu",le,!0))}}},[Le,re,Re,fe,B]);function $(){W.current=!0}return $}var it=["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 $e(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ue.Z,Le=E.forwardRef(function(re,Re){var fe=re.prefixCls,B=fe===void 0?"rc-trigger-popup":fe,A=re.children,U=re.action,X=U===void 0?"hover":U,W=re.showAction,$=re.hideAction,ee=re.popupVisible,le=re.defaultPopupVisible,ge=re.onPopupVisibleChange,we=re.afterPopupVisibleChange,ze=re.mouseEnterDelay,Ue=re.mouseLeaveDelay,Ye=Ue===void 0?.1:Ue,Fe=re.focusDelay,Ve=re.blurDelay,Qe=re.mask,Ie=re.maskClosable,tt=Ie===void 0?!0:Ie,Nt=re.getPopupContainer,Et=re.forceRender,Rt=re.autoDestroy,ht=re.destroyPopupOnHide,qt=re.popup,Vt=re.popupClassName,bt=re.popupStyle,zt=re.popupPlacement,Tt=re.builtinPlacements,_t=Tt===void 0?{}:Tt,Ot=re.popupAlign,St=re.zIndex,Jt=re.stretch,Pt=re.getPopupClassNameFromAlign,xt=re.fresh,Dt=re.alignPoint,un=re.onPopupClick,Ft=re.onPopupAlign,Ht=re.arrow,It=re.popupMotion,rt=re.maskMotion,d=re.popupTransitionName,g=re.popupAnimation,T=re.maskTransitionName,j=re.maskAnimation,te=re.className,Ee=re.getTriggerDOMNode,Ce=(0,me.Z)(re,it),Xe=Rt||ht||!1,Ze=E.useState(!1),ut=(0,de.Z)(Ze,2),ft=ut[0],Lt=ut[1];(0,m.Z)(function(){Lt((0,_.Z)())},[]);var vt=E.useRef({}),Kt=E.useContext(Ne),$t=E.useMemo(function(){return{registerSubPopup:function(vn,jn){vt.current[vn]=jn,Kt==null||Kt.registerSubPopup(vn,jn)}}},[Kt]),gt=(0,P.Z)(),mt=E.useState(null),Bt=(0,de.Z)(mt,2),kt=Bt[0],hn=Bt[1],En=E.useRef(null),Wt=(0,K.Z)(function(sn){En.current=sn,(0,ne.Sh)(sn)&&kt!==sn&&hn(sn),Kt==null||Kt.registerSubPopup(gt,sn)}),Mt=E.useState(null),Qt=(0,de.Z)(Mt,2),gn=Qt[0],Be=Qt[1],Ke=E.useRef(null),pt=(0,K.Z)(function(sn){(0,ne.Sh)(sn)&&gn!==sn&&(Be(sn),Ke.current=sn)}),lt=E.Children.only(A),st=(lt==null?void 0:lt.props)||{},ct={},At=(0,K.Z)(function(sn){var vn,jn,An=gn;return(An==null?void 0:An.contains(sn))||((vn=(0,l.A)(An))===null||vn===void 0?void 0:vn.host)===sn||sn===An||(kt==null?void 0:kt.contains(sn))||((jn=(0,l.A)(kt))===null||jn===void 0?void 0:jn.host)===sn||sn===kt||Object.values(vt.current).some(function(On){return(On==null?void 0:On.contains(sn))||sn===On})}),Ut=H(B,It,g,d),cn=H(B,rt,j,T),tn=E.useState(le||!1),xn=(0,de.Z)(tn,2),an=xn[0],_n=xn[1],Sn=ee!=null?ee:an,Ln=(0,K.Z)(function(sn){ee===void 0&&_n(sn)});(0,m.Z)(function(){_n(ee||!1)},[ee]);var Pn=E.useRef(Sn);Pn.current=Sn;var pn=E.useRef([]);pn.current=[];var yn=(0,K.Z)(function(sn){var vn;Ln(sn),((vn=pn.current[pn.current.length-1])!==null&&vn!==void 0?vn:Sn)!==sn&&(pn.current.push(sn),ge==null||ge(sn))}),Rn=E.useRef(),In=function(){clearTimeout(Rn.current)},wn=function(vn){var jn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;In(),jn===0?yn(vn):Rn.current=setTimeout(function(){yn(vn)},jn*1e3)};E.useEffect(function(){return In},[]);var $n=E.useState(!1),Dn=(0,de.Z)($n,2),Nn=Dn[0],Xn=Dn[1];(0,m.Z)(function(sn){(!sn||Sn)&&Xn(!0)},[Sn]);var Gn=E.useState(null),si=(0,de.Z)(Gn,2),Zn=si[0],Qn=si[1],ni=E.useState(null),ii=(0,de.Z)(ni,2),ei=ii[0],Cn=ii[1],kn=function(vn){Cn([vn.clientX,vn.clientY])},rn=ke(Sn,kt,Dt&&ei!==null?ei:gn,zt,_t,Ot,Ft),Gt=(0,de.Z)(rn,11),en=Gt[0],Bn=Gt[1],Un=Gt[2],Jn=Gt[3],oi=Gt[4],Hn=Gt[5],ci=Gt[6],Ti=Gt[7],di=Gt[8],bi=Gt[9],ai=Gt[10],hi=je(ft,X,W,$),gi=(0,de.Z)(hi,2),Mi=gi[0],fi=gi[1],_i=Mi.has("click"),Ci=fi.has("click")||fi.has("contextMenu"),Fi=(0,K.Z)(function(){Nn||ai()}),vi=function(){Pn.current&&Dt&&Ci&&wn(!1)};Oe(Sn,gn,kt,Fi,vi),(0,m.Z)(function(){Fi()},[ei,zt]),(0,m.Z)(function(){Sn&&!(_t!=null&&_t[zt])&&Fi()},[JSON.stringify(Ot)]);var zi=E.useMemo(function(){var sn=z(_t,B,bi,Dt);return p()(sn,Pt==null?void 0:Pt(bi))},[bi,Pt,_t,B,Dt]);E.useImperativeHandle(Re,function(){return{nativeElement:Ke.current,popupElement:En.current,forceAlign:Fi}});var $i=E.useState(0),Di=(0,de.Z)($i,2),qi=Di[0],bn=Di[1],Wi=E.useState(0),Si=(0,de.Z)(Wi,2),er=Si[0],or=Si[1],tr=function(){if(Jt&&gn){var vn=gn.getBoundingClientRect();bn(vn.width),or(vn.height)}},lr=function(){tr(),Fi()},Zi=function(vn){Xn(!1),ai(),we==null||we(vn)},Vn=function(){return new Promise(function(vn){tr(),Qn(function(){return vn})})};(0,m.Z)(function(){Zn&&(ai(),Zn(),Qn(null))},[Zn]);function pi(sn,vn,jn,An){ct[sn]=function(On){var Yi;An==null||An(On),wn(vn,jn);for(var wi=arguments.length,cr=new Array(wi>1?wi-1:0),_r=1;_r<wi;_r++)cr[_r-1]=arguments[_r];(Yi=st[sn])===null||Yi===void 0||Yi.call.apply(Yi,[st,On].concat(cr))}}(_i||Ci)&&(ct.onClick=function(sn){var vn;Pn.current&&Ci?wn(!1):!Pn.current&&_i&&(kn(sn),wn(!0));for(var jn=arguments.length,An=new Array(jn>1?jn-1:0),On=1;On<jn;On++)An[On-1]=arguments[On];(vn=st.onClick)===null||vn===void 0||vn.call.apply(vn,[st,sn].concat(An))});var Oi=xe(Sn,Ci,gn,kt,Qe,tt,At,wn),nr=Mi.has("hover"),li=fi.has("hover"),ti,mi;nr&&(pi("onMouseEnter",!0,ze,function(sn){kn(sn)}),pi("onPointerEnter",!0,ze,function(sn){kn(sn)}),ti=function(vn){(Sn||Nn)&&kt!==null&&kt!==void 0&&kt.contains(vn.target)&&wn(!0,ze)},Dt&&(ct.onMouseMove=function(sn){var vn;(vn=st.onMouseMove)===null||vn===void 0||vn.call(st,sn)})),li&&(pi("onMouseLeave",!1,Ye),pi("onPointerLeave",!1,Ye),mi=function(){wn(!1,Ye)}),Mi.has("focus")&&pi("onFocus",!0,Fe),fi.has("focus")&&pi("onBlur",!1,Ve),Mi.has("contextMenu")&&(ct.onContextMenu=function(sn){var vn;Pn.current&&fi.has("contextMenu")?wn(!1):(kn(sn),wn(!0)),sn.preventDefault();for(var jn=arguments.length,An=new Array(jn>1?jn-1:0),On=1;On<jn;On++)An[On-1]=arguments[On];(vn=st.onContextMenu)===null||vn===void 0||vn.call.apply(vn,[st,sn].concat(An))}),te&&(ct.className=p()(st.className,te));var yi=E.useRef(!1);yi.current||(yi.current=Et||Sn||Nn);var Ui=(0,x.Z)((0,x.Z)({},st),ct),Pi={},ur=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];ur.forEach(function(sn){Ce[sn]&&(Pi[sn]=function(){for(var vn,jn=arguments.length,An=new Array(jn),On=0;On<jn;On++)An[On]=arguments[On];(vn=Ui[sn])===null||vn===void 0||vn.call.apply(vn,[Ui].concat(An)),Ce[sn].apply(Ce,An)})});var gr=E.cloneElement(lt,(0,x.Z)((0,x.Z)({},Ui),Pi)),ir={x:Hn,y:ci},Ir=Ht?(0,x.Z)({},Ht!==!0?Ht:{}):null;return E.createElement(E.Fragment,null,E.createElement(se.Z,{disabled:!Sn,ref:pt,onResize:lr},E.createElement(ae,{getTriggerDOMNode:Ee},gr)),yi.current&&E.createElement(Ne.Provider,{value:$t},E.createElement(Q,{portal:ve,ref:Wt,prefixCls:B,popup:qt,className:p()(Vt,zi),style:bt,target:gn,onMouseEnter:ti,onMouseLeave:mi,onPointerEnter:ti,zIndex:St,open:Sn,keepDom:Nn,fresh:xt,onClick:un,onPointerDownCapture:Oi,mask:Qe,motion:Ut,maskMotion:cn,onVisibleChanged:Zi,onPrepare:Vn,forceRender:Et,autoDestroy:Xe,getPopupContainer:Nt,align:bi,arrow:Ir,arrowPos:ir,ready:en,offsetX:Bn,offsetY:Un,offsetR:Jn,offsetB:oi,onAlign:Fi,stretch:Jt,targetWidth:qi/Ti,targetHeight:er/di})))});return Le}var De=$e(ue.Z)},90736:function(Ct,He,S){"use strict";var x=S(59301),de=S(4977),me=S(7939),ue=Object.defineProperty,G=Object.defineProperties,p=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,K=(E,w,F)=>w in E?ue(E,w,{enumerable:!0,configurable:!0,writable:!0,value:F}):E[w]=F,P=(E,w)=>{for(var F in w||(w={}))ne.call(w,F)&&K(E,F,w[F]);if(se)for(var F of se(w))l.call(w,F)&&K(E,F,w[F]);return E},m=(E,w)=>G(E,p(w));const _=({img:E,buttonProps:w={},styles:F={},customText:k,ButtonText:N,ButtonClick:L,Buttonclass:O,ButtonTwo:D,imgStyles:C,loading:Q=!1,className:ce=""})=>x.createElement("section",{className:`tc animated fadeIn ${ce}`,style:P({color:"#999",margin:"100px auto",visibility:Q?"hidden":"visible"},F)},x.createElement("img",{src:E||de,style:m(P({},C),{pointerEvents:"none",userSelect:"none"})}),x.createElement("p",{className:"mt20 font14"},k||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),N&&x.createElement(me.ZP,P({className:O,onClick:L},w),N),D&&D);He.Z=_},86974:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return O}});var x=S(59301),de={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",showClose:"showClose___edZQA",embed:"embed___hvpEJ"},me=S(7939),ue=S(70557),G=S(34728),p=S(25399),se=S(76406),ne=S(84849),l=S(90736),K=S(14185),P=S(52078),m=S(59301),_=Object.defineProperty,E=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable,k=(D,C,Q)=>C in D?_(D,C,{enumerable:!0,configurable:!0,writable:!0,value:Q}):D[C]=Q,N=(D,C)=>{for(var Q in C||(C={}))w.call(C,Q)&&k(D,Q,C[Q]);if(E)for(var Q of E(C))F.call(C,Q)&&k(D,Q,C[Q]);return D},L=(D,C,Q)=>new Promise((ce,ae)=>{var Se=je=>{try{Te(Q.next(je))}catch(ie){ae(ie)}},Ne=je=>{try{Te(Q.throw(je))}catch(ie){ae(ie)}},Te=je=>je.done?ce(je.value):Promise.resolve(je.value).then(Se,Ne);Te((Q=Q.apply(D,C)).next())}),O=({editOffice:D="view",data:C,issaver:Q,onSaver:ce,theme:ae,type:Se,filename:Ne,monacoEditor:Te,className:je,style:ie,close:M,onClose:z,hasMask:H,disabledDownload:Z,onImgDimensions:Y,showNodata:b,recordInfo:y})=>{const[V,he]=(0,x.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[be,Pe]=(0,x.useState)(""),[oe,Ae]=(0,x.useState)(),ke=window.ENV==="build"?"/react/build":"",et=location.host.startsWith("localhost")?K.Z.PROXY_SERVER:K.Z.API_SERVER,qe=10*(1024*1024),xe=(0,x.useRef)();C!=null&&C.startsWith("/api")&&Se!=="txt"&&(C=K.Z.API_SERVER+C);const it=Re=>Re.substring(Re.lastIndexOf("/")+1).split(".").pop();Ne&&Te&&(Te.filename=Ne),(0,x.useEffect)(()=>{var Re,fe;const B=(fe=(Re=document.cookie)==null?void 0:Re.replace(/\s/g,""))==null?void 0:fe.split(";");B==null||B.map(A=>{let U=A.split("=");U[0]==="_educoder_session"&&Pe(U[1])})},[]),(0,x.useEffect)(()=>{Se==="office"&&(C.indexOf("bigfilescdn.")>-1||C.indexOf("bigfiles1")>-1?Ae({url:C,fileType:it(C),model:C.indexOf("model=edit")?"edit":"view"}):C.indexOf("coze")>-1?Ae({url:C,fileType:"doc",model:"view"}):De())},[Se,C]);function $e(Re){return L(this,null,function*(){Re.data.type==="pdfdata"&&(ce(Re.data.data),window.removeEventListener("message",$e,!1)),console.log("mess---:",Re.data)})}const De=()=>L(void 0,null,function*(){console.log("data:",C);let Re=C;C.startsWith("http")||(Re=location.origin+Re);let fe=new URL(Re).pathname.split("/").pop();const B=yield(0,ne.gJ)({attachment_id:fe});B.url=et+B.url,Ae(B)}),ve=()=>{if(C.startsWith("http")||C.startsWith("blob:")){Le();return}(0,se.Sv)(Ne||"educoder",C,Ne)},Le=()=>{y&&(0,P.fc)({id:y==null?void 0:y.id,watch_type:1,course_id:y==null?void 0:y.course_id}),(0,se.Nd)(Ne||"educoder",decodeURIComponent(C))};(0,x.useEffect)(()=>(window.addEventListener("message",re),()=>{window.removeEventListener("message",re)}),[]);const re=Re=>{var fe;((fe=Re==null?void 0:Re.data)==null?void 0:fe.type)==="closePop"&&z()};return m.createElement("div",{style:N({},ie||{}),className:`${H&&de.bgBlack} ${Se?de.wrp:"hide"}`},!!Se&&M&&m.createElement("div",{id:"closePop",className:de.close,ref:xe},!!Y&&m.createElement(p.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>xe.current},m.createElement("span",{onClick:()=>{z(),Y()}},m.createElement("i",{className:"icon-yulanpizhu"}))),!Z&&window.parent===window&&m.createElement(p.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>xe.current},m.createElement("span",{onClick:Le},m.createElement("i",{className:"icon-quxiaozhiding"}))),Q&&m.createElement(p.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>xe.current},m.createElement("span",{className:"",onClick:()=>{const Re=document.getElementById("pdfiframe");window.addEventListener("message",$e,!1),setTimeout(()=>{Re.contentWindow.postMessage("getData","*")},300)}},m.createElement("i",{className:"icon-baocun"}))),m.createElement(p.Z,{title:"\u5173\u95ED",getPopupContainer:()=>xe.current},m.createElement("span",{className:"",onClick:()=>{z()}},m.createElement("i",{className:"icon-guanbi1"})))),m.createElement("div",{className:`${de[je]} ${je} ${de.monaco} ${Se==="txt"?"show":"hide"}`},Se==="txt"&&m.createElement(m.Fragment,null,m.createElement(G.ZP,N({},Te)))),Se==="audio"&&m.createElement("audio",{controls:!0,src:`${(C==null?void 0:C.indexOf("http://"))>-1||(C==null?void 0:C.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${C}`,autoPlay:!0}),Se==="video"&&m.createElement(m.Fragment,null,(C==null?void 0:C.indexOf("http"))>-1?m.createElement("video",{controls:!0,src:`${C}`,autoPlay:!0}):m.createElement("video",{controls:!0,src:`data:video/mp4;base64,${C}`,autoPlay:!0})),Se==="office"&&oe&&m.createElement("iframe",{src:`${ke}/office.html?key=${oe.key}&url=${btoa(oe.url)}&callbackUrl=${et+(oe.callbackUrl||"")}&fileType=${oe.fileType}&title=${oe.title||""}&model=${D}&officeServer=${K.Z.ONLYOFFICE}&disabledDownload=${!!Z}`}),Se==="html"&&m.createElement("iframe",{src:C+"&disposition=inline"}),Se==="pdf"&&m.createElement("iframe",{id:"pdfiframe",src:`${ke}/js/pdf/index.html?filename=${Ne||"educoder.pdf"}&url=${encodeURIComponent(C)}&disabledDownload=${!!Z}&model=${D}`}),Se==="image"&&m.createElement("img",{src:`${(C==null?void 0:C.indexOf("http://"))>-1||(C==null?void 0:C.indexOf("https://"))>-1?"":"data:image/png;base64,"}${C}`}),(Se==="other"||Se==="download")&&m.createElement(m.Fragment,null,b?m.createElement(l.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:m.createElement(me.ZP,{icon:m.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:ve,disabled:Z},"\u4E0B\u8F7D")}):m.createElement(me.ZP,{type:"primary",size:"middle",onClick:ve,disabled:Z},m.createElement(ue.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")),Se==="flowChart"&&m.createElement("div",{className:"embed"},m.createElement("iframe",{src:`/drawio/src/main/webapp/viewer.html?id=${C||""}&gapi=0&od=0&db=0&gh=0&gl=0`,width:"100%",height:"100%",frameBorder:"0"})))}},42972:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return w}});var x=S(59301),de=S(6767),me=S(75727),ue=S(72790),G=S(16471),p=S(15267),se=S(56102),ne=S(67195),l={watermark:"watermark___hNYlv",videovideo:"videovideo___ovOkV",animate__loop:"animate__loop___mvL6s",upDown:"upDown___SlgHv",container:"container___g1WYG","video-container":"video-container___XPkWR","video-controls":"video-controls___to0Zq",hide:"hide___NA3DV","video-progress":"video-progress___gqHsd",seek:"seek___iZHBm","seek-tooltip":"seek-tooltip___uWyXx","bottom-controls":"bottom-controls___uoIBm","left-controls":"left-controls___mBEx4","right-controls":"right-controls___e9L6r",rateOverlay:"rateOverlay___HHBWe",controlText:"controlText___M_BWR","volume-controls":"volume-controls___fa3mE","fullscreen-button":"fullscreen-button___ur0es","fullscreen-button1":"fullscreen-button1___rfaXm","pip-button":"pip-button___GFO8W","playback-animation":"playback-animation___ndURq",volume:"volume___OTmpP",hidden:"hidden___o7GkT"},K=(F,k,N)=>new Promise((L,O)=>{var D=ce=>{try{Q(N.next(ce))}catch(ae){O(ae)}},C=ce=>{try{Q(N.throw(ce))}catch(ae){O(ae)}},Q=ce=>ce.done?L(ce.value):Promise.resolve(ce.value).then(D,C);Q((N=N.apply(F,k)).next())});function P(F){if(isNaN(F))return{minutes:"00",seconds:"00"};const k=new Date(F*1e3).toISOString().substr(11,8);return{hour:k.substr(0,2),minutes:k.substr(3,2),seconds:k.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function m(F,k){return F-k}function _(F){F.sort(m);let k=0;for(let N=0;N<F.length-1;N++){let L=Math.abs(F[N+1]-F[N]);L<21&&(k+=L)}return k}const E=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;var w=(0,x.forwardRef)(({allow_skip:F,src:k,toLog:N,videoId:L,logWatchHistory:O,courseId:D=null,startTime:C,handlePause:Q=()=>{},handlePlay:ce=()=>{},handlePlayEnded:ae=()=>{},autoPlay:Se=!1,onPlayEnded:Ne=()=>{},isShowWaterMark:Te=!0},je)=>{var ie;k=k==null?void 0:k.replace("http://","https://");const z=((ie=k==null?void 0:k.split("."))==null?void 0:ie.pop())==="flv",H=(0,x.useRef)(),Z=(0,x.useRef)(),Y=(0,x.useRef)(),b=(0,x.useRef)(),y=(0,x.useRef)(),V=(0,x.useRef)(),he=(0,x.useRef)(),be=(0,x.useRef)(),Pe=(0,x.useRef)(),oe=(0,x.useRef)(),Ae=(0,x.useRef)(),ke=(0,x.useRef)(),et=(0,x.useRef)(),Oe=(0,x.useRef)(),qe=navigator.userAgent.toLowerCase().match(E),xe=qe?qe[0]:"pc",it=(0,x.useRef)(!1),$e=(0,p.eY)();let De=0,ve=0,Le=0,re=null,Re=!1,fe=20,B=1,A=!1,U=!1,X=[];(0,x.useImperativeHandle)(je,()=>({getLastUpdatedTime:()=>H.current.currentTime,getDuration:()=>H.current.duration})),de.ZP.config({maxCount:1,getContainer:()=>Y.current});const W=(0,x.useCallback)((Ue,Ye=!1)=>{let Fe={point:H.current.currentTime};re?(Fe.log_id=re,Fe.watch_duration=_(X),Fe.total_duration=ve):(D?(Fe.video_id=parseInt(L,10),Fe.course_id=D):Fe.video_id=L,Fe.duration=De,Fe.device=xe),Ye&&(Fe.ed="1");function Ve(){return K(this,null,function*(){A=!0,re=yield O==null?void 0:O(Fe),A=!1,Ue&&Ue()})}Ve()},[L,D]);(0,x.useEffect)(()=>{H.current&&(b.current.style.display="none",y.current.style.display="block"),de.ZP.destroy();let Ue=null;return ue.Z.isSupported&&z&&k&&(k==null?void 0:k.indexOf(".m3u8"))<0?(Ue=ue.Z.createPlayer({type:"flv",volume:.8,cors:!0,url:k,muted:!1}),H.current&&(Ue.attachMediaElement(H.current),Ue.load())):H.current.setAttribute("src",k),ee(),()=>{Ue&&(Ue.unload(),Ue.pause(),Ue.destroy(),Ue=null)}},[H,z,k]);function $(){H.current.paused?(b.current.style.display="none",y.current.style.display="block"):(b.current.style.display="block",y.current.style.display="none")}function ee(){Ae.current.style.display="none",et.current.style.display="none",ke.current.style.display="none",H.current.muted||H.current.volume===0?Ae.current.style.display="block":H.current.volume>0&&H.current.volume<=.5?et.current.style.display="block":ke.current.style.display="block"}(0,x.useEffect)(()=>{const Ue=document.getElementById("play"),Ye=document.querySelectorAll(".playback-icons use");function Fe(){ce(),C&&!it.current&&(H.current.currentTime=C),it.current=!0,X.push(H.current.currentTime),Re||(Re=!0,N&&W())}function Ve(){return K(this,null,function*(){$(),X.push(H.current.currentTime),N&&W(()=>{re=null,Le=0,Re=!1,A=!1,U=!1,X=[],ve=0,B=1},!0),Ne()})}function Qe(){V.current.value=Math.round(H.current.currentTime),he.current.value=Math.round(H.current.currentTime)}function Ie(){const _t=P(Math.round(H.current.currentTime));Pe.current.innerText=`${_t.hour>0?_t.hour+":":""}${_t.minutes}:${_t.seconds}`,Pe.current.setAttribute("datetime",`${_t.hour>0?" "+_t.hour+" ":""}${_t.minutes}m ${_t.seconds}s`)}function tt(){var _t,Ot,St,Jt,Pt,xt,Dt;const un=Math.round((_t=H.current)==null?void 0:_t.duration);(St=(Ot=V.current)==null?void 0:Ot.setAttribute)==null||St.call(Ot,"max",un),(Pt=(Jt=he.current)==null?void 0:Jt.setAttribute)==null||Pt.call(Jt,"max",un);const Ft=P(un);be.current&&(be.current.innerText=`${Ft.hour>0?Ft.hour+":":""}${Ft.minutes}:${Ft.seconds}`,(Dt=(xt=be.current).setAttribute)==null||Dt.call(xt,"datetime",`${Ft.hour>0?" "+Ft.hour+" ":""}${Ft.minutes}m ${Ft.seconds}s`))}function Nt(){try{const _t=Math.round(H.current.duration);V.current.setAttribute("max",_t),he.current.setAttribute("max",_t);const Ot=P(_t);be.current.innerText=`${Ot.hour>0?Ot.hour+":":""}${Ot.minutes}:${Ot.seconds}`,be.current.setAttribute("datetime",`${Ot.hour>0?" "+Ot.hour+" ":""}${Ot.minutes}m ${Ot.seconds}s`),Qe(),Ie();const{width:St,height:Jt,x:Pt,y:xt}=Z.current.getBoundingClientRect();if(Pt<0||xt<0,!U){let Dt=H.current.currentTime,un=Dt-Le;Math.abs(un)<10?(ve+=Math.abs(un),Le=Dt,A||ve-B*fe>=0&&(B++,X.push(Le),N&&W())):(Le=Dt,N&&W())}}catch(_t){console.log("videoplaying:",_t)}}function Et(){U=!0}function Rt(){H.current.playing&&X.push(H.current.currentTime,Le),Le=H.current.currentTime,U=!1}function ht(){De=H.current.duration,De<=20&&(fe=De/3),H.current.addEventListener("play",Fe)}function qt(_t){_t.preventDefault(),(0,ne.vp)()?(H.current.style.width="100%",H.current.style.height="100%"):H.current.style.cssText=""}function Vt(){Q()}function bt(_t){if(!F){de.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");return}const Ot=_t.target.dataset.seek?_t.target.dataset.seek:_t.target.value;H.current.currentTime=Ot,he.current.value=Ot,V.current.value=Ot}function zt(_t){const Ot=Math.round(_t.offsetX/_t.target.clientWidth*parseInt(_t.target.getAttribute("max"),10));V.current.setAttribute("data-seek",Ot);const St=P(Ot);oe.current.textContent=`${St.hour>0?St.hour+":":""}${St.minutes}:${St.seconds}`;const Jt=H.current.getBoundingClientRect();oe.current.style.left=`${_t.pageX-Jt.left}px`}function Tt(_t){switch(_t.code){case"Space":_t.preventDefault(),we();break;case"ArrowRight":if(_t.preventDefault(),!F){de.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(H.current.currentTime>=H.current.duration)break;H.current.currentTime=parseInt(H.current.currentTime)+5,Qe();break;case"ArrowLeft":if(_t.preventDefault(),!F){de.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(H.current.currentTime===0)break;H.current.currentTime=parseInt(H.current.currentTime)-5,Qe();break;case"ArrowUp":_t.preventDefault(),H.current.volume<1&&(H.current.volume=(parseInt(H.current.volume*10)+1)/10);break;case"ArrowDown":_t.preventDefault(),H.current.volume>0&&(H.current.volume=(parseInt(H.current.volume*10)-1)/10);break}}return Y.current.addEventListener((0,ne.gH)(),qt),H.current.addEventListener("canplay",ht),H.current.addEventListener("ended",Ve),H.current.addEventListener("seeking",Et),H.current.addEventListener("seeked",Rt),H.current.addEventListener("loadedmetadata",tt),V.current.addEventListener("mousemove",zt),V.current.addEventListener("input",bt),H.current.addEventListener("timeupdate",Nt),H.current.addEventListener("pause",Vt),H.current.addEventListener("volumechange",ee),document.addEventListener("keydown",Tt),()=>{var _t,Ot,St,Jt,Pt,xt,Dt,un,Ft,Ht,It,rt;(_t=H.current)==null||_t.removeEventListener("canplay",ht),(Ot=H.current)==null||Ot.removeEventListener("play",Fe),(St=H.current)==null||St.removeEventListener("ended",Ve),(Jt=H.current)==null||Jt.removeEventListener("seeking",Et),(Pt=H.current)==null||Pt.removeEventListener("seeked",Rt),(xt=V.current)==null||xt.removeEventListener("mousemove",zt),(Dt=V.current)==null||Dt.removeEventListener("input",bt),(un=H.current)==null||un.removeEventListener("timeupdate",Nt),(Ft=H.current)==null||Ft.removeEventListener("pause",Vt),(Ht=H.current)==null||Ht.removeEventListener("loadedmetadata",tt),(It=H.current)==null||It.removeEventListener("volumechange",ee),document.removeEventListener("keydown",Tt),(rt=H.current)!=null&&rt.playing&&(X.push(Le,H.current.currentTime),N&&W())}},[H,k]),(0,x.useEffect)(()=>{if(H.current.onended=()=>{ae(H)},H.current.oncontextmenu=()=>!1,(k==null?void 0:k.indexOf(".m3u8"))>-1){if(H.current.canPlayType("application/vnd.apple.mpegurl"))H.current.src=k;else if(G.ZP.isSupported()){var Ue=new G.ZP;Ue.loadSource(k),Ue.attachMedia(H.current)}}},[k]);const[le,ge]=(0,x.useState)(1),we=()=>{H.current.paused||H.current.ended?H.current.play():H.current.pause(),$()};function ze(){H.current.muted=!H.current.muted,H.current.muted?(Oe.current.setAttribute("data-volume",volume.value),Oe.current.value=0):Oe.current.value=Oe.current.dataset.volume}return x.createElement("div",{style:{position:"relative"},ref:Y},x.createElement("div",{ref:Z,className:`${l.watermark} animated_alternate animate__animated_10s animate__infinite animate__stepstart ${l.animate__loop}`},Te&&$e?$e.login:" "),x.createElement("div",{className:l.container},x.createElement("div",{className:l["video-container"],id:"video-container"},x.createElement("div",{className:l["playback-animation"],id:"playback-animation"},x.createElement("svg",{className:l["playback-icons"]},x.createElement("use",{className:"hidden",href:"#play-icon"}),x.createElement("use",{href:"#pause"}))),x.createElement("video",{className:l.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:H,autoPlay:Se}),x.createElement("div",{className:`${l["video-controls"]} `,id:"video-controls"},x.createElement("div",{className:l["bottom-controls"]},x.createElement("div",{className:l["left-controls"]},x.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:we},x.createElement("svg",{className:l["playback-icons"]},x.createElement("use",{ref:y,href:"#play-icon"}),x.createElement("use",{ref:b,style:{display:"none"},href:"#pause"}))),x.createElement("div",{className:l.time},x.createElement("time",{id:"time-elapsed",ref:Pe},"00:00"),x.createElement("span",null," / "),x.createElement("time",{id:"duration",ref:be},"00:00"))),x.createElement("div",{className:l["right-controls"]},F&&x.createElement(me.Z,{placement:"top",overlayClassName:l.rateOverlay,getPopupContainer:Ue=>Ue.parentNode,menu:{items:[{key:"1",label:x.createElement("span",{onClick:()=>{ge(1),H.current.playbackRate=1}},"1.0x")},{key:"2",label:x.createElement("span",{onClick:()=>{ge(1.5),H.current.playbackRate=1.5}},"1.5x")},{key:"3",label:x.createElement("span",{onClick:()=>{ge(2),H.current.playbackRate=2}},"2.0x")}]}},x.createElement("div",{className:`${l.controlText} mr5`},"\u500D\u901F")),x.createElement(se.CopyToClipboard,{text:k,onCopy:()=>de.ZP.success("\u590D\u5236\u6210\u529F")},x.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},x.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),x.createElement("div",{className:l["volume-controls"]},x.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:l["volume-button"],id:"volume-button",onClick:ze},x.createElement("i",{ref:Ae,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),x.createElement("i",{ref:et,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),x.createElement("i",{ref:ke,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),x.createElement("input",{className:l.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Oe,style:{display:"none"},onClick:ee})),x.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:l["fullscreen-button"],onClick:()=>{(0,ne.vp)()?(0,ne.BU)():(0,ne.Dj)(Y.current)}},x.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),x.createElement("div",{className:l["video-progress"]},x.createElement("progress",{ref:he,value:"0",min:"0"}),x.createElement("input",{className:l.seek,ref:V,value:"0",min:"0",type:"range",step:"1"}),x.createElement("div",{className:l["seek-tooltip"],ref:oe,id:"seek-tooltip"},"00:00"))))),x.createElement("svg",{style:{display:"none"}},x.createElement("defs",null,x.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},x.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),x.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},x.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),x.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},x.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),x.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},x.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),x.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},x.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),x.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},x.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),x.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},x.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),x.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},x.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},34728:function(Ct,He,S){"use strict";S.d(He,{SV:function(){return qe},ZP:function(){return Oe}});var x=S(59301),de=S(76374);const me={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"]},ue={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"]},G={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(`
|
|
`)}]},se={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 ne=S(53184),l=S.n(ne),K=(xe,it,$e)=>new Promise((De,ve)=>{var Le=fe=>{try{Re($e.next(fe))}catch(B){ve(B)}},re=fe=>{try{Re($e.throw(fe))}catch(B){ve(B)}},Re=fe=>fe.done?De(fe.value):Promise.resolve(fe.value).then(Le,re);Re(($e=$e.apply(xe,it)).next())});const P={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},m=(xe,it,$e,De)=>{const ve=it.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:$e.lineNumber,endColumn:$e.column});return Array.from(new Set(ve.match(/\b\w{2,}\b/g)||[])).map(re=>({label:re,kind:xe.languages.CompletionItemKind.Text,insertText:re,range:De}))},_=(xe,it,$e,De)=>{xe.languages.registerCompletionItemProvider(it,{provideCompletionItems(ve,Le){const re=ve.getWordUntilPosition(Le),Re={startLineNumber:Le.lineNumber,endLineNumber:Le.lineNumber,startColumn:re.startColumn,endColumn:re.endColumn},fe=ve.getLineContent(Le.lineNumber).substring(re.startColumn-2,re.endColumn);return{suggestions:[...m(xe,ve,Le,Re),...$e.map(A=>({label:A,kind:xe.languages.CompletionItemKind.Keyword,documentation:A,insertText:A,insertTextRules:xe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re})),...De.map(A=>({label:A.label,kind:xe.languages.CompletionItemKind.Snippet,documentation:A.content,insertText:fe.startsWith("#")?A.content.replace(/#/,""):A.content,insertTextRules:xe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}))]}}})};var E=xe=>{P.languages.forEach(it=>{xe.languages.registerDocumentFormattingEditProvider(it,{provideDocumentFormattingEdits($e){return K(this,null,function*(){const De=l()($e.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:$e.getFullModelRange(),text:De}]})}})}),_(xe,"java",ue.keywords,ue.quickKey),_(xe,"cpp",G.keywords,G.quickKey),_(xe,"c",me.keywords,[]),_(xe,"python",p.keywords,p.quickKey),_(xe,"scala",se.keywords,se.quickKey)};const w="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var F=Object.defineProperty,k=(xe,it,$e)=>it in xe?F(xe,it,{enumerable:!0,configurable:!0,writable:!0,value:$e}):xe[it]=$e,N=(xe,it,$e)=>k(xe,typeof it!="symbol"?it+"":it,$e);const L=class xl{constructor(it,$e,De){this.placeholder=it,this.editor=$e,this.monaco=De,$e.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return xl.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)}};N(L,"ID","editor.widget.placeholderHint");var D=L,C=S(96236),Q=S(6767),ce=S(25399),ae=S(78267),Se=S(33156),Ne=S(56102),Te=Object.defineProperty,je=Object.defineProperties,ie=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,Z=(xe,it,$e)=>it in xe?Te(xe,it,{enumerable:!0,configurable:!0,writable:!0,value:$e}):xe[it]=$e,Y=(xe,it)=>{for(var $e in it||(it={}))z.call(it,$e)&&Z(xe,$e,it[$e]);if(M)for(var $e of M(it))H.call(it,$e)&&Z(xe,$e,it[$e]);return xe},b=(xe,it)=>je(xe,ie(it)),y=(xe,it)=>{var $e={};for(var De in xe)z.call(xe,De)&&it.indexOf(De)<0&&($e[De]=xe[De]);if(xe!=null&&M)for(var De of M(xe))it.indexOf(De)<0&&H.call(xe,De)&&($e[De]=xe[De]);return $e},V=(xe,it,$e)=>new Promise((De,ve)=>{var Le=fe=>{try{Re($e.next(fe))}catch(B){ve(B)}},re=fe=>{try{Re($e.throw(fe))}catch(B){ve(B)}},Re=fe=>fe.done?De(fe.value):Promise.resolve(fe.value).then(Le,re);Re(($e=$e.apply(xe,it)).next())});function he(xe){return/^\d+$/.test(xe)?`${xe}px`:xe}function be(){}let Pe=!1;const oe={"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 Ae(xe=[]){let it=xe;if(Array.isArray(xe)){for(let $e=0;$e<xe.length;$e++){let De=oe[xe[$e]];if(De)return De}return it[0]}return oe[it]||it}let ke=null;const et=()=>V(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(xe){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",xe)}});var Oe=xe=>{var it=xe,{width:$e="100%",height:De="100%",value:ve,language:Le="javascript",style:re={},options:Re={},overrideServices:fe={},theme:B="vs-dark",onEditBlur:A,isCopy:U=!1,onSave:X,autoHeight:W=!1,forbidCopy:$=!1,forbidCopyTips:ee,onChange:le=be,editorDidMount:ge=be,onFocus:we=be,onBreakPoint:ze=be,breakPointValue:Ue=[],filename:Ye="educoder.txt",errorLine:Fe,errorContent:Ve="",highlightLine:Qe,openBreakPoint:Ie=!1,placeholder:tt="",showMiniMap:Nt=!0}=it,Et=y(it,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","forbidCopyTips","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const Rt=(0,x.useRef)(),ht=(0,x.useRef)({}),qt=(0,x.useRef)(),Vt=(0,x.useRef)(),bt=(0,x.useRef)([]),zt=(0,x.useRef)(!1),Tt=(0,x.useRef)(),_t=(0,x.useRef)(),Ot=(0,x.useRef)(!1),[St,Jt]=(0,x.useState)(!1);function Pt(){let Xe;return Rt.current&&(Xe=new de.Z(Ze=>{for(let ut of Ze)(ut.target.offsetHeight>0||ut.target.offsetWidth>0)&&ht.current.instance.layout()}),Xe.observe(Rt.current)),Xe}function xt(){Q.ZP.warning({content:decodeURIComponent(ee||w),key:"monaco-editor-tip"})}const Dt=()=>{let Xe=ht.current.instance;if(ve!=null&&Xe&&St){const Ze=Xe.getModel();Ze&&ve!==Ze.getValue()&&(Pe=!0,Ze.setValue(ve),Xe.layout(),Pe=!1)}};(0,x.useEffect)(()=>{const Xe=Se.Z.subscribe("formatDocument",Ze=>{var ut;let ft=ht.current.instance;(ut=ft==null?void 0:ft.getAction)==null||ut.call(ft,"editor.action.formatDocument").run()});return window.updateMonacoValue=Ze=>{le(Ze)},Xe},[]),(0,x.useEffect)(()=>{var Xe;let Ze=ht.current.instance;Vt.current&&clearTimeout(Vt.current),Vt.current=setTimeout(()=>{Dt()},500),ve&&(ve!=null&&ve.length)&&((Xe=Ze==null?void 0:Ze.updateOptions)==null||Xe.call(Ze,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(ve.split(/\r\n|\r|\n/g).length))+3,5)}))},[ve,St,ht.current]),(0,x.useEffect)(()=>{if(Fe&&ht.current&&ht.current.instance){let Ze=ht.current.instance;Ze.changeViewZones(function(ut){var ft=document.createElement("div");ft.style.padding="10px 20px",ft.style.width="calc(100% - 20px)",ft.className="my-error-line-wrp",ft.innerHTML=Ve,ut.addZone({afterLineNumber:Fe||11,heightInLines:3,domNode:ft})});var Xe={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}};Ze.addOverlayWidget(Xe),Ze.revealPositionInCenter({lineNumber:20,column:1})}},[Fe,ht.current,St]);const un=(Xe="",Ze)=>{if(!Xe||Xe.trim()==="")return!0;const ft=ht.current.instance.getModel().getLineTokens(Ze);let Lt=!1;for(let vt=0;vt<2;vt++)ft.getStandardTokenType(vt)===1&&(Lt=!0);return Lt};(0,x.useEffect)(()=>{var Xe;const Ze=(Xe=ht.current)==null?void 0:Xe.instance;if(Ze&&St&&$){const ut=Ze.onDidBlurEditorWidget(()=>{Ot.current=!1}),ft=Ze.onDidFocusEditorText(()=>{Ot.current=!0});return()=>{ut.dispose(),ft.dispose()}}},[ht.current,St,$]),(0,x.useEffect)(()=>{var Xe;if((Xe=ht.current)!=null&&Xe.instance&&St&&Ie){let Ze=ht.current.instance,ut=Ze.getModel();if(!ut)return;(()=>{var Wt;let Mt=[],Qt=[];const gn=ut.getAllDecorations();for(let Ke of gn)Ke.options.className==="highlighted-line"&&(Mt.push((Wt=Ke==null?void 0:Ke.range)==null?void 0:Wt.startLineNumber),Qt.push(Ke==null?void 0:Ke.id));if(Qe===Mt[0])return;ut.deltaDecorations(Qt,[]);const Be=ut.getLineCount();Qe&&Qe<=Be&&(Ze.deltaDecorations([],[{range:new ke.Range(Qe,1,Qe,ut.getLineMaxColumn(Qe)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Ze.revealLineInCenter(Qe))})();const Lt=(Wt=!1)=>{var Mt;let Qt=[],gn=[];const Be=ut.getAllDecorations();for(let Ke of Be)Ke.options.linesDecorationsClassName==="breakpoints-select"&&(Qt.push((Mt=Ke==null?void 0:Ke.range)==null?void 0:Mt.startLineNumber),gn.push(Ke==null?void 0:Ke.id));if(Wt)return{lines:Qt,ids:gn};ze(Qt)},vt=Wt=>V(void 0,null,function*(){let Mt={range:new ke.Range(Wt,1,Wt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield ut.deltaDecorations([],[Mt]),Lt()}),Kt=Wt=>V(void 0,null,function*(){let Mt=[];const Qt=Ze.getLineDecorations(Wt);for(let gn of Qt)gn.options.linesDecorationsClassName==="breakpoints-select"&&Mt.push(gn.id);yield ut.deltaDecorations(Mt,[]),Lt()}),$t=Wt=>{let Mt=Ze.getLineDecorations(Wt);for(let Qt of Mt)if(Qt.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,ae.isEqual)(Ue,Lt(!0).lines)){ut.deltaDecorations(Lt(!0).ids,[]);const Wt=Ue.map(Mt=>({range:new ke.Range(Mt,1,Mt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));ut.deltaDecorations([],Wt)}const gt=Ze.onDidChangeModelContent(Wt=>{let Mt=Ze.getPosition();if(Mt){let Qt=Mt.lineNumber;clearTimeout(_t.current),_t.current=setTimeout(()=>{un(ut.getLineContent(Qt),Qt)?Kt(Qt):$t(Qt)?(Kt(Qt),vt(Qt)):Lt()},100)}}),mt=Ze.onMouseDown(Wt=>{var Mt,Qt,gn;if(Wt.target.detail&&((gn=(Qt=(Mt=Wt.target)==null?void 0:Mt.element)==null?void 0:Qt.className)!=null&&gn.includes("line-numbers"))){let Be=Wt.target.position.lineNumber;if(un(ut.getLineContent(Be),Be))return;$t(Be)?Kt(Be):vt(Be)}}),Bt=Wt=>{let Mt={range:new ke.Range(Wt,1,Wt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};bt.current=Ze.deltaDecorations(bt.current,[Mt])},kt=()=>{bt.current=Ze.deltaDecorations(bt.current,[])},hn=Ze.onMouseMove(Wt=>{var Mt,Qt,gn;if(kt(),Wt.target.detail&&((gn=(Qt=(Mt=Wt.target)==null?void 0:Mt.element)==null?void 0:Qt.className)!=null&&gn.includes("line-numbers"))){let Be=Wt.target.position.lineNumber;if(un(ut.getLineContent(Be),Be))return;Bt(Be)}}),En=Ze.onMouseLeave(()=>{kt()});return()=>{gt.dispose(),mt.dispose(),hn.dispose(),En.dispose()}}},[ht.current,St,Ue,Qe,Ie,Le]),(0,x.useEffect)(()=>{var Xe;(Xe=ht.current)!=null&&Xe.instance&&Ie&&ht.current.instance.setPosition({lineNumber:0,column:0})},[Qe]);function Ft(){let Xe=ht.current.instance;if(Xe){const Ze=Xe.getSelection(),ut=ht.current.pastePos||{},ft=new ke.Range(ut.startLineNumber||Ze.endLineNumber,ut.startColumn||Ze.endColumn,ut.endLineNumber||Ze.endLineNumber,ut.endColumn||Ze.endColumn);setTimeout(()=>{Xe.executeEdits("",[{range:ft,text:""}])},300)}}function Ht(Xe){(window.navigator.platform.match("Mac")?Xe.metaKey:Xe.ctrlKey)&&Xe.keyCode==83&&(Xe.preventDefault(),X())}const It=()=>{if(W&&ht.current.instance){const Xe=ht.current.instance.getContentHeight();Ee(Xe<De?De:Xe)}else Ee(De)};function rt(Xe){var Ze=document.createEvent("MouseEvents");Ze.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Xe.dispatchEvent(Ze)}const d=Xe=>{if(!Ot.current)return;const{keyCode:Ze,ctrlKey:ut,metaKey:ft,target:Lt,type:vt}=Xe;return(vt==="paste"||(Ze===67||Ze===86)&&(ft||ut))&&Lt.nodeName==="TEXTAREA"&&(xt(),Xe.preventDefault()),!1};function g(Xe,Ze){var ut=window.URL||window.webkitURL||window,ft=new Blob([Ze]),Lt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Lt.href=ut.createObjectURL(ft),Lt.download=Xe,rt(Lt)}(0,x.useEffect)(()=>{It()},[It]),(0,x.useEffect)(()=>{Rt.current&&!St&&Promise.all([S.e(8909),S.e(5977)]).then(S.bind(S,71448)).then(Xe=>{try{ke=Xe,ht.current.instance=ke.editor.create(Rt.current,{value:ve,language:Ae(Le),theme:B,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:Nt||!1}},fe);const Ze=ht.current.instance;let Lt=[...C.BH._menuItems].find(gt=>gt[0]._debugName=="EditorContext")[1],vt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Kt=(gt,mt)=>{var Bt,kt;let hn=gt._first;do mt.includes((kt=(Bt=hn.element)==null?void 0:Bt.command)==null?void 0:kt.id)&>._remove(hn);while(hn=hn.next)};if(ge(Ze,ke),setTimeout(()=>{It(),ht.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{g(Ye||"educoder.txt",Ze.getValue())}})},500),ht.current.subscription=Ze.onDidChangeModelContent(gt=>{zt.current?clearTimeout(Tt.current):(It(),le(Ze.getValue(),gt)),Tt.current=setTimeout(()=>{zt.current=!1},500)}),window.Monaco||E(ke,Ae(Le)),$&&(Kt(Lt,vt),Rt.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",d),window.removeEventListener("paste",d),window.addEventListener("keydown",d),window.addEventListener("paste",d)),window.Monaco=ke,A&&Ze.onDidBlurEditorWidget(()=>{A(Ze.getValue())}),we&&Ze.onDidFocusEditorText(()=>{$&&et(),we(Ze.getValue())}),$){et();try{Ze.onDidPaste(gt=>{const mt=Ze.getSelection(),Bt=ht.current.pastePos||{},kt=new ke.Range(Bt.startLineNumber||mt.endLineNumber,Bt.startColumn||mt.endColumn,Bt.endLineNumber||mt.endLineNumber,Bt.endColumn||mt.endColumn);Ze.executeEdits("",[{range:gt.range,text:""}])})}catch(gt){}}let $t=Pt();return tt&&typeof tt=="string"&&new D(tt,Ze,ke),Jt(!0),()=>{const gt=ht.current.instance;gt.dispose();const mt=gt.getModel();mt&&mt.dispose(),ht.current.subscription&&ht.current.subscription.dispose(),$t.unobserve(Rt.current)}}catch(Ze){}})},[]),(0,x.useEffect)(()=>{if(ht.current.instance&&St)return document.addEventListener("keydown",Ht,!1),()=>{document.removeEventListener("keydown",Ht)}},[X,St]),(0,x.useEffect)(()=>{let Xe=ht.current.instance;if(Xe&&St){let Ze=Ae(Le);ke.editor.setModelLanguage(Xe.getModel(),Ze)}},[Le,St]),(0,x.useEffect)(()=>{ht.current.instance&&St&&ke.editor.setTheme(B)},[B,St]),(0,x.useEffect)(()=>{let Xe=ht.current.instance;qt.current=Re,Xe&&St&&(Xe.updateOptions(Y({},Re)),setTimeout(()=>{Xe.getModel().updateOptions(Y({},Re))},200))},[JSON.stringify(Re),St]),(0,x.useEffect)(()=>{let Xe=ht.current.instance;Xe&&St&&Xe.layout()},[$e,De,St]);const[T,j]=(0,x.useState)(he($e)),[te,Ee]=(0,x.useState)(he(De)),Ce=b(Y({},re),{width:T,height:te,position:"relative"});return x.createElement("div",{className:"my-monaco-editor",ref:Rt,style:Ce,onFocus:()=>{$&&et()}},U&&x.createElement(Ne.CopyToClipboard,{text:ve,onCopy:()=>Q.ZP.success("\u590D\u5236\u6210\u529F")},x.createElement(ce.Z,{title:"\u590D\u5236\u4EE3\u7801"},x.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},x.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function qe({width:xe="100%",height:it="100%",original:$e,modified:De,language:ve,options:Le={}}){const re=(0,x.useRef)(),[Re,fe]=(0,x.useState)(null);function B(W){let $;return re.current&&($=new de.Z(ee=>{for(let le of ee)(le.target.offsetHeight>0||le.target.offsetWidth>0)&&W.layout()}),$.observe(re.current)),$}(0,x.useEffect)(()=>(re.current&&Promise.all([S.e(8909),S.e(9404)]).then(S.bind(S,2550)).then(W=>{ke=W;const $=ke.editor.createDiffEditor(re.current,b(Y({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},Le),{wordWrap:!0}));fe($);let ee=B($);return()=>{$.dispose();const le=$.getModel();le&&le.dispose(),ee.unobserve(re.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,x.useEffect)(()=>{Re&&Re.setModel({original:ke.editor.createModel($e,ve),modified:ke.editor.createModel(De,ve)})},[$e,De,ve,Re]);const A=he(xe),U=he(it),X={width:A,height:U};return x.createElement("div",{className:"my-diff-editor",ref:re,style:X})}},79006:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return de}});var x=S(59301);function de(me,ue){const G=(0,x.useRef)();(0,x.useEffect)(()=>{G.current=me}),(0,x.useEffect)(()=>{function p(){G.current()}if(ue!==null){let se=setInterval(p,ue);return()=>clearInterval(se)}},[ue])}},70157:function(Ct,He,S){"use strict";S.r(He),S.d(He,{default:function(){return $},formatQuery:function(){return X}});var x=S(59301),de=S(44283),me=S(29787),ue={bg:"bg___eq_Aq",container:"container___j770l",widthle:"widthle___ouh1T"},G=S(24334),p=S(42972),se=S(62957),ne=S(63139),l=S(58755),K=S(584),P={contentWrap:"contentWrap___xMJQi",title:"title___z4t4P",footer:"footer___CLzrT",footer_left:"footer_left___N2sZZ",footer_bfcs:"footer_bfcs___UmvUE",footer_bfcs_value:"footer_bfcs_value___yiYga",pingfen:"pingfen___aEEMe",fenshu:"fenshu___I6HCo",radioGroup:"radioGroup___RT1dL",wrap:"wrap___QZGSJ",introName:"introName___m17tA",rating:"rating___MXLBr",modalRating:"modalRating___aluwj",zdbf:"zdbf___9PNEF"},m=S(79006),_=S(60269),E=S(76406),w=S(59301),F=Object.defineProperty,k=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,O=(ee,le,ge)=>le in ee?F(ee,le,{enumerable:!0,configurable:!0,writable:!0,value:ge}):ee[le]=ge,D=(ee,le)=>{for(var ge in le||(le={}))N.call(le,ge)&&O(ee,ge,le[ge]);if(k)for(var ge of k(le))L.call(le,ge)&&O(ee,ge,le[ge]);return ee},C=(ee,le)=>{var ge={};for(var we in ee)N.call(ee,we)&&le.indexOf(we)<0&&(ge[we]=ee[we]);if(ee!=null&&k)for(var we of k(ee))le.indexOf(we)<0&&L.call(ee,we)&&(ge[we]=ee[we]);return ge},Q=(ee,le,ge)=>new Promise((we,ze)=>{var Ue=Ve=>{try{Fe(ge.next(Ve))}catch(Qe){ze(Qe)}},Ye=Ve=>{try{Fe(ge.throw(Ve))}catch(Qe){ze(Qe)}},Fe=Ve=>Ve.done?we(Ve.value):Promise.resolve(Ve.value).then(Ue,Ye);Fe((ge=ge.apply(ee,le)).next())});const ce=ee=>{var le=ee,{videoDetail:ge,globalSetting:we,loading:ze,dispatch:Ue}=le,Ye=C(le,["videoDetail","globalSetting","loading","dispatch"]);const{queryParams:Fe,selectParams:Ve,videoList:Qe}=ge,{subject_id:Ie,videoId:tt}=Fe,{checkBoxValue:Nt,radioValue:Et}=Ve,Rt={videoId:tt},ht={query:Fe},qt=(0,x.useRef)(),Vt=(0,x.useRef)(),bt=(0,x.useRef)(),zt=(0,x.useRef)(5),{video_item:Tt}=ge.detail||{};(0,m.Z)(()=>Q(void 0,null,function*(){Vt.current&&(console.log("videoRef lastUpdatedTime: ",qt.current.getLastUpdatedTime()),console.log(qt.current),yield _t())}),zt.current*1e3);const _t=(Ft=!1)=>{const Ht=Ft?{is_f:1}:{};return(0,_.DH)(D(D({},Ht),{id:Rt.videoId,point:qt.current.getLastUpdatedTime(),total:qt.current.getDuration()}))},Ot=Ft=>(Ft.ed==="1"&&(Vt.current=!1,_t(!0)),!Vt.current&&!Ft.ed&&(Vt.current=!0,zt.current=qt.current.getDuration()<=5?1:5,_t()),Ue({type:"userDetail/logWatchHistory",payload:Ft})),St=()=>{Vt.current=!1},Jt=()=>{Vt.current=!0},Pt=()=>{bt.current=5,se.default.confirm({width:600,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BF7\u7ED9\u672C\u89C6\u9891\u8BC4\u5206",content:w.createElement("div",{className:"tc font14"},w.createElement(ne.Z,{defaultValue:bt.current,onChange:Ft=>bt.current=Ft,className:P.modalRating})),onOk:()=>Q(void 0,null,function*(){if((yield(0,_.jK)({id:Rt.videoId,star:bt.current})).status===0){const{course_id:Ht}=(0,E.oP)();Ue({type:"videoDetail/getVideoDetail",payload:{id:Rt.videoId,videoId:Rt.videoId,course_id:Ht,subject_id:Ie}})}})})},xt=Ft=>{const Ht=window.filterVideoSign,It=Ht.findIndex(te=>te.id===tt);if(It===Ht.length-1)return;const d=Ht[It+1].id,g=Ht[It+1].can_view,T=Ht[It+1].link,j=Ht[It+1].is_public;if(window.checkBoxValue){if(T){window.open(T);return}if(!g){se.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:w.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650")});return}if(!j){se.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:w.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}Ue({type:"videoDetail/handleListItemClick",payload:{videoId:d}}),window.videoTimer=setTimeout(()=>{Ft.current.play()},2e3)}},Dt=(Ft,Ht)=>{if(Ft==="checkBox"){const It=Ht;window.checkBoxValue=It,Ue({type:"videoDetail/setSelectValue",payload:{radioValue:Et,checkBoxValue:It}});return}Ue({type:"videoDetail/setSelectValue",payload:{checkBoxValue:Nt,radioValue:Ht.target.value}})},un=()=>Qe.findIndex(It=>It.id===tt)===Qe.length-1?w.createElement("div",null,"\u5F53\u524D\u5DF2\u662F\u6700\u540E\u4E00\u4E2A\u89C6\u9891"):w.createElement("div",null,w.createElement(l.Z,{onChange:It=>{Dt("checkBox",It)},defaultChecked:Nt,size:"small"}),w.createElement("span",{className:P.zdbf},"\u81EA\u52A8\u64AD\u653E\u4E0B\u4E00\u4E2A\u89C6\u9891"));return w.createElement("aside",{className:P.contentWrap},w.createElement("aside",{className:P.wrap},w.createElement("header",null),w.createElement("div",{className:P.title},Tt==null?void 0:Tt.name),!(Tt!=null&&Tt.can_edit)&&!(Tt!=null&&Tt.is_public)?w.createElement(K.Z,{description:"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85"}):w.createElement(p.Z,{ref:qt,startTime:Tt==null?void 0:Tt.last_point,src:Tt!=null&&Tt.is_link?Tt==null?void 0:Tt.link:(Tt==null?void 0:Tt.play_url)&&G.Base64.decode(Tt==null?void 0:Tt.play_url),videoId:Tt==null?void 0:Tt.video_id,logWatchHistory:Ot,handlePause:St,handlePlay:Jt,allow_skip:Tt==null?void 0:Tt.allow_skip,handlePlayEnded:xt,toLog:()=>{}}),w.createElement("div",{className:P.footer},w.createElement("div",{className:P.footer_left},w.createElement("div",{className:P.pingfen},"\u8BC4\u5206"),w.createElement(ne.Z,{value:Tt==null?void 0:Tt.star,disabled:!0,className:P.rating,style:{color:"#FFA100",fontSize:12,marginLeft:10}}),w.createElement("div",{className:P.fenshu},(Tt==null?void 0:Tt.star)||0,"\u5206")),!(Tt!=null&&Tt.can_edit)&&!(Tt!=null&&Tt.is_public)?null:w.createElement("div",null,w.createElement("div",{className:P.checkBox},un()))),w.createElement("div",{className:"mt10"},(Tt==null?void 0:Tt.description)&&w.createElement("span",{className:P.introName},"\u7B80\u4ECB\uFF1A",Tt.description))))};var ae=(0,de.connect)(({videoDetail:ee,loading:le,globalSetting:ge})=>({videoDetail:ee,globalSetting:ge,loading:le}))(ce),Se=S(6767),Ne=S(18287),Te={flex_box_center:"flex_box_center___yWqSL",flex_space_between:"flex_space_between___LgFmv",flex_box_vertical_center:"flex_box_vertical_center____lt6U",flex_box_center_end:"flex_box_center_end___UqkaD",flex_box_column:"flex_box_column___V8XLF",list:"list___8tjfT",tree_style:"tree_style___ZzDvO",title:"title___IVfkQ",gray:"gray___RnyYk",brght:"brght___EWRNa",s1:"s1___dPBQg",s3:"s3___SRBBG",active:"active___hsNCX",tree_line:"tree_line___EGn30",tabs_style:"tabs_style___Nwkiq",tabs_item:"tabs_item___Vzu_U",tabs_item_active:"tabs_item_active___BcIwZ"},je=S(84849),ie=S(66443),M=S(14185),z=S(59301),H=Object.defineProperty,Z=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,he=(ee,le,ge)=>le in ee?H(ee,le,{enumerable:!0,configurable:!0,writable:!0,value:ge}):ee[le]=ge,be=(ee,le)=>{for(var ge in le||(le={}))y.call(le,ge)&&he(ee,ge,le[ge]);if(b)for(var ge of b(le))V.call(le,ge)&&he(ee,ge,le[ge]);return ee},Pe=(ee,le)=>Z(ee,Y(le)),oe=(ee,le)=>{var ge={};for(var we in ee)y.call(ee,we)&&le.indexOf(we)<0&&(ge[we]=ee[we]);if(ee!=null&&b)for(var we of b(ee))le.indexOf(we)<0&&V.call(ee,we)&&(ge[we]=ee[we]);return ge},Ae=(ee,le,ge)=>new Promise((we,ze)=>{var Ue=Ve=>{try{Fe(ge.next(Ve))}catch(Qe){ze(Qe)}},Ye=Ve=>{try{Fe(ge.throw(Ve))}catch(Qe){ze(Qe)}},Fe=Ve=>Ve.done?we(Ve.value):Promise.resolve(Ve.value).then(Ue,Ye);Fe((ge=ge.apply(ee,le)).next())});const ke=[{name:"\u5B9E\u8DF5\u9879\u76EE",type:"Shixun",icon:z.createElement("i",{className:"iconfont icon-shixun2 font20"}),bq:z.createElement("span",{style:{border:"1px solid #FF9D18",color:"#FF9D18"},className:Te.s1},"\u5B9E\u8BAD")},{name:"\u89C6\u9891\u9879\u76EE",type:"VideoItem",icon:z.createElement("i",{className:"iconfont icon-shipin font20"}),bq:z.createElement("span",{style:{border:"1px solid #9B18FF",color:"#9B18FF"},className:Te.s1},"\u89C6\u9891")},{name:"\u6559\u5B66\u8BFE\u4EF6",type:"Attachment",icon:z.createElement("i",{className:"iconfont icon-jiaoxueanli font20"}),bq:z.createElement("span",{style:{border:"1px solid #3061D0",color:"#3061D0"},className:Te.s1},"\u8D44\u6599")},{name:"\u7A7A\u76EE\u5F55",type:"StageCatalog",icon:z.createElement("i",{className:"iconfont icon-kongbai font20"}),bq:z.createElement("span",null)}],et=ee=>{var le=ee,{dispatch:ge,pathsDetail:we,videoDetail:ze,user:Ue}=le,Ye=oe(le,["dispatch","pathsDetail","videoDetail","user"]);const{queryParams:Fe,stages:Ve,cust_seq:Qe,active:Ie}=ze,{subject_id:tt,course_id:Nt}=Fe,Et=(0,de.useParams)(),[Rt]=(0,de.useSearchParams)(),[ht,qt]=(0,x.useState)([]),[Vt,bt]=(0,x.useState)([(Ie==null?void 0:Ie.id)||Number(Et.videoId)]),[zt,Tt]=(0,x.useState)("\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55"),_t=[".PDF",".DOC",".DOCX",".XLS",".XLSX",".PPT",".PPTX"];(0,x.useEffect)(()=>{ge(tt?{type:"videoDetail/getStageData",payload:{subject_id:tt,page_type:"video"}}:{type:"videoDetail/getCourseStageData",payload:{coursesId:Nt}})},[]),(0,x.useEffect)(()=>{Ot()},[ze==null?void 0:ze.stages]);const Ot=()=>{let It=ht;Ve.forEach((rt,d)=>{It.push({title:z.createElement("div",{title:rt.stage_name,className:Te.title},rt.stage_name),value:rt==null?void 0:rt.stage_id,key:rt==null?void 0:rt.stage_id,icon:z.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:St(rt.items||[])})}),qt(It)},St=It=>{function rt(d){var g;const T=d.children,j=Array.isArray(T)&&T.length>0,te=d==null?void 0:d.id,{name:Ee,item_type:Ce,id:Xe}=d,Ze=(g=ke.find(Lt=>Lt.type===Ce))==null?void 0:g.bq,ut=Te.brght,ft=Ie.id===Xe?`${ut} ${Te.active}`:ut;return{title:z.createElement("div",{onClick:()=>Dt(d),className:ut,title:Ee},Ze,z.createElement("div",{className:Te.s3},Ee)),value:te,key:te,icon:z.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:j?T==null?void 0:T.map(Lt=>rt(Lt)):[]}}return It==null?void 0:It.map(d=>rt(d))},Jt=(It,rt)=>Ae(void 0,null,function*(){ge({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF0C\u8BF7\u7A0D\u540E..."}});const d=rt?yield(0,ie.BK)({id:It}):yield(0,ie.Ir)({id:It});if(ge({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),d!=null&&d.game_identifier||d!=null&&d.identifier){(0,E.xg)(rt?`/tasks/${d==null?void 0:d.identifier}/jupyter`:`/tasks/${d.game_identifier}`);return}(d==null?void 0:d.status)===2?xt(d==null?void 0:d.message):(d==null?void 0:d.status)===3&&Pt(d==null?void 0:d.message)}),Pt=It=>{se.default.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:z.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",It,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},xt=It=>{It=It!=null&&It.includes(".json")?It:`${It}.json`,se.default.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:z.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:()=>Ae(void 0,null,function*(){const rt=yield(0,je.L8)({url:It});if(!rt)return;Se.ZP.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF01");const d=yield(0,ie.Ir)({id:rt.shixun_identifier});if(d!=null&&d.game_identifier){(0,E.xg)(`/tasks/${d.game_identifier}`);return}(d==null?void 0:d.status)===2?xt(d==null?void 0:d.message):(d==null?void 0:d.status)===3&&Pt(d==null?void 0:d.message)})})},Dt=It=>{var rt,d,g,T,j;if((It==null?void 0:It.item_type)==="StageCatalog")return;clearTimeout(window.videoTimer);const{id:te,item_type:Ee,identifier:Ce,is_jupyter:Xe,url:Ze,link:ut}=It;if(Ee==="VideoItem"&&!ut){if(!((rt=Ue.userInfo)!=null&&rt.admin)&&!((d=Ue.userInfo)!=null&&d.business)&&!It.can_view){se.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:z.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650")});return}ge({type:"videoDetail/handleListItemClick",payload:{videoId:te}}),ge({type:"videoDetail/getVideoDetail",payload:Pe(be({id:te},Fe),{videoId:te}),callback:ft=>{if(ft&&ft.video_item&&!ft.video_item.can_edit&&!It.is_public){se.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:z.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}}});return}if(Ee==="VideoItem"&&ut){It.link&&(0,_.DH)({is_f:1,id:It.id,point:0,total:0}),window.open(ut);return}if(Ee==="Shixun"){Jt(Ce,Xe);return}if(Ee==="Attachment"){if(ut){(0,E.xg)(ut);return}let ft=(T=It==null?void 0:It.name)==null?void 0:T.substr((g=It==null?void 0:It.name)==null?void 0:g.lastIndexOf("."));if(_t.includes(ft.toUpperCase())){ge({type:"videoDetail/handleListItemClick",payload:{attachmentId:te}});return}else{if(!((j=we.detail)!=null&&j.allow_download)){Se.ZP.info("\u6559\u5B66\u8BFE\u4EF6\u4E0D\u652F\u6301\u4E0B\u8F7D");return}(0,E.FH)(It.name,M.Z.API_SERVER+It.url);return}}window.open(M.Z.IMG_SERVER+Ze)},un=It=>{let rt=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],d=["","\u5341","\u767E","\u5343","\u4E07"];It=parseInt(It);let g=te=>{let Ee=te.toString().split("").reverse(),Ce="";for(var Xe=0;Xe<Ee.length;Xe++)Ce=(Xe==0&&Ee[Xe]==0||Xe>0&&Ee[Xe]==0&&Ee[Xe-1]==0?"":rt[Ee[Xe]]+(Ee[Xe]==0?d[0]:d[Xe]))+Ce;return Ce},T=Math.floor(It/1e4),j=It%1e4;return j.toString().length<4&&(j="0"+j),T?g(T)+"\u4E07"+g(j):g(It)},Ft=(It,rt,d,g)=>{var T;const{name:j,item_type:te,id:Ee}=It,Ce=`${rt+1}-${d+1}-${g+1}`,Xe=(T=ke.find(ft=>ft.type===te))==null?void 0:T.icon,Ze=Te.brght,ut=Ie.id===Ee?`${Ze} ${Te.active}`:Ze;return z.createElement("div",{key:Ce,onClick:()=>Dt(It),className:ut,style:{paddingLeft:52}},z.createElement("span",{className:Te.s1},Xe),!!Qe&&z.createElement("span",{className:Te.s2},Ce),z.createElement("span",{className:Te.s3},"\u203B ",j))},Ht=(It,rt,d)=>{var g;const{name:T,item_type:j,id:te,children:Ee}=It,Ce=`${rt+1}-${d+1}`,Xe=(g=ke.find(ft=>ft.type===j))==null?void 0:g.icon,Ze=Te.brght,ut=Ie.id===te?`${Ze} ${Te.active}`:Ze;return z.createElement(x.Fragment,{key:Ce},z.createElement("div",{onClick:()=>Dt(It),className:ut},z.createElement("span",{className:Te.s1},Xe),!!Qe&&z.createElement("span",{className:Te.s2},Ce),z.createElement("span",{className:Te.s3},"\u203B ",T)),!!Ee.length&&Ee.map((ft,Lt)=>Ft(ft,rt,d,Lt)))};return z.createElement("aside",{className:Te.list},z.createElement("div",{className:Te.tabs_style},z.createElement("div",{className:Te.tabs_item,onClick:()=>{Tt("\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55")}},"\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55",zt=="\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55"&&z.createElement("div",{className:Te.tabs_item_active}))),z.createElement("div",{className:Te.tree_style},(ht==null?void 0:ht.length)>0&&z.createElement(Ne.default,{selectedKeys:Vt,onSelect:(It,rt)=>{bt([...It])},blockNode:!0,treeData:ht,defaultExpandAll:!0,className:Te.tree_line})))};var Oe=(0,de.connect)(({user:ee,videoDetail:le,loading:ge,globalSetting:we,pathsDetail:ze})=>({user:ee,videoDetail:le,globalSetting:we,loading:ge,pathsDetail:ze}))(et),qe=S(86974),xe=S(59301),it=Object.defineProperty,$e=Object.defineProperties,De=Object.getOwnPropertyDescriptors,ve=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable,Re=(ee,le,ge)=>le in ee?it(ee,le,{enumerable:!0,configurable:!0,writable:!0,value:ge}):ee[le]=ge,fe=(ee,le)=>{for(var ge in le||(le={}))Le.call(le,ge)&&Re(ee,ge,le[ge]);if(ve)for(var ge of ve(le))re.call(le,ge)&&Re(ee,ge,le[ge]);return ee},B=(ee,le)=>$e(ee,De(le)),A=(ee,le)=>{var ge={};for(var we in ee)Le.call(ee,we)&&le.indexOf(we)<0&&(ge[we]=ee[we]);if(ee!=null&&ve)for(var we of ve(ee))le.indexOf(we)<0&&re.call(ee,we)&&(ge[we]=ee[we]);return ge},U=(ee,le,ge)=>new Promise((we,ze)=>{var Ue=Ve=>{try{Fe(ge.next(Ve))}catch(Qe){ze(Qe)}},Ye=Ve=>{try{Fe(ge.throw(Ve))}catch(Qe){ze(Qe)}},Fe=Ve=>Ve.done?we(Ve.value):Promise.resolve(Ve.value).then(Ue,Ye);Fe((ge=ge.apply(ee,le)).next())});const X=ee=>{const{subject_id:le}=ee;return{subject_id:le,course_id:le}},W=ee=>{var le=ee,{videoDetail:ge,globalSetting:we,loading:ze,pathsDetail:Ue,dispatch:Ye}=le,Fe=A(le,["videoDetail","globalSetting","loading","pathsDetail","dispatch"]),Ve,Qe;const{queryParams:Ie,videoList:tt,attachmentList:Nt,active:Et}=ge,{subject_id:Rt,videoId:ht}=Ie,qt={videoId:ht};(0,x.useEffect)(()=>{if(Et){const{item_type:zt,id:Tt}=Et;zt==="VideoItem"&&Ye({type:"videoDetail/getVideoDetail",payload:B(fe({},Ie),{id:Tt})})}},[Et.id]),console.log("---",Et),(0,x.useEffect)(()=>{Rt&&Vt()},[]);function Vt(){return U(this,null,function*(){const zt=yield Ye({type:"pathsDetail/getPathsDetail",payload:{id:Rt}})})}(0,x.useEffect)(()=>{var zt,Tt;(0,E.Dk)((Tt=(zt=ge.detail)==null?void 0:zt.video_item)==null?void 0:Tt.name)},[ge]);let bt={width:1200};return Et&&Et.item_type==="Attachment"&&Et.content_type==="application/pdf"&&(bt={width:1250,marginLeft:(document.body.clientWidth-1200)/2}),xe.createElement(me.Z,{spinning:!1},xe.createElement("section",{className:ue.bg},xe.createElement("div",{className:ue.container,style:bt},xe.createElement(Oe,null),Et&&Et.item_type==="VideoItem"&&xe.createElement(ae,null),Et&&Et.item_type==="Attachment"&&Et.content_type==="application/pdf"&&Et.url&&xe.createElement("div",{className:ue.widthle},xe.createElement(qe.Z,{disabledDownload:!((Ve=Ue.detail)!=null&&Ve.allow_download),type:"pdf",filename:Et.name,data:M.Z.API_SERVER+Et.url,style:{position:"absolute",zIndex:1}})),Et&&Et.item_type==="Attachment"&&["application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(Et.content_type)&&Et.url&&xe.createElement("div",{className:ue.widthle},xe.createElement(qe.Z,{disabledDownload:!((Qe=Ue.detail)!=null&&Qe.allow_download),type:"office",data:M.Z.API_SERVER+Et.url,style:{position:"absolute",zIndex:1}})))))};var $=(0,de.connect)(({videoDetail:ee,loading:le,globalSetting:ge,pathsDetail:we})=>({videoDetail:ee,globalSetting:ge,loading:le,pathsDetail:we}))(W)},67195:function(Ct,He,S){"use strict";S.d(He,{BU:function(){return de},Dj:function(){return x},gH:function(){return me},vp:function(){return ue}});function x(G){try{G.mozRequestFullScreen?G.mozRequestFullScreen():G.webkitRequestFullScreen&&G.webkitRequestFullScreen()}catch(p){console.log(p,":e")}}function de(){window.top.document.webkitExitFullscreen?window.top.document.webkitExitFullscreen():document.exitFullscreen?window.top.document.exitFullscreen():document.msExitFullscreen?window.top.document.msExitFullscreen():document.mozCancelFullScreen&&window.top.document.mozCancelFullScreen()}const me=()=>{if(document.webkitExitFullscreen)return"webkitfullscreenchange";if(document.exitFullscreen)return"fullscreenchange";if(document.msExitFullscreen)return"msfullscreenchange";if(document.mozCancelFullScreen)return"mozfullscreenchange"};function ue(){var G=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement,p=document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",G),window.isFullScreen?window.isFullScreen:G!=null}},72790:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return It}});class x{static install(){Object.setPrototypeOf=Object.setPrototypeOf||function(d,g){return d.__proto__=g,d},Object.assign=Object.assign||function(d){if(d==null)throw new TypeError("Cannot convert undefined or null to object");let g=Object(d);for(let T=1;T<arguments.length;T++){let j=arguments[T];if(j!=null)for(let te in j)j.hasOwnProperty(te)&&(g[te]=j[te])}return g},typeof self.Promise!="function"&&S(3867).polyfill()}}x.install();var de=x,me=S(86204),ue=S.n(me);class G{static e(d,g){(!d||G.FORCE_GLOBAL_TAG)&&(d=G.GLOBAL_TAG);let T=`[${d}] > ${g}`;G.ENABLE_CALLBACK&&G.emitter.emit("log","error",T),G.ENABLE_ERROR&&(console.error?console.error(T):console.warn?console.warn(T):console.log(T))}static i(d,g){(!d||G.FORCE_GLOBAL_TAG)&&(d=G.GLOBAL_TAG);let T=`[${d}] > ${g}`;G.ENABLE_CALLBACK&&G.emitter.emit("log","info",T),G.ENABLE_INFO&&(console.info?console.info(T):console.log(T))}static w(d,g){(!d||G.FORCE_GLOBAL_TAG)&&(d=G.GLOBAL_TAG);let T=`[${d}] > ${g}`;G.ENABLE_CALLBACK&&G.emitter.emit("log","warn",T),G.ENABLE_WARN&&(console.warn?console.warn(T):console.log(T))}static d(d,g){(!d||G.FORCE_GLOBAL_TAG)&&(d=G.GLOBAL_TAG);let T=`[${d}] > ${g}`;G.ENABLE_CALLBACK&&G.emitter.emit("log","debug",T),G.ENABLE_DEBUG&&(console.debug?console.debug(T):console.log(T))}static v(d,g){(!d||G.FORCE_GLOBAL_TAG)&&(d=G.GLOBAL_TAG);let T=`[${d}] > ${g}`;G.ENABLE_CALLBACK&&G.emitter.emit("log","verbose",T),G.ENABLE_VERBOSE&&console.log(T)}}G.GLOBAL_TAG="flv.js",G.FORCE_GLOBAL_TAG=!1,G.ENABLE_ERROR=!0,G.ENABLE_INFO=!0,G.ENABLE_WARN=!0,G.ENABLE_DEBUG=!0,G.ENABLE_VERBOSE=!0,G.ENABLE_CALLBACK=!1,G.emitter=new(ue());var p=G;class se{constructor(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}reset(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}addBytes(d){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=d,this._totalBytes+=d):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=d,this._totalBytes+=d):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=d,this._totalBytes+=d,this._lastCheckpoint=this._now())}get currentKBps(){this.addBytes(0);let d=(this._now()-this._lastCheckpoint)/1e3;return d==0&&(d=1),this._intervalBytes/d/1024}get lastSecondKBps(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}get averageKBps(){let d=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/d/1024}}var ne=se;class l{constructor(d){this._message=d}get name(){return"RuntimeException"}get message(){return this._message}toString(){return this.name+": "+this.message}}class K extends l{constructor(d){super(d)}get name(){return"IllegalStateException"}}class P extends l{constructor(d){super(d)}get name(){return"InvalidArgumentException"}}class m extends l{constructor(d){super(d)}get name(){return"NotImplementedException"}}const _={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},E={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"};class w{constructor(d){this._type=d||"undefined",this._status=_.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}destroy(){this._status=_.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}isWorking(){return this._status===_.kConnecting||this._status===_.kBuffering}get type(){return this._type}get status(){return this._status}get needStashBuffer(){return this._needStash}get onContentLengthKnown(){return this._onContentLengthKnown}set onContentLengthKnown(d){this._onContentLengthKnown=d}get onURLRedirect(){return this._onURLRedirect}set onURLRedirect(d){this._onURLRedirect=d}get onDataArrival(){return this._onDataArrival}set onDataArrival(d){this._onDataArrival=d}get onError(){return this._onError}set onError(d){this._onError=d}get onComplete(){return this._onComplete}set onComplete(d){this._onComplete=d}open(d,g){throw new m("Unimplemented abstract function!")}abort(){throw new m("Unimplemented abstract function!")}}let F={};function k(){let rt=self.navigator.userAgent.toLowerCase(),d=/(edge)\/([\w.]+)/.exec(rt)||/(opr)[\/]([\w.]+)/.exec(rt)||/(chrome)[ \/]([\w.]+)/.exec(rt)||/(iemobile)[\/]([\w.]+)/.exec(rt)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(rt)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(rt)||/(webkit)[ \/]([\w.]+)/.exec(rt)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(rt)||/(msie) ([\w.]+)/.exec(rt)||rt.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(rt)||rt.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(rt)||[],g=/(ipad)/.exec(rt)||/(ipod)/.exec(rt)||/(windows phone)/.exec(rt)||/(iphone)/.exec(rt)||/(kindle)/.exec(rt)||/(android)/.exec(rt)||/(windows)/.exec(rt)||/(mac)/.exec(rt)||/(linux)/.exec(rt)||/(cros)/.exec(rt)||[],T={browser:d[5]||d[3]||d[1]||"",version:d[2]||d[4]||"0",majorVersion:d[4]||d[2]||"0",platform:g[0]||""},j={};if(T.browser){j[T.browser]=!0;let te=T.majorVersion.split(".");j.version={major:parseInt(T.majorVersion,10),string:T.version},te.length>1&&(j.version.minor=parseInt(te[1],10)),te.length>2&&(j.version.build=parseInt(te[2],10))}if(T.platform&&(j[T.platform]=!0),(j.chrome||j.opr||j.safari)&&(j.webkit=!0),j.rv||j.iemobile){j.rv&&delete j.rv;let te="msie";T.browser=te,j[te]=!0}if(j.edge){delete j.edge;let te="msedge";T.browser=te,j[te]=!0}if(j.opr){let te="opera";T.browser=te,j[te]=!0}if(j.safari&&j.android){let te="android";T.browser=te,j[te]=!0}j.name=T.browser,j.platform=T.platform;for(let te in F)F.hasOwnProperty(te)&&delete F[te];Object.assign(F,j)}k();var N=F;class L extends w{static isSupported(){try{let d=N.msedge&&N.version.minor>=15048,g=N.msedge?d:!0;return self.fetch&&self.ReadableStream&&g}catch(d){return!1}}constructor(d,g){super("fetch-stream-loader"),this.TAG="FetchStreamLoader",this._seekHandler=d,this._config=g,this._needStash=!0,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),super.destroy()}open(d,g){this._dataSource=d,this._range=g;let T=d.url;this._config.reuseRedirectedURL&&d.redirectedURL!=null&&(T=d.redirectedURL);let j=this._seekHandler.getConfig(T,g),te=new self.Headers;if(typeof j.headers=="object"){let Ce=j.headers;for(let Xe in Ce)Ce.hasOwnProperty(Xe)&&te.append(Xe,Ce[Xe])}let Ee={method:"GET",headers:te,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(let Ce in this._config.headers)te.append(Ce,this._config.headers[Ce]);d.cors===!1&&(Ee.mode="same-origin"),d.withCredentials&&(Ee.credentials="include"),d.referrerPolicy&&(Ee.referrerPolicy=d.referrerPolicy),this._status=_.kConnecting,self.fetch(j.url,Ee).then(Ce=>{if(this._requestAbort){this._requestAbort=!1,this._status=_.kIdle;return}if(Ce.ok&&Ce.status>=200&&Ce.status<=299){if(Ce.url!==j.url&&this._onURLRedirect){let Ze=this._seekHandler.removeURLParameters(Ce.url);this._onURLRedirect(Ze)}let Xe=Ce.headers.get("Content-Length");return Xe!=null&&(this._contentLength=parseInt(Xe),this._contentLength!==0&&this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)),this._pump.call(this,Ce.body.getReader())}else if(this._status=_.kError,this._onError)this._onError(E.HTTP_STATUS_CODE_INVALID,{code:Ce.status,msg:Ce.statusText});else throw new l("FetchStreamLoader: Http code invalid, "+Ce.status+" "+Ce.statusText)}).catch(Ce=>{if(this._status=_.kError,this._onError)this._onError(E.EXCEPTION,{code:-1,msg:Ce.message});else throw Ce})}abort(){this._requestAbort=!0}_pump(d){return d.read().then(g=>{if(g.done)if(this._contentLength!==null&&this._receivedLength<this._contentLength){this._status=_.kError;let T=E.EARLY_EOF,j={code:-1,msg:"Fetch stream meet Early-EOF"};if(this._onError)this._onError(T,j);else throw new l(j.msg)}else this._status=_.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1);else{if(this._requestAbort===!0)return this._requestAbort=!1,this._status=_.kComplete,d.cancel();this._status=_.kBuffering;let T=g.value.buffer,j=this._range.from+this._receivedLength;this._receivedLength+=T.byteLength,this._onDataArrival&&this._onDataArrival(T,j,this._receivedLength),this._pump(d)}}).catch(g=>{if(g.code===11&&N.msedge)return;this._status=_.kError;let T=0,j=null;if((g.code===19||g.message==="network error")&&(this._contentLength===null||this._contentLength!==null&&this._receivedLength<this._contentLength)?(T=E.EARLY_EOF,j={code:g.code,msg:"Fetch stream meet Early-EOF"}):(T=E.EXCEPTION,j={code:g.code,msg:g.message}),this._onError)this._onError(T,j);else throw new l(j.msg)})}}var O=L;class D extends w{static isSupported(){try{let d=new XMLHttpRequest;return d.open("GET","https://example.com",!0),d.responseType="moz-chunked-arraybuffer",d.responseType==="moz-chunked-arraybuffer"}catch(d){return p.w("MozChunkedLoader",d.message),!1}}constructor(d,g){super("xhr-moz-chunked-loader"),this.TAG="MozChunkedLoader",this._seekHandler=d,this._config=g,this._needStash=!0,this._xhr=null,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}open(d,g){this._dataSource=d,this._range=g;let T=d.url;this._config.reuseRedirectedURL&&d.redirectedURL!=null&&(T=d.redirectedURL);let j=this._seekHandler.getConfig(T,g);this._requestURL=j.url;let te=this._xhr=new XMLHttpRequest;if(te.open("GET",j.url,!0),te.responseType="moz-chunked-arraybuffer",te.onreadystatechange=this._onReadyStateChange.bind(this),te.onprogress=this._onProgress.bind(this),te.onloadend=this._onLoadEnd.bind(this),te.onerror=this._onXhrError.bind(this),d.withCredentials&&(te.withCredentials=!0),typeof j.headers=="object"){let Ee=j.headers;for(let Ce in Ee)Ee.hasOwnProperty(Ce)&&te.setRequestHeader(Ce,Ee[Ce])}if(typeof this._config.headers=="object"){let Ee=this._config.headers;for(let Ce in Ee)Ee.hasOwnProperty(Ce)&&te.setRequestHeader(Ce,Ee[Ce])}this._status=_.kConnecting,te.send()}abort(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=_.kComplete}_onReadyStateChange(d){let g=d.target;if(g.readyState===2){if(g.responseURL!=null&&g.responseURL!==this._requestURL&&this._onURLRedirect){let T=this._seekHandler.removeURLParameters(g.responseURL);this._onURLRedirect(T)}if(g.status!==0&&(g.status<200||g.status>299))if(this._status=_.kError,this._onError)this._onError(E.HTTP_STATUS_CODE_INVALID,{code:g.status,msg:g.statusText});else throw new l("MozChunkedLoader: Http code invalid, "+g.status+" "+g.statusText);else this._status=_.kBuffering}}_onProgress(d){if(this._status===_.kError)return;this._contentLength===null&&d.total!==null&&d.total!==0&&(this._contentLength=d.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));let g=d.target.response,T=this._range.from+this._receivedLength;this._receivedLength+=g.byteLength,this._onDataArrival&&this._onDataArrival(g,T,this._receivedLength)}_onLoadEnd(d){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===_.kError)return;this._status=_.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}_onXhrError(d){this._status=_.kError;let g=0,T=null;if(this._contentLength&&d.loaded<this._contentLength?(g=E.EARLY_EOF,T={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(g=E.EXCEPTION,T={code:-1,msg:d.constructor.name+" "+d.type}),this._onError)this._onError(g,T);else throw new l(T.msg)}}var C=D;class Q extends null{static isSupported(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;let d=new XMLHttpRequest;return d.open("GET","https://example.com",!0),d.responseType="ms-stream",d.responseType==="ms-stream"}catch(d){return Log.w("MSStreamLoader",d.message),!1}}constructor(d,g){super("xhr-msstream-loader"),this.TAG="MSStreamLoader",this._seekHandler=d,this._config=g,this._needStash=!0,this._xhr=null,this._reader=null,this._totalRange=null,this._currentRange=null,this._currentRequestURL=null,this._currentRedirectedURL=null,this._contentLength=null,this._receivedLength=0,this._bufferLimit=16*1024*1024,this._lastTimeBufferSize=0,this._isReconnecting=!1}destroy(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),super.destroy()}open(d,g){this._internalOpen(d,g,!1)}_internalOpen(d,g,T){this._dataSource=d,T?this._currentRange=g:this._totalRange=g;let j=d.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?j=this._currentRedirectedURL:d.redirectedURL!=null&&(j=d.redirectedURL));let te=this._seekHandler.getConfig(j,g);this._currentRequestURL=te.url;let Ee=this._reader=new self.MSStreamReader;Ee.onprogress=this._msrOnProgress.bind(this),Ee.onload=this._msrOnLoad.bind(this),Ee.onerror=this._msrOnError.bind(this);let Ce=this._xhr=new XMLHttpRequest;if(Ce.open("GET",te.url,!0),Ce.responseType="ms-stream",Ce.onreadystatechange=this._xhrOnReadyStateChange.bind(this),Ce.onerror=this._xhrOnError.bind(this),d.withCredentials&&(Ce.withCredentials=!0),typeof te.headers=="object"){let Xe=te.headers;for(let Ze in Xe)Xe.hasOwnProperty(Ze)&&Ce.setRequestHeader(Ze,Xe[Ze])}if(typeof this._config.headers=="object"){let Xe=this._config.headers;for(let Ze in Xe)Xe.hasOwnProperty(Ze)&&Ce.setRequestHeader(Ze,Xe[Ze])}this._isReconnecting?this._isReconnecting=!1:this._status=LoaderStatus.kConnecting,Ce.send()}abort(){this._internalAbort(),this._status=LoaderStatus.kComplete}_internalAbort(){this._reader&&(this._reader.readyState===1&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)}_xhrOnReadyStateChange(d){let g=d.target;if(g.readyState===2)if(g.status>=200&&g.status<=299){if(this._status=LoaderStatus.kBuffering,g.responseURL!=null){let j=this._seekHandler.removeURLParameters(g.responseURL);g.responseURL!==this._currentRequestURL&&j!==this._currentRedirectedURL&&(this._currentRedirectedURL=j,this._onURLRedirect&&this._onURLRedirect(j))}let T=g.getResponseHeader("Content-Length");if(T!=null&&this._contentLength==null){let j=parseInt(T);j>0&&(this._contentLength=j,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=LoaderStatus.kError,this._onError)this._onError(LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:g.status,msg:g.statusText});else throw new RuntimeException("MSStreamLoader: Http code invalid, "+g.status+" "+g.statusText);else if(g.readyState===3&&g.status>=200&&g.status<=299){this._status=LoaderStatus.kBuffering;let T=g.response;this._reader.readAsArrayBuffer(T)}}_xhrOnError(d){this._status=LoaderStatus.kError;let g=LoaderErrors.EXCEPTION,T={code:-1,msg:d.constructor.name+" "+d.type};if(this._onError)this._onError(g,T);else throw new RuntimeException(T.msg)}_msrOnProgress(d){let T=d.target.result;if(T==null){this._doReconnectIfNeeded();return}let j=T.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=T.byteLength;let te=this._totalRange.from+this._receivedLength;this._receivedLength+=j.byteLength,this._onDataArrival&&this._onDataArrival(j,te,this._receivedLength),T.byteLength>=this._bufferLimit&&(Log.v(this.TAG,`MSStream buffer exceeded max size near ${te+j.byteLength}, reconnecting...`),this._doReconnectIfNeeded())}_doReconnectIfNeeded(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();let d={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,d,!0)}}_msrOnLoad(d){this._status=LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}_msrOnError(d){this._status=LoaderStatus.kError;let g=0,T=null;if(this._contentLength&&this._receivedLength<this._contentLength?(g=LoaderErrors.EARLY_EOF,T={code:-1,msg:"MSStream meet Early-Eof"}):(g=LoaderErrors.EARLY_EOF,T={code:-1,msg:d.constructor.name+" "+d.type}),this._onError)this._onError(g,T);else throw new RuntimeException(T.msg)}}var ce=null;class ae extends w{static isSupported(){try{let d=new XMLHttpRequest;return d.open("GET","https://example.com",!0),d.responseType="arraybuffer",d.responseType==="arraybuffer"}catch(d){return p.w("RangeLoader",d.message),!1}}constructor(d,g){super("xhr-range-loader"),this.TAG="RangeLoader",this._seekHandler=d,this._config=g,this._needStash=!1,this._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],this._currentChunkSizeKB=384,this._currentSpeedNormalized=0,this._zeroSpeedChunkCount=0,this._xhr=null,this._speedSampler=new ne,this._requestAbort=!1,this._waitForTotalLength=!1,this._totalLengthReceived=!1,this._currentRequestURL=null,this._currentRedirectedURL=null,this._currentRequestRange=null,this._totalLength=null,this._contentLength=null,this._receivedLength=0,this._lastTimeLoaded=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}get currentSpeed(){return this._speedSampler.lastSecondKBps}open(d,g){this._dataSource=d,this._range=g,this._status=_.kConnecting;let T=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(T=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!T?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}_openSubRange(){let d=this._currentChunkSizeKB*1024,g=this._range.from+this._receivedLength,T=g+d;this._contentLength!=null&&T-this._range.from>=this._contentLength&&(T=this._range.from+this._contentLength-1),this._currentRequestRange={from:g,to:T},this._internalOpen(this._dataSource,this._currentRequestRange)}_internalOpen(d,g){this._lastTimeLoaded=0;let T=d.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?T=this._currentRedirectedURL:d.redirectedURL!=null&&(T=d.redirectedURL));let j=this._seekHandler.getConfig(T,g);this._currentRequestURL=j.url;let te=this._xhr=new XMLHttpRequest;if(te.open("GET",j.url,!0),te.responseType="arraybuffer",te.onreadystatechange=this._onReadyStateChange.bind(this),te.onprogress=this._onProgress.bind(this),te.onload=this._onLoad.bind(this),te.onerror=this._onXhrError.bind(this),d.withCredentials&&(te.withCredentials=!0),typeof j.headers=="object"){let Ee=j.headers;for(let Ce in Ee)Ee.hasOwnProperty(Ce)&&te.setRequestHeader(Ce,Ee[Ce])}if(typeof this._config.headers=="object"){let Ee=this._config.headers;for(let Ce in Ee)Ee.hasOwnProperty(Ce)&&te.setRequestHeader(Ce,Ee[Ce])}te.send()}abort(){this._requestAbort=!0,this._internalAbort(),this._status=_.kComplete}_internalAbort(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}_onReadyStateChange(d){let g=d.target;if(g.readyState===2){if(g.responseURL!=null){let T=this._seekHandler.removeURLParameters(g.responseURL);g.responseURL!==this._currentRequestURL&&T!==this._currentRedirectedURL&&(this._currentRedirectedURL=T,this._onURLRedirect&&this._onURLRedirect(T))}if(g.status>=200&&g.status<=299){if(this._waitForTotalLength)return;this._status=_.kBuffering}else if(this._status=_.kError,this._onError)this._onError(E.HTTP_STATUS_CODE_INVALID,{code:g.status,msg:g.statusText});else throw new l("RangeLoader: Http code invalid, "+g.status+" "+g.statusText)}}_onProgress(d){if(this._status===_.kError)return;if(this._contentLength===null){let T=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,T=!0;let j=d.total;this._internalAbort(),j!=null&j!==0&&(this._totalLength=j)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,T){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}let g=d.loaded-this._lastTimeLoaded;this._lastTimeLoaded=d.loaded,this._speedSampler.addBytes(g)}_normalizeSpeed(d){let g=this._chunkSizeKBList,T=g.length-1,j=0,te=0,Ee=T;if(d<g[0])return g[0];for(;te<=Ee;){if(j=te+Math.floor((Ee-te)/2),j===T||d>=g[j]&&d<g[j+1])return g[j];g[j]<d?te=j+1:Ee=j-1}}_onLoad(d){if(this._status===_.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;let g=this._speedSampler.lastSecondKBps;if(g===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(g=this._speedSampler.currentKBps)),g!==0){let Ee=this._normalizeSpeed(g);this._currentSpeedNormalized!==Ee&&(this._currentSpeedNormalized=Ee,this._currentChunkSizeKB=Ee)}let T=d.target.response,j=this._range.from+this._receivedLength;this._receivedLength+=T.byteLength;let te=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():te=!0,this._onDataArrival&&this._onDataArrival(T,j,this._receivedLength),te&&(this._status=_.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}_onXhrError(d){this._status=_.kError;let g=0,T=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(g=E.EARLY_EOF,T={code:-1,msg:"RangeLoader meet Early-Eof"}):(g=E.EXCEPTION,T={code:-1,msg:d.constructor.name+" "+d.type}),this._onError)this._onError(g,T);else throw new l(T.msg)}}var Se=ae;class Ne extends w{static isSupported(){try{return typeof self.WebSocket!="undefined"}catch(d){return!1}}constructor(){super("websocket-loader"),this.TAG="WebSocketLoader",this._needStash=!0,this._ws=null,this._requestAbort=!1,this._receivedLength=0}destroy(){this._ws&&this.abort(),super.destroy()}open(d){try{let g=this._ws=new self.WebSocket(d.url);g.binaryType="arraybuffer",g.onopen=this._onWebSocketOpen.bind(this),g.onclose=this._onWebSocketClose.bind(this),g.onmessage=this._onWebSocketMessage.bind(this),g.onerror=this._onWebSocketError.bind(this),this._status=_.kConnecting}catch(g){this._status=_.kError;let T={code:g.code,msg:g.message};if(this._onError)this._onError(E.EXCEPTION,T);else throw new l(T.msg)}}abort(){let d=this._ws;d&&(d.readyState===0||d.readyState===1)&&(this._requestAbort=!0,d.close()),this._ws=null,this._status=_.kComplete}_onWebSocketOpen(d){this._status=_.kBuffering}_onWebSocketClose(d){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=_.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}_onWebSocketMessage(d){if(d.data instanceof ArrayBuffer)this._dispatchArrayBuffer(d.data);else if(d.data instanceof Blob){let g=new FileReader;g.onload=()=>{this._dispatchArrayBuffer(g.result)},g.readAsArrayBuffer(d.data)}else{this._status=_.kError;let g={code:-1,msg:"Unsupported WebSocket message type: "+d.data.constructor.name};if(this._onError)this._onError(E.EXCEPTION,g);else throw new l(g.msg)}}_dispatchArrayBuffer(d){let g=d,T=this._receivedLength;this._receivedLength+=g.byteLength,this._onDataArrival&&this._onDataArrival(g,T,this._receivedLength)}_onWebSocketError(d){this._status=_.kError;let g={code:d.code,msg:d.message};if(this._onError)this._onError(E.EXCEPTION,g);else throw new l(g.msg)}}var Te=Ne;class je{constructor(d){this._zeroStart=d||!1}getConfig(d,g){let T={};if(g.from!==0||g.to!==-1){let j;g.to!==-1?j=`bytes=${g.from.toString()}-${g.to.toString()}`:j=`bytes=${g.from.toString()}-`,T.Range=j}else this._zeroStart&&(T.Range="bytes=0-");return{url:d,headers:T}}removeURLParameters(d){return d}}var ie=je;class M{constructor(d,g){this._startName=d,this._endName=g}getConfig(d,g){let T=d;if(g.from!==0||g.to!==-1){let j=!0;T.indexOf("?")===-1&&(T+="?",j=!1),j&&(T+="&"),T+=`${this._startName}=${g.from.toString()}`,g.to!==-1&&(T+=`&${this._endName}=${g.to.toString()}`)}return{url:T,headers:{}}}removeURLParameters(d){let g=d.split("?")[0],T,j=d.indexOf("?");j!==-1&&(T=d.substring(j+1));let te="";if(T!=null&&T.length>0){let Ee=T.split("&");for(let Ce=0;Ce<Ee.length;Ce++){let Xe=Ee[Ce].split("="),Ze=Ce>0;Xe[0]!==this._startName&&Xe[0]!==this._endName&&(Ze&&(te+="&"),te+=Ee[Ce])}}return te.length===0?g:g+"?"+te}}var z=M;class H{constructor(d,g,T){this.TAG="IOController",this._config=g,this._extraData=T,this._stashInitialSize=1024*384,g.stashInitialSize!=null&&g.stashInitialSize>0&&(this._stashInitialSize=g.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,g.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=d,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(d.url),this._refTotalLength=d.filesize?d.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new ne,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}destroy(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}isWorking(){return this._loader&&this._loader.isWorking()&&!this._paused}isPaused(){return this._paused}get status(){return this._loader.status}get extraData(){return this._extraData}set extraData(d){this._extraData=d}get onDataArrival(){return this._onDataArrival}set onDataArrival(d){this._onDataArrival=d}get onSeeked(){return this._onSeeked}set onSeeked(d){this._onSeeked=d}get onError(){return this._onError}set onError(d){this._onError=d}get onComplete(){return this._onComplete}set onComplete(d){this._onComplete=d}get onRedirect(){return this._onRedirect}set onRedirect(d){this._onRedirect=d}get onRecoveredEarlyEof(){return this._onRecoveredEarlyEof}set onRecoveredEarlyEof(d){this._onRecoveredEarlyEof=d}get currentURL(){return this._dataSource.url}get hasRedirect(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}get currentRedirectedURL(){return this._redirectedURL||this._dataSource.redirectedURL}get currentSpeed(){return this._loaderClass===Se?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}get loaderType(){return this._loader.type}_selectSeekHandler(){let d=this._config;if(d.seekType==="range")this._seekHandler=new ie(this._config.rangeLoadZeroStart);else if(d.seekType==="param"){let g=d.seekParamStart||"bstart",T=d.seekParamEnd||"bend";this._seekHandler=new z(g,T)}else if(d.seekType==="custom"){if(typeof d.customSeekHandler!="function")throw new P("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new d.customSeekHandler}else throw new P(`Invalid seekType in config: ${d.seekType}`)}_selectLoader(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=Te;else if(O.isSupported())this._loaderClass=O;else if(C.isSupported())this._loaderClass=C;else if(Se.isSupported())this._loaderClass=Se;else throw new l("Your browser doesn't support xhr with arraybuffer responseType!")}_createLoader(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}open(d){this._currentRange={from:0,to:-1},d&&(this._currentRange.from=d),this._speedSampler.reset(),d||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}abort(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}pause(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}resume(){if(this._paused){this._paused=!1;let d=this._resumeFrom;this._resumeFrom=0,this._internalSeek(d,!0)}}seek(d){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(d,!0)}_internalSeek(d,g){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(g),this._loader.destroy(),this._loader=null;let T={from:d,to:-1};this._currentRange={from:T.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,T),this._onSeeked&&this._onSeeked()}updateUrl(d){if(!d||typeof d!="string"||d.length===0)throw new P("Url must be a non-empty string!");this._dataSource.url=d}_expandBuffer(d){let g=this._stashSize;for(;g+1024*1024*1<d;)g*=2;if(g+=1024*1024*1,g===this._bufferSize)return;let T=new ArrayBuffer(g);if(this._stashUsed>0){let j=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(T,0,g).set(j,0)}this._stashBuffer=T,this._bufferSize=g}_normalizeSpeed(d){let g=this._speedNormalizeList,T=g.length-1,j=0,te=0,Ee=T;if(d<g[0])return g[0];for(;te<=Ee;){if(j=te+Math.floor((Ee-te)/2),j===T||d>=g[j]&&d<g[j+1])return g[j];g[j]<d?te=j+1:Ee=j-1}}_adjustStashSize(d){let g=0;this._config.isLive||d<512?g=d:d>=512&&d<=1024?g=Math.floor(d*1.5):g=d*2,g>8192&&(g=8192);let T=g*1024+1024*1024*1;this._bufferSize<T&&this._expandBuffer(T),this._stashSize=g*1024}_dispatchChunks(d,g){return this._currentRange.to=g+d.byteLength-1,this._onDataArrival(d,g)}_onURLRedirect(d){this._redirectedURL=d,this._onRedirect&&this._onRedirect(d)}_onContentLengthKnown(d){d&&this._fullRequestFlag&&(this._totalLength=d,this._fullRequestFlag=!1)}_onLoaderChunkArrival(d,g,T){if(!this._onDataArrival)throw new K("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(d.byteLength);let j=this._speedSampler.lastSecondKBps;if(j!==0){let te=this._normalizeSpeed(j);this._speedNormalized!==te&&(this._speedNormalized=te,this._adjustStashSize(te))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=g),this._stashUsed+d.byteLength<=this._stashSize)new Uint8Array(this._stashBuffer,0,this._stashSize).set(new Uint8Array(d),this._stashUsed),this._stashUsed+=d.byteLength;else{let te=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){let Ee=this._stashBuffer.slice(0,this._stashUsed),Ce=this._dispatchChunks(Ee,this._stashByteStart);if(Ce<Ee.byteLength){if(Ce>0){let Xe=new Uint8Array(Ee,Ce);te.set(Xe,0),this._stashUsed=Xe.byteLength,this._stashByteStart+=Ce}}else this._stashUsed=0,this._stashByteStart+=Ce;this._stashUsed+d.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+d.byteLength),te=new Uint8Array(this._stashBuffer,0,this._bufferSize)),te.set(new Uint8Array(d),this._stashUsed),this._stashUsed+=d.byteLength}else{let Ee=this._dispatchChunks(d,g);if(Ee<d.byteLength){let Ce=d.byteLength-Ee;Ce>this._bufferSize&&(this._expandBuffer(Ce),te=new Uint8Array(this._stashBuffer,0,this._bufferSize)),te.set(new Uint8Array(d,Ee),0),this._stashUsed+=Ce,this._stashByteStart=g+Ee}}}else if(this._stashUsed===0){let te=this._dispatchChunks(d,g);if(te<d.byteLength){let Ee=d.byteLength-te;Ee>this._bufferSize&&this._expandBuffer(Ee),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(d,te),0),this._stashUsed+=Ee,this._stashByteStart=g+te}}else{this._stashUsed+d.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+d.byteLength);let te=new Uint8Array(this._stashBuffer,0,this._bufferSize);te.set(new Uint8Array(d),this._stashUsed),this._stashUsed+=d.byteLength;let Ee=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(Ee<this._stashUsed&&Ee>0){let Ce=new Uint8Array(this._stashBuffer,Ee);te.set(Ce,0)}this._stashUsed-=Ee,this._stashByteStart+=Ee}}_flushStashBuffer(d){if(this._stashUsed>0){let g=this._stashBuffer.slice(0,this._stashUsed),T=this._dispatchChunks(g,this._stashByteStart),j=g.byteLength-T;if(T<g.byteLength)if(d)p.w(this.TAG,`${j} bytes unconsumed data remain when flush buffer, dropped`);else{if(T>0){let te=new Uint8Array(this._stashBuffer,0,this._bufferSize),Ee=new Uint8Array(g,T);te.set(Ee,0),this._stashUsed=Ee.byteLength,this._stashByteStart+=T}return 0}return this._stashUsed=0,this._stashByteStart=0,j}return 0}_onLoaderComplete(d,g){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}_onLoaderError(d,g){switch(p.e(this.TAG,`Loader error, code = ${g.code}, msg = ${g.msg}`),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,d=E.UNRECOVERABLE_EARLY_EOF),d){case E.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){let T=this._currentRange.to+1;T<this._totalLength&&(p.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(T,!1));return}d=E.UNRECOVERABLE_EARLY_EOF;break}case E.UNRECOVERABLE_EARLY_EOF:case E.CONNECTING_TIMEOUT:case E.HTTP_STATUS_CODE_INVALID:case E.EXCEPTION:break}if(this._onError)this._onError(d,g);else throw new l("IOException: "+g.msg)}}var Z=H;const Y={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function b(){return Object.assign({},Y)}class y{static supportMSEH264Playback(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}static supportNetworkStreamIO(){let d=new Z({},b()),g=d.loaderType;return d.destroy(),g=="fetch-stream-loader"||g=="xhr-moz-chunked-loader"}static getNetworkLoaderTypeName(){let d=new Z({},b()),g=d.loaderType;return d.destroy(),g}static supportNativeMediaPlayback(d){y.videoElement==null&&(y.videoElement=window.document.createElement("video"));let g=y.videoElement.canPlayType(d);return g==="probably"||g=="maybe"}static getFeatureList(){let d={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return d.mseFlvPlayback=y.supportMSEH264Playback(),d.networkStreamIO=y.supportNetworkStreamIO(),d.networkLoaderName=y.getNetworkLoaderTypeName(),d.mseLiveFlvPlayback=d.mseFlvPlayback&&d.networkStreamIO,d.nativeMP4H264Playback=y.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),d.nativeWebmVP8Playback=y.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),d.nativeWebmVP9Playback=y.supportNativeMediaPlayback('video/webm; codecs="vp9"'),d}}var V=y,be={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"};class Pe{static get forceGlobalTag(){return p.FORCE_GLOBAL_TAG}static set forceGlobalTag(d){p.FORCE_GLOBAL_TAG=d,Pe._notifyChange()}static get globalTag(){return p.GLOBAL_TAG}static set globalTag(d){p.GLOBAL_TAG=d,Pe._notifyChange()}static get enableAll(){return p.ENABLE_VERBOSE&&p.ENABLE_DEBUG&&p.ENABLE_INFO&&p.ENABLE_WARN&&p.ENABLE_ERROR}static set enableAll(d){p.ENABLE_VERBOSE=d,p.ENABLE_DEBUG=d,p.ENABLE_INFO=d,p.ENABLE_WARN=d,p.ENABLE_ERROR=d,Pe._notifyChange()}static get enableDebug(){return p.ENABLE_DEBUG}static set enableDebug(d){p.ENABLE_DEBUG=d,Pe._notifyChange()}static get enableVerbose(){return p.ENABLE_VERBOSE}static set enableVerbose(d){p.ENABLE_VERBOSE=d,Pe._notifyChange()}static get enableInfo(){return p.ENABLE_INFO}static set enableInfo(d){p.ENABLE_INFO=d,Pe._notifyChange()}static get enableWarn(){return p.ENABLE_WARN}static set enableWarn(d){p.ENABLE_WARN=d,Pe._notifyChange()}static get enableError(){return p.ENABLE_ERROR}static set enableError(d){p.ENABLE_ERROR=d,Pe._notifyChange()}static getConfig(){return{globalTag:p.GLOBAL_TAG,forceGlobalTag:p.FORCE_GLOBAL_TAG,enableVerbose:p.ENABLE_VERBOSE,enableDebug:p.ENABLE_DEBUG,enableInfo:p.ENABLE_INFO,enableWarn:p.ENABLE_WARN,enableError:p.ENABLE_ERROR,enableCallback:p.ENABLE_CALLBACK}}static applyConfig(d){p.GLOBAL_TAG=d.globalTag,p.FORCE_GLOBAL_TAG=d.forceGlobalTag,p.ENABLE_VERBOSE=d.enableVerbose,p.ENABLE_DEBUG=d.enableDebug,p.ENABLE_INFO=d.enableInfo,p.ENABLE_WARN=d.enableWarn,p.ENABLE_ERROR=d.enableError,p.ENABLE_CALLBACK=d.enableCallback}static _notifyChange(){let d=Pe.emitter;if(d.listenerCount("change")>0){let g=Pe.getConfig();d.emit("change",g)}}static registerListener(d){Pe.emitter.addListener("change",d)}static removeListener(d){Pe.emitter.removeListener("change",d)}static addLogListener(d){p.emitter.addListener("log",d),p.emitter.listenerCount("log")>0&&(p.ENABLE_CALLBACK=!0,Pe._notifyChange())}static removeLogListener(d){p.emitter.removeListener("log",d),p.emitter.listenerCount("log")===0&&(p.ENABLE_CALLBACK=!1,Pe._notifyChange())}}Pe.emitter=new(ue());var oe=Pe;class Ae{constructor(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}isComplete(){let d=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,g=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&d&&g}isSeekable(){return this.hasKeyframesIndex===!0}getNearestKeyframe(d){if(this.keyframesIndex==null)return null;let g=this.keyframesIndex,T=this._search(g.times,d);return{index:T,milliseconds:g.times[T],fileposition:g.filepositions[T]}}_search(d,g){let T=0,j=d.length-1,te=0,Ee=0,Ce=j;for(g<d[0]&&(T=0,Ee=Ce+1);Ee<=Ce;)if(te=Ee+Math.floor((Ce-Ee)/2),te===j||g>=d[te]&&g<d[te+1]){T=te;break}else d[te]<g?Ee=te+1:Ce=te-1;return T}}var ke=Ae;function et(rt,d,g){let T=rt;if(d+g<T.length){for(;g--;)if((T[++d]&192)!==128)return!1;return!0}else return!1}function Oe(rt){let d=[],g=rt,T=0,j=rt.length;for(;T<j;){if(g[T]<128){d.push(String.fromCharCode(g[T])),++T;continue}else if(!(g[T]<192)){if(g[T]<224){if(et(g,T,1)){let te=(g[T]&31)<<6|g[T+1]&63;if(te>=128){d.push(String.fromCharCode(te&65535)),T+=2;continue}}}else if(g[T]<240){if(et(g,T,2)){let te=(g[T]&15)<<12|(g[T+1]&63)<<6|g[T+2]&63;if(te>=2048&&(te&63488)!==55296){d.push(String.fromCharCode(te&65535)),T+=3;continue}}}else if(g[T]<248&&et(g,T,3)){let te=(g[T]&7)<<18|(g[T+1]&63)<<12|(g[T+2]&63)<<6|g[T+3]&63;if(te>65536&&te<1114112){te-=65536,d.push(String.fromCharCode(te>>>10|55296)),d.push(String.fromCharCode(te&1023|56320)),T+=4;continue}}}d.push("\uFFFD"),++T}return d.join("")}var qe=Oe;let xe=function(){let rt=new ArrayBuffer(2);return new DataView(rt).setInt16(0,256,!0),new Int16Array(rt)[0]===256}();class it{static parseScriptData(d,g,T){let j={};try{let te=it.parseValue(d,g,T),Ee=it.parseValue(d,g+te.size,T-te.size);j[te.data]=Ee.data}catch(te){p.e("AMF",te.toString())}return j}static parseObject(d,g,T){if(T<3)throw new K("Data not enough when parse ScriptDataObject");let j=it.parseString(d,g,T),te=it.parseValue(d,g+j.size,T-j.size),Ee=te.objectEnd;return{data:{name:j.data,value:te.data},size:j.size+te.size,objectEnd:Ee}}static parseVariable(d,g,T){return it.parseObject(d,g,T)}static parseString(d,g,T){if(T<2)throw new K("Data not enough when parse String");let te=new DataView(d,g,T).getUint16(0,!xe),Ee;return te>0?Ee=qe(new Uint8Array(d,g+2,te)):Ee="",{data:Ee,size:2+te}}static parseLongString(d,g,T){if(T<4)throw new K("Data not enough when parse LongString");let te=new DataView(d,g,T).getUint32(0,!xe),Ee;return te>0?Ee=qe(new Uint8Array(d,g+4,te)):Ee="",{data:Ee,size:4+te}}static parseDate(d,g,T){if(T<10)throw new K("Data size invalid when parse Date");let j=new DataView(d,g,T),te=j.getFloat64(0,!xe),Ee=j.getInt16(8,!xe);return te+=Ee*60*1e3,{data:new Date(te),size:10}}static parseValue(d,g,T){if(T<1)throw new K("Data not enough when parse Value");let j=new DataView(d,g,T),te=1,Ee=j.getUint8(0),Ce,Xe=!1;try{switch(Ee){case 0:Ce=j.getFloat64(1,!xe),te+=8;break;case 1:{Ce=!!j.getUint8(1),te+=1;break}case 2:{let Ze=it.parseString(d,g+1,T-1);Ce=Ze.data,te+=Ze.size;break}case 3:{Ce={};let Ze=0;for((j.getUint32(T-4,!xe)&16777215)===9&&(Ze=3);te<T-4;){let ut=it.parseObject(d,g+te,T-te-Ze);if(ut.objectEnd)break;Ce[ut.data.name]=ut.data.value,te+=ut.size}te<=T-3&&(j.getUint32(te-1,!xe)&16777215)===9&&(te+=3);break}case 8:{Ce={},te+=4;let Ze=0;for((j.getUint32(T-4,!xe)&16777215)===9&&(Ze=3);te<T-8;){let ut=it.parseVariable(d,g+te,T-te-Ze);if(ut.objectEnd)break;Ce[ut.data.name]=ut.data.value,te+=ut.size}te<=T-3&&(j.getUint32(te-1,!xe)&16777215)===9&&(te+=3);break}case 9:Ce=void 0,te=1,Xe=!0;break;case 10:{Ce=[];let Ze=j.getUint32(1,!xe);te+=4;for(let ut=0;ut<Ze;ut++){let ft=it.parseValue(d,g+te,T-te);Ce.push(ft.data),te+=ft.size}break}case 11:{let Ze=it.parseDate(d,g+1,T-1);Ce=Ze.data,te+=Ze.size;break}case 12:{let Ze=it.parseString(d,g+1,T-1);Ce=Ze.data,te+=Ze.size;break}default:te=T,p.w("AMF","Unsupported AMF value type "+Ee)}}catch(Ze){p.e("AMF",Ze.toString())}return{data:Ce,size:te,objectEnd:Xe}}}var $e=it;class De{constructor(d){this.TAG="ExpGolomb",this._buffer=d,this._buffer_index=0,this._total_bytes=d.byteLength,this._total_bits=d.byteLength*8,this._current_word=0,this._current_word_bits_left=0}destroy(){this._buffer=null}_fillCurrentWord(){let d=this._total_bytes-this._buffer_index;if(d<=0)throw new K("ExpGolomb: _fillCurrentWord() but no bytes available");let g=Math.min(4,d),T=new Uint8Array(4);T.set(this._buffer.subarray(this._buffer_index,this._buffer_index+g)),this._current_word=new DataView(T.buffer).getUint32(0,!1),this._buffer_index+=g,this._current_word_bits_left=g*8}readBits(d){if(d>32)throw new P("ExpGolomb: readBits() bits exceeded max 32bits!");if(d<=this._current_word_bits_left){let Ee=this._current_word>>>32-d;return this._current_word<<=d,this._current_word_bits_left-=d,Ee}let g=this._current_word_bits_left?this._current_word:0;g=g>>>32-this._current_word_bits_left;let T=d-this._current_word_bits_left;this._fillCurrentWord();let j=Math.min(T,this._current_word_bits_left),te=this._current_word>>>32-j;return this._current_word<<=j,this._current_word_bits_left-=j,g=g<<j|te,g}readBool(){return this.readBits(1)===1}readByte(){return this.readBits(8)}_skipLeadingZero(){let d;for(d=0;d<this._current_word_bits_left;d++)if(this._current_word&2147483648>>>d)return this._current_word<<=d,this._current_word_bits_left-=d,d;return this._fillCurrentWord(),d+this._skipLeadingZero()}readUEG(){let d=this._skipLeadingZero();return this.readBits(d+1)-1}readSEG(){let d=this.readUEG();return d&1?d+1>>>1:-1*(d>>>1)}}var ve=De;class Le{static _ebsp2rbsp(d){let g=d,T=g.byteLength,j=new Uint8Array(T),te=0;for(let Ee=0;Ee<T;Ee++)Ee>=2&&g[Ee]===3&&g[Ee-1]===0&&g[Ee-2]===0||(j[te]=g[Ee],te++);return new Uint8Array(j.buffer,0,te)}static parseSPS(d){let g=Le._ebsp2rbsp(d),T=new ve(g);T.readByte();let j=T.readByte();T.readByte();let te=T.readByte();T.readUEG();let Ee=Le.getProfileString(j),Ce=Le.getLevelString(te),Xe=1,Ze=420,ut=[0,420,422,444],ft=8;if((j===100||j===110||j===122||j===244||j===44||j===83||j===86||j===118||j===128||j===138||j===144)&&(Xe=T.readUEG(),Xe===3&&T.readBits(1),Xe<=3&&(Ze=ut[Xe]),ft=T.readUEG()+8,T.readUEG(),T.readBits(1),T.readBool())){let tn=Xe!==3?8:12;for(let xn=0;xn<tn;xn++)T.readBool()&&(xn<6?Le._skipScalingList(T,16):Le._skipScalingList(T,64))}T.readUEG();let Lt=T.readUEG();if(Lt===0)T.readUEG();else if(Lt===1){T.readBits(1),T.readSEG(),T.readSEG();let tn=T.readUEG();for(let xn=0;xn<tn;xn++)T.readSEG()}let vt=T.readUEG();T.readBits(1);let Kt=T.readUEG(),$t=T.readUEG(),gt=T.readBits(1);gt===0&&T.readBits(1),T.readBits(1);let mt=0,Bt=0,kt=0,hn=0;T.readBool()&&(mt=T.readUEG(),Bt=T.readUEG(),kt=T.readUEG(),hn=T.readUEG());let Wt=1,Mt=1,Qt=0,gn=!0,Be=0,Ke=0;if(T.readBool()){if(T.readBool()){let tn=T.readByte(),xn=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],an=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];tn>0&&tn<16?(Wt=xn[tn-1],Mt=an[tn-1]):tn===255&&(Wt=T.readByte()<<8|T.readByte(),Mt=T.readByte()<<8|T.readByte())}if(T.readBool()&&T.readBool(),T.readBool()&&(T.readBits(4),T.readBool()&&T.readBits(24)),T.readBool()&&(T.readUEG(),T.readUEG()),T.readBool()){let tn=T.readBits(32),xn=T.readBits(32);gn=T.readBool(),Be=xn,Ke=tn*2,Qt=Be/Ke}}let lt=1;(Wt!==1||Mt!==1)&&(lt=Wt/Mt);let st=0,ct=0;if(Xe===0)st=1,ct=2-gt;else{let tn=Xe===3?1:2,xn=Xe===1?2:1;st=tn,ct=xn*(2-gt)}let At=(Kt+1)*16,Ut=(2-gt)*(($t+1)*16);At-=(mt+Bt)*st,Ut-=(kt+hn)*ct;let cn=Math.ceil(At*lt);return T.destroy(),T=null,{profile_string:Ee,level_string:Ce,bit_depth:ft,ref_frames:vt,chroma_format:Ze,chroma_format_string:Le.getChromaFormatString(Ze),frame_rate:{fixed:gn,fps:Qt,fps_den:Ke,fps_num:Be},sar_ratio:{width:Wt,height:Mt},codec_size:{width:At,height:Ut},present_size:{width:cn,height:Ut}}}static _skipScalingList(d,g){let T=8,j=8,te=0;for(let Ee=0;Ee<g;Ee++)j!==0&&(te=d.readSEG(),j=(T+te+256)%256),T=j===0?T:j}static getProfileString(d){switch(d){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}static getLevelString(d){return(d/10).toFixed(1)}static getChromaFormatString(d){switch(d){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}var re=Le,fe={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};function B(rt){return rt>>>8&255|(rt&255)<<8}function A(rt){return(rt&4278190080)>>>24|(rt&16711680)>>>8|(rt&65280)<<8|(rt&255)<<24}function U(rt,d){return rt[d]<<24|rt[d+1]<<16|rt[d+2]<<8|rt[d+3]}class X{constructor(d,g){this.TAG="FLVDemuxer",this._config=g,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=d.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=d.hasAudioTrack,this._hasVideo=d.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new ke,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){let T=new ArrayBuffer(2);return new DataView(T).setInt16(0,256,!0),new Int16Array(T)[0]===256}()}destroy(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}static probe(d){let g=new Uint8Array(d),T={match:!1};if(g[0]!==70||g[1]!==76||g[2]!==86||g[3]!==1)return T;let j=(g[4]&4)>>>2!==0,te=(g[4]&1)!==0,Ee=U(g,5);return Ee<9?T:{match:!0,consumed:Ee,dataOffset:Ee,hasAudioTrack:j,hasVideoTrack:te}}bindDataSource(d){return d.onDataArrival=this.parseChunks.bind(this),this}get onTrackMetadata(){return this._onTrackMetadata}set onTrackMetadata(d){this._onTrackMetadata=d}get onMediaInfo(){return this._onMediaInfo}set onMediaInfo(d){this._onMediaInfo=d}get onMetaDataArrived(){return this._onMetaDataArrived}set onMetaDataArrived(d){this._onMetaDataArrived=d}get onScriptDataArrived(){return this._onScriptDataArrived}set onScriptDataArrived(d){this._onScriptDataArrived=d}get onError(){return this._onError}set onError(d){this._onError=d}get onDataAvailable(){return this._onDataAvailable}set onDataAvailable(d){this._onDataAvailable=d}get timestampBase(){return this._timestampBase}set timestampBase(d){this._timestampBase=d}get overridedDuration(){return this._duration}set overridedDuration(d){this._durationOverrided=!0,this._duration=d,this._mediaInfo.duration=d}set overridedHasAudio(d){this._hasAudioFlagOverrided=!0,this._hasAudio=d,this._mediaInfo.hasAudio=d}set overridedHasVideo(d){this._hasVideoFlagOverrided=!0,this._hasVideo=d,this._mediaInfo.hasVideo=d}resetMediaInfo(){this._mediaInfo=new ke}_isInitialMetadataDispatched(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}parseChunks(d,g){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new K("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let T=0,j=this._littleEndian;if(g===0)if(d.byteLength>13)T=X.probe(d).dataOffset;else return 0;for(this._firstParse&&(this._firstParse=!1,g+T!==this._dataOffset&&p.w(this.TAG,"First time parsing but chunk byteStart invalid!"),new DataView(d,T).getUint32(0,!j)!==0&&p.w(this.TAG,"PrevTagSize0 !== 0 !!!"),T+=4);T<d.byteLength;){this._dispatch=!0;let te=new DataView(d,T);if(T+11+4>d.byteLength)break;let Ee=te.getUint8(0),Ce=te.getUint32(0,!j)&16777215;if(T+11+Ce+4>d.byteLength)break;if(Ee!==8&&Ee!==9&&Ee!==18){p.w(this.TAG,`Unsupported tag type ${Ee}, skipped`),T+=11+Ce+4;continue}let Xe=te.getUint8(4),Ze=te.getUint8(5),ut=te.getUint8(6),ft=te.getUint8(7),Lt=ut|Ze<<8|Xe<<16|ft<<24;(te.getUint32(7,!j)&16777215)!==0&&p.w(this.TAG,"Meet tag which has StreamID != 0!");let Kt=T+11;switch(Ee){case 8:this._parseAudioData(d,Kt,Ce,Lt);break;case 9:this._parseVideoData(d,Kt,Ce,Lt,g+T);break;case 18:this._parseScriptData(d,Kt,Ce);break}let $t=te.getUint32(11+Ce,!j);$t!==11+Ce&&p.w(this.TAG,`Invalid PrevTagSize ${$t}`),T+=11+Ce+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),T}_parseScriptData(d,g,T){let j=$e.parseScriptData(d,g,T);if(j.hasOwnProperty("onMetaData")){if(j.onMetaData==null||typeof j.onMetaData!="object"){p.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&p.w(this.TAG,"Found another onMetaData tag!"),this._metadata=j;let te=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},te)),typeof te.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=te.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof te.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=te.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof te.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=te.audiodatarate),typeof te.videodatarate=="number"&&(this._mediaInfo.videoDataRate=te.videodatarate),typeof te.width=="number"&&(this._mediaInfo.width=te.width),typeof te.height=="number"&&(this._mediaInfo.height=te.height),typeof te.duration=="number"){if(!this._durationOverrided){let Ee=Math.floor(te.duration*this._timescale);this._duration=Ee,this._mediaInfo.duration=Ee}}else this._mediaInfo.duration=0;if(typeof te.framerate=="number"){let Ee=Math.floor(te.framerate*1e3);if(Ee>0){let Ce=Ee/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Ce,this._referenceFrameRate.fps_num=Ee,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Ce}}if(typeof te.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;let Ee=te.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(Ee),te.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=te,p.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(j).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},j))}_parseKeyframesIndex(d){let g=[],T=[];for(let j=1;j<d.times.length;j++){let te=this._timestampBase+Math.floor(d.times[j]*1e3);g.push(te),T.push(d.filepositions[j])}return{times:g,filepositions:T}}_parseAudioData(d,g,T,j){if(T<=1){p.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;let te=this._littleEndian,Ce=new DataView(d,g,T).getUint8(0),Xe=Ce>>>4;if(Xe!==2&&Xe!==10){this._onError(fe.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+Xe);return}let Ze=0,ut=(Ce&12)>>>2;if(ut>=0&&ut<=4)Ze=this._flvSoundRateTable[ut];else{this._onError(fe.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+ut);return}let ft=(Ce&2)>>>1,Lt=Ce&1,vt=this._audioMetadata,Kt=this._audioTrack;if(vt||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),vt=this._audioMetadata={},vt.type="audio",vt.id=Kt.id,vt.timescale=this._timescale,vt.duration=this._duration,vt.audioSampleRate=Ze,vt.channelCount=Lt===0?1:2),Xe===10){let $t=this._parseAACAudioData(d,g+1,T-1);if($t==null)return;if($t.packetType===0){vt.config&&p.w(this.TAG,"Found another AudioSpecificConfig!");let gt=$t.data;vt.audioSampleRate=gt.samplingRate,vt.channelCount=gt.channelCount,vt.codec=gt.codec,vt.originalCodec=gt.originalCodec,vt.config=gt.config,vt.refSampleDuration=1024/vt.audioSampleRate*vt.timescale,p.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",vt);let mt=this._mediaInfo;mt.audioCodec=vt.originalCodec,mt.audioSampleRate=vt.audioSampleRate,mt.audioChannelCount=vt.channelCount,mt.hasVideo?mt.videoCodec!=null&&(mt.mimeType='video/x-flv; codecs="'+mt.videoCodec+","+mt.audioCodec+'"'):mt.mimeType='video/x-flv; codecs="'+mt.audioCodec+'"',mt.isComplete()&&this._onMediaInfo(mt)}else if($t.packetType===1){let gt=this._timestampBase+j,mt={unit:$t.data,length:$t.data.byteLength,dts:gt,pts:gt};Kt.samples.push(mt),Kt.length+=$t.data.length}else p.e(this.TAG,`Flv: Unsupported AAC data type ${$t.packetType}`)}else if(Xe===2){if(!vt.codec){let Bt=this._parseMP3AudioData(d,g+1,T-1,!0);if(Bt==null)return;vt.audioSampleRate=Bt.samplingRate,vt.channelCount=Bt.channelCount,vt.codec=Bt.codec,vt.originalCodec=Bt.originalCodec,vt.refSampleDuration=1152/vt.audioSampleRate*vt.timescale,p.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",vt);let kt=this._mediaInfo;kt.audioCodec=vt.codec,kt.audioSampleRate=vt.audioSampleRate,kt.audioChannelCount=vt.channelCount,kt.audioDataRate=Bt.bitRate,kt.hasVideo?kt.videoCodec!=null&&(kt.mimeType='video/x-flv; codecs="'+kt.videoCodec+","+kt.audioCodec+'"'):kt.mimeType='video/x-flv; codecs="'+kt.audioCodec+'"',kt.isComplete()&&this._onMediaInfo(kt)}let $t=this._parseMP3AudioData(d,g+1,T-1,!1);if($t==null)return;let gt=this._timestampBase+j,mt={unit:$t,length:$t.byteLength,dts:gt,pts:gt};Kt.samples.push(mt),Kt.length+=$t.length}}_parseAACAudioData(d,g,T){if(T<=1){p.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}let j={},te=new Uint8Array(d,g,T);return j.packetType=te[0],te[0]===0?j.data=this._parseAACAudioSpecificConfig(d,g+1,T-1):j.data=te.subarray(1),j}_parseAACAudioSpecificConfig(d,g,T){let j=new Uint8Array(d,g,T),te=null,Ee=0,Ce=0,Xe=null,Ze=0,ut=null;if(Ee=Ce=j[0]>>>3,Ze=(j[0]&7)<<1|j[1]>>>7,Ze<0||Ze>=this._mpegSamplingRates.length){this._onError(fe.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}let ft=this._mpegSamplingRates[Ze],Lt=(j[1]&120)>>>3;if(Lt<0||Lt>=8){this._onError(fe.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Ee===5&&(ut=(j[1]&7)<<1|j[2]>>>7,Xe=(j[2]&124)>>>2);let vt=self.navigator.userAgent.toLowerCase();return vt.indexOf("firefox")!==-1?Ze>=6?(Ee=5,te=new Array(4),ut=Ze-3):(Ee=2,te=new Array(2),ut=Ze):vt.indexOf("android")!==-1?(Ee=2,te=new Array(2),ut=Ze):(Ee=5,ut=Ze,te=new Array(4),Ze>=6?ut=Ze-3:Lt===1&&(Ee=2,te=new Array(2),ut=Ze)),te[0]=Ee<<3,te[0]|=(Ze&15)>>>1,te[1]=(Ze&15)<<7,te[1]|=(Lt&15)<<3,Ee===5&&(te[1]|=(ut&15)>>>1,te[2]=(ut&1)<<7,te[2]|=8,te[3]=0),{config:te,samplingRate:ft,channelCount:Lt,codec:"mp4a.40."+Ee,originalCodec:"mp4a.40."+Ce}}_parseMP3AudioData(d,g,T,j){if(T<4){p.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}let te=this._littleEndian,Ee=new Uint8Array(d,g,T),Ce=null;if(j){if(Ee[0]!==255)return;let Xe=Ee[1]>>>3&3,Ze=(Ee[1]&6)>>1,ut=(Ee[2]&240)>>>4,ft=(Ee[2]&12)>>>2,vt=(Ee[3]>>>6&3)!==3?2:1,Kt=0,$t=0,gt=34,mt="mp3";switch(Xe){case 0:Kt=this._mpegAudioV25SampleRateTable[ft];break;case 2:Kt=this._mpegAudioV20SampleRateTable[ft];break;case 3:Kt=this._mpegAudioV10SampleRateTable[ft];break}switch(Ze){case 1:gt=34,ut<this._mpegAudioL3BitRateTable.length&&($t=this._mpegAudioL3BitRateTable[ut]);break;case 2:gt=33,ut<this._mpegAudioL2BitRateTable.length&&($t=this._mpegAudioL2BitRateTable[ut]);break;case 3:gt=32,ut<this._mpegAudioL1BitRateTable.length&&($t=this._mpegAudioL1BitRateTable[ut]);break}Ce={bitRate:$t,samplingRate:Kt,channelCount:vt,codec:mt,originalCodec:mt}}else Ce=Ee;return Ce}_parseVideoData(d,g,T,j,te){if(T<=1){p.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;let Ee=new Uint8Array(d,g,T)[0],Ce=(Ee&240)>>>4,Xe=Ee&15;if(Xe!==7){this._onError(fe.CODEC_UNSUPPORTED,`Flv: Unsupported codec in video frame: ${Xe}`);return}this._parseAVCVideoPacket(d,g+1,T-1,j,te,Ce)}_parseAVCVideoPacket(d,g,T,j,te,Ee){if(T<4){p.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}let Ce=this._littleEndian,Xe=new DataView(d,g,T),Ze=Xe.getUint8(0),ft=(Xe.getUint32(0,!Ce)&16777215)<<8>>8;if(Ze===0)this._parseAVCDecoderConfigurationRecord(d,g+4,T-4);else if(Ze===1)this._parseAVCVideoData(d,g+4,T-4,j,te,Ee,ft);else if(Ze!==2){this._onError(fe.FORMAT_ERROR,`Flv: Invalid video packet type ${Ze}`);return}}_parseAVCDecoderConfigurationRecord(d,g,T){if(T<7){p.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}let j=this._videoMetadata,te=this._videoTrack,Ee=this._littleEndian,Ce=new DataView(d,g,T);j?typeof j.avcc!="undefined"&&p.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),j=this._videoMetadata={},j.type="video",j.id=te.id,j.timescale=this._timescale,j.duration=this._duration);let Xe=Ce.getUint8(0),Ze=Ce.getUint8(1),ut=Ce.getUint8(2),ft=Ce.getUint8(3);if(Xe!==1||Ze===0){this._onError(fe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(Ce.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(fe.FORMAT_ERROR,`Flv: Strange NaluLengthSizeMinusOne: ${this._naluLengthSize-1}`);return}let Lt=Ce.getUint8(5)&31;if(Lt===0){this._onError(fe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else Lt>1&&p.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ${Lt}`);let vt=6;for(let $t=0;$t<Lt;$t++){let gt=Ce.getUint16(vt,!Ee);if(vt+=2,gt===0)continue;let mt=new Uint8Array(d,g+vt,gt);vt+=gt;let Bt=re.parseSPS(mt);if($t!==0)continue;j.codecWidth=Bt.codec_size.width,j.codecHeight=Bt.codec_size.height,j.presentWidth=Bt.present_size.width,j.presentHeight=Bt.present_size.height,j.profile=Bt.profile_string,j.level=Bt.level_string,j.bitDepth=Bt.bit_depth,j.chromaFormat=Bt.chroma_format,j.sarRatio=Bt.sar_ratio,j.frameRate=Bt.frame_rate,(Bt.frame_rate.fixed===!1||Bt.frame_rate.fps_num===0||Bt.frame_rate.fps_den===0)&&(j.frameRate=this._referenceFrameRate);let kt=j.frameRate.fps_den,hn=j.frameRate.fps_num;j.refSampleDuration=j.timescale*(kt/hn);let En=mt.subarray(1,4),Wt="avc1.";for(let Qt=0;Qt<3;Qt++){let gn=En[Qt].toString(16);gn.length<2&&(gn="0"+gn),Wt+=gn}j.codec=Wt;let Mt=this._mediaInfo;Mt.width=j.codecWidth,Mt.height=j.codecHeight,Mt.fps=j.frameRate.fps,Mt.profile=j.profile,Mt.level=j.level,Mt.refFrames=Bt.ref_frames,Mt.chromaFormat=Bt.chroma_format_string,Mt.sarNum=j.sarRatio.width,Mt.sarDen=j.sarRatio.height,Mt.videoCodec=Wt,Mt.hasAudio?Mt.audioCodec!=null&&(Mt.mimeType='video/x-flv; codecs="'+Mt.videoCodec+","+Mt.audioCodec+'"'):Mt.mimeType='video/x-flv; codecs="'+Mt.videoCodec+'"',Mt.isComplete()&&this._onMediaInfo(Mt)}let Kt=Ce.getUint8(vt);if(Kt===0){this._onError(fe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else Kt>1&&p.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ${Kt}`);vt++;for(let $t=0;$t<Kt;$t++){let gt=Ce.getUint16(vt,!Ee);vt+=2,gt!==0&&(vt+=gt)}j.avcc=new Uint8Array(T),j.avcc.set(new Uint8Array(d,g,T),0),p.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",j)}_parseAVCVideoData(d,g,T,j,te,Ee,Ce){let Xe=this._littleEndian,Ze=new DataView(d,g,T),ut=[],ft=0,Lt=0;const vt=this._naluLengthSize;let Kt=this._timestampBase+j,$t=Ee===1;for(;Lt<T;){if(Lt+4>=T){p.w(this.TAG,`Malformed Nalu near timestamp ${Kt}, offset = ${Lt}, dataSize = ${T}`);break}let gt=Ze.getUint32(Lt,!Xe);if(vt===3&&(gt>>>=8),gt>T-vt){p.w(this.TAG,`Malformed Nalus near timestamp ${Kt}, NaluSize > DataSize!`);return}let mt=Ze.getUint8(Lt+vt)&31;mt===5&&($t=!0);let Bt=new Uint8Array(d,g+Lt,vt+gt),kt={type:mt,data:Bt};ut.push(kt),ft+=Bt.byteLength,Lt+=vt+gt}if(ut.length){let gt=this._videoTrack,mt={units:ut,length:ft,isKeyframe:$t,dts:Kt,cts:Ce,pts:Kt+Ce};$t&&(mt.fileposition=te),gt.samples.push(mt),gt.length+=ft}}}var W=X;class ${static init(){$.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(let g in $.types)$.types.hasOwnProperty(g)&&($.types[g]=[g.charCodeAt(0),g.charCodeAt(1),g.charCodeAt(2),g.charCodeAt(3)]);let d=$.constants={};d.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),d.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),d.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),d.STSC=d.STCO=d.STTS,d.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),d.HDLR_VIDEO=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]),d.HDLR_AUDIO=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]),d.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),d.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),d.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}static box(d){let g=8,T=null,j=Array.prototype.slice.call(arguments,1),te=j.length;for(let Ce=0;Ce<te;Ce++)g+=j[Ce].byteLength;T=new Uint8Array(g),T[0]=g>>>24&255,T[1]=g>>>16&255,T[2]=g>>>8&255,T[3]=g&255,T.set(d,4);let Ee=8;for(let Ce=0;Ce<te;Ce++)T.set(j[Ce],Ee),Ee+=j[Ce].byteLength;return T}static generateInitSegment(d){let g=$.box($.types.ftyp,$.constants.FTYP),T=$.moov(d),j=new Uint8Array(g.byteLength+T.byteLength);return j.set(g,0),j.set(T,g.byteLength),j}static moov(d){let g=$.mvhd(d.timescale,d.duration),T=$.trak(d),j=$.mvex(d);return $.box($.types.moov,g,T,j)}static mvhd(d,g){return $.box($.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,d>>>24&255,d>>>16&255,d>>>8&255,d&255,g>>>24&255,g>>>16&255,g>>>8&255,g&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]))}static trak(d){return $.box($.types.trak,$.tkhd(d),$.mdia(d))}static tkhd(d){let g=d.id,T=d.duration,j=d.presentWidth,te=d.presentHeight;return $.box($.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,g>>>24&255,g>>>16&255,g>>>8&255,g&255,0,0,0,0,T>>>24&255,T>>>16&255,T>>>8&255,T&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,j>>>8&255,j&255,0,0,te>>>8&255,te&255,0,0]))}static mdia(d){return $.box($.types.mdia,$.mdhd(d),$.hdlr(d),$.minf(d))}static mdhd(d){let g=d.timescale,T=d.duration;return $.box($.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,g>>>24&255,g>>>16&255,g>>>8&255,g&255,T>>>24&255,T>>>16&255,T>>>8&255,T&255,85,196,0,0]))}static hdlr(d){let g=null;return d.type==="audio"?g=$.constants.HDLR_AUDIO:g=$.constants.HDLR_VIDEO,$.box($.types.hdlr,g)}static minf(d){let g=null;return d.type==="audio"?g=$.box($.types.smhd,$.constants.SMHD):g=$.box($.types.vmhd,$.constants.VMHD),$.box($.types.minf,g,$.dinf(),$.stbl(d))}static dinf(){return $.box($.types.dinf,$.box($.types.dref,$.constants.DREF))}static stbl(d){return $.box($.types.stbl,$.stsd(d),$.box($.types.stts,$.constants.STTS),$.box($.types.stsc,$.constants.STSC),$.box($.types.stsz,$.constants.STSZ),$.box($.types.stco,$.constants.STCO))}static stsd(d){return d.type==="audio"?d.codec==="mp3"?$.box($.types.stsd,$.constants.STSD_PREFIX,$.mp3(d)):$.box($.types.stsd,$.constants.STSD_PREFIX,$.mp4a(d)):$.box($.types.stsd,$.constants.STSD_PREFIX,$.avc1(d))}static mp3(d){let g=d.channelCount,T=d.audioSampleRate,j=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,g,0,16,0,0,0,0,T>>>8&255,T&255,0,0]);return $.box($.types[".mp3"],j)}static mp4a(d){let g=d.channelCount,T=d.audioSampleRate,j=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,g,0,16,0,0,0,0,T>>>8&255,T&255,0,0]);return $.box($.types.mp4a,j,$.esds(d))}static esds(d){let g=d.config||[],T=g.length,j=new Uint8Array([0,0,0,0,3,23+T,0,1,0,4,15+T,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([T]).concat(g).concat([6,1,2]));return $.box($.types.esds,j)}static avc1(d){let g=d.avcc,T=d.codecWidth,j=d.codecHeight,te=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,T>>>8&255,T&255,j>>>8&255,j&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return $.box($.types.avc1,te,$.box($.types.avcC,g))}static mvex(d){return $.box($.types.mvex,$.trex(d))}static trex(d){let g=d.id,T=new Uint8Array([0,0,0,0,g>>>24&255,g>>>16&255,g>>>8&255,g&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return $.box($.types.trex,T)}static moof(d,g){return $.box($.types.moof,$.mfhd(d.sequenceNumber),$.traf(d,g))}static mfhd(d){let g=new Uint8Array([0,0,0,0,d>>>24&255,d>>>16&255,d>>>8&255,d&255]);return $.box($.types.mfhd,g)}static traf(d,g){let T=d.id,j=$.box($.types.tfhd,new Uint8Array([0,0,0,0,T>>>24&255,T>>>16&255,T>>>8&255,T&255])),te=$.box($.types.tfdt,new Uint8Array([0,0,0,0,g>>>24&255,g>>>16&255,g>>>8&255,g&255])),Ee=$.sdtp(d),Ce=$.trun(d,Ee.byteLength+16+16+8+16+8+8);return $.box($.types.traf,j,te,Ce,Ee)}static sdtp(d){let g=d.samples||[],T=g.length,j=new Uint8Array(4+T);for(let te=0;te<T;te++){let Ee=g[te].flags;j[te+4]=Ee.isLeading<<6|Ee.dependsOn<<4|Ee.isDependedOn<<2|Ee.hasRedundancy}return $.box($.types.sdtp,j)}static trun(d,g){let T=d.samples||[],j=T.length,te=12+16*j,Ee=new Uint8Array(te);g+=8+te,Ee.set([0,0,15,1,j>>>24&255,j>>>16&255,j>>>8&255,j&255,g>>>24&255,g>>>16&255,g>>>8&255,g&255],0);for(let Ce=0;Ce<j;Ce++){let Xe=T[Ce].duration,Ze=T[Ce].size,ut=T[Ce].flags,ft=T[Ce].cts;Ee.set([Xe>>>24&255,Xe>>>16&255,Xe>>>8&255,Xe&255,Ze>>>24&255,Ze>>>16&255,Ze>>>8&255,Ze&255,ut.isLeading<<2|ut.dependsOn,ut.isDependedOn<<6|ut.hasRedundancy<<4|ut.isNonSync,0,0,ft>>>24&255,ft>>>16&255,ft>>>8&255,ft&255],12+16*Ce)}return $.box($.types.trun,Ee)}static mdat(d){return $.box($.types.mdat,d)}}$.init();var ee=$;class le{static getSilentFrame(d,g){if(d==="mp4a.40.2"){if(g===1)return new Uint8Array([0,200,0,128,35,128]);if(g===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(g===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(g===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(g===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(g===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])}else{if(g===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(g===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(g===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])}return null}}var ge=le;class we{constructor(d,g,T,j,te){this.dts=d,this.pts=g,this.duration=T,this.originalDts=j,this.isSyncPoint=te,this.fileposition=null}}class ze{constructor(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}appendSyncPoint(d){d.isSyncPoint=!0,this.syncPoints.push(d)}}class Ue{constructor(){this._list=[]}clear(){this._list=[]}appendArray(d){let g=this._list;d.length!==0&&(g.length>0&&d[0].originalDts<g[g.length-1].originalDts&&this.clear(),Array.prototype.push.apply(g,d))}getLastSyncPointBeforeDts(d){if(this._list.length==0)return null;let g=this._list,T=0,j=g.length-1,te=0,Ee=0,Ce=j;for(d<g[0].dts&&(T=0,Ee=Ce+1);Ee<=Ce;)if(te=Ee+Math.floor((Ce-Ee)/2),te===j||d>=g[te].dts&&d<g[te+1].dts){T=te;break}else g[te].dts<d?Ee=te+1:Ce=te-1;return this._list[T]}}class Ye{constructor(d){this._type=d,this._list=[],this._lastAppendLocation=-1}get type(){return this._type}get length(){return this._list.length}isEmpty(){return this._list.length===0}clear(){this._list=[],this._lastAppendLocation=-1}_searchNearestSegmentBefore(d){let g=this._list;if(g.length===0)return-2;let T=g.length-1,j=0,te=0,Ee=T,Ce=0;if(d<g[0].originalBeginDts)return Ce=-1,Ce;for(;te<=Ee;)if(j=te+Math.floor((Ee-te)/2),j===T||d>g[j].lastSample.originalDts&&d<g[j+1].originalBeginDts){Ce=j;break}else g[j].originalBeginDts<d?te=j+1:Ee=j-1;return Ce}_searchNearestSegmentAfter(d){return this._searchNearestSegmentBefore(d)+1}append(d){let g=this._list,T=d,j=this._lastAppendLocation,te=0;j!==-1&&j<g.length&&T.originalBeginDts>=g[j].lastSample.originalDts&&(j===g.length-1||j<g.length-1&&T.originalBeginDts<g[j+1].originalBeginDts)?te=j+1:g.length>0&&(te=this._searchNearestSegmentBefore(T.originalBeginDts)+1),this._lastAppendLocation=te,this._list.splice(te,0,T)}getLastSegmentBefore(d){let g=this._searchNearestSegmentBefore(d);return g>=0?this._list[g]:null}getLastSampleBefore(d){let g=this.getLastSegmentBefore(d);return g!=null?g.lastSample:null}getLastSyncPointBefore(d){let g=this._searchNearestSegmentBefore(d),T=this._list[g].syncPoints;for(;T.length===0&&g>0;)g--,T=this._list[g].syncPoints;return T.length>0?T[T.length-1]:null}}class Fe{constructor(d){this.TAG="MP4Remuxer",this._config=d,this._isLive=d.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new Ye("audio"),this._videoSegmentInfoList=new Ye("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(N.chrome&&(N.version.major<50||N.version.major===50&&N.version.build<2661)),this._fillSilentAfterSeek=N.msedge||N.msie,this._mp3UseMpegAudio=!N.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}destroy(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}bindDataSource(d){return d.onDataAvailable=this.remux.bind(this),d.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}get onInitSegment(){return this._onInitSegment}set onInitSegment(d){this._onInitSegment=d}get onMediaSegment(){return this._onMediaSegment}set onMediaSegment(d){this._onMediaSegment=d}insertDiscontinuity(){this._audioNextDts=this._videoNextDts=void 0}seek(d){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}remux(d,g){if(!this._onMediaSegment)throw new K("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(d,g),this._remuxVideo(g),this._remuxAudio(d)}_onTrackMetadataReceived(d,g){let T=null,j="mp4",te=g.codec;if(d==="audio")this._audioMeta=g,g.codec==="mp3"&&this._mp3UseMpegAudio?(j="mpeg",te="",T=new Uint8Array):T=ee.generateInitSegment(g);else if(d==="video")this._videoMeta=g,T=ee.generateInitSegment(g);else return;if(!this._onInitSegment)throw new K("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(d,{type:d,data:T.buffer,codec:te,container:`${d}/${j}`,mediaDuration:g.duration})}_calculateDtsBase(d,g){this._dtsBaseInited||(d.samples&&d.samples.length&&(this._audioDtsBase=d.samples[0].dts),g.samples&&g.samples.length&&(this._videoDtsBase=g.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}flushStashedSamples(){let d=this._videoStashedLastSample,g=this._audioStashedLastSample,T={type:"video",id:1,sequenceNumber:0,samples:[],length:0};d!=null&&(T.samples.push(d),T.length=d.length);let j={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};g!=null&&(j.samples.push(g),j.length=g.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(T,!0),this._remuxAudio(j,!0)}_remuxAudio(d,g){if(this._audioMeta==null)return;let T=d,j=T.samples,te,Ee=-1,Ce=-1,Xe=-1,Ze=this._audioMeta.refSampleDuration,ut=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,ft=this._dtsBaseInited&&this._audioNextDts===void 0,Lt=!1;if(!j||j.length===0||j.length===1&&!g)return;let vt=0,Kt=null,$t=0;ut?(vt=0,$t=T.length):(vt=8,$t=8+T.length);let gt=null;if(j.length>1&&(gt=j.pop(),$t-=gt.length),this._audioStashedLastSample!=null){let Mt=this._audioStashedLastSample;this._audioStashedLastSample=null,j.unshift(Mt),$t+=Mt.length}gt!=null&&(this._audioStashedLastSample=gt);let mt=j[0].dts-this._dtsBase;if(this._audioNextDts)te=mt-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())te=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(Lt=!0);else{let Mt=this._audioSegmentInfoList.getLastSampleBefore(mt);if(Mt!=null){let Qt=mt-(Mt.originalDts+Mt.duration);Qt<=3&&(Qt=0);let gn=Mt.dts+Mt.duration+Qt;te=mt-gn}else te=0}if(Lt){let Mt=mt-te,Qt=this._videoSegmentInfoList.getLastSegmentBefore(mt);if(Qt!=null&&Qt.beginDts<Mt){let gn=ge.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(gn){let Be=Qt.beginDts,Ke=Mt-Qt.beginDts;p.v(this.TAG,`InsertPrefixSilentAudio: dts: ${Be}, duration: ${Ke}`),j.unshift({unit:gn,dts:Be,pts:Be}),$t+=gn.byteLength}}else Lt=!1}let Bt=[];for(let Mt=0;Mt<j.length;Mt++){let Qt=j[Mt],gn=Qt.unit,Be=Qt.dts-this._dtsBase,Ke=Be-te;Ee===-1&&(Ee=Ke);let pt=0;Mt!==j.length-1?pt=j[Mt+1].dts-this._dtsBase-te-Ke:gt!=null?pt=gt.dts-this._dtsBase-te-Ke:Bt.length>=1?pt=Bt[Bt.length-1].duration:pt=Math.floor(Ze);let lt=!1,st=null;if(pt>Ze*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!N.safari){lt=!0;let ct=Math.abs(pt-Ze),At=Math.ceil(ct/Ze),Ut=Ke+Ze;p.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
|
|
dts: ${Ke+pt} ms, expected: ${Ke+Math.round(Ze)} ms, delta: ${Math.round(ct)} ms, generate: ${At} frames`);let cn=ge.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);cn==null&&(p.w(this.TAG,`Unable to generate silent frame for ${this._audioMeta.originalCodec} with ${this._audioMeta.channelCount} channels, repeat last frame`),cn=gn),st=[];for(let xn=0;xn<At;xn++){let an=Math.round(Ut);if(st.length>0){let Sn=st[st.length-1];Sn.duration=an-Sn.dts}let _n={dts:an,pts:an,cts:0,unit:cn,size:cn.byteLength,duration:0,originalDts:Be,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};st.push(_n),$t+=_n.size,Ut+=Ze}let tn=st[st.length-1];tn.duration=Ke+pt-tn.dts,pt=Math.round(Ze)}Bt.push({dts:Ke,pts:Ke,cts:0,unit:Qt.unit,size:Qt.unit.byteLength,duration:pt,originalDts:Be,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),lt&&Bt.push.apply(Bt,st)}ut?Kt=new Uint8Array($t):(Kt=new Uint8Array($t),Kt[0]=$t>>>24&255,Kt[1]=$t>>>16&255,Kt[2]=$t>>>8&255,Kt[3]=$t&255,Kt.set(ee.types.mdat,4));for(let Mt=0;Mt<Bt.length;Mt++){let Qt=Bt[Mt].unit;Kt.set(Qt,vt),vt+=Qt.byteLength}let kt=Bt[Bt.length-1];Ce=kt.dts+kt.duration,this._audioNextDts=Ce;let hn=new ze;hn.beginDts=Ee,hn.endDts=Ce,hn.beginPts=Ee,hn.endPts=Ce,hn.originalBeginDts=Bt[0].originalDts,hn.originalEndDts=kt.originalDts+kt.duration,hn.firstSample=new we(Bt[0].dts,Bt[0].pts,Bt[0].duration,Bt[0].originalDts,!1),hn.lastSample=new we(kt.dts,kt.pts,kt.duration,kt.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(hn),T.samples=Bt,T.sequenceNumber++;let En=null;ut?En=new Uint8Array:En=ee.moof(T,Ee),T.samples=[],T.length=0;let Wt={type:"audio",data:this._mergeBoxes(En,Kt).buffer,sampleCount:Bt.length,info:hn};ut&&ft&&(Wt.timestampOffset=Ee),this._onMediaSegment("audio",Wt)}_remuxVideo(d,g){if(this._videoMeta==null)return;let T=d,j=T.samples,te,Ee=-1,Ce=-1,Xe=-1,Ze=-1;if(!j||j.length===0||j.length===1&&!g)return;let ut=8,ft=null,Lt=8+d.length,vt=null;if(j.length>1&&(vt=j.pop(),Lt-=vt.length),this._videoStashedLastSample!=null){let kt=this._videoStashedLastSample;this._videoStashedLastSample=null,j.unshift(kt),Lt+=kt.length}vt!=null&&(this._videoStashedLastSample=vt);let Kt=j[0].dts-this._dtsBase;if(this._videoNextDts)te=Kt-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())te=0;else{let kt=this._videoSegmentInfoList.getLastSampleBefore(Kt);if(kt!=null){let hn=Kt-(kt.originalDts+kt.duration);hn<=3&&(hn=0);let En=kt.dts+kt.duration+hn;te=Kt-En}else te=0}let $t=new ze,gt=[];for(let kt=0;kt<j.length;kt++){let hn=j[kt],En=hn.dts-this._dtsBase,Wt=hn.isKeyframe,Mt=En-te,Qt=hn.cts,gn=Mt+Qt;Ee===-1&&(Ee=Mt,Xe=gn);let Be=0;if(kt!==j.length-1?Be=j[kt+1].dts-this._dtsBase-te-Mt:vt!=null?Be=vt.dts-this._dtsBase-te-Mt:gt.length>=1?Be=gt[gt.length-1].duration:Be=Math.floor(this._videoMeta.refSampleDuration),Wt){let Ke=new we(Mt,gn,Be,hn.dts,!0);Ke.fileposition=hn.fileposition,$t.appendSyncPoint(Ke)}gt.push({dts:Mt,pts:gn,cts:Qt,units:hn.units,size:hn.length,isKeyframe:Wt,duration:Be,originalDts:En,flags:{isLeading:0,dependsOn:Wt?2:1,isDependedOn:Wt?1:0,hasRedundancy:0,isNonSync:Wt?0:1}})}ft=new Uint8Array(Lt),ft[0]=Lt>>>24&255,ft[1]=Lt>>>16&255,ft[2]=Lt>>>8&255,ft[3]=Lt&255,ft.set(ee.types.mdat,4);for(let kt=0;kt<gt.length;kt++){let hn=gt[kt].units;for(;hn.length;){let Wt=hn.shift().data;ft.set(Wt,ut),ut+=Wt.byteLength}}let mt=gt[gt.length-1];if(Ce=mt.dts+mt.duration,Ze=mt.pts+mt.duration,this._videoNextDts=Ce,$t.beginDts=Ee,$t.endDts=Ce,$t.beginPts=Xe,$t.endPts=Ze,$t.originalBeginDts=gt[0].originalDts,$t.originalEndDts=mt.originalDts+mt.duration,$t.firstSample=new we(gt[0].dts,gt[0].pts,gt[0].duration,gt[0].originalDts,gt[0].isKeyframe),$t.lastSample=new we(mt.dts,mt.pts,mt.duration,mt.originalDts,mt.isKeyframe),this._isLive||this._videoSegmentInfoList.append($t),T.samples=gt,T.sequenceNumber++,this._forceFirstIDR){let kt=gt[0].flags;kt.dependsOn=2,kt.isNonSync=0}let Bt=ee.moof(T,Ee);T.samples=[],T.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Bt,ft).buffer,sampleCount:gt.length,info:$t})}_mergeBoxes(d,g){let T=new Uint8Array(d.byteLength+g.byteLength);return T.set(d,0),T.set(g,d.byteLength),T}}var Ve=Fe,Ie={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"};class tt{constructor(d,g){this.TAG="TransmuxingController",this._emitter=new(ue()),this._config=g,d.segments||(d.segments=[{duration:d.duration,filesize:d.filesize,url:d.url}]),typeof d.cors!="boolean"&&(d.cors=!0),typeof d.withCredentials!="boolean"&&(d.withCredentials=!1),this._mediaDataSource=d,this._currentSegmentIndex=0;let T=0;this._mediaDataSource.segments.forEach(j=>{j.timestampBase=T,T+=j.duration,j.cors=d.cors,j.withCredentials=d.withCredentials,g.referrerPolicy&&(j.referrerPolicy=g.referrerPolicy)}),!isNaN(T)&&this._mediaDataSource.duration!==T&&(this._mediaDataSource.duration=T),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}destroy(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}on(d,g){this._emitter.addListener(d,g)}off(d,g){this._emitter.removeListener(d,g)}start(){this._loadSegment(0),this._enableStatisticsReporter()}_loadSegment(d,g){this._currentSegmentIndex=d;let T=this._mediaDataSource.segments[d],j=this._ioctl=new Z(T,this._config,d);j.onError=this._onIOException.bind(this),j.onSeeked=this._onIOSeeked.bind(this),j.onComplete=this._onIOComplete.bind(this),j.onRedirect=this._onIORedirect.bind(this),j.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),g?this._demuxer.bindDataSource(this._ioctl):j.onDataArrival=this._onInitChunkArrival.bind(this),j.open(g)}stop(){this._internalAbort(),this._disableStatisticsReporter()}_internalAbort(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}pause(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}resume(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}seek(d){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;let g=this._searchSegmentIndexContains(d);if(g===this._currentSegmentIndex){let T=this._mediaInfo.segments[g];if(T==null)this._pendingSeekTime=d;else{let j=T.getNearestKeyframe(d);this._remuxer.seek(j.milliseconds),this._ioctl.seek(j.fileposition),this._pendingResolveSeekPoint=j.milliseconds}}else{let T=this._mediaInfo.segments[g];if(T==null)this._pendingSeekTime=d,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(g);else{let j=T.getNearestKeyframe(d);this._internalAbort(),this._remuxer.seek(d),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[g].timestampBase,this._loadSegment(g,j.fileposition),this._pendingResolveSeekPoint=j.milliseconds,this._reportSegmentMediaInfo(g)}}this._enableStatisticsReporter()}_searchSegmentIndexContains(d){let g=this._mediaDataSource.segments,T=g.length-1;for(let j=0;j<g.length;j++)if(d<g[j].timestampBase){T=j-1;break}return T}_onInitChunkArrival(d,g){let T=null,j=0;if(g>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,j=this._demuxer.parseChunks(d,g);else if((T=W.probe(d)).match){this._demuxer=new W(T,this._config),this._remuxer||(this._remuxer=new Ve(this._config));let te=this._mediaDataSource;te.duration!=null&&!isNaN(te.duration)&&(this._demuxer.overridedDuration=te.duration),typeof te.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=te.hasAudio),typeof te.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=te.hasVideo),this._demuxer.timestampBase=te.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),j=this._demuxer.parseChunks(d,g)}else T=null,p.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(()=>{this._internalAbort()}),this._emitter.emit(Ie.DEMUX_ERROR,fe.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),j=0;return j}_onMediaInfo(d){this._mediaInfo==null&&(this._mediaInfo=Object.assign({},d),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,ke.prototype));let g=Object.assign({},d);Object.setPrototypeOf(g,ke.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=g,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(()=>{let T=this._pendingSeekTime;this._pendingSeekTime=null,this.seek(T)})}_onMetaDataArrived(d){this._emitter.emit(Ie.METADATA_ARRIVED,d)}_onScriptDataArrived(d){this._emitter.emit(Ie.SCRIPTDATA_ARRIVED,d)}_onIOSeeked(){this._remuxer.insertDiscontinuity()}_onIOComplete(d){let T=d+1;T<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(T)):(this._remuxer.flushStashedSamples(),this._emitter.emit(Ie.LOADING_COMPLETE),this._disableStatisticsReporter())}_onIORedirect(d){let g=this._ioctl.extraData;this._mediaDataSource.segments[g].redirectedURL=d}_onIORecoveredEarlyEof(){this._emitter.emit(Ie.RECOVERED_EARLY_EOF)}_onIOException(d,g){p.e(this.TAG,`IOException: type = ${d}, code = ${g.code}, msg = ${g.msg}`),this._emitter.emit(Ie.IO_ERROR,d,g),this._disableStatisticsReporter()}_onDemuxException(d,g){p.e(this.TAG,`DemuxException: type = ${d}, info = ${g}`),this._emitter.emit(Ie.DEMUX_ERROR,d,g)}_onRemuxerInitSegmentArrival(d,g){this._emitter.emit(Ie.INIT_SEGMENT,d,g)}_onRemuxerMediaSegmentArrival(d,g){if(this._pendingSeekTime==null&&(this._emitter.emit(Ie.MEDIA_SEGMENT,d,g),this._pendingResolveSeekPoint!=null&&d==="video")){let T=g.info.syncPoints,j=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,N.safari&&T.length>0&&T[0].originalDts===j&&(j=T[0].pts),this._emitter.emit(Ie.RECOMMEND_SEEKPOINT,j)}}_enableStatisticsReporter(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}_disableStatisticsReporter(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}_reportSegmentMediaInfo(d){let g=this._mediaInfo.segments[d],T=Object.assign({},g);T.duration=this._mediaInfo.duration,T.segmentCount=this._mediaInfo.segmentCount,delete T.segments,delete T.keyframesIndex,this._emitter.emit(Ie.MEDIA_INFO,T)}_reportStatisticsInfo(){let d={};d.url=this._ioctl.currentURL,d.hasRedirect=this._ioctl.hasRedirect,d.hasRedirect&&(d.redirectedURL=this._ioctl.currentRedirectedURL),d.speed=this._ioctl.currentSpeed,d.loaderType=this._ioctl.loaderType,d.currentSegmentIndex=this._currentSegmentIndex,d.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Ie.STATISTICS_INFO,d)}}var Nt=tt,Rt=function(rt){let d="TransmuxingWorker",g=null,T=$t.bind(this);de.install(),rt.addEventListener("message",function(gt){switch(gt.data.cmd){case"init":g=new Nt(gt.data.param[0],gt.data.param[1]),g.on(Ie.IO_ERROR,Lt.bind(this)),g.on(Ie.DEMUX_ERROR,vt.bind(this)),g.on(Ie.INIT_SEGMENT,j.bind(this)),g.on(Ie.MEDIA_SEGMENT,te.bind(this)),g.on(Ie.LOADING_COMPLETE,Ee.bind(this)),g.on(Ie.RECOVERED_EARLY_EOF,Ce.bind(this)),g.on(Ie.MEDIA_INFO,Xe.bind(this)),g.on(Ie.METADATA_ARRIVED,Ze.bind(this)),g.on(Ie.SCRIPTDATA_ARRIVED,ut.bind(this)),g.on(Ie.STATISTICS_INFO,ft.bind(this)),g.on(Ie.RECOMMEND_SEEKPOINT,Kt.bind(this));break;case"destroy":g&&(g.destroy(),g=null),rt.postMessage({msg:"destroyed"});break;case"start":g.start();break;case"stop":g.stop();break;case"seek":g.seek(gt.data.param);break;case"pause":g.pause();break;case"resume":g.resume();break;case"logging_config":{let mt=gt.data.param;oe.applyConfig(mt),mt.enableCallback===!0?oe.addLogListener(T):oe.removeLogListener(T);break}}});function j(gt,mt){let Bt={msg:Ie.INIT_SEGMENT,data:{type:gt,data:mt}};rt.postMessage(Bt,[mt.data])}function te(gt,mt){let Bt={msg:Ie.MEDIA_SEGMENT,data:{type:gt,data:mt}};rt.postMessage(Bt,[mt.data])}function Ee(){let gt={msg:Ie.LOADING_COMPLETE};rt.postMessage(gt)}function Ce(){let gt={msg:Ie.RECOVERED_EARLY_EOF};rt.postMessage(gt)}function Xe(gt){let mt={msg:Ie.MEDIA_INFO,data:gt};rt.postMessage(mt)}function Ze(gt){let mt={msg:Ie.METADATA_ARRIVED,data:gt};rt.postMessage(mt)}function ut(gt){let mt={msg:Ie.SCRIPTDATA_ARRIVED,data:gt};rt.postMessage(mt)}function ft(gt){let mt={msg:Ie.STATISTICS_INFO,data:gt};rt.postMessage(mt)}function Lt(gt,mt){rt.postMessage({msg:Ie.IO_ERROR,data:{type:gt,info:mt}})}function vt(gt,mt){rt.postMessage({msg:Ie.DEMUX_ERROR,data:{type:gt,info:mt}})}function Kt(gt){rt.postMessage({msg:Ie.RECOMMEND_SEEKPOINT,data:gt})}function $t(gt,mt){rt.postMessage({msg:"logcat_callback",data:{type:gt,logcat:mt}})}};class ht{constructor(d,g){if(this.TAG="Transmuxer",this._emitter=new(ue()),g.enableWorker&&typeof Worker!="undefined")try{let T=S(82059);this._worker=T(Rt),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[d,g]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},oe.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:oe.getConfig()})}catch(T){p.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Nt(d,g)}else this._controller=new Nt(d,g);if(this._controller){let T=this._controller;T.on(Ie.IO_ERROR,this._onIOError.bind(this)),T.on(Ie.DEMUX_ERROR,this._onDemuxError.bind(this)),T.on(Ie.INIT_SEGMENT,this._onInitSegment.bind(this)),T.on(Ie.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),T.on(Ie.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),T.on(Ie.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),T.on(Ie.MEDIA_INFO,this._onMediaInfo.bind(this)),T.on(Ie.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),T.on(Ie.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),T.on(Ie.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),T.on(Ie.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}destroy(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),oe.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}on(d,g){this._emitter.addListener(d,g)}off(d,g){this._emitter.removeListener(d,g)}hasWorker(){return this._worker!=null}open(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}close(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}seek(d){this._worker?this._worker.postMessage({cmd:"seek",param:d}):this._controller.seek(d)}pause(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}resume(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}_onInitSegment(d,g){Promise.resolve().then(()=>{this._emitter.emit(Ie.INIT_SEGMENT,d,g)})}_onMediaSegment(d,g){Promise.resolve().then(()=>{this._emitter.emit(Ie.MEDIA_SEGMENT,d,g)})}_onLoadingComplete(){Promise.resolve().then(()=>{this._emitter.emit(Ie.LOADING_COMPLETE)})}_onRecoveredEarlyEof(){Promise.resolve().then(()=>{this._emitter.emit(Ie.RECOVERED_EARLY_EOF)})}_onMediaInfo(d){Promise.resolve().then(()=>{this._emitter.emit(Ie.MEDIA_INFO,d)})}_onMetaDataArrived(d){Promise.resolve().then(()=>{this._emitter.emit(Ie.METADATA_ARRIVED,d)})}_onScriptDataArrived(d){Promise.resolve().then(()=>{this._emitter.emit(Ie.SCRIPTDATA_ARRIVED,d)})}_onStatisticsInfo(d){Promise.resolve().then(()=>{this._emitter.emit(Ie.STATISTICS_INFO,d)})}_onIOError(d,g){Promise.resolve().then(()=>{this._emitter.emit(Ie.IO_ERROR,d,g)})}_onDemuxError(d,g){Promise.resolve().then(()=>{this._emitter.emit(Ie.DEMUX_ERROR,d,g)})}_onRecommendSeekpoint(d){Promise.resolve().then(()=>{this._emitter.emit(Ie.RECOMMEND_SEEKPOINT,d)})}_onLoggingConfigChanged(d){this._worker&&this._worker.postMessage({cmd:"logging_config",param:d})}_onWorkerMessage(d){let g=d.data,T=g.data;if(g.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(g.msg){case Ie.INIT_SEGMENT:case Ie.MEDIA_SEGMENT:this._emitter.emit(g.msg,T.type,T.data);break;case Ie.LOADING_COMPLETE:case Ie.RECOVERED_EARLY_EOF:this._emitter.emit(g.msg);break;case Ie.MEDIA_INFO:Object.setPrototypeOf(T,ke.prototype),this._emitter.emit(g.msg,T);break;case Ie.METADATA_ARRIVED:case Ie.SCRIPTDATA_ARRIVED:case Ie.STATISTICS_INFO:this._emitter.emit(g.msg,T);break;case Ie.IO_ERROR:case Ie.DEMUX_ERROR:this._emitter.emit(g.msg,T.type,T.info);break;case Ie.RECOMMEND_SEEKPOINT:this._emitter.emit(g.msg,T);break;case"logcat_callback":p.emitter.emit("log",T.type,T.logcat);break;default:break}}}var qt=ht,bt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};class zt{constructor(d){this.TAG="MSEController",this._config=d,this._emitter=new(ue()),this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new Ue}destroy(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}on(d,g){this._emitter.addListener(d,g)}off(d,g){this._emitter.removeListener(d,g)}attachMediaElement(d){if(this._mediaSource)throw new K("MediaSource has been attached to an HTMLMediaElement!");let g=this._mediaSource=new window.MediaSource;g.addEventListener("sourceopen",this.e.onSourceOpen),g.addEventListener("sourceended",this.e.onSourceEnded),g.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=d,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),d.src=this._mediaSourceObjectURL}detachMediaElement(){if(this._mediaSource){let d=this._mediaSource;for(let g in this._sourceBuffers){let T=this._pendingSegments[g];T.splice(0,T.length),this._pendingSegments[g]=null,this._pendingRemoveRanges[g]=null,this._lastInitSegments[g]=null;let j=this._sourceBuffers[g];if(j){if(d.readyState!=="closed"){try{d.removeSourceBuffer(j)}catch(te){p.e(this.TAG,te.message)}j.removeEventListener("error",this.e.onSourceBufferError),j.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[g]=null,this._sourceBuffers[g]=null}}if(d.readyState==="open")try{d.endOfStream()}catch(g){p.e(this.TAG,g.message)}d.removeEventListener("sourceopen",this.e.onSourceOpen),d.removeEventListener("sourceended",this.e.onSourceEnded),d.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}appendInitSegment(d,g){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(d),this._pendingSegments[d.type].push(d);return}let T=d,j=`${T.container}`;T.codec&&T.codec.length>0&&(j+=`;codecs=${T.codec}`);let te=!1;if(p.v(this.TAG,"Received Initialization Segment, mimeType: "+j),this._lastInitSegments[T.type]=T,j!==this._mimeTypes[T.type]){if(this._mimeTypes[T.type])p.v(this.TAG,`Notice: ${T.type} mimeType changed, origin: ${this._mimeTypes[T.type]}, target: ${j}`);else{te=!0;try{let Ee=this._sourceBuffers[T.type]=this._mediaSource.addSourceBuffer(j);Ee.addEventListener("error",this.e.onSourceBufferError),Ee.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(Ee){p.e(this.TAG,Ee.message),this._emitter.emit(bt.ERROR,{code:Ee.code,msg:Ee.message});return}}this._mimeTypes[T.type]=j}g||this._pendingSegments[T.type].push(T),te||this._sourceBuffers[T.type]&&!this._sourceBuffers[T.type].updating&&this._doAppendSegments(),N.safari&&T.container==="audio/mpeg"&&T.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=T.mediaDuration/1e3,this._updateMediaSourceDuration())}appendMediaSegment(d){let g=d;this._pendingSegments[g.type].push(g),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();let T=this._sourceBuffers[g.type];T&&!T.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}seek(d){for(let g in this._sourceBuffers){if(!this._sourceBuffers[g])continue;let T=this._sourceBuffers[g];if(this._mediaSource.readyState==="open")try{T.abort()}catch(te){p.e(this.TAG,te.message)}this._idrList.clear();let j=this._pendingSegments[g];if(j.splice(0,j.length),this._mediaSource.readyState!=="closed"){for(let te=0;te<T.buffered.length;te++){let Ee=T.buffered.start(te),Ce=T.buffered.end(te);this._pendingRemoveRanges[g].push({start:Ee,end:Ce})}if(T.updating||this._doRemoveRanges(),N.safari){let te=this._lastInitSegments[g];te&&(this._pendingSegments[g].push(te),T.updating||this._doAppendSegments())}}}}endOfStream(){let d=this._mediaSource,g=this._sourceBuffers;if(!d||d.readyState!=="open"){d&&d.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}g.video&&g.video.updating||g.audio&&g.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,d.endOfStream())}getNearestKeyframe(d){return this._idrList.getLastSyncPointBeforeDts(d)}_needCleanupSourceBuffer(){if(!this._config.autoCleanupSourceBuffer)return!1;let d=this._mediaElement.currentTime;for(let g in this._sourceBuffers){let T=this._sourceBuffers[g];if(T){let j=T.buffered;if(j.length>=1&&d-j.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}_doCleanupSourceBuffer(){let d=this._mediaElement.currentTime;for(let g in this._sourceBuffers){let T=this._sourceBuffers[g];if(T){let j=T.buffered,te=!1;for(let Ee=0;Ee<j.length;Ee++){let Ce=j.start(Ee),Xe=j.end(Ee);if(Ce<=d&&d<Xe+3){if(d-Ce>=this._config.autoCleanupMaxBackwardDuration){te=!0;let Ze=d-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[g].push({start:Ce,end:Ze})}}else Xe<d&&(te=!0,this._pendingRemoveRanges[g].push({start:Ce,end:Xe}))}te&&!T.updating&&this._doRemoveRanges()}}}_updateMediaSourceDuration(){let d=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open"||d.video&&d.video.updating||d.audio&&d.audio.updating)return;let g=this._mediaSource.duration,T=this._pendingMediaDuration;T>0&&(isNaN(g)||T>g)&&(p.v(this.TAG,`Update MediaSource duration from ${g} to ${T}`),this._mediaSource.duration=T),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}_doRemoveRanges(){for(let d in this._pendingRemoveRanges){if(!this._sourceBuffers[d]||this._sourceBuffers[d].updating)continue;let g=this._sourceBuffers[d],T=this._pendingRemoveRanges[d];for(;T.length&&!g.updating;){let j=T.shift();g.remove(j.start,j.end)}}}_doAppendSegments(){let d=this._pendingSegments;for(let g in d)if(!(!this._sourceBuffers[g]||this._sourceBuffers[g].updating)&&d[g].length>0){let T=d[g].shift();if(T.timestampOffset){let j=this._sourceBuffers[g].timestampOffset,te=T.timestampOffset/1e3;Math.abs(j-te)>.1&&(p.v(this.TAG,`Update MPEG audio timestampOffset from ${j} to ${te}`),this._sourceBuffers[g].timestampOffset=te),delete T.timestampOffset}if(!T.data||T.data.byteLength===0)continue;try{this._sourceBuffers[g].appendBuffer(T.data),this._isBufferFull=!1,g==="video"&&T.hasOwnProperty("info")&&this._idrList.appendArray(T.info.syncPoints)}catch(j){this._pendingSegments[g].unshift(T),j.code===22?(this._isBufferFull||this._emitter.emit(bt.BUFFER_FULL),this._isBufferFull=!0):(p.e(this.TAG,j.message),this._emitter.emit(bt.ERROR,{code:j.code,msg:j.message}))}}}_onSourceOpen(){if(p.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){let d=this._pendingSourceBufferInit;for(;d.length;){let g=d.shift();this.appendInitSegment(g,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(bt.SOURCE_OPEN)}_onSourceEnded(){p.v(this.TAG,"MediaSource onSourceEnded")}_onSourceClose(){p.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}_hasPendingSegments(){let d=this._pendingSegments;return d.video.length>0||d.audio.length>0}_hasPendingRemoveRanges(){let d=this._pendingRemoveRanges;return d.video.length>0||d.audio.length>0}_onSourceBufferUpdateEnd(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(bt.UPDATE_END)}_onSourceBufferError(d){p.e(this.TAG,`SourceBuffer Error: ${d}`)}}var Tt=zt;const _t={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Ot={NETWORK_EXCEPTION:E.EXCEPTION,NETWORK_STATUS_CODE_INVALID:E.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:E.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:E.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:fe.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:fe.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:fe.CODEC_UNSUPPORTED};class St{constructor(d,g){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(ue()),this._config=b(),typeof g=="object"&&Object.assign(this._config,g),d.type.toLowerCase()!=="flv")throw new P("FlvPlayer requires an flv MediaDataSource input!");d.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=d,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;let T=N.chrome&&(N.version.major<50||N.version.major===50&&N.version.build<2661);this._alwaysSeekKeyframe=!!(T||N.msedge||N.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}destroy(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(d,g){d===be.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(be.MEDIA_INFO,this.mediaInfo)}):d===be.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(be.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(d,g)}off(d,g){this._emitter.removeListener(d,g)}attachMediaElement(d){if(this._mediaElement=d,d.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),d.addEventListener("seeking",this.e.onvSeeking),d.addEventListener("canplay",this.e.onvCanPlay),d.addEventListener("stalled",this.e.onvStalled),d.addEventListener("progress",this.e.onvProgress),this._msectl=new Tt(this._config),this._msectl.on(bt.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(bt.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(bt.SOURCE_OPEN,()=>{this._mseSourceOpened=!0,this._hasPendingLoad&&(this._hasPendingLoad=!1,this.load())}),this._msectl.on(bt.ERROR,g=>{this._emitter.emit(be.ERROR,_t.MEDIA_ERROR,Ot.MEDIA_MSE_ERROR,g)}),this._msectl.attachMediaElement(d),this._pendingSeekTime!=null)try{d.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(g){}}detachMediaElement(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}load(){if(!this._mediaElement)throw new K("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new K("FlvPlayer.load() has been called, please call unload() first!");if(!this._hasPendingLoad){if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new qt(this._mediaDataSource,this._config),this._transmuxer.on(Ie.INIT_SEGMENT,(d,g)=>{this._msectl.appendInitSegment(g)}),this._transmuxer.on(Ie.MEDIA_SEGMENT,(d,g)=>{if(this._msectl.appendMediaSegment(g),this._config.lazyLoad&&!this._config.isLive){let T=this._mediaElement.currentTime;g.info.endDts>=(T+this._config.lazyLoadMaxDuration)*1e3&&this._progressChecker==null&&(p.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}),this._transmuxer.on(Ie.LOADING_COMPLETE,()=>{this._msectl.endOfStream(),this._emitter.emit(be.LOADING_COMPLETE)}),this._transmuxer.on(Ie.RECOVERED_EARLY_EOF,()=>{this._emitter.emit(be.RECOVERED_EARLY_EOF)}),this._transmuxer.on(Ie.IO_ERROR,(d,g)=>{this._emitter.emit(be.ERROR,_t.NETWORK_ERROR,d,g)}),this._transmuxer.on(Ie.DEMUX_ERROR,(d,g)=>{this._emitter.emit(be.ERROR,_t.MEDIA_ERROR,d,{code:-1,msg:g})}),this._transmuxer.on(Ie.MEDIA_INFO,d=>{this._mediaInfo=d,this._emitter.emit(be.MEDIA_INFO,Object.assign({},d))}),this._transmuxer.on(Ie.METADATA_ARRIVED,d=>{this._emitter.emit(be.METADATA_ARRIVED,d)}),this._transmuxer.on(Ie.SCRIPTDATA_ARRIVED,d=>{this._emitter.emit(be.SCRIPTDATA_ARRIVED,d)}),this._transmuxer.on(Ie.STATISTICS_INFO,d=>{this._statisticsInfo=this._fillStatisticsInfo(d),this._emitter.emit(be.STATISTICS_INFO,Object.assign({},this._statisticsInfo))}),this._transmuxer.on(Ie.RECOMMEND_SEEKPOINT,d=>{this._mediaElement&&!this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=d/1e3)}),this._transmuxer.open()}}unload(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(d){this._mediaElement.volume=d}get muted(){return this._mediaElement.muted}set muted(d){this._mediaElement.muted=d}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(d){this._mediaElement?this._internalSeek(d):this._pendingSeekTime=d}get mediaInfo(){return Object.assign({},this._mediaInfo)}get statisticsInfo(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}_fillStatisticsInfo(d){if(d.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return d;let g=!0,T=0,j=0;if(this._mediaElement.getVideoPlaybackQuality){let te=this._mediaElement.getVideoPlaybackQuality();T=te.totalVideoFrames,j=te.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(T=this._mediaElement.webkitDecodedFrameCount,j=this._mediaElement.webkitDroppedFrameCount):g=!1;return g&&(d.decodedFrames=T,d.droppedFrames=j),d}_onmseUpdateEnd(){if(!this._config.lazyLoad||this._config.isLive)return;let d=this._mediaElement.buffered,g=this._mediaElement.currentTime,T=0,j=0;for(let te=0;te<d.length;te++){let Ee=d.start(te),Ce=d.end(te);if(Ee<=g&&g<Ce){T=Ee,j=Ce;break}}j>=g+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(p.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}_onmseBufferFull(){p.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}_suspendTransmuxer(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}_checkProgressAndResume(){let d=this._mediaElement.currentTime,g=this._mediaElement.buffered,T=!1;for(let j=0;j<g.length;j++){let te=g.start(j),Ee=g.end(j);if(d>=te&&d<Ee){d>=Ee-this._config.lazyLoadRecoverDuration&&(T=!0);break}}T&&(window.clearInterval(this._progressChecker),this._progressChecker=null,T&&(p.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}_isTimepointBuffered(d){let g=this._mediaElement.buffered;for(let T=0;T<g.length;T++){let j=g.start(T),te=g.end(T);if(d>=j&&d<te)return!0}return!1}_internalSeek(d){let g=this._isTimepointBuffered(d),T=!1,j=0;if(d<1&&this._mediaElement.buffered.length>0){let te=this._mediaElement.buffered.start(0);(te<1&&d<te||N.safari)&&(T=!0,j=N.safari?.1:te)}if(T)this._requestSetTime=!0,this._mediaElement.currentTime=j;else if(g){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=d;else{let te=this._msectl.getNearestKeyframe(Math.floor(d*1e3));this._requestSetTime=!0,te!=null?this._mediaElement.currentTime=te.dts/1e3:this._mediaElement.currentTime=d}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(d),this._transmuxer.seek(Math.floor(d*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=d)}_checkAndApplyUnbufferedSeekpoint(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){let d=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(d)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(d),this._transmuxer.seek(Math.floor(d*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=d))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_checkAndResumeStuckPlayback(d){let g=this._mediaElement;if(d||!this._receivedCanPlay||g.readyState<2){let T=g.buffered;T.length>0&&g.currentTime<T.start(0)&&(p.w(this.TAG,`Playback seems stuck at ${g.currentTime}, seek to ${T.start(0)}`),this._requestSetTime=!0,this._mediaElement.currentTime=T.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}_onvLoadedMetadata(d){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}_onvSeeking(d){let g=this._mediaElement.currentTime,T=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(g<1&&T.length>0){let j=T.start(0);if(j<1&&g<j||N.safari){this._requestSetTime=!0,this._mediaElement.currentTime=N.safari?.1:j;return}}if(this._isTimepointBuffered(g)){if(this._alwaysSeekKeyframe){let j=this._msectl.getNearestKeyframe(Math.floor(g*1e3));j!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=j.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:g,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_onvCanPlay(d){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}_onvStalled(d){this._checkAndResumeStuckPlayback(!0)}_onvProgress(d){this._checkAndResumeStuckPlayback()}}var Jt=St;class Pt{constructor(d,g){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(ue()),this._config=b(),typeof g=="object"&&Object.assign(this._config,g),d.type.toLowerCase()==="flv")throw new P("NativePlayer does't support flv MediaDataSource input!");if(d.hasOwnProperty("segments"))throw new P(`NativePlayer(${d.type}) doesn't support multipart playback!`);this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=d,this._mediaElement=null}destroy(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(d,g){d===be.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(be.MEDIA_INFO,this.mediaInfo)}):d===be.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(be.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(d,g)}off(d,g){this._emitter.removeListener(d,g)}attachMediaElement(d){if(this._mediaElement=d,d.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{d.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(g){}}detachMediaElement(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}load(){if(!this._mediaElement)throw new K("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}unload(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(d){this._mediaElement.volume=d}get muted(){return this._mediaElement.muted}set muted(d){this._mediaElement.muted=d}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(d){this._mediaElement?this._mediaElement.currentTime=d:this._pendingSeekTime=d}get mediaInfo(){let g={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(g.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(g.width=this._mediaElement.videoWidth,g.height=this._mediaElement.videoHeight)),g}get statisticsInfo(){let d={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return d;let g=!0,T=0,j=0;if(this._mediaElement.getVideoPlaybackQuality){let te=this._mediaElement.getVideoPlaybackQuality();T=te.totalVideoFrames,j=te.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(T=this._mediaElement.webkitDecodedFrameCount,j=this._mediaElement.webkitDroppedFrameCount):g=!1;return g&&(d.decodedFrames=T,d.droppedFrames=j),d}_onvLoadedMetadata(d){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(be.MEDIA_INFO,this.mediaInfo)}_reportStatisticsInfo(){this._emitter.emit(be.STATISTICS_INFO,this.statisticsInfo)}}var xt=Pt;de.install();function Dt(rt,d){let g=rt;if(g==null||typeof g!="object")throw new P("MediaDataSource must be an javascript object!");if(!g.hasOwnProperty("type"))throw new P("MediaDataSource must has type field to indicate video file type!");switch(g.type){case"flv":return new Jt(g,d);default:return new xt(g,d)}}function un(){return V.supportMSEH264Playback()}function Ft(){return V.getFeatureList()}let Ht={};Ht.createPlayer=Dt,Ht.isSupported=un,Ht.getFeatureList=Ft,Ht.BaseLoader=w,Ht.LoaderStatus=_,Ht.LoaderErrors=E,Ht.Events=be,Ht.ErrorTypes=_t,Ht.ErrorDetails=Ot,Ht.FlvPlayer=Jt,Ht.NativePlayer=xt,Ht.LoggingControl=oe,Object.defineProperty(Ht,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var It=Ht},29509:function(Ct,He,S){"use strict";S.d(He,{o2:function(){return G},yT:function(){return p}});var x=S(77654),de=S(34998);const me=de.i.map(se=>`${se}-inverse`),ue=["success","processing","error","default","warning"];function G(se){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,x.Z)(me),(0,x.Z)(de.i)).includes(se):de.i.includes(se)}function p(se){return ue.includes(se)}},99402:function(Ct,He,S){"use strict";S.d(He,{T:function(){return de},n:function(){return x}});function x(me){return["small","middle","large"].includes(me)}function de(me){return me?typeof me=="number"&&!Number.isNaN(me):!1}},52838:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return p}});var x=S(37645);function de(se,ne,l,K){if(K===!1)return{adjustX:!1,adjustY:!1};const P=K&&typeof K=="object"?K:{},m={};switch(se){case"top":case"bottom":m.shiftX=ne.arrowOffsetHorizontal*2+l,m.shiftY=!0,m.adjustY=!0;break;case"left":case"right":m.shiftY=ne.arrowOffsetVertical*2+l,m.shiftX=!0,m.adjustX=!0;break}const _=Object.assign(Object.assign({},m),P);return _.shiftX||(_.adjustX=!0),_.shiftY||(_.adjustY=!0),_}const me={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},ue={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},G=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function p(se){const{arrowWidth:ne,autoAdjustOverflow:l,arrowPointAtCenter:K,offset:P,borderRadius:m,visibleFirst:_}=se,E=ne/2,w={};return Object.keys(me).forEach(F=>{const k=K&&ue[F]||me[F],N=Object.assign(Object.assign({},k),{offset:[0,0],dynamicInset:!0});switch(w[F]=N,G.has(F)&&(N.autoArrow=!1),F){case"top":case"topLeft":case"topRight":N.offset[1]=-E-P;break;case"bottom":case"bottomLeft":case"bottomRight":N.offset[1]=E+P;break;case"left":case"leftTop":case"leftBottom":N.offset[0]=-E-P;break;case"right":case"rightTop":case"rightBottom":N.offset[0]=E+P;break}const L=(0,x.wZ)({contentRadius:m,limitVerticalRadius:!0});if(K)switch(F){case"topLeft":case"bottomLeft":N.offset[0]=-L.arrowOffsetHorizontal-E;break;case"topRight":case"bottomRight":N.offset[0]=L.arrowOffsetHorizontal+E;break;case"leftTop":case"rightTop":N.offset[1]=-L.arrowOffsetHorizontal*2+E;break;case"leftBottom":case"rightBottom":N.offset[1]=L.arrowOffsetHorizontal*2-E;break}N.overflow=de(F,L,ne,l),_&&(N.htmlRegion="visibleFirst")}),w}},36170:function(Ct,He,S){"use strict";S.d(He,{C2:function(){return p}});var x=S(36237),de=S(63356),me=S(51636),ue=S(16931);const G=se=>{const{checkboxCls:ne}=se,l=`${ne}-wrapper`;return[{[`${ne}-group`]:Object.assign(Object.assign({},(0,de.Wf)(se)),{display:"inline-flex",flexWrap:"wrap",columnGap:se.marginXS,[`> ${se.antCls}-row`]:{flex:1}}),[l]:Object.assign(Object.assign({},(0,de.Wf)(se)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${l}`]:{marginInlineStart:0},[`&${l}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[ne]:Object.assign(Object.assign({},(0,de.Wf)(se)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:se.borderRadiusSM,alignSelf:"center",[`${ne}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${ne}-inner`]:Object.assign({},(0,de.oN)(se))},[`${ne}-inner`]:{boxSizing:"border-box",display:"block",width:se.checkboxSize,height:se.checkboxSize,direction:"ltr",backgroundColor:se.colorBgContainer,border:`${(0,x.unit)(se.lineWidth)} ${se.lineType} ${se.colorBorder}`,borderRadius:se.borderRadiusSM,borderCollapse:"separate",transition:`all ${se.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:se.calc(se.checkboxSize).div(14).mul(5).equal(),height:se.calc(se.checkboxSize).div(14).mul(8).equal(),border:`${(0,x.unit)(se.lineWidthBold)} solid ${se.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${se.motionDurationFast} ${se.motionEaseInBack}, opacity ${se.motionDurationFast}`}},"& + span":{paddingInlineStart:se.paddingXS,paddingInlineEnd:se.paddingXS}})},{[`
|
|
${l}:not(${l}-disabled),
|
|
${ne}:not(${ne}-disabled)
|
|
`]:{[`&:hover ${ne}-inner`]:{borderColor:se.colorPrimary}},[`${l}:not(${l}-disabled)`]:{[`&:hover ${ne}-checked:not(${ne}-disabled) ${ne}-inner`]:{backgroundColor:se.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${ne}-checked:not(${ne}-disabled):after`]:{borderColor:se.colorPrimaryHover}}},{[`${ne}-checked`]:{[`${ne}-inner`]:{backgroundColor:se.colorPrimary,borderColor:se.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${se.motionDurationMid} ${se.motionEaseOutBack} ${se.motionDurationFast}`}}},[`
|
|
${l}-checked:not(${l}-disabled),
|
|
${ne}-checked:not(${ne}-disabled)
|
|
`]:{[`&:hover ${ne}-inner`]:{backgroundColor:se.colorPrimaryHover,borderColor:"transparent"}}},{[ne]:{"&-indeterminate":{[`${ne}-inner`]:{backgroundColor:`${se.colorBgContainer} !important`,borderColor:`${se.colorBorder} !important`,"&:after":{top:"50%",insetInlineStart:"50%",width:se.calc(se.fontSizeLG).div(2).equal(),height:se.calc(se.fontSizeLG).div(2).equal(),backgroundColor:se.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}},[`&:hover ${ne}-inner`]:{backgroundColor:`${se.colorBgContainer} !important`,borderColor:`${se.colorPrimary} !important`}}}},{[`${l}-disabled`]:{cursor:"not-allowed"},[`${ne}-disabled`]:{[`&, ${ne}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${ne}-inner`]:{background:se.colorBgContainerDisabled,borderColor:se.colorBorder,"&:after":{borderColor:se.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:se.colorTextDisabled},[`&${ne}-indeterminate ${ne}-inner::after`]:{background:se.colorTextDisabled}}}]};function p(se,ne){const l=(0,me.mergeToken)(ne,{checkboxCls:`.${se}`,checkboxSize:ne.controlInteractiveSize});return[G(l)]}He.ZP=(0,ue.I$)("Checkbox",(se,ne)=>{let{prefixCls:l}=ne;return[p(l,se)]})},19563:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return Pe}});var x=S(59301),de=S(33853),me=S(38819),ue=S(92310),G=S.n(ue),p=S(96478),se=S(6089),ne=S(18929),l=S(2738),K=S(75030),m=oe=>typeof oe!="object"&&typeof oe!="function"||oe===null,_=S(52838),E=S(45915),w=S(22703),F=S(32383),k=S(55743),N=S(48755),L=S(83397),O=S(93041),D=S(78857),C=S(57700),Q=S(36237),ce=S(63356),ae=S(46e3),Se=S(93873),Ne=S(34925),Te=S(37645),je=S(36305),ie=S(16931),M=S(51636),H=oe=>{const{componentCls:Ae,menuCls:ke,colorError:et,colorTextLightSolid:Oe}=oe,qe=`${ke}-item`;return{[`${Ae}, ${Ae}-menu-submenu`]:{[`${ke} ${qe}`]:{[`&${qe}-danger:not(${qe}-disabled)`]:{color:et,"&:hover":{color:Oe,backgroundColor:et}}}}}};const Z=oe=>{const{componentCls:Ae,menuCls:ke,zIndexPopup:et,dropdownArrowDistance:Oe,sizePopupArrow:qe,antCls:xe,iconCls:it,motionDurationMid:$e,paddingBlock:De,fontSize:ve,dropdownEdgeChildPadding:Le,colorTextDisabled:re,fontSizeIcon:Re,controlPaddingHorizontal:fe,colorBgElevated:B}=oe;return[{[Ae]:{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:et,display:"block","&::before":{position:"absolute",insetBlock:oe.calc(qe).div(2).sub(Oe).equal(),zIndex:-9999,opacity:1e-4,content:'""'},"&-menu-vertical":{maxHeight:"100vh",overflowY:"auto"},[`&-trigger${xe}-btn`]:{[`& > ${it}-down, & > ${xe}-btn-icon > ${it}-down`]:{fontSize:Re}},[`${Ae}-wrap`]:{position:"relative",[`${xe}-btn > ${it}-down`]:{fontSize:Re},[`${it}-down::before`]:{transition:`transform ${$e}`}},[`${Ae}-wrap-open`]:{[`${it}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${xe}-slide-down-enter${xe}-slide-down-enter-active${Ae}-placement-bottomLeft,
|
|
&${xe}-slide-down-appear${xe}-slide-down-appear-active${Ae}-placement-bottomLeft,
|
|
&${xe}-slide-down-enter${xe}-slide-down-enter-active${Ae}-placement-bottom,
|
|
&${xe}-slide-down-appear${xe}-slide-down-appear-active${Ae}-placement-bottom,
|
|
&${xe}-slide-down-enter${xe}-slide-down-enter-active${Ae}-placement-bottomRight,
|
|
&${xe}-slide-down-appear${xe}-slide-down-appear-active${Ae}-placement-bottomRight`]:{animationName:ae.fJ},[`&${xe}-slide-up-enter${xe}-slide-up-enter-active${Ae}-placement-topLeft,
|
|
&${xe}-slide-up-appear${xe}-slide-up-appear-active${Ae}-placement-topLeft,
|
|
&${xe}-slide-up-enter${xe}-slide-up-enter-active${Ae}-placement-top,
|
|
&${xe}-slide-up-appear${xe}-slide-up-appear-active${Ae}-placement-top,
|
|
&${xe}-slide-up-enter${xe}-slide-up-enter-active${Ae}-placement-topRight,
|
|
&${xe}-slide-up-appear${xe}-slide-up-appear-active${Ae}-placement-topRight`]:{animationName:ae.Qt},[`&${xe}-slide-down-leave${xe}-slide-down-leave-active${Ae}-placement-bottomLeft,
|
|
&${xe}-slide-down-leave${xe}-slide-down-leave-active${Ae}-placement-bottom,
|
|
&${xe}-slide-down-leave${xe}-slide-down-leave-active${Ae}-placement-bottomRight`]:{animationName:ae.Uw},[`&${xe}-slide-up-leave${xe}-slide-up-leave-active${Ae}-placement-topLeft,
|
|
&${xe}-slide-up-leave${xe}-slide-up-leave-active${Ae}-placement-top,
|
|
&${xe}-slide-up-leave${xe}-slide-up-leave-active${Ae}-placement-topRight`]:{animationName:ae.ly}}},(0,Te.ZP)(oe,B,{arrowPlacement:{top:!0,bottom:!0}}),{[`${Ae} ${ke}`]:{position:"relative",margin:0},[`${ke}-submenu-popup`]:{position:"absolute",zIndex:et,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${Ae}, ${Ae}-menu-submenu`]:Object.assign(Object.assign({},(0,ce.Wf)(oe)),{[ke]:Object.assign(Object.assign({padding:Le,listStyleType:"none",backgroundColor:B,backgroundClip:"padding-box",borderRadius:oe.borderRadiusLG,outline:"none",boxShadow:oe.boxShadowSecondary},(0,ce.Qy)(oe)),{"&:empty":{padding:0,boxShadow:"none"},[`${ke}-item-group-title`]:{padding:`${(0,Q.unit)(De)} ${(0,Q.unit)(fe)}`,color:oe.colorTextDescription,transition:`all ${$e}`},[`${ke}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${ke}-item-icon`]:{minWidth:ve,marginInlineEnd:oe.marginXS,fontSize:oe.fontSizeSM},[`${ke}-title-content`]:{flex:"auto","&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},"> a":{color:"inherit",transition:`all ${$e}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}},[`${ke}-item-extra`]:{paddingInlineStart:oe.padding,marginInlineStart:"auto",fontSize:oe.fontSizeSM,color:oe.colorTextDescription}},[`${ke}-item, ${ke}-submenu-title`]:Object.assign(Object.assign({display:"flex",margin:0,padding:`${(0,Q.unit)(De)} ${(0,Q.unit)(fe)}`,color:oe.colorText,fontWeight:"normal",fontSize:ve,lineHeight:oe.lineHeight,cursor:"pointer",transition:`all ${$e}`,borderRadius:oe.borderRadiusSM,"&:hover, &-active":{backgroundColor:oe.controlItemBgHover}},(0,ce.Qy)(oe)),{"&-selected":{color:oe.colorPrimary,backgroundColor:oe.controlItemBgActive,"&:hover, &-active":{backgroundColor:oe.controlItemBgActiveHover}},"&-disabled":{color:re,cursor:"not-allowed","&:hover":{color:re,backgroundColor:B,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${(0,Q.unit)(oe.marginXXS)} 0`,overflow:"hidden",lineHeight:0,backgroundColor:oe.colorSplit},[`${Ae}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:oe.paddingXS,[`${Ae}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:oe.colorTextDescription,fontSize:Re,fontStyle:"normal"}}}),[`${ke}-item-group-list`]:{margin:`0 ${(0,Q.unit)(oe.marginXS)}`,padding:0,listStyle:"none"},[`${ke}-submenu-title`]:{paddingInlineEnd:oe.calc(fe).add(oe.fontSizeSM).equal()},[`${ke}-submenu-vertical`]:{position:"relative"},[`${ke}-submenu${ke}-submenu-disabled ${Ae}-menu-submenu-title`]:{[`&, ${Ae}-menu-submenu-arrow-icon`]:{color:re,backgroundColor:B,cursor:"not-allowed"}},[`${ke}-submenu-selected ${Ae}-menu-submenu-title`]:{color:oe.colorPrimary}})})},[(0,ae.oN)(oe,"slide-up"),(0,ae.oN)(oe,"slide-down"),(0,Se.Fm)(oe,"move-up"),(0,Se.Fm)(oe,"move-down"),(0,Ne._y)(oe,"zoom-big")]]},Y=oe=>Object.assign(Object.assign({zIndexPopup:oe.zIndexPopupBase+50,paddingBlock:(oe.controlHeight-oe.fontSize*oe.lineHeight)/2},(0,Te.wZ)({contentRadius:oe.borderRadiusLG,limitVerticalRadius:!0})),(0,je.w)(oe));var b=(0,ie.I$)("Dropdown",oe=>{const{marginXXS:Ae,sizePopupArrow:ke,paddingXXS:et,componentCls:Oe}=oe,qe=(0,M.mergeToken)(oe,{menuCls:`${Oe}-menu`,dropdownArrowDistance:oe.calc(ke).div(2).add(Ae).equal(),dropdownEdgeChildPadding:et});return[Z(qe),H(qe)]},Y,{resetStyle:!1});const y=null,V=oe=>{var Ae;const{menu:ke,arrow:et,prefixCls:Oe,children:qe,trigger:xe,disabled:it,dropdownRender:$e,getPopupContainer:De,overlayClassName:ve,rootClassName:Le,overlayStyle:re,open:Re,onOpenChange:fe,visible:B,onVisibleChange:A,mouseEnterDelay:U=.15,mouseLeaveDelay:X=.1,autoAdjustOverflow:W=!0,placement:$="",overlay:ee,transitionName:le}=oe,{getPopupContainer:ge,getPrefixCls:we,direction:ze,dropdown:Ue}=x.useContext(N.E_),Ye=(0,F.ln)("Dropdown"),Fe=x.useMemo(()=>{const Ft=we();return le!==void 0?le:$.includes("top")?`${Ft}-slide-down`:`${Ft}-slide-up`},[we,$,le]),Ve=x.useMemo(()=>$?$.includes("Center")?$.slice(0,$.indexOf("Center")):$:ze==="rtl"?"bottomRight":"bottomLeft",[$,ze]),Qe=we("dropdown",Oe),Ie=(0,L.Z)(Qe),[tt,Nt,Et]=b(Qe,Ie),[,Rt]=(0,C.ZP)(),ht=x.Children.only(m(qe)?x.createElement("span",null,qe):qe),qt=(0,w.Tm)(ht,{className:G()(`${Qe}-trigger`,{[`${Qe}-rtl`]:ze==="rtl"},ht.props.className),disabled:(Ae=ht.props.disabled)!==null&&Ae!==void 0?Ae:it}),Vt=it?[]:xe,bt=!!(Vt!=null&&Vt.includes("contextMenu")),[zt,Tt]=(0,ne.Z)(!1,{value:Re!=null?Re:B}),_t=(0,se.Z)(Ft=>{fe==null||fe(Ft,{source:"trigger"}),A==null||A(Ft),Tt(Ft)}),Ot=G()(ve,Le,Nt,Et,Ie,Ue==null?void 0:Ue.className,{[`${Qe}-rtl`]:ze==="rtl"}),St=(0,_.Z)({arrowPointAtCenter:typeof et=="object"&&et.pointAtCenter,autoAdjustOverflow:W,offset:Rt.marginXXS,arrowWidth:et?Rt.sizePopupArrow:0,borderRadius:Rt.borderRadius}),Jt=x.useCallback(()=>{ke!=null&&ke.selectable&&(ke!=null&&ke.multiple)||(fe==null||fe(!1,{source:"menu"}),Tt(!1))},[ke==null?void 0:ke.selectable,ke==null?void 0:ke.multiple]),Pt=()=>{let Ft;return ke!=null&&ke.items?Ft=x.createElement(O.default,Object.assign({},ke)):typeof ee=="function"?Ft=ee():Ft=ee,$e&&(Ft=$e(Ft)),Ft=x.Children.only(typeof Ft=="string"?x.createElement("span",null,Ft):Ft),x.createElement(D.J,{prefixCls:`${Qe}-menu`,rootClassName:G()(Et,Ie),expandIcon:x.createElement("span",{className:`${Qe}-menu-submenu-arrow`},ze==="rtl"?x.createElement(de.Z,{className:`${Qe}-menu-submenu-arrow-icon`}):x.createElement(me.Z,{className:`${Qe}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:Jt,validator:Ht=>{let{mode:It}=Ht}},Ft)},[xt,Dt]=(0,K.Cn)("Dropdown",re==null?void 0:re.zIndex);let un=x.createElement(p.Z,Object.assign({alignPoint:bt},(0,l.Z)(oe,["rootClassName"]),{mouseEnterDelay:U,mouseLeaveDelay:X,visible:zt,builtinPlacements:St,arrow:!!et,overlayClassName:Ot,prefixCls:Qe,getPopupContainer:De||ge,transitionName:Fe,trigger:Vt,overlay:Pt,placement:Ve,onVisibleChange:_t,overlayStyle:Object.assign(Object.assign(Object.assign({},Ue==null?void 0:Ue.style),re),{zIndex:xt})}),qt);return xt&&(un=x.createElement(k.Z.Provider,{value:Dt},un)),tt(un)},he=(0,E.Z)(V,"align",void 0,"dropdown",oe=>oe),be=oe=>x.createElement(he,Object.assign({},oe),x.createElement("span",null));V._InternalPanelDoNotUseOrYouWillBeFired=be;var Pe=V},75727:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return E}});var x=S(19563),de=S(59301),me=S(18785),ue=S(92310),G=S.n(ue),p=S(7939),se=S(48755),ne=S(44104),l=S(70045),K=function(w,F){var k={};for(var N in w)Object.prototype.hasOwnProperty.call(w,N)&&F.indexOf(N)<0&&(k[N]=w[N]);if(w!=null&&typeof Object.getOwnPropertySymbols=="function")for(var L=0,N=Object.getOwnPropertySymbols(w);L<N.length;L++)F.indexOf(N[L])<0&&Object.prototype.propertyIsEnumerable.call(w,N[L])&&(k[N[L]]=w[N[L]]);return k};const P=w=>{const{getPopupContainer:F,getPrefixCls:k,direction:N}=de.useContext(se.E_),{prefixCls:L,type:O="default",danger:D,disabled:C,loading:Q,onClick:ce,htmlType:ae,children:Se,className:Ne,menu:Te,arrow:je,autoFocus:ie,overlay:M,trigger:z,align:H,open:Z,onOpenChange:Y,placement:b,getPopupContainer:y,href:V,icon:he=de.createElement(me.Z,null),title:be,buttonsRender:Pe=U=>U,mouseEnterDelay:oe,mouseLeaveDelay:Ae,overlayClassName:ke,overlayStyle:et,destroyPopupOnHide:Oe,dropdownRender:qe}=w,xe=K(w,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","dropdownRender"]),it=k("dropdown",L),$e=`${it}-button`,De={menu:Te,arrow:je,autoFocus:ie,align:H,disabled:C,trigger:C?[]:z,onOpenChange:Y,getPopupContainer:y||F,mouseEnterDelay:oe,mouseLeaveDelay:Ae,overlayClassName:ke,overlayStyle:et,destroyPopupOnHide:Oe,dropdownRender:qe},{compactSize:ve,compactItemClassnames:Le}=(0,l.ri)(it,N),re=G()($e,Le,Ne);"overlay"in w&&(De.overlay=M),"open"in w&&(De.open=Z),"placement"in w?De.placement=b:De.placement=N==="rtl"?"bottomLeft":"bottomRight";const Re=de.createElement(p.ZP,{type:O,danger:D,disabled:C,loading:Q,onClick:ce,htmlType:ae,href:V,title:be},Se),fe=de.createElement(p.ZP,{type:O,danger:D,icon:he}),[B,A]=Pe([Re,fe]);return de.createElement(ne.Z.Compact,Object.assign({className:re,size:ve,block:!0},xe),B,de.createElement(x.Z,Object.assign({},De),A))};P.__ANT_BUTTON=!0;var m=P;const _=x.Z;_.Button=m;var E=_},584:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return O}});var x=S(59301),de=S(92310),me=S.n(de),ue=S(9017),G=S(17835),p=S(57700),ne=()=>{const[,D]=(0,p.ZP)(),[C]=(0,ue.Z)("Empty"),ce=new G.FastColor(D.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return x.createElement("svg",{style:ce,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},x.createElement("title",null,(C==null?void 0:C.description)||"Empty"),x.createElement("g",{fill:"none",fillRule:"evenodd"},x.createElement("g",{transform:"translate(24 31.67)"},x.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),x.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),x.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),x.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),x.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),x.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),x.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},x.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),x.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},K=()=>{const[,D]=(0,p.ZP)(),[C]=(0,ue.Z)("Empty"),{colorFill:Q,colorFillTertiary:ce,colorFillQuaternary:ae,colorBgContainer:Se}=D,{borderColor:Ne,shadowColor:Te,contentColor:je}=(0,x.useMemo)(()=>({borderColor:new G.FastColor(Q).onBackground(Se).toHexString(),shadowColor:new G.FastColor(ce).onBackground(Se).toHexString(),contentColor:new G.FastColor(ae).onBackground(Se).toHexString()}),[Q,ce,ae,Se]);return x.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},x.createElement("title",null,(C==null?void 0:C.description)||"Empty"),x.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},x.createElement("ellipse",{fill:Te,cx:"32",cy:"33",rx:"32",ry:"7"}),x.createElement("g",{fillRule:"nonzero",stroke:Ne},x.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),x.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:je}))))},P=S(16931),m=S(51636);const _=D=>{const{componentCls:C,margin:Q,marginXS:ce,marginXL:ae,fontSize:Se,lineHeight:Ne}=D;return{[C]:{marginInline:ce,fontSize:Se,lineHeight:Ne,textAlign:"center",[`${C}-image`]:{height:D.emptyImgHeight,marginBottom:ce,opacity:D.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${C}-description`]:{color:D.colorTextDescription},[`${C}-footer`]:{marginTop:Q},"&-normal":{marginBlock:ae,color:D.colorTextDescription,[`${C}-description`]:{color:D.colorTextDescription},[`${C}-image`]:{height:D.emptyImgHeightMD}},"&-small":{marginBlock:ce,color:D.colorTextDescription,[`${C}-image`]:{height:D.emptyImgHeightSM}}}}};var E=(0,P.I$)("Empty",D=>{const{componentCls:C,controlHeightLG:Q,calc:ce}=D,ae=(0,m.mergeToken)(D,{emptyImgCls:`${C}-img`,emptyImgHeight:ce(Q).mul(2.5).equal(),emptyImgHeightMD:Q,emptyImgHeightSM:ce(Q).mul(.875).equal()});return[_(ae)]}),w=S(48755),F=function(D,C){var Q={};for(var ce in D)Object.prototype.hasOwnProperty.call(D,ce)&&C.indexOf(ce)<0&&(Q[ce]=D[ce]);if(D!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ae=0,ce=Object.getOwnPropertySymbols(D);ae<ce.length;ae++)C.indexOf(ce[ae])<0&&Object.prototype.propertyIsEnumerable.call(D,ce[ae])&&(Q[ce[ae]]=D[ce[ae]]);return Q};const k=x.createElement(ne,null),N=x.createElement(K,null),L=D=>{const{className:C,rootClassName:Q,prefixCls:ce,image:ae=k,description:Se,children:Ne,imageStyle:Te,style:je,classNames:ie,styles:M}=D,z=F(D,["className","rootClassName","prefixCls","image","description","children","imageStyle","style","classNames","styles"]),{getPrefixCls:H,direction:Z,className:Y,style:b,classNames:y,styles:V}=(0,w.dj)("empty"),he=H("empty",ce),[be,Pe,oe]=E(he),[Ae]=(0,ue.Z)("Empty"),ke=typeof Se!="undefined"?Se:Ae==null?void 0:Ae.description,et=typeof ke=="string"?ke:"empty";let Oe=null;return typeof ae=="string"?Oe=x.createElement("img",{alt:et,src:ae}):Oe=ae,be(x.createElement("div",Object.assign({className:me()(Pe,oe,he,Y,{[`${he}-normal`]:ae===N,[`${he}-rtl`]:Z==="rtl"},C,Q,y.root,ie==null?void 0:ie.root),style:Object.assign(Object.assign(Object.assign(Object.assign({},V.root),b),M==null?void 0:M.root),je)},z),x.createElement("div",{className:me()(`${he}-image`,y.image,ie==null?void 0:ie.image),style:Object.assign(Object.assign(Object.assign({},Te),V.image),M==null?void 0:M.image)},Oe),ke&&x.createElement("div",{className:me()(`${he}-description`,y.description,ie==null?void 0:ie.description),style:Object.assign(Object.assign({},V.description),M==null?void 0:M.description)},ke),Ne&&x.createElement("div",{className:me()(`${he}-footer`,y.footer,ie==null?void 0:ie.footer),style:Object.assign(Object.assign({},V.footer),M==null?void 0:M.footer)},Ne)))};L.PRESENTED_IMAGE_DEFAULT=k,L.PRESENTED_IMAGE_SIMPLE=N;var O=L},24303:function(Ct,He,S){"use strict";S.d(He,{D:function(){return ce},Z:function(){return Ne}});var x=S(59301),de=S(60499),me={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},ue=me,G=S(7657),p=function(je,ie){return x.createElement(G.Z,(0,de.Z)({},je,{ref:ie,icon:ue}))},se=x.forwardRef(p),ne=se,l=S(33853),K=S(38819),P=S(92310),m=S.n(P),_=S(2738),E=S(48755),w=S(6989),F=S(36237),k=S(48923),N=S(16931);const L=Te=>{const{componentCls:je,siderBg:ie,motionDurationMid:M,motionDurationSlow:z,antCls:H,triggerHeight:Z,triggerColor:Y,triggerBg:b,headerHeight:y,zeroTriggerWidth:V,zeroTriggerHeight:he,borderRadiusLG:be,lightSiderBg:Pe,lightTriggerColor:oe,lightTriggerBg:Ae,bodyBg:ke}=Te;return{[je]:{position:"relative",minWidth:0,background:ie,transition:`all ${M}, background 0s`,"&-has-trigger":{paddingBottom:Z},"&-right":{order:1},[`${je}-children`]:{height:"100%",marginTop:-.1,paddingTop:.1,[`${H}-menu${H}-menu-inline-collapsed`]:{width:"auto"}},[`&-zero-width ${je}-children`]:{overflow:"hidden"},[`${je}-trigger`]:{position:"fixed",bottom:0,zIndex:1,height:Z,color:Y,lineHeight:(0,F.unit)(Z),textAlign:"center",background:b,cursor:"pointer",transition:`all ${M}`},[`${je}-zero-width-trigger`]:{position:"absolute",top:y,insetInlineEnd:Te.calc(V).mul(-1).equal(),zIndex:1,width:V,height:he,color:Y,fontSize:Te.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:ie,borderRadius:`0 ${(0,F.unit)(be)} ${(0,F.unit)(be)} 0`,cursor:"pointer",transition:`background ${z} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${z}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:Te.calc(V).mul(-1).equal(),borderRadius:`${(0,F.unit)(be)} 0 0 ${(0,F.unit)(be)}`}},"&-light":{background:Pe,[`${je}-trigger`]:{color:oe,background:Ae},[`${je}-zero-width-trigger`]:{color:oe,background:Ae,border:`1px solid ${ke}`,borderInlineStart:0}}}}};var O=(0,N.I$)(["Layout","Sider"],Te=>[L(Te)],k.eh,{deprecatedTokens:k.jn}),D=function(Te,je){var ie={};for(var M in Te)Object.prototype.hasOwnProperty.call(Te,M)&&je.indexOf(M)<0&&(ie[M]=Te[M]);if(Te!=null&&typeof Object.getOwnPropertySymbols=="function")for(var z=0,M=Object.getOwnPropertySymbols(Te);z<M.length;z++)je.indexOf(M[z])<0&&Object.prototype.propertyIsEnumerable.call(Te,M[z])&&(ie[M[z]]=Te[M[z]]);return ie};const C={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},Q=Te=>!Number.isNaN(Number.parseFloat(Te))&&isFinite(Te),ce=x.createContext({}),ae=(()=>{let Te=0;return function(){let je=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return Te+=1,`${je}${Te}`}})();var Ne=x.forwardRef((Te,je)=>{const{prefixCls:ie,className:M,trigger:z,children:H,defaultCollapsed:Z=!1,theme:Y="dark",style:b={},collapsible:y=!1,reverseArrow:V=!1,width:he=200,collapsedWidth:be=80,zeroWidthTriggerStyle:Pe,breakpoint:oe,onCollapse:Ae,onBreakpoint:ke}=Te,et=D(Te,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:Oe}=(0,x.useContext)(w.V),[qe,xe]=(0,x.useState)("collapsed"in Te?Te.collapsed:Z),[it,$e]=(0,x.useState)(!1);(0,x.useEffect)(()=>{"collapsed"in Te&&xe(Te.collapsed)},[Te.collapsed]);const De=(Qe,Ie)=>{"collapsed"in Te||xe(Qe),Ae==null||Ae(Qe,Ie)},{getPrefixCls:ve,direction:Le}=(0,x.useContext)(E.E_),re=ve("layout-sider",ie),[Re,fe,B]=O(re),A=(0,x.useRef)(null);A.current=Qe=>{$e(Qe.matches),ke==null||ke(Qe.matches),qe!==Qe.matches&&De(Qe.matches,"responsive")},(0,x.useEffect)(()=>{function Qe(tt){return A.current(tt)}let Ie;if(typeof window!="undefined"){const{matchMedia:tt}=window;if(tt&&oe&&oe in C){Ie=tt(`screen and (max-width: ${C[oe]})`);try{Ie.addEventListener("change",Qe)}catch(Nt){Ie.addListener(Qe)}Qe(Ie)}}return()=>{try{Ie==null||Ie.removeEventListener("change",Qe)}catch(tt){Ie==null||Ie.removeListener(Qe)}}},[oe]),(0,x.useEffect)(()=>{const Qe=ae("ant-sider-");return Oe.addSider(Qe),()=>Oe.removeSider(Qe)},[]);const U=()=>{De(!qe,"clickTrigger")},X=(0,_.Z)(et,["collapsed"]),W=qe?be:he,$=Q(W)?`${W}px`:String(W),ee=parseFloat(String(be||0))===0?x.createElement("span",{onClick:U,className:m()(`${re}-zero-width-trigger`,`${re}-zero-width-trigger-${V?"right":"left"}`),style:Pe},z||x.createElement(ne,null)):null,le=Le==="rtl"==!V,ze={expanded:le?x.createElement(K.Z,null):x.createElement(l.Z,null),collapsed:le?x.createElement(l.Z,null):x.createElement(K.Z,null)}[qe?"collapsed":"expanded"],Ue=z!==null?ee||x.createElement("div",{className:`${re}-trigger`,onClick:U,style:{width:$}},z||ze):null,Ye=Object.assign(Object.assign({},b),{flex:`0 0 ${$}`,maxWidth:$,minWidth:$,width:$}),Fe=m()(re,`${re}-${Y}`,{[`${re}-collapsed`]:!!qe,[`${re}-has-trigger`]:y&&z!==null&&!ee,[`${re}-below`]:!!it,[`${re}-zero-width`]:parseFloat($)===0},M,fe,B),Ve=x.useMemo(()=>({siderCollapsed:qe}),[qe]);return Re(x.createElement(ce.Provider,{value:Ve},x.createElement("aside",Object.assign({className:Fe},X,{style:Ye,ref:je}),x.createElement("div",{className:`${re}-children`},H),y||it&&ee?Ue:null)))})},6989:function(Ct,He,S){"use strict";S.d(He,{V:function(){return de}});var x=S(59301);const de=x.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}})},48923:function(Ct,He,S){"use strict";S.d(He,{eh:function(){return ue},jn:function(){return G}});var x=S(36237),de=S(16931);const me=p=>{const{antCls:se,componentCls:ne,colorText:l,footerBg:K,headerHeight:P,headerPadding:m,headerColor:_,footerPadding:E,fontSize:w,bodyBg:F,headerBg:k}=p;return{[ne]:{display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:F,"&, *":{boxSizing:"border-box"},[`&${ne}-has-sider`]:{flexDirection:"row",[`> ${ne}, > ${ne}-content`]:{width:0}},[`${ne}-header, &${ne}-footer`]:{flex:"0 0 auto"},"&-rtl":{direction:"rtl"}},[`${ne}-header`]:{height:P,padding:m,color:_,lineHeight:(0,x.unit)(P),background:k,[`${se}-menu`]:{lineHeight:"inherit"}},[`${ne}-footer`]:{padding:E,color:l,fontSize:w,background:K},[`${ne}-content`]:{flex:"auto",color:l,minHeight:0}}},ue=p=>{const{colorBgLayout:se,controlHeight:ne,controlHeightLG:l,colorText:K,controlHeightSM:P,marginXXS:m,colorTextLightSolid:_,colorBgContainer:E}=p,w=l*1.25;return{colorBgHeader:"#001529",colorBgBody:se,colorBgTrigger:"#002140",bodyBg:se,headerBg:"#001529",headerHeight:ne*2,headerPadding:`0 ${w}px`,headerColor:K,footerPadding:`${P}px ${w}px`,footerBg:se,siderBg:"#001529",triggerHeight:l+m*2,triggerBg:"#002140",triggerColor:_,zeroTriggerWidth:l,zeroTriggerHeight:l,lightSiderBg:E,lightTriggerBg:E,lightTriggerColor:K}},G=[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]];He.ZP=(0,de.I$)("Layout",p=>[me(p)],ue,{deprecatedTokens:G})},78857:function(Ct,He,S){"use strict";S.d(He,{J:function(){return p}});var x=S(59301),de=S(8654),me=S(62487),ue=function(se,ne){var l={};for(var K in se)Object.prototype.hasOwnProperty.call(se,K)&&ne.indexOf(K)<0&&(l[K]=se[K]);if(se!=null&&typeof Object.getOwnPropertySymbols=="function")for(var P=0,K=Object.getOwnPropertySymbols(se);P<K.length;P++)ne.indexOf(K[P])<0&&Object.prototype.propertyIsEnumerable.call(se,K[P])&&(l[K[P]]=se[K[P]]);return l};const G=x.createContext(null),p=x.forwardRef((se,ne)=>{const{children:l}=se,K=ue(se,["children"]),P=x.useContext(G),m=x.useMemo(()=>Object.assign(Object.assign({},P),K),[P,K.prefixCls,K.mode,K.selectable,K.rootClassName]),_=(0,de.t4)(l),E=(0,de.x1)(ne,_?(0,de.C4)(l):null);return x.createElement(G.Provider,{value:m},x.createElement(me.Z,{space:!0},_?x.cloneElement(l,{ref:E}):l))});He.Z=G},93041:function(Ct,He,S){"use strict";S.d(He,{default:function(){return Re}});var x=S(59301),de=S(28321),me=S(24303),ue=S(18785),G=S(92310),p=S.n(G),se=S(6089),ne=S(2738),l=S(86641),K=S(22703),P=S(48755),m=S(83397),E=(0,x.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),w=function(fe,B){var A={};for(var U in fe)Object.prototype.hasOwnProperty.call(fe,U)&&B.indexOf(U)<0&&(A[U]=fe[U]);if(fe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var X=0,U=Object.getOwnPropertySymbols(fe);X<U.length;X++)B.indexOf(U[X])<0&&Object.prototype.propertyIsEnumerable.call(fe,U[X])&&(A[U[X]]=fe[U[X]]);return A},k=fe=>{const{prefixCls:B,className:A,dashed:U}=fe,X=w(fe,["prefixCls","className","dashed"]),{getPrefixCls:W}=x.useContext(P.E_),$=W("menu",B),ee=p()({[`${$}-item-divider-dashed`]:!!U},A);return x.createElement(de.iz,Object.assign({className:ee},X))},N=S(11592),L=S(25399),D=fe=>{var B;const{className:A,children:U,icon:X,title:W,danger:$,extra:ee}=fe,{prefixCls:le,firstLevel:ge,direction:we,disableMenuItemTitleTooltip:ze,inlineCollapsed:Ue}=x.useContext(E),Ye=Nt=>{const Et=U==null?void 0:U[0],Rt=x.createElement("span",{className:p()(`${le}-title-content`,{[`${le}-title-content-with-extra`]:!!ee||ee===0})},U);return(!X||x.isValidElement(U)&&U.type==="span")&&U&&Nt&&ge&&typeof Et=="string"?x.createElement("div",{className:`${le}-inline-collapsed-noicon`},Et.charAt(0)):Rt},{siderCollapsed:Fe}=x.useContext(me.D);let Ve=W;typeof W=="undefined"?Ve=ge?U:"":W===!1&&(Ve="");const Qe={title:Ve};!Fe&&!Ue&&(Qe.title=null,Qe.open=!1);const Ie=(0,N.Z)(U).length;let tt=x.createElement(de.ck,Object.assign({},(0,ne.Z)(fe,["title","icon","danger"]),{className:p()({[`${le}-item-danger`]:$,[`${le}-item-only-child`]:(X?Ie+1:Ie)===1},A),title:typeof W=="string"?W:void 0}),(0,K.Tm)(X,{className:p()(x.isValidElement(X)?(B=X.props)===null||B===void 0?void 0:B.className:"",`${le}-item-icon`)}),Ye(Ue));return ze||(tt=x.createElement(L.Z,Object.assign({},Qe,{placement:we==="rtl"?"left":"right",classNames:{root:`${le}-inline-collapsed-tooltip`}}),tt)),tt},C=S(78857),Q=S(36237),ce=S(17835),ae=S(63356),Se=S(34961),Ne=S(46e3),Te=S(34925),je=S(16931),ie=S(51636),z=fe=>{const{componentCls:B,motionDurationSlow:A,horizontalLineHeight:U,colorSplit:X,lineWidth:W,lineType:$,itemPaddingInline:ee}=fe;return{[`${B}-horizontal`]:{lineHeight:U,border:0,borderBottom:`${(0,Q.unit)(W)} ${$} ${X}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${B}-item, ${B}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:ee},[`> ${B}-item:hover,
|
|
> ${B}-item-active,
|
|
> ${B}-submenu ${B}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${B}-item, ${B}-submenu-title`]:{transition:[`border-color ${A}`,`background ${A}`].join(",")},[`${B}-submenu-arrow`]:{display:"none"}}}},Z=fe=>{let{componentCls:B,menuArrowOffset:A,calc:U}=fe;return{[`${B}-rtl`]:{direction:"rtl"},[`${B}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${B}-rtl${B}-vertical,
|
|
${B}-submenu-rtl ${B}-vertical`]:{[`${B}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(${(0,Q.unit)(U(A).mul(-1).equal())})`},"&::after":{transform:`rotate(45deg) translateY(${(0,Q.unit)(A)})`}}}}};const Y=fe=>Object.assign({},(0,ae.oN)(fe));var y=(fe,B)=>{const{componentCls:A,itemColor:U,itemSelectedColor:X,subMenuItemSelectedColor:W,groupTitleColor:$,itemBg:ee,subMenuItemBg:le,itemSelectedBg:ge,activeBarHeight:we,activeBarWidth:ze,activeBarBorderWidth:Ue,motionDurationSlow:Ye,motionEaseInOut:Fe,motionEaseOut:Ve,itemPaddingInline:Qe,motionDurationMid:Ie,itemHoverColor:tt,lineType:Nt,colorSplit:Et,itemDisabledColor:Rt,dangerItemColor:ht,dangerItemHoverColor:qt,dangerItemSelectedColor:Vt,dangerItemActiveBg:bt,dangerItemSelectedBg:zt,popupBg:Tt,itemHoverBg:_t,itemActiveBg:Ot,menuSubMenuBg:St,horizontalItemSelectedColor:Jt,horizontalItemSelectedBg:Pt,horizontalItemBorderRadius:xt,horizontalItemHoverBg:Dt}=fe;return{[`${A}-${B}, ${A}-${B} > ${A}`]:{color:U,background:ee,[`&${A}-root:focus-visible`]:Object.assign({},Y(fe)),[`${A}-item`]:{"&-group-title, &-extra":{color:$}},[`${A}-submenu-selected > ${A}-submenu-title`]:{color:W},[`${A}-item, ${A}-submenu-title`]:{color:U,[`&:not(${A}-item-disabled):focus-visible`]:Object.assign({},Y(fe))},[`${A}-item-disabled, ${A}-submenu-disabled`]:{color:`${Rt} !important`},[`${A}-item:not(${A}-item-selected):not(${A}-submenu-selected)`]:{[`&:hover, > ${A}-submenu-title:hover`]:{color:tt}},[`&:not(${A}-horizontal)`]:{[`${A}-item:not(${A}-item-selected)`]:{"&:hover":{backgroundColor:_t},"&:active":{backgroundColor:Ot}},[`${A}-submenu-title`]:{"&:hover":{backgroundColor:_t},"&:active":{backgroundColor:Ot}}},[`${A}-item-danger`]:{color:ht,[`&${A}-item:hover`]:{[`&:not(${A}-item-selected):not(${A}-submenu-selected)`]:{color:qt}},[`&${A}-item:active`]:{background:bt}},[`${A}-item a`]:{"&, &:hover":{color:"inherit"}},[`${A}-item-selected`]:{color:X,[`&${A}-item-danger`]:{color:Vt},"a, a:hover":{color:"inherit"}},[`& ${A}-item-selected`]:{backgroundColor:ge,[`&${A}-item-danger`]:{backgroundColor:zt}},[`&${A}-submenu > ${A}`]:{backgroundColor:St},[`&${A}-popup > ${A}`]:{backgroundColor:Tt},[`&${A}-submenu-popup > ${A}`]:{backgroundColor:Tt},[`&${A}-horizontal`]:Object.assign(Object.assign({},B==="dark"?{borderBottom:0}:{}),{[`> ${A}-item, > ${A}-submenu`]:{top:Ue,marginTop:fe.calc(Ue).mul(-1).equal(),marginBottom:0,borderRadius:xt,"&::after":{position:"absolute",insetInline:Qe,bottom:0,borderBottom:`${(0,Q.unit)(we)} solid transparent`,transition:`border-color ${Ye} ${Fe}`,content:'""'},"&:hover, &-active, &-open":{background:Dt,"&::after":{borderBottomWidth:we,borderBottomColor:Jt}},"&-selected":{color:Jt,backgroundColor:Pt,"&:hover":{backgroundColor:Pt},"&::after":{borderBottomWidth:we,borderBottomColor:Jt}}}}),[`&${A}-root`]:{[`&${A}-inline, &${A}-vertical`]:{borderInlineEnd:`${(0,Q.unit)(Ue)} ${Nt} ${Et}`}},[`&${A}-inline`]:{[`${A}-sub${A}-inline`]:{background:le},[`${A}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${(0,Q.unit)(ze)} solid ${X}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${Ie} ${Ve}`,`opacity ${Ie} ${Ve}`].join(","),content:'""'},[`&${A}-item-danger`]:{"&::after":{borderInlineEndColor:Vt}}},[`${A}-selected, ${A}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${Ie} ${Fe}`,`opacity ${Ie} ${Fe}`].join(",")}}}}}};const V=fe=>{const{componentCls:B,itemHeight:A,itemMarginInline:U,padding:X,menuArrowSize:W,marginXS:$,itemMarginBlock:ee,itemWidth:le,itemPaddingInline:ge}=fe,we=fe.calc(W).add(X).add($).equal();return{[`${B}-item`]:{position:"relative",overflow:"hidden"},[`${B}-item, ${B}-submenu-title`]:{height:A,lineHeight:(0,Q.unit)(A),paddingInline:ge,overflow:"hidden",textOverflow:"ellipsis",marginInline:U,marginBlock:ee,width:le},[`> ${B}-item,
|
|
> ${B}-submenu > ${B}-submenu-title`]:{height:A,lineHeight:(0,Q.unit)(A)},[`${B}-item-group-list ${B}-submenu-title,
|
|
${B}-submenu-title`]:{paddingInlineEnd:we}}};var be=fe=>{const{componentCls:B,iconCls:A,itemHeight:U,colorTextLightSolid:X,dropdownWidth:W,controlHeightLG:$,motionEaseOut:ee,paddingXL:le,itemMarginInline:ge,fontSizeLG:we,motionDurationFast:ze,motionDurationSlow:Ue,paddingXS:Ye,boxShadowSecondary:Fe,collapsedWidth:Ve,collapsedIconSize:Qe}=fe,Ie={height:U,lineHeight:(0,Q.unit)(U),listStylePosition:"inside",listStyleType:"disc"};return[{[B]:{"&-inline, &-vertical":Object.assign({[`&${B}-root`]:{boxShadow:"none"}},V(fe))},[`${B}-submenu-popup`]:{[`${B}-vertical`]:Object.assign(Object.assign({},V(fe)),{boxShadow:Fe})}},{[`${B}-submenu-popup ${B}-vertical${B}-sub`]:{minWidth:W,maxHeight:`calc(100vh - ${(0,Q.unit)(fe.calc($).mul(2.5).equal())})`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${B}-inline`]:{width:"100%",[`&${B}-root`]:{[`${B}-item, ${B}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${Ue}`,`background ${Ue}`,`padding ${ze} ${ee}`].join(","),[`> ${B}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${B}-sub${B}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${B}-submenu > ${B}-submenu-title`]:Ie,[`& ${B}-item-group-title`]:{paddingInlineStart:le}},[`${B}-item`]:Ie}},{[`${B}-inline-collapsed`]:{width:Ve,[`&${B}-root`]:{[`${B}-item, ${B}-submenu ${B}-submenu-title`]:{[`> ${B}-inline-collapsed-noicon`]:{fontSize:we,textAlign:"center"}}},[`> ${B}-item,
|
|
> ${B}-item-group > ${B}-item-group-list > ${B}-item,
|
|
> ${B}-item-group > ${B}-item-group-list > ${B}-submenu > ${B}-submenu-title,
|
|
> ${B}-submenu > ${B}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${(0,Q.unit)(fe.calc(Qe).div(2).equal())} - ${(0,Q.unit)(ge)})`,textOverflow:"clip",[`
|
|
${B}-submenu-arrow,
|
|
${B}-submenu-expand-icon
|
|
`]:{opacity:0},[`${B}-item-icon, ${A}`]:{margin:0,fontSize:Qe,lineHeight:(0,Q.unit)(U),"+ span":{display:"inline-block",opacity:0}}},[`${B}-item-icon, ${A}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${B}-item-icon, ${A}`]:{display:"none"},"a, a:hover":{color:X}},[`${B}-item-group-title`]:Object.assign(Object.assign({},ae.vS),{paddingInline:Ye})}}]};const Pe=fe=>{const{componentCls:B,motionDurationSlow:A,motionDurationMid:U,motionEaseInOut:X,motionEaseOut:W,iconCls:$,iconSize:ee,iconMarginInlineEnd:le}=fe;return{[`${B}-item, ${B}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${A}`,`background ${A}`,`padding calc(${A} + 0.1s) ${X}`].join(","),[`${B}-item-icon, ${$}`]:{minWidth:ee,fontSize:ee,transition:[`font-size ${U} ${W}`,`margin ${A} ${X}`,`color ${A}`].join(","),"+ span":{marginInlineStart:le,opacity:1,transition:[`opacity ${A} ${X}`,`margin ${A}`,`color ${A}`].join(",")}},[`${B}-item-icon`]:Object.assign({},(0,ae.Ro)()),[`&${B}-item-only-child`]:{[`> ${$}, > ${B}-item-icon`]:{marginInlineEnd:0}}},[`${B}-item-disabled, ${B}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important",cursor:"not-allowed",pointerEvents:"none"},[`> ${B}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},oe=fe=>{const{componentCls:B,motionDurationSlow:A,motionEaseInOut:U,borderRadius:X,menuArrowSize:W,menuArrowOffset:$}=fe;return{[`${B}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:fe.margin,width:W,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${A} ${U}, opacity ${A}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:fe.calc(W).mul(.6).equal(),height:fe.calc(W).mul(.15).equal(),backgroundColor:"currentcolor",borderRadius:X,transition:[`background ${A} ${U}`,`transform ${A} ${U}`,`top ${A} ${U}`,`color ${A} ${U}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(${(0,Q.unit)(fe.calc($).mul(-1).equal())})`},"&::after":{transform:`rotate(-45deg) translateY(${(0,Q.unit)($)})`}}}}},Ae=fe=>{const{antCls:B,componentCls:A,fontSize:U,motionDurationSlow:X,motionDurationMid:W,motionEaseInOut:$,paddingXS:ee,padding:le,colorSplit:ge,lineWidth:we,zIndexPopup:ze,borderRadiusLG:Ue,subMenuItemBorderRadius:Ye,menuArrowSize:Fe,menuArrowOffset:Ve,lineType:Qe,groupTitleLineHeight:Ie,groupTitleFontSize:tt}=fe;return[{"":{[A]:Object.assign(Object.assign({},(0,ae.dF)()),{"&-hidden":{display:"none"}})},[`${A}-submenu-hidden`]:{display:"none"}},{[A]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,ae.Wf)(fe)),(0,ae.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:U,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${X} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${A}-item`]:{flex:"none"}},[`${A}-item, ${A}-submenu, ${A}-submenu-title`]:{borderRadius:fe.itemBorderRadius},[`${A}-item-group-title`]:{padding:`${(0,Q.unit)(ee)} ${(0,Q.unit)(le)}`,fontSize:tt,lineHeight:Ie,transition:`all ${X}`},[`&-horizontal ${A}-submenu`]:{transition:[`border-color ${X} ${$}`,`background ${X} ${$}`].join(",")},[`${A}-submenu, ${A}-submenu-inline`]:{transition:[`border-color ${X} ${$}`,`background ${X} ${$}`,`padding ${W} ${$}`].join(",")},[`${A}-submenu ${A}-sub`]:{cursor:"initial",transition:[`background ${X} ${$}`,`padding ${X} ${$}`].join(",")},[`${A}-title-content`]:{transition:`color ${X}`,"&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},[`> ${B}-typography-ellipsis-single-line`]:{display:"inline",verticalAlign:"unset"},[`${A}-item-extra`]:{marginInlineStart:"auto",paddingInlineStart:fe.padding}},[`${A}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${A}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:ge,borderStyle:Qe,borderWidth:0,borderTopWidth:we,marginBlock:we,padding:0,"&-dashed":{borderStyle:"dashed"}}}),Pe(fe)),{[`${A}-item-group`]:{[`${A}-item-group-list`]:{margin:0,padding:0,[`${A}-item, ${A}-submenu-title`]:{paddingInline:`${(0,Q.unit)(fe.calc(U).mul(2).equal())} ${(0,Q.unit)(le)}`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:ze,borderRadius:Ue,boxShadow:"none",transformOrigin:"0 0",[`&${A}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:0,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'},[`> ${A}`]:Object.assign(Object.assign(Object.assign({borderRadius:Ue},Pe(fe)),oe(fe)),{[`${A}-item, ${A}-submenu > ${A}-submenu-title`]:{borderRadius:Ye},[`${A}-submenu-title::after`]:{transition:`transform ${X} ${$}`}})},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:fe.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:fe.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:fe.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:fe.paddingXS}}}),oe(fe)),{[`&-inline-collapsed ${A}-submenu-arrow,
|
|
&-inline ${A}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${(0,Q.unit)(Ve)})`},"&::after":{transform:`rotate(45deg) translateX(${(0,Q.unit)(fe.calc(Ve).mul(-1).equal())})`}},[`${A}-submenu-open${A}-submenu-inline > ${A}-submenu-title > ${A}-submenu-arrow`]:{transform:`translateY(${(0,Q.unit)(fe.calc(Fe).mul(.2).mul(-1).equal())})`,"&::after":{transform:`rotate(-45deg) translateX(${(0,Q.unit)(fe.calc(Ve).mul(-1).equal())})`},"&::before":{transform:`rotate(45deg) translateX(${(0,Q.unit)(Ve)})`}}})},{[`${B}-layout-header`]:{[A]:{lineHeight:"inherit"}}}]},ke=fe=>{var B,A,U;const{colorPrimary:X,colorError:W,colorTextDisabled:$,colorErrorBg:ee,colorText:le,colorTextDescription:ge,colorBgContainer:we,colorFillAlter:ze,colorFillContent:Ue,lineWidth:Ye,lineWidthBold:Fe,controlItemBgActive:Ve,colorBgTextHover:Qe,controlHeightLG:Ie,lineHeight:tt,colorBgElevated:Nt,marginXXS:Et,padding:Rt,fontSize:ht,controlHeightSM:qt,fontSizeLG:Vt,colorTextLightSolid:bt,colorErrorHover:zt}=fe,Tt=(B=fe.activeBarWidth)!==null&&B!==void 0?B:0,_t=(A=fe.activeBarBorderWidth)!==null&&A!==void 0?A:Ye,Ot=(U=fe.itemMarginInline)!==null&&U!==void 0?U:fe.marginXXS,St=new ce.FastColor(bt).setA(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:fe.zIndexPopupBase+50,radiusItem:fe.borderRadiusLG,itemBorderRadius:fe.borderRadiusLG,radiusSubMenuItem:fe.borderRadiusSM,subMenuItemBorderRadius:fe.borderRadiusSM,colorItemText:le,itemColor:le,colorItemTextHover:le,itemHoverColor:le,colorItemTextHoverHorizontal:X,horizontalItemHoverColor:X,colorGroupTitle:ge,groupTitleColor:ge,colorItemTextSelected:X,itemSelectedColor:X,subMenuItemSelectedColor:X,colorItemTextSelectedHorizontal:X,horizontalItemSelectedColor:X,colorItemBg:we,itemBg:we,colorItemBgHover:Qe,itemHoverBg:Qe,colorItemBgActive:Ue,itemActiveBg:Ve,colorSubItemBg:ze,subMenuItemBg:ze,colorItemBgSelected:Ve,itemSelectedBg:Ve,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:Tt,colorActiveBarHeight:Fe,activeBarHeight:Fe,colorActiveBarBorderSize:Ye,activeBarBorderWidth:_t,colorItemTextDisabled:$,itemDisabledColor:$,colorDangerItemText:W,dangerItemColor:W,colorDangerItemTextHover:W,dangerItemHoverColor:W,colorDangerItemTextSelected:W,dangerItemSelectedColor:W,colorDangerItemBgActive:ee,dangerItemActiveBg:ee,colorDangerItemBgSelected:ee,dangerItemSelectedBg:ee,itemMarginInline:Ot,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:Ie,groupTitleLineHeight:tt,collapsedWidth:Ie*2,popupBg:Nt,itemMarginBlock:Et,itemPaddingInline:Rt,horizontalLineHeight:`${Ie*1.15}px`,iconSize:ht,iconMarginInlineEnd:qt-ht,collapsedIconSize:Vt,groupTitleFontSize:ht,darkItemDisabledColor:new ce.FastColor(bt).setA(.25).toRgbString(),darkItemColor:St,darkDangerItemColor:W,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:bt,darkItemSelectedBg:X,darkDangerItemSelectedBg:W,darkItemHoverBg:"transparent",darkGroupTitleColor:St,darkItemHoverColor:bt,darkDangerItemHoverColor:zt,darkDangerItemSelectedColor:bt,darkDangerItemActiveBg:W,itemWidth:Tt?`calc(100% + ${_t}px)`:`calc(100% - ${Ot*2}px)`}};var et=function(fe){let B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fe,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return(0,je.I$)("Menu",X=>{const{colorBgElevated:W,controlHeightLG:$,fontSize:ee,darkItemColor:le,darkDangerItemColor:ge,darkItemBg:we,darkSubMenuItemBg:ze,darkItemSelectedColor:Ue,darkItemSelectedBg:Ye,darkDangerItemSelectedBg:Fe,darkItemHoverBg:Ve,darkGroupTitleColor:Qe,darkItemHoverColor:Ie,darkItemDisabledColor:tt,darkDangerItemHoverColor:Nt,darkDangerItemSelectedColor:Et,darkDangerItemActiveBg:Rt,popupBg:ht,darkPopupBg:qt}=X,Vt=X.calc(ee).div(7).mul(5).equal(),bt=(0,ie.mergeToken)(X,{menuArrowSize:Vt,menuHorizontalHeight:X.calc($).mul(1.15).equal(),menuArrowOffset:X.calc(Vt).mul(.25).equal(),menuSubMenuBg:W,calc:X.calc,popupBg:ht}),zt=(0,ie.mergeToken)(bt,{itemColor:le,itemHoverColor:Ie,groupTitleColor:Qe,itemSelectedColor:Ue,subMenuItemSelectedColor:Ue,itemBg:we,popupBg:qt,subMenuItemBg:ze,itemActiveBg:"transparent",itemSelectedBg:Ye,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:Ve,itemDisabledColor:tt,dangerItemColor:ge,dangerItemHoverColor:Nt,dangerItemSelectedColor:Et,dangerItemActiveBg:Rt,dangerItemSelectedBg:Fe,menuSubMenuBg:ze,horizontalItemSelectedColor:Ue,horizontalItemSelectedBg:Ye});return[Ae(bt),z(bt),be(bt),y(bt,"light"),y(zt,"dark"),Z(bt),(0,Se.Z)(bt),(0,Ne.oN)(bt,"slide-up"),(0,Ne.oN)(bt,"slide-down"),(0,Te._y)(bt,"zoom-big")]},ke,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:A,unitless:{groupTitleLineHeight:!0}})(fe,B)},Oe=S(75030),xe=fe=>{var B;const{popupClassName:A,icon:U,title:X,theme:W}=fe,$=x.useContext(E),{prefixCls:ee,inlineCollapsed:le,theme:ge}=$,we=(0,de.Xl)();let ze;if(!U)ze=le&&!we.length&&X&&typeof X=="string"?x.createElement("div",{className:`${ee}-inline-collapsed-noicon`},X.charAt(0)):x.createElement("span",{className:`${ee}-title-content`},X);else{const Fe=x.isValidElement(X)&&X.type==="span";ze=x.createElement(x.Fragment,null,(0,K.Tm)(U,{className:p()(x.isValidElement(U)?(B=U.props)===null||B===void 0?void 0:B.className:"",`${ee}-item-icon`)}),Fe?X:x.createElement("span",{className:`${ee}-title-content`},X))}const Ue=x.useMemo(()=>Object.assign(Object.assign({},$),{firstLevel:!1}),[$]),[Ye]=(0,Oe.Cn)("Menu");return x.createElement(E.Provider,{value:Ue},x.createElement(de.Wd,Object.assign({},(0,ne.Z)(fe,["icon"]),{title:ze,popupClassName:p()(ee,A,`${ee}-${W||ge}`),popupStyle:Object.assign({zIndex:Ye},fe.popupStyle)})))},it=function(fe,B){var A={};for(var U in fe)Object.prototype.hasOwnProperty.call(fe,U)&&B.indexOf(U)<0&&(A[U]=fe[U]);if(fe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var X=0,U=Object.getOwnPropertySymbols(fe);X<U.length;X++)B.indexOf(U[X])<0&&Object.prototype.propertyIsEnumerable.call(fe,U[X])&&(A[U[X]]=fe[U[X]]);return A};function $e(fe){return fe===null||fe===!1}const De={item:D,submenu:xe,divider:k};var Le=(0,x.forwardRef)((fe,B)=>{var A;const U=x.useContext(C.Z),X=U||{},{getPrefixCls:W,getPopupContainer:$,direction:ee,menu:le}=x.useContext(P.E_),ge=W(),{prefixCls:we,className:ze,style:Ue,theme:Ye="light",expandIcon:Fe,_internalDisableMenuItemTitleTooltip:Ve,inlineCollapsed:Qe,siderCollapsed:Ie,rootClassName:tt,mode:Nt,selectable:Et,onClick:Rt,overflowedIndicatorPopupClassName:ht}=fe,qt=it(fe,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),Vt=(0,ne.Z)(qt,["collapsedWidth"]);(A=X.validator)===null||A===void 0||A.call(X,{mode:Nt});const bt=(0,se.Z)(function(){var It;Rt==null||Rt.apply(void 0,arguments),(It=X.onClick)===null||It===void 0||It.call(X)}),zt=X.mode||Nt,Tt=Et!=null?Et:X.selectable,_t=Qe!=null?Qe:Ie,Ot={horizontal:{motionName:`${ge}-slide-up`},inline:(0,l.Z)(ge),other:{motionName:`${ge}-zoom-big`}},St=W("menu",we||X.prefixCls),Jt=(0,m.Z)(St),[Pt,xt,Dt]=et(St,Jt,!U),un=p()(`${St}-${Ye}`,le==null?void 0:le.className,ze),Ft=x.useMemo(()=>{var It,rt;if(typeof Fe=="function"||$e(Fe))return Fe||null;if(typeof X.expandIcon=="function"||$e(X.expandIcon))return X.expandIcon||null;if(typeof(le==null?void 0:le.expandIcon)=="function"||$e(le==null?void 0:le.expandIcon))return(le==null?void 0:le.expandIcon)||null;const d=(It=Fe!=null?Fe:X==null?void 0:X.expandIcon)!==null&&It!==void 0?It:le==null?void 0:le.expandIcon;return(0,K.Tm)(d,{className:p()(`${St}-submenu-expand-icon`,x.isValidElement(d)?(rt=d.props)===null||rt===void 0?void 0:rt.className:void 0)})},[Fe,X==null?void 0:X.expandIcon,le==null?void 0:le.expandIcon,St]),Ht=x.useMemo(()=>({prefixCls:St,inlineCollapsed:_t||!1,direction:ee,firstLevel:!0,theme:Ye,mode:zt,disableMenuItemTitleTooltip:Ve}),[St,_t,ee,Ve,Ye]);return Pt(x.createElement(C.Z.Provider,{value:null},x.createElement(E.Provider,{value:Ht},x.createElement(de.ZP,Object.assign({getPopupContainer:$,overflowedIndicator:x.createElement(ue.Z,null),overflowedIndicatorPopupClassName:p()(St,`${St}-${Ye}`,ht),mode:zt,selectable:Tt,onClick:bt},Vt,{inlineCollapsed:_t,style:Object.assign(Object.assign({},le==null?void 0:le.style),Ue),className:un,prefixCls:St,direction:ee,defaultMotions:Ot,expandIcon:Ft,ref:B,rootClassName:p()(tt,xt,X.rootClassName,Dt,Jt),_internalComponents:De})))))});const re=(0,x.forwardRef)((fe,B)=>{const A=(0,x.useRef)(null),U=x.useContext(me.D);return(0,x.useImperativeHandle)(B,()=>({menu:A.current,focus:X=>{var W;(W=A.current)===null||W===void 0||W.focus(X)}})),x.createElement(Le,Object.assign({ref:A},fe,U))});re.Item=D,re.SubMenu=xe,re.Divider=k,re.ItemGroup=de.BW;var Re=re},63139:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return Pe}});var x=S(59301),de=S(60499),me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"}}]},name:"star",theme:"filled"},ue=me,G=S(7657),p=function(Ae,ke){return x.createElement(G.Z,(0,de.Z)({},Ae,{ref:ke,icon:ue}))},se=x.forwardRef(p),ne=se,l=S(92310),K=S.n(l),P=S(18642),m=S(72190),_=S(42244),E=S(18929),w=S(10228),F=S(26112);function k(oe,Ae){var ke=oe.disabled,et=oe.prefixCls,Oe=oe.character,qe=oe.characterRender,xe=oe.index,it=oe.count,$e=oe.value,De=oe.allowHalf,ve=oe.focused,Le=oe.onHover,re=oe.onClick,Re=function(ee){Le(ee,xe)},fe=function(ee){re(ee,xe)},B=function(ee){ee.keyCode===w.Z.ENTER&&re(ee,xe)},A=xe+1,U=new Set([et]);$e===0&&xe===0&&ve?U.add("".concat(et,"-focused")):De&&$e+.5>=A&&$e<A?(U.add("".concat(et,"-half")),U.add("".concat(et,"-active")),ve&&U.add("".concat(et,"-focused"))):(A<=$e?U.add("".concat(et,"-full")):U.add("".concat(et,"-zero")),A===$e&&ve&&U.add("".concat(et,"-focused")));var X=typeof Oe=="function"?Oe(oe):Oe,W=x.createElement("li",{className:K()(Array.from(U)),ref:Ae},x.createElement("div",{onClick:ke?null:fe,onKeyDown:ke?null:B,onMouseMove:ke?null:Re,role:"radio","aria-checked":$e>xe?"true":"false","aria-posinset":xe+1,"aria-setsize":it,tabIndex:ke?-1:0},x.createElement("div",{className:"".concat(et,"-first")},X),x.createElement("div",{className:"".concat(et,"-second")},X)));return qe&&(W=qe(W,oe)),W}var N=x.forwardRef(k);function L(){var oe=x.useRef({});function Ae(et){return oe.current[et]}function ke(et){return function(Oe){oe.current[et]=Oe}}return[Ae,ke]}function O(oe){var Ae=oe.pageXOffset,ke="scrollLeft";if(typeof Ae!="number"){var et=oe.document;Ae=et.documentElement[ke],typeof Ae!="number"&&(Ae=et.body[ke])}return Ae}function D(oe){var Ae,ke,et=oe.ownerDocument,Oe=et.body,qe=et&&et.documentElement,xe=oe.getBoundingClientRect();return Ae=xe.left,ke=xe.top,Ae-=qe.clientLeft||Oe.clientLeft||0,ke-=qe.clientTop||Oe.clientTop||0,{left:Ae,top:ke}}function C(oe){var Ae=D(oe),ke=oe.ownerDocument,et=ke.defaultView||ke.parentWindow;return Ae.left+=O(et),Ae.left}var Q=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","keyboard","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function ce(oe,Ae){var ke=oe.prefixCls,et=ke===void 0?"rc-rate":ke,Oe=oe.className,qe=oe.defaultValue,xe=oe.value,it=oe.count,$e=it===void 0?5:it,De=oe.allowHalf,ve=De===void 0?!1:De,Le=oe.allowClear,re=Le===void 0?!0:Le,Re=oe.keyboard,fe=Re===void 0?!0:Re,B=oe.character,A=B===void 0?"\u2605":B,U=oe.characterRender,X=oe.disabled,W=oe.direction,$=W===void 0?"ltr":W,ee=oe.tabIndex,le=ee===void 0?0:ee,ge=oe.autoFocus,we=oe.onHoverChange,ze=oe.onChange,Ue=oe.onFocus,Ye=oe.onBlur,Fe=oe.onKeyDown,Ve=oe.onMouseLeave,Qe=(0,_.Z)(oe,Q),Ie=L(),tt=(0,m.Z)(Ie,2),Nt=tt[0],Et=tt[1],Rt=x.useRef(null),ht=function(){if(!X){var ft;(ft=Rt.current)===null||ft===void 0||ft.focus()}};x.useImperativeHandle(Ae,function(){return{focus:ht,blur:function(){if(!X){var ft;(ft=Rt.current)===null||ft===void 0||ft.blur()}}}});var qt=(0,E.Z)(qe||0,{value:xe}),Vt=(0,m.Z)(qt,2),bt=Vt[0],zt=Vt[1],Tt=(0,E.Z)(null),_t=(0,m.Z)(Tt,2),Ot=_t[0],St=_t[1],Jt=function(ft,Lt){var vt=$==="rtl",Kt=ft+1;if(ve){var $t=Nt(ft),gt=C($t),mt=$t.clientWidth;(vt&&Lt-gt>mt/2||!vt&&Lt-gt<mt/2)&&(Kt-=.5)}return Kt},Pt=function(ft){zt(ft),ze==null||ze(ft)},xt=x.useState(!1),Dt=(0,m.Z)(xt,2),un=Dt[0],Ft=Dt[1],Ht=function(){Ft(!0),Ue==null||Ue()},It=function(){Ft(!1),Ye==null||Ye()},rt=x.useState(null),d=(0,m.Z)(rt,2),g=d[0],T=d[1],j=function(ft,Lt){var vt=Jt(Lt,ft.pageX);vt!==Ot&&(T(vt),St(null)),we==null||we(vt)},te=function(ft){X||(T(null),St(null),we==null||we(void 0)),ft&&(Ve==null||Ve(ft))},Ee=function(ft,Lt){var vt=Jt(Lt,ft.pageX),Kt=!1;re&&(Kt=vt===bt),te(),Pt(Kt?0:vt),St(Kt?vt:null)},Ce=function(ft){var Lt=ft.keyCode,vt=$==="rtl",Kt=ve?.5:1;fe&&(Lt===w.Z.RIGHT&&bt<$e&&!vt?(Pt(bt+Kt),ft.preventDefault()):Lt===w.Z.LEFT&&bt>0&&!vt||Lt===w.Z.RIGHT&&bt>0&&vt?(Pt(bt-Kt),ft.preventDefault()):Lt===w.Z.LEFT&&bt<$e&&vt&&(Pt(bt+Kt),ft.preventDefault())),Fe==null||Fe(ft)};x.useEffect(function(){ge&&!X&&ht()},[]);var Xe=new Array($e).fill(0).map(function(ut,ft){return x.createElement(N,{ref:Et(ft),index:ft,count:$e,disabled:X,prefixCls:"".concat(et,"-star"),allowHalf:ve,value:g===null?bt:g,onClick:Ee,onHover:j,key:ut||ft,character:A,characterRender:U,focused:un})}),Ze=K()(et,Oe,(0,P.Z)((0,P.Z)({},"".concat(et,"-disabled"),X),"".concat(et,"-rtl"),$==="rtl"));return x.createElement("ul",(0,de.Z)({className:Ze,onMouseLeave:te,tabIndex:X?-1:le,onFocus:X?null:Ht,onBlur:X?null:It,onKeyDown:X?null:Ce,ref:Rt},(0,F.Z)(Qe,{aria:!0,data:!0,attr:!0})),Xe)}var ae=x.forwardRef(ce),Se=ae,Ne=S(48755),Te=S(25399),je=S(36237),ie=S(63356),M=S(16931),z=S(51636);const H=oe=>{const{componentCls:Ae}=oe;return{[`${Ae}-star`]:{position:"relative",display:"inline-block",color:"inherit",cursor:"pointer","&:not(:last-child)":{marginInlineEnd:oe.marginXS},"> div":{transition:`all ${oe.motionDurationMid}, outline 0s`,"&:hover":{transform:oe.starHoverScale},"&:focus":{outline:0},"&:focus-visible":{outline:`${(0,je.unit)(oe.lineWidth)} dashed ${oe.starColor}`,transform:oe.starHoverScale}},"&-first, &-second":{color:oe.starBg,transition:`all ${oe.motionDurationMid}`,userSelect:"none"},"&-first":{position:"absolute",top:0,insetInlineStart:0,width:"50%",height:"100%",overflow:"hidden",opacity:0},[`&-half ${Ae}-star-first, &-half ${Ae}-star-second`]:{opacity:1},[`&-half ${Ae}-star-first, &-full ${Ae}-star-second`]:{color:"inherit"}}}},Z=oe=>({[`&-rtl${oe.componentCls}`]:{direction:"rtl"}}),Y=oe=>{const{componentCls:Ae}=oe;return{[Ae]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,ie.Wf)(oe)),{display:"inline-block",margin:0,padding:0,color:oe.starColor,fontSize:oe.starSize,lineHeight:1,listStyle:"none",outline:"none",[`&-disabled${Ae} ${Ae}-star`]:{cursor:"default","> div:hover":{transform:"scale(1)"}}}),H(oe)),Z(oe))}},b=oe=>({starColor:oe.yellow6,starSize:oe.controlHeightLG*.5,starHoverScale:"scale(1.1)",starBg:oe.colorFillContent});var y=(0,M.I$)("Rate",oe=>{const Ae=(0,z.mergeToken)(oe,{});return[Y(Ae)]},b),V=S(2171),he=function(oe,Ae){var ke={};for(var et in oe)Object.prototype.hasOwnProperty.call(oe,et)&&Ae.indexOf(et)<0&&(ke[et]=oe[et]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Oe=0,et=Object.getOwnPropertySymbols(oe);Oe<et.length;Oe++)Ae.indexOf(et[Oe])<0&&Object.prototype.propertyIsEnumerable.call(oe,et[Oe])&&(ke[et[Oe]]=oe[et[Oe]]);return ke},Pe=x.forwardRef((oe,Ae)=>{const{prefixCls:ke,className:et,rootClassName:Oe,style:qe,tooltips:xe,character:it=x.createElement(ne,null),disabled:$e}=oe,De=he(oe,["prefixCls","className","rootClassName","style","tooltips","character","disabled"]),ve=(ee,le)=>{let{index:ge}=le;return xe?x.createElement(Te.Z,{title:xe[ge]},ee):ee},{getPrefixCls:Le,direction:re,rate:Re}=x.useContext(Ne.E_),fe=Le("rate",ke),[B,A,U]=y(fe),X=Object.assign(Object.assign({},Re==null?void 0:Re.style),qe),W=x.useContext(V.Z),$=$e!=null?$e:W;return B(x.createElement(Se,Object.assign({ref:Ae,character:it,characterRender:ve,disabled:$},De,{className:K()(et,Oe,A,U,Re==null?void 0:Re.className),style:X,prefixCls:fe,direction:re})))})},44104:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return F}});var x=S(59301),de=S(92310),me=S.n(de),ue=S(11592),G=S(99402),p=S(48755),se=S(70045);const ne=x.createContext({latestIndex:0}),l=ne.Provider;var P=k=>{let{className:N,index:L,children:O,split:D,style:C}=k;const{latestIndex:Q}=x.useContext(ne);return O==null?null:x.createElement(x.Fragment,null,x.createElement("div",{className:N,style:C},O),L<Q&&D&&x.createElement("span",{className:`${N}-split`},D))},m=S(31547),_=function(k,N){var L={};for(var O in k)Object.prototype.hasOwnProperty.call(k,O)&&N.indexOf(O)<0&&(L[O]=k[O]);if(k!=null&&typeof Object.getOwnPropertySymbols=="function")for(var D=0,O=Object.getOwnPropertySymbols(k);D<O.length;D++)N.indexOf(O[D])<0&&Object.prototype.propertyIsEnumerable.call(k,O[D])&&(L[O[D]]=k[O[D]]);return L};const w=x.forwardRef((k,N)=>{var L;const{getPrefixCls:O,direction:D,size:C,className:Q,style:ce,classNames:ae,styles:Se}=(0,p.dj)("space"),{size:Ne=C!=null?C:"small",align:Te,className:je,rootClassName:ie,children:M,direction:z="horizontal",prefixCls:H,split:Z,style:Y,wrap:b=!1,classNames:y,styles:V}=k,he=_(k,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[be,Pe]=Array.isArray(Ne)?Ne:[Ne,Ne],oe=(0,G.n)(Pe),Ae=(0,G.n)(be),ke=(0,G.T)(Pe),et=(0,G.T)(be),Oe=(0,ue.Z)(M,{keepEmpty:!0}),qe=Te===void 0&&z==="horizontal"?"center":Te,xe=O("space",H),[it,$e,De]=(0,m.Z)(xe),ve=me()(xe,Q,$e,`${xe}-${z}`,{[`${xe}-rtl`]:D==="rtl",[`${xe}-align-${qe}`]:qe,[`${xe}-gap-row-${Pe}`]:oe,[`${xe}-gap-col-${be}`]:Ae},je,ie,De),Le=me()(`${xe}-item`,(L=y==null?void 0:y.item)!==null&&L!==void 0?L:ae.item);let re=0;const Re=Oe.map((A,U)=>{var X;A!=null&&(re=U);const W=(A==null?void 0:A.key)||`${Le}-${U}`;return x.createElement(P,{className:Le,key:W,index:U,split:Z,style:(X=V==null?void 0:V.item)!==null&&X!==void 0?X:Se.item},A)}),fe=x.useMemo(()=>({latestIndex:re}),[re]);if(Oe.length===0)return null;const B={};return b&&(B.flexWrap="wrap"),!Ae&&et&&(B.columnGap=be),!oe&&ke&&(B.rowGap=Pe),it(x.createElement("div",Object.assign({ref:N,className:ve,style:Object.assign(Object.assign(Object.assign({},B),ce),Y)},he),x.createElement(l,{value:fe},Re)))});w.Compact=se.ZP;var F=w},93873:function(Ct,He,S){"use strict";S.d(He,{Fm:function(){return m}});var x=S(36237),de=S(48746);const me=new x.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ue=new x.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),G=new x.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),p=new x.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),se=new x.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ne=new x.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),l=new x.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),K=new x.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),P={"move-up":{inKeyframes:l,outKeyframes:K},"move-down":{inKeyframes:me,outKeyframes:ue},"move-left":{inKeyframes:G,outKeyframes:p},"move-right":{inKeyframes:se,outKeyframes:ne}},m=(_,E)=>{const{antCls:w}=_,F=`${w}-${E}`,{inKeyframes:k,outKeyframes:N}=P[E];return[(0,de.R)(F,k,N,_.motionDurationMid),{[`
|
|
${F}-enter,
|
|
${F}-appear
|
|
`]:{opacity:0,animationTimingFunction:_.motionEaseOutCirc},[`${F}-leave`]:{animationTimingFunction:_.motionEaseInOutCirc}}]}},46e3:function(Ct,He,S){"use strict";S.d(He,{Qt:function(){return G},Uw:function(){return ue},fJ:function(){return me},ly:function(){return p},oN:function(){return m}});var x=S(36237),de=S(48746);const me=new x.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),ue=new x.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),G=new x.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),p=new x.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),se=new x.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),ne=new x.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),l=new x.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),K=new x.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),P={"slide-up":{inKeyframes:me,outKeyframes:ue},"slide-down":{inKeyframes:G,outKeyframes:p},"slide-left":{inKeyframes:se,outKeyframes:ne},"slide-right":{inKeyframes:l,outKeyframes:K}},m=(_,E)=>{const{antCls:w}=_,F=`${w}-${E}`,{inKeyframes:k,outKeyframes:N}=P[E];return[(0,de.R)(F,k,N,_.motionDurationMid),{[`
|
|
${F}-enter,
|
|
${F}-appear
|
|
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:_.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${F}-leave`]:{animationTimingFunction:_.motionEaseInQuint}}]}},37645:function(Ct,He,S){"use strict";S.d(He,{ZP:function(){return p},qN:function(){return me},wZ:function(){return ue}});var x=S(36237),de=S(36305);const me=8;function ue(se){const{contentRadius:ne,limitVerticalRadius:l}=se,K=ne>12?ne+2:12;return{arrowOffsetHorizontal:K,arrowOffsetVertical:l?me:K}}function G(se,ne){return se?ne:{}}function p(se,ne,l){const{componentCls:K,boxShadowPopoverArrow:P,arrowOffsetVertical:m,arrowOffsetHorizontal:_}=se,{arrowDistance:E=0,arrowPlacement:w={left:!0,right:!0,top:!0,bottom:!0}}=l||{};return{[K]:Object.assign(Object.assign(Object.assign(Object.assign({[`${K}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,de.W)(se,ne,P)),{"&:before":{background:ne}})]},G(!!w.top,{[[`&-placement-top > ${K}-arrow`,`&-placement-topLeft > ${K}-arrow`,`&-placement-topRight > ${K}-arrow`].join(",")]:{bottom:E,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${K}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":_,[`> ${K}-arrow`]:{left:{_skip_check_:!0,value:_}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${(0,x.unit)(_)})`,[`> ${K}-arrow`]:{right:{_skip_check_:!0,value:_}}}})),G(!!w.bottom,{[[`&-placement-bottom > ${K}-arrow`,`&-placement-bottomLeft > ${K}-arrow`,`&-placement-bottomRight > ${K}-arrow`].join(",")]:{top:E,transform:"translateY(-100%)"},[`&-placement-bottom > ${K}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":_,[`> ${K}-arrow`]:{left:{_skip_check_:!0,value:_}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${(0,x.unit)(_)})`,[`> ${K}-arrow`]:{right:{_skip_check_:!0,value:_}}}})),G(!!w.left,{[[`&-placement-left > ${K}-arrow`,`&-placement-leftTop > ${K}-arrow`,`&-placement-leftBottom > ${K}-arrow`].join(",")]:{right:{_skip_check_:!0,value:E},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${K}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${K}-arrow`]:{top:m},[`&-placement-leftBottom > ${K}-arrow`]:{bottom:m}})),G(!!w.right,{[[`&-placement-right > ${K}-arrow`,`&-placement-rightTop > ${K}-arrow`,`&-placement-rightBottom > ${K}-arrow`].join(",")]:{left:{_skip_check_:!0,value:E},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${K}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${K}-arrow`]:{top:m},[`&-placement-rightBottom > ${K}-arrow`]:{bottom:m}}))}}},36305:function(Ct,He,S){"use strict";S.d(He,{W:function(){return me},w:function(){return de}});var x=S(36237);function de(ue){const{sizePopupArrow:G,borderRadiusXS:p,borderRadiusOuter:se}=ue,ne=G/2,l=0,K=ne,P=se*1/Math.sqrt(2),m=ne-se*(1-1/Math.sqrt(2)),_=ne-p*(1/Math.sqrt(2)),E=se*(Math.sqrt(2)-1)+p*(1/Math.sqrt(2)),w=2*ne-_,F=E,k=2*ne-P,N=m,L=2*ne-l,O=K,D=ne*Math.sqrt(2)+se*(Math.sqrt(2)-2),C=se*(Math.sqrt(2)-1),Q=`polygon(${C}px 100%, 50% ${C}px, ${2*ne-C}px 100%, ${C}px 100%)`,ce=`path('M ${l} ${K} A ${se} ${se} 0 0 0 ${P} ${m} L ${_} ${E} A ${p} ${p} 0 0 1 ${w} ${F} L ${k} ${N} A ${se} ${se} 0 0 0 ${L} ${O} Z')`;return{arrowShadowWidth:D,arrowPath:ce,arrowPolygon:Q}}const me=(ue,G,p)=>{const{sizePopupArrow:se,arrowPolygon:ne,arrowPath:l,arrowShadowWidth:K,borderRadiusXS:P,calc:m}=ue;return{pointerEvents:"none",width:se,height:se,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:se,height:m(se).div(2).equal(),background:G,clipPath:{_multi_value_:!0,value:[ne,l]},content:'""'},"&::after":{content:'""',position:"absolute",width:K,height:K,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${(0,x.unit)(P)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:p,zIndex:0,background:"transparent"}}}},58755:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return H}});var x=S(59301),de=S(58617),me=S(92310),ue=S.n(me),G=S(60499),p=S(18642),se=S(72190),ne=S(42244),l=S(18929),K=S(10228),P=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],m=x.forwardRef(function(Z,Y){var b,y=Z.prefixCls,V=y===void 0?"rc-switch":y,he=Z.className,be=Z.checked,Pe=Z.defaultChecked,oe=Z.disabled,Ae=Z.loadingIcon,ke=Z.checkedChildren,et=Z.unCheckedChildren,Oe=Z.onClick,qe=Z.onChange,xe=Z.onKeyDown,it=(0,ne.Z)(Z,P),$e=(0,l.Z)(!1,{value:be,defaultValue:Pe}),De=(0,se.Z)($e,2),ve=De[0],Le=De[1];function re(A,U){var X=ve;return oe||(X=A,Le(X),qe==null||qe(X,U)),X}function Re(A){A.which===K.Z.LEFT?re(!1,A):A.which===K.Z.RIGHT&&re(!0,A),xe==null||xe(A)}function fe(A){var U=re(!ve,A);Oe==null||Oe(U,A)}var B=ue()(V,he,(b={},(0,p.Z)(b,"".concat(V,"-checked"),ve),(0,p.Z)(b,"".concat(V,"-disabled"),oe),b));return x.createElement("button",(0,G.Z)({},it,{type:"button",role:"switch","aria-checked":ve,disabled:oe,className:B,ref:Y,onKeyDown:Re,onClick:fe}),Ae,x.createElement("span",{className:"".concat(V,"-inner")},x.createElement("span",{className:"".concat(V,"-inner-checked")},ke),x.createElement("span",{className:"".concat(V,"-inner-unchecked")},et)))});m.displayName="Switch";var _=m,E=S(12919),w=S(48755),F=S(2171),k=S(31756),N=S(36237),L=S(17835),O=S(63356),D=S(16931),C=S(51636);const Q=Z=>{const{componentCls:Y,trackHeightSM:b,trackPadding:y,trackMinWidthSM:V,innerMinMarginSM:he,innerMaxMarginSM:be,handleSizeSM:Pe,calc:oe}=Z,Ae=`${Y}-inner`,ke=(0,N.unit)(oe(Pe).add(oe(y).mul(2)).equal()),et=(0,N.unit)(oe(be).mul(2).equal());return{[Y]:{[`&${Y}-small`]:{minWidth:V,height:b,lineHeight:(0,N.unit)(b),[`${Y}-inner`]:{paddingInlineStart:be,paddingInlineEnd:he,[`${Ae}-checked, ${Ae}-unchecked`]:{minHeight:b},[`${Ae}-checked`]:{marginInlineStart:`calc(-100% + ${ke} - ${et})`,marginInlineEnd:`calc(100% - ${ke} + ${et})`},[`${Ae}-unchecked`]:{marginTop:oe(b).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`${Y}-handle`]:{width:Pe,height:Pe},[`${Y}-loading-icon`]:{top:oe(oe(Pe).sub(Z.switchLoadingIconSize)).div(2).equal(),fontSize:Z.switchLoadingIconSize},[`&${Y}-checked`]:{[`${Y}-inner`]:{paddingInlineStart:he,paddingInlineEnd:be,[`${Ae}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${Ae}-unchecked`]:{marginInlineStart:`calc(100% - ${ke} + ${et})`,marginInlineEnd:`calc(-100% + ${ke} - ${et})`}},[`${Y}-handle`]:{insetInlineStart:`calc(100% - ${(0,N.unit)(oe(Pe).add(y).equal())})`}},[`&:not(${Y}-disabled):active`]:{[`&:not(${Y}-checked) ${Ae}`]:{[`${Ae}-unchecked`]:{marginInlineStart:oe(Z.marginXXS).div(2).equal(),marginInlineEnd:oe(Z.marginXXS).mul(-1).div(2).equal()}},[`&${Y}-checked ${Ae}`]:{[`${Ae}-checked`]:{marginInlineStart:oe(Z.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:oe(Z.marginXXS).div(2).equal()}}}}}}},ce=Z=>{const{componentCls:Y,handleSize:b,calc:y}=Z;return{[Y]:{[`${Y}-loading-icon${Z.iconCls}`]:{position:"relative",top:y(y(b).sub(Z.fontSize)).div(2).equal(),color:Z.switchLoadingIconColor,verticalAlign:"top"},[`&${Y}-checked ${Y}-loading-icon`]:{color:Z.switchColor}}}},ae=Z=>{const{componentCls:Y,trackPadding:b,handleBg:y,handleShadow:V,handleSize:he,calc:be}=Z,Pe=`${Y}-handle`;return{[Y]:{[Pe]:{position:"absolute",top:b,insetInlineStart:b,width:he,height:he,transition:`all ${Z.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:y,borderRadius:be(he).div(2).equal(),boxShadow:V,transition:`all ${Z.switchDuration} ease-in-out`,content:'""'}},[`&${Y}-checked ${Pe}`]:{insetInlineStart:`calc(100% - ${(0,N.unit)(be(he).add(b).equal())})`},[`&:not(${Y}-disabled):active`]:{[`${Pe}::before`]:{insetInlineEnd:Z.switchHandleActiveInset,insetInlineStart:0},[`&${Y}-checked ${Pe}::before`]:{insetInlineEnd:0,insetInlineStart:Z.switchHandleActiveInset}}}}},Se=Z=>{const{componentCls:Y,trackHeight:b,trackPadding:y,innerMinMargin:V,innerMaxMargin:he,handleSize:be,calc:Pe}=Z,oe=`${Y}-inner`,Ae=(0,N.unit)(Pe(be).add(Pe(y).mul(2)).equal()),ke=(0,N.unit)(Pe(he).mul(2).equal());return{[Y]:{[oe]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:he,paddingInlineEnd:V,transition:`padding-inline-start ${Z.switchDuration} ease-in-out, padding-inline-end ${Z.switchDuration} ease-in-out`,[`${oe}-checked, ${oe}-unchecked`]:{display:"block",color:Z.colorTextLightSolid,fontSize:Z.fontSizeSM,transition:`margin-inline-start ${Z.switchDuration} ease-in-out, margin-inline-end ${Z.switchDuration} ease-in-out`,pointerEvents:"none",minHeight:b},[`${oe}-checked`]:{marginInlineStart:`calc(-100% + ${Ae} - ${ke})`,marginInlineEnd:`calc(100% - ${Ae} + ${ke})`},[`${oe}-unchecked`]:{marginTop:Pe(b).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`&${Y}-checked ${oe}`]:{paddingInlineStart:V,paddingInlineEnd:he,[`${oe}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${oe}-unchecked`]:{marginInlineStart:`calc(100% - ${Ae} + ${ke})`,marginInlineEnd:`calc(-100% + ${Ae} - ${ke})`}},[`&:not(${Y}-disabled):active`]:{[`&:not(${Y}-checked) ${oe}`]:{[`${oe}-unchecked`]:{marginInlineStart:Pe(y).mul(2).equal(),marginInlineEnd:Pe(y).mul(-1).mul(2).equal()}},[`&${Y}-checked ${oe}`]:{[`${oe}-checked`]:{marginInlineStart:Pe(y).mul(-1).mul(2).equal(),marginInlineEnd:Pe(y).mul(2).equal()}}}}}},Ne=Z=>{const{componentCls:Y,trackHeight:b,trackMinWidth:y}=Z;return{[Y]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,O.Wf)(Z)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:y,height:b,lineHeight:(0,N.unit)(b),verticalAlign:"middle",background:Z.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${Z.motionDurationMid}`,userSelect:"none",[`&:hover:not(${Y}-disabled)`]:{background:Z.colorTextTertiary}}),(0,O.Qy)(Z)),{[`&${Y}-checked`]:{background:Z.switchColor,[`&:hover:not(${Y}-disabled)`]:{background:Z.colorPrimaryHover}},[`&${Y}-loading, &${Y}-disabled`]:{cursor:"not-allowed",opacity:Z.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${Y}-rtl`]:{direction:"rtl"}})}},Te=Z=>{const{fontSize:Y,lineHeight:b,controlHeight:y,colorWhite:V}=Z,he=Y*b,be=y/2,Pe=2,oe=he-Pe*2,Ae=be-Pe*2;return{trackHeight:he,trackHeightSM:be,trackMinWidth:oe*2+Pe*4,trackMinWidthSM:Ae*2+Pe*2,trackPadding:Pe,handleBg:V,handleSize:oe,handleSizeSM:Ae,handleShadow:`0 2px 4px 0 ${new L.FastColor("#00230b").setA(.2).toRgbString()}`,innerMinMargin:oe/2,innerMaxMargin:oe+Pe+Pe*2,innerMinMarginSM:Ae/2,innerMaxMarginSM:Ae+Pe+Pe*2}};var je=(0,D.I$)("Switch",Z=>{const Y=(0,C.mergeToken)(Z,{switchDuration:Z.motionDurationMid,switchColor:Z.colorPrimary,switchDisabledOpacity:Z.opacityLoading,switchLoadingIconSize:Z.calc(Z.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:`rgba(0, 0, 0, ${Z.opacityLoading})`,switchHandleActiveInset:"-30%"});return[Ne(Y),Se(Y),ae(Y),ce(Y),Q(Y)]},Te),ie=function(Z,Y){var b={};for(var y in Z)Object.prototype.hasOwnProperty.call(Z,y)&&Y.indexOf(y)<0&&(b[y]=Z[y]);if(Z!=null&&typeof Object.getOwnPropertySymbols=="function")for(var V=0,y=Object.getOwnPropertySymbols(Z);V<y.length;V++)Y.indexOf(y[V])<0&&Object.prototype.propertyIsEnumerable.call(Z,y[V])&&(b[y[V]]=Z[y[V]]);return b};const z=x.forwardRef((Z,Y)=>{const{prefixCls:b,size:y,disabled:V,loading:he,className:be,rootClassName:Pe,style:oe,checked:Ae,value:ke,defaultChecked:et,defaultValue:Oe,onChange:qe}=Z,xe=ie(Z,["prefixCls","size","disabled","loading","className","rootClassName","style","checked","value","defaultChecked","defaultValue","onChange"]),[it,$e]=(0,l.Z)(!1,{value:Ae!=null?Ae:ke,defaultValue:et!=null?et:Oe}),{getPrefixCls:De,direction:ve,switch:Le}=x.useContext(w.E_),re=x.useContext(F.Z),Re=(V!=null?V:re)||he,fe=De("switch",b),B=x.createElement("div",{className:`${fe}-handle`},he&&x.createElement(de.Z,{className:`${fe}-loading-icon`})),[A,U,X]=je(fe),W=(0,k.Z)(y),$=ue()(Le==null?void 0:Le.className,{[`${fe}-small`]:W==="small",[`${fe}-loading`]:he,[`${fe}-rtl`]:ve==="rtl"},be,Pe,U,X),ee=Object.assign(Object.assign({},Le==null?void 0:Le.style),oe),le=function(){$e(arguments.length<=0?void 0:arguments[0]),qe==null||qe.apply(void 0,arguments)};return A(x.createElement(E.Z,{component:"Switch"},x.createElement(_,Object.assign({},xe,{checked:it,onChange:le,prefixCls:fe,className:$,style:ee,disabled:Re,ref:Y,loadingIcon:B}))))});z.__ANT_SWITCH=!0;var H=z},93427:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return de}});var x=S(34998);function de(me,ue){return x.i.reduce((G,p)=>{const se=me[`${p}1`],ne=me[`${p}3`],l=me[`${p}6`],K=me[`${p}7`];return Object.assign(Object.assign({},G),ue(p,{lightColor:se,lightBorderColor:ne,darkColor:l,textColor:K}))},{})}},25399:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return H}});var x=S(59301),de=S(92310),me=S.n(de),ue=S(29125),G=S(18929),p=S(62487),se=S(75030),ne=S(86641),l=S(52838),K=S(22703),P=S(32383),m=S(55743),_=S(57700),E=S(48755),w=S(36237),F=S(63356),k=S(34925),N=S(37645),L=S(36305),O=S(93427),D=S(51636),C=S(16931);const Q=Z=>{const{calc:Y,componentCls:b,tooltipMaxWidth:y,tooltipColor:V,tooltipBg:he,tooltipBorderRadius:be,zIndexPopup:Pe,controlHeight:oe,boxShadowSecondary:Ae,paddingSM:ke,paddingXS:et,arrowOffsetHorizontal:Oe,sizePopupArrow:qe}=Z,xe=Y(be).add(qe).add(Oe).equal(),it=Y(be).mul(2).add(qe).equal();return[{[b]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,F.Wf)(Z)),{position:"absolute",zIndex:Pe,display:"block",width:"max-content",maxWidth:y,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":he,[`${b}-inner`]:{minWidth:it,minHeight:oe,padding:`${(0,w.unit)(Z.calc(ke).div(2).equal())} ${(0,w.unit)(et)}`,color:V,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:he,borderRadius:be,boxShadow:Ae,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:xe},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${b}-inner`]:{borderRadius:Z.min(be,N.qN)}},[`${b}-content`]:{position:"relative"}}),(0,O.Z)(Z,($e,De)=>{let{darkColor:ve}=De;return{[`&${b}-${$e}`]:{[`${b}-inner`]:{backgroundColor:ve},[`${b}-arrow`]:{"--antd-arrow-background-color":ve}}}})),{"&-rtl":{direction:"rtl"}})},(0,N.ZP)(Z,"var(--antd-arrow-background-color)"),{[`${b}-pure`]:{position:"relative",maxWidth:"none",margin:Z.sizePopupArrow}}]},ce=Z=>Object.assign(Object.assign({zIndexPopup:Z.zIndexPopupBase+70},(0,N.wZ)({contentRadius:Z.borderRadius,limitVerticalRadius:!0})),(0,L.w)((0,D.mergeToken)(Z,{borderRadiusOuter:Math.min(Z.borderRadiusOuter,4)})));var ae=function(Z){let Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return(0,C.I$)("Tooltip",y=>{const{borderRadius:V,colorTextLightSolid:he,colorBgSpotlight:be}=y,Pe=(0,D.mergeToken)(y,{tooltipMaxWidth:250,tooltipColor:he,tooltipBorderRadius:V,tooltipBg:be});return[Q(Pe),(0,k._y)(y,"zoom-big-fast")]},ce,{resetStyle:!1,injectStyle:Y})(Z)},Se=S(29509);function Ne(Z,Y){const b=(0,Se.o2)(Y),y=me()({[`${Z}-${Y}`]:Y&&b}),V={},he={};return Y&&!b&&(V.background=Y,he["--antd-arrow-background-color"]=Y),{className:y,overlayStyle:V,arrowStyle:he}}var je=Z=>{const{prefixCls:Y,className:b,placement:y="top",title:V,color:he,overlayInnerStyle:be}=Z,{getPrefixCls:Pe}=x.useContext(E.E_),oe=Pe("tooltip",Y),[Ae,ke,et]=ae(oe),Oe=Ne(oe,he),qe=Oe.arrowStyle,xe=Object.assign(Object.assign({},be),Oe.overlayStyle),it=me()(ke,et,oe,`${oe}-pure`,`${oe}-placement-${y}`,b,Oe.className);return Ae(x.createElement("div",{className:it,style:qe},x.createElement("div",{className:`${oe}-arrow`}),x.createElement(ue.G,Object.assign({},Z,{className:ke,prefixCls:oe,overlayInnerStyle:xe}),V)))},ie=function(Z,Y){var b={};for(var y in Z)Object.prototype.hasOwnProperty.call(Z,y)&&Y.indexOf(y)<0&&(b[y]=Z[y]);if(Z!=null&&typeof Object.getOwnPropertySymbols=="function")for(var V=0,y=Object.getOwnPropertySymbols(Z);V<y.length;V++)Y.indexOf(y[V])<0&&Object.prototype.propertyIsEnumerable.call(Z,y[V])&&(b[y[V]]=Z[y[V]]);return b};const z=x.forwardRef((Z,Y)=>{var b,y;const{prefixCls:V,openClassName:he,getTooltipContainer:be,color:Pe,overlayInnerStyle:oe,children:Ae,afterOpenChange:ke,afterVisibleChange:et,destroyTooltipOnHide:Oe,arrow:qe=!0,title:xe,overlay:it,builtinPlacements:$e,arrowPointAtCenter:De=!1,autoAdjustOverflow:ve=!0,motion:Le,getPopupContainer:re,placement:Re="top",mouseEnterDelay:fe=.1,mouseLeaveDelay:B=.1,overlayStyle:A,rootClassName:U,overlayClassName:X,styles:W,classNames:$}=Z,ee=ie(Z,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),le=!!qe,[,ge]=(0,_.ZP)(),{getPopupContainer:we,getPrefixCls:ze,direction:Ue,className:Ye,style:Fe,classNames:Ve,styles:Qe}=(0,E.dj)("tooltip"),Ie=(0,P.ln)("Tooltip"),tt=x.useRef(null),Nt=()=>{var te;(te=tt.current)===null||te===void 0||te.forceAlign()};x.useImperativeHandle(Y,()=>{var te,Ee;return{forceAlign:Nt,forcePopupAlign:()=>{Ie.deprecated(!1,"forcePopupAlign","forceAlign"),Nt()},nativeElement:(te=tt.current)===null||te===void 0?void 0:te.nativeElement,popupElement:(Ee=tt.current)===null||Ee===void 0?void 0:Ee.popupElement}});const[Et,Rt]=(0,G.Z)(!1,{value:(b=Z.open)!==null&&b!==void 0?b:Z.visible,defaultValue:(y=Z.defaultOpen)!==null&&y!==void 0?y:Z.defaultVisible}),ht=!xe&&!it&&xe!==0,qt=te=>{var Ee,Ce;Rt(ht?!1:te),ht||((Ee=Z.onOpenChange)===null||Ee===void 0||Ee.call(Z,te),(Ce=Z.onVisibleChange)===null||Ce===void 0||Ce.call(Z,te))},Vt=x.useMemo(()=>{var te,Ee;let Ce=De;return typeof qe=="object"&&(Ce=(Ee=(te=qe.pointAtCenter)!==null&&te!==void 0?te:qe.arrowPointAtCenter)!==null&&Ee!==void 0?Ee:De),$e||(0,l.Z)({arrowPointAtCenter:Ce,autoAdjustOverflow:ve,arrowWidth:le?ge.sizePopupArrow:0,borderRadius:ge.borderRadius,offset:ge.marginXXS,visibleFirst:!0})},[De,qe,$e,ge]),bt=x.useMemo(()=>xe===0?xe:it||xe||"",[it,xe]),zt=x.createElement(p.Z,{space:!0},typeof bt=="function"?bt():bt),Tt=ze("tooltip",V),_t=ze(),Ot=Z["data-popover-inject"];let St=Et;!("open"in Z)&&!("visible"in Z)&&ht&&(St=!1);const Jt=x.isValidElement(Ae)&&!(0,K.M2)(Ae)?Ae:x.createElement("span",null,Ae),Pt=Jt.props,xt=!Pt.className||typeof Pt.className=="string"?me()(Pt.className,he||`${Tt}-open`):Pt.className,[Dt,un,Ft]=ae(Tt,!Ot),Ht=Ne(Tt,Pe),It=Ht.arrowStyle,rt=me()(X,{[`${Tt}-rtl`]:Ue==="rtl"},Ht.className,U,un,Ft,Ye,Ve.root,$==null?void 0:$.root),d=me()(Ve.body,$==null?void 0:$.body),[g,T]=(0,se.Cn)("Tooltip",ee.zIndex),j=x.createElement(ue.Z,Object.assign({},ee,{zIndex:g,showArrow:le,placement:Re,mouseEnterDelay:fe,mouseLeaveDelay:B,prefixCls:Tt,classNames:{root:rt,body:d},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},It),Qe.root),Fe),A),W==null?void 0:W.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},Qe.body),oe),W==null?void 0:W.body),Ht.overlayStyle)},getTooltipContainer:re||be||we,ref:tt,builtinPlacements:Vt,overlay:zt,visible:St,onVisibleChange:qt,afterVisibleChange:ke!=null?ke:et,arrowContent:x.createElement("span",{className:`${Tt}-arrow-content`}),motion:{motionName:(0,ne.m)(_t,"zoom-big-fast",Z.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!Oe}),St?(0,K.Tm)(Jt,{className:xt}):Jt);return Dt(x.createElement(m.Z.Provider,{value:T},j))});z._InternalPanelDoNotUseOrYouWillBeFired=je;var H=z},18287:function(Ct,He,S){"use strict";S.d(He,{default:function(){return Pe}});var x=S(87632),de=S(77654),me=S(59301),ue=S(52671),G=S(8657),p=S(60499),se={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},ne=se,l=S(7657),K=function(Ae,ke){return me.createElement(l.Z,(0,p.Z)({},Ae,{ref:ke,icon:ne}))},P=me.forwardRef(K),m=P,_=S(92310),E=S.n(_),w=S(82661),F=S(34061),k=S(48755),N=S(56082),L=S(86641),O=S(57700),D=S(12425);const C=4;function Q(oe){const{dropPosition:Ae,dropLevelOffset:ke,prefixCls:et,indent:Oe,direction:qe="ltr"}=oe,xe=qe==="ltr"?"left":"right",it=qe==="ltr"?"right":"left",$e={[xe]:-ke*Oe+C,[it]:0};switch(Ae){case-1:$e.top=-3;break;case 1:$e.bottom=-3;break;default:$e.bottom=-3,$e[xe]=Oe+C;break}return me.createElement("div",{style:$e,className:`${et}-drop-indicator`})}var ce=Q,ae=S(85278),Ne=me.forwardRef((oe,Ae)=>{var ke;const{getPrefixCls:et,direction:Oe,virtual:qe,tree:xe}=me.useContext(k.E_),{prefixCls:it,className:$e,showIcon:De=!1,showLine:ve,switcherIcon:Le,switcherLoadingIcon:re,blockNode:Re=!1,children:fe,checkable:B=!1,selectable:A=!0,draggable:U,motion:X,style:W}=oe,$=et("tree",it),ee=et(),le=X!=null?X:Object.assign(Object.assign({},(0,L.Z)(ee)),{motionAppear:!1}),ge=Object.assign(Object.assign({},oe),{checkable:B,selectable:A,showIcon:De,motion:le,blockNode:Re,showLine:!!ve,dropIndicatorRender:ce}),[we,ze,Ue]=(0,D.ZP)($),[,Ye]=(0,O.ZP)(),Fe=Ye.paddingXS/2+(((ke=Ye.Tree)===null||ke===void 0?void 0:ke.titleHeight)||Ye.controlHeightSM),Ve=me.useMemo(()=>{if(!U)return!1;let Ie={};switch(typeof U){case"function":Ie.nodeDraggable=U;break;case"object":Ie=Object.assign({},U);break;default:break}return Ie.icon!==!1&&(Ie.icon=Ie.icon||me.createElement(N.Z,null)),Ie},[U]),Qe=Ie=>me.createElement(ae.Z,{prefixCls:$,switcherIcon:Le,switcherLoadingIcon:re,treeNodeProps:Ie,showLine:ve});return we(me.createElement(x.ZP,Object.assign({itemHeight:Fe,ref:Ae,virtual:qe},ge,{style:Object.assign(Object.assign({},xe==null?void 0:xe.style),W),prefixCls:$,className:E()({[`${$}-icon-hide`]:!De,[`${$}-block-node`]:Re,[`${$}-unselectable`]:!A,[`${$}-rtl`]:Oe==="rtl"},xe==null?void 0:xe.className,$e,ze,Ue),direction:Oe,checkable:B&&me.createElement("span",{className:`${$}-checkbox-inner`}),selectable:A,switcherIcon:Qe,draggable:Ve}),fe))});const Te=0,je=1,ie=2;function M(oe,Ae,ke){const{key:et,children:Oe}=ke;function qe(xe){const it=xe[et],$e=xe[Oe];Ae(it,xe)!==!1&&M($e||[],Ae,ke)}oe.forEach(qe)}function z(oe){let{treeData:Ae,expandedKeys:ke,startKey:et,endKey:Oe,fieldNames:qe}=oe;const xe=[];let it=Te;if(et&&et===Oe)return[et];if(!et||!Oe)return[];function $e(De){return De===et||De===Oe}return M(Ae,De=>{if(it===ie)return!1;if($e(De)){if(xe.push(De),it===Te)it=je;else if(it===je)return it=ie,!1}else it===je&&xe.push(De);return ke.includes(De)},(0,F.w$)(qe)),xe}function H(oe,Ae,ke){const et=(0,de.Z)(Ae),Oe=[];return M(oe,(qe,xe)=>{const it=et.indexOf(qe);return it!==-1&&(Oe.push(xe),et.splice(it,1)),!!et.length},(0,F.w$)(ke)),Oe}var Z=function(oe,Ae){var ke={};for(var et in oe)Object.prototype.hasOwnProperty.call(oe,et)&&Ae.indexOf(et)<0&&(ke[et]=oe[et]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Oe=0,et=Object.getOwnPropertySymbols(oe);Oe<et.length;Oe++)Ae.indexOf(et[Oe])<0&&Object.prototype.propertyIsEnumerable.call(oe,et[Oe])&&(ke[et[Oe]]=oe[et[Oe]]);return ke};function Y(oe){const{isLeaf:Ae,expanded:ke}=oe;return Ae?me.createElement(ue.Z,null):ke?me.createElement(G.Z,null):me.createElement(m,null)}function b(oe){let{treeData:Ae,children:ke}=oe;return Ae||(0,F.zn)(ke)}const y=(oe,Ae)=>{var{defaultExpandAll:ke,defaultExpandParent:et,defaultExpandedKeys:Oe}=oe,qe=Z(oe,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const xe=me.useRef(null),it=me.useRef(null),$e=()=>{const{keyEntities:we}=(0,F.I8)(b(qe));let ze;return ke?ze=Object.keys(we):et?ze=(0,w.r7)(qe.expandedKeys||Oe||[],we):ze=qe.expandedKeys||Oe||[],ze},[De,ve]=me.useState(qe.selectedKeys||qe.defaultSelectedKeys||[]),[Le,re]=me.useState(()=>$e());me.useEffect(()=>{"selectedKeys"in qe&&ve(qe.selectedKeys)},[qe.selectedKeys]),me.useEffect(()=>{"expandedKeys"in qe&&re(qe.expandedKeys)},[qe.expandedKeys]);const Re=(we,ze)=>{var Ue;return"expandedKeys"in qe||re(we),(Ue=qe.onExpand)===null||Ue===void 0?void 0:Ue.call(qe,we,ze)},fe=(we,ze)=>{var Ue;const{multiple:Ye,fieldNames:Fe}=qe,{node:Ve,nativeEvent:Qe}=ze,{key:Ie=""}=Ve,tt=b(qe),Nt=Object.assign(Object.assign({},ze),{selected:!0}),Et=(Qe==null?void 0:Qe.ctrlKey)||(Qe==null?void 0:Qe.metaKey),Rt=Qe==null?void 0:Qe.shiftKey;let ht;Ye&&Et?(ht=we,xe.current=Ie,it.current=ht,Nt.selectedNodes=H(tt,ht,Fe)):Ye&&Rt?(ht=Array.from(new Set([].concat((0,de.Z)(it.current||[]),(0,de.Z)(z({treeData:tt,expandedKeys:Le,startKey:Ie,endKey:xe.current,fieldNames:Fe}))))),Nt.selectedNodes=H(tt,ht,Fe)):(ht=[Ie],xe.current=Ie,it.current=ht,Nt.selectedNodes=H(tt,ht,Fe)),(Ue=qe.onSelect)===null||Ue===void 0||Ue.call(qe,ht,Nt),"selectedKeys"in qe||ve(ht)},{getPrefixCls:B,direction:A}=me.useContext(k.E_),{prefixCls:U,className:X,showIcon:W=!0,expandAction:$="click"}=qe,ee=Z(qe,["prefixCls","className","showIcon","expandAction"]),le=B("tree",U),ge=E()(`${le}-directory`,{[`${le}-directory-rtl`]:A==="rtl"},X);return me.createElement(Ne,Object.assign({icon:Y,ref:Ae,blockNode:!0},ee,{showIcon:W,expandAction:$,prefixCls:le,className:ge,expandedKeys:Le,selectedKeys:De,onSelect:fe,onExpand:Re}))};var he=me.forwardRef(y);const be=Ne;be.DirectoryTree=he,be.TreeNode=x.OF;var Pe=be},12425:function(Ct,He,S){"use strict";S.d(He,{ZP:function(){return w},Yk:function(){return m},TM:function(){return _}});var x=S(36237),de=S(36170),me=S(63356),ue=S(34961),G=S(51636),p=S(16931);const se=F=>{let{treeCls:k,treeNodeCls:N,directoryNodeSelectedBg:L,directoryNodeSelectedColor:O,motionDurationMid:D,borderRadius:C,controlItemBgHover:Q}=F;return{[`${k}${k}-directory ${N}`]:{[`${k}-node-content-wrapper`]:{position:"static",[`> *:not(${k}-drop-indicator)`]:{position:"relative"},"&:hover":{background:"transparent"},"&:before":{position:"absolute",inset:0,transition:`background-color ${D}`,content:'""',borderRadius:C},"&:hover:before":{background:Q}},[`${k}-switcher, ${k}-checkbox, ${k}-draggable-icon`]:{zIndex:1},"&-selected":{[`${k}-switcher, ${k}-draggable-icon`]:{color:O},[`${k}-node-content-wrapper`]:{color:O,background:"transparent","&:before, &:hover:before":{background:L}}}}}},ne=new x.Keyframes("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),l=(F,k)=>({[`.${F}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${k.motionDurationSlow}`}}}),K=(F,k)=>({[`.${F}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:k.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${(0,x.unit)(k.lineWidthBold)} solid ${k.colorPrimary}`,borderRadius:"50%",content:'""'}}}),P=(F,k)=>{const{treeCls:N,treeNodeCls:L,treeNodePadding:O,titleHeight:D,indentSize:C,nodeSelectedBg:Q,nodeHoverBg:ce,colorTextQuaternary:ae,controlItemBgActiveDisabled:Se}=k;return{[N]:Object.assign(Object.assign({},(0,me.Wf)(k)),{background:k.colorBgContainer,borderRadius:k.borderRadius,transition:`background-color ${k.motionDurationSlow}`,"&-rtl":{direction:"rtl"},[`&${N}-rtl ${N}-switcher_close ${N}-switcher-icon svg`]:{transform:"rotate(90deg)"},[`&-focused:not(:hover):not(${N}-active-focused)`]:Object.assign({},(0,me.oN)(k)),[`${N}-list-holder-inner`]:{alignItems:"flex-start"},[`&${N}-block-node`]:{[`${N}-list-holder-inner`]:{alignItems:"stretch",[`${N}-node-content-wrapper`]:{flex:"auto"},[`${L}.dragging:after`]:{position:"absolute",inset:0,border:`1px solid ${k.colorPrimary}`,opacity:0,animationName:ne,animationDuration:k.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none",borderRadius:k.borderRadius}}},[L]:{display:"flex",alignItems:"flex-start",marginBottom:O,lineHeight:(0,x.unit)(D),position:"relative","&:before":{content:'""',position:"absolute",zIndex:1,insetInlineStart:0,width:"100%",top:"100%",height:O},[`&-disabled ${N}-node-content-wrapper`]:{color:k.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}},[`${N}-checkbox-disabled + ${N}-node-selected,&${L}-disabled${L}-selected ${N}-node-content-wrapper`]:{backgroundColor:Se},[`${N}-checkbox-disabled`]:{pointerEvents:"unset"},[`&:not(${L}-disabled)`]:{[`${N}-node-content-wrapper`]:{"&:hover":{color:k.nodeHoverColor}}},[`&-active ${N}-node-content-wrapper`]:{background:k.controlItemBgHover},[`&:not(${L}-disabled).filter-node ${N}-title`]:{color:k.colorPrimary,fontWeight:500},"&-draggable":{cursor:"grab",[`${N}-draggable-icon`]:{flexShrink:0,width:D,textAlign:"center",visibility:"visible",color:ae},[`&${L}-disabled ${N}-draggable-icon`]:{visibility:"hidden"}}},[`${N}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:C}},[`${N}-draggable-icon`]:{visibility:"hidden"},[`${N}-switcher, ${N}-checkbox`]:{marginInlineEnd:k.calc(k.calc(D).sub(k.controlInteractiveSize)).div(2).equal()},[`${N}-switcher`]:Object.assign(Object.assign({},l(F,k)),{position:"relative",flex:"none",alignSelf:"stretch",width:D,textAlign:"center",cursor:"pointer",userSelect:"none",transition:`all ${k.motionDurationSlow}`,"&-noop":{cursor:"unset"},"&:before":{pointerEvents:"none",content:'""',width:D,height:D,position:"absolute",left:{_skip_check_:!0,value:0},top:0,borderRadius:k.borderRadius,transition:`all ${k.motionDurationSlow}`},[`&:not(${N}-switcher-noop):hover:before`]:{backgroundColor:k.colorBgTextHover},[`&_close ${N}-switcher-icon svg`]:{transform:"rotate(-90deg)"},"&-loading-icon":{color:k.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:k.calc(D).div(2).equal(),bottom:k.calc(O).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:`1px solid ${k.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:k.calc(k.calc(D).div(2).equal()).mul(.8).equal(),height:k.calc(D).div(2).equal(),borderBottom:`1px solid ${k.colorBorder}`,content:'""'}}}),[`${N}-node-content-wrapper`]:Object.assign(Object.assign({position:"relative",minHeight:D,paddingBlock:0,paddingInline:k.paddingXS,background:"transparent",borderRadius:k.borderRadius,cursor:"pointer",transition:`all ${k.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`},K(F,k)),{"&:hover":{backgroundColor:ce},[`&${N}-node-selected`]:{color:k.nodeSelectedColor,backgroundColor:Q},[`${N}-iconEle`]:{display:"inline-block",width:D,height:D,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}}),[`${N}-unselectable ${N}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${L}.drop-container > [draggable]`]:{boxShadow:`0 0 0 2px ${k.colorPrimary}`},"&-show-line":{[`${N}-indent-unit`]:{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:k.calc(D).div(2).equal(),bottom:k.calc(O).mul(-1).equal(),borderInlineEnd:`1px solid ${k.colorBorder}`,content:'""'},"&-end:before":{display:"none"}},[`${N}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${L}-leaf-last ${N}-switcher-leaf-line:before`]:{top:"auto !important",bottom:"auto !important",height:`${(0,x.unit)(k.calc(D).div(2).equal())} !important`}})}},m=function(F,k){let N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const L=`.${F}`,O=`${L}-treenode`,D=k.calc(k.paddingXS).div(2).equal(),C=(0,G.mergeToken)(k,{treeCls:L,treeNodeCls:O,treeNodePadding:D});return[P(F,C),N&&se(C)].filter(Boolean)},_=F=>{const{controlHeightSM:k,controlItemBgHover:N,controlItemBgActive:L}=F,O=k;return{titleHeight:O,indentSize:O,nodeHoverBg:N,nodeHoverColor:F.colorText,nodeSelectedBg:L,nodeSelectedColor:F.colorText}},E=F=>{const{colorTextLightSolid:k,colorPrimary:N}=F;return Object.assign(Object.assign({},_(F)),{directoryNodeSelectedColor:k,directoryNodeSelectedBg:N})};var w=(0,p.I$)("Tree",(F,k)=>{let{prefixCls:N}=k;return[{[F.componentCls]:(0,de.C2)(`${N}-checkbox`,F)},m(N,F),(0,ue.Z)(F)]},E)},85278:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return k}});var x=S(59301),de=S(60499),me={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},ue=me,G=S(7657),p=function(L,O){return x.createElement(G.Z,(0,de.Z)({},L,{ref:O,icon:ue}))},se=x.forwardRef(p),ne=se,l=S(52671),K=S(58617),P=S(15075),m=S(43531),_=S(92310),E=S.n(_),w=S(22703),k=N=>{const{prefixCls:L,switcherIcon:O,treeNodeProps:D,showLine:C,switcherLoadingIcon:Q}=N,{isLeaf:ce,expanded:ae,loading:Se}=D;if(Se)return x.isValidElement(Q)?Q:x.createElement(K.Z,{className:`${L}-switcher-loading-icon`});let Ne;if(C&&typeof C=="object"&&(Ne=C.showLeafIcon),ce){if(!C)return null;if(typeof Ne!="boolean"&&Ne){const ie=typeof Ne=="function"?Ne(D):Ne,M=`${L}-switcher-line-custom-icon`;return x.isValidElement(ie)?(0,w.Tm)(ie,{className:E()(ie.props.className||"",M)}):ie}return Ne?x.createElement(l.Z,{className:`${L}-switcher-line-icon`}):x.createElement("span",{className:`${L}-switcher-leaf-line`})}const Te=`${L}-switcher-icon`,je=typeof O=="function"?O(D):O;return x.isValidElement(je)?(0,w.Tm)(je,{className:E()(je.props.className||"",Te)}):je!==void 0?je:C?ae?x.createElement(P.Z,{className:`${L}-switcher-line-icon`}):x.createElement(m.Z,{className:`${L}-switcher-line-icon`}):x.createElement(ne,{className:Te})}},25769:function(Ct,He,S){"use strict";var x=S(98040),de={"text/plain":"Text","text/html":"Url",default:"Text"},me="Copy to clipboard: #{key}, Enter";function ue(p){var se=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return p.replace(/#{\s*key\s*}/g,se)}function G(p,se){var ne,l,K,P,m,_,E=!1;se||(se={}),ne=se.debug||!1;try{K=x(),P=document.createRange(),m=document.getSelection(),_=document.createElement("span"),_.textContent=p,_.ariaHidden="true",_.style.all="unset",_.style.position="fixed",_.style.top=0,_.style.clip="rect(0, 0, 0, 0)",_.style.whiteSpace="pre",_.style.webkitUserSelect="text",_.style.MozUserSelect="text",_.style.msUserSelect="text",_.style.userSelect="text",_.addEventListener("copy",function(F){if(F.stopPropagation(),se.format)if(F.preventDefault(),typeof F.clipboardData=="undefined"){ne&&console.warn("unable to use e.clipboardData"),ne&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var k=de[se.format]||de.default;window.clipboardData.setData(k,p)}else F.clipboardData.clearData(),F.clipboardData.setData(se.format,p);se.onCopy&&(F.preventDefault(),se.onCopy(F.clipboardData))}),document.body.appendChild(_),P.selectNodeContents(_),m.addRange(P);var w=document.execCommand("copy");if(!w)throw new Error("copy command was unsuccessful");E=!0}catch(F){ne&&console.error("unable to copy using execCommand: ",F),ne&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(se.format||"text",p),se.onCopy&&se.onCopy(window.clipboardData),E=!0}catch(k){ne&&console.error("unable to copy using clipboardData: ",k),ne&&console.error("falling back to prompt"),l=ue("message"in se?se.message:me),window.prompt(l,p)}}finally{m&&(typeof m.removeRange=="function"?m.removeRange(P):m.removeAllRanges()),_&&document.body.removeChild(_),K()}return E}Ct.exports=G},3867:function(Ct,He,S){var x=S(97671);(function(de,me){Ct.exports=me()})(this,function(){"use strict";function de(U){var X=typeof U;return U!==null&&(X==="object"||X==="function")}function me(U){return typeof U=="function"}var ue=void 0;Array.isArray?ue=Array.isArray:ue=function(U){return Object.prototype.toString.call(U)==="[object Array]"};var G=ue,p=0,se=void 0,ne=void 0,l=function(X,W){C[p]=X,C[p+1]=W,p+=2,p===2&&(ne?ne(Q):ae())};function K(U){ne=U}function P(U){l=U}var m=typeof window!="undefined"?window:void 0,_=m||{},E=_.MutationObserver||_.WebKitMutationObserver,w=typeof self=="undefined"&&typeof x!="undefined"&&{}.toString.call(x)==="[object process]",F=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function k(){return function(){return x.nextTick(Q)}}function N(){return typeof se!="undefined"?function(){se(Q)}:D()}function L(){var U=0,X=new E(Q),W=document.createTextNode("");return X.observe(W,{characterData:!0}),function(){W.data=U=++U%2}}function O(){var U=new MessageChannel;return U.port1.onmessage=Q,function(){return U.port2.postMessage(0)}}function D(){var U=setTimeout;return function(){return U(Q,1)}}var C=new Array(1e3);function Q(){for(var U=0;U<p;U+=2){var X=C[U],W=C[U+1];X(W),C[U]=void 0,C[U+1]=void 0}p=0}function ce(){try{var U=Function("return this")().require("vertx");return se=U.runOnLoop||U.runOnContext,N()}catch(X){return D()}}var ae=void 0;w?ae=k():E?ae=L():F?ae=O():m===void 0?ae=ce():ae=D();function Se(U,X){var W=this,$=new this.constructor(je);$[Te]===void 0&&it($);var ee=W._state;if(ee){var le=arguments[ee-1];l(function(){return et(ee,$,le,W._result)})}else Ae(W,$,U,X);return $}function Ne(U){var X=this;if(U&&typeof U=="object"&&U.constructor===X)return U;var W=new X(je);return he(W,U),W}var Te=Math.random().toString(36).substring(2);function je(){}var ie=void 0,M=1,z=2;function H(){return new TypeError("You cannot resolve a promise with itself")}function Z(){return new TypeError("A promises callback cannot return that same promise.")}function Y(U,X,W,$){try{U.call(X,W,$)}catch(ee){return ee}}function b(U,X,W){l(function($){var ee=!1,le=Y(W,X,function(ge){ee||(ee=!0,X!==ge?he($,ge):Pe($,ge))},function(ge){ee||(ee=!0,oe($,ge))},"Settle: "+($._label||" unknown promise"));!ee&&le&&(ee=!0,oe($,le))},U)}function y(U,X){X._state===M?Pe(U,X._result):X._state===z?oe(U,X._result):Ae(X,void 0,function(W){return he(U,W)},function(W){return oe(U,W)})}function V(U,X,W){X.constructor===U.constructor&&W===Se&&X.constructor.resolve===Ne?y(U,X):W===void 0?Pe(U,X):me(W)?b(U,X,W):Pe(U,X)}function he(U,X){if(U===X)oe(U,H());else if(de(X)){var W=void 0;try{W=X.then}catch($){oe(U,$);return}V(U,X,W)}else Pe(U,X)}function be(U){U._onerror&&U._onerror(U._result),ke(U)}function Pe(U,X){U._state===ie&&(U._result=X,U._state=M,U._subscribers.length!==0&&l(ke,U))}function oe(U,X){U._state===ie&&(U._state=z,U._result=X,l(be,U))}function Ae(U,X,W,$){var ee=U._subscribers,le=ee.length;U._onerror=null,ee[le]=X,ee[le+M]=W,ee[le+z]=$,le===0&&U._state&&l(ke,U)}function ke(U){var X=U._subscribers,W=U._state;if(X.length!==0){for(var $=void 0,ee=void 0,le=U._result,ge=0;ge<X.length;ge+=3)$=X[ge],ee=X[ge+W],$?et(W,$,ee,le):ee(le);U._subscribers.length=0}}function et(U,X,W,$){var ee=me(W),le=void 0,ge=void 0,we=!0;if(ee){try{le=W($)}catch(ze){we=!1,ge=ze}if(X===le){oe(X,Z());return}}else le=$;X._state!==ie||(ee&&we?he(X,le):we===!1?oe(X,ge):U===M?Pe(X,le):U===z&&oe(X,le))}function Oe(U,X){try{X(function($){he(U,$)},function($){oe(U,$)})}catch(W){oe(U,W)}}var qe=0;function xe(){return qe++}function it(U){U[Te]=qe++,U._state=void 0,U._result=void 0,U._subscribers=[]}function $e(){return new Error("Array Methods must be provided an Array")}var De=function(){function U(X,W){this._instanceConstructor=X,this.promise=new X(je),this.promise[Te]||it(this.promise),G(W)?(this.length=W.length,this._remaining=W.length,this._result=new Array(this.length),this.length===0?Pe(this.promise,this._result):(this.length=this.length||0,this._enumerate(W),this._remaining===0&&Pe(this.promise,this._result))):oe(this.promise,$e())}return U.prototype._enumerate=function(W){for(var $=0;this._state===ie&&$<W.length;$++)this._eachEntry(W[$],$)},U.prototype._eachEntry=function(W,$){var ee=this._instanceConstructor,le=ee.resolve;if(le===Ne){var ge=void 0,we=void 0,ze=!1;try{ge=W.then}catch(Ye){ze=!0,we=Ye}if(ge===Se&&W._state!==ie)this._settledAt(W._state,$,W._result);else if(typeof ge!="function")this._remaining--,this._result[$]=W;else if(ee===B){var Ue=new ee(je);ze?oe(Ue,we):V(Ue,W,ge),this._willSettleAt(Ue,$)}else this._willSettleAt(new ee(function(Ye){return Ye(W)}),$)}else this._willSettleAt(le(W),$)},U.prototype._settledAt=function(W,$,ee){var le=this.promise;le._state===ie&&(this._remaining--,W===z?oe(le,ee):this._result[$]=ee),this._remaining===0&&Pe(le,this._result)},U.prototype._willSettleAt=function(W,$){var ee=this;Ae(W,void 0,function(le){return ee._settledAt(M,$,le)},function(le){return ee._settledAt(z,$,le)})},U}();function ve(U){return new De(this,U).promise}function Le(U){var X=this;return G(U)?new X(function(W,$){for(var ee=U.length,le=0;le<ee;le++)X.resolve(U[le]).then(W,$)}):new X(function(W,$){return $(new TypeError("You must pass an array to race."))})}function re(U){var X=this,W=new X(je);return oe(W,U),W}function Re(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function fe(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var B=function(){function U(X){this[Te]=xe(),this._result=this._state=void 0,this._subscribers=[],je!==X&&(typeof X!="function"&&Re(),this instanceof U?Oe(this,X):fe())}return U.prototype.catch=function(W){return this.then(null,W)},U.prototype.finally=function(W){var $=this,ee=$.constructor;return me(W)?$.then(function(le){return ee.resolve(W()).then(function(){return le})},function(le){return ee.resolve(W()).then(function(){throw le})}):$.then(W,W)},U}();B.prototype.then=Se,B.all=ve,B.race=Le,B.resolve=Ne,B.reject=re,B._setScheduler=K,B._setAsap=P,B._asap=l;function A(){var U=void 0;if(typeof S.g!="undefined")U=S.g;else if(typeof self!="undefined")U=self;else try{U=Function("return this")()}catch($){throw new Error("polyfill failed because global object is unavailable in this environment")}var X=U.Promise;if(X){var W=null;try{W=Object.prototype.toString.call(X.resolve())}catch($){}if(W==="[object Promise]"&&!X.cast)return}U.Promise=B}return B.polyfill=A,B.Promise=B,B})},86204:function(Ct){"use strict";var He=typeof Reflect=="object"?Reflect:null,S=He&&typeof He.apply=="function"?He.apply:function(O,D,C){return Function.prototype.apply.call(O,D,C)},x;He&&typeof He.ownKeys=="function"?x=He.ownKeys:Object.getOwnPropertySymbols?x=function(O){return Object.getOwnPropertyNames(O).concat(Object.getOwnPropertySymbols(O))}:x=function(O){return Object.getOwnPropertyNames(O)};function de(L){console&&console.warn&&console.warn(L)}var me=Number.isNaN||function(O){return O!==O};function ue(){ue.init.call(this)}Ct.exports=ue,Ct.exports.once=F,ue.EventEmitter=ue,ue.prototype._events=void 0,ue.prototype._eventsCount=0,ue.prototype._maxListeners=void 0;var G=10;function p(L){if(typeof L!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof L)}Object.defineProperty(ue,"defaultMaxListeners",{enumerable:!0,get:function(){return G},set:function(L){if(typeof L!="number"||L<0||me(L))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+L+".");G=L}}),ue.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ue.prototype.setMaxListeners=function(O){if(typeof O!="number"||O<0||me(O))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+O+".");return this._maxListeners=O,this};function se(L){return L._maxListeners===void 0?ue.defaultMaxListeners:L._maxListeners}ue.prototype.getMaxListeners=function(){return se(this)},ue.prototype.emit=function(O){for(var D=[],C=1;C<arguments.length;C++)D.push(arguments[C]);var Q=O==="error",ce=this._events;if(ce!==void 0)Q=Q&&ce.error===void 0;else if(!Q)return!1;if(Q){var ae;if(D.length>0&&(ae=D[0]),ae instanceof Error)throw ae;var Se=new Error("Unhandled error."+(ae?" ("+ae.message+")":""));throw Se.context=ae,Se}var Ne=ce[O];if(Ne===void 0)return!1;if(typeof Ne=="function")S(Ne,this,D);else for(var Te=Ne.length,je=_(Ne,Te),C=0;C<Te;++C)S(je[C],this,D);return!0};function ne(L,O,D,C){var Q,ce,ae;if(p(D),ce=L._events,ce===void 0?(ce=L._events=Object.create(null),L._eventsCount=0):(ce.newListener!==void 0&&(L.emit("newListener",O,D.listener?D.listener:D),ce=L._events),ae=ce[O]),ae===void 0)ae=ce[O]=D,++L._eventsCount;else if(typeof ae=="function"?ae=ce[O]=C?[D,ae]:[ae,D]:C?ae.unshift(D):ae.push(D),Q=se(L),Q>0&&ae.length>Q&&!ae.warned){ae.warned=!0;var Se=new Error("Possible EventEmitter memory leak detected. "+ae.length+" "+String(O)+" listeners added. Use emitter.setMaxListeners() to increase limit");Se.name="MaxListenersExceededWarning",Se.emitter=L,Se.type=O,Se.count=ae.length,de(Se)}return L}ue.prototype.addListener=function(O,D){return ne(this,O,D,!1)},ue.prototype.on=ue.prototype.addListener,ue.prototype.prependListener=function(O,D){return ne(this,O,D,!0)};function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function K(L,O,D){var C={fired:!1,wrapFn:void 0,target:L,type:O,listener:D},Q=l.bind(C);return Q.listener=D,C.wrapFn=Q,Q}ue.prototype.once=function(O,D){return p(D),this.on(O,K(this,O,D)),this},ue.prototype.prependOnceListener=function(O,D){return p(D),this.prependListener(O,K(this,O,D)),this},ue.prototype.removeListener=function(O,D){var C,Q,ce,ae,Se;if(p(D),Q=this._events,Q===void 0)return this;if(C=Q[O],C===void 0)return this;if(C===D||C.listener===D)--this._eventsCount===0?this._events=Object.create(null):(delete Q[O],Q.removeListener&&this.emit("removeListener",O,C.listener||D));else if(typeof C!="function"){for(ce=-1,ae=C.length-1;ae>=0;ae--)if(C[ae]===D||C[ae].listener===D){Se=C[ae].listener,ce=ae;break}if(ce<0)return this;ce===0?C.shift():E(C,ce),C.length===1&&(Q[O]=C[0]),Q.removeListener!==void 0&&this.emit("removeListener",O,Se||D)}return this},ue.prototype.off=ue.prototype.removeListener,ue.prototype.removeAllListeners=function(O){var D,C,Q;if(C=this._events,C===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[O]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete C[O]),this;if(arguments.length===0){var ce=Object.keys(C),ae;for(Q=0;Q<ce.length;++Q)ae=ce[Q],ae!=="removeListener"&&this.removeAllListeners(ae);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(D=C[O],typeof D=="function")this.removeListener(O,D);else if(D!==void 0)for(Q=D.length-1;Q>=0;Q--)this.removeListener(O,D[Q]);return this};function P(L,O,D){var C=L._events;if(C===void 0)return[];var Q=C[O];return Q===void 0?[]:typeof Q=="function"?D?[Q.listener||Q]:[Q]:D?w(Q):_(Q,Q.length)}ue.prototype.listeners=function(O){return P(this,O,!0)},ue.prototype.rawListeners=function(O){return P(this,O,!1)},ue.listenerCount=function(L,O){return typeof L.listenerCount=="function"?L.listenerCount(O):m.call(L,O)},ue.prototype.listenerCount=m;function m(L){var O=this._events;if(O!==void 0){var D=O[L];if(typeof D=="function")return 1;if(D!==void 0)return D.length}return 0}ue.prototype.eventNames=function(){return this._eventsCount>0?x(this._events):[]};function _(L,O){for(var D=new Array(O),C=0;C<O;++C)D[C]=L[C];return D}function E(L,O){for(;O+1<L.length;O++)L[O]=L[O+1];L.pop()}function w(L){for(var O=new Array(L.length),D=0;D<O.length;++D)O[D]=L[D].listener||L[D];return O}function F(L,O){return new Promise(function(D,C){function Q(ae){L.removeListener(O,ce),C(ae)}function ce(){typeof L.removeListener=="function"&&L.removeListener("error",Q),D([].slice.call(arguments))}N(L,O,ce,{once:!0}),O!=="error"&&k(L,Q,{once:!0})})}function k(L,O,D){typeof L.on=="function"&&N(L,"error",O,D)}function N(L,O,D,C){if(typeof L.on=="function")C.once?L.once(O,D):L.on(O,D);else if(typeof L.addEventListener=="function")L.addEventListener(O,function Q(ce){C.once&&L.removeEventListener(O,Q),D(ce)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof L)}},24334:function(Ct,He,S){var x,de;(function(me,ue){Ct.exports=ue(me)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof S.g!="undefined"?S.g:this,function(me){"use strict";me=me||{};var ue=me.Base64,G="2.6.4",p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",se=function(M){for(var z={},H=0,Z=M.length;H<Z;H++)z[M.charAt(H)]=H;return z}(p),ne=String.fromCharCode,l=function(M){if(M.length<2){var z=M.charCodeAt(0);return z<128?M:z<2048?ne(192|z>>>6)+ne(128|z&63):ne(224|z>>>12&15)+ne(128|z>>>6&63)+ne(128|z&63)}else{var z=65536+(M.charCodeAt(0)-55296)*1024+(M.charCodeAt(1)-56320);return ne(240|z>>>18&7)+ne(128|z>>>12&63)+ne(128|z>>>6&63)+ne(128|z&63)}},K=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,P=function(M){return M.replace(K,l)},m=function(M){var z=[0,2,1][M.length%3],H=M.charCodeAt(0)<<16|(M.length>1?M.charCodeAt(1):0)<<8|(M.length>2?M.charCodeAt(2):0),Z=[p.charAt(H>>>18),p.charAt(H>>>12&63),z>=2?"=":p.charAt(H>>>6&63),z>=1?"=":p.charAt(H&63)];return Z.join("")},_=me.btoa&&typeof me.btoa=="function"?function(M){return me.btoa(M)}:function(M){if(M.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return M.replace(/[\s\S]{1,3}/g,m)},E=function(M){return _(P(String(M)))},w=function(M){return M.replace(/[+\/]/g,function(z){return z=="+"?"-":"_"}).replace(/=/g,"")},F=function(M,z){return z?w(E(M)):E(M)},k=function(M){return F(M,!0)},N;me.Uint8Array&&(N=function(M,z){for(var H="",Z=0,Y=M.length;Z<Y;Z+=3){var b=M[Z],y=M[Z+1],V=M[Z+2],he=b<<16|y<<8|V;H+=p.charAt(he>>>18)+p.charAt(he>>>12&63)+(typeof y!="undefined"?p.charAt(he>>>6&63):"=")+(typeof V!="undefined"?p.charAt(he&63):"=")}return z?w(H):H});var L=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,O=function(M){switch(M.length){case 4:var z=(7&M.charCodeAt(0))<<18|(63&M.charCodeAt(1))<<12|(63&M.charCodeAt(2))<<6|63&M.charCodeAt(3),H=z-65536;return ne((H>>>10)+55296)+ne((H&1023)+56320);case 3:return ne((15&M.charCodeAt(0))<<12|(63&M.charCodeAt(1))<<6|63&M.charCodeAt(2));default:return ne((31&M.charCodeAt(0))<<6|63&M.charCodeAt(1))}},D=function(M){return M.replace(L,O)},C=function(M){var z=M.length,H=z%4,Z=(z>0?se[M.charAt(0)]<<18:0)|(z>1?se[M.charAt(1)]<<12:0)|(z>2?se[M.charAt(2)]<<6:0)|(z>3?se[M.charAt(3)]:0),Y=[ne(Z>>>16),ne(Z>>>8&255),ne(Z&255)];return Y.length-=[0,0,2,1][H],Y.join("")},Q=me.atob&&typeof me.atob=="function"?function(M){return me.atob(M)}:function(M){return M.replace(/\S{1,4}/g,C)},ce=function(M){return Q(String(M).replace(/[^A-Za-z0-9\+\/]/g,""))},ae=function(M){return D(Q(M))},Se=function(M){return String(M).replace(/[-_]/g,function(z){return z=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},Ne=function(M){return ae(Se(M))},Te;me.Uint8Array&&(Te=function(M){return Uint8Array.from(ce(Se(M)),function(z){return z.charCodeAt(0)})});var je=function(){var M=me.Base64;return me.Base64=ue,M};if(me.Base64={VERSION:G,atob:ce,btoa:_,fromBase64:Ne,toBase64:F,utob:P,encode:F,encodeURI:k,btou:D,decode:Ne,noConflict:je,fromUint8Array:N,toUint8Array:Te},typeof Object.defineProperty=="function"){var ie=function(M){return{value:M,enumerable:!1,writable:!0,configurable:!0}};me.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",ie(function(){return Ne(this)})),Object.defineProperty(String.prototype,"toBase64",ie(function(M){return F(this,M)})),Object.defineProperty(String.prototype,"toBase64URI",ie(function(){return F(this,!0)}))}}return me.Meteor&&(Base64=me.Base64),Ct.exports?Ct.exports.Base64=me.Base64:(x=[],de=function(){return me.Base64}.apply(He,x),de!==void 0&&(Ct.exports=de)),{Base64:me.Base64}})},53184:function(Ct,He,S){"use strict";var x,de;function me(ue,G,p){var se=function(ne,l){return ue.js_beautify(ne,l)};return se.js=ue.js_beautify,se.css=G.css_beautify,se.html=p.html_beautify,se.js_beautify=ue.js_beautify,se.css_beautify=G.css_beautify,se.html_beautify=p.html_beautify,se}x=[S(58553),S(87804),S(40998)],de=function(ue,G,p){return me(ue,G,p)}.apply(He,x),de!==void 0&&(Ct.exports=de)},87804:function(Ct,He){var S,x;(function(){var de;(function(){"use strict";var ue=[,,function(ne){function l(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}l.prototype.clone_empty=function(){var m=new l(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},l.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},l.prototype.has_match=function(m){for(var _=this.__items.length-1;_>=0;_--)if(this.__items[_].match(m))return!0;return!1},l.prototype.set_indent=function(m,_){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=_||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},l.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},l.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},l.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},l.prototype.is_empty=function(){return this.__items.length===0},l.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},l.prototype.push=function(m){this.__items.push(m);var _=m.lastIndexOf(`
|
|
`);_!==-1?this.__character_count=m.length-_:this.__character_count+=m.length},l.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},l.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},l.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},l.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},l.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function K(m,_){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),_=_||"",m.indent_level>0&&(_=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=_,this.__base_string_length=_.length}K.prototype.get_indent_size=function(m,_){var E=this.__base_string_length;return _=_||0,m<0&&(E=0),E+=m*this.__indent_size,E+=_,E},K.prototype.get_indent_string=function(m,_){var E=this.__base_string;return _=_||0,m<0&&(m=0,E=""),_+=m*this.__indent_size,this.__ensure_cache(_),E+=this.__cache[_],E},K.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},K.prototype.__add_column=function(){var m=this.__cache.length,_=0,E="";this.__indent_size&&m>=this.__indent_size&&(_=Math.floor(m/this.__indent_size),m-=_*this.__indent_size,E=new Array(_+1).join(this.__indent_string)),m&&(E+=new Array(m+1).join(" ")),this.__cache.push(E)};function P(m,_){this.__indent_cache=new K(m,_),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new l(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}P.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},P.prototype.get_line_number=function(){return this.__lines.length},P.prototype.get_indent_string=function(m,_){return this.__indent_cache.get_indent_string(m,_)},P.prototype.get_indent_size=function(m,_){return this.__indent_cache.get_indent_size(m,_)},P.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},P.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},P.prototype.get_code=function(m){this.trim(!0);var _=this.current_line.pop();_&&(_[_.length-1]===`
|
|
`&&(_=_.replace(/\n+$/g,"")),this.current_line.push(_)),this._end_with_newline&&this.__add_outputline();var E=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(E=E.replace(/[\n]/g,m)),E},P.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},P.prototype.set_indent=function(m,_){return m=m||0,_=_||0,this.next_line.set_indent(m,_),this.__lines.length>1?(this.current_line.set_indent(m,_),!0):(this.current_line.set_indent(),!1)},P.prototype.add_raw_token=function(m){for(var _=0;_<m.newlines;_++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},P.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},P.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(" "))},P.prototype.remove_indent=function(m){for(var _=this.__lines.length;m<_;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},P.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},P.prototype.just_added_newline=function(){return this.current_line.is_empty()},P.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},P.prototype.ensure_empty_line_above=function(m,_){for(var E=this.__lines.length-2;E>=0;){var w=this.__lines[E];if(w.is_empty())break;if(w.item(0).indexOf(m)!==0&&w.item(-1)!==_){this.__lines.splice(E+1,0,new l(this)),this.previous_line=this.__lines[this.__lines.length-2];break}E--}},ne.exports.Output=P},,,,function(ne){function l(m,_){this.raw_options=K(m,_),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}l.prototype._get_array=function(m,_){var E=this.raw_options[m],w=_||[];return typeof E=="object"?E!==null&&typeof E.concat=="function"&&(w=E.concat()):typeof E=="string"&&(w=E.split(/[^a-zA-Z0-9_\/\-]+/)),w},l.prototype._get_boolean=function(m,_){var E=this.raw_options[m],w=E===void 0?!!_:!!E;return w},l.prototype._get_characters=function(m,_){var E=this.raw_options[m],w=_||"";return typeof E=="string"&&(w=E.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),w},l.prototype._get_number=function(m,_){var E=this.raw_options[m];_=parseInt(_,10),isNaN(_)&&(_=0);var w=parseInt(E,10);return isNaN(w)&&(w=_),w},l.prototype._get_selection=function(m,_,E){var w=this._get_selection_list(m,_,E);if(w.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+_+`
|
|
You passed in: '`+this.raw_options[m]+"'");return w[0]},l.prototype._get_selection_list=function(m,_,E){if(!_||_.length===0)throw new Error("Selection list cannot be empty.");if(E=E||[_[0]],!this._is_valid_selection(E,_))throw new Error("Invalid Default Value!");var w=this._get_array(m,E);if(!this._is_valid_selection(w,_))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+_+`
|
|
You passed in: '`+this.raw_options[m]+"'");return w},l.prototype._is_valid_selection=function(m,_){return m.length&&_.length&&!m.some(function(E){return _.indexOf(E)===-1})};function K(m,_){var E={};m=P(m);var w;for(w in m)w!==_&&(E[w]=m[w]);if(_&&m[_])for(w in m[_])E[w]=m[_][w];return E}function P(m){var _={},E;for(E in m){var w=E.replace(/-/g,"_");_[w]=m[E]}return _}ne.exports.Options=l,ne.exports.normalizeOpts=P,ne.exports.mergeOpts=K},,function(ne){var l=RegExp.prototype.hasOwnProperty("sticky");function K(P){this.__input=P||"",this.__input_length=this.__input.length,this.__position=0}K.prototype.restart=function(){this.__position=0},K.prototype.back=function(){this.__position>0&&(this.__position-=1)},K.prototype.hasNext=function(){return this.__position<this.__input_length},K.prototype.next=function(){var P=null;return this.hasNext()&&(P=this.__input.charAt(this.__position),this.__position+=1),P},K.prototype.peek=function(P){var m=null;return P=P||0,P+=this.__position,P>=0&&P<this.__input_length&&(m=this.__input.charAt(P)),m},K.prototype.__match=function(P,m){P.lastIndex=m;var _=P.exec(this.__input);return _&&!(l&&P.sticky)&&_.index!==m&&(_=null),_},K.prototype.test=function(P,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(P,m):!1},K.prototype.testChar=function(P,m){var _=this.peek(m);return P.lastIndex=0,_!==null&&P.test(_)},K.prototype.match=function(P){var m=this.__match(P,this.__position);return m?this.__position+=m[0].length:m=null,m},K.prototype.read=function(P,m,_){var E="",w;return P&&(w=this.match(P),w&&(E+=w[0])),m&&(w||!P)&&(E+=this.readUntil(m,_)),E},K.prototype.readUntil=function(P,m){var _="",E=this.__position;P.lastIndex=this.__position;var w=P.exec(this.__input);return w?(E=w.index,m&&(E+=w[0].length)):E=this.__input_length,_=this.__input.substring(this.__position,E),this.__position=E,_},K.prototype.readUntilAfter=function(P){return this.readUntil(P,!0)},K.prototype.get_regexp=function(P,m){var _=null,E="g";return m&&l&&(E="y"),typeof P=="string"&&P!==""?_=new RegExp(P,E):P&&(_=new RegExp(P.source,E)),_},K.prototype.get_literal_regexp=function(P){return RegExp(P.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},K.prototype.peekUntilAfter=function(P){var m=this.__position,_=this.readUntilAfter(P);return this.__position=m,_},K.prototype.lookBack=function(P){var m=this.__position-1;return m>=P.length&&this.__input.substring(m-P.length,m).toLowerCase()===P},ne.exports.InputScanner=K},,,,,function(ne){function l(K,P){K=typeof K=="string"?K:K.source,P=typeof P=="string"?P:P.source,this.__directives_block_pattern=new RegExp(K+/ beautify( \w+[:]\w+)+ /.source+P,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(K+/\sbeautify\signore:end\s/.source+P,"g")}l.prototype.get_directives=function(K){if(!K.match(this.__directives_block_pattern))return null;var P={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(K);m;)P[m[1]]=m[2],m=this.__directive_pattern.exec(K);return P},l.prototype.readIgnored=function(K){return K.readUntilAfter(this.__directives_end_ignore_pattern)},ne.exports.Directives=l},,function(ne,l,K){var P=K(16).Beautifier,m=K(17).Options;function _(E,w){var F=new P(E,w);return F.beautify()}ne.exports=_,ne.exports.defaultOptions=function(){return new m}},function(ne,l,K){var P=K(17).Options,m=K(2).Output,_=K(8).InputScanner,E=K(13).Directives,w=new E(/\/\*/,/\*\//),F=/\r\n|[\r\n]/,k=/\r\n|[\r\n]/g,N=/\s/,L=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,D=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function C(Q,ce){this._source_text=Q||"",this._options=new P(ce),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"]}C.prototype.eatString=function(Q){var ce="";for(this._ch=this._input.next();this._ch;){if(ce+=this._ch,this._ch==="\\")ce+=this._input.next();else if(Q.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return ce},C.prototype.eatWhitespace=function(Q){for(var ce=N.test(this._input.peek()),ae=0;N.test(this._input.peek());)this._ch=this._input.next(),Q&&this._ch===`
|
|
`&&(ae===0||ae<this._options.max_preserve_newlines)&&(ae++,this._output.add_new_line(!0));return ce},C.prototype.foundNestedPseudoClass=function(){for(var Q=0,ce=1,ae=this._input.peek(ce);ae;){if(ae==="{")return!0;if(ae==="(")Q+=1;else if(ae===")"){if(Q===0)return!1;Q-=1}else if(ae===";"||ae==="}")return!1;ce++,ae=this._input.peek(ce)}return!1},C.prototype.print_string=function(Q){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(Q)},C.prototype.preserveSingleSpace=function(Q){Q&&(this._output.space_before_token=!0)},C.prototype.indent=function(){this._indentLevel++},C.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var Q=this._source_text,ce=this._options.eol;ce==="auto"&&(ce=`
|
|
`,Q&&F.test(Q||"")&&(ce=Q.match(F)[0])),Q=Q.replace(k,`
|
|
`);var ae=Q.match(/^[\t ]*/)[0];this._output=new m(this._options,ae),this._input=new _(Q),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var Se=0,Ne=!1,Te=!1,je=!1,ie=!1,M=!1,z=this._ch,H=!1,Z,Y,b;Z=this._input.read(L),Y=Z!=="",b=z,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),z=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var y=this._input.read(O),V=w.get_directives(y);V&&V.ignore==="start"&&(y+=w.readIgnored(this._input)),this.print_string(y),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(D)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(Y),this.print_string(this._ch);var he=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);he.match(/[ :]$/)&&(he=this.eatString(": ").replace(/\s+$/,""),this.print_string(he),this._output.space_before_token=!0),Se===0&&he.indexOf(":")!==-1&&(Te=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(Y),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),Se===0&&be.indexOf(":")!==-1?(Te=!0,this.indent()):be in this.NESTED_AT_RULE?(this._nestedLevel+=1,be in this.CONDITIONAL_GROUP_RULE&&(je=!0)):Se===0&&!Te&&(ie=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(Y),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")Te&&(Te=!1,this.outdent()),ie=!1,je?(je=!1,Ne=this._indentLevel>=this._nestedLevel):Ne=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&Ne&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(b==="("?this._output.space_before_token=!1:b!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),b==="{"&&this._output.trim(!0),Te&&(this.outdent(),Te=!1),this.print_string(this._ch),Ne=!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 Pe=0;Pe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Pe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Pe])){H=!0;break}(Ne||je)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!ie&&Se===0?(this.print_string(":"),Te||(Te=!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 oe=b==='"'||b==="'";this.preserveSingleSpace(oe||Y),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")H=!1,Se===0?(Te&&(this.outdent(),Te=!1),ie=!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(),Se++,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(")")),Se&&(Se--,this.outdent()));else{var Ae=!1;this._input.lookBack("with")&&(Ae=!0),this.preserveSingleSpace(Y||Ae),this.print_string(this._ch),Te&&b==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),M=!0):(this.eatWhitespace(),Se++,this.indent())}else if(this._ch===")")Se&&(Se--,this.outdent()),M&&this._input.peek()===";"&&this._options.selector_separator_newline&&(M=!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&&(!Te||M)&&Se===0&&!ie?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!Te&&Se===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&&N.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(Y),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),N.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 ke=b==='"'||b==="'";this.preserveSingleSpace(ke||Y),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&H&&this._output.add_new_line()}var et=this._output.get_code(ce);return et},ne.exports.Beautifier=C},function(ne,l,K){var P=K(6).Options;function m(_){P.call(this,_,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var E=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||E;var w=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var F=0;F<w.length;F++)w[F]!=="expand"?this.brace_style="collapse":this.brace_style=w[F]}m.prototype=new P,ne.exports.Options=m}],G={};function p(ne){var l=G[ne];if(l!==void 0)return l.exports;var K=G[ne]={exports:{}};return ue[ne](K,K.exports,p),K.exports}var se=p(15);de=se})();var me=de;S=[],x=function(){return{css_beautify:me}}.apply(He,S),x!==void 0&&(Ct.exports=x)})()},40998:function(Ct,He,S){var x,de;(function(){var me;(function(){"use strict";var se=[,,function(P){function m(w){this.__parent=w,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var w=new m(this.__parent);return w.set_indent(this.__indent_count,this.__alignment_count),w},m.prototype.item=function(w){return w<0?this.__items[this.__items.length+w]:this.__items[w]},m.prototype.has_match=function(w){for(var F=this.__items.length-1;F>=0;F--)if(this.__items[F].match(w))return!0;return!1},m.prototype.set_indent=function(w,F){this.is_empty()&&(this.__indent_count=w||0,this.__alignment_count=F||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var w=this.__parent.current_line;return w.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),w.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),w.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,w.__items[0]===" "&&(w.__items.splice(0,1),w.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(w){this.__items.push(w);var F=w.lastIndexOf(`
|
|
`);F!==-1?this.__character_count=w.length-F:this.__character_count+=w.length},m.prototype.pop=function(){var w=null;return this.is_empty()||(w=this.__items.pop(),this.__character_count-=w.length),w},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var w="";return this.is_empty()?this.__parent.indent_empty_lines&&(w=this.__parent.get_indent_string(this.__indent_count)):(w=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),w+=this.__items.join("")),w};function _(w,F){this.__cache=[""],this.__indent_size=w.indent_size,this.__indent_string=w.indent_char,w.indent_with_tabs||(this.__indent_string=new Array(w.indent_size+1).join(w.indent_char)),F=F||"",w.indent_level>0&&(F=new Array(w.indent_level+1).join(this.__indent_string)),this.__base_string=F,this.__base_string_length=F.length}_.prototype.get_indent_size=function(w,F){var k=this.__base_string_length;return F=F||0,w<0&&(k=0),k+=w*this.__indent_size,k+=F,k},_.prototype.get_indent_string=function(w,F){var k=this.__base_string;return F=F||0,w<0&&(w=0,k=""),F+=w*this.__indent_size,this.__ensure_cache(F),k+=this.__cache[F],k},_.prototype.__ensure_cache=function(w){for(;w>=this.__cache.length;)this.__add_column()},_.prototype.__add_column=function(){var w=this.__cache.length,F=0,k="";this.__indent_size&&w>=this.__indent_size&&(F=Math.floor(w/this.__indent_size),w-=F*this.__indent_size,k=new Array(F+1).join(this.__indent_string)),w&&(k+=new Array(w+1).join(" ")),this.__cache.push(k)};function E(w,F){this.__indent_cache=new _(w,F),this.raw=!1,this._end_with_newline=w.end_with_newline,this.indent_size=w.indent_size,this.wrap_line_length=w.wrap_line_length,this.indent_empty_lines=w.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}E.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},E.prototype.get_line_number=function(){return this.__lines.length},E.prototype.get_indent_string=function(w,F){return this.__indent_cache.get_indent_string(w,F)},E.prototype.get_indent_size=function(w,F){return this.__indent_cache.get_indent_size(w,F)},E.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},E.prototype.add_new_line=function(w){return this.is_empty()||!w&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},E.prototype.get_code=function(w){this.trim(!0);var F=this.current_line.pop();F&&(F[F.length-1]===`
|
|
`&&(F=F.replace(/\n+$/g,"")),this.current_line.push(F)),this._end_with_newline&&this.__add_outputline();var k=this.__lines.join(`
|
|
`);return w!==`
|
|
`&&(k=k.replace(/[\n]/g,w)),k},E.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},E.prototype.set_indent=function(w,F){return w=w||0,F=F||0,this.next_line.set_indent(w,F),this.__lines.length>1?(this.current_line.set_indent(w,F),!0):(this.current_line.set_indent(),!1)},E.prototype.add_raw_token=function(w){for(var F=0;F<w.newlines;F++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(w.whitespace_before),this.current_line.push(w.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},E.prototype.add_token=function(w){this.__add_space_before_token(),this.current_line.push(w),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},E.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(" "))},E.prototype.remove_indent=function(w){for(var F=this.__lines.length;w<F;)this.__lines[w]._remove_indent(),w++;this.current_line._remove_wrap_indent()},E.prototype.trim=function(w){for(w=w===void 0?!1:w,this.current_line.trim();w&&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},E.prototype.just_added_newline=function(){return this.current_line.is_empty()},E.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},E.prototype.ensure_empty_line_above=function(w,F){for(var k=this.__lines.length-2;k>=0;){var N=this.__lines[k];if(N.is_empty())break;if(N.item(0).indexOf(w)!==0&&N.item(-1)!==F){this.__lines.splice(k+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}k--}},P.exports.Output=E},function(P){function m(_,E,w,F){this.type=_,this.text=E,this.comments_before=null,this.newlines=w||0,this.whitespace_before=F||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}P.exports.Token=m},,,function(P){function m(w,F){this.raw_options=_(w,F),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(w,F){var k=this.raw_options[w],N=F||[];return typeof k=="object"?k!==null&&typeof k.concat=="function"&&(N=k.concat()):typeof k=="string"&&(N=k.split(/[^a-zA-Z0-9_\/\-]+/)),N},m.prototype._get_boolean=function(w,F){var k=this.raw_options[w],N=k===void 0?!!F:!!k;return N},m.prototype._get_characters=function(w,F){var k=this.raw_options[w],N=F||"";return typeof k=="string"&&(N=k.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),N},m.prototype._get_number=function(w,F){var k=this.raw_options[w];F=parseInt(F,10),isNaN(F)&&(F=0);var N=parseInt(k,10);return isNaN(N)&&(N=F),N},m.prototype._get_selection=function(w,F,k){var N=this._get_selection_list(w,F,k);if(N.length!==1)throw new Error("Invalid Option Value: The option '"+w+`' can only be one of the following values:
|
|
`+F+`
|
|
You passed in: '`+this.raw_options[w]+"'");return N[0]},m.prototype._get_selection_list=function(w,F,k){if(!F||F.length===0)throw new Error("Selection list cannot be empty.");if(k=k||[F[0]],!this._is_valid_selection(k,F))throw new Error("Invalid Default Value!");var N=this._get_array(w,k);if(!this._is_valid_selection(N,F))throw new Error("Invalid Option Value: The option '"+w+`' can contain only the following values:
|
|
`+F+`
|
|
You passed in: '`+this.raw_options[w]+"'");return N},m.prototype._is_valid_selection=function(w,F){return w.length&&F.length&&!w.some(function(k){return F.indexOf(k)===-1})};function _(w,F){var k={};w=E(w);var N;for(N in w)N!==F&&(k[N]=w[N]);if(F&&w[F])for(N in w[F])k[N]=w[F][N];return k}function E(w){var F={},k;for(k in w){var N=k.replace(/-/g,"_");F[N]=w[k]}return F}P.exports.Options=m,P.exports.normalizeOpts=E,P.exports.mergeOpts=_},,function(P){var m=RegExp.prototype.hasOwnProperty("sticky");function _(E){this.__input=E||"",this.__input_length=this.__input.length,this.__position=0}_.prototype.restart=function(){this.__position=0},_.prototype.back=function(){this.__position>0&&(this.__position-=1)},_.prototype.hasNext=function(){return this.__position<this.__input_length},_.prototype.next=function(){var E=null;return this.hasNext()&&(E=this.__input.charAt(this.__position),this.__position+=1),E},_.prototype.peek=function(E){var w=null;return E=E||0,E+=this.__position,E>=0&&E<this.__input_length&&(w=this.__input.charAt(E)),w},_.prototype.__match=function(E,w){E.lastIndex=w;var F=E.exec(this.__input);return F&&!(m&&E.sticky)&&F.index!==w&&(F=null),F},_.prototype.test=function(E,w){return w=w||0,w+=this.__position,w>=0&&w<this.__input_length?!!this.__match(E,w):!1},_.prototype.testChar=function(E,w){var F=this.peek(w);return E.lastIndex=0,F!==null&&E.test(F)},_.prototype.match=function(E){var w=this.__match(E,this.__position);return w?this.__position+=w[0].length:w=null,w},_.prototype.read=function(E,w,F){var k="",N;return E&&(N=this.match(E),N&&(k+=N[0])),w&&(N||!E)&&(k+=this.readUntil(w,F)),k},_.prototype.readUntil=function(E,w){var F="",k=this.__position;E.lastIndex=this.__position;var N=E.exec(this.__input);return N?(k=N.index,w&&(k+=N[0].length)):k=this.__input_length,F=this.__input.substring(this.__position,k),this.__position=k,F},_.prototype.readUntilAfter=function(E){return this.readUntil(E,!0)},_.prototype.get_regexp=function(E,w){var F=null,k="g";return w&&m&&(k="y"),typeof E=="string"&&E!==""?F=new RegExp(E,k):E&&(F=new RegExp(E.source,k)),F},_.prototype.get_literal_regexp=function(E){return RegExp(E.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},_.prototype.peekUntilAfter=function(E){var w=this.__position,F=this.readUntilAfter(E);return this.__position=w,F},_.prototype.lookBack=function(E){var w=this.__position-1;return w>=E.length&&this.__input.substring(w-E.length,w).toLowerCase()===E},P.exports.InputScanner=_},function(P,m,_){var E=_(8).InputScanner,w=_(3).Token,F=_(10).TokenStream,k=_(11).WhitespacePattern,N={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},L=function(O,D){this._input=new E(O),this._options=D||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new k(this._input)};L.prototype.tokenize=function(){this._input.restart(),this.__tokens=new F,this._reset();for(var O,D=new w(N.START,""),C=null,Q=[],ce=new F;D.type!==N.EOF;){for(O=this._get_next_token(D,C);this._is_comment(O);)ce.add(O),O=this._get_next_token(D,C);ce.isEmpty()||(O.comments_before=ce,ce=new F),O.parent=C,this._is_opening(O)?(Q.push(C),C=O):C&&this._is_closing(O,C)&&(O.opened=C,C.closed=O,C=Q.pop(),O.parent=C),O.previous=D,D.next=O,this.__tokens.add(O),D=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,D){this._readWhitespace();var C=this._input.read(/.+/g);return C?this._create_token(N.RAW,C):this._create_token(N.EOF,"")},L.prototype._is_comment=function(O){return!1},L.prototype._is_opening=function(O){return!1},L.prototype._is_closing=function(O,D){return!1},L.prototype._create_token=function(O,D){var C=new w(O,D,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return C},L.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},P.exports.Tokenizer=L,P.exports.TOKEN=N},function(P){function m(_){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=_}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var _=null;return this.hasNext()&&(_=this.__tokens[this.__position],this.__position+=1),_},m.prototype.peek=function(_){var E=null;return _=_||0,_+=this.__position,_>=0&&_<this.__tokens_length&&(E=this.__tokens[_]),E},m.prototype.add=function(_){this.__parent_token&&(_.parent=this.__parent_token),this.__tokens.push(_),this.__tokens_length+=1},P.exports.TokenStream=m},function(P,m,_){var E=_(12).Pattern;function w(F,k){E.call(this,F,k),k?this._line_regexp=this._input.get_regexp(k._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}w.prototype=new E,w.prototype.__set_whitespace_patterns=function(F,k){F+="\\t ",k+="\\n\\r",this._match_pattern=this._input.get_regexp("["+F+k+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+k+"]")},w.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var F=this._input.read(this._match_pattern);if(F===" ")this.whitespace_before_token=" ";else if(F){var k=this.__split(this._newline_regexp,F);this.newline_count=k.length-1,this.whitespace_before_token=k[this.newline_count]}return F},w.prototype.matching=function(F,k){var N=this._create();return N.__set_whitespace_patterns(F,k),N._update(),N},w.prototype._create=function(){return new w(this._input,this)},w.prototype.__split=function(F,k){F.lastIndex=0;for(var N=0,L=[],O=F.exec(k);O;)L.push(k.substring(N,O.index)),N=O.index+O[0].length,O=F.exec(k);return N<k.length?L.push(k.substring(N,k.length)):L.push(""),L},P.exports.WhitespacePattern=w},function(P){function m(_,E){this._input=_,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,E&&(this._starting_pattern=this._input.get_regexp(E._starting_pattern,!0),this._match_pattern=this._input.get_regexp(E._match_pattern,!0),this._until_pattern=this._input.get_regexp(E._until_pattern),this._until_after=E._until_after)}m.prototype.read=function(){var _=this._input.read(this._starting_pattern);return(!this._starting_pattern||_)&&(_+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),_},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(_){var E=this._create();return E._until_after=!0,E._until_pattern=this._input.get_regexp(_),E._update(),E},m.prototype.until=function(_){var E=this._create();return E._until_after=!1,E._until_pattern=this._input.get_regexp(_),E._update(),E},m.prototype.starting_with=function(_){var E=this._create();return E._starting_pattern=this._input.get_regexp(_,!0),E._update(),E},m.prototype.matching=function(_){var E=this._create();return E._match_pattern=this._input.get_regexp(_,!0),E._update(),E},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},P.exports.Pattern=m},function(P){function m(_,E){_=typeof _=="string"?_:_.source,E=typeof E=="string"?E:E.source,this.__directives_block_pattern=new RegExp(_+/ beautify( \w+[:]\w+)+ /.source+E,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(_+/\sbeautify\signore:end\s/.source+E,"g")}m.prototype.get_directives=function(_){if(!_.match(this.__directives_block_pattern))return null;var E={};this.__directive_pattern.lastIndex=0;for(var w=this.__directive_pattern.exec(_);w;)E[w[1]]=w[2],w=this.__directive_pattern.exec(_);return E},m.prototype.readIgnored=function(_){return _.readUntilAfter(this.__directives_end_ignore_pattern)},P.exports.Directives=m},function(P,m,_){var E=_(12).Pattern,w={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function F(k,N){E.call(this,k,N),this.__template_pattern=null,this._disabled=Object.assign({},w),this._excluded=Object.assign({},w),N&&(this.__template_pattern=this._input.get_regexp(N.__template_pattern),this._excluded=Object.assign(this._excluded,N._excluded),this._disabled=Object.assign(this._disabled,N._disabled));var L=new E(k);this.__patterns={handlebars_comment:L.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:L.starting_with(/{{{/).until_after(/}}}/),handlebars:L.starting_with(/{{/).until_after(/}}/),php:L.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:L.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:L.starting_with(/{%/).until_after(/%}/),django_value:L.starting_with(/{{/).until_after(/}}/),django_comment:L.starting_with(/{#/).until_after(/#}/),smarty:L.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:L.starting_with(/{\*/).until_after(/\*}/),smarty_literal:L.starting_with(/{literal}/).until_after(/{\/literal}/)}}F.prototype=new E,F.prototype._create=function(){return new F(this._input,this)},F.prototype._update=function(){this.__set_templated_pattern()},F.prototype.disable=function(k){var N=this._create();return N._disabled[k]=!0,N._update(),N},F.prototype.read_options=function(k){var N=this._create();for(var L in w)N._disabled[L]=k.templating.indexOf(L)===-1;return N._update(),N},F.prototype.exclude=function(k){var N=this._create();return N._excluded[k]=!0,N._update(),N},F.prototype.read=function(){var k="";this._match_pattern?k=this._input.read(this._starting_pattern):k=this._input.read(this._starting_pattern,this.__template_pattern);for(var N=this._read_template();N;)this._match_pattern?N+=this._input.read(this._match_pattern):N+=this._input.readUntil(this.__template_pattern),k+=N,N=this._read_template();return this._until_after&&(k+=this._input.readUntilAfter(this._until_pattern)),k},F.prototype.__set_templated_pattern=function(){var k=[];this._disabled.php||k.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||k.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||k.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||k.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(k.push(this.__patterns.django._starting_pattern.source),k.push(this.__patterns.django_value._starting_pattern.source),k.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||k.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&k.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+k.join("|")+")")},F.prototype._read_template=function(){var k="",N=this._input.peek();if(N==="<"){var L=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&L==="?"&&(k=k||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&L==="%"&&(k=k||this.__patterns.erb.read())}else N==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(k=k||this.__patterns.handlebars_comment.read(),k=k||this.__patterns.handlebars_unescaped.read(),k=k||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(k=k||this.__patterns.django_value.read()),this._excluded.django||(k=k||this.__patterns.django_comment.read(),k=k||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(k=k||this.__patterns.smarty_comment.read(),k=k||this.__patterns.smarty_literal.read(),k=k||this.__patterns.smarty.read()));return k},P.exports.TemplatablePattern=F},,,,function(P,m,_){var E=_(19).Beautifier,w=_(20).Options;function F(k,N,L,O){var D=new E(k,N,L,O);return D.beautify()}P.exports=F,P.exports.defaultOptions=function(){return new w}},function(P,m,_){var E=_(20).Options,w=_(2).Output,F=_(21).Tokenizer,k=_(21).TOKEN,N=/\r\n|[\r\n]/,L=/\r\n|[\r\n]/g,O=function(ie,M){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=ie.max_preserve_newlines,this.preserve_newlines=ie.preserve_newlines,this._output=new w(ie,M)};O.prototype.current_line_has_match=function(ie){return this._output.current_line.has_match(ie)},O.prototype.set_space_before_token=function(ie,M){this._output.space_before_token=ie,this._output.non_breaking_space=M},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(ie){this._output.add_raw_token(ie)},O.prototype.print_preserved_newlines=function(ie){var M=0;ie.type!==k.TEXT&&ie.previous.type!==k.TEXT&&(M=ie.newlines?1:0),this.preserve_newlines&&(M=ie.newlines<this.max_preserve_newlines+1?ie.newlines:this.max_preserve_newlines+1);for(var z=0;z<M;z++)this.print_newline(z>0);return M!==0},O.prototype.traverse_whitespace=function(ie){return ie.whitespace_before||ie.newlines?(this.print_preserved_newlines(ie)||(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(ie){this._output.add_new_line(ie)},O.prototype.print_token=function(ie){ie.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(ie.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(ie){return ie=this.indent_level+(ie||0),ie<1?"":this._output.get_indent_string(ie)};var D=function(ie){for(var M=null,z=ie.next;z.type!==k.EOF&&ie.closed!==z;){if(z.type===k.ATTRIBUTE&&z.text==="type"){z.next&&z.next.type===k.EQUALS&&z.next.next&&z.next.next.type===k.VALUE&&(M=z.next.next.text);break}z=z.next}return M},C=function(ie,M){var z=null,H=null;return M.closed?(ie==="script"?z="text/javascript":ie==="style"&&(z="text/css"),z=D(M)||z,z.search("text/css")>-1?H="css":z.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?H="javascript":z.search(/(text|application|dojo)\/(x-)?(html)/)>-1?H="html":z.search(/test\/null/)>-1&&(H="null"),H):null};function Q(ie,M){return M.indexOf(ie)!==-1}function ce(ie,M,z){this.parent=ie||null,this.tag=M?M.tag_name:"",this.indent_level=z||0,this.parser_token=M||null}function ae(ie){this._printer=ie,this._current_frame=null}ae.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},ae.prototype.record_tag=function(ie){var M=new ce(this._current_frame,ie,this._printer.indent_level);this._current_frame=M},ae.prototype._try_pop_frame=function(ie){var M=null;return ie&&(M=ie.parser_token,this._printer.indent_level=ie.indent_level,this._current_frame=ie.parent),M},ae.prototype._get_frame=function(ie,M){for(var z=this._current_frame;z&&ie.indexOf(z.tag)===-1;){if(M&&M.indexOf(z.tag)!==-1){z=null;break}z=z.parent}return z},ae.prototype.try_pop=function(ie,M){var z=this._get_frame([ie],M);return this._try_pop_frame(z)},ae.prototype.indent_to_tag=function(ie){var M=this._get_frame(ie);M&&(this._printer.indent_level=M.indent_level)};function Se(ie,M,z,H){this._source_text=ie||"",M=M||{},this._js_beautify=z,this._css_beautify=H,this._tag_stack=null;var Z=new E(M,"html");this._options=Z,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"}Se.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var ie=this._source_text,M=this._options.eol;this._options.eol==="auto"&&(M=`
|
|
`,ie&&N.test(ie)&&(M=ie.match(N)[0])),ie=ie.replace(L,`
|
|
`);var z=ie.match(/^[\t ]*/)[0],H={text:"",type:""},Z=new Ne(this._options),Y=new O(this._options,z),b=new F(ie,this._options).tokenize();this._tag_stack=new ae(Y);for(var y=null,V=b.next();V.type!==k.EOF;)V.type===k.TAG_OPEN||V.type===k.COMMENT?(y=this._handle_tag_open(Y,V,Z,H,b),Z=y):V.type===k.ATTRIBUTE||V.type===k.EQUALS||V.type===k.VALUE||V.type===k.TEXT&&!Z.tag_complete?y=this._handle_inside_tag(Y,V,Z,H):V.type===k.TAG_CLOSE?y=this._handle_tag_close(Y,V,Z):V.type===k.TEXT?y=this._handle_text(Y,V,Z):V.type===k.CONTROL_FLOW_OPEN?y=this._handle_control_flow_open(Y,V):V.type===k.CONTROL_FLOW_CLOSE?y=this._handle_control_flow_close(Y,V):Y.add_raw_token(V),H=y,V=b.next();var he=Y._output.get_code(M);return he},Se.prototype._handle_control_flow_open=function(ie,M){var z={text:M.text,type:M.type};return ie.set_space_before_token(M.newlines||M.whitespace_before!=="",!0),M.newlines?ie.print_preserved_newlines(M):ie.set_space_before_token(M.newlines||M.whitespace_before!=="",!0),ie.print_token(M),ie.indent(),z},Se.prototype._handle_control_flow_close=function(ie,M){var z={text:M.text,type:M.type};return ie.deindent(),M.newlines?ie.print_preserved_newlines(M):ie.set_space_before_token(M.newlines||M.whitespace_before!=="",!0),ie.print_token(M),z},Se.prototype._handle_tag_close=function(ie,M,z){var H={text:M.text,type:M.type};return ie.alignment_size=0,z.tag_complete=!0,ie.set_space_before_token(M.newlines||M.whitespace_before!=="",!0),z.is_unformatted?ie.add_raw_token(M):(z.tag_start_char==="<"&&(ie.set_space_before_token(M.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&z.has_wrapped_attrs&&ie.print_newline(!1)),ie.print_token(M)),z.indent_content&&!(z.is_unformatted||z.is_content_unformatted)&&(ie.indent(),z.indent_content=!1),!z.is_inline_element&&!(z.is_unformatted||z.is_content_unformatted)&&ie.set_wrap_point(),H},Se.prototype._handle_inside_tag=function(ie,M,z,H){var Z=z.has_wrapped_attrs,Y={text:M.text,type:M.type};return ie.set_space_before_token(M.newlines||M.whitespace_before!=="",!0),z.is_unformatted?ie.add_raw_token(M):z.tag_start_char==="{"&&M.type===k.TEXT?ie.print_preserved_newlines(M)?(M.newlines=0,ie.add_raw_token(M)):ie.print_token(M):(M.type===k.ATTRIBUTE?ie.set_space_before_token(!0):(M.type===k.EQUALS||M.type===k.VALUE&&M.previous.type===k.EQUALS)&&ie.set_space_before_token(!1),M.type===k.ATTRIBUTE&&z.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(ie.traverse_whitespace(M),Z=Z||M.newlines!==0),this._is_wrap_attributes_force&&z.attr_count>=this._options.wrap_attributes_min_attrs&&(H.type!==k.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(ie.print_newline(!1),Z=!0)),ie.print_token(M),Z=Z||ie.previous_token_wrapped(),z.has_wrapped_attrs=Z),Y},Se.prototype._handle_text=function(ie,M,z){var H={text:M.text,type:"TK_CONTENT"};return z.custom_beautifier_name?this._print_custom_beatifier_text(ie,M,z):z.is_unformatted||z.is_content_unformatted?ie.add_raw_token(M):(ie.traverse_whitespace(M),ie.print_token(M)),H},Se.prototype._print_custom_beatifier_text=function(ie,M,z){var H=this;if(M.text!==""){var Z=M.text,Y,b=1,y="",V="";z.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?Y=this._js_beautify:z.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?Y=this._css_beautify:z.custom_beautifier_name==="html"&&(Y=function(ke,et){var Oe=new Se(ke,et,H._js_beautify,H._css_beautify);return Oe.beautify()}),this._options.indent_scripts==="keep"?b=0:this._options.indent_scripts==="separate"&&(b=-ie.indent_level);var he=ie.get_full_indent(b);if(Z=Z.replace(/\n[ \t]*$/,""),z.custom_beautifier_name!=="html"&&Z[0]==="<"&&Z.match(/^(<!--|<!\[CDATA\[)/)){var be=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(Z);if(!be){ie.add_raw_token(M);return}y=he+be[1]+`
|
|
`,Z=be[4],be[5]&&(V=he+be[5]),Z=Z.replace(/\n[ \t]*$/,""),(be[2]||be[3].indexOf(`
|
|
`)!==-1)&&(be=be[3].match(/[ \t]+$/),be&&(M.whitespace_before=be[0]))}if(Z)if(Y){var Pe=function(){this.eol=`
|
|
`};Pe.prototype=this._options.raw_options;var oe=new Pe;Z=Y(he+Z,oe)}else{var Ae=M.whitespace_before;Ae&&(Z=Z.replace(new RegExp(`
|
|
(`+Ae+")?","g"),`
|
|
`)),Z=he+Z.replace(/\n/g,`
|
|
`+he)}y&&(Z?Z=y+Z+`
|
|
`+V:Z=y+V),ie.print_newline(!1),Z&&(M.text=Z,M.whitespace_before="",M.newlines=0,ie.add_raw_token(M),ie.print_newline(!0))}},Se.prototype._handle_tag_open=function(ie,M,z,H,Z){var Y=this._get_tag_open_token(M);if((z.is_unformatted||z.is_content_unformatted)&&!z.is_empty_element&&M.type===k.TAG_OPEN&&!Y.is_start_tag?(ie.add_raw_token(M),Y.start_tag_token=this._tag_stack.try_pop(Y.tag_name)):(ie.traverse_whitespace(M),this._set_tag_position(ie,M,Y,z,H),Y.is_inline_element||ie.set_wrap_point(),ie.print_token(M)),Y.is_start_tag&&this._is_wrap_attributes_force){var b=0,y;do y=Z.peek(b),y.type===k.ATTRIBUTE&&(Y.attr_count+=1),b+=1;while(y.type!==k.EOF&&y.type!==k.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(Y.alignment_size=M.text.length+1),!Y.tag_complete&&!Y.is_unformatted&&(ie.alignment_size=Y.alignment_size),Y};var Ne=function(ie,M,z){if(this.parent=M||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="",!z)this.tag_complete=!0;else{var H;this.tag_start_char=z.text[0],this.text=z.text,this.tag_start_char==="<"?(H=z.text.match(/^<([^\s>]*)/),this.tag_check=H?H[1]:""):(H=z.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=H?H[1]:"",(z.text.startsWith("{{#>")||z.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&z.next!==null?this.tag_check=z.next.text.split(" ")[0]:this.tag_check=z.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),z.type===k.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||z.closed&&z.closed.text==="/>";var Z=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(Z=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!ie.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(Z)))}};Se.prototype._get_tag_open_token=function(ie){var M=new Ne(this._options,this._tag_stack.get_parser_token(),ie);return M.alignment_size=this._options.wrap_attributes_indent_size,M.is_end_tag=M.is_end_tag||Q(M.tag_check,this._options.void_elements),M.is_empty_element=M.tag_complete||M.is_start_tag&&M.is_end_tag,M.is_unformatted=!M.tag_complete&&Q(M.tag_check,this._options.unformatted),M.is_content_unformatted=!M.is_empty_element&&Q(M.tag_check,this._options.content_unformatted),M.is_inline_element=Q(M.tag_name,this._options.inline)||this._options.inline_custom_elements&&M.tag_name.includes("-")||M.tag_start_char==="{",M},Se.prototype._set_tag_position=function(ie,M,z,H,Z){if(z.is_empty_element||(z.is_end_tag?z.start_tag_token=this._tag_stack.try_pop(z.tag_name):(this._do_optional_end_element(z)&&(z.is_inline_element||ie.print_newline(!1)),this._tag_stack.record_tag(z),(z.tag_name==="script"||z.tag_name==="style")&&!(z.is_unformatted||z.is_content_unformatted)&&(z.custom_beautifier_name=C(z.tag_check,M)))),Q(z.tag_check,this._options.extra_liners)&&(ie.print_newline(!1),ie._output.just_added_blankline()||ie.print_newline(!0)),z.is_empty_element){if(z.tag_start_char==="{"&&z.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),z.indent_content=!0;var Y=ie.current_line_has_match(/{{#if/);Y||ie.print_newline(!1)}z.tag_name==="!--"&&Z.type===k.TAG_CLOSE&&H.is_end_tag&&z.text.indexOf(`
|
|
`)===-1||(z.is_inline_element||z.is_unformatted||ie.print_newline(!1),this._calcluate_parent_multiline(ie,z))}else if(z.is_end_tag){var b=!1;b=z.start_tag_token&&z.start_tag_token.multiline_content,b=b||!z.is_inline_element&&!(H.is_inline_element||H.is_unformatted)&&!(Z.type===k.TAG_CLOSE&&z.start_tag_token===H)&&Z.type!=="TK_CONTENT",(z.is_content_unformatted||z.is_unformatted)&&(b=!1),b&&ie.print_newline(!1)}else z.indent_content=!z.custom_beautifier_name,z.tag_start_char==="<"&&(z.tag_name==="html"?z.indent_content=this._options.indent_inner_html:z.tag_name==="head"?z.indent_content=this._options.indent_head_inner_html:z.tag_name==="body"&&(z.indent_content=this._options.indent_body_inner_html)),!(z.is_inline_element||z.is_unformatted)&&(Z.type!=="TK_CONTENT"||z.is_content_unformatted)&&ie.print_newline(!1),this._calcluate_parent_multiline(ie,z)},Se.prototype._calcluate_parent_multiline=function(ie,M){M.parent&&ie._output.just_added_newline()&&!((M.is_inline_element||M.is_unformatted)&&M.parent.is_inline_element)&&(M.parent.multiline_content=!0)};var Te=["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"],je=["a","audio","del","ins","map","noscript","video"];Se.prototype._do_optional_end_element=function(ie){var M=null;if(!(ie.is_empty_element||!ie.is_start_tag||!ie.parent)){if(ie.tag_name==="body")M=M||this._tag_stack.try_pop("head");else if(ie.tag_name==="li")M=M||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(ie.tag_name==="dd"||ie.tag_name==="dt")M=M||this._tag_stack.try_pop("dt",["dl"]),M=M||this._tag_stack.try_pop("dd",["dl"]);else if(ie.parent.tag_name==="p"&&Te.indexOf(ie.tag_name)!==-1){var z=ie.parent.parent;(!z||je.indexOf(z.tag_name)===-1)&&(M=M||this._tag_stack.try_pop("p"))}else ie.tag_name==="rp"||ie.tag_name==="rt"?(M=M||this._tag_stack.try_pop("rt",["ruby","rtc"]),M=M||this._tag_stack.try_pop("rp",["ruby","rtc"])):ie.tag_name==="optgroup"?M=M||this._tag_stack.try_pop("optgroup",["select"]):ie.tag_name==="option"?M=M||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):ie.tag_name==="colgroup"?M=M||this._tag_stack.try_pop("caption",["table"]):ie.tag_name==="thead"?(M=M||this._tag_stack.try_pop("caption",["table"]),M=M||this._tag_stack.try_pop("colgroup",["table"])):ie.tag_name==="tbody"||ie.tag_name==="tfoot"?(M=M||this._tag_stack.try_pop("caption",["table"]),M=M||this._tag_stack.try_pop("colgroup",["table"]),M=M||this._tag_stack.try_pop("thead",["table"]),M=M||this._tag_stack.try_pop("tbody",["table"])):ie.tag_name==="tr"?(M=M||this._tag_stack.try_pop("caption",["table"]),M=M||this._tag_stack.try_pop("colgroup",["table"]),M=M||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(ie.tag_name==="th"||ie.tag_name==="td")&&(M=M||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),M=M||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return ie.parent=this._tag_stack.get_parser_token(),M}},P.exports.Beautifier=Se},function(P,m,_){var E=_(6).Options;function w(F){E.call(this,F,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}w.prototype=new E,P.exports.Options=w},function(P,m,_){var E=_(9).Tokenizer,w=_(9).TOKEN,F=_(13).Directives,k=_(14).TemplatablePattern,N=_(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:w.START,RAW:w.RAW,EOF:w.EOF},O=new F(/<\!--/,/-->/),D=function(C,Q){E.call(this,C,Q),this._current_tag_name="";var ce=new k(this._input).read_options(this._options),ae=new N(this._input);if(this.__patterns={word:ce.until(/[\n\r\t <]/),word_control_flow_close_excluded:ce.until(/[\n\r\t <}]/),single_quote:ce.until_after(/'/),double_quote:ce.until_after(/"/),attribute:ce.until(/[\n\r\t =>]|\/>/),element_name:ce.until(/[\n\r\t >\/]/),angular_control_flow_start:ae.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:ae.starting_with(/{{!--/).until_after(/--}}/),handlebars:ae.starting_with(/{{/).until_after(/}}/),handlebars_open:ae.until(/[\n\r\t }]/),handlebars_raw_close:ae.until(/}}/),comment:ae.starting_with(/<!--/).until_after(/-->/),cdata:ae.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:ae.starting_with(/<!\[/).until_after(/]>/),processing:ae.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 Se=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=ae.matching(Se).until_after(Se)}};D.prototype=new E,D.prototype._is_comment=function(C){return!1},D.prototype._is_opening=function(C){return C.type===L.TAG_OPEN||C.type===L.CONTROL_FLOW_OPEN},D.prototype._is_closing=function(C,Q){return C.type===L.TAG_CLOSE&&Q&&((C.text===">"||C.text==="/>")&&Q.text[0]==="<"||C.text==="}}"&&Q.text[0]==="{"&&Q.text[1]==="{")||C.type===L.CONTROL_FLOW_CLOSE&&C.text==="}"&&Q.text.endsWith("{")},D.prototype._reset=function(){this._current_tag_name=""},D.prototype._get_next_token=function(C,Q){var ce=null;this._readWhitespace();var ae=this._input.peek();return ae===null?this._create_token(L.EOF,""):(ce=ce||this._read_open_handlebars(ae,Q),ce=ce||this._read_attribute(ae,C,Q),ce=ce||this._read_close(ae,Q),ce=ce||this._read_script_and_style(ae,C),ce=ce||this._read_control_flows(ae,Q),ce=ce||this._read_raw_content(ae,C,Q),ce=ce||this._read_content_word(ae,Q),ce=ce||this._read_comment_or_cdata(ae),ce=ce||this._read_processing(ae),ce=ce||this._read_open(ae,Q),ce=ce||this._create_token(L.UNKNOWN,this._input.next()),ce)},D.prototype._read_comment_or_cdata=function(C){var Q=null,ce=null,ae=null;if(C==="<"){var Se=this._input.peek(1);Se==="!"&&(ce=this.__patterns.comment.read(),ce?(ae=O.get_directives(ce),ae&&ae.ignore==="start"&&(ce+=O.readIgnored(this._input))):ce=this.__patterns.cdata.read()),ce&&(Q=this._create_token(L.COMMENT,ce),Q.directives=ae)}return Q},D.prototype._read_processing=function(C){var Q=null,ce=null,ae=null;if(C==="<"){var Se=this._input.peek(1);(Se==="!"||Se==="?")&&(ce=this.__patterns.conditional_comment.read(),ce=ce||this.__patterns.processing.read()),ce&&(Q=this._create_token(L.COMMENT,ce),Q.directives=ae)}return Q},D.prototype._read_open=function(C,Q){var ce=null,ae=null;return(!Q||Q.type===L.CONTROL_FLOW_OPEN)&&C==="<"&&(ce=this._input.next(),this._input.peek()==="/"&&(ce+=this._input.next()),ce+=this.__patterns.element_name.read(),ae=this._create_token(L.TAG_OPEN,ce)),ae},D.prototype._read_open_handlebars=function(C,Q){var ce=null,ae=null;return(!Q||Q.type===L.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&C==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(ce=this.__patterns.handlebars_comment.read(),ce=ce||this.__patterns.handlebars.read(),ae=this._create_token(L.COMMENT,ce)):(ce=this.__patterns.handlebars_open.read(),ae=this._create_token(L.TAG_OPEN,ce))),ae},D.prototype._read_control_flows=function(C,Q){var ce="",ae=null;if(!this._options.templating.includes("angular"))return ae;if(C==="@"){if(ce=this.__patterns.angular_control_flow_start.read(),ce==="")return ae;for(var Se=ce.endsWith("(")?1:0,Ne=0;!(ce.endsWith("{")&&Se===Ne);){var Te=this._input.next();if(Te===null)break;Te==="("?Se++:Te===")"&&Ne++,ce+=Te}ae=this._create_token(L.CONTROL_FLOW_OPEN,ce)}else C==="}"&&Q&&Q.type===L.CONTROL_FLOW_OPEN&&(ce=this._input.next(),ae=this._create_token(L.CONTROL_FLOW_CLOSE,ce));return ae},D.prototype._read_close=function(C,Q){var ce=null,ae=null;return Q&&Q.type===L.TAG_OPEN&&(Q.text[0]==="<"&&(C===">"||C==="/"&&this._input.peek(1)===">")?(ce=this._input.next(),C==="/"&&(ce+=this._input.next()),ae=this._create_token(L.TAG_CLOSE,ce)):Q.text[0]==="{"&&C==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),ae=this._create_token(L.TAG_CLOSE,"}}"))),ae},D.prototype._read_attribute=function(C,Q,ce){var ae=null,Se="";if(ce&&ce.text[0]==="<")if(C==="=")ae=this._create_token(L.EQUALS,this._input.next());else if(C==='"'||C==="'"){var Ne=this._input.next();C==='"'?Ne+=this.__patterns.double_quote.read():Ne+=this.__patterns.single_quote.read(),ae=this._create_token(L.VALUE,Ne)}else Se=this.__patterns.attribute.read(),Se&&(Q.type===L.EQUALS?ae=this._create_token(L.VALUE,Se):ae=this._create_token(L.ATTRIBUTE,Se));return ae},D.prototype._is_content_unformatted=function(C){return this._options.void_elements.indexOf(C)===-1&&(this._options.content_unformatted.indexOf(C)!==-1||this._options.unformatted.indexOf(C)!==-1)},D.prototype._read_raw_content=function(C,Q,ce){var ae="";if(ce&&ce.text[0]==="{")ae=this.__patterns.handlebars_raw_close.read();else if(Q.type===L.TAG_CLOSE&&Q.opened.text[0]==="<"&&Q.text[0]!=="/"){var Se=Q.opened.text.substr(1).toLowerCase();this._is_content_unformatted(Se)&&(ae=this._input.readUntil(new RegExp("</"+Se+"[\\n\\r\\t ]*?>","ig")))}return ae?this._create_token(L.TEXT,ae):null},D.prototype._read_script_and_style=function(C,Q){if(Q.type===L.TAG_CLOSE&&Q.opened.text[0]==="<"&&Q.text[0]!=="/"){var ce=Q.opened.text.substr(1).toLowerCase();if(ce==="script"||ce==="style"){var ae=this._read_comment_or_cdata(C);if(ae)return ae.type=L.TEXT,ae;var Se=this._input.readUntil(new RegExp("</"+ce+"[\\n\\r\\t ]*?>","ig"));if(Se)return this._create_token(L.TEXT,Se)}}return null},D.prototype._read_content_word=function(C,Q){var ce="";return this._options.unformatted_content_delimiter&&C===this._options.unformatted_content_delimiter[0]&&(ce=this.__patterns.unformatted_content_delimiter.read()),ce||(ce=Q&&Q.type===L.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),ce?this._create_token(L.TEXT,ce):null},P.exports.Tokenizer=D,P.exports.TOKEN=L}],ne={};function l(P){var m=ne[P];if(m!==void 0)return m.exports;var _=ne[P]={exports:{}};return se[P](_,_.exports,l),_.exports}var K=l(18);me=K})();var ue=me;if(1)x=[S,S(58553),S(87804)],de=function(se){var ne=S(58553),l=S(87804);return{html_beautify:function(K,P){return ue(K,P,ne.js_beautify,l.css_beautify)}}}.apply(He,x),de!==void 0&&(Ct.exports=de);else var G,p})()},58553:function(Ct,He){var S,x;(function(){var de;(function(){"use strict";var ue=[function(ne,l,K){var P=K(1).Beautifier,m=K(5).Options;function _(E,w){var F=new P(E,w);return F.beautify()}ne.exports=_,ne.exports.defaultOptions=function(){return new m}},function(ne,l,K){var P=K(2).Output,m=K(3).Token,_=K(4),E=K(5).Options,w=K(7).Tokenizer,F=K(7).line_starters,k=K(7).positionable_operators,N=K(7).TOKEN;function L(y,V){return V.indexOf(y)!==-1}function O(y){return y.replace(/^\s+/g,"")}function D(y){for(var V={},he=0;he<y.length;he++)V[y[he].replace(/-/g,"_")]=y[he];return V}function C(y,V){return y&&y.type===N.RESERVED&&y.text===V}function Q(y,V){return y&&y.type===N.RESERVED&&L(y.text,V)}var ce=["case","return","do","if","throw","else","await","break","continue","async"],ae=["before-newline","after-newline","preserve-newline"],Se=D(ae),Ne=[Se.before_newline,Se.preserve_newline],Te={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function je(y,V){V.multiline_frame||V.mode===Te.ForInitializer||V.mode===Te.Conditional||y.remove_indent(V.start_line_index)}function ie(y){y=y.replace(_.allLineBreaks,`
|
|
`);for(var V=[],he=y.indexOf(`
|
|
`);he!==-1;)V.push(y.substring(0,he)),y=y.substring(he+1),he=y.indexOf(`
|
|
`);return y.length&&V.push(y),V}function M(y){return y===Te.ArrayLiteral}function z(y){return L(y,[Te.Expression,Te.ForInitializer,Te.Conditional])}function H(y,V){for(var he=0;he<y.length;he++){var be=y[he].trim();if(be.charAt(0)!==V)return!1}return!0}function Z(y,V){for(var he=0,be=y.length,Pe;he<be;he++)if(Pe=y[he],Pe&&Pe.indexOf(V)!==0)return!1;return!0}function Y(y,V){V=V||{},this._source_text=y||"",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 E(V)}Y.prototype.create_flags=function(y,V){var he=0;y&&(he=y.indentation_level,!this._output.just_added_newline()&&y.line_indent_level>he&&(he=y.line_indent_level));var be={mode:V,parent:y,last_token:y?y.last_token:new m(N.START_BLOCK,""),last_word:y?y.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:he,alignment:0,line_indent_level:y?y.line_indent_level:he,start_line_index:this._output.get_line_number(),ternary_depth:0};return be},Y.prototype._reset=function(y){var V=y.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new P(this._options,V),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(Te.BlockStatement);var he=new w(y,this._options);return this._tokens=he.tokenize(),y},Y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y,V=this._reset(this._source_text),he=this._options.eol;this._options.eol==="auto"&&(he=`
|
|
`,V&&_.lineBreak.test(V||"")&&(he=V.match(_.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 y=this._output.get_code(he),y},Y.prototype.handle_token=function(y,V){y.type===N.START_EXPR?this.handle_start_expr(y):y.type===N.END_EXPR?this.handle_end_expr(y):y.type===N.START_BLOCK?this.handle_start_block(y):y.type===N.END_BLOCK?this.handle_end_block(y):y.type===N.WORD?this.handle_word(y):y.type===N.RESERVED?this.handle_word(y):y.type===N.SEMICOLON?this.handle_semicolon(y):y.type===N.STRING?this.handle_string(y):y.type===N.EQUALS?this.handle_equals(y):y.type===N.OPERATOR?this.handle_operator(y):y.type===N.COMMA?this.handle_comma(y):y.type===N.BLOCK_COMMENT?this.handle_block_comment(y,V):y.type===N.COMMENT?this.handle_comment(y,V):y.type===N.DOT?this.handle_dot(y):y.type===N.EOF?this.handle_eof(y):y.type===N.UNKNOWN?this.handle_unknown(y,V):this.handle_unknown(y,V)},Y.prototype.handle_whitespace_and_comments=function(y,V){var he=y.newlines,be=this._options.keep_array_indentation&&M(this._flags.mode);if(y.comments_before)for(var Pe=y.comments_before.next();Pe;)this.handle_whitespace_and_comments(Pe,V),this.handle_token(Pe,V),Pe=y.comments_before.next();if(be)for(var oe=0;oe<he;oe+=1)this.print_newline(oe>0,V);else if(this._options.max_preserve_newlines&&he>this._options.max_preserve_newlines&&(he=this._options.max_preserve_newlines),this._options.preserve_newlines&&he>1){this.print_newline(!1,V);for(var Ae=1;Ae<he;Ae+=1)this.print_newline(!0,V)}};var b=["async","break","continue","return","throw","yield"];Y.prototype.allow_wrap_or_preserved_newline=function(y,V){if(V=V===void 0?!1:V,!this._output.just_added_newline()){var he=this._options.preserve_newlines&&y.newlines||V,be=L(this._flags.last_token.text,k)||L(y.text,k);if(be){var Pe=L(this._flags.last_token.text,k)&&L(this._options.operator_position,Ne)||L(y.text,k);he=he&&Pe}if(he)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(Q(this._flags.last_token,b))return;this._output.set_wrap_point()}}},Y.prototype.print_newline=function(y,V){if(!V&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==N.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var he=this._tokens.peek();this._flags.mode===Te.Statement&&!(this._flags.if_block&&C(he,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(y)&&(this._flags.multiline_frame=!0)},Y.prototype.print_token_line_indentation=function(y){this._output.just_added_newline()&&(this._options.keep_array_indentation&&y.newlines&&(y.text==="["||M(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(y.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))},Y.prototype.print_token=function(y){if(this._output.raw){this._output.add_raw_token(y);return}if(this._options.comma_first&&y.previous&&y.previous.type===N.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var V=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(V),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(y),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(y),this._output.non_breaking_space=!0,this._output.add_token(y.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},Y.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Y.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))},Y.prototype.set_mode=function(y){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,y),this._flags=this.create_flags(this._previous_flags,y),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Y.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===Te.Statement&&je(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Y.prototype.start_of_object_property=function(){return this._flags.parent.mode===Te.ObjectLiteral&&this._flags.mode===Te.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||Q(this._flags.last_token,["get","set"]))},Y.prototype.start_of_statement=function(y){var V=!1;return V=V||Q(this._flags.last_token,["var","let","const"])&&y.type===N.WORD,V=V||C(this._flags.last_token,"do"),V=V||!(this._flags.parent.mode===Te.ObjectLiteral&&this._flags.mode===Te.Statement)&&Q(this._flags.last_token,b)&&!y.newlines,V=V||C(this._flags.last_token,"else")&&!(C(y,"if")&&!y.comments_before),V=V||this._flags.last_token.type===N.END_EXPR&&(this._previous_flags.mode===Te.ForInitializer||this._previous_flags.mode===Te.Conditional),V=V||this._flags.last_token.type===N.WORD&&this._flags.mode===Te.BlockStatement&&!this._flags.in_case&&!(y.text==="--"||y.text==="++")&&this._last_last_text!=="function"&&y.type!==N.WORD&&y.type!==N.RESERVED,V=V||this._flags.mode===Te.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||Q(this._flags.last_token,["get","set"])),V?(this.set_mode(Te.Statement),this.indent(),this.handle_whitespace_and_comments(y,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y,Q(y,["do","for","if","while"])),!0):!1},Y.prototype.handle_start_expr=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y);var V=Te.Expression;if(y.text==="["){if(this._flags.last_token.type===N.WORD||this._flags.last_token.text===")"){Q(this._flags.last_token,F)&&(this._output.space_before_token=!0),this.print_token(y),this.set_mode(V),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}V=Te.ArrayLiteral,M(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,[N.START_EXPR,N.END_EXPR,N.WORD,N.OPERATOR,N.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===N.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,V=Te.ForInitializer):L(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,V=Te.Conditional):L(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&y.whitespace_before===""?this._output.space_before_token=!1:(L(this._flags.last_token.text,F)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===N.EQUALS||this._flags.last_token.type===N.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y);else if(this._flags.last_token.type===N.WORD){this._output.space_before_token=!1;var he=this._tokens.peek(-3);if(this._options.space_after_named_function&&he){var be=this._tokens.peek(-4);Q(he,["async","function"])||he.text==="*"&&Q(be,["async","function"])?this._output.space_before_token=!0:this._flags.mode===Te.ObjectLiteral?(he.text==="{"||he.text===","||he.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(y);(this._flags.last_token.type===N.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===Te.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===N.START_BLOCK?this.print_newline():(this._flags.last_token.type===N.END_EXPR||this._flags.last_token.type===N.START_EXPR||this._flags.last_token.type===N.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===N.COMMA)&&this.allow_wrap_or_preserved_newline(y,y.newlines),this.print_token(y),this.set_mode(V),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Y.prototype.handle_end_expr=function(y){for(;this._flags.mode===Te.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(y,y.text==="]"&&M(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===N.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(y),this.restore_mode(),je(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===Te.Conditional&&(this._previous_flags.mode=Te.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},Y.prototype.handle_start_block=function(y){this.handle_whitespace_and_comments(y);var V=this._tokens.peek(),he=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===N.END_EXPR?(this.set_mode(Te.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(Te.BlockStatement):he&&(L(he.text,[":",","])&&L(V.type,[N.STRING,N.WORD,N.RESERVED])||L(V.text,["get","set","..."])&&L(he.type,[N.WORD,N.RESERVED]))?L(this._last_last_text,["class","interface"])&&!L(he.text,[":",","])?this.set_mode(Te.BlockStatement):this.set_mode(Te.ObjectLiteral):this._flags.last_token.type===N.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(Te.BlockStatement):L(this._flags.last_token.type,[N.EQUALS,N.START_EXPR,N.COMMA,N.OPERATOR])||Q(this._flags.last_token,["return","throw","import","default"])?this.set_mode(Te.ObjectLiteral):this.set_mode(Te.BlockStatement),this._flags.last_token&&Q(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var be=!V.comments_before&&V.text==="}",Pe=be&&this._flags.last_word==="function"&&this._flags.last_token.type===N.END_EXPR;if(this._options.brace_preserve_inline){var oe=0,Ae=null;this._flags.inline_frame=!0;do if(oe+=1,Ae=this._tokens.peek(oe-1),Ae.newlines){this._flags.inline_frame=!1;break}while(Ae.type!==N.EOF&&!(Ae.type===N.END_BLOCK&&Ae.opened===y))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==N.OPERATOR&&(Pe||this._flags.last_token.type===N.EQUALS||Q(this._flags.last_token,ce)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(M(this._previous_flags.mode)&&(this._flags.last_token.type===N.START_EXPR||this._flags.last_token.type===N.COMMA)&&((this._flags.last_token.type===N.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===N.COMMA||this._flags.last_token.type===N.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(y),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==N.OPERATOR&&this._flags.last_token.type!==N.START_EXPR&&(L(this._flags.last_token.type,[N.START_BLOCK,N.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(y),this.indent(),!be&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},Y.prototype.handle_end_block=function(y){for(this.handle_whitespace_and_comments(y);this._flags.mode===Te.Statement;)this.restore_mode();var V=this._flags.last_token.type===N.START_BLOCK;this._flags.inline_frame&&!V?this._output.space_before_token=!0:this._options.brace_style==="expand"?V||this.print_newline():V||(M(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(y)},Y.prototype.handle_word=function(y){if(y.type===N.RESERVED){if(L(y.text,["set","get"])&&this._flags.mode!==Te.ObjectLiteral)y.type=N.WORD;else if(y.text==="import"&&L(this._tokens.peek().text,["(","."]))y.type=N.WORD;else if(L(y.text,["as","from"])&&!this._flags.import_block)y.type=N.WORD;else if(this._flags.mode===Te.ObjectLiteral){var V=this._tokens.peek();V.text===":"&&(y.type=N.WORD)}}if(this.start_of_statement(y)?Q(this._flags.last_token,["var","let","const"])&&y.type===N.WORD&&(this._flags.declaration_statement=!0):y.newlines&&!z(this._flags.mode)&&(this._flags.last_token.type!==N.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==N.EQUALS&&(this._options.preserve_newlines||!Q(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(y),this.print_newline()):this.handle_whitespace_and_comments(y),this._flags.do_block&&!this._flags.do_while)if(C(y,"while")){this._output.space_before_token=!0,this.print_token(y),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&&C(y,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===Te.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&Q(y,["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(y),this._flags.in_case=!0;return}if((this._flags.last_token.type===N.COMMA||this._flags.last_token.type===N.START_EXPR||this._flags.last_token.type===N.EQUALS||this._flags.last_token.type===N.OPERATOR)&&!this.start_of_object_property()&&!(L(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===Te.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(y),C(y,"function")){(L(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(L(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===N.OPERATOR))&&!this._output.just_added_blankline()&&!y.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===N.RESERVED||this._flags.last_token.type===N.WORD?Q(this._flags.last_token,["get","set","new","export"])||Q(this._flags.last_token,b)?this._output.space_before_token=!0:C(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===N.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(z(this._flags.mode)||M(this._flags.mode))||this.print_newline(),this.print_token(y),this._flags.last_word=y.text;return}var he="NONE";if(this._flags.last_token.type===N.END_BLOCK?this._previous_flags.inline_frame?he="SPACE":Q(y,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines?he="NEWLINE":(he="SPACE",this._output.space_before_token=!0):he="NEWLINE":this._flags.last_token.type===N.SEMICOLON&&this._flags.mode===Te.BlockStatement?he="NEWLINE":this._flags.last_token.type===N.SEMICOLON&&z(this._flags.mode)?he="SPACE":this._flags.last_token.type===N.STRING?he="NEWLINE":this._flags.last_token.type===N.RESERVED||this._flags.last_token.type===N.WORD||this._flags.last_token.text==="*"&&(L(this._last_last_text,["function","yield"])||this._flags.mode===Te.ObjectLiteral&&L(this._last_last_text,["{",","]))?he="SPACE":this._flags.last_token.type===N.START_BLOCK?this._flags.inline_frame?he="SPACE":he="NEWLINE":this._flags.last_token.type===N.END_EXPR&&(this._output.space_before_token=!0,he="NEWLINE"),Q(y,F)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?he="SPACE":he="NEWLINE"),Q(y,["else","catch","finally"]))if((!(this._flags.last_token.type===N.END_BLOCK&&this._previous_flags.mode===Te.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.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 he==="NEWLINE"?Q(this._flags.last_token,ce)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&Q(y,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==N.END_EXPR?(this._flags.last_token.type!==N.START_EXPR||!Q(y,["var","let","const"]))&&this._flags.last_token.text!==":"&&(C(y,"if")&&C(y.previous,"else")?this._output.space_before_token=!0:this.print_newline()):Q(y,F)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&M(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():he==="SPACE"&&(this._output.space_before_token=!0);y.previous&&(y.previous.type===N.WORD||y.previous.type===N.RESERVED)&&(this._output.space_before_token=!0),this.print_token(y),this._flags.last_word=y.text,y.type===N.RESERVED&&(y.text==="do"?this._flags.do_block=!0:y.text==="if"?this._flags.if_block=!0:y.text==="import"?this._flags.import_block=!0:this._flags.import_block&&C(y,"from")&&(this._flags.import_block=!1))},Y.prototype.handle_semicolon=function(y){this.start_of_statement(y)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(y);for(var V=this._tokens.peek();this._flags.mode===Te.Statement&&!(this._flags.if_block&&C(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(y)},Y.prototype.handle_string=function(y){y.text.startsWith("`")&&y.newlines===0&&y.whitespace_before===""&&(y.previous.text===")"||this._flags.last_token.type===N.WORD)||(this.start_of_statement(y)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(y),this._flags.last_token.type===N.RESERVED||this._flags.last_token.type===N.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===N.COMMA||this._flags.last_token.type===N.START_EXPR||this._flags.last_token.type===N.EQUALS||this._flags.last_token.type===N.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y):y.text.startsWith("`")&&this._flags.last_token.type===N.END_EXPR&&(y.previous.text==="]"||y.previous.text===")")&&y.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(y)},Y.prototype.handle_equals=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0},Y.prototype.handle_comma=function(y){this.handle_whitespace_and_comments(y,!0),this.print_token(y),this._output.space_before_token=!0,this._flags.declaration_statement?(z(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(y)):this._flags.mode===Te.ObjectLiteral||this._flags.mode===Te.Statement&&this._flags.parent.mode===Te.ObjectLiteral?(this._flags.mode===Te.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(y)},Y.prototype.handle_operator=function(y){var V=y.text==="*"&&(Q(this._flags.last_token,["function","yield"])||L(this._flags.last_token.type,[N.START_BLOCK,N.COMMA,N.END_BLOCK,N.SEMICOLON])),he=L(y.text,["-","+"])&&(L(this._flags.last_token.type,[N.START_BLOCK,N.START_EXPR,N.EQUALS,N.OPERATOR])||L(this._flags.last_token.text,F)||this._flags.last_token.text===",");if(!this.start_of_statement(y)){var be=!V;this.handle_whitespace_and_comments(y,be)}if(y.text==="*"&&this._flags.last_token.type===N.DOT){this.print_token(y);return}if(y.text==="::"){this.print_token(y);return}if(L(y.text,["-","+"])&&this.start_of_object_property()){this.print_token(y);return}if(this._flags.last_token.type===N.OPERATOR&&L(this._options.operator_position,Ne)&&this.allow_wrap_or_preserved_newline(y),y.text===":"&&this._flags.in_case){this.print_token(y),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==N.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 Pe=!0,oe=!0,Ae=!1;if(y.text===":"?this._flags.ternary_depth===0?Pe=!1:(this._flags.ternary_depth-=1,Ae=!0):y.text==="?"&&(this._flags.ternary_depth+=1),!he&&!V&&this._options.preserve_newlines&&L(y.text,k)){var ke=y.text===":",et=ke&&Ae,Oe=ke&&!Ae;switch(this._options.operator_position){case Se.before_newline:this._output.space_before_token=!Oe,this.print_token(y),(!ke||et)&&this.allow_wrap_or_preserved_newline(y),this._output.space_before_token=!0;return;case Se.after_newline:this._output.space_before_token=!0,!ke||et?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(y):this._output.space_before_token=!1,this.print_token(y),this._output.space_before_token=!0;return;case Se.preserve_newline:Oe||this.allow_wrap_or_preserved_newline(y),Pe=!(this._output.just_added_newline()||Oe),this._output.space_before_token=Pe,this.print_token(y),this._output.space_before_token=!0;return}}if(V){this.allow_wrap_or_preserved_newline(y),Pe=!1;var qe=this._tokens.peek();oe=qe&&L(qe.type,[N.WORD,N.RESERVED])}else if(y.text==="...")this.allow_wrap_or_preserved_newline(y),Pe=this._flags.last_token.type===N.START_BLOCK,oe=!1;else if(L(y.text,["--","++","!","~"])||he){if((this._flags.last_token.type===N.COMMA||this._flags.last_token.type===N.START_EXPR)&&this.allow_wrap_or_preserved_newline(y),Pe=!1,oe=!1,y.newlines&&(y.text==="--"||y.text==="++"||y.text==="~")){var xe=Q(this._flags.last_token,ce)&&y.newlines;xe&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(xe,!0)}this._flags.last_token.text===";"&&z(this._flags.mode)&&(Pe=!0),this._flags.last_token.type===N.RESERVED?Pe=!0:this._flags.last_token.type===N.END_EXPR?Pe=!(this._flags.last_token.text==="]"&&(y.text==="--"||y.text==="++")):this._flags.last_token.type===N.OPERATOR&&(Pe=L(y.text,["--","-","++","+"])&&L(this._flags.last_token.text,["--","-","++","+"]),L(y.text,["+","-"])&&L(this._flags.last_token.text,["--","++"])&&(oe=!0)),(this._flags.mode===Te.BlockStatement&&!this._flags.inline_frame||this._flags.mode===Te.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Pe,this.print_token(y),this._output.space_before_token=oe},Y.prototype.handle_block_comment=function(y,V){if(this._output.raw){this._output.add_raw_token(y),y.directives&&y.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(y.directives){this.print_newline(!1,V),this.print_token(y),y.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!_.newline.test(y.text)&&!y.newlines){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0;return}else this.print_block_commment(y,V)},Y.prototype.print_block_commment=function(y,V){var he=ie(y.text),be,Pe=!1,oe=!1,Ae=y.whitespace_before,ke=Ae.length;if(this.print_newline(!1,V),this.print_token_line_indentation(y),this._output.add_token(he[0]),this.print_newline(!1,V),he.length>1){for(he=he.slice(1),Pe=H(he,"*"),oe=Z(he,Ae),Pe&&(this._flags.alignment=1),be=0;be<he.length;be++)Pe?(this.print_token_line_indentation(y),this._output.add_token(O(he[be]))):oe&&he[be]?(this.print_token_line_indentation(y),this._output.add_token(he[be].substring(ke))):(this._output.current_line.set_indent(-1),this._output.add_token(he[be])),this.print_newline(!1,V);this._flags.alignment=0}},Y.prototype.handle_comment=function(y,V){y.newlines?this.print_newline(!1,V):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(y),this.print_newline(!1,V)},Y.prototype.handle_dot=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),Q(this._flags.last_token,ce)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(y,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(y)},Y.prototype.handle_unknown=function(y,V){this.print_token(y),y.text[y.text.length-1]===`
|
|
`&&this.print_newline(!1,V)},Y.prototype.handle_eof=function(y){for(;this._flags.mode===Te.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y)},ne.exports.Beautifier=Y},function(ne){function l(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}l.prototype.clone_empty=function(){var m=new l(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},l.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},l.prototype.has_match=function(m){for(var _=this.__items.length-1;_>=0;_--)if(this.__items[_].match(m))return!0;return!1},l.prototype.set_indent=function(m,_){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=_||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},l.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},l.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},l.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},l.prototype.is_empty=function(){return this.__items.length===0},l.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},l.prototype.push=function(m){this.__items.push(m);var _=m.lastIndexOf(`
|
|
`);_!==-1?this.__character_count=m.length-_:this.__character_count+=m.length},l.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},l.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},l.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},l.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},l.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function K(m,_){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),_=_||"",m.indent_level>0&&(_=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=_,this.__base_string_length=_.length}K.prototype.get_indent_size=function(m,_){var E=this.__base_string_length;return _=_||0,m<0&&(E=0),E+=m*this.__indent_size,E+=_,E},K.prototype.get_indent_string=function(m,_){var E=this.__base_string;return _=_||0,m<0&&(m=0,E=""),_+=m*this.__indent_size,this.__ensure_cache(_),E+=this.__cache[_],E},K.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},K.prototype.__add_column=function(){var m=this.__cache.length,_=0,E="";this.__indent_size&&m>=this.__indent_size&&(_=Math.floor(m/this.__indent_size),m-=_*this.__indent_size,E=new Array(_+1).join(this.__indent_string)),m&&(E+=new Array(m+1).join(" ")),this.__cache.push(E)};function P(m,_){this.__indent_cache=new K(m,_),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new l(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}P.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},P.prototype.get_line_number=function(){return this.__lines.length},P.prototype.get_indent_string=function(m,_){return this.__indent_cache.get_indent_string(m,_)},P.prototype.get_indent_size=function(m,_){return this.__indent_cache.get_indent_size(m,_)},P.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},P.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},P.prototype.get_code=function(m){this.trim(!0);var _=this.current_line.pop();_&&(_[_.length-1]===`
|
|
`&&(_=_.replace(/\n+$/g,"")),this.current_line.push(_)),this._end_with_newline&&this.__add_outputline();var E=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(E=E.replace(/[\n]/g,m)),E},P.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},P.prototype.set_indent=function(m,_){return m=m||0,_=_||0,this.next_line.set_indent(m,_),this.__lines.length>1?(this.current_line.set_indent(m,_),!0):(this.current_line.set_indent(),!1)},P.prototype.add_raw_token=function(m){for(var _=0;_<m.newlines;_++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},P.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},P.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(" "))},P.prototype.remove_indent=function(m){for(var _=this.__lines.length;m<_;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},P.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},P.prototype.just_added_newline=function(){return this.current_line.is_empty()},P.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},P.prototype.ensure_empty_line_above=function(m,_){for(var E=this.__lines.length-2;E>=0;){var w=this.__lines[E];if(w.is_empty())break;if(w.item(0).indexOf(m)!==0&&w.item(-1)!==_){this.__lines.splice(E+1,0,new l(this)),this.previous_line=this.__lines[this.__lines.length-2];break}E--}},ne.exports.Output=P},function(ne){function l(K,P,m,_){this.type=K,this.text=P,this.comments_before=null,this.newlines=m||0,this.whitespace_before=_||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}ne.exports.Token=l},function(ne,l){var K="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",P="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",_="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",E="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",w="(?:"+E+"|["+K+m+"])",F="(?:"+E+"|["+P+m+_+"])*";l.identifier=new RegExp(w+F,"g"),l.identifierStart=new RegExp(w),l.identifierMatch=new RegExp("(?:"+E+"|["+P+m+_+"])+");var k=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;l.newline=/[\n\r\u2028\u2029]/,l.lineBreak=new RegExp(`\r
|
|
|`+l.newline.source),l.allLineBreaks=new RegExp(l.lineBreak.source,"g")},function(ne,l,K){var P=K(6).Options,m=["before-newline","after-newline","preserve-newline"];function _(E){P.call(this,E,"js");var w=this.raw_options.brace_style||null;w==="expand-strict"?this.raw_options.brace_style="expand":w==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var F=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var k=0;k<F.length;k++)F[k]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=F[k];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",m),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}_.prototype=new P,ne.exports.Options=_},function(ne){function l(m,_){this.raw_options=K(m,_),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}l.prototype._get_array=function(m,_){var E=this.raw_options[m],w=_||[];return typeof E=="object"?E!==null&&typeof E.concat=="function"&&(w=E.concat()):typeof E=="string"&&(w=E.split(/[^a-zA-Z0-9_\/\-]+/)),w},l.prototype._get_boolean=function(m,_){var E=this.raw_options[m],w=E===void 0?!!_:!!E;return w},l.prototype._get_characters=function(m,_){var E=this.raw_options[m],w=_||"";return typeof E=="string"&&(w=E.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),w},l.prototype._get_number=function(m,_){var E=this.raw_options[m];_=parseInt(_,10),isNaN(_)&&(_=0);var w=parseInt(E,10);return isNaN(w)&&(w=_),w},l.prototype._get_selection=function(m,_,E){var w=this._get_selection_list(m,_,E);if(w.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+_+`
|
|
You passed in: '`+this.raw_options[m]+"'");return w[0]},l.prototype._get_selection_list=function(m,_,E){if(!_||_.length===0)throw new Error("Selection list cannot be empty.");if(E=E||[_[0]],!this._is_valid_selection(E,_))throw new Error("Invalid Default Value!");var w=this._get_array(m,E);if(!this._is_valid_selection(w,_))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+_+`
|
|
You passed in: '`+this.raw_options[m]+"'");return w},l.prototype._is_valid_selection=function(m,_){return m.length&&_.length&&!m.some(function(E){return _.indexOf(E)===-1})};function K(m,_){var E={};m=P(m);var w;for(w in m)w!==_&&(E[w]=m[w]);if(_&&m[_])for(w in m[_])E[w]=m[_][w];return E}function P(m){var _={},E;for(E in m){var w=E.replace(/-/g,"_");_[w]=m[E]}return _}ne.exports.Options=l,ne.exports.normalizeOpts=P,ne.exports.mergeOpts=K},function(ne,l,K){var P=K(8).InputScanner,m=K(9).Tokenizer,_=K(9).TOKEN,E=K(13).Directives,w=K(4),F=K(12).Pattern,k=K(14).TemplatablePattern;function N(H,Z){return Z.indexOf(H)!==-1}var L={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:_.START,RAW:_.RAW,EOF:_.EOF},O=new E(/\/\*/,/\*\//),D=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,C=/[0-9]/,Q=/[^\d\.]/,ce=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),ae=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";ae=ae.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),ae="\\?\\.(?!\\d) "+ae,ae=ae.replace(/ /g,"|");var Se=new RegExp(ae),Ne="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),Te=Ne.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),je=new RegExp("^(?:"+Te.join("|")+")$"),ie,M=function(H,Z){m.call(this,H,Z),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var Y=new F(this._input),b=new k(this._input).read_options(this._options);this.__patterns={template:b,identifier:b.starting_with(w.identifier).matching(w.identifierMatch),number:Y.matching(D),punct:Y.matching(Se),comment:Y.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:Y.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:Y.matching(/<!--/),html_comment_end:Y.matching(/-->/),include:Y.starting_with(/#include/).until_after(w.lineBreak),shebang:Y.starting_with(/#!/).until_after(w.lineBreak),xml:Y.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:b.until(/['\\\n\r\u2028\u2029]/),double_quote:b.until(/["\\\n\r\u2028\u2029]/),template_text:b.until(/[`\\$]/),template_expression:b.until(/[`}\\]/)}};M.prototype=new m,M.prototype._is_comment=function(H){return H.type===L.COMMENT||H.type===L.BLOCK_COMMENT||H.type===L.UNKNOWN},M.prototype._is_opening=function(H){return H.type===L.START_BLOCK||H.type===L.START_EXPR},M.prototype._is_closing=function(H,Z){return(H.type===L.END_BLOCK||H.type===L.END_EXPR)&&Z&&(H.text==="]"&&Z.text==="["||H.text===")"&&Z.text==="("||H.text==="}"&&Z.text==="{")},M.prototype._reset=function(){ie=!1},M.prototype._get_next_token=function(H,Z){var Y=null;this._readWhitespace();var b=this._input.peek();return b===null?this._create_token(L.EOF,""):(Y=Y||this._read_non_javascript(b),Y=Y||this._read_string(b),Y=Y||this._read_pair(b,this._input.peek(1)),Y=Y||this._read_word(H),Y=Y||this._read_singles(b),Y=Y||this._read_comment(b),Y=Y||this._read_regexp(b,H),Y=Y||this._read_xml(b,H),Y=Y||this._read_punctuation(),Y=Y||this._create_token(L.UNKNOWN,this._input.next()),Y)},M.prototype._read_word=function(H){var Z;if(Z=this.__patterns.identifier.read(),Z!=="")return Z=Z.replace(w.allLineBreaks,`
|
|
`),!(H.type===L.DOT||H.type===L.RESERVED&&(H.text==="set"||H.text==="get"))&&je.test(Z)?(Z==="in"||Z==="of")&&(H.type===L.WORD||H.type===L.STRING)?this._create_token(L.OPERATOR,Z):this._create_token(L.RESERVED,Z):this._create_token(L.WORD,Z);if(Z=this.__patterns.number.read(),Z!=="")return this._create_token(L.WORD,Z)},M.prototype._read_singles=function(H){var Z=null;return H==="("||H==="["?Z=this._create_token(L.START_EXPR,H):H===")"||H==="]"?Z=this._create_token(L.END_EXPR,H):H==="{"?Z=this._create_token(L.START_BLOCK,H):H==="}"?Z=this._create_token(L.END_BLOCK,H):H===";"?Z=this._create_token(L.SEMICOLON,H):H==="."&&Q.test(this._input.peek(1))?Z=this._create_token(L.DOT,H):H===","&&(Z=this._create_token(L.COMMA,H)),Z&&this._input.next(),Z},M.prototype._read_pair=function(H,Z){var Y=null;return H==="#"&&Z==="{"&&(Y=this._create_token(L.START_BLOCK,H+Z)),Y&&(this._input.next(),this._input.next()),Y},M.prototype._read_punctuation=function(){var H=this.__patterns.punct.read();if(H!=="")return H==="="?this._create_token(L.EQUALS,H):H==="?."?this._create_token(L.DOT,H):this._create_token(L.OPERATOR,H)},M.prototype._read_non_javascript=function(H){var Z="";if(H==="#"){if(this._is_first_token()&&(Z=this.__patterns.shebang.read(),Z))return this._create_token(L.UNKNOWN,Z.trim()+`
|
|
`);if(Z=this.__patterns.include.read(),Z)return this._create_token(L.UNKNOWN,Z.trim()+`
|
|
`);H=this._input.next();var Y="#";if(this._input.hasNext()&&this._input.testChar(C)){do H=this._input.next(),Y+=H;while(this._input.hasNext()&&H!=="#"&&H!=="=");return H==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(Y+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(Y+="{}",this._input.next(),this._input.next())),this._create_token(L.WORD,Y)}this._input.back()}else if(H==="<"&&this._is_first_token()){if(Z=this.__patterns.html_comment_start.read(),Z){for(;this._input.hasNext()&&!this._input.testChar(w.newline);)Z+=this._input.next();return ie=!0,this._create_token(L.COMMENT,Z)}}else if(ie&&H==="-"&&(Z=this.__patterns.html_comment_end.read(),Z))return ie=!1,this._create_token(L.COMMENT,Z);return null},M.prototype._read_comment=function(H){var Z=null;if(H==="/"){var Y="";if(this._input.peek(1)==="*"){Y=this.__patterns.block_comment.read();var b=O.get_directives(Y);b&&b.ignore==="start"&&(Y+=O.readIgnored(this._input)),Y=Y.replace(w.allLineBreaks,`
|
|
`),Z=this._create_token(L.BLOCK_COMMENT,Y),Z.directives=b}else this._input.peek(1)==="/"&&(Y=this.__patterns.comment.read(),Z=this._create_token(L.COMMENT,Y))}return Z},M.prototype._read_string=function(H){if(H==="`"||H==="'"||H==='"'){var Z=this._input.next();return this.has_char_escapes=!1,H==="`"?Z+=this._read_string_recursive("`",!0,"${"):Z+=this._read_string_recursive(H),this.has_char_escapes&&this._options.unescape_strings&&(Z=z(Z)),this._input.peek()===H&&(Z+=this._input.next()),Z=Z.replace(w.allLineBreaks,`
|
|
`),this._create_token(L.STRING,Z)}return null},M.prototype._allow_regexp_or_xml=function(H){return H.type===L.RESERVED&&N(H.text,["return","case","throw","else","do","typeof","yield"])||H.type===L.END_EXPR&&H.text===")"&&H.opened.previous.type===L.RESERVED&&N(H.opened.previous.text,["if","while","for"])||N(H.type,[L.COMMENT,L.START_EXPR,L.START_BLOCK,L.START,L.END_BLOCK,L.OPERATOR,L.EQUALS,L.EOF,L.SEMICOLON,L.COMMA])},M.prototype._read_regexp=function(H,Z){if(H==="/"&&this._allow_regexp_or_xml(Z)){for(var Y=this._input.next(),b=!1,y=!1;this._input.hasNext()&&(b||y||this._input.peek()!==H)&&!this._input.testChar(w.newline);)Y+=this._input.peek(),b?b=!1:(b=this._input.peek()==="\\",this._input.peek()==="["?y=!0:this._input.peek()==="]"&&(y=!1)),this._input.next();return this._input.peek()===H&&(Y+=this._input.next(),Y+=this._input.read(w.identifier)),this._create_token(L.STRING,Y)}return null},M.prototype._read_xml=function(H,Z){if(this._options.e4x&&H==="<"&&this._allow_regexp_or_xml(Z)){var Y="",b=this.__patterns.xml.read_match();if(b){for(var y=b[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),V=y.indexOf("{")===0,he=0;b;){var be=!!b[1],Pe=b[2],oe=!!b[b.length-1]||Pe.slice(0,8)==="![CDATA[";if(!oe&&(Pe===y||V&&Pe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(be?--he:++he),Y+=b[0],he<=0)break;b=this.__patterns.xml.read_match()}return b||(Y+=this._input.match(/[\s\S]*/g)[0]),Y=Y.replace(w.allLineBreaks,`
|
|
`),this._create_token(L.STRING,Y)}}return null};function z(H){for(var Z="",Y=0,b=new P(H),y=null;b.hasNext();)if(y=b.match(/([\s]|[^\\]|\\\\)+/g),y&&(Z+=y[0]),b.peek()==="\\"){if(b.next(),b.peek()==="x")y=b.match(/x([0-9A-Fa-f]{2})/g);else if(b.peek()==="u")y=b.match(/u([0-9A-Fa-f]{4})/g),y||(y=b.match(/u\{([0-9A-Fa-f]+)\}/g));else{Z+="\\",b.hasNext()&&(Z+=b.next());continue}if(!y||(Y=parseInt(y[1],16),Y>126&&Y<=255&&y[0].indexOf("x")===0))return H;Y>=0&&Y<32||Y>1114111?Z+="\\"+y[0]:Y===34||Y===39||Y===92?Z+="\\"+String.fromCharCode(Y):Z+=String.fromCharCode(Y)}return Z}M.prototype._read_string_recursive=function(H,Z,Y){var b,y;H==="'"?y=this.__patterns.single_quote:H==='"'?y=this.__patterns.double_quote:H==="`"?y=this.__patterns.template_text:H==="}"&&(y=this.__patterns.template_expression);for(var V=y.read(),he="";this._input.hasNext();){if(he=this._input.next(),he===H||!Z&&w.newline.test(he)){this._input.back();break}else he==="\\"&&this._input.hasNext()?(b=this._input.peek(),b==="x"||b==="u"?this.has_char_escapes=!0:b==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),he+=this._input.next()):Y&&(Y==="${"&&he==="$"&&this._input.peek()==="{"&&(he+=this._input.next()),Y===he&&(H==="`"?he+=this._read_string_recursive("}",Z,"`"):he+=this._read_string_recursive("`",Z,"${"),this._input.hasNext()&&(he+=this._input.next())));he+=y.read(),V+=he}return V},ne.exports.Tokenizer=M,ne.exports.TOKEN=L,ne.exports.positionable_operators=ce.slice(),ne.exports.line_starters=Ne.slice()},function(ne){var l=RegExp.prototype.hasOwnProperty("sticky");function K(P){this.__input=P||"",this.__input_length=this.__input.length,this.__position=0}K.prototype.restart=function(){this.__position=0},K.prototype.back=function(){this.__position>0&&(this.__position-=1)},K.prototype.hasNext=function(){return this.__position<this.__input_length},K.prototype.next=function(){var P=null;return this.hasNext()&&(P=this.__input.charAt(this.__position),this.__position+=1),P},K.prototype.peek=function(P){var m=null;return P=P||0,P+=this.__position,P>=0&&P<this.__input_length&&(m=this.__input.charAt(P)),m},K.prototype.__match=function(P,m){P.lastIndex=m;var _=P.exec(this.__input);return _&&!(l&&P.sticky)&&_.index!==m&&(_=null),_},K.prototype.test=function(P,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(P,m):!1},K.prototype.testChar=function(P,m){var _=this.peek(m);return P.lastIndex=0,_!==null&&P.test(_)},K.prototype.match=function(P){var m=this.__match(P,this.__position);return m?this.__position+=m[0].length:m=null,m},K.prototype.read=function(P,m,_){var E="",w;return P&&(w=this.match(P),w&&(E+=w[0])),m&&(w||!P)&&(E+=this.readUntil(m,_)),E},K.prototype.readUntil=function(P,m){var _="",E=this.__position;P.lastIndex=this.__position;var w=P.exec(this.__input);return w?(E=w.index,m&&(E+=w[0].length)):E=this.__input_length,_=this.__input.substring(this.__position,E),this.__position=E,_},K.prototype.readUntilAfter=function(P){return this.readUntil(P,!0)},K.prototype.get_regexp=function(P,m){var _=null,E="g";return m&&l&&(E="y"),typeof P=="string"&&P!==""?_=new RegExp(P,E):P&&(_=new RegExp(P.source,E)),_},K.prototype.get_literal_regexp=function(P){return RegExp(P.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},K.prototype.peekUntilAfter=function(P){var m=this.__position,_=this.readUntilAfter(P);return this.__position=m,_},K.prototype.lookBack=function(P){var m=this.__position-1;return m>=P.length&&this.__input.substring(m-P.length,m).toLowerCase()===P},ne.exports.InputScanner=K},function(ne,l,K){var P=K(8).InputScanner,m=K(3).Token,_=K(10).TokenStream,E=K(11).WhitespacePattern,w={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},F=function(k,N){this._input=new P(k),this._options=N||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new E(this._input)};F.prototype.tokenize=function(){this._input.restart(),this.__tokens=new _,this._reset();for(var k,N=new m(w.START,""),L=null,O=[],D=new _;N.type!==w.EOF;){for(k=this._get_next_token(N,L);this._is_comment(k);)D.add(k),k=this._get_next_token(N,L);D.isEmpty()||(k.comments_before=D,D=new _),k.parent=L,this._is_opening(k)?(O.push(L),L=k):L&&this._is_closing(k,L)&&(k.opened=L,L.closed=k,L=O.pop(),k.parent=L),k.previous=N,N.next=k,this.__tokens.add(k),N=k}return this.__tokens},F.prototype._is_first_token=function(){return this.__tokens.isEmpty()},F.prototype._reset=function(){},F.prototype._get_next_token=function(k,N){this._readWhitespace();var L=this._input.read(/.+/g);return L?this._create_token(w.RAW,L):this._create_token(w.EOF,"")},F.prototype._is_comment=function(k){return!1},F.prototype._is_opening=function(k){return!1},F.prototype._is_closing=function(k,N){return!1},F.prototype._create_token=function(k,N){var L=new m(k,N,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return L},F.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},ne.exports.Tokenizer=F,ne.exports.TOKEN=w},function(ne){function l(K){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=K}l.prototype.restart=function(){this.__position=0},l.prototype.isEmpty=function(){return this.__tokens_length===0},l.prototype.hasNext=function(){return this.__position<this.__tokens_length},l.prototype.next=function(){var K=null;return this.hasNext()&&(K=this.__tokens[this.__position],this.__position+=1),K},l.prototype.peek=function(K){var P=null;return K=K||0,K+=this.__position,K>=0&&K<this.__tokens_length&&(P=this.__tokens[K]),P},l.prototype.add=function(K){this.__parent_token&&(K.parent=this.__parent_token),this.__tokens.push(K),this.__tokens_length+=1},ne.exports.TokenStream=l},function(ne,l,K){var P=K(12).Pattern;function m(_,E){P.call(this,_,E),E?this._line_regexp=this._input.get_regexp(E._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new P,m.prototype.__set_whitespace_patterns=function(_,E){_+="\\t ",E+="\\n\\r",this._match_pattern=this._input.get_regexp("["+_+E+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+E+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var _=this._input.read(this._match_pattern);if(_===" ")this.whitespace_before_token=" ";else if(_){var E=this.__split(this._newline_regexp,_);this.newline_count=E.length-1,this.whitespace_before_token=E[this.newline_count]}return _},m.prototype.matching=function(_,E){var w=this._create();return w.__set_whitespace_patterns(_,E),w._update(),w},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(_,E){_.lastIndex=0;for(var w=0,F=[],k=_.exec(E);k;)F.push(E.substring(w,k.index)),w=k.index+k[0].length,k=_.exec(E);return w<E.length?F.push(E.substring(w,E.length)):F.push(""),F},ne.exports.WhitespacePattern=m},function(ne){function l(K,P){this._input=K,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,P&&(this._starting_pattern=this._input.get_regexp(P._starting_pattern,!0),this._match_pattern=this._input.get_regexp(P._match_pattern,!0),this._until_pattern=this._input.get_regexp(P._until_pattern),this._until_after=P._until_after)}l.prototype.read=function(){var K=this._input.read(this._starting_pattern);return(!this._starting_pattern||K)&&(K+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),K},l.prototype.read_match=function(){return this._input.match(this._match_pattern)},l.prototype.until_after=function(K){var P=this._create();return P._until_after=!0,P._until_pattern=this._input.get_regexp(K),P._update(),P},l.prototype.until=function(K){var P=this._create();return P._until_after=!1,P._until_pattern=this._input.get_regexp(K),P._update(),P},l.prototype.starting_with=function(K){var P=this._create();return P._starting_pattern=this._input.get_regexp(K,!0),P._update(),P},l.prototype.matching=function(K){var P=this._create();return P._match_pattern=this._input.get_regexp(K,!0),P._update(),P},l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){},ne.exports.Pattern=l},function(ne){function l(K,P){K=typeof K=="string"?K:K.source,P=typeof P=="string"?P:P.source,this.__directives_block_pattern=new RegExp(K+/ beautify( \w+[:]\w+)+ /.source+P,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(K+/\sbeautify\signore:end\s/.source+P,"g")}l.prototype.get_directives=function(K){if(!K.match(this.__directives_block_pattern))return null;var P={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(K);m;)P[m[1]]=m[2],m=this.__directive_pattern.exec(K);return P},l.prototype.readIgnored=function(K){return K.readUntilAfter(this.__directives_end_ignore_pattern)},ne.exports.Directives=l},function(ne,l,K){var P=K(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function _(E,w){P.call(this,E,w),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),w&&(this.__template_pattern=this._input.get_regexp(w.__template_pattern),this._excluded=Object.assign(this._excluded,w._excluded),this._disabled=Object.assign(this._disabled,w._disabled));var F=new P(E);this.__patterns={handlebars_comment:F.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:F.starting_with(/{{{/).until_after(/}}}/),handlebars:F.starting_with(/{{/).until_after(/}}/),php:F.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:F.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:F.starting_with(/{%/).until_after(/%}/),django_value:F.starting_with(/{{/).until_after(/}}/),django_comment:F.starting_with(/{#/).until_after(/#}/),smarty:F.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:F.starting_with(/{\*/).until_after(/\*}/),smarty_literal:F.starting_with(/{literal}/).until_after(/{\/literal}/)}}_.prototype=new P,_.prototype._create=function(){return new _(this._input,this)},_.prototype._update=function(){this.__set_templated_pattern()},_.prototype.disable=function(E){var w=this._create();return w._disabled[E]=!0,w._update(),w},_.prototype.read_options=function(E){var w=this._create();for(var F in m)w._disabled[F]=E.templating.indexOf(F)===-1;return w._update(),w},_.prototype.exclude=function(E){var w=this._create();return w._excluded[E]=!0,w._update(),w},_.prototype.read=function(){var E="";this._match_pattern?E=this._input.read(this._starting_pattern):E=this._input.read(this._starting_pattern,this.__template_pattern);for(var w=this._read_template();w;)this._match_pattern?w+=this._input.read(this._match_pattern):w+=this._input.readUntil(this.__template_pattern),E+=w,w=this._read_template();return this._until_after&&(E+=this._input.readUntilAfter(this._until_pattern)),E},_.prototype.__set_templated_pattern=function(){var E=[];this._disabled.php||E.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||E.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||E.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||E.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(E.push(this.__patterns.django._starting_pattern.source),E.push(this.__patterns.django_value._starting_pattern.source),E.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||E.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&E.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+E.join("|")+")")},_.prototype._read_template=function(){var E="",w=this._input.peek();if(w==="<"){var F=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&F==="?"&&(E=E||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&F==="%"&&(E=E||this.__patterns.erb.read())}else w==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(E=E||this.__patterns.handlebars_comment.read(),E=E||this.__patterns.handlebars_unescaped.read(),E=E||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(E=E||this.__patterns.django_value.read()),this._excluded.django||(E=E||this.__patterns.django_comment.read(),E=E||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(E=E||this.__patterns.smarty_comment.read(),E=E||this.__patterns.smarty_literal.read(),E=E||this.__patterns.smarty.read()));return E},ne.exports.TemplatablePattern=_}],G={};function p(ne){var l=G[ne];if(l!==void 0)return l.exports;var K=G[ne]={exports:{}};return ue[ne](K,K.exports,p),K.exports}var se=p(0);de=se})();var me=de;S=[],x=function(){return{js_beautify:me}}.apply(He,S),x!==void 0&&(Ct.exports=x)})()},75918:function(Ct,He,S){"use strict";S.d(He,{Wi:function(){return p},Z0:function(){return se},aU:function(){return G},eZ:function(){return l},wY:function(){return ne}});var x=S(4348),de=S(69323),me=S(13268),ue=function(K,P,m,_){function E(w){return w instanceof m?w:new m(function(F){F(w)})}return new(m||(m=Promise))(function(w,F){function k(O){try{L(_.next(O))}catch(D){F(D)}}function N(O){try{L(_.throw(O))}catch(D){F(D)}}function L(O){O.done?w(O.value):E(O.value).then(k,N)}L((_=_.apply(K,P||[])).next())})};class G extends de.JT{constructor(P,m="",_="",E=!0,w){super(),this._onDidChange=this._register(new x.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=P,this._label=m,this._cssClass=_,this._enabled=E,this._actionCallback=w}get id(){return this._id}get label(){return this._label}set label(P){this._setLabel(P)}_setLabel(P){this._label!==P&&(this._label=P,this._onDidChange.fire({label:P}))}get tooltip(){return this._tooltip||""}set tooltip(P){this._setTooltip(P)}_setTooltip(P){this._tooltip!==P&&(this._tooltip=P,this._onDidChange.fire({tooltip:P}))}get class(){return this._cssClass}set class(P){this._setClass(P)}_setClass(P){this._cssClass!==P&&(this._cssClass=P,this._onDidChange.fire({class:P}))}get enabled(){return this._enabled}set enabled(P){this._setEnabled(P)}_setEnabled(P){this._enabled!==P&&(this._enabled=P,this._onDidChange.fire({enabled:P}))}get checked(){return this._checked}set checked(P){this._setChecked(P)}_setChecked(P){this._checked!==P&&(this._checked=P,this._onDidChange.fire({checked:P}))}run(P,m){return ue(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(P))})}}class p extends de.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new x.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new x.Q5),this.onDidRun=this._onDidRun.event}run(P,m){return ue(this,void 0,void 0,function*(){if(!P.enabled)return;this._onBeforeRun.fire({action:P});let _;try{yield this.runAction(P,m)}catch(E){_=E}this._onDidRun.fire({action:P,error:_})})}runAction(P,m){return ue(this,void 0,void 0,function*(){yield P.run(m)})}}class se extends G{constructor(P){super(se.ID,P,P?"separator text":"separator"),this.checked=!1,this.enabled=!1}}se.ID="vs.actions.separator";class ne{constructor(P,m,_,E){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=P,this.label=m,this.class=E,this._actions=_}get actions(){return this._actions}dispose(){}run(){return ue(this,void 0,void 0,function*(){})}}class l extends G{constructor(){super(l.ID,me.N("submenu.empty","(empty)"),void 0,!1)}}l.ID="vs.actions.empty"},76068:function(Ct,He,S){"use strict";S.d(He,{ok:function(){return x}});function x(de,me){if(!de)throw new Error(me?`Assertion failed (${me})`:"Assertion Failed")}},52615:function(Ct,He,S){"use strict";S.d(He,{CM:function(){return G},JL:function(){return p},dT:function(){return ne},fK:function(){return ue},lA:function(){return se}});var x=S(4348);class de{constructor(){this._icons=new Map,this._onDidRegister=new x.Q5}add(K){const P=this._icons.get(K.id);P?K.description?P.description=K.description:console.error(`Duplicate registration of codicon ${K.id}`):(this._icons.set(K.id,K),this._onDidRegister.fire(K))}get(K){return this._icons.get(K)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const me=new de,ue=me;function G(l,K){return new se(l,K)}function p(l){return l?l.replace(/\$\((.*?)\)/g,(K,P)=>` ${P} `).trim():""}class se{constructor(K,P,m){this.id=K,this.definition=P,this.description=m,me.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var ne;(function(l){l.iconNameSegment="[A-Za-z0-9]+",l.iconNameExpression="[A-Za-z0-9\\-]+",l.iconModifierExpression="~[A-Za-z]+";const K=new RegExp(`^(${l.iconNameExpression})(${l.iconModifierExpression})?$`);function P(E){if(E instanceof se)return["codicon","codicon-"+E.id];const w=K.exec(E.id);if(!w)return P(se.error);let[,F,k]=w;const N=["codicon","codicon-"+F];return k&&N.push("codicon-modifier-"+k.substr(1)),N}l.asClassNameArray=P;function m(E){return P(E).join(" ")}l.asClassName=m;function _(E){return"."+P(E).join(".")}l.asCSSSelector=_})(ne||(ne={})),function(l){l.add=new l("add",{fontCharacter:"\\ea60"}),l.plus=new l("plus",l.add.definition),l.gistNew=new l("gist-new",l.add.definition),l.repoCreate=new l("repo-create",l.add.definition),l.lightbulb=new l("lightbulb",{fontCharacter:"\\ea61"}),l.lightBulb=new l("light-bulb",{fontCharacter:"\\ea61"}),l.repo=new l("repo",{fontCharacter:"\\ea62"}),l.repoDelete=new l("repo-delete",{fontCharacter:"\\ea62"}),l.gistFork=new l("gist-fork",{fontCharacter:"\\ea63"}),l.repoForked=new l("repo-forked",{fontCharacter:"\\ea63"}),l.gitPullRequest=new l("git-pull-request",{fontCharacter:"\\ea64"}),l.gitPullRequestAbandoned=new l("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),l.recordKeys=new l("record-keys",{fontCharacter:"\\ea65"}),l.keyboard=new l("keyboard",{fontCharacter:"\\ea65"}),l.tag=new l("tag",{fontCharacter:"\\ea66"}),l.tagAdd=new l("tag-add",{fontCharacter:"\\ea66"}),l.tagRemove=new l("tag-remove",{fontCharacter:"\\ea66"}),l.person=new l("person",{fontCharacter:"\\ea67"}),l.personFollow=new l("person-follow",{fontCharacter:"\\ea67"}),l.personOutline=new l("person-outline",{fontCharacter:"\\ea67"}),l.personFilled=new l("person-filled",{fontCharacter:"\\ea67"}),l.gitBranch=new l("git-branch",{fontCharacter:"\\ea68"}),l.gitBranchCreate=new l("git-branch-create",{fontCharacter:"\\ea68"}),l.gitBranchDelete=new l("git-branch-delete",{fontCharacter:"\\ea68"}),l.sourceControl=new l("source-control",{fontCharacter:"\\ea68"}),l.mirror=new l("mirror",{fontCharacter:"\\ea69"}),l.mirrorPublic=new l("mirror-public",{fontCharacter:"\\ea69"}),l.star=new l("star",{fontCharacter:"\\ea6a"}),l.starAdd=new l("star-add",{fontCharacter:"\\ea6a"}),l.starDelete=new l("star-delete",{fontCharacter:"\\ea6a"}),l.starEmpty=new l("star-empty",{fontCharacter:"\\ea6a"}),l.comment=new l("comment",{fontCharacter:"\\ea6b"}),l.commentAdd=new l("comment-add",{fontCharacter:"\\ea6b"}),l.alert=new l("alert",{fontCharacter:"\\ea6c"}),l.warning=new l("warning",{fontCharacter:"\\ea6c"}),l.search=new l("search",{fontCharacter:"\\ea6d"}),l.searchSave=new l("search-save",{fontCharacter:"\\ea6d"}),l.logOut=new l("log-out",{fontCharacter:"\\ea6e"}),l.signOut=new l("sign-out",{fontCharacter:"\\ea6e"}),l.logIn=new l("log-in",{fontCharacter:"\\ea6f"}),l.signIn=new l("sign-in",{fontCharacter:"\\ea6f"}),l.eye=new l("eye",{fontCharacter:"\\ea70"}),l.eyeUnwatch=new l("eye-unwatch",{fontCharacter:"\\ea70"}),l.eyeWatch=new l("eye-watch",{fontCharacter:"\\ea70"}),l.circleFilled=new l("circle-filled",{fontCharacter:"\\ea71"}),l.primitiveDot=new l("primitive-dot",{fontCharacter:"\\ea71"}),l.closeDirty=new l("close-dirty",{fontCharacter:"\\ea71"}),l.debugBreakpoint=new l("debug-breakpoint",{fontCharacter:"\\ea71"}),l.debugBreakpointDisabled=new l("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),l.debugHint=new l("debug-hint",{fontCharacter:"\\ea71"}),l.primitiveSquare=new l("primitive-square",{fontCharacter:"\\ea72"}),l.edit=new l("edit",{fontCharacter:"\\ea73"}),l.pencil=new l("pencil",{fontCharacter:"\\ea73"}),l.info=new l("info",{fontCharacter:"\\ea74"}),l.issueOpened=new l("issue-opened",{fontCharacter:"\\ea74"}),l.gistPrivate=new l("gist-private",{fontCharacter:"\\ea75"}),l.gitForkPrivate=new l("git-fork-private",{fontCharacter:"\\ea75"}),l.lock=new l("lock",{fontCharacter:"\\ea75"}),l.mirrorPrivate=new l("mirror-private",{fontCharacter:"\\ea75"}),l.close=new l("close",{fontCharacter:"\\ea76"}),l.removeClose=new l("remove-close",{fontCharacter:"\\ea76"}),l.x=new l("x",{fontCharacter:"\\ea76"}),l.repoSync=new l("repo-sync",{fontCharacter:"\\ea77"}),l.sync=new l("sync",{fontCharacter:"\\ea77"}),l.clone=new l("clone",{fontCharacter:"\\ea78"}),l.desktopDownload=new l("desktop-download",{fontCharacter:"\\ea78"}),l.beaker=new l("beaker",{fontCharacter:"\\ea79"}),l.microscope=new l("microscope",{fontCharacter:"\\ea79"}),l.vm=new l("vm",{fontCharacter:"\\ea7a"}),l.deviceDesktop=new l("device-desktop",{fontCharacter:"\\ea7a"}),l.file=new l("file",{fontCharacter:"\\ea7b"}),l.fileText=new l("file-text",{fontCharacter:"\\ea7b"}),l.more=new l("more",{fontCharacter:"\\ea7c"}),l.ellipsis=new l("ellipsis",{fontCharacter:"\\ea7c"}),l.kebabHorizontal=new l("kebab-horizontal",{fontCharacter:"\\ea7c"}),l.mailReply=new l("mail-reply",{fontCharacter:"\\ea7d"}),l.reply=new l("reply",{fontCharacter:"\\ea7d"}),l.organization=new l("organization",{fontCharacter:"\\ea7e"}),l.organizationFilled=new l("organization-filled",{fontCharacter:"\\ea7e"}),l.organizationOutline=new l("organization-outline",{fontCharacter:"\\ea7e"}),l.newFile=new l("new-file",{fontCharacter:"\\ea7f"}),l.fileAdd=new l("file-add",{fontCharacter:"\\ea7f"}),l.newFolder=new l("new-folder",{fontCharacter:"\\ea80"}),l.fileDirectoryCreate=new l("file-directory-create",{fontCharacter:"\\ea80"}),l.trash=new l("trash",{fontCharacter:"\\ea81"}),l.trashcan=new l("trashcan",{fontCharacter:"\\ea81"}),l.history=new l("history",{fontCharacter:"\\ea82"}),l.clock=new l("clock",{fontCharacter:"\\ea82"}),l.folder=new l("folder",{fontCharacter:"\\ea83"}),l.fileDirectory=new l("file-directory",{fontCharacter:"\\ea83"}),l.symbolFolder=new l("symbol-folder",{fontCharacter:"\\ea83"}),l.logoGithub=new l("logo-github",{fontCharacter:"\\ea84"}),l.markGithub=new l("mark-github",{fontCharacter:"\\ea84"}),l.github=new l("github",{fontCharacter:"\\ea84"}),l.terminal=new l("terminal",{fontCharacter:"\\ea85"}),l.console=new l("console",{fontCharacter:"\\ea85"}),l.repl=new l("repl",{fontCharacter:"\\ea85"}),l.zap=new l("zap",{fontCharacter:"\\ea86"}),l.symbolEvent=new l("symbol-event",{fontCharacter:"\\ea86"}),l.error=new l("error",{fontCharacter:"\\ea87"}),l.stop=new l("stop",{fontCharacter:"\\ea87"}),l.variable=new l("variable",{fontCharacter:"\\ea88"}),l.symbolVariable=new l("symbol-variable",{fontCharacter:"\\ea88"}),l.array=new l("array",{fontCharacter:"\\ea8a"}),l.symbolArray=new l("symbol-array",{fontCharacter:"\\ea8a"}),l.symbolModule=new l("symbol-module",{fontCharacter:"\\ea8b"}),l.symbolPackage=new l("symbol-package",{fontCharacter:"\\ea8b"}),l.symbolNamespace=new l("symbol-namespace",{fontCharacter:"\\ea8b"}),l.symbolObject=new l("symbol-object",{fontCharacter:"\\ea8b"}),l.symbolMethod=new l("symbol-method",{fontCharacter:"\\ea8c"}),l.symbolFunction=new l("symbol-function",{fontCharacter:"\\ea8c"}),l.symbolConstructor=new l("symbol-constructor",{fontCharacter:"\\ea8c"}),l.symbolBoolean=new l("symbol-boolean",{fontCharacter:"\\ea8f"}),l.symbolNull=new l("symbol-null",{fontCharacter:"\\ea8f"}),l.symbolNumeric=new l("symbol-numeric",{fontCharacter:"\\ea90"}),l.symbolNumber=new l("symbol-number",{fontCharacter:"\\ea90"}),l.symbolStructure=new l("symbol-structure",{fontCharacter:"\\ea91"}),l.symbolStruct=new l("symbol-struct",{fontCharacter:"\\ea91"}),l.symbolParameter=new l("symbol-parameter",{fontCharacter:"\\ea92"}),l.symbolTypeParameter=new l("symbol-type-parameter",{fontCharacter:"\\ea92"}),l.symbolKey=new l("symbol-key",{fontCharacter:"\\ea93"}),l.symbolText=new l("symbol-text",{fontCharacter:"\\ea93"}),l.symbolReference=new l("symbol-reference",{fontCharacter:"\\ea94"}),l.goToFile=new l("go-to-file",{fontCharacter:"\\ea94"}),l.symbolEnum=new l("symbol-enum",{fontCharacter:"\\ea95"}),l.symbolValue=new l("symbol-value",{fontCharacter:"\\ea95"}),l.symbolRuler=new l("symbol-ruler",{fontCharacter:"\\ea96"}),l.symbolUnit=new l("symbol-unit",{fontCharacter:"\\ea96"}),l.activateBreakpoints=new l("activate-breakpoints",{fontCharacter:"\\ea97"}),l.archive=new l("archive",{fontCharacter:"\\ea98"}),l.arrowBoth=new l("arrow-both",{fontCharacter:"\\ea99"}),l.arrowDown=new l("arrow-down",{fontCharacter:"\\ea9a"}),l.arrowLeft=new l("arrow-left",{fontCharacter:"\\ea9b"}),l.arrowRight=new l("arrow-right",{fontCharacter:"\\ea9c"}),l.arrowSmallDown=new l("arrow-small-down",{fontCharacter:"\\ea9d"}),l.arrowSmallLeft=new l("arrow-small-left",{fontCharacter:"\\ea9e"}),l.arrowSmallRight=new l("arrow-small-right",{fontCharacter:"\\ea9f"}),l.arrowSmallUp=new l("arrow-small-up",{fontCharacter:"\\eaa0"}),l.arrowUp=new l("arrow-up",{fontCharacter:"\\eaa1"}),l.bell=new l("bell",{fontCharacter:"\\eaa2"}),l.bold=new l("bold",{fontCharacter:"\\eaa3"}),l.book=new l("book",{fontCharacter:"\\eaa4"}),l.bookmark=new l("bookmark",{fontCharacter:"\\eaa5"}),l.debugBreakpointConditionalUnverified=new l("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),l.debugBreakpointConditional=new l("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),l.debugBreakpointConditionalDisabled=new l("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),l.debugBreakpointDataUnverified=new l("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),l.debugBreakpointData=new l("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),l.debugBreakpointDataDisabled=new l("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),l.debugBreakpointLogUnverified=new l("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),l.debugBreakpointLog=new l("debug-breakpoint-log",{fontCharacter:"\\eaab"}),l.debugBreakpointLogDisabled=new l("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),l.briefcase=new l("briefcase",{fontCharacter:"\\eaac"}),l.broadcast=new l("broadcast",{fontCharacter:"\\eaad"}),l.browser=new l("browser",{fontCharacter:"\\eaae"}),l.bug=new l("bug",{fontCharacter:"\\eaaf"}),l.calendar=new l("calendar",{fontCharacter:"\\eab0"}),l.caseSensitive=new l("case-sensitive",{fontCharacter:"\\eab1"}),l.check=new l("check",{fontCharacter:"\\eab2"}),l.checklist=new l("checklist",{fontCharacter:"\\eab3"}),l.chevronDown=new l("chevron-down",{fontCharacter:"\\eab4"}),l.dropDownButton=new l("drop-down-button",l.chevronDown.definition),l.chevronLeft=new l("chevron-left",{fontCharacter:"\\eab5"}),l.chevronRight=new l("chevron-right",{fontCharacter:"\\eab6"}),l.chevronUp=new l("chevron-up",{fontCharacter:"\\eab7"}),l.chromeClose=new l("chrome-close",{fontCharacter:"\\eab8"}),l.chromeMaximize=new l("chrome-maximize",{fontCharacter:"\\eab9"}),l.chromeMinimize=new l("chrome-minimize",{fontCharacter:"\\eaba"}),l.chromeRestore=new l("chrome-restore",{fontCharacter:"\\eabb"}),l.circleOutline=new l("circle-outline",{fontCharacter:"\\eabc"}),l.debugBreakpointUnverified=new l("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),l.circleSlash=new l("circle-slash",{fontCharacter:"\\eabd"}),l.circuitBoard=new l("circuit-board",{fontCharacter:"\\eabe"}),l.clearAll=new l("clear-all",{fontCharacter:"\\eabf"}),l.clippy=new l("clippy",{fontCharacter:"\\eac0"}),l.closeAll=new l("close-all",{fontCharacter:"\\eac1"}),l.cloudDownload=new l("cloud-download",{fontCharacter:"\\eac2"}),l.cloudUpload=new l("cloud-upload",{fontCharacter:"\\eac3"}),l.code=new l("code",{fontCharacter:"\\eac4"}),l.collapseAll=new l("collapse-all",{fontCharacter:"\\eac5"}),l.colorMode=new l("color-mode",{fontCharacter:"\\eac6"}),l.commentDiscussion=new l("comment-discussion",{fontCharacter:"\\eac7"}),l.compareChanges=new l("compare-changes",{fontCharacter:"\\eafd"}),l.creditCard=new l("credit-card",{fontCharacter:"\\eac9"}),l.dash=new l("dash",{fontCharacter:"\\eacc"}),l.dashboard=new l("dashboard",{fontCharacter:"\\eacd"}),l.database=new l("database",{fontCharacter:"\\eace"}),l.debugContinue=new l("debug-continue",{fontCharacter:"\\eacf"}),l.debugDisconnect=new l("debug-disconnect",{fontCharacter:"\\ead0"}),l.debugPause=new l("debug-pause",{fontCharacter:"\\ead1"}),l.debugRestart=new l("debug-restart",{fontCharacter:"\\ead2"}),l.debugStart=new l("debug-start",{fontCharacter:"\\ead3"}),l.debugStepInto=new l("debug-step-into",{fontCharacter:"\\ead4"}),l.debugStepOut=new l("debug-step-out",{fontCharacter:"\\ead5"}),l.debugStepOver=new l("debug-step-over",{fontCharacter:"\\ead6"}),l.debugStop=new l("debug-stop",{fontCharacter:"\\ead7"}),l.debug=new l("debug",{fontCharacter:"\\ead8"}),l.deviceCameraVideo=new l("device-camera-video",{fontCharacter:"\\ead9"}),l.deviceCamera=new l("device-camera",{fontCharacter:"\\eada"}),l.deviceMobile=new l("device-mobile",{fontCharacter:"\\eadb"}),l.diffAdded=new l("diff-added",{fontCharacter:"\\eadc"}),l.diffIgnored=new l("diff-ignored",{fontCharacter:"\\eadd"}),l.diffModified=new l("diff-modified",{fontCharacter:"\\eade"}),l.diffRemoved=new l("diff-removed",{fontCharacter:"\\eadf"}),l.diffRenamed=new l("diff-renamed",{fontCharacter:"\\eae0"}),l.diff=new l("diff",{fontCharacter:"\\eae1"}),l.discard=new l("discard",{fontCharacter:"\\eae2"}),l.editorLayout=new l("editor-layout",{fontCharacter:"\\eae3"}),l.emptyWindow=new l("empty-window",{fontCharacter:"\\eae4"}),l.exclude=new l("exclude",{fontCharacter:"\\eae5"}),l.extensions=new l("extensions",{fontCharacter:"\\eae6"}),l.eyeClosed=new l("eye-closed",{fontCharacter:"\\eae7"}),l.fileBinary=new l("file-binary",{fontCharacter:"\\eae8"}),l.fileCode=new l("file-code",{fontCharacter:"\\eae9"}),l.fileMedia=new l("file-media",{fontCharacter:"\\eaea"}),l.filePdf=new l("file-pdf",{fontCharacter:"\\eaeb"}),l.fileSubmodule=new l("file-submodule",{fontCharacter:"\\eaec"}),l.fileSymlinkDirectory=new l("file-symlink-directory",{fontCharacter:"\\eaed"}),l.fileSymlinkFile=new l("file-symlink-file",{fontCharacter:"\\eaee"}),l.fileZip=new l("file-zip",{fontCharacter:"\\eaef"}),l.files=new l("files",{fontCharacter:"\\eaf0"}),l.filter=new l("filter",{fontCharacter:"\\eaf1"}),l.flame=new l("flame",{fontCharacter:"\\eaf2"}),l.foldDown=new l("fold-down",{fontCharacter:"\\eaf3"}),l.foldUp=new l("fold-up",{fontCharacter:"\\eaf4"}),l.fold=new l("fold",{fontCharacter:"\\eaf5"}),l.folderActive=new l("folder-active",{fontCharacter:"\\eaf6"}),l.folderOpened=new l("folder-opened",{fontCharacter:"\\eaf7"}),l.gear=new l("gear",{fontCharacter:"\\eaf8"}),l.gift=new l("gift",{fontCharacter:"\\eaf9"}),l.gistSecret=new l("gist-secret",{fontCharacter:"\\eafa"}),l.gist=new l("gist",{fontCharacter:"\\eafb"}),l.gitCommit=new l("git-commit",{fontCharacter:"\\eafc"}),l.gitCompare=new l("git-compare",{fontCharacter:"\\eafd"}),l.gitMerge=new l("git-merge",{fontCharacter:"\\eafe"}),l.githubAction=new l("github-action",{fontCharacter:"\\eaff"}),l.githubAlt=new l("github-alt",{fontCharacter:"\\eb00"}),l.globe=new l("globe",{fontCharacter:"\\eb01"}),l.grabber=new l("grabber",{fontCharacter:"\\eb02"}),l.graph=new l("graph",{fontCharacter:"\\eb03"}),l.gripper=new l("gripper",{fontCharacter:"\\eb04"}),l.heart=new l("heart",{fontCharacter:"\\eb05"}),l.home=new l("home",{fontCharacter:"\\eb06"}),l.horizontalRule=new l("horizontal-rule",{fontCharacter:"\\eb07"}),l.hubot=new l("hubot",{fontCharacter:"\\eb08"}),l.inbox=new l("inbox",{fontCharacter:"\\eb09"}),l.issueClosed=new l("issue-closed",{fontCharacter:"\\eba4"}),l.issueReopened=new l("issue-reopened",{fontCharacter:"\\eb0b"}),l.issues=new l("issues",{fontCharacter:"\\eb0c"}),l.italic=new l("italic",{fontCharacter:"\\eb0d"}),l.jersey=new l("jersey",{fontCharacter:"\\eb0e"}),l.json=new l("json",{fontCharacter:"\\eb0f"}),l.kebabVertical=new l("kebab-vertical",{fontCharacter:"\\eb10"}),l.key=new l("key",{fontCharacter:"\\eb11"}),l.law=new l("law",{fontCharacter:"\\eb12"}),l.lightbulbAutofix=new l("lightbulb-autofix",{fontCharacter:"\\eb13"}),l.linkExternal=new l("link-external",{fontCharacter:"\\eb14"}),l.link=new l("link",{fontCharacter:"\\eb15"}),l.listOrdered=new l("list-ordered",{fontCharacter:"\\eb16"}),l.listUnordered=new l("list-unordered",{fontCharacter:"\\eb17"}),l.liveShare=new l("live-share",{fontCharacter:"\\eb18"}),l.loading=new l("loading",{fontCharacter:"\\eb19"}),l.location=new l("location",{fontCharacter:"\\eb1a"}),l.mailRead=new l("mail-read",{fontCharacter:"\\eb1b"}),l.mail=new l("mail",{fontCharacter:"\\eb1c"}),l.markdown=new l("markdown",{fontCharacter:"\\eb1d"}),l.megaphone=new l("megaphone",{fontCharacter:"\\eb1e"}),l.mention=new l("mention",{fontCharacter:"\\eb1f"}),l.milestone=new l("milestone",{fontCharacter:"\\eb20"}),l.mortarBoard=new l("mortar-board",{fontCharacter:"\\eb21"}),l.move=new l("move",{fontCharacter:"\\eb22"}),l.multipleWindows=new l("multiple-windows",{fontCharacter:"\\eb23"}),l.mute=new l("mute",{fontCharacter:"\\eb24"}),l.noNewline=new l("no-newline",{fontCharacter:"\\eb25"}),l.note=new l("note",{fontCharacter:"\\eb26"}),l.octoface=new l("octoface",{fontCharacter:"\\eb27"}),l.openPreview=new l("open-preview",{fontCharacter:"\\eb28"}),l.package_=new l("package",{fontCharacter:"\\eb29"}),l.paintcan=new l("paintcan",{fontCharacter:"\\eb2a"}),l.pin=new l("pin",{fontCharacter:"\\eb2b"}),l.play=new l("play",{fontCharacter:"\\eb2c"}),l.run=new l("run",{fontCharacter:"\\eb2c"}),l.plug=new l("plug",{fontCharacter:"\\eb2d"}),l.preserveCase=new l("preserve-case",{fontCharacter:"\\eb2e"}),l.preview=new l("preview",{fontCharacter:"\\eb2f"}),l.project=new l("project",{fontCharacter:"\\eb30"}),l.pulse=new l("pulse",{fontCharacter:"\\eb31"}),l.question=new l("question",{fontCharacter:"\\eb32"}),l.quote=new l("quote",{fontCharacter:"\\eb33"}),l.radioTower=new l("radio-tower",{fontCharacter:"\\eb34"}),l.reactions=new l("reactions",{fontCharacter:"\\eb35"}),l.references=new l("references",{fontCharacter:"\\eb36"}),l.refresh=new l("refresh",{fontCharacter:"\\eb37"}),l.regex=new l("regex",{fontCharacter:"\\eb38"}),l.remoteExplorer=new l("remote-explorer",{fontCharacter:"\\eb39"}),l.remote=new l("remote",{fontCharacter:"\\eb3a"}),l.remove=new l("remove",{fontCharacter:"\\eb3b"}),l.replaceAll=new l("replace-all",{fontCharacter:"\\eb3c"}),l.replace=new l("replace",{fontCharacter:"\\eb3d"}),l.repoClone=new l("repo-clone",{fontCharacter:"\\eb3e"}),l.repoForcePush=new l("repo-force-push",{fontCharacter:"\\eb3f"}),l.repoPull=new l("repo-pull",{fontCharacter:"\\eb40"}),l.repoPush=new l("repo-push",{fontCharacter:"\\eb41"}),l.report=new l("report",{fontCharacter:"\\eb42"}),l.requestChanges=new l("request-changes",{fontCharacter:"\\eb43"}),l.rocket=new l("rocket",{fontCharacter:"\\eb44"}),l.rootFolderOpened=new l("root-folder-opened",{fontCharacter:"\\eb45"}),l.rootFolder=new l("root-folder",{fontCharacter:"\\eb46"}),l.rss=new l("rss",{fontCharacter:"\\eb47"}),l.ruby=new l("ruby",{fontCharacter:"\\eb48"}),l.saveAll=new l("save-all",{fontCharacter:"\\eb49"}),l.saveAs=new l("save-as",{fontCharacter:"\\eb4a"}),l.save=new l("save",{fontCharacter:"\\eb4b"}),l.screenFull=new l("screen-full",{fontCharacter:"\\eb4c"}),l.screenNormal=new l("screen-normal",{fontCharacter:"\\eb4d"}),l.searchStop=new l("search-stop",{fontCharacter:"\\eb4e"}),l.server=new l("server",{fontCharacter:"\\eb50"}),l.settingsGear=new l("settings-gear",{fontCharacter:"\\eb51"}),l.settings=new l("settings",{fontCharacter:"\\eb52"}),l.shield=new l("shield",{fontCharacter:"\\eb53"}),l.smiley=new l("smiley",{fontCharacter:"\\eb54"}),l.sortPrecedence=new l("sort-precedence",{fontCharacter:"\\eb55"}),l.splitHorizontal=new l("split-horizontal",{fontCharacter:"\\eb56"}),l.splitVertical=new l("split-vertical",{fontCharacter:"\\eb57"}),l.squirrel=new l("squirrel",{fontCharacter:"\\eb58"}),l.starFull=new l("star-full",{fontCharacter:"\\eb59"}),l.starHalf=new l("star-half",{fontCharacter:"\\eb5a"}),l.symbolClass=new l("symbol-class",{fontCharacter:"\\eb5b"}),l.symbolColor=new l("symbol-color",{fontCharacter:"\\eb5c"}),l.symbolConstant=new l("symbol-constant",{fontCharacter:"\\eb5d"}),l.symbolEnumMember=new l("symbol-enum-member",{fontCharacter:"\\eb5e"}),l.symbolField=new l("symbol-field",{fontCharacter:"\\eb5f"}),l.symbolFile=new l("symbol-file",{fontCharacter:"\\eb60"}),l.symbolInterface=new l("symbol-interface",{fontCharacter:"\\eb61"}),l.symbolKeyword=new l("symbol-keyword",{fontCharacter:"\\eb62"}),l.symbolMisc=new l("symbol-misc",{fontCharacter:"\\eb63"}),l.symbolOperator=new l("symbol-operator",{fontCharacter:"\\eb64"}),l.symbolProperty=new l("symbol-property",{fontCharacter:"\\eb65"}),l.wrench=new l("wrench",{fontCharacter:"\\eb65"}),l.wrenchSubaction=new l("wrench-subaction",{fontCharacter:"\\eb65"}),l.symbolSnippet=new l("symbol-snippet",{fontCharacter:"\\eb66"}),l.tasklist=new l("tasklist",{fontCharacter:"\\eb67"}),l.telescope=new l("telescope",{fontCharacter:"\\eb68"}),l.textSize=new l("text-size",{fontCharacter:"\\eb69"}),l.threeBars=new l("three-bars",{fontCharacter:"\\eb6a"}),l.thumbsdown=new l("thumbsdown",{fontCharacter:"\\eb6b"}),l.thumbsup=new l("thumbsup",{fontCharacter:"\\eb6c"}),l.tools=new l("tools",{fontCharacter:"\\eb6d"}),l.triangleDown=new l("triangle-down",{fontCharacter:"\\eb6e"}),l.triangleLeft=new l("triangle-left",{fontCharacter:"\\eb6f"}),l.triangleRight=new l("triangle-right",{fontCharacter:"\\eb70"}),l.triangleUp=new l("triangle-up",{fontCharacter:"\\eb71"}),l.twitter=new l("twitter",{fontCharacter:"\\eb72"}),l.unfold=new l("unfold",{fontCharacter:"\\eb73"}),l.unlock=new l("unlock",{fontCharacter:"\\eb74"}),l.unmute=new l("unmute",{fontCharacter:"\\eb75"}),l.unverified=new l("unverified",{fontCharacter:"\\eb76"}),l.verified=new l("verified",{fontCharacter:"\\eb77"}),l.versions=new l("versions",{fontCharacter:"\\eb78"}),l.vmActive=new l("vm-active",{fontCharacter:"\\eb79"}),l.vmOutline=new l("vm-outline",{fontCharacter:"\\eb7a"}),l.vmRunning=new l("vm-running",{fontCharacter:"\\eb7b"}),l.watch=new l("watch",{fontCharacter:"\\eb7c"}),l.whitespace=new l("whitespace",{fontCharacter:"\\eb7d"}),l.wholeWord=new l("whole-word",{fontCharacter:"\\eb7e"}),l.window=new l("window",{fontCharacter:"\\eb7f"}),l.wordWrap=new l("word-wrap",{fontCharacter:"\\eb80"}),l.zoomIn=new l("zoom-in",{fontCharacter:"\\eb81"}),l.zoomOut=new l("zoom-out",{fontCharacter:"\\eb82"}),l.listFilter=new l("list-filter",{fontCharacter:"\\eb83"}),l.listFlat=new l("list-flat",{fontCharacter:"\\eb84"}),l.listSelection=new l("list-selection",{fontCharacter:"\\eb85"}),l.selection=new l("selection",{fontCharacter:"\\eb85"}),l.listTree=new l("list-tree",{fontCharacter:"\\eb86"}),l.debugBreakpointFunctionUnverified=new l("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),l.debugBreakpointFunction=new l("debug-breakpoint-function",{fontCharacter:"\\eb88"}),l.debugBreakpointFunctionDisabled=new l("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),l.debugStackframeActive=new l("debug-stackframe-active",{fontCharacter:"\\eb89"}),l.debugStackframeDot=new l("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),l.debugStackframe=new l("debug-stackframe",{fontCharacter:"\\eb8b"}),l.debugStackframeFocused=new l("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),l.debugBreakpointUnsupported=new l("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),l.symbolString=new l("symbol-string",{fontCharacter:"\\eb8d"}),l.debugReverseContinue=new l("debug-reverse-continue",{fontCharacter:"\\eb8e"}),l.debugStepBack=new l("debug-step-back",{fontCharacter:"\\eb8f"}),l.debugRestartFrame=new l("debug-restart-frame",{fontCharacter:"\\eb90"}),l.callIncoming=new l("call-incoming",{fontCharacter:"\\eb92"}),l.callOutgoing=new l("call-outgoing",{fontCharacter:"\\eb93"}),l.menu=new l("menu",{fontCharacter:"\\eb94"}),l.expandAll=new l("expand-all",{fontCharacter:"\\eb95"}),l.feedback=new l("feedback",{fontCharacter:"\\eb96"}),l.groupByRefType=new l("group-by-ref-type",{fontCharacter:"\\eb97"}),l.ungroupByRefType=new l("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),l.account=new l("account",{fontCharacter:"\\eb99"}),l.bellDot=new l("bell-dot",{fontCharacter:"\\eb9a"}),l.debugConsole=new l("debug-console",{fontCharacter:"\\eb9b"}),l.library=new l("library",{fontCharacter:"\\eb9c"}),l.output=new l("output",{fontCharacter:"\\eb9d"}),l.runAll=new l("run-all",{fontCharacter:"\\eb9e"}),l.syncIgnored=new l("sync-ignored",{fontCharacter:"\\eb9f"}),l.pinned=new l("pinned",{fontCharacter:"\\eba0"}),l.githubInverted=new l("github-inverted",{fontCharacter:"\\eba1"}),l.debugAlt=new l("debug-alt",{fontCharacter:"\\eb91"}),l.serverProcess=new l("server-process",{fontCharacter:"\\eba2"}),l.serverEnvironment=new l("server-environment",{fontCharacter:"\\eba3"}),l.pass=new l("pass",{fontCharacter:"\\eba4"}),l.stopCircle=new l("stop-circle",{fontCharacter:"\\eba5"}),l.playCircle=new l("play-circle",{fontCharacter:"\\eba6"}),l.record=new l("record",{fontCharacter:"\\eba7"}),l.debugAltSmall=new l("debug-alt-small",{fontCharacter:"\\eba8"}),l.vmConnect=new l("vm-connect",{fontCharacter:"\\eba9"}),l.cloud=new l("cloud",{fontCharacter:"\\ebaa"}),l.merge=new l("merge",{fontCharacter:"\\ebab"}),l.exportIcon=new l("export",{fontCharacter:"\\ebac"}),l.graphLeft=new l("graph-left",{fontCharacter:"\\ebad"}),l.magnet=new l("magnet",{fontCharacter:"\\ebae"}),l.notebook=new l("notebook",{fontCharacter:"\\ebaf"}),l.redo=new l("redo",{fontCharacter:"\\ebb0"}),l.checkAll=new l("check-all",{fontCharacter:"\\ebb1"}),l.pinnedDirty=new l("pinned-dirty",{fontCharacter:"\\ebb2"}),l.passFilled=new l("pass-filled",{fontCharacter:"\\ebb3"}),l.circleLargeFilled=new l("circle-large-filled",{fontCharacter:"\\ebb4"}),l.circleLargeOutline=new l("circle-large-outline",{fontCharacter:"\\ebb5"}),l.combine=new l("combine",{fontCharacter:"\\ebb6"}),l.gather=new l("gather",{fontCharacter:"\\ebb6"}),l.table=new l("table",{fontCharacter:"\\ebb7"}),l.variableGroup=new l("variable-group",{fontCharacter:"\\ebb8"}),l.typeHierarchy=new l("type-hierarchy",{fontCharacter:"\\ebb9"}),l.typeHierarchySub=new l("type-hierarchy-sub",{fontCharacter:"\\ebba"}),l.typeHierarchySuper=new l("type-hierarchy-super",{fontCharacter:"\\ebbb"}),l.gitPullRequestCreate=new l("git-pull-request-create",{fontCharacter:"\\ebbc"}),l.runAbove=new l("run-above",{fontCharacter:"\\ebbd"}),l.runBelow=new l("run-below",{fontCharacter:"\\ebbe"}),l.notebookTemplate=new l("notebook-template",{fontCharacter:"\\ebbf"}),l.debugRerun=new l("debug-rerun",{fontCharacter:"\\ebc0"}),l.workspaceTrusted=new l("workspace-trusted",{fontCharacter:"\\ebc1"}),l.workspaceUntrusted=new l("workspace-untrusted",{fontCharacter:"\\ebc2"}),l.workspaceUnspecified=new l("workspace-unspecified",{fontCharacter:"\\ebc3"}),l.terminalCmd=new l("terminal-cmd",{fontCharacter:"\\ebc4"}),l.terminalDebian=new l("terminal-debian",{fontCharacter:"\\ebc5"}),l.terminalLinux=new l("terminal-linux",{fontCharacter:"\\ebc6"}),l.terminalPowershell=new l("terminal-powershell",{fontCharacter:"\\ebc7"}),l.terminalTmux=new l("terminal-tmux",{fontCharacter:"\\ebc8"}),l.terminalUbuntu=new l("terminal-ubuntu",{fontCharacter:"\\ebc9"}),l.terminalBash=new l("terminal-bash",{fontCharacter:"\\ebca"}),l.arrowSwap=new l("arrow-swap",{fontCharacter:"\\ebcb"}),l.copy=new l("copy",{fontCharacter:"\\ebcc"}),l.personAdd=new l("person-add",{fontCharacter:"\\ebcd"}),l.filterFilled=new l("filter-filled",{fontCharacter:"\\ebce"}),l.wand=new l("wand",{fontCharacter:"\\ebcf"}),l.debugLineByLine=new l("debug-line-by-line",{fontCharacter:"\\ebd0"}),l.inspect=new l("inspect",{fontCharacter:"\\ebd1"}),l.layers=new l("layers",{fontCharacter:"\\ebd2"}),l.layersDot=new l("layers-dot",{fontCharacter:"\\ebd3"}),l.layersActive=new l("layers-active",{fontCharacter:"\\ebd4"}),l.compass=new l("compass",{fontCharacter:"\\ebd5"}),l.compassDot=new l("compass-dot",{fontCharacter:"\\ebd6"}),l.compassActive=new l("compass-active",{fontCharacter:"\\ebd7"}),l.azure=new l("azure",{fontCharacter:"\\ebd8"}),l.issueDraft=new l("issue-draft",{fontCharacter:"\\ebd9"}),l.gitPullRequestClosed=new l("git-pull-request-closed",{fontCharacter:"\\ebda"}),l.gitPullRequestDraft=new l("git-pull-request-draft",{fontCharacter:"\\ebdb"}),l.debugAll=new l("debug-all",{fontCharacter:"\\ebdc"}),l.debugCoverage=new l("debug-coverage",{fontCharacter:"\\ebdd"}),l.runErrors=new l("run-errors",{fontCharacter:"\\ebde"}),l.folderLibrary=new l("folder-library",{fontCharacter:"\\ebdf"}),l.debugContinueSmall=new l("debug-continue-small",{fontCharacter:"\\ebe0"}),l.beakerStop=new l("beaker-stop",{fontCharacter:"\\ebe1"}),l.graphLine=new l("graph-line",{fontCharacter:"\\ebe2"}),l.graphScatter=new l("graph-scatter",{fontCharacter:"\\ebe3"}),l.pieChart=new l("pie-chart",{fontCharacter:"\\ebe4"}),l.bracket=new l("bracket",l.json.definition),l.bracketDot=new l("bracket-dot",{fontCharacter:"\\ebe5"}),l.bracketError=new l("bracket-error",{fontCharacter:"\\ebe6"}),l.lockSmall=new l("lock-small",{fontCharacter:"\\ebe7"}),l.azureDevops=new l("azure-devops",{fontCharacter:"\\ebe8"}),l.verifiedFilled=new l("verified-filled",{fontCharacter:"\\ebe9"})}(se||(se={}))},79881:function(Ct,He,S){"use strict";S.d(He,{B8:function(){return P},Cp:function(){return ue},F0:function(){return ne},L6:function(){return K},VV:function(){return se},b1:function(){return l},dL:function(){return me},ri:function(){return G}});class x{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(_){setTimeout(()=>{throw _.stack?new Error(_.message+`
|
|
|
|
`+_.stack):_},0)}}emit(_){this.listeners.forEach(E=>{E(_)})}onUnexpectedError(_){this.unexpectedErrorHandler(_),this.emit(_)}onUnexpectedExternalError(_){this.unexpectedErrorHandler(_)}}const de=new x;function me(m){se(m)||de.onUnexpectedError(m)}function ue(m){se(m)||de.onUnexpectedExternalError(m)}function G(m){if(m instanceof Error){let{name:_,message:E}=m;const w=m.stacktrace||m.stack;return{$isError:!0,name:_,message:E,stack:w}}return m}const p="Canceled";function se(m){return m instanceof Error&&m.name===p&&m.message===p}function ne(){const m=new Error(p);return m.name=m.message,m}function l(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function K(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class P extends Error{constructor(_){super("NotSupported"),_&&(this.message=_)}}},4348:function(Ct,He,S){"use strict";S.d(He,{D0:function(){return P},E7:function(){return m},K3:function(){return K},Q5:function(){return l},ZD:function(){return _},ju:function(){return G}});var x=S(79881),de=S(69323),me=S(34502),ue=S(95830),G;(function(E){E.None=()=>de.JT.None;function w(z){return(H,Z=null,Y)=>{let b=!1,y;return y=z(V=>{if(!b)return y?y.dispose():b=!0,H.call(Z,V)},null,Y),b&&y.dispose(),y}}E.once=w;function F(z,H){return C((Z,Y=null,b)=>z(y=>Z.call(Y,H(y)),null,b))}E.map=F;function k(z,H){return C((Z,Y=null,b)=>z(y=>{H(y),Z.call(Y,y)},null,b))}E.forEach=k;function N(z,H){return C((Z,Y=null,b)=>z(y=>H(y)&&Z.call(Y,y),null,b))}E.filter=N;function L(z){return z}E.signal=L;function O(...z){return(H,Z=null,Y)=>(0,de.F8)(...z.map(b=>b(y=>H.call(Z,y),null,Y)))}E.any=O;function D(z,H,Z){let Y=Z;return F(z,b=>(Y=H(Y,b),Y))}E.reduce=D;function C(z){let H;const Z=new l({onFirstListenerAdd(){H=z(Z.fire,Z)},onLastListenerRemove(){H.dispose()}});return Z.event}function Q(z,H,Z=100,Y=!1,b){let y,V,he,be=0;const Pe=new l({leakWarningThreshold:b,onFirstListenerAdd(){y=z(oe=>{be++,V=H(V,oe),Y&&!he&&(Pe.fire(V),V=void 0),clearTimeout(he),he=setTimeout(()=>{const Ae=V;V=void 0,he=void 0,(!Y||be>1)&&Pe.fire(Ae),be=0},Z)})},onLastListenerRemove(){y.dispose()}});return Pe.event}E.debounce=Q;function ce(z,H=(Z,Y)=>Z===Y){let Z=!0,Y;return N(z,b=>{const y=Z||!H(b,Y);return Z=!1,Y=b,y})}E.latch=ce;function ae(z,H){return[E.filter(z,H),E.filter(z,Z=>!H(Z))]}E.split=ae;function Se(z,H=!1,Z=[]){let Y=Z.slice(),b=z(he=>{Y?Y.push(he):V.fire(he)});const y=()=>{Y&&Y.forEach(he=>V.fire(he)),Y=null},V=new l({onFirstListenerAdd(){b||(b=z(he=>V.fire(he)))},onFirstListenerDidAdd(){Y&&(H?setTimeout(y):y())},onLastListenerRemove(){b&&b.dispose(),b=null}});return V.event}E.buffer=Se;class Ne{constructor(H){this.event=H}map(H){return new Ne(F(this.event,H))}forEach(H){return new Ne(k(this.event,H))}filter(H){return new Ne(N(this.event,H))}reduce(H,Z){return new Ne(D(this.event,H,Z))}latch(){return new Ne(ce(this.event))}debounce(H,Z=100,Y=!1,b){return new Ne(Q(this.event,H,Z,Y,b))}on(H,Z,Y){return this.event(H,Z,Y)}once(H,Z,Y){return w(this.event)(H,Z,Y)}}function Te(z){return new Ne(z)}E.chain=Te;function je(z,H,Z=Y=>Y){const Y=(...he)=>V.fire(Z(...he)),b=()=>z.on(H,Y),y=()=>z.removeListener(H,Y),V=new l({onFirstListenerAdd:b,onLastListenerRemove:y});return V.event}E.fromNodeEventEmitter=je;function ie(z,H,Z=Y=>Y){const Y=(...he)=>V.fire(Z(...he)),b=()=>z.addEventListener(H,Y),y=()=>z.removeEventListener(H,Y),V=new l({onFirstListenerAdd:b,onLastListenerRemove:y});return V.event}E.fromDOMEventEmitter=ie;function M(z){return new Promise(H=>w(z)(H))}E.toPromise=M})(G||(G={}));class p{constructor(w){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${w}_${p._idPool++}`}start(w){this._stopWatch=new ue.G(!0),this._listenerCount=w}stop(){if(this._stopWatch){const w=this._stopWatch.elapsed();this._elapsedOverall+=w,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${w.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}p._idPool=0;let se=-1;class ne{constructor(w,F=Math.random().toString(18).slice(2,5)){this.customThreshold=w,this.name=F,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(w){let F=se;if(typeof this.customThreshold=="number"&&(F=this.customThreshold),F<=0||w<F)return;this._stacks||(this._stacks=new Map);const k=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),N=this._stacks.get(k)||0;if(this._stacks.set(k,N+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=F*.5;let L,O=0;for(const[D,C]of this._stacks)(!L||O<C)&&(L=D,O=C);console.warn(`[${this.name}] potential listener LEAK detected, having ${w} listeners already. MOST frequent listener (${O}):`),console.warn(L)}return()=>{const L=this._stacks.get(k)||0;this._stacks.set(k,L-1)}}}class l{constructor(w){var F;this._disposed=!1,this._options=w,this._leakageMon=se>0?new ne(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((F=this._options)===null||F===void 0)&&F._profName?new p(this._options._profName):void 0}get event(){return this._event||(this._event=(w,F,k)=>{var N;this._listeners||(this._listeners=new me.S);const L=this._listeners.isEmpty();L&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const O=this._listeners.push(F?[w,F]:w);L&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,w,F);const D=(N=this._leakageMon)===null||N===void 0?void 0:N.check(this._listeners.size),C=(0,de.OF)(()=>{D&&D(),this._disposed||(O(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return k instanceof de.SL?k.add(C):Array.isArray(k)&&k.push(C),C}),this._event}fire(w){var F,k;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new me.S);for(let N of this._listeners)this._deliveryQueue.push([N,w]);for((F=this._perfMon)===null||F===void 0||F.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[N,L]=this._deliveryQueue.shift();try{typeof N=="function"?N.call(void 0,L):N[0].call(N[1],L)}catch(O){(0,x.dL)(O)}}(k=this._perfMon)===null||k===void 0||k.stop()}}dispose(){var w,F,k,N,L;this._disposed||(this._disposed=!0,(w=this._listeners)===null||w===void 0||w.clear(),(F=this._deliveryQueue)===null||F===void 0||F.clear(),(N=(k=this._options)===null||k===void 0?void 0:k.onLastListenerRemove)===null||N===void 0||N.call(k),(L=this._leakageMon)===null||L===void 0||L.dispose())}}class K extends l{constructor(w){super(w),this._isPaused=0,this._eventQueue=new me.S,this._mergeFn=w==null?void 0:w.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const w=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(w))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(w){this._listeners&&(this._isPaused!==0?this._eventQueue.push(w):super.fire(w))}}class P extends K{constructor(w){var F;super(w),this._delay=(F=w.delay)!==null&&F!==void 0?F:100}fire(w){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(w)}}class m{constructor(){this.buffers=[]}wrapEvent(w){return(F,k,N)=>w(L=>{const O=this.buffers[this.buffers.length-1];O?O.push(()=>F.call(k,L)):F.call(k,L)},void 0,N)}bufferEvents(w){const F=[];this.buffers.push(F);const k=w();return this.buffers.pop(),F.forEach(N=>N()),k}}class _{constructor(){this.listening=!1,this.inputEvent=G.None,this.inputEventListener=de.JT.None,this.emitter=new l({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(w){this.inputEvent=w,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=w(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(Ct,He,S){"use strict";S.d(He,{I:function(){return x}});function x(de){const me=this;let ue=!1,G;return function(){return ue||(ue=!0,G=de.apply(me,arguments)),G}}},88226:function(Ct,He,S){"use strict";S.d(He,{$:function(){return x}});var x;(function(de){function me(O){return O&&typeof O=="object"&&typeof O[Symbol.iterator]=="function"}de.is=me;const ue=Object.freeze([]);function G(){return ue}de.empty=G;function*p(O){yield O}de.single=p;function se(O){return O||ue}de.from=se;function ne(O){return!O||O[Symbol.iterator]().next().done===!0}de.isEmpty=ne;function l(O){return O[Symbol.iterator]().next().value}de.first=l;function K(O,D){for(const C of O)if(D(C))return!0;return!1}de.some=K;function P(O,D){for(const C of O)if(D(C))return C}de.find=P;function*m(O,D){for(const C of O)D(C)&&(yield C)}de.filter=m;function*_(O,D){let C=0;for(const Q of O)yield D(Q,C++)}de.map=_;function*E(...O){for(const D of O)for(const C of D)yield C}de.concat=E;function*w(O){for(const D of O)for(const C of D)yield C}de.concatNested=w;function F(O,D,C){let Q=C;for(const ce of O)Q=D(Q,ce);return Q}de.reduce=F;function*k(O,D,C=O.length){for(D<0&&(D+=O.length),C<0?C+=O.length:C>O.length&&(C=O.length);D<C;D++)yield O[D]}de.slice=k;function N(O,D=Number.POSITIVE_INFINITY){const C=[];if(D===0)return[C,O];const Q=O[Symbol.iterator]();for(let ce=0;ce<D;ce++){const ae=Q.next();if(ae.done)return[C,de.empty()];C.push(ae.value)}return[C,{[Symbol.iterator](){return Q}}]}de.consume=N;function L(O,D,C=(Q,ce)=>Q===ce){const Q=O[Symbol.iterator](),ce=D[Symbol.iterator]();for(;;){const ae=Q.next(),Se=ce.next();if(ae.done!==Se.done)return!1;if(ae.done)return!0;if(!C(ae.value,Se.value))return!1}}de.equals=L})(x||(x={}))},69323:function(Ct,He,S){"use strict";S.d(He,{B9:function(){return _},F8:function(){return E},JT:function(){return k},Jz:function(){return L},OF:function(){return w},SL:function(){return F},Wf:function(){return m},XK:function(){return N},dk:function(){return K}});var x=S(17845),de=S(88226);const me=!1;let ue=null;function G(O){ue=O}if(me){const O="__is_disposable_tracked__";G(new class{trackDisposable(D){const C=new Error("Potentially leaked disposable").stack;setTimeout(()=>{D[O]||console.log(C)},3e3)}setParent(D,C){if(D&&D!==k.None)try{D[O]=!0}catch(Q){}}markAsDisposed(D){if(D&&D!==k.None)try{D[O]=!0}catch(C){}}markAsSingleton(D){}})}function p(O){return ue==null||ue.trackDisposable(O),O}function se(O){ue==null||ue.markAsDisposed(O)}function ne(O,D){ue==null||ue.setParent(O,D)}function l(O,D){if(ue)for(const C of O)ue.setParent(C,D)}function K(O){return ue==null||ue.markAsSingleton(O),O}class P extends Error{constructor(D){super(`Encountered errors while disposing of store. Errors: [${D.join(", ")}]`),this.errors=D}}function m(O){return typeof O.dispose=="function"&&O.dispose.length===0}function _(O){if(de.$.is(O)){let D=[];for(const C of O)if(C)try{C.dispose()}catch(Q){D.push(Q)}if(D.length===1)throw D[0];if(D.length>1)throw new P(D);return Array.isArray(O)?[]:O}else if(O)return O.dispose(),O}function E(...O){const D=w(()=>_(O));return l(O,D),D}function w(O){const D=p({dispose:(0,x.I)(()=>{se(D),O()})});return D}class F{constructor(){this._toDispose=new Set,this._isDisposed=!1,p(this)}dispose(){this._isDisposed||(se(this),this._isDisposed=!0,this.clear())}clear(){try{_(this._toDispose.values())}finally{this._toDispose.clear()}}add(D){if(!D)return D;if(D===this)throw new Error("Cannot register a disposable on itself!");return ne(D,this),this._isDisposed?F.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(D),D}}F.DISABLE_DISPOSED_WARNING=!1;class k{constructor(){this._store=new F,p(this),ne(this._store,this)}dispose(){se(this),this._store.dispose()}_register(D){if(D===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(D)}}k.None=Object.freeze({dispose(){}});class N{constructor(){this._isDisposed=!1,p(this)}get value(){return this._isDisposed?void 0:this._value}set value(D){var C;this._isDisposed||D===this._value||((C=this._value)===null||C===void 0||C.dispose(),D&&ne(D,this),this._value=D)}clear(){this.value=void 0}dispose(){var D;this._isDisposed=!0,se(this),(D=this._value)===null||D===void 0||D.dispose(),this._value=void 0}clearAndLeak(){const D=this._value;return this._value=void 0,D&&ne(D,null),D}}class L{constructor(D){this.object=D}dispose(){}}},34502:function(Ct,He,S){"use strict";S.d(He,{S:function(){return de}});class x{constructor(ue){this.element=ue,this.next=x.Undefined,this.prev=x.Undefined}}x.Undefined=new x(void 0);class de{constructor(){this._first=x.Undefined,this._last=x.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===x.Undefined}clear(){let ue=this._first;for(;ue!==x.Undefined;){const G=ue.next;ue.prev=x.Undefined,ue.next=x.Undefined,ue=G}this._first=x.Undefined,this._last=x.Undefined,this._size=0}unshift(ue){return this._insert(ue,!1)}push(ue){return this._insert(ue,!0)}_insert(ue,G){const p=new x(ue);if(this._first===x.Undefined)this._first=p,this._last=p;else if(G){const ne=this._last;this._last=p,p.prev=ne,ne.next=p}else{const ne=this._first;this._first=p,p.next=ne,ne.prev=p}this._size+=1;let se=!1;return()=>{se||(se=!0,this._remove(p))}}shift(){if(this._first!==x.Undefined){const ue=this._first.element;return this._remove(this._first),ue}}pop(){if(this._last!==x.Undefined){const ue=this._last.element;return this._remove(this._last),ue}}_remove(ue){if(ue.prev!==x.Undefined&&ue.next!==x.Undefined){const G=ue.prev;G.next=ue.next,ue.next.prev=G}else ue.prev===x.Undefined&&ue.next===x.Undefined?(this._first=x.Undefined,this._last=x.Undefined):ue.next===x.Undefined?(this._last=this._last.prev,this._last.next=x.Undefined):ue.prev===x.Undefined&&(this._first=this._first.next,this._first.prev=x.Undefined);this._size-=1}*[Symbol.iterator](){let ue=this._first;for(;ue!==x.Undefined;)yield ue.element,ue=ue.next}}},23345:function(Ct,He,S){"use strict";S.d(He,{$L:function(){return Q},ED:function(){return L},IJ:function(){return D},OS:function(){return Ne},WE:function(){return ae},dz:function(){return O},gn:function(){return ce},li:function(){return w},r:function(){return ie},tY:function(){return C},xS:function(){return Se}});var x=S(97671),de;const me="en";let ue=!1,G=!1,p=!1,se=!1,ne=!1,l=!1,K=!1,P,m=null,_=null,E;const w=typeof self=="object"?self:typeof S.g=="object"?S.g:{};let F;typeof w.vscode!="undefined"&&typeof w.vscode.process!="undefined"?F=w.vscode.process:typeof x!="undefined"&&(F=x);const k=typeof((de=F==null?void 0:F.versions)===null||de===void 0?void 0:de.electron)=="string"&&F.type==="renderer";if(typeof navigator=="object"&&!k)E=navigator.userAgent,ue=E.indexOf("Windows")>=0,G=E.indexOf("Macintosh")>=0,K=(E.indexOf("Macintosh")>=0||E.indexOf("iPad")>=0||E.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,p=E.indexOf("Linux")>=0,l=!0,P=navigator.language,m=P;else if(typeof F=="object"){ue=F.platform==="win32",G=F.platform==="darwin",p=F.platform==="linux",se=p&&!!F.env.SNAP&&!!F.env.SNAP_REVISION,P=me,m=me;const M=F.env.VSCODE_NLS_CONFIG;if(M)try{const z=JSON.parse(M),H=z.availableLanguages["*"];P=z.locale,m=H||me,_=z._translationsConfigFile}catch(z){}ne=!0}else console.error("Unable to resolve platform.");let N=0;G?N=1:ue?N=3:p&&(N=2);const L=ue,O=G,D=p,C=ne,Q=l,ce=K,ae=E,Se=function(){if(w.setImmediate)return w.setImmediate.bind(w);if(typeof w.postMessage=="function"&&!w.importScripts){let H=[];w.addEventListener("message",Y=>{if(Y.data&&Y.data.vscodeSetImmediateId)for(let b=0,y=H.length;b<y;b++){const V=H[b];if(V.id===Y.data.vscodeSetImmediateId){H.splice(b,1),V.callback();return}}});let Z=0;return Y=>{const b=++Z;H.push({id:b,callback:Y}),w.postMessage({vscodeSetImmediateId:b},"*")}}if(typeof(F==null?void 0:F.nextTick)=="function")return F.nextTick.bind(F);const z=Promise.resolve();return H=>z.then(H)}(),Ne=G||K?2:ue?1:3;let Te=!0,je=!1;function ie(){if(!je){je=!0;const M=new Uint8Array(2);M[0]=1,M[1]=2,Te=new Uint16Array(M.buffer)[0]===513}return Te}},95830:function(Ct,He,S){"use strict";S.d(He,{G:function(){return me}});var x=S(23345);const de=x.li.performance&&typeof x.li.performance.now=="function";class me{constructor(G){this._highResolution=de&&G,this._startTime=this._now(),this._stopTime=-1}static create(G=!0){return new me(G)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?x.li.performance.now():Date.now()}}},82983:function(Ct,He,S){"use strict";S.d(He,{$i:function(){return be},C8:function(){return et},GF:function(){return P},HO:function(){return Z},IO:function(){return m},K7:function(){return ke},Kw:function(){return xe},LC:function(){return w},Mh:function(){return Se},P1:function(){return Ne},PJ:function(){return it},Qe:function(){return Pe},R1:function(){return K},RP:function(){return V},S6:function(){return $e},TT:function(){return L},Ut:function(){return b},V8:function(){return F},WU:function(){return me},YK:function(){return je},YU:function(){return ue},ZG:function(){return Te},ZH:function(){return M},ab:function(){return oe},c1:function(){return Oe},df:function(){return Q},ec:function(){return G},fi:function(){return De},fy:function(){return p},j3:function(){return se},j_:function(){return D},m5:function(){return x},mK:function(){return C},mr:function(){return _},oH:function(){return re},oL:function(){return ne},ok:function(){return ae},ow:function(){return k},qq:function(){return ce},qu:function(){return N},rL:function(){return ie},uS:function(){return qe},un:function(){return l},uq:function(){return E},vH:function(){return H},xe:function(){return Ae},zY:function(){return O}});function x(A){return!A||typeof A!="string"?!0:A.trim().length===0}const de=/{(\d+)}/g;function me(A,...U){return U.length===0?A:A.replace(de,function(X,W){const $=parseInt(W,10);return isNaN($)||$<0||$>=U.length?X:U[$]})}function ue(A){return A.replace(/[<>&]/g,function(U){switch(U){case"<":return"<";case">":return">";case"&":return"&";default:return U}})}function G(A){return A.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function p(A,U=" "){const X=se(A,U);return ne(X,U)}function se(A,U){if(!A||!U)return A;const X=U.length;if(X===0||A.length===0)return A;let W=0;for(;A.indexOf(U,W)===W;)W=W+X;return A.substring(W)}function ne(A,U){if(!A||!U)return A;const X=U.length,W=A.length;if(X===0||W===0)return A;let $=W,ee=-1;for(;ee=A.lastIndexOf(U,$-1),!(ee===-1||ee+X!==$);){if(ee===0)return"";$=ee}return A.substring(0,$)}function l(A){return A.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function K(A){return A.replace(/\*/g,"")}function P(A,U,X={}){if(!A)throw new Error("Cannot create regex from empty string");U||(A=G(A)),X.wholeWord&&(/\B/.test(A.charAt(0))||(A="\\b"+A),/\B/.test(A.charAt(A.length-1))||(A=A+"\\b"));let W="";return X.global&&(W+="g"),X.matchCase||(W+="i"),X.multiline&&(W+="m"),X.unicode&&(W+="u"),new RegExp(A,W)}function m(A){return A.source==="^"||A.source==="^$"||A.source==="$"||A.source==="^\\s*$"?!1:!!(A.exec("")&&A.lastIndex===0)}function _(A){return(A.global?"g":"")+(A.ignoreCase?"i":"")+(A.multiline?"m":"")+(A.unicode?"u":"")}function E(A){return A.split(/\r\n|\r|\n/)}function w(A){for(let U=0,X=A.length;U<X;U++){const W=A.charCodeAt(U);if(W!==32&&W!==9)return U}return-1}function F(A,U=0,X=A.length){for(let W=U;W<X;W++){const $=A.charCodeAt(W);if($!==32&&$!==9)return A.substring(U,W)}return A.substring(U,X)}function k(A,U=A.length-1){for(let X=U;X>=0;X--){const W=A.charCodeAt(X);if(W!==32&&W!==9)return X}return-1}function N(A,U){return A<U?-1:A>U?1:0}function L(A,U,X=0,W=A.length,$=0,ee=U.length){for(;X<W&&$<ee;X++,$++){let we=A.charCodeAt(X),ze=U.charCodeAt($);if(we<ze)return-1;if(we>ze)return 1}const le=W-X,ge=ee-$;return le<ge?-1:le>ge?1:0}function O(A,U){return D(A,U,0,A.length,0,U.length)}function D(A,U,X=0,W=A.length,$=0,ee=U.length){for(;X<W&&$<ee;X++,$++){let we=A.charCodeAt(X),ze=U.charCodeAt($);if(we===ze)continue;if(we>=128||ze>=128)return L(A.toLowerCase(),U.toLowerCase(),X,W,$,ee);C(we)&&(we-=32),C(ze)&&(ze-=32);const Ue=we-ze;if(Ue!==0)return Ue}const le=W-X,ge=ee-$;return le<ge?-1:le>ge?1:0}function C(A){return A>=97&&A<=122}function Q(A){return A>=65&&A<=90}function ce(A,U){return A.length===U.length&&D(A,U)===0}function ae(A,U){const X=U.length;return U.length>A.length?!1:D(A,U,0,X)===0}function Se(A,U){let X,W=Math.min(A.length,U.length);for(X=0;X<W;X++)if(A.charCodeAt(X)!==U.charCodeAt(X))return X;return W}function Ne(A,U){let X,W=Math.min(A.length,U.length);const $=A.length-1,ee=U.length-1;for(X=0;X<W;X++)if(A.charCodeAt($-X)!==U.charCodeAt(ee-X))return X;return W}function Te(A){return 55296<=A&&A<=56319}function je(A){return 56320<=A&&A<=57343}function ie(A,U){return(A-55296<<10)+(U-56320)+65536}function M(A,U,X){const W=A.charCodeAt(X);if(Te(W)&&X+1<U){const $=A.charCodeAt(X+1);if(je($))return ie(W,$)}return W}function z(A,U){const X=A.charCodeAt(U-1);if(je(X)&&U>1){const W=A.charCodeAt(U-2);if(Te(W))return ie(W,X)}return X}function H(A,U){const X=ve.getInstance(),W=U,$=A.length,ee=M(A,$,U);U+=ee>=65536?2:1;let le=X.getGraphemeBreakType(ee);for(;U<$;){const ge=M(A,$,U),we=X.getGraphemeBreakType(ge);if(De(le,we))break;U+=ge>=65536?2:1,le=we}return U-W}function Z(A,U){const X=ve.getInstance(),W=U,$=z(A,U);U-=$>=65536?2:1;let ee=X.getGraphemeBreakType($);for(;U>0;){const le=z(A,U),ge=X.getGraphemeBreakType(le);if(De(ge,ee))break;U-=le>=65536?2:1,ee=ge}return W-U}const Y=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function b(A){return Y.test(A)}const y=/(?:[\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 V(A){return y.test(A)}const he=/^[\t\n\r\x20-\x7E]*$/;function be(A){return he.test(A)}const Pe=/[\u2028\u2029]/;function oe(A){return Pe.test(A)}function Ae(A){for(let U=0,X=A.length;U<X;U++)if(ke(A.charCodeAt(U)))return!0;return!1}function ke(A){return A=+A,A>=11904&&A<=55215||A>=63744&&A<=64255||A>=65281&&A<=65374}function et(A){return A>=127462&&A<=127487||A===8986||A===8987||A===9200||A===9203||A>=9728&&A<=10175||A===11088||A===11093||A>=127744&&A<=128591||A>=128640&&A<=128764||A>=128992&&A<=129003||A>=129280&&A<=129535||A>=129648&&A<=129750}const Oe="\uFEFF";function qe(A){return!!(A&&A.length>0&&A.charCodeAt(0)===65279)}function xe(A,U=!1){return A?(U&&(A=A.replace(/\\./g,"")),A.toLowerCase()!==A):!1}function it(A){return A=A%(2*26),A<26?String.fromCharCode(97+A):String.fromCharCode(65+A-26)}function $e(A){return ve.getInstance().getGraphemeBreakType(A)}function De(A,U){return A===0?U!==5&&U!==7:A===2&&U===3?!1:A===4||A===2||A===3||U===4||U===2||U===3?!0:!(A===8&&(U===8||U===9||U===11||U===12)||(A===11||A===9)&&(U===9||U===10)||(A===12||A===10)&&U===10||U===5||U===13||U===7||A===1||A===13&&U===14||A===6&&U===6)}class ve{constructor(){this._data=Le()}static getInstance(){return ve._INSTANCE||(ve._INSTANCE=new ve),ve._INSTANCE}getGraphemeBreakType(U){if(U<32)return U===10?3:U===13?2:4;if(U<127)return 0;const X=this._data,W=X.length/3;let $=1;for(;$<=W;)if(U<X[3*$])$=2*$;else if(U>X[3*$+1])$=2*$+1;else return X[3*$+2];return 0}}ve._INSTANCE=null;function Le(){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 re(A,U){if(A===0)return 0;const X=Re(A,U);if(X!==void 0)return X;const W=z(U,A);return A-=fe(W),A}function Re(A,U){let X=z(U,A);for(A-=fe(X);B(X)||X===65039||X===8419;){if(A===0)return;X=z(U,A),A-=fe(X)}if(et(X)){if(A>=0){const W=z(U,A);W===8205&&(A-=fe(W))}return A}}function fe(A){return A>=65536?2:1}function B(A){return 127995<=A&&A<=127999}},72999:function(Ct,He,S){"use strict";S.d(He,{$E:function(){return w},$K:function(){return se},D8:function(){return m},HD:function(){return de},IU:function(){return F},Jp:function(){return ne},Kn:function(){return me},cW:function(){return K},f6:function(){return k},hj:function(){return ue},jn:function(){return G},kJ:function(){return x},mf:function(){return P},o8:function(){return p},p_:function(){return l},vE:function(){return N}});function x(L){return Array.isArray(L)}function de(L){return typeof L=="string"}function me(L){return typeof L=="object"&&L!==null&&!Array.isArray(L)&&!(L instanceof RegExp)&&!(L instanceof Date)}function ue(L){return typeof L=="number"&&!isNaN(L)}function G(L){return L===!0||L===!1}function p(L){return typeof L=="undefined"}function se(L){return!ne(L)}function ne(L){return p(L)||L===null}function l(L,O){if(!L)throw new Error(O?`Unexpected type, expected '${O}'`:"Unexpected type")}function K(L){if(ne(L))throw new Error("Assertion Failed: argument is undefined or null");return L}function P(L){return typeof L=="function"}function m(L,O){const D=Math.min(L.length,O.length);for(let C=0;C<D;C++)_(L[C],O[C])}function _(L,O){if(de(O)){if(typeof L!==O)throw new Error(`argument does not match constraint: typeof ${O}`)}else if(P(O)){try{if(L instanceof O)return}catch(D){}if(!ne(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 E(L){let O=[],D=Object.getPrototypeOf(L);for(;Object.prototype!==D;)O=O.concat(Object.getOwnPropertyNames(D)),D=Object.getPrototypeOf(D);return O}function w(L){const O=[];for(const D of E(L))typeof L[D]=="function"&&O.push(D);return O}function F(L,O){const D=Q=>function(){const ce=Array.prototype.slice.call(arguments,0);return O(Q,ce)};let C={};for(const Q of L)C[Q]=D(Q);return C}function k(L){return L===null?void 0:L}function N(L,O="Unreachable"){throw new Error(O)}},13268:function(Ct,He,S){"use strict";S.d(He,{N:function(){return de}});function x(me,ue){let G;return ue.length===0?G=me:G=me.replace(/\{(\d+)\}/g,function(p,se){const ne=se[0];return typeof ue[ne]!="undefined"?ue[ne]:p}),G}function de(me,ue,...G){return x(ue,G)}},96236:function(Ct,He,S){"use strict";S.d(He,{BH:function(){return F},NZ:function(){return k},U8:function(){return N},co:function(){return w},eH:function(){return E},vr:function(){return _}});var x=S(75918),de=S(52615),me=S(4348),ue=S(88226),G=S(69323),p=S(34502),se=S(35884),ne=S(90689),l=S(16925),K=S(49055),P=function(L,O,D,C){var Q=arguments.length,ce=Q<3?O:C===null?C=Object.getOwnPropertyDescriptor(O,D):C,ae;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ce=Reflect.decorate(L,O,D,C);else for(var Se=L.length-1;Se>=0;Se--)(ae=L[Se])&&(ce=(Q<3?ae(ce):Q>3?ae(O,D,ce):ae(O,D))||ce);return Q>3&&ce&&Object.defineProperty(O,D,ce),ce},m=function(L,O){return function(D,C){O(D,C,L)}};function _(L){return L.command!==void 0}class E{constructor(O){this.id=E._idPool++,this._debugName=O}}E._idPool=0,E.CommandPalette=new E("CommandPalette"),E.EditorContext=new E("EditorContext"),E.SimpleEditorContext=new E("SimpleEditorContext"),E.EditorContextCopy=new E("EditorContextCopy"),E.EditorContextPeek=new E("EditorContextPeek"),E.MenubarEditMenu=new E("MenubarEditMenu"),E.MenubarCopy=new E("MenubarCopy"),E.MenubarGoMenu=new E("MenubarGoMenu"),E.MenubarSelectionMenu=new E("MenubarSelectionMenu"),E.InlineCompletionsActions=new E("InlineCompletionsActions");const w=(0,l.yh)("menuService"),F=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new me.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:L=>L===E.CommandPalette}}addCommand(L){return this.addCommands(ue.$.single(L))}addCommands(L){for(const O of L)this._commands.set(O.id,O);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,G.OF)(()=>{let O=!1;for(const D of L)O=this._commands.delete(D.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,D)=>L.set(D,O)),L}appendMenuItem(L,O){return this.appendMenuItems(ue.$.single({id:L,item:O}))}appendMenuItems(L){const O=new Set,D=new p.S;for(const{id:C,item:Q}of L){let ce=this._menuItems.get(C);ce||(ce=new p.S,this._menuItems.set(C,ce)),D.push(ce.push(Q)),O.add(C)}return this._onDidChangeMenu.fire(O),(0,G.OF)(()=>{if(D.size>0){for(let C of D)C();this._onDidChangeMenu.fire(O),D.clear()}})}getMenuItems(L){let O;return this._menuItems.has(L)?O=[...this._menuItems.get(L)]:O=[],L===E.CommandPalette&&this._appendImplicitItems(O),O}_appendImplicitItems(L){const O=new Set;for(const D of L)_(D)&&(O.add(D.command.id),D.alt&&O.add(D.alt.id));this._commands.forEach((D,C)=>{O.has(C)||L.push({command:D})})}};class k extends x.wY{constructor(O,D,C,Q){super(`submenuitem.${O.submenu.id}`,typeof O.title=="string"?O.title:O.title.value,[],"submenu"),this.item=O,this._menuService=D,this._contextKeyService=C,this._options=Q}get actions(){const O=[],D=this._menuService.createMenu(this.item.submenu,this._contextKeyService),C=D.getActions(this._options);D.dispose();for(const[,Q]of C)Q.length>0&&(O.push(...Q),O.push(new x.Z0));return O.length&&O.pop(),O}}let N=class Tl{constructor(O,D,C,Q,ce){var ae,Se;if(this._commandService=ce,this.id=O.id,this.label=C!=null&&C.renderShortTitle&&O.shortTitle?typeof O.shortTitle=="string"?O.shortTitle:O.shortTitle.value:typeof O.title=="string"?O.title:O.title.value,this.tooltip=(Se=typeof O.tooltip=="string"?O.tooltip:(ae=O.tooltip)===null||ae===void 0?void 0:ae.value)!==null&&Se!==void 0?Se:"",this.enabled=!O.precondition||Q.contextMatchesRules(O.precondition),this.checked=void 0,O.toggled){const Ne=O.toggled.condition?O.toggled:{condition:O.toggled};this.checked=Q.contextMatchesRules(Ne.condition),this.checked&&Ne.tooltip&&(this.tooltip=typeof Ne.tooltip=="string"?Ne.tooltip:Ne.tooltip.value),Ne.title&&(this.label=typeof Ne.title=="string"?Ne.title:Ne.title.value)}this.item=O,this.alt=D?new Tl(D,void 0,C,Q,ce):void 0,this._options=C,K.kS.isThemeIcon(O.icon)&&(this.class=de.dT.asClassName(O.icon))}dispose(){}run(...O){var D,C;let Q=[];return!((D=this._options)===null||D===void 0)&&D.arg&&(Q=[...Q,this._options.arg]),!((C=this._options)===null||C===void 0)&&C.shouldForwardArgs&&(Q=[...Q,...O]),this._commandService.executeCommand(this.id,...Q)}};N=P([m(3,ne.i6),m(4,se.H)],N)},35884:function(Ct,He,S){"use strict";S.d(He,{H:function(){return se},P:function(){return ne}});var x=S(4348),de=S(88226),me=S(69323),ue=S(34502),G=S(72999),p=S(16925);const se=(0,p.yh)("commandService"),ne=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new x.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(l,K){if(!l)throw new Error("invalid command");if(typeof l=="string"){if(!K)throw new Error("invalid command");return this.registerCommand({id:l,handler:K})}if(l.description){const w=[];for(let k of l.description.args)w.push(k.constraint);const F=l.handler;l.handler=function(k,...N){return(0,G.D8)(N,w),F(k,...N)}}const{id:P}=l;let m=this._commands.get(P);m||(m=new ue.S,this._commands.set(P,m));let _=m.unshift(l),E=(0,me.OF)(()=>{_();const w=this._commands.get(P);w!=null&&w.isEmpty()&&this._commands.delete(P)});return this._onDidRegisterCommand.fire(P),E}registerCommandAlias(l,K){return ne.registerCommand(l,(P,...m)=>P.get(se).executeCommand(K,...m))}getCommand(l){const K=this._commands.get(l);if(!(!K||K.isEmpty()))return de.$.first(K)}getCommands(){const l=new Map;for(const K of this._commands.keys()){const P=this.getCommand(K);P&&l.set(K,P)}return l}};ne.registerCommand("noop",()=>{})},90689:function(Ct,He,S){"use strict";S.d(He,{Ao:function(){return se},Eq:function(){return ie},Fb:function(){return ne},K8:function(){return H},i6:function(){return je},uy:function(){return Te}});var x=S(23345),de=S(82983),me=S(16925);let ue=x.WE||"";const G=new Map;G.set("false",!1),G.set("true",!0),G.set("isMac",x.dz),G.set("isLinux",x.IJ),G.set("isWindows",x.ED),G.set("isWeb",x.$L),G.set("isMacNative",x.dz&&!x.$L),G.set("isEdge",ue.indexOf("Edg/")>=0),G.set("isFirefox",ue.indexOf("Firefox")>=0),G.set("isChrome",ue.indexOf("Chrome")>=0),G.set("isSafari",ue.indexOf("Safari")>=0);const p=Object.prototype.hasOwnProperty;class se{static has(b){return m.create(b)}static equals(b,y){return _.create(b,y)}static regex(b,y){return Q.create(b,y)}static not(b){return k.create(b)}static and(...b){return Se.create(b,null)}static or(...b){return Ne.create(b,null,!0)}static deserialize(b,y=!1){if(b)return this._deserializeOrExpression(b,y)}static _deserializeOrExpression(b,y){let V=b.split("||");return Ne.create(V.map(he=>this._deserializeAndExpression(he,y)),null,!0)}static _deserializeAndExpression(b,y){let V=b.split("&&");return Se.create(V.map(he=>this._deserializeOne(he,y)),null)}static _deserializeOne(b,y){if(b=b.trim(),b.indexOf("!=")>=0){let V=b.split("!=");return F.create(V[0].trim(),this._deserializeValue(V[1],y))}if(b.indexOf("==")>=0){let V=b.split("==");return _.create(V[0].trim(),this._deserializeValue(V[1],y))}if(b.indexOf("=~")>=0){let V=b.split("=~");return Q.create(V[0].trim(),this._deserializeRegexValue(V[1],y))}if(b.indexOf(" in ")>=0){let V=b.split(" in ");return E.create(V[0].trim(),V[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(b)){const V=b.split(">=");return O.create(V[0].trim(),V[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(b)){const V=b.split(">");return L.create(V[0].trim(),V[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(b)){const V=b.split("<=");return C.create(V[0].trim(),V[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(b)){const V=b.split("<");return D.create(V[0].trim(),V[1].trim())}return/^\!\s*/.test(b)?k.create(b.substr(1).trim()):m.create(b)}static _deserializeValue(b,y){if(b=b.trim(),b==="true")return!0;if(b==="false")return!1;let V=/^'([^']*)'$/.exec(b);return V?V[1].trim():b}static _deserializeRegexValue(b,y){if((0,de.m5)(b)){if(y)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let V=b.indexOf("/"),he=b.lastIndexOf("/");if(V===he||V<0){if(y)throw new Error(`bad regexp-value '${b}', missing /-enclosure`);return console.warn(`bad regexp-value '${b}', missing /-enclosure`),null}let be=b.slice(V+1,he),Pe=b[he+1]==="i"?"i":"";try{return new RegExp(be,Pe)}catch(oe){if(y)throw new Error(`bad regexp-value '${b}', parse error: ${oe}`);return console.warn(`bad regexp-value '${b}', parse error: ${oe}`),null}}}function ne(Y,b){const y=Y?Y.substituteConstants():void 0,V=b?b.substituteConstants():void 0;return!y&&!V?!0:!y||!V?!1:y.equals(V)}function l(Y,b){return Y.cmp(b)}class K{constructor(){this.type=0}cmp(b){return this.type-b.type}equals(b){return b.type===this.type}substituteConstants(){return this}evaluate(b){return!1}serialize(){return"false"}keys(){return[]}negate(){return P.INSTANCE}}K.INSTANCE=new K;class P{constructor(){this.type=1}cmp(b){return this.type-b.type}equals(b){return b.type===this.type}substituteConstants(){return this}evaluate(b){return!0}serialize(){return"true"}keys(){return[]}negate(){return K.INSTANCE}}P.INSTANCE=new P;class m{constructor(b,y){this.key=b,this.negated=y,this.type=2}static create(b,y=null){const V=G.get(b);return typeof V=="boolean"?V?P.INSTANCE:K.INSTANCE:new m(b,y)}cmp(b){return b.type!==this.type?this.type-b.type:M(this.key,b.key)}equals(b){return b.type===this.type?this.key===b.key:!1}substituteConstants(){const b=G.get(this.key);return typeof b=="boolean"?b?P.INSTANCE:K.INSTANCE:this}evaluate(b){return!!b.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=k.create(this.key,this)),this.negated}}class _{constructor(b,y,V){this.key=b,this.value=y,this.negated=V,this.type=4}static create(b,y,V=null){if(typeof y=="boolean")return y?m.create(b,V):k.create(b,V);const he=G.get(b);return typeof he=="boolean"?y===(he?"true":"false")?P.INSTANCE:K.INSTANCE:new _(b,y,V)}cmp(b){return b.type!==this.type?this.type-b.type:z(this.key,this.value,b.key,b.value)}equals(b){return b.type===this.type?this.key===b.key&&this.value===b.value:!1}substituteConstants(){const b=G.get(this.key);if(typeof b=="boolean"){const y=b?"true":"false";return this.value===y?P.INSTANCE:K.INSTANCE}return this}evaluate(b){return b.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=F.create(this.key,this.value,this)),this.negated}}class E{constructor(b,y){this.key=b,this.valueKey=y,this.type=10,this.negated=null}static create(b,y){return new E(b,y)}cmp(b){return b.type!==this.type?this.type-b.type:z(this.key,this.valueKey,b.key,b.valueKey)}equals(b){return b.type===this.type?this.key===b.key&&this.valueKey===b.valueKey:!1}substituteConstants(){return this}evaluate(b){const y=b.getValue(this.valueKey),V=b.getValue(this.key);return Array.isArray(y)?y.indexOf(V)>=0:typeof V=="string"&&typeof y=="object"&&y!==null?p.call(y,V):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=w.create(this)),this.negated}}class w{constructor(b){this._actual=b,this.type=11}static create(b){return new w(b)}cmp(b){return b.type!==this.type?this.type-b.type:this._actual.cmp(b._actual)}equals(b){return b.type===this.type?this._actual.equals(b._actual):!1}substituteConstants(){return this}evaluate(b){return!this._actual.evaluate(b)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class F{constructor(b,y,V){this.key=b,this.value=y,this.negated=V,this.type=5}static create(b,y,V=null){if(typeof y=="boolean")return y?k.create(b,V):m.create(b,V);const he=G.get(b);return typeof he=="boolean"?y===(he?"true":"false")?K.INSTANCE:P.INSTANCE:new F(b,y,V)}cmp(b){return b.type!==this.type?this.type-b.type:z(this.key,this.value,b.key,b.value)}equals(b){return b.type===this.type?this.key===b.key&&this.value===b.value:!1}substituteConstants(){const b=G.get(this.key);if(typeof b=="boolean"){const y=b?"true":"false";return this.value===y?K.INSTANCE:P.INSTANCE}return this}evaluate(b){return b.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_.create(this.key,this.value,this)),this.negated}}class k{constructor(b,y){this.key=b,this.negated=y,this.type=3}static create(b,y=null){const V=G.get(b);return typeof V=="boolean"?V?K.INSTANCE:P.INSTANCE:new k(b,y)}cmp(b){return b.type!==this.type?this.type-b.type:M(this.key,b.key)}equals(b){return b.type===this.type?this.key===b.key:!1}substituteConstants(){const b=G.get(this.key);return typeof b=="boolean"?b?K.INSTANCE:P.INSTANCE:this}evaluate(b){return!b.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this)),this.negated}}function N(Y,b){if(typeof Y=="string"){const y=parseFloat(Y);isNaN(y)||(Y=y)}return typeof Y=="string"||typeof Y=="number"?b(Y):K.INSTANCE}class L{constructor(b,y,V){this.key=b,this.value=y,this.negated=V,this.type=12}static create(b,y,V=null){return N(y,he=>new L(b,he,V))}cmp(b){return b.type!==this.type?this.type-b.type:z(this.key,this.value,b.key,b.value)}equals(b){return b.type===this.type?this.key===b.key&&this.value===b.value:!1}substituteConstants(){return this}evaluate(b){return typeof this.value=="string"?!1:parseFloat(b.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=C.create(this.key,this.value,this)),this.negated}}class O{constructor(b,y,V){this.key=b,this.value=y,this.negated=V,this.type=13}static create(b,y,V=null){return N(y,he=>new O(b,he,V))}cmp(b){return b.type!==this.type?this.type-b.type:z(this.key,this.value,b.key,b.value)}equals(b){return b.type===this.type?this.key===b.key&&this.value===b.value:!1}substituteConstants(){return this}evaluate(b){return typeof this.value=="string"?!1:parseFloat(b.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this.key,this.value,this)),this.negated}}class D{constructor(b,y,V){this.key=b,this.value=y,this.negated=V,this.type=14}static create(b,y,V=null){return N(y,he=>new D(b,he,V))}cmp(b){return b.type!==this.type?this.type-b.type:z(this.key,this.value,b.key,b.value)}equals(b){return b.type===this.type?this.key===b.key&&this.value===b.value:!1}substituteConstants(){return this}evaluate(b){return typeof this.value=="string"?!1:parseFloat(b.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=O.create(this.key,this.value,this)),this.negated}}class C{constructor(b,y,V){this.key=b,this.value=y,this.negated=V,this.type=15}static create(b,y,V=null){return N(y,he=>new C(b,he,V))}cmp(b){return b.type!==this.type?this.type-b.type:z(this.key,this.value,b.key,b.value)}equals(b){return b.type===this.type?this.key===b.key&&this.value===b.value:!1}substituteConstants(){return this}evaluate(b){return typeof this.value=="string"?!1:parseFloat(b.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this.key,this.value,this)),this.negated}}class Q{constructor(b,y){this.key=b,this.regexp=y,this.type=7,this.negated=null}static create(b,y){return new Q(b,y)}cmp(b){if(b.type!==this.type)return this.type-b.type;if(this.key<b.key)return-1;if(this.key>b.key)return 1;const y=this.regexp?this.regexp.source:"",V=b.regexp?b.regexp.source:"";return y<V?-1:y>V?1:0}equals(b){if(b.type===this.type){const y=this.regexp?this.regexp.source:"",V=b.regexp?b.regexp.source:"";return this.key===b.key&&y===V}return!1}substituteConstants(){return this}evaluate(b){let y=b.getValue(this.key);return this.regexp?this.regexp.test(y):!1}serialize(){const b=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${b}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ce.create(this)),this.negated}}class ce{constructor(b){this._actual=b,this.type=8}static create(b){return new ce(b)}cmp(b){return b.type!==this.type?this.type-b.type:this._actual.cmp(b._actual)}equals(b){return b.type===this.type?this._actual.equals(b._actual):!1}substituteConstants(){return this}evaluate(b){return!this._actual.evaluate(b)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function ae(Y){let b=null;for(let y=0,V=Y.length;y<V;y++){const he=Y[y].substituteConstants();if(Y[y]!==he&&b===null){b=[];for(let be=0;be<y;be++)b[be]=Y[be]}b!==null&&(b[y]=he)}return b===null?Y:b}class Se{constructor(b,y){this.expr=b,this.negated=y,this.type=6}static create(b,y){return Se._normalizeArr(b,y)}cmp(b){if(b.type!==this.type)return this.type-b.type;if(this.expr.length<b.expr.length)return-1;if(this.expr.length>b.expr.length)return 1;for(let y=0,V=this.expr.length;y<V;y++){const he=l(this.expr[y],b.expr[y]);if(he!==0)return he}return 0}equals(b){if(b.type===this.type){if(this.expr.length!==b.expr.length)return!1;for(let y=0,V=this.expr.length;y<V;y++)if(!this.expr[y].equals(b.expr[y]))return!1;return!0}return!1}substituteConstants(){const b=ae(this.expr);return b===this.expr?this:Se.create(b,this.negated)}evaluate(b){for(let y=0,V=this.expr.length;y<V;y++)if(!this.expr[y].evaluate(b))return!1;return!0}static _normalizeArr(b,y){const V=[];let he=!1;for(const be of b)if(be){if(be.type===1){he=!0;continue}if(be.type===0)return K.INSTANCE;if(be.type===6){V.push(...be.expr);continue}V.push(be)}if(V.length===0&&he)return P.INSTANCE;if(V.length!==0){if(V.length===1)return V[0];V.sort(l);for(let be=1;be<V.length;be++)V[be-1].equals(V[be])&&(V.splice(be,1),be--);if(V.length===1)return V[0];for(;V.length>1;){const be=V[V.length-1];if(be.type!==9)break;V.pop();const Pe=V.pop(),oe=V.length===0,Ae=Ne.create(be.expr.map(ke=>Se.create([ke,Pe],null)),null,oe);Ae&&(V.push(Ae),V.sort(l))}return V.length===1?V[0]:new Se(V,y)}}serialize(){return this.expr.map(b=>b.serialize()).join(" && ")}keys(){const b=[];for(let y of this.expr)b.push(...y.keys());return b}negate(){if(!this.negated){const b=[];for(let y of this.expr)b.push(y.negate());this.negated=Ne.create(b,this,!0)}return this.negated}}class Ne{constructor(b,y){this.expr=b,this.negated=y,this.type=9}static create(b,y,V){return Ne._normalizeArr(b,y,V)}cmp(b){if(b.type!==this.type)return this.type-b.type;if(this.expr.length<b.expr.length)return-1;if(this.expr.length>b.expr.length)return 1;for(let y=0,V=this.expr.length;y<V;y++){const he=l(this.expr[y],b.expr[y]);if(he!==0)return he}return 0}equals(b){if(b.type===this.type){if(this.expr.length!==b.expr.length)return!1;for(let y=0,V=this.expr.length;y<V;y++)if(!this.expr[y].equals(b.expr[y]))return!1;return!0}return!1}substituteConstants(){const b=ae(this.expr);return b===this.expr?this:Ne.create(b,this.negated,!1)}evaluate(b){for(let y=0,V=this.expr.length;y<V;y++)if(this.expr[y].evaluate(b))return!0;return!1}static _normalizeArr(b,y,V){let he=[],be=!1;if(b){for(let Pe=0,oe=b.length;Pe<oe;Pe++){const Ae=b[Pe];if(Ae){if(Ae.type===0){be=!0;continue}if(Ae.type===1)return P.INSTANCE;if(Ae.type===9){he=he.concat(Ae.expr);continue}he.push(Ae)}}if(he.length===0&&be)return K.INSTANCE;he.sort(l)}if(he.length!==0){if(he.length===1)return he[0];for(let Pe=1;Pe<he.length;Pe++)he[Pe-1].equals(he[Pe])&&(he.splice(Pe,1),Pe--);if(he.length===1)return he[0];if(V){for(let Pe=0;Pe<he.length;Pe++)for(let oe=Pe+1;oe<he.length;oe++)H(he[Pe],he[oe])&&(he.splice(oe,1),oe--);if(he.length===1)return he[0]}return new Ne(he,y)}}serialize(){return this.expr.map(b=>b.serialize()).join(" || ")}keys(){const b=[];for(let y of this.expr)b.push(...y.keys());return b}negate(){if(!this.negated){let b=[];for(let y of this.expr)b.push(y.negate());for(;b.length>1;){const y=b.shift(),V=b.shift(),he=[];for(const Pe of Z(y))for(const oe of Z(V))he.push(Se.create([Pe,oe],null));const be=b.length===0;b.unshift(Ne.create(he,null,be))}this.negated=b[0]}return this.negated}}class Te extends m{constructor(b,y,V){super(b,null),this._defaultValue=y,typeof V=="object"?Te._info.push(Object.assign(Object.assign({},V),{key:b})):V!==!0&&Te._info.push({key:b,description:V,type:y!=null?typeof y:void 0})}static all(){return Te._info.values()}bindTo(b){return b.createKey(this.key,this._defaultValue)}getValue(b){return b.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(b){return _.create(this.key,b)}}Te._info=[];const je=(0,me.yh)("contextKeyService"),ie="setContext";function M(Y,b){return Y<b?-1:Y>b?1:0}function z(Y,b,y,V){return Y<y?-1:Y>y?1:b<V?-1:b>V?1:0}function H(Y,b){if(b.type===6&&Y.type!==9&&Y.type!==6){for(const he of b.expr)if(Y.equals(he))return!0}const y=Y.negate(),V=Z(y).concat(Z(b));V.sort(l);for(let he=0;he<V.length;he++){const Pe=V[he].negate();for(let oe=he+1;oe<V.length;oe++){const Ae=V[oe];if(Pe.equals(Ae))return!0}}return!1}function Z(Y){return Y.type===9?Y.expr:[Y]}},16925:function(Ct,He,S){"use strict";S.d(He,{I8:function(){return x},TG:function(){return de},jt:function(){return G},yh:function(){return ue}});var x;(function(p){p.serviceIds=new Map,p.DI_TARGET="$di$target",p.DI_DEPENDENCIES="$di$dependencies";function se(ne){return ne[p.DI_DEPENDENCIES]||[]}p.getServiceDependencies=se})(x||(x={}));const de=ue("instantiationService");function me(p,se,ne,l){se[x.DI_TARGET]===se?se[x.DI_DEPENDENCIES].push({id:p,index:ne,optional:l}):(se[x.DI_DEPENDENCIES]=[{id:p,index:ne,optional:l}],se[x.DI_TARGET]=se)}function ue(p){if(x.serviceIds.has(p))return x.serviceIds.get(p);const se=function(ne,l,K){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");me(se,ne,K,!1)};return se.toString=()=>p,x.serviceIds.set(p,se),se}function G(p){return function(se,ne,l){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");me(p,se,l,!0)}}},44650:function(Ct,He,S){"use strict";S.d(He,{B:function(){return ue}});var x=S(76068),de=S(72999);class me{constructor(){this.data=new Map}add(p,se){x.ok(de.HD(p)),x.ok(de.Kn(se)),x.ok(!this.data.has(p),"There is already an extension with this id"),this.data.set(p,se)}as(p){return this.data.get(p)||null}}const ue=new me},66213:function(Ct,He,S){"use strict";S.d(He,{e:function(){return x}});var x;(function(de){de.DARK="dark",de.LIGHT="light",de.HIGH_CONTRAST="hc"})(x||(x={}))},49055:function(Ct,He,S){"use strict";S.d(He,{EN:function(){return l},IP:function(){return m},Ic:function(){return w},XE:function(){return se},bB:function(){return F},kS:function(){return K},m6:function(){return P}});var x=S(52615),de=S(4348),me=S(69323),ue=S(16925),G=S(44650),p=S(66213);const se=(0,ue.yh)("themeService");var ne;(function(k){function N(L){return L&&typeof L=="object"&&typeof L.id=="string"}k.isThemeColor=N})(ne||(ne={}));function l(k){return{id:k}}var K;(function(k){function N(ce){return ce&&typeof ce=="object"&&typeof ce.id=="string"&&(typeof ce.color=="undefined"||ne.isThemeColor(ce.color))}k.isThemeIcon=N;const L=new RegExp(`^\\$\\((${x.dT.iconNameExpression}(?:${x.dT.iconModifierExpression})?)\\)$`);function O(ce){const ae=L.exec(ce);if(!ae)return;let[,Se]=ae;return{id:Se}}k.fromString=O;function D(ce,ae){let Se=ce.id;const Ne=Se.lastIndexOf("~");return Ne!==-1&&(Se=Se.substring(0,Ne)),ae&&(Se=`${Se}~${ae}`),{id:Se}}k.modify=D;function C(ce,ae){var Se,Ne;return ce.id===ae.id&&((Se=ce.color)===null||Se===void 0?void 0:Se.id)===((Ne=ae.color)===null||Ne===void 0?void 0:Ne.id)}k.isEqual=C;function Q(ce,ae){return{id:ce.id,color:ae?l(ae):void 0}}k.asThemeIcon=Q,k.asClassNameArray=x.dT.asClassNameArray,k.asClassName=x.dT.asClassName,k.asCSSSelector=x.dT.asCSSSelector})(K||(K={}));function P(k){switch(k){case p.e.DARK:return"vs-dark";case p.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const m={ThemingContribution:"base.contributions.theming"};class _{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new de.Q5}onColorThemeChange(N){return this.themingParticipants.push(N),this.onThemingParticipantAddedEmitter.fire(N),(0,me.OF)(()=>{const L=this.themingParticipants.indexOf(N);this.themingParticipants.splice(L,1)})}getThemingParticipants(){return this.themingParticipants}}let E=new _;G.B.add(m.ThemingContribution,E);function w(k){return E.onColorThemeChange(k)}class F extends me.JT{constructor(N){super(),this.themeService=N,this.theme=N.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(L=>this.onThemeChange(L)))}onThemeChange(N){this.theme=N,this.updateStyles()}updateStyles(){}}},96478:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return ce}});var x=S(60499),de=S(18642),me=S(72190),ue=S(42244),G=S(68196),p=S(92310),se=S.n(p),ne=S(8654),l=S(59301),K=S(10228),P=S(16089),m=K.Z.ESC,_=K.Z.TAB;function E(ae){var Se=ae.visible,Ne=ae.triggerRef,Te=ae.onVisibleChange,je=ae.autoFocus,ie=ae.overlayRef,M=l.useRef(!1),z=function(){if(Se){var b,y;(b=Ne.current)===null||b===void 0||(y=b.focus)===null||y===void 0||y.call(b),Te==null||Te(!1)}},H=function(){var b;return(b=ie.current)!==null&&b!==void 0&&b.focus?(ie.current.focus(),M.current=!0,!0):!1},Z=function(b){switch(b.keyCode){case m:z();break;case _:{var y=!1;M.current||(y=H()),y?b.preventDefault():z();break}}};l.useEffect(function(){return Se?(window.addEventListener("keydown",Z),je&&(0,P.Z)(H,3),function(){window.removeEventListener("keydown",Z),M.current=!1}):function(){M.current=!1}},[Se])}var w=(0,l.forwardRef)(function(ae,Se){var Ne=ae.overlay,Te=ae.arrow,je=ae.prefixCls,ie=(0,l.useMemo)(function(){var z;return typeof Ne=="function"?z=Ne():z=Ne,z},[Ne]),M=(0,ne.sQ)(Se,(0,ne.C4)(ie));return l.createElement(l.Fragment,null,Te&&l.createElement("div",{className:"".concat(je,"-arrow")}),l.cloneElement(ie,{ref:(0,ne.Yr)(ie)?M:void 0}))}),F=w,k={adjustX:1,adjustY:1},N=[0,0],L={topLeft:{points:["bl","tl"],overflow:k,offset:[0,-4],targetOffset:N},top:{points:["bc","tc"],overflow:k,offset:[0,-4],targetOffset:N},topRight:{points:["br","tr"],overflow:k,offset:[0,-4],targetOffset:N},bottomLeft:{points:["tl","bl"],overflow:k,offset:[0,4],targetOffset:N},bottom:{points:["tc","bc"],overflow:k,offset:[0,4],targetOffset:N},bottomRight:{points:["tr","br"],overflow:k,offset:[0,4],targetOffset:N}},O=L,D=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function C(ae,Se){var Ne,Te=ae.arrow,je=Te===void 0?!1:Te,ie=ae.prefixCls,M=ie===void 0?"rc-dropdown":ie,z=ae.transitionName,H=ae.animation,Z=ae.align,Y=ae.placement,b=Y===void 0?"bottomLeft":Y,y=ae.placements,V=y===void 0?O:y,he=ae.getPopupContainer,be=ae.showAction,Pe=ae.hideAction,oe=ae.overlayClassName,Ae=ae.overlayStyle,ke=ae.visible,et=ae.trigger,Oe=et===void 0?["hover"]:et,qe=ae.autoFocus,xe=ae.overlay,it=ae.children,$e=ae.onVisibleChange,De=(0,ue.Z)(ae,D),ve=l.useState(),Le=(0,me.Z)(ve,2),re=Le[0],Re=Le[1],fe="visible"in ae?ke:re,B=l.useRef(null),A=l.useRef(null),U=l.useRef(null);l.useImperativeHandle(Se,function(){return B.current});var X=function(Ye){Re(Ye),$e==null||$e(Ye)};E({visible:fe,triggerRef:U,onVisibleChange:X,autoFocus:qe,overlayRef:A});var W=function(Ye){var Fe=ae.onOverlayClick;Re(!1),Fe&&Fe(Ye)},$=function(){return l.createElement(F,{ref:A,overlay:xe,prefixCls:M,arrow:je})},ee=function(){return typeof xe=="function"?$:$()},le=function(){var Ye=ae.minOverlayWidthMatchTrigger,Fe=ae.alignPoint;return"minOverlayWidthMatchTrigger"in ae?Ye:!Fe},ge=function(){var Ye=ae.openClassName;return Ye!==void 0?Ye:"".concat(M,"-open")},we=l.cloneElement(it,{className:se()((Ne=it.props)===null||Ne===void 0?void 0:Ne.className,fe&&ge()),ref:(0,ne.Yr)(it)?(0,ne.sQ)(U,(0,ne.C4)(it)):void 0}),ze=Pe;return!ze&&Oe.indexOf("contextMenu")!==-1&&(ze=["click"]),l.createElement(G.Z,(0,x.Z)({builtinPlacements:V},De,{prefixCls:M,ref:B,popupClassName:se()(oe,(0,de.Z)({},"".concat(M,"-show-arrow"),je)),popupStyle:Ae,action:Oe,showAction:be,hideAction:ze,popupPlacement:b,popupAlign:Z,popupTransitionName:z,popupAnimation:H,popupVisible:fe,stretch:le()?"minWidth":"",popup:ee(),onPopupVisibleChange:X,onPopupClick:W,getPopupContainer:he}),we)}var Q=l.forwardRef(C),ce=Q},28321:function(Ct,He,S){"use strict";S.d(He,{iz:function(){return Lt},ck:function(){return _t},BW:function(){return gt},sN:function(){return _t},Wd:function(){return ut},ZP:function(){return gn},Xl:function(){return Ne}});var x=S(60499),de=S(18642),me=S(85899),ue=S(77654),G=S(72190),p=S(42244),se=S(92310),ne=S.n(se),l=S(83836),K=S(18929),P=S(13697),m=S(48736),_=S(59301),E=S(4676),w=_.createContext(null);function F(Be,Ke){return Be===void 0?null:"".concat(Be,"-").concat(Ke)}function k(Be){var Ke=_.useContext(w);return F(Ke,Be)}var N=S(80547),L=["children","locked"],O=_.createContext(null);function D(Be,Ke){var pt=(0,me.Z)({},Be);return Object.keys(Ke).forEach(function(lt){var st=Ke[lt];st!==void 0&&(pt[lt]=st)}),pt}function C(Be){var Ke=Be.children,pt=Be.locked,lt=(0,p.Z)(Be,L),st=_.useContext(O),ct=(0,N.Z)(function(){return D(st,lt)},[st,lt],function(At,Ut){return!pt&&(At[0]!==Ut[0]||!(0,P.Z)(At[1],Ut[1],!0))});return _.createElement(O.Provider,{value:ct},Ke)}var Q=[],ce=_.createContext(null);function ae(){return _.useContext(ce)}var Se=_.createContext(Q);function Ne(Be){var Ke=_.useContext(Se);return _.useMemo(function(){return Be!==void 0?[].concat((0,ue.Z)(Ke),[Be]):Ke},[Ke,Be])}var Te=_.createContext(null),je=_.createContext({}),ie=je,M=S(29194);function z(Be){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,M.Z)(Be)){var pt=Be.nodeName.toLowerCase(),lt=["input","select","textarea","button"].includes(pt)||Be.isContentEditable||pt==="a"&&!!Be.getAttribute("href"),st=Be.getAttribute("tabindex"),ct=Number(st),At=null;return st&&!Number.isNaN(ct)?At=ct:lt&&At===null&&(At=0),lt&&Be.disabled&&(At=null),At!==null&&(At>=0||Ke&&At<0)}return!1}function H(Be){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,pt=(0,ue.Z)(Be.querySelectorAll("*")).filter(function(lt){return z(lt,Ke)});return z(Be,Ke)&&pt.unshift(Be),pt}var Z=null;function Y(){Z=document.activeElement}function b(){Z=null}function y(){if(Z)try{Z.focus()}catch(Be){}}function V(Be,Ke){if(Ke.keyCode===9){var pt=H(Be),lt=pt[Ke.shiftKey?0:pt.length-1],st=lt===document.activeElement||Be===document.activeElement;if(st){var ct=pt[Ke.shiftKey?pt.length-1:0];ct.focus(),Ke.preventDefault()}}}var he=S(10228),be=S(16089),Pe=he.Z.LEFT,oe=he.Z.RIGHT,Ae=he.Z.UP,ke=he.Z.DOWN,et=he.Z.ENTER,Oe=he.Z.ESC,qe=he.Z.HOME,xe=he.Z.END,it=[Ae,ke,Pe,oe];function $e(Be,Ke,pt,lt){var st,ct="prev",At="next",Ut="children",cn="parent";if(Be==="inline"&<===et)return{inlineTrigger:!0};var tn=(0,de.Z)((0,de.Z)({},Ae,ct),ke,At),xn=(0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)({},Pe,pt?At:ct),oe,pt?ct:At),ke,Ut),et,Ut),an=(0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)({},Ae,ct),ke,At),et,Ut),Oe,cn),Pe,pt?Ut:cn),oe,pt?cn:Ut),_n={inline:tn,horizontal:xn,vertical:an,inlineSub:tn,horizontalSub:an,verticalSub:an},Sn=(st=_n["".concat(Be).concat(Ke?"":"Sub")])===null||st===void 0?void 0:st[lt];switch(Sn){case ct:return{offset:-1,sibling:!0};case At:return{offset:1,sibling:!0};case cn:return{offset:-1,sibling:!1};case Ut:return{offset:1,sibling:!1};default:return null}}function De(Be){for(var Ke=Be;Ke;){if(Ke.getAttribute("data-menu-list"))return Ke;Ke=Ke.parentElement}return null}function ve(Be,Ke){for(var pt=Be||document.activeElement;pt;){if(Ke.has(pt))return pt;pt=pt.parentElement}return null}function Le(Be,Ke){var pt=H(Be,!0);return pt.filter(function(lt){return Ke.has(lt)})}function re(Be,Ke,pt){var lt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Be)return null;var st=Le(Be,Ke),ct=st.length,At=st.findIndex(function(Ut){return pt===Ut});return lt<0?At===-1?At=ct-1:At-=1:lt>0&&(At+=1),At=(At+ct)%ct,st[At]}var Re=function(Ke,pt){var lt=new Set,st=new Map,ct=new Map;return Ke.forEach(function(At){var Ut=document.querySelector("[data-menu-id='".concat(F(pt,At),"']"));Ut&&(lt.add(Ut),ct.set(Ut,At),st.set(At,Ut))}),{elements:lt,key2element:st,element2key:ct}};function fe(Be,Ke,pt,lt,st,ct,At,Ut,cn,tn){var xn=_.useRef(),an=_.useRef();an.current=Ke;var _n=function(){be.Z.cancel(xn.current)};return _.useEffect(function(){return function(){_n()}},[]),function(Sn){var Ln=Sn.which;if([].concat(it,[et,Oe,qe,xe]).includes(Ln)){var Pn=ct(),pn=Re(Pn,lt),yn=pn,Rn=yn.elements,In=yn.key2element,wn=yn.element2key,$n=In.get(Ke),Dn=ve($n,Rn),Nn=wn.get(Dn),Xn=$e(Be,At(Nn,!0).length===1,pt,Ln);if(!Xn&&Ln!==qe&&Ln!==xe)return;(it.includes(Ln)||[qe,xe].includes(Ln))&&Sn.preventDefault();var Gn=function(kn){if(kn){var rn=kn,Gt=kn.querySelector("a");Gt!=null&&Gt.getAttribute("href")&&(rn=Gt);var en=wn.get(kn);Ut(en),_n(),xn.current=(0,be.Z)(function(){an.current===en&&rn.focus()})}};if([qe,xe].includes(Ln)||Xn.sibling||!Dn){var si;!Dn||Be==="inline"?si=st.current:si=De(Dn);var Zn,Qn=Le(si,Rn);Ln===qe?Zn=Qn[0]:Ln===xe?Zn=Qn[Qn.length-1]:Zn=re(si,Rn,Dn,Xn.offset),Gn(Zn)}else if(Xn.inlineTrigger)cn(Nn);else if(Xn.offset>0)cn(Nn,!0),_n(),xn.current=(0,be.Z)(function(){pn=Re(Pn,lt);var Cn=Dn.getAttribute("aria-controls"),kn=document.getElementById(Cn),rn=re(kn,pn.elements);Gn(rn)},5);else if(Xn.offset<0){var ni=At(Nn,!0),ii=ni[ni.length-2],ei=In.get(ii);cn(ii,!1),Gn(ei)}}tn==null||tn(Sn)}}function B(Be){Promise.resolve().then(Be)}var A="__RC_UTIL_PATH_SPLIT__",U=function(Ke){return Ke.join(A)},X=function(Ke){return Ke.split(A)},W="rc-menu-more";function $(){var Be=_.useState({}),Ke=(0,G.Z)(Be,2),pt=Ke[1],lt=(0,_.useRef)(new Map),st=(0,_.useRef)(new Map),ct=_.useState([]),At=(0,G.Z)(ct,2),Ut=At[0],cn=At[1],tn=(0,_.useRef)(0),xn=(0,_.useRef)(!1),an=function(){xn.current||pt({})},_n=(0,_.useCallback)(function(In,wn){var $n=U(wn);st.current.set($n,In),lt.current.set(In,$n),tn.current+=1;var Dn=tn.current;B(function(){Dn===tn.current&&an()})},[]),Sn=(0,_.useCallback)(function(In,wn){var $n=U(wn);st.current.delete($n),lt.current.delete(In)},[]),Ln=(0,_.useCallback)(function(In){cn(In)},[]),Pn=(0,_.useCallback)(function(In,wn){var $n=lt.current.get(In)||"",Dn=X($n);return wn&&Ut.includes(Dn[0])&&Dn.unshift(W),Dn},[Ut]),pn=(0,_.useCallback)(function(In,wn){return In.filter(function($n){return $n!==void 0}).some(function($n){var Dn=Pn($n,!0);return Dn.includes(wn)})},[Pn]),yn=function(){var wn=(0,ue.Z)(lt.current.keys());return Ut.length&&wn.push(W),wn},Rn=(0,_.useCallback)(function(In){var wn="".concat(lt.current.get(In)).concat(A),$n=new Set;return(0,ue.Z)(st.current.keys()).forEach(function(Dn){Dn.startsWith(wn)&&$n.add(st.current.get(Dn))}),$n},[]);return _.useEffect(function(){return function(){xn.current=!0}},[]),{registerPath:_n,unregisterPath:Sn,refreshOverflowKeys:Ln,isSubPathKey:pn,getKeyPath:Pn,getKeys:yn,getSubPathKeys:Rn}}function ee(Be){var Ke=_.useRef(Be);Ke.current=Be;var pt=_.useCallback(function(){for(var lt,st=arguments.length,ct=new Array(st),At=0;At<st;At++)ct[At]=arguments[At];return(lt=Ke.current)===null||lt===void 0?void 0:lt.call.apply(lt,[Ke].concat(ct))},[]);return Be?pt:void 0}var le=Math.random().toFixed(5).toString().slice(2),ge=0;function we(Be){var Ke=(0,K.Z)(Be,{value:Be}),pt=(0,G.Z)(Ke,2),lt=pt[0],st=pt[1];return _.useEffect(function(){ge+=1;var ct="".concat(le,"-").concat(ge);st("rc-menu-uuid-".concat(ct))},[]),lt}var ze=S(38705),Ue=S(17212),Ye=S(39153),Fe=S(55401),Ve=S(2738),Qe=S(8654);function Ie(Be,Ke,pt,lt){var st=_.useContext(O),ct=st.activeKey,At=st.onActive,Ut=st.onInactive,cn={active:ct===Be};return Ke||(cn.onMouseEnter=function(tn){pt==null||pt({key:Be,domEvent:tn}),At(Be)},cn.onMouseLeave=function(tn){lt==null||lt({key:Be,domEvent:tn}),Ut(Be)}),cn}function tt(Be){var Ke=_.useContext(O),pt=Ke.mode,lt=Ke.rtl,st=Ke.inlineIndent;if(pt!=="inline")return null;var ct=Be;return lt?{paddingRight:ct*st}:{paddingLeft:ct*st}}function Nt(Be){var Ke=Be.icon,pt=Be.props,lt=Be.children,st;return Ke===null||Ke===!1?null:(typeof Ke=="function"?st=_.createElement(Ke,(0,me.Z)({},pt)):typeof Ke!="boolean"&&(st=Ke),st||lt||null)}var Et=["item"];function Rt(Be){var Ke=Be.item,pt=(0,p.Z)(Be,Et);return Object.defineProperty(pt,"item",{get:function(){return(0,m.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),Ke}}),pt}var ht=["title","attribute","elementRef"],qt=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],Vt=["active"],bt=function(Be){(0,Ye.Z)(pt,Be);var Ke=(0,Fe.Z)(pt);function pt(){return(0,ze.Z)(this,pt),Ke.apply(this,arguments)}return(0,Ue.Z)(pt,[{key:"render",value:function(){var st=this.props,ct=st.title,At=st.attribute,Ut=st.elementRef,cn=(0,p.Z)(st,ht),tn=(0,Ve.Z)(cn,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,m.ZP)(!At,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),_.createElement(l.Z.Item,(0,x.Z)({},At,{title:typeof ct=="string"?ct:void 0},tn,{ref:Ut}))}}]),pt}(_.Component),zt=_.forwardRef(function(Be,Ke){var pt=Be.style,lt=Be.className,st=Be.eventKey,ct=Be.warnKey,At=Be.disabled,Ut=Be.itemIcon,cn=Be.children,tn=Be.role,xn=Be.onMouseEnter,an=Be.onMouseLeave,_n=Be.onClick,Sn=Be.onKeyDown,Ln=Be.onFocus,Pn=(0,p.Z)(Be,qt),pn=k(st),yn=_.useContext(O),Rn=yn.prefixCls,In=yn.onItemClick,wn=yn.disabled,$n=yn.overflowDisabled,Dn=yn.itemIcon,Nn=yn.selectedKeys,Xn=yn.onActive,Gn=_.useContext(ie),si=Gn._internalRenderMenuItem,Zn="".concat(Rn,"-item"),Qn=_.useRef(),ni=_.useRef(),ii=wn||At,ei=(0,Qe.x1)(Ke,ni),Cn=Ne(st),kn=function(ai){return{key:st,keyPath:(0,ue.Z)(Cn).reverse(),item:Qn.current,domEvent:ai}},rn=Ut||Dn,Gt=Ie(st,ii,xn,an),en=Gt.active,Bn=(0,p.Z)(Gt,Vt),Un=Nn.includes(st),Jn=tt(Cn.length),oi=function(ai){if(!ii){var hi=kn(ai);_n==null||_n(Rt(hi)),In(hi)}},Hn=function(ai){if(Sn==null||Sn(ai),ai.which===he.Z.ENTER){var hi=kn(ai);_n==null||_n(Rt(hi)),In(hi)}},ci=function(ai){Xn(st),Ln==null||Ln(ai)},Ti={};Be.role==="option"&&(Ti["aria-selected"]=Un);var di=_.createElement(bt,(0,x.Z)({ref:Qn,elementRef:ei,role:tn===null?"none":tn||"menuitem",tabIndex:At?null:-1,"data-menu-id":$n&&pn?null:pn},(0,Ve.Z)(Pn,["extra"]),Bn,Ti,{component:"li","aria-disabled":At,style:(0,me.Z)((0,me.Z)({},Jn),pt),className:ne()(Zn,(0,de.Z)((0,de.Z)((0,de.Z)({},"".concat(Zn,"-active"),en),"".concat(Zn,"-selected"),Un),"".concat(Zn,"-disabled"),ii),lt),onClick:oi,onKeyDown:Hn,onFocus:ci}),cn,_.createElement(Nt,{props:(0,me.Z)((0,me.Z)({},Be),{},{isSelected:Un}),icon:rn}));return si&&(di=si(di,Be,{selected:Un})),di});function Tt(Be,Ke){var pt=Be.eventKey,lt=ae(),st=Ne(pt);return _.useEffect(function(){if(lt)return lt.registerPath(pt,st),function(){lt.unregisterPath(pt,st)}},[st]),lt?null:_.createElement(zt,(0,x.Z)({},Be,{ref:Ke}))}var _t=_.forwardRef(Tt),Ot=["className","children"],St=function(Ke,pt){var lt=Ke.className,st=Ke.children,ct=(0,p.Z)(Ke,Ot),At=_.useContext(O),Ut=At.prefixCls,cn=At.mode,tn=At.rtl;return _.createElement("ul",(0,x.Z)({className:ne()(Ut,tn&&"".concat(Ut,"-rtl"),"".concat(Ut,"-sub"),"".concat(Ut,"-").concat(cn==="inline"?"inline":"vertical"),lt),role:"menu"},ct,{"data-menu-list":!0,ref:pt}),st)},Jt=_.forwardRef(St);Jt.displayName="SubMenuList";var Pt=Jt,xt=S(11592);function Dt(Be,Ke){return(0,xt.Z)(Be).map(function(pt,lt){if(_.isValidElement(pt)){var st,ct,At=pt.key,Ut=(st=(ct=pt.props)===null||ct===void 0?void 0:ct.eventKey)!==null&&st!==void 0?st:At,cn=Ut==null;cn&&(Ut="tmp_key-".concat([].concat((0,ue.Z)(Ke),[lt]).join("-")));var tn={key:Ut,eventKey:Ut};return _.cloneElement(pt,tn)}return pt})}var un=S(68196),Ft={adjustX:1,adjustY:1},Ht={topLeft:{points:["bl","tl"],overflow:Ft},topRight:{points:["br","tr"],overflow:Ft},bottomLeft:{points:["tl","bl"],overflow:Ft},bottomRight:{points:["tr","br"],overflow:Ft},leftTop:{points:["tr","tl"],overflow:Ft},leftBottom:{points:["br","bl"],overflow:Ft},rightTop:{points:["tl","tr"],overflow:Ft},rightBottom:{points:["bl","br"],overflow:Ft}},It={topLeft:{points:["bl","tl"],overflow:Ft},topRight:{points:["br","tr"],overflow:Ft},bottomLeft:{points:["tl","bl"],overflow:Ft},bottomRight:{points:["tr","br"],overflow:Ft},rightTop:{points:["tr","tl"],overflow:Ft},rightBottom:{points:["br","bl"],overflow:Ft},leftTop:{points:["tl","tr"],overflow:Ft},leftBottom:{points:["bl","br"],overflow:Ft}},rt=null;function d(Be,Ke,pt){if(Ke)return Ke;if(pt)return pt[Be]||pt.other}var g={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function T(Be){var Ke=Be.prefixCls,pt=Be.visible,lt=Be.children,st=Be.popup,ct=Be.popupStyle,At=Be.popupClassName,Ut=Be.popupOffset,cn=Be.disabled,tn=Be.mode,xn=Be.onVisibleChange,an=_.useContext(O),_n=an.getPopupContainer,Sn=an.rtl,Ln=an.subMenuOpenDelay,Pn=an.subMenuCloseDelay,pn=an.builtinPlacements,yn=an.triggerSubMenuAction,Rn=an.forceSubMenuRender,In=an.rootClassName,wn=an.motion,$n=an.defaultMotions,Dn=_.useState(!1),Nn=(0,G.Z)(Dn,2),Xn=Nn[0],Gn=Nn[1],si=Sn?(0,me.Z)((0,me.Z)({},It),pn):(0,me.Z)((0,me.Z)({},Ht),pn),Zn=g[tn],Qn=d(tn,wn,$n),ni=_.useRef(Qn);tn!=="inline"&&(ni.current=Qn);var ii=(0,me.Z)((0,me.Z)({},ni.current),{},{leavedClassName:"".concat(Ke,"-hidden"),removeOnLeave:!1,motionAppear:!0}),ei=_.useRef();return _.useEffect(function(){return ei.current=(0,be.Z)(function(){Gn(pt)}),function(){be.Z.cancel(ei.current)}},[pt]),_.createElement(un.Z,{prefixCls:Ke,popupClassName:ne()("".concat(Ke,"-popup"),(0,de.Z)({},"".concat(Ke,"-rtl"),Sn),At,In),stretch:tn==="horizontal"?"minWidth":null,getPopupContainer:_n,builtinPlacements:si,popupPlacement:Zn,popupVisible:Xn,popup:st,popupStyle:ct,popupAlign:Ut&&{offset:Ut},action:cn?[]:[yn],mouseEnterDelay:Ln,mouseLeaveDelay:Pn,onPopupVisibleChange:xn,forceRender:Rn,popupMotion:ii,fresh:!0},lt)}var j=S(77900);function te(Be){var Ke=Be.id,pt=Be.open,lt=Be.keyPath,st=Be.children,ct="inline",At=_.useContext(O),Ut=At.prefixCls,cn=At.forceSubMenuRender,tn=At.motion,xn=At.defaultMotions,an=At.mode,_n=_.useRef(!1);_n.current=an===ct;var Sn=_.useState(!_n.current),Ln=(0,G.Z)(Sn,2),Pn=Ln[0],pn=Ln[1],yn=_n.current?pt:!1;_.useEffect(function(){_n.current&&pn(!1)},[an]);var Rn=(0,me.Z)({},d(ct,tn,xn));lt.length>1&&(Rn.motionAppear=!1);var In=Rn.onVisibleChanged;return Rn.onVisibleChanged=function(wn){return!_n.current&&!wn&&pn(!0),In==null?void 0:In(wn)},Pn?null:_.createElement(C,{mode:ct,locked:!_n.current},_.createElement(j.default,(0,x.Z)({visible:yn},Rn,{forceRender:cn,removeOnLeave:!1,leavedClassName:"".concat(Ut,"-hidden")}),function(wn){var $n=wn.className,Dn=wn.style;return _.createElement(Pt,{id:Ke,className:$n,style:Dn},st)}))}var Ee=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Ce=["active"],Xe=_.forwardRef(function(Be,Ke){var pt=Be.style,lt=Be.className,st=Be.title,ct=Be.eventKey,At=Be.warnKey,Ut=Be.disabled,cn=Be.internalPopupClose,tn=Be.children,xn=Be.itemIcon,an=Be.expandIcon,_n=Be.popupClassName,Sn=Be.popupOffset,Ln=Be.popupStyle,Pn=Be.onClick,pn=Be.onMouseEnter,yn=Be.onMouseLeave,Rn=Be.onTitleClick,In=Be.onTitleMouseEnter,wn=Be.onTitleMouseLeave,$n=(0,p.Z)(Be,Ee),Dn=k(ct),Nn=_.useContext(O),Xn=Nn.prefixCls,Gn=Nn.mode,si=Nn.openKeys,Zn=Nn.disabled,Qn=Nn.overflowDisabled,ni=Nn.activeKey,ii=Nn.selectedKeys,ei=Nn.itemIcon,Cn=Nn.expandIcon,kn=Nn.onItemClick,rn=Nn.onOpenChange,Gt=Nn.onActive,en=_.useContext(ie),Bn=en._internalRenderSubMenuItem,Un=_.useContext(Te),Jn=Un.isSubPathKey,oi=Ne(),Hn="".concat(Xn,"-submenu"),ci=Zn||Ut,Ti=_.useRef(),di=_.useRef(),bi=xn!=null?xn:ei,ai=an!=null?an:Cn,hi=si.includes(ct),gi=!Qn&&hi,Mi=Jn(ii,ct),fi=Ie(ct,ci,In,wn),_i=fi.active,Ci=(0,p.Z)(fi,Ce),Fi=_.useState(!1),vi=(0,G.Z)(Fi,2),zi=vi[0],$i=vi[1],Di=function(mi){ci||$i(mi)},qi=function(mi){Di(!0),pn==null||pn({key:ct,domEvent:mi})},bn=function(mi){Di(!1),yn==null||yn({key:ct,domEvent:mi})},Wi=_.useMemo(function(){return _i||(Gn!=="inline"?zi||Jn([ni],ct):!1)},[Gn,_i,ni,zi,ct,Jn]),Si=tt(oi.length),er=function(mi){ci||(Rn==null||Rn({key:ct,domEvent:mi}),Gn==="inline"&&rn(ct,!hi))},or=ee(function(ti){Pn==null||Pn(Rt(ti)),kn(ti)}),tr=function(mi){Gn!=="inline"&&rn(ct,mi)},lr=function(){Gt(ct)},Zi=Dn&&"".concat(Dn,"-popup"),Vn=_.useMemo(function(){return _.createElement(Nt,{icon:Gn!=="horizontal"?ai:void 0,props:(0,me.Z)((0,me.Z)({},Be),{},{isOpen:gi,isSubMenu:!0})},_.createElement("i",{className:"".concat(Hn,"-arrow")}))},[Gn,ai,Be,gi,Hn]),pi=_.createElement("div",(0,x.Z)({role:"menuitem",style:Si,className:"".concat(Hn,"-title"),tabIndex:ci?null:-1,ref:Ti,title:typeof st=="string"?st:null,"data-menu-id":Qn&&Dn?null:Dn,"aria-expanded":gi,"aria-haspopup":!0,"aria-controls":Zi,"aria-disabled":ci,onClick:er,onFocus:lr},Ci),st,Vn),Oi=_.useRef(Gn);if(Gn!=="inline"&&oi.length>1?Oi.current="vertical":Oi.current=Gn,!Qn){var nr=Oi.current;pi=_.createElement(T,{mode:nr,prefixCls:Hn,visible:!cn&&gi&&Gn!=="inline",popupClassName:_n,popupOffset:Sn,popupStyle:Ln,popup:_.createElement(C,{mode:nr==="horizontal"?"vertical":nr},_.createElement(Pt,{id:Zi,ref:di},tn)),disabled:ci,onVisibleChange:tr},pi)}var li=_.createElement(l.Z.Item,(0,x.Z)({ref:Ke,role:"none"},$n,{component:"li",style:pt,className:ne()(Hn,"".concat(Hn,"-").concat(Gn),lt,(0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)({},"".concat(Hn,"-open"),gi),"".concat(Hn,"-active"),Wi),"".concat(Hn,"-selected"),Mi),"".concat(Hn,"-disabled"),ci)),onMouseEnter:qi,onMouseLeave:bn}),pi,!Qn&&_.createElement(te,{id:Zi,open:gi,keyPath:oi},tn));return Bn&&(li=Bn(li,Be,{selected:Mi,active:Wi,open:gi,disabled:ci})),_.createElement(C,{onItemClick:or,mode:Gn==="horizontal"?"vertical":Gn,itemIcon:bi,expandIcon:ai},li)}),Ze=_.forwardRef(function(Be,Ke){var pt=Be.eventKey,lt=Be.children,st=Ne(pt),ct=Dt(lt,st),At=ae();_.useEffect(function(){if(At)return At.registerPath(pt,st),function(){At.unregisterPath(pt,st)}},[st]);var Ut;return At?Ut=ct:Ut=_.createElement(Xe,(0,x.Z)({ref:Ke},Be),ct),_.createElement(Se.Provider,{value:st},Ut)}),ut=Ze,ft=S(43749);function Lt(Be){var Ke=Be.className,pt=Be.style,lt=_.useContext(O),st=lt.prefixCls,ct=ae();return ct?null:_.createElement("li",{role:"separator",className:ne()("".concat(st,"-item-divider"),Ke),style:pt})}var vt=["className","title","eventKey","children"],Kt=_.forwardRef(function(Be,Ke){var pt=Be.className,lt=Be.title,st=Be.eventKey,ct=Be.children,At=(0,p.Z)(Be,vt),Ut=_.useContext(O),cn=Ut.prefixCls,tn="".concat(cn,"-item-group");return _.createElement("li",(0,x.Z)({ref:Ke,role:"presentation"},At,{onClick:function(an){return an.stopPropagation()},className:ne()(tn,pt)}),_.createElement("div",{role:"presentation",className:"".concat(tn,"-title"),title:typeof lt=="string"?lt:void 0},lt),_.createElement("ul",{role:"group",className:"".concat(tn,"-list")},ct))}),$t=_.forwardRef(function(Be,Ke){var pt=Be.eventKey,lt=Be.children,st=Ne(pt),ct=Dt(lt,st),At=ae();return At?ct:_.createElement(Kt,(0,x.Z)({ref:Ke},(0,Ve.Z)(Be,["warnKey"])),ct)}),gt=$t,mt=["label","children","key","type","extra"];function Bt(Be,Ke,pt){var lt=Ke.item,st=Ke.group,ct=Ke.submenu,At=Ke.divider;return(Be||[]).map(function(Ut,cn){if(Ut&&(0,ft.Z)(Ut)==="object"){var tn=Ut,xn=tn.label,an=tn.children,_n=tn.key,Sn=tn.type,Ln=tn.extra,Pn=(0,p.Z)(tn,mt),pn=_n!=null?_n:"tmp-".concat(cn);return an||Sn==="group"?Sn==="group"?_.createElement(st,(0,x.Z)({key:pn},Pn,{title:xn}),Bt(an,Ke,pt)):_.createElement(ct,(0,x.Z)({key:pn},Pn,{title:xn}),Bt(an,Ke,pt)):Sn==="divider"?_.createElement(At,(0,x.Z)({key:pn},Pn)):_.createElement(lt,(0,x.Z)({key:pn},Pn,{extra:Ln}),xn,(!!Ln||Ln===0)&&_.createElement("span",{className:"".concat(pt,"-item-extra")},Ln))}return null}).filter(function(Ut){return Ut})}function kt(Be,Ke,pt,lt,st){var ct=Be,At=(0,me.Z)({divider:Lt,item:_t,group:gt,submenu:ut},lt);return Ke&&(ct=Bt(Ke,At,st)),Dt(ct,pt)}var hn=["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"],En=[],Wt=_.forwardRef(function(Be,Ke){var pt,lt=Be,st=lt.prefixCls,ct=st===void 0?"rc-menu":st,At=lt.rootClassName,Ut=lt.style,cn=lt.className,tn=lt.tabIndex,xn=tn===void 0?0:tn,an=lt.items,_n=lt.children,Sn=lt.direction,Ln=lt.id,Pn=lt.mode,pn=Pn===void 0?"vertical":Pn,yn=lt.inlineCollapsed,Rn=lt.disabled,In=lt.disabledOverflow,wn=lt.subMenuOpenDelay,$n=wn===void 0?.1:wn,Dn=lt.subMenuCloseDelay,Nn=Dn===void 0?.1:Dn,Xn=lt.forceSubMenuRender,Gn=lt.defaultOpenKeys,si=lt.openKeys,Zn=lt.activeKey,Qn=lt.defaultActiveFirst,ni=lt.selectable,ii=ni===void 0?!0:ni,ei=lt.multiple,Cn=ei===void 0?!1:ei,kn=lt.defaultSelectedKeys,rn=lt.selectedKeys,Gt=lt.onSelect,en=lt.onDeselect,Bn=lt.inlineIndent,Un=Bn===void 0?24:Bn,Jn=lt.motion,oi=lt.defaultMotions,Hn=lt.triggerSubMenuAction,ci=Hn===void 0?"hover":Hn,Ti=lt.builtinPlacements,di=lt.itemIcon,bi=lt.expandIcon,ai=lt.overflowedIndicator,hi=ai===void 0?"...":ai,gi=lt.overflowedIndicatorPopupClassName,Mi=lt.getPopupContainer,fi=lt.onClick,_i=lt.onOpenChange,Ci=lt.onKeyDown,Fi=lt.openAnimation,vi=lt.openTransitionName,zi=lt._internalRenderMenuItem,$i=lt._internalRenderSubMenuItem,Di=lt._internalComponents,qi=(0,p.Z)(lt,hn),bn=_.useMemo(function(){return[kt(_n,an,En,Di,ct),kt(_n,an,En,{},ct)]},[_n,an,Di]),Wi=(0,G.Z)(bn,2),Si=Wi[0],er=Wi[1],or=_.useState(!1),tr=(0,G.Z)(or,2),lr=tr[0],Zi=tr[1],Vn=_.useRef(),pi=we(Ln),Oi=Sn==="rtl",nr=(0,K.Z)(Gn,{value:si,postState:function(Wn){return Wn||En}}),li=(0,G.Z)(nr,2),ti=li[0],mi=li[1],yi=function(Wn){var qn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Ai(){mi(Wn),_i==null||_i(Wn)}qn?(0,E.flushSync)(Ai):Ai()},Ui=_.useState(ti),Pi=(0,G.Z)(Ui,2),ur=Pi[0],gr=Pi[1],ir=_.useRef(!1),Ir=_.useMemo(function(){return(pn==="inline"||pn==="vertical")&&yn?["vertical",yn]:[pn,!1]},[pn,yn]),sn=(0,G.Z)(Ir,2),vn=sn[0],jn=sn[1],An=vn==="inline",On=_.useState(vn),Yi=(0,G.Z)(On,2),wi=Yi[0],cr=Yi[1],_r=_.useState(jn),hs=(0,G.Z)(_r,2),Ws=hs[0],Zs=hs[1];_.useEffect(function(){cr(vn),Zs(jn),ir.current&&(An?mi(ur):yi(En))},[vn,jn]);var fs=_.useState(0),vr=(0,G.Z)(fs,2),Ki=vr[0],Ys=vr[1],Nr=Ki>=Si.length-1||wi!=="horizontal"||In;_.useEffect(function(){An&&gr(ti)},[ti]),_.useEffect(function(){return ir.current=!0,function(){ir.current=!1}},[]);var yr=$(),Zr=yr.registerPath,Yr=yr.unregisterPath,Xs=yr.refreshOverflowKeys,Br=yr.isSubPathKey,Qs=yr.getKeyPath,Gi=yr.getKeys,ps=yr.getSubPathKeys,Js=_.useMemo(function(){return{registerPath:Zr,unregisterPath:Yr}},[Zr,Yr]),ms=_.useMemo(function(){return{isSubPathKey:Br}},[Br]);_.useEffect(function(){Xs(Nr?En:Si.slice(Ki+1).map(function(ri){return ri.key}))},[Ki,Nr]);var gs=(0,K.Z)(Zn||Qn&&((pt=Si[0])===null||pt===void 0?void 0:pt.key),{value:Zn}),Xr=(0,G.Z)(gs,2),Sr=Xr[0],Qr=Xr[1],Jr=ee(function(ri){Qr(ri)}),_s=ee(function(){Qr(void 0)});(0,_.useImperativeHandle)(Ke,function(){return{list:Vn.current,focus:function(Wn){var qn,Ai=Gi(),Ri=Re(Ai,pi),Fr=Ri.elements,$r=Ri.key2element,Cr=Ri.element2key,xs=Le(Vn.current,Fr),ts=Sr!=null?Sr:xs[0]?Cr.get(xs[0]):(qn=Si.find(function(Ts){return!Ts.props.disabled}))===null||qn===void 0?void 0:qn.key,xr=$r.get(ts);if(ts&&xr){var ns;xr==null||(ns=xr.focus)===null||ns===void 0||ns.call(xr,Wn)}}}});var vs=(0,K.Z)(kn||[],{value:rn,postState:function(Wn){return Array.isArray(Wn)?Wn:Wn==null?En:[Wn]}}),Xi=(0,G.Z)(vs,2),Lr=Xi[0],qr=Xi[1],ys=function(Wn){if(ii){var qn=Wn.key,Ai=Lr.includes(qn),Ri;Cn?Ai?Ri=Lr.filter(function($r){return $r!==qn}):Ri=[].concat((0,ue.Z)(Lr),[qn]):Ri=[qn],qr(Ri);var Fr=(0,me.Z)((0,me.Z)({},Wn),{},{selectedKeys:Ri});Ai?en==null||en(Fr):Gt==null||Gt(Fr)}!Cn&&ti.length&&wi!=="inline"&&yi(En)},qs=ee(function(ri){fi==null||fi(Rt(ri)),ys(ri)}),Es=ee(function(ri,Wn){var qn=ti.filter(function(Ri){return Ri!==ri});if(Wn)qn.push(ri);else if(wi!=="inline"){var Ai=ps(ri);qn=qn.filter(function(Ri){return!Ai.has(Ri)})}(0,P.Z)(ti,qn,!0)||yi(qn,!0)}),ea=function(Wn,qn){var Ai=qn!=null?qn:!ti.includes(Wn);Es(Wn,Ai)},ta=fe(wi,Sr,Oi,pi,Vn,Gi,Qs,Qr,ea,Ci);_.useEffect(function(){Zi(!0)},[]);var bs=_.useMemo(function(){return{_internalRenderMenuItem:zi,_internalRenderSubMenuItem:$i}},[zi,$i]),Ss=wi!=="horizontal"||In?Si:Si.map(function(ri,Wn){return _.createElement(C,{key:ri.key,overflowDisabled:Wn>Ki},ri)}),es=_.createElement(l.Z,(0,x.Z)({id:Ln,ref:Vn,prefixCls:"".concat(ct,"-overflow"),component:"ul",itemComponent:_t,className:ne()(ct,"".concat(ct,"-root"),"".concat(ct,"-").concat(wi),cn,(0,de.Z)((0,de.Z)({},"".concat(ct,"-inline-collapsed"),Ws),"".concat(ct,"-rtl"),Oi),At),dir:Sn,style:Ut,role:"menu",tabIndex:xn,data:Ss,renderRawItem:function(Wn){return Wn},renderRawRest:function(Wn){var qn=Wn.length,Ai=qn?Si.slice(-qn):null;return _.createElement(ut,{eventKey:W,title:hi,disabled:Nr,internalPopupClose:qn===0,popupClassName:gi},Ai)},maxCount:wi!=="horizontal"||In?l.Z.INVALIDATE:l.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Wn){Ys(Wn)},onKeyDown:ta},qi));return _.createElement(ie.Provider,{value:bs},_.createElement(w.Provider,{value:pi},_.createElement(C,{prefixCls:ct,rootClassName:At,mode:wi,openKeys:ti,rtl:Oi,disabled:Rn,motion:lr?Jn:null,defaultMotions:lr?oi:null,activeKey:Sr,onActive:Jr,onInactive:_s,selectedKeys:Lr,inlineIndent:Un,subMenuOpenDelay:$n,subMenuCloseDelay:Nn,forceSubMenuRender:Xn,builtinPlacements:Ti,triggerSubMenuAction:ci,getPopupContainer:Mi,itemIcon:di,expandIcon:bi,onItemClick:qs,onOpenChange:Es},_.createElement(Te.Provider,{value:ms},es),_.createElement("div",{style:{display:"none"},"aria-hidden":!0},_.createElement(ce.Provider,{value:Js},er)))))}),Mt=Wt,Qt=Mt;Qt.Item=_t,Qt.SubMenu=ut,Qt.ItemGroup=gt,Qt.Divider=Lt;var gn=Qt},83836:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return Y}});var x=S(60499),de=S(85899),me=S(72190),ue=S(42244),G=S(59301),p=S(92310),se=S.n(p),ne=S(29301),l=S(34280),K=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],P=void 0;function m(b,y){var V=b.prefixCls,he=b.invalidate,be=b.item,Pe=b.renderItem,oe=b.responsive,Ae=b.responsiveDisabled,ke=b.registerSize,et=b.itemKey,Oe=b.className,qe=b.style,xe=b.children,it=b.display,$e=b.order,De=b.component,ve=De===void 0?"div":De,Le=(0,ue.Z)(b,K),re=oe&&!it;function Re(X){ke(et,X)}G.useEffect(function(){return function(){Re(null)}},[]);var fe=Pe&&be!==P?Pe(be,{index:$e}):xe,B;he||(B={opacity:re?0:1,height:re?0:P,overflowY:re?"hidden":P,order:oe?$e:P,pointerEvents:re?"none":P,position:re?"absolute":P});var A={};re&&(A["aria-hidden"]=!0);var U=G.createElement(ve,(0,x.Z)({className:se()(!he&&V,Oe),style:(0,de.Z)((0,de.Z)({},B),qe)},A,Le,{ref:y}),fe);return oe&&(U=G.createElement(ne.Z,{onResize:function(W){var $=W.offsetWidth;Re($)},disabled:Ae},U)),U}var _=G.forwardRef(m);_.displayName="Item";var E=_,w=S(6089),F=S(4676),k=S(16089);function N(b){if(typeof MessageChannel=="undefined")(0,k.Z)(b);else{var y=new MessageChannel;y.port1.onmessage=function(){return b()},y.port2.postMessage(void 0)}}function L(){var b=G.useRef(null),y=function(he){b.current||(b.current=[],N(function(){(0,F.unstable_batchedUpdates)(function(){b.current.forEach(function(be){be()}),b.current=null})})),b.current.push(he)};return y}function O(b,y){var V=G.useState(y),he=(0,me.Z)(V,2),be=he[0],Pe=he[1],oe=(0,w.Z)(function(Ae){b(function(){Pe(Ae)})});return[be,oe]}var D=G.createContext(null),C=["component"],Q=["className"],ce=["className"],ae=function(y,V){var he=G.useContext(D);if(!he){var be=y.component,Pe=be===void 0?"div":be,oe=(0,ue.Z)(y,C);return G.createElement(Pe,(0,x.Z)({},oe,{ref:V}))}var Ae=he.className,ke=(0,ue.Z)(he,Q),et=y.className,Oe=(0,ue.Z)(y,ce);return G.createElement(D.Provider,{value:null},G.createElement(E,(0,x.Z)({ref:V,className:se()(Ae,et)},ke,Oe)))},Se=G.forwardRef(ae);Se.displayName="RawItem";var Ne=Se,Te=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","prefix","suffix","component","itemComponent","onVisibleChange"],je="responsive",ie="invalidate";function M(b){return"+ ".concat(b.length," ...")}function z(b,y){var V=b.prefixCls,he=V===void 0?"rc-overflow":V,be=b.data,Pe=be===void 0?[]:be,oe=b.renderItem,Ae=b.renderRawItem,ke=b.itemKey,et=b.itemWidth,Oe=et===void 0?10:et,qe=b.ssr,xe=b.style,it=b.className,$e=b.maxCount,De=b.renderRest,ve=b.renderRawRest,Le=b.prefix,re=b.suffix,Re=b.component,fe=Re===void 0?"div":Re,B=b.itemComponent,A=b.onVisibleChange,U=(0,ue.Z)(b,Te),X=qe==="full",W=L(),$=O(W,null),ee=(0,me.Z)($,2),le=ee[0],ge=ee[1],we=le||0,ze=O(W,new Map),Ue=(0,me.Z)(ze,2),Ye=Ue[0],Fe=Ue[1],Ve=O(W,0),Qe=(0,me.Z)(Ve,2),Ie=Qe[0],tt=Qe[1],Nt=O(W,0),Et=(0,me.Z)(Nt,2),Rt=Et[0],ht=Et[1],qt=O(W,0),Vt=(0,me.Z)(qt,2),bt=Vt[0],zt=Vt[1],Tt=O(W,0),_t=(0,me.Z)(Tt,2),Ot=_t[0],St=_t[1],Jt=(0,G.useState)(null),Pt=(0,me.Z)(Jt,2),xt=Pt[0],Dt=Pt[1],un=(0,G.useState)(null),Ft=(0,me.Z)(un,2),Ht=Ft[0],It=Ft[1],rt=G.useMemo(function(){return Ht===null&&X?Number.MAX_SAFE_INTEGER:Ht||0},[Ht,le]),d=(0,G.useState)(!1),g=(0,me.Z)(d,2),T=g[0],j=g[1],te="".concat(he,"-item"),Ee=Math.max(Ie,Rt),Ce=$e===je,Xe=Pe.length&&Ce,Ze=$e===ie,ut=Xe||typeof $e=="number"&&Pe.length>$e,ft=(0,G.useMemo)(function(){var st=Pe;return Xe?le===null&&X?st=Pe:st=Pe.slice(0,Math.min(Pe.length,we/Oe)):typeof $e=="number"&&(st=Pe.slice(0,$e)),st},[Pe,Oe,le,$e,Xe]),Lt=(0,G.useMemo)(function(){return Xe?Pe.slice(rt+1):Pe.slice(ft.length)},[Pe,ft,Xe,rt]),vt=(0,G.useCallback)(function(st,ct){var At;return typeof ke=="function"?ke(st):(At=ke&&(st==null?void 0:st[ke]))!==null&&At!==void 0?At:ct},[ke]),Kt=(0,G.useCallback)(oe||function(st){return st},[oe]);function $t(st,ct,At){Ht===st&&(ct===void 0||ct===xt)||(It(st),At||(j(st<Pe.length-1),A==null||A(st)),ct!==void 0&&Dt(ct))}function gt(st,ct){ge(ct.clientWidth)}function mt(st,ct){Fe(function(At){var Ut=new Map(At);return ct===null?Ut.delete(st):Ut.set(st,ct),Ut})}function Bt(st,ct){ht(ct),tt(Rt)}function kt(st,ct){zt(ct)}function hn(st,ct){St(ct)}function En(st){return Ye.get(vt(ft[st],st))}(0,l.Z)(function(){if(we&&typeof Ee=="number"&&ft){var st=bt+Ot,ct=ft.length,At=ct-1;if(!ct){$t(0,null);return}for(var Ut=0;Ut<ct;Ut+=1){var cn=En(Ut);if(X&&(cn=cn||0),cn===void 0){$t(Ut-1,void 0,!0);break}if(st+=cn,At===0&&st<=we||Ut===At-1&&st+En(At)<=we){$t(At,null);break}else if(st+Ee>we){$t(Ut-1,st-cn-Ot+Rt);break}}re&&En(0)+Ot>we&&Dt(null)}},[we,Ye,Rt,bt,Ot,vt,ft]);var Wt=T&&!!Lt.length,Mt={};xt!==null&&Xe&&(Mt={position:"absolute",left:xt,top:0});var Qt={prefixCls:te,responsive:Xe,component:B,invalidate:Ze},gn=Ae?function(st,ct){var At=vt(st,ct);return G.createElement(D.Provider,{key:At,value:(0,de.Z)((0,de.Z)({},Qt),{},{order:ct,item:st,itemKey:At,registerSize:mt,display:ct<=rt})},Ae(st,ct))}:function(st,ct){var At=vt(st,ct);return G.createElement(E,(0,x.Z)({},Qt,{order:ct,key:At,item:st,renderItem:Kt,itemKey:At,registerSize:mt,display:ct<=rt}))},Be={order:Wt?rt:Number.MAX_SAFE_INTEGER,className:"".concat(te,"-rest"),registerSize:Bt,display:Wt},Ke=De||M,pt=ve?G.createElement(D.Provider,{value:(0,de.Z)((0,de.Z)({},Qt),Be)},ve(Lt)):G.createElement(E,(0,x.Z)({},Qt,Be),typeof Ke=="function"?Ke(Lt):Ke),lt=G.createElement(fe,(0,x.Z)({className:se()(!Ze&&he,it),style:xe,ref:y},U),Le&&G.createElement(E,(0,x.Z)({},Qt,{responsive:Ce,responsiveDisabled:!Xe,order:-1,className:"".concat(te,"-prefix"),registerSize:kt,display:!0}),Le),ft.map(gn),ut?pt:null,re&&G.createElement(E,(0,x.Z)({},Qt,{responsive:Ce,responsiveDisabled:!Xe,order:rt,className:"".concat(te,"-suffix"),registerSize:hn,display:!0,style:Mt}),re));return Ce?G.createElement(ne.Z,{onResize:gt,disabled:!Xe},lt):lt}var H=G.forwardRef(z);H.displayName="Overflow",H.Item=Ne,H.RESPONSIVE=je,H.INVALIDATE=ie;var Z=H,Y=Z},29301:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return ie}});var x=S(60499),de=S(59301),me=S(11592),ue=S(48736),G=S(85899),p=S(43749),se=S(76846),ne=S(8654),l=de.createContext(null);function K(M){var z=M.children,H=M.onBatchResize,Z=de.useRef(0),Y=de.useRef([]),b=de.useContext(l),y=de.useCallback(function(V,he,be){Z.current+=1;var Pe=Z.current;Y.current.push({size:V,element:he,data:be}),Promise.resolve().then(function(){Pe===Z.current&&(H==null||H(Y.current),Y.current=[])}),b==null||b(V,he,be)},[H,b]);return de.createElement(l.Provider,{value:y},z)}var P=S(76374),m=new Map;function _(M){M.forEach(function(z){var H,Z=z.target;(H=m.get(Z))===null||H===void 0||H.forEach(function(Y){return Y(Z)})})}var E=new P.Z(_),w=null,F=null;function k(M,z){m.has(M)||(m.set(M,new Set),E.observe(M)),m.get(M).add(z)}function N(M,z){m.has(M)&&(m.get(M).delete(z),m.get(M).size||(E.unobserve(M),m.delete(M)))}var L=S(38705),O=S(17212),D=S(39153),C=S(55401),Q=function(M){(0,D.Z)(H,M);var z=(0,C.Z)(H);function H(){return(0,L.Z)(this,H),z.apply(this,arguments)}return(0,O.Z)(H,[{key:"render",value:function(){return this.props.children}}]),H}(de.Component);function ce(M,z){var H=M.children,Z=M.disabled,Y=de.useRef(null),b=de.useRef(null),y=de.useContext(l),V=typeof H=="function",he=V?H(Y):H,be=de.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Pe=!V&&de.isValidElement(he)&&(0,ne.Yr)(he),oe=Pe?(0,ne.C4)(he):null,Ae=(0,ne.x1)(oe,Y),ke=function(){var xe;return(0,se.ZP)(Y.current)||(Y.current&&(0,p.Z)(Y.current)==="object"?(0,se.ZP)((xe=Y.current)===null||xe===void 0?void 0:xe.nativeElement):null)||(0,se.ZP)(b.current)};de.useImperativeHandle(z,function(){return ke()});var et=de.useRef(M);et.current=M;var Oe=de.useCallback(function(qe){var xe=et.current,it=xe.onResize,$e=xe.data,De=qe.getBoundingClientRect(),ve=De.width,Le=De.height,re=qe.offsetWidth,Re=qe.offsetHeight,fe=Math.floor(ve),B=Math.floor(Le);if(be.current.width!==fe||be.current.height!==B||be.current.offsetWidth!==re||be.current.offsetHeight!==Re){var A={width:fe,height:B,offsetWidth:re,offsetHeight:Re};be.current=A;var U=re===Math.round(ve)?ve:re,X=Re===Math.round(Le)?Le:Re,W=(0,G.Z)((0,G.Z)({},A),{},{offsetWidth:U,offsetHeight:X});y==null||y(W,qe,$e),it&&Promise.resolve().then(function(){it(W,qe)})}},[]);return de.useEffect(function(){var qe=ke();return qe&&!Z&&k(qe,Oe),function(){return N(qe,Oe)}},[Y.current,Z]),de.createElement(Q,{ref:b},Pe?de.cloneElement(he,{ref:Ae}):he)}var ae=de.forwardRef(ce),Se=ae,Ne="rc-observer-key";function Te(M,z){var H=M.children,Z=typeof H=="function"?[H]:(0,me.Z)(H);return Z.map(function(Y,b){var y=(Y==null?void 0:Y.key)||"".concat(Ne,"-").concat(b);return de.createElement(Se,(0,x.Z)({},M,{key:y,ref:b===0?z:void 0}),Y)})}var je=de.forwardRef(Te);je.Collection=K;var ie=je},29125:function(Ct,He,S){"use strict";S.d(He,{G:function(){return ue},Z:function(){return N}});var x=S(92310),de=S.n(x),me=S(59301);function ue(L){var O=L.children,D=L.prefixCls,C=L.id,Q=L.overlayInnerStyle,ce=L.bodyClassName,ae=L.className,Se=L.style;return me.createElement("div",{className:de()("".concat(D,"-content"),ae),style:Se},me.createElement("div",{className:de()("".concat(D,"-inner"),ce),id:C,role:"tooltip",style:Q},typeof O=="function"?O():O))}var G=S(60499),p=S(85899),se=S(42244),ne=S(68196),l={shiftX:64,adjustY:1},K={adjustX:1,shiftY:!0},P=[0,0],m={left:{points:["cr","cl"],overflow:K,offset:[-4,0],targetOffset:P},right:{points:["cl","cr"],overflow:K,offset:[4,0],targetOffset:P},top:{points:["bc","tc"],overflow:l,offset:[0,-4],targetOffset:P},bottom:{points:["tc","bc"],overflow:l,offset:[0,4],targetOffset:P},topLeft:{points:["bl","tl"],overflow:l,offset:[0,-4],targetOffset:P},leftTop:{points:["tr","tl"],overflow:K,offset:[-4,0],targetOffset:P},topRight:{points:["br","tr"],overflow:l,offset:[0,-4],targetOffset:P},rightTop:{points:["tl","tr"],overflow:K,offset:[4,0],targetOffset:P},bottomRight:{points:["tr","br"],overflow:l,offset:[0,4],targetOffset:P},rightBottom:{points:["bl","br"],overflow:K,offset:[4,0],targetOffset:P},bottomLeft:{points:["tl","bl"],overflow:l,offset:[0,4],targetOffset:P},leftBottom:{points:["br","bl"],overflow:K,offset:[-4,0],targetOffset:P}},_=null,E=S(80402),w=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],F=function(O,D){var C=O.overlayClassName,Q=O.trigger,ce=Q===void 0?["hover"]:Q,ae=O.mouseEnterDelay,Se=ae===void 0?0:ae,Ne=O.mouseLeaveDelay,Te=Ne===void 0?.1:Ne,je=O.overlayStyle,ie=O.prefixCls,M=ie===void 0?"rc-tooltip":ie,z=O.children,H=O.onVisibleChange,Z=O.afterVisibleChange,Y=O.transitionName,b=O.animation,y=O.motion,V=O.placement,he=V===void 0?"right":V,be=O.align,Pe=be===void 0?{}:be,oe=O.destroyTooltipOnHide,Ae=oe===void 0?!1:oe,ke=O.defaultVisible,et=O.getTooltipContainer,Oe=O.overlayInnerStyle,qe=O.arrowContent,xe=O.overlay,it=O.id,$e=O.showArrow,De=$e===void 0?!0:$e,ve=O.classNames,Le=O.styles,re=(0,se.Z)(O,w),Re=(0,E.Z)(it),fe=(0,me.useRef)(null);(0,me.useImperativeHandle)(D,function(){return fe.current});var B=(0,p.Z)({},re);"visible"in O&&(B.popupVisible=O.visible);var A=function(){return me.createElement(ue,{key:"content",prefixCls:M,id:Re,bodyClassName:ve==null?void 0:ve.body,overlayInnerStyle:(0,p.Z)((0,p.Z)({},Oe),Le==null?void 0:Le.body)},xe)},U=function(){var W=me.Children.only(z),$=(W==null?void 0:W.props)||{},ee=(0,p.Z)((0,p.Z)({},$),{},{"aria-describedby":xe?Re:null});return me.cloneElement(z,ee)};return me.createElement(ne.Z,(0,G.Z)({popupClassName:de()(C,ve==null?void 0:ve.root),prefixCls:M,popup:A,action:ce,builtinPlacements:m,popupPlacement:he,ref:fe,popupAlign:Pe,getPopupContainer:et,onPopupVisibleChange:H,afterPopupVisibleChange:Z,popupTransitionName:Y,popupAnimation:b,popupMotion:y,defaultPopupVisible:ke,autoDestroy:Ae,mouseLeaveDelay:Te,popupStyle:(0,p.Z)((0,p.Z)({},je),Le==null?void 0:Le.root),mouseEnterDelay:Se,arrow:De},B),U())},k=(0,me.forwardRef)(F),N=k},639:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return O}});var x=S(60499),de=S(18642),me=S(85899),ue=S(72190),G=S(42244),p=S(59301),se=S(92310),ne=S.n(se),l=S(26112),K=S(30699),P=function(C){for(var Q=C.prefixCls,ce=C.level,ae=C.isStart,Se=C.isEnd,Ne="".concat(Q,"-indent-unit"),Te=[],je=0;je<ce;je+=1)Te.push(p.createElement("span",{key:je,className:ne()(Ne,(0,de.Z)((0,de.Z)({},"".concat(Ne,"-start"),ae[je]),"".concat(Ne,"-end"),Se[je]))}));return p.createElement("span",{"aria-hidden":"true",className:"".concat(Q,"-indent")},Te)},m=p.memo(P),_=S(65065),E=S(34061),w=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],F="open",k="close",N="---",L=function(C){var Q,ce,ae,Se=C.eventKey,Ne=C.className,Te=C.style,je=C.dragOver,ie=C.dragOverGapTop,M=C.dragOverGapBottom,z=C.isLeaf,H=C.isStart,Z=C.isEnd,Y=C.expanded,b=C.selected,y=C.checked,V=C.halfChecked,he=C.loading,be=C.domRef,Pe=C.active,oe=C.data,Ae=C.onMouseMove,ke=C.selectable,et=(0,G.Z)(C,w),Oe=p.useContext(K.k),qe=p.useContext(K.y),xe=p.useRef(null),it=p.useState(!1),$e=(0,ue.Z)(it,2),De=$e[0],ve=$e[1],Le=!!(Oe.disabled||C.disabled||(Q=qe.nodeDisabled)!==null&&Q!==void 0&&Q.call(qe,oe)),re=p.useMemo(function(){return!Oe.checkable||C.checkable===!1?!1:Oe.checkable},[Oe.checkable,C.checkable]),Re=function(xt){Le||Oe.onNodeSelect(xt,(0,E.F)(C))},fe=function(xt){Le||!re||C.disableCheckbox||Oe.onNodeCheck(xt,(0,E.F)(C),!y)},B=p.useMemo(function(){return typeof ke=="boolean"?ke:Oe.selectable},[ke,Oe.selectable]),A=function(xt){Oe.onNodeClick(xt,(0,E.F)(C)),B?Re(xt):fe(xt)},U=function(xt){Oe.onNodeDoubleClick(xt,(0,E.F)(C))},X=function(xt){Oe.onNodeMouseEnter(xt,(0,E.F)(C))},W=function(xt){Oe.onNodeMouseLeave(xt,(0,E.F)(C))},$=function(xt){Oe.onNodeContextMenu(xt,(0,E.F)(C))},ee=p.useMemo(function(){return!!(Oe.draggable&&(!Oe.draggable.nodeDraggable||Oe.draggable.nodeDraggable(oe)))},[Oe.draggable,oe]),le=function(xt){xt.stopPropagation(),ve(!0),Oe.onNodeDragStart(xt,C);try{xt.dataTransfer.setData("text/plain","")}catch(Dt){}},ge=function(xt){xt.preventDefault(),xt.stopPropagation(),Oe.onNodeDragEnter(xt,C)},we=function(xt){xt.preventDefault(),xt.stopPropagation(),Oe.onNodeDragOver(xt,C)},ze=function(xt){xt.stopPropagation(),Oe.onNodeDragLeave(xt,C)},Ue=function(xt){xt.stopPropagation(),ve(!1),Oe.onNodeDragEnd(xt,C)},Ye=function(xt){xt.preventDefault(),xt.stopPropagation(),ve(!1),Oe.onNodeDrop(xt,C)},Fe=function(xt){he||Oe.onNodeExpand(xt,(0,E.F)(C))},Ve=p.useMemo(function(){var Pt=(0,_.Z)(Oe.keyEntities,Se)||{},xt=Pt.children;return!!(xt||[]).length},[Oe.keyEntities,Se]),Qe=p.useMemo(function(){return z===!1?!1:z||!Oe.loadData&&!Ve||Oe.loadData&&C.loaded&&!Ve},[z,Oe.loadData,Ve,C.loaded]);p.useEffect(function(){he||typeof Oe.loadData=="function"&&Y&&!Qe&&!C.loaded&&Oe.onNodeLoad((0,E.F)(C))},[he,Oe.loadData,Oe.onNodeLoad,Y,Qe,C]);var Ie=p.useMemo(function(){var Pt;return(Pt=Oe.draggable)!==null&&Pt!==void 0&&Pt.icon?p.createElement("span",{className:"".concat(Oe.prefixCls,"-draggable-icon")},Oe.draggable.icon):null},[Oe.draggable]),tt=function(xt){var Dt=C.switcherIcon||Oe.switcherIcon;return typeof Dt=="function"?Dt((0,me.Z)((0,me.Z)({},C),{},{isLeaf:xt})):Dt},Nt=function(){if(Qe){var xt=tt(!0);return xt!==!1?p.createElement("span",{className:ne()("".concat(Oe.prefixCls,"-switcher"),"".concat(Oe.prefixCls,"-switcher-noop"))},xt):null}var Dt=tt(!1);return Dt!==!1?p.createElement("span",{onClick:Fe,className:ne()("".concat(Oe.prefixCls,"-switcher"),"".concat(Oe.prefixCls,"-switcher_").concat(Y?F:k))},Dt):null},Et=p.useMemo(function(){if(!re)return null;var Pt=typeof re!="boolean"?re:null;return p.createElement("span",{className:ne()("".concat(Oe.prefixCls,"-checkbox"),(0,de.Z)((0,de.Z)((0,de.Z)({},"".concat(Oe.prefixCls,"-checkbox-checked"),y),"".concat(Oe.prefixCls,"-checkbox-indeterminate"),!y&&V),"".concat(Oe.prefixCls,"-checkbox-disabled"),Le||C.disableCheckbox)),onClick:fe,role:"checkbox","aria-checked":V?"mixed":y,"aria-disabled":Le||C.disableCheckbox,"aria-label":"Select ".concat(typeof C.title=="string"?C.title:"tree node")},Pt)},[re,y,V,Le,C.disableCheckbox,C.title]),Rt=p.useMemo(function(){return Qe?null:Y?F:k},[Qe,Y]),ht=p.useMemo(function(){return p.createElement("span",{className:ne()("".concat(Oe.prefixCls,"-iconEle"),"".concat(Oe.prefixCls,"-icon__").concat(Rt||"docu"),(0,de.Z)({},"".concat(Oe.prefixCls,"-icon_loading"),he))})},[Oe.prefixCls,Rt,he]),qt=p.useMemo(function(){var Pt=!!Oe.draggable,xt=!C.disabled&&Pt&&Oe.dragOverNodeKey===Se;return xt?Oe.dropIndicatorRender({dropPosition:Oe.dropPosition,dropLevelOffset:Oe.dropLevelOffset,indent:Oe.indent,prefixCls:Oe.prefixCls,direction:Oe.direction}):null},[Oe.dropPosition,Oe.dropLevelOffset,Oe.indent,Oe.prefixCls,Oe.direction,Oe.draggable,Oe.dragOverNodeKey,Oe.dropIndicatorRender]),Vt=p.useMemo(function(){var Pt=C.title,xt=Pt===void 0?N:Pt,Dt="".concat(Oe.prefixCls,"-node-content-wrapper"),un;if(Oe.showIcon){var Ft=C.icon||Oe.icon;un=Ft?p.createElement("span",{className:ne()("".concat(Oe.prefixCls,"-iconEle"),"".concat(Oe.prefixCls,"-icon__customize"))},typeof Ft=="function"?Ft(C):Ft):ht}else Oe.loadData&&he&&(un=ht);var Ht;return typeof xt=="function"?Ht=xt(oe):Oe.titleRender?Ht=Oe.titleRender(oe):Ht=xt,p.createElement("span",{ref:xe,title:typeof xt=="string"?xt:"",className:ne()(Dt,"".concat(Dt,"-").concat(Rt||"normal"),(0,de.Z)({},"".concat(Oe.prefixCls,"-node-selected"),!Le&&(b||De))),onMouseEnter:X,onMouseLeave:W,onContextMenu:$,onClick:A,onDoubleClick:U},un,p.createElement("span",{className:"".concat(Oe.prefixCls,"-title")},Ht),qt)},[Oe.prefixCls,Oe.showIcon,C,Oe.icon,ht,Oe.titleRender,oe,Rt,X,W,$,A,U]),bt=(0,l.Z)(et,{aria:!0,data:!0}),zt=(0,_.Z)(Oe.keyEntities,Se)||{},Tt=zt.level,_t=Z[Z.length-1],Ot=!Le&&ee,St=Oe.draggingNodeKey===Se,Jt=ke!==void 0?{"aria-selected":!!ke}:void 0;return p.createElement("div",(0,x.Z)({ref:be,role:"treeitem","aria-expanded":z?void 0:Y,className:ne()(Ne,"".concat(Oe.prefixCls,"-treenode"),(ae={},(0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)(ae,"".concat(Oe.prefixCls,"-treenode-disabled"),Le),"".concat(Oe.prefixCls,"-treenode-switcher-").concat(Y?"open":"close"),!z),"".concat(Oe.prefixCls,"-treenode-checkbox-checked"),y),"".concat(Oe.prefixCls,"-treenode-checkbox-indeterminate"),V),"".concat(Oe.prefixCls,"-treenode-selected"),b),"".concat(Oe.prefixCls,"-treenode-loading"),he),"".concat(Oe.prefixCls,"-treenode-active"),Pe),"".concat(Oe.prefixCls,"-treenode-leaf-last"),_t),"".concat(Oe.prefixCls,"-treenode-draggable"),ee),"dragging",St),(0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)((0,de.Z)(ae,"drop-target",Oe.dropTargetKey===Se),"drop-container",Oe.dropContainerKey===Se),"drag-over",!Le&&je),"drag-over-gap-top",!Le&&ie),"drag-over-gap-bottom",!Le&&M),"filter-node",(ce=Oe.filterTreeNode)===null||ce===void 0?void 0:ce.call(Oe,(0,E.F)(C))),"".concat(Oe.prefixCls,"-treenode-leaf"),Qe))),style:Te,draggable:Ot,onDragStart:Ot?le:void 0,onDragEnter:ee?ge:void 0,onDragOver:ee?we:void 0,onDragLeave:ee?ze:void 0,onDrop:ee?Ye:void 0,onDragEnd:ee?Ue:void 0,onMouseMove:Ae},Jt,bt),p.createElement(m,{prefixCls:Oe.prefixCls,level:Tt,isStart:H,isEnd:Z}),Ie,Nt(),Et,Vt)};L.isTreeNode=1;var O=L},30699:function(Ct,He,S){"use strict";S.d(He,{k:function(){return de},y:function(){return me}});var x=S(59301),de=x.createContext(null),me=x.createContext({})},87632:function(Ct,He,S){"use strict";S.d(He,{OF:function(){return Se.Z},y6:function(){return k.y},ZP:function(){return Le}});var x=S(60499),de=S(43749),me=S(85899),ue=S(77654),G=S(38705),p=S(17212),se=S(15793),ne=S(39153),l=S(55401),K=S(18642),P=S(92310),m=S.n(P),_=S(10228),E=S(26112),w=S(48736),F=S(59301),k=S(30699),N=function(Re){var fe=Re.dropPosition,B=Re.dropLevelOffset,A=Re.indent,U={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(fe){case-1:U.top=0,U.left=-B*A;break;case 1:U.bottom=0,U.left=-B*A;break;case 0:U.bottom=0,U.left=A;break}return F.createElement("div",{style:U})},L=N;function O(re){if(re==null)throw new TypeError("Cannot destructure "+re)}var D=S(72190),C=S(42244),Q=S(34280),ce=S(48911),ae=S(77900),Se=S(639);function Ne(re,Re){var fe=F.useState(!1),B=(0,D.Z)(fe,2),A=B[0],U=B[1];(0,Q.Z)(function(){if(A)return re(),function(){Re()}},[A]),(0,Q.Z)(function(){return U(!0),function(){U(!1)}},[])}var Te=Ne,je=S(34061),ie=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],M=F.forwardRef(function(re,Re){var fe=re.className,B=re.style,A=re.motion,U=re.motionNodes,X=re.motionType,W=re.onMotionStart,$=re.onMotionEnd,ee=re.active,le=re.treeNodeRequiredProps,ge=(0,C.Z)(re,ie),we=F.useState(!0),ze=(0,D.Z)(we,2),Ue=ze[0],Ye=ze[1],Fe=F.useContext(k.k),Ve=Fe.prefixCls,Qe=U&&X!=="hide";(0,Q.Z)(function(){U&&Qe!==Ue&&Ye(Qe)},[U]);var Ie=function(){U&&W()},tt=F.useRef(!1),Nt=function(){U&&!tt.current&&(tt.current=!0,$())};Te(Ie,Nt);var Et=function(ht){Qe===ht&&Nt()};return U?F.createElement(ae.default,(0,x.Z)({ref:Re,visible:Ue},A,{motionAppear:X==="show",onVisibleChanged:Et}),function(Rt,ht){var qt=Rt.className,Vt=Rt.style;return F.createElement("div",{ref:ht,className:m()("".concat(Ve,"-treenode-motion"),qt),style:Vt},U.map(function(bt){var zt=Object.assign({},(O(bt.data),bt.data)),Tt=bt.title,_t=bt.key,Ot=bt.isStart,St=bt.isEnd;delete zt.children;var Jt=(0,je.H8)(_t,le);return F.createElement(Se.Z,(0,x.Z)({},zt,Jt,{title:Tt,active:ee,data:bt.data,key:_t,isStart:Ot,isEnd:St}))}))}):F.createElement(Se.Z,(0,x.Z)({domRef:Re,className:fe,style:B},ge,{active:ee}))}),z=M;function H(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],fe=re.length,B=Re.length;if(Math.abs(fe-B)!==1)return{add:!1,key:null};function A(U,X){var W=new Map;U.forEach(function(ee){W.set(ee,!0)});var $=X.filter(function(ee){return!W.has(ee)});return $.length===1?$[0]:null}return fe<B?{add:!0,key:A(re,Re)}:{add:!1,key:A(Re,re)}}function Z(re,Re,fe){var B=re.findIndex(function(W){return W.key===fe}),A=re[B+1],U=Re.findIndex(function(W){return W.key===fe});if(A){var X=Re.findIndex(function(W){return W.key===A.key});return Re.slice(U+1,X)}return Re.slice(U+1)}var Y=["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"],b={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},y=function(){},V="RC_TREE_MOTION_".concat(Math.random()),he={key:V},be={key:V,level:0,index:0,pos:"0",node:he,nodes:[he]},Pe={parent:null,children:[],pos:be.pos,data:he,title:null,key:V,isStart:[],isEnd:[]};function oe(re,Re,fe,B){return Re===!1||!fe?re:re.slice(0,Math.ceil(fe/B)+1)}function Ae(re){var Re=re.key,fe=re.pos;return(0,je.km)(Re,fe)}function ke(re){for(var Re=String(re.data.key),fe=re;fe.parent;)fe=fe.parent,Re="".concat(fe.data.key," > ").concat(Re);return Re}var et=F.forwardRef(function(re,Re){var fe=re.prefixCls,B=re.data,A=re.selectable,U=re.checkable,X=re.expandedKeys,W=re.selectedKeys,$=re.checkedKeys,ee=re.loadedKeys,le=re.loadingKeys,ge=re.halfCheckedKeys,we=re.keyEntities,ze=re.disabled,Ue=re.dragging,Ye=re.dragOverNodeKey,Fe=re.dropPosition,Ve=re.motion,Qe=re.height,Ie=re.itemHeight,tt=re.virtual,Nt=re.scrollWidth,Et=re.focusable,Rt=re.activeItem,ht=re.focused,qt=re.tabIndex,Vt=re.onKeyDown,bt=re.onFocus,zt=re.onBlur,Tt=re.onActiveChange,_t=re.onListChangeStart,Ot=re.onListChangeEnd,St=(0,C.Z)(re,Y),Jt=F.useRef(null),Pt=F.useRef(null);F.useImperativeHandle(Re,function(){return{scrollTo:function(kt){Jt.current.scrollTo(kt)},getIndentWidth:function(){return Pt.current.offsetWidth}}});var xt=F.useState(X),Dt=(0,D.Z)(xt,2),un=Dt[0],Ft=Dt[1],Ht=F.useState(B),It=(0,D.Z)(Ht,2),rt=It[0],d=It[1],g=F.useState(B),T=(0,D.Z)(g,2),j=T[0],te=T[1],Ee=F.useState([]),Ce=(0,D.Z)(Ee,2),Xe=Ce[0],Ze=Ce[1],ut=F.useState(null),ft=(0,D.Z)(ut,2),Lt=ft[0],vt=ft[1],Kt=F.useRef(B);Kt.current=B;function $t(){var Bt=Kt.current;d(Bt),te(Bt),Ze([]),vt(null),Ot()}(0,Q.Z)(function(){Ft(X);var Bt=H(un,X);if(Bt.key!==null)if(Bt.add){var kt=rt.findIndex(function(gn){var Be=gn.key;return Be===Bt.key}),hn=oe(Z(rt,B,Bt.key),tt,Qe,Ie),En=rt.slice();En.splice(kt+1,0,Pe),te(En),Ze(hn),vt("show")}else{var Wt=B.findIndex(function(gn){var Be=gn.key;return Be===Bt.key}),Mt=oe(Z(B,rt,Bt.key),tt,Qe,Ie),Qt=B.slice();Qt.splice(Wt+1,0,Pe),te(Qt),Ze(Mt),vt("hide")}else rt!==B&&(d(B),te(B))},[X,B]),F.useEffect(function(){Ue||$t()},[Ue]);var gt=Ve?j:B,mt={expandedKeys:X,selectedKeys:W,loadedKeys:ee,loadingKeys:le,checkedKeys:$,halfCheckedKeys:ge,dragOverNodeKey:Ye,dropPosition:Fe,keyEntities:we};return F.createElement(F.Fragment,null,ht&&Rt&&F.createElement("span",{style:b,"aria-live":"assertive"},ke(Rt)),F.createElement("div",null,F.createElement("input",{style:b,disabled:Et===!1||ze,tabIndex:Et!==!1?qt:null,onKeyDown:Vt,onFocus:bt,onBlur:zt,value:"",onChange:y,"aria-label":"for screen reader"})),F.createElement("div",{className:"".concat(fe,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},F.createElement("div",{className:"".concat(fe,"-indent")},F.createElement("div",{ref:Pt,className:"".concat(fe,"-indent-unit")}))),F.createElement(ce.Z,(0,x.Z)({},St,{data:gt,itemKey:Ae,height:Qe,fullHeight:!1,virtual:tt,itemHeight:Ie,scrollWidth:Nt,prefixCls:"".concat(fe,"-list"),ref:Jt,role:"tree",onVisibleChange:function(kt){kt.every(function(hn){return Ae(hn)!==V})&&$t()}}),function(Bt){var kt=Bt.pos,hn=Object.assign({},(O(Bt.data),Bt.data)),En=Bt.title,Wt=Bt.key,Mt=Bt.isStart,Qt=Bt.isEnd,gn=(0,je.km)(Wt,kt);delete hn.key,delete hn.children;var Be=(0,je.H8)(gn,mt);return F.createElement(z,(0,x.Z)({},hn,Be,{title:En,active:!!Rt&&Wt===Rt.key,pos:kt,data:Bt.data,isStart:Mt,isEnd:Qt,motion:Ve,motionNodes:Wt===V?Xe:null,motionType:Lt,onMotionStart:_t,onMotionEnd:$t,treeNodeRequiredProps:mt,onMouseMove:function(){Tt(null)}}))}))}),Oe=et,qe=S(82661),xe=S(34643),it=S(65065),$e=10,De=function(re){(0,ne.Z)(fe,re);var Re=(0,l.Z)(fe);function fe(){var B;(0,G.Z)(this,fe);for(var A=arguments.length,U=new Array(A),X=0;X<A;X++)U[X]=arguments[X];return B=Re.call.apply(Re,[this].concat(U)),(0,K.Z)((0,se.Z)(B),"destroyed",!1),(0,K.Z)((0,se.Z)(B),"delayedDragEnterLogic",void 0),(0,K.Z)((0,se.Z)(B),"loadingRetryTimes",{}),(0,K.Z)((0,se.Z)(B),"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,je.w$)()}),(0,K.Z)((0,se.Z)(B),"dragStartMousePosition",null),(0,K.Z)((0,se.Z)(B),"dragNodeProps",null),(0,K.Z)((0,se.Z)(B),"currentMouseOverDroppableNodeKey",null),(0,K.Z)((0,se.Z)(B),"listRef",F.createRef()),(0,K.Z)((0,se.Z)(B),"onNodeDragStart",function(W,$){var ee=B.state,le=ee.expandedKeys,ge=ee.keyEntities,we=B.props.onDragStart,ze=$.eventKey;B.dragNodeProps=$,B.dragStartMousePosition={x:W.clientX,y:W.clientY};var Ue=(0,qe._5)(le,ze);B.setState({draggingNodeKey:ze,dragChildrenKeys:(0,qe.wA)(ze,ge),indent:B.listRef.current.getIndentWidth()}),B.setExpandedKeys(Ue),window.addEventListener("dragend",B.onWindowDragEnd),we==null||we({event:W,node:(0,je.F)($)})}),(0,K.Z)((0,se.Z)(B),"onNodeDragEnter",function(W,$){var ee=B.state,le=ee.expandedKeys,ge=ee.keyEntities,we=ee.dragChildrenKeys,ze=ee.flattenNodes,Ue=ee.indent,Ye=B.props,Fe=Ye.onDragEnter,Ve=Ye.onExpand,Qe=Ye.allowDrop,Ie=Ye.direction,tt=$.pos,Nt=$.eventKey;if(B.currentMouseOverDroppableNodeKey!==Nt&&(B.currentMouseOverDroppableNodeKey=Nt),!B.dragNodeProps){B.resetDragState();return}var Et=(0,qe.OM)(W,B.dragNodeProps,$,Ue,B.dragStartMousePosition,Qe,ze,ge,le,Ie),Rt=Et.dropPosition,ht=Et.dropLevelOffset,qt=Et.dropTargetKey,Vt=Et.dropContainerKey,bt=Et.dropTargetPos,zt=Et.dropAllowed,Tt=Et.dragOverNodeKey;if(we.includes(qt)||!zt){B.resetDragState();return}if(B.delayedDragEnterLogic||(B.delayedDragEnterLogic={}),Object.keys(B.delayedDragEnterLogic).forEach(function(_t){clearTimeout(B.delayedDragEnterLogic[_t])}),B.dragNodeProps.eventKey!==$.eventKey&&(W.persist(),B.delayedDragEnterLogic[tt]=window.setTimeout(function(){if(B.state.draggingNodeKey!==null){var _t=(0,ue.Z)(le),Ot=(0,it.Z)(ge,$.eventKey);Ot&&(Ot.children||[]).length&&(_t=(0,qe.L0)(le,$.eventKey)),B.props.hasOwnProperty("expandedKeys")||B.setExpandedKeys(_t),Ve==null||Ve(_t,{node:(0,je.F)($),expanded:!0,nativeEvent:W.nativeEvent})}},800)),B.dragNodeProps.eventKey===qt&&ht===0){B.resetDragState();return}B.setState({dragOverNodeKey:Tt,dropPosition:Rt,dropLevelOffset:ht,dropTargetKey:qt,dropContainerKey:Vt,dropTargetPos:bt,dropAllowed:zt}),Fe==null||Fe({event:W,node:(0,je.F)($),expandedKeys:le})}),(0,K.Z)((0,se.Z)(B),"onNodeDragOver",function(W,$){var ee=B.state,le=ee.dragChildrenKeys,ge=ee.flattenNodes,we=ee.keyEntities,ze=ee.expandedKeys,Ue=ee.indent,Ye=B.props,Fe=Ye.onDragOver,Ve=Ye.allowDrop,Qe=Ye.direction;if(B.dragNodeProps){var Ie=(0,qe.OM)(W,B.dragNodeProps,$,Ue,B.dragStartMousePosition,Ve,ge,we,ze,Qe),tt=Ie.dropPosition,Nt=Ie.dropLevelOffset,Et=Ie.dropTargetKey,Rt=Ie.dropContainerKey,ht=Ie.dropTargetPos,qt=Ie.dropAllowed,Vt=Ie.dragOverNodeKey;le.includes(Et)||!qt||(B.dragNodeProps.eventKey===Et&&Nt===0?B.state.dropPosition===null&&B.state.dropLevelOffset===null&&B.state.dropTargetKey===null&&B.state.dropContainerKey===null&&B.state.dropTargetPos===null&&B.state.dropAllowed===!1&&B.state.dragOverNodeKey===null||B.resetDragState():tt===B.state.dropPosition&&Nt===B.state.dropLevelOffset&&Et===B.state.dropTargetKey&&Rt===B.state.dropContainerKey&&ht===B.state.dropTargetPos&&qt===B.state.dropAllowed&&Vt===B.state.dragOverNodeKey||B.setState({dropPosition:tt,dropLevelOffset:Nt,dropTargetKey:Et,dropContainerKey:Rt,dropTargetPos:ht,dropAllowed:qt,dragOverNodeKey:Vt}),Fe==null||Fe({event:W,node:(0,je.F)($)}))}}),(0,K.Z)((0,se.Z)(B),"onNodeDragLeave",function(W,$){B.currentMouseOverDroppableNodeKey===$.eventKey&&!W.currentTarget.contains(W.relatedTarget)&&(B.resetDragState(),B.currentMouseOverDroppableNodeKey=null);var ee=B.props.onDragLeave;ee==null||ee({event:W,node:(0,je.F)($)})}),(0,K.Z)((0,se.Z)(B),"onWindowDragEnd",function(W){B.onNodeDragEnd(W,null,!0),window.removeEventListener("dragend",B.onWindowDragEnd)}),(0,K.Z)((0,se.Z)(B),"onNodeDragEnd",function(W,$){var ee=B.props.onDragEnd;B.setState({dragOverNodeKey:null}),B.cleanDragState(),ee==null||ee({event:W,node:(0,je.F)($)}),B.dragNodeProps=null,window.removeEventListener("dragend",B.onWindowDragEnd)}),(0,K.Z)((0,se.Z)(B),"onNodeDrop",function(W,$){var ee,le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ge=B.state,we=ge.dragChildrenKeys,ze=ge.dropPosition,Ue=ge.dropTargetKey,Ye=ge.dropTargetPos,Fe=ge.dropAllowed;if(Fe){var Ve=B.props.onDrop;if(B.setState({dragOverNodeKey:null}),B.cleanDragState(),Ue!==null){var Qe=(0,me.Z)((0,me.Z)({},(0,je.H8)(Ue,B.getTreeNodeRequiredProps())),{},{active:((ee=B.getActiveItem())===null||ee===void 0?void 0:ee.key)===Ue,data:(0,it.Z)(B.state.keyEntities,Ue).node}),Ie=we.includes(Ue);(0,w.ZP)(!Ie,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var tt=(0,qe.yx)(Ye),Nt={event:W,node:(0,je.F)(Qe),dragNode:B.dragNodeProps?(0,je.F)(B.dragNodeProps):null,dragNodesKeys:[B.dragNodeProps.eventKey].concat(we),dropToGap:ze!==0,dropPosition:ze+Number(tt[tt.length-1])};le||Ve==null||Ve(Nt),B.dragNodeProps=null}}}),(0,K.Z)((0,se.Z)(B),"cleanDragState",function(){var W=B.state.draggingNodeKey;W!==null&&B.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),B.dragStartMousePosition=null,B.currentMouseOverDroppableNodeKey=null}),(0,K.Z)((0,se.Z)(B),"triggerExpandActionExpand",function(W,$){var ee=B.state,le=ee.expandedKeys,ge=ee.flattenNodes,we=$.expanded,ze=$.key,Ue=$.isLeaf;if(!(Ue||W.shiftKey||W.metaKey||W.ctrlKey)){var Ye=ge.filter(function(Ve){return Ve.key===ze})[0],Fe=(0,je.F)((0,me.Z)((0,me.Z)({},(0,je.H8)(ze,B.getTreeNodeRequiredProps())),{},{data:Ye.data}));B.setExpandedKeys(we?(0,qe._5)(le,ze):(0,qe.L0)(le,ze)),B.onNodeExpand(W,Fe)}}),(0,K.Z)((0,se.Z)(B),"onNodeClick",function(W,$){var ee=B.props,le=ee.onClick,ge=ee.expandAction;ge==="click"&&B.triggerExpandActionExpand(W,$),le==null||le(W,$)}),(0,K.Z)((0,se.Z)(B),"onNodeDoubleClick",function(W,$){var ee=B.props,le=ee.onDoubleClick,ge=ee.expandAction;ge==="doubleClick"&&B.triggerExpandActionExpand(W,$),le==null||le(W,$)}),(0,K.Z)((0,se.Z)(B),"onNodeSelect",function(W,$){var ee=B.state.selectedKeys,le=B.state,ge=le.keyEntities,we=le.fieldNames,ze=B.props,Ue=ze.onSelect,Ye=ze.multiple,Fe=$.selected,Ve=$[we.key],Qe=!Fe;Qe?Ye?ee=(0,qe.L0)(ee,Ve):ee=[Ve]:ee=(0,qe._5)(ee,Ve);var Ie=ee.map(function(tt){var Nt=(0,it.Z)(ge,tt);return Nt?Nt.node:null}).filter(Boolean);B.setUncontrolledState({selectedKeys:ee}),Ue==null||Ue(ee,{event:"select",selected:Qe,node:$,selectedNodes:Ie,nativeEvent:W.nativeEvent})}),(0,K.Z)((0,se.Z)(B),"onNodeCheck",function(W,$,ee){var le=B.state,ge=le.keyEntities,we=le.checkedKeys,ze=le.halfCheckedKeys,Ue=B.props,Ye=Ue.checkStrictly,Fe=Ue.onCheck,Ve=$.key,Qe,Ie={event:"check",node:$,checked:ee,nativeEvent:W.nativeEvent};if(Ye){var tt=ee?(0,qe.L0)(we,Ve):(0,qe._5)(we,Ve),Nt=(0,qe._5)(ze,Ve);Qe={checked:tt,halfChecked:Nt},Ie.checkedNodes=tt.map(function(bt){return(0,it.Z)(ge,bt)}).filter(Boolean).map(function(bt){return bt.node}),B.setUncontrolledState({checkedKeys:tt})}else{var Et=(0,xe.S)([].concat((0,ue.Z)(we),[Ve]),!0,ge),Rt=Et.checkedKeys,ht=Et.halfCheckedKeys;if(!ee){var qt=new Set(Rt);qt.delete(Ve);var Vt=(0,xe.S)(Array.from(qt),{checked:!1,halfCheckedKeys:ht},ge);Rt=Vt.checkedKeys,ht=Vt.halfCheckedKeys}Qe=Rt,Ie.checkedNodes=[],Ie.checkedNodesPositions=[],Ie.halfCheckedKeys=ht,Rt.forEach(function(bt){var zt=(0,it.Z)(ge,bt);if(zt){var Tt=zt.node,_t=zt.pos;Ie.checkedNodes.push(Tt),Ie.checkedNodesPositions.push({node:Tt,pos:_t})}}),B.setUncontrolledState({checkedKeys:Rt},!1,{halfCheckedKeys:ht})}Fe==null||Fe(Qe,Ie)}),(0,K.Z)((0,se.Z)(B),"onNodeLoad",function(W){var $,ee=W.key,le=B.state.keyEntities,ge=(0,it.Z)(le,ee);if(!(ge!=null&&($=ge.children)!==null&&$!==void 0&&$.length)){var we=new Promise(function(ze,Ue){B.setState(function(Ye){var Fe=Ye.loadedKeys,Ve=Fe===void 0?[]:Fe,Qe=Ye.loadingKeys,Ie=Qe===void 0?[]:Qe,tt=B.props,Nt=tt.loadData,Et=tt.onLoad;if(!Nt||Ve.includes(ee)||Ie.includes(ee))return null;var Rt=Nt(W);return Rt.then(function(){var ht=B.state.loadedKeys,qt=(0,qe.L0)(ht,ee);Et==null||Et(qt,{event:"load",node:W}),B.setUncontrolledState({loadedKeys:qt}),B.setState(function(Vt){return{loadingKeys:(0,qe._5)(Vt.loadingKeys,ee)}}),ze()}).catch(function(ht){if(B.setState(function(Vt){return{loadingKeys:(0,qe._5)(Vt.loadingKeys,ee)}}),B.loadingRetryTimes[ee]=(B.loadingRetryTimes[ee]||0)+1,B.loadingRetryTimes[ee]>=$e){var qt=B.state.loadedKeys;(0,w.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),B.setUncontrolledState({loadedKeys:(0,qe.L0)(qt,ee)}),ze()}Ue(ht)}),{loadingKeys:(0,qe.L0)(Ie,ee)}})});return we.catch(function(){}),we}}),(0,K.Z)((0,se.Z)(B),"onNodeMouseEnter",function(W,$){var ee=B.props.onMouseEnter;ee==null||ee({event:W,node:$})}),(0,K.Z)((0,se.Z)(B),"onNodeMouseLeave",function(W,$){var ee=B.props.onMouseLeave;ee==null||ee({event:W,node:$})}),(0,K.Z)((0,se.Z)(B),"onNodeContextMenu",function(W,$){var ee=B.props.onRightClick;ee&&(W.preventDefault(),ee({event:W,node:$}))}),(0,K.Z)((0,se.Z)(B),"onFocus",function(){var W=B.props.onFocus;B.setState({focused:!0});for(var $=arguments.length,ee=new Array($),le=0;le<$;le++)ee[le]=arguments[le];W==null||W.apply(void 0,ee)}),(0,K.Z)((0,se.Z)(B),"onBlur",function(){var W=B.props.onBlur;B.setState({focused:!1}),B.onActiveChange(null);for(var $=arguments.length,ee=new Array($),le=0;le<$;le++)ee[le]=arguments[le];W==null||W.apply(void 0,ee)}),(0,K.Z)((0,se.Z)(B),"getTreeNodeRequiredProps",function(){var W=B.state,$=W.expandedKeys,ee=W.selectedKeys,le=W.loadedKeys,ge=W.loadingKeys,we=W.checkedKeys,ze=W.halfCheckedKeys,Ue=W.dragOverNodeKey,Ye=W.dropPosition,Fe=W.keyEntities;return{expandedKeys:$||[],selectedKeys:ee||[],loadedKeys:le||[],loadingKeys:ge||[],checkedKeys:we||[],halfCheckedKeys:ze||[],dragOverNodeKey:Ue,dropPosition:Ye,keyEntities:Fe}}),(0,K.Z)((0,se.Z)(B),"setExpandedKeys",function(W){var $=B.state,ee=$.treeData,le=$.fieldNames,ge=(0,je.oH)(ee,W,le);B.setUncontrolledState({expandedKeys:W,flattenNodes:ge},!0)}),(0,K.Z)((0,se.Z)(B),"onNodeExpand",function(W,$){var ee=B.state.expandedKeys,le=B.state,ge=le.listChanging,we=le.fieldNames,ze=B.props,Ue=ze.onExpand,Ye=ze.loadData,Fe=$.expanded,Ve=$[we.key];if(!ge){var Qe=ee.includes(Ve),Ie=!Fe;if((0,w.ZP)(Fe&&Qe||!Fe&&!Qe,"Expand state not sync with index check"),ee=Ie?(0,qe.L0)(ee,Ve):(0,qe._5)(ee,Ve),B.setExpandedKeys(ee),Ue==null||Ue(ee,{node:$,expanded:Ie,nativeEvent:W.nativeEvent}),Ie&&Ye){var tt=B.onNodeLoad($);tt&&tt.then(function(){var Nt=(0,je.oH)(B.state.treeData,ee,we);B.setUncontrolledState({flattenNodes:Nt})}).catch(function(){var Nt=B.state.expandedKeys,Et=(0,qe._5)(Nt,Ve);B.setExpandedKeys(Et)})}}}),(0,K.Z)((0,se.Z)(B),"onListChangeStart",function(){B.setUncontrolledState({listChanging:!0})}),(0,K.Z)((0,se.Z)(B),"onListChangeEnd",function(){setTimeout(function(){B.setUncontrolledState({listChanging:!1})})}),(0,K.Z)((0,se.Z)(B),"onActiveChange",function(W){var $=B.state.activeKey,ee=B.props,le=ee.onActiveChange,ge=ee.itemScrollOffset,we=ge===void 0?0:ge;$!==W&&(B.setState({activeKey:W}),W!==null&&B.scrollTo({key:W,offset:we}),le==null||le(W))}),(0,K.Z)((0,se.Z)(B),"getActiveItem",function(){var W=B.state,$=W.activeKey,ee=W.flattenNodes;return $===null?null:ee.find(function(le){var ge=le.key;return ge===$})||null}),(0,K.Z)((0,se.Z)(B),"offsetActiveKey",function(W){var $=B.state,ee=$.flattenNodes,le=$.activeKey,ge=ee.findIndex(function(Ue){var Ye=Ue.key;return Ye===le});ge===-1&&W<0&&(ge=ee.length),ge=(ge+W+ee.length)%ee.length;var we=ee[ge];if(we){var ze=we.key;B.onActiveChange(ze)}else B.onActiveChange(null)}),(0,K.Z)((0,se.Z)(B),"onKeyDown",function(W){var $=B.state,ee=$.activeKey,le=$.expandedKeys,ge=$.checkedKeys,we=$.fieldNames,ze=B.props,Ue=ze.onKeyDown,Ye=ze.checkable,Fe=ze.selectable;switch(W.which){case _.Z.UP:{B.offsetActiveKey(-1),W.preventDefault();break}case _.Z.DOWN:{B.offsetActiveKey(1),W.preventDefault();break}}var Ve=B.getActiveItem();if(Ve&&Ve.data){var Qe=B.getTreeNodeRequiredProps(),Ie=Ve.data.isLeaf===!1||!!(Ve.data[we.children]||[]).length,tt=(0,je.F)((0,me.Z)((0,me.Z)({},(0,je.H8)(ee,Qe)),{},{data:Ve.data,active:!0}));switch(W.which){case _.Z.LEFT:{Ie&&le.includes(ee)?B.onNodeExpand({},tt):Ve.parent&&B.onActiveChange(Ve.parent.key),W.preventDefault();break}case _.Z.RIGHT:{Ie&&!le.includes(ee)?B.onNodeExpand({},tt):Ve.children&&Ve.children.length&&B.onActiveChange(Ve.children[0].key),W.preventDefault();break}case _.Z.ENTER:case _.Z.SPACE:{Ye&&!tt.disabled&&tt.checkable!==!1&&!tt.disableCheckbox?B.onNodeCheck({},tt,!ge.includes(ee)):!Ye&&Fe&&!tt.disabled&&tt.selectable!==!1&&B.onNodeSelect({},tt);break}}}Ue==null||Ue(W)}),(0,K.Z)((0,se.Z)(B),"setUncontrolledState",function(W){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!B.destroyed){var le=!1,ge=!0,we={};Object.keys(W).forEach(function(ze){if(B.props.hasOwnProperty(ze)){ge=!1;return}le=!0,we[ze]=W[ze]}),le&&(!$||ge)&&B.setState((0,me.Z)((0,me.Z)({},we),ee))}}),(0,K.Z)((0,se.Z)(B),"scrollTo",function(W){B.listRef.current.scrollTo(W)}),B}return(0,p.Z)(fe,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var A=this.props,U=A.activeKey,X=A.itemScrollOffset,W=X===void 0?0:X;U!==void 0&&U!==this.state.activeKey&&(this.setState({activeKey:U}),U!==null&&this.scrollTo({key:U,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 A=this.state,U=A.focused,X=A.flattenNodes,W=A.keyEntities,$=A.draggingNodeKey,ee=A.activeKey,le=A.dropLevelOffset,ge=A.dropContainerKey,we=A.dropTargetKey,ze=A.dropPosition,Ue=A.dragOverNodeKey,Ye=A.indent,Fe=this.props,Ve=Fe.prefixCls,Qe=Fe.className,Ie=Fe.style,tt=Fe.showLine,Nt=Fe.focusable,Et=Fe.tabIndex,Rt=Et===void 0?0:Et,ht=Fe.selectable,qt=Fe.showIcon,Vt=Fe.icon,bt=Fe.switcherIcon,zt=Fe.draggable,Tt=Fe.checkable,_t=Fe.checkStrictly,Ot=Fe.disabled,St=Fe.motion,Jt=Fe.loadData,Pt=Fe.filterTreeNode,xt=Fe.height,Dt=Fe.itemHeight,un=Fe.scrollWidth,Ft=Fe.virtual,Ht=Fe.titleRender,It=Fe.dropIndicatorRender,rt=Fe.onContextMenu,d=Fe.onScroll,g=Fe.direction,T=Fe.rootClassName,j=Fe.rootStyle,te=(0,E.Z)(this.props,{aria:!0,data:!0}),Ee;zt&&((0,de.Z)(zt)==="object"?Ee=zt:typeof zt=="function"?Ee={nodeDraggable:zt}:Ee={});var Ce={prefixCls:Ve,selectable:ht,showIcon:qt,icon:Vt,switcherIcon:bt,draggable:Ee,draggingNodeKey:$,checkable:Tt,checkStrictly:_t,disabled:Ot,keyEntities:W,dropLevelOffset:le,dropContainerKey:ge,dropTargetKey:we,dropPosition:ze,dragOverNodeKey:Ue,indent:Ye,direction:g,dropIndicatorRender:It,loadData:Jt,filterTreeNode:Pt,titleRender:Ht,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 F.createElement(k.k.Provider,{value:Ce},F.createElement("div",{className:m()(Ve,Qe,T,(0,K.Z)((0,K.Z)((0,K.Z)({},"".concat(Ve,"-show-line"),tt),"".concat(Ve,"-focused"),U),"".concat(Ve,"-active-focused"),ee!==null)),style:j},F.createElement(Oe,(0,x.Z)({ref:this.listRef,prefixCls:Ve,style:Ie,data:X,disabled:Ot,selectable:ht,checkable:!!Tt,motion:St,dragging:$!==null,height:xt,itemHeight:Dt,virtual:Ft,focusable:Nt,focused:U,tabIndex:Rt,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:rt,onScroll:d,scrollWidth:un},this.getTreeNodeRequiredProps(),te))))}}],[{key:"getDerivedStateFromProps",value:function(A,U){var X=U.prevProps,W={prevProps:A};function $(Rt){return!X&&A.hasOwnProperty(Rt)||X&&X[Rt]!==A[Rt]}var ee,le=U.fieldNames;if($("fieldNames")&&(le=(0,je.w$)(A.fieldNames),W.fieldNames=le),$("treeData")?ee=A.treeData:$("children")&&((0,w.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),ee=(0,je.zn)(A.children)),ee){W.treeData=ee;var ge=(0,je.I8)(ee,{fieldNames:le});W.keyEntities=(0,me.Z)((0,K.Z)({},V,be),ge.keyEntities)}var we=W.keyEntities||U.keyEntities;if($("expandedKeys")||X&&$("autoExpandParent"))W.expandedKeys=A.autoExpandParent||!X&&A.defaultExpandParent?(0,qe.r7)(A.expandedKeys,we):A.expandedKeys;else if(!X&&A.defaultExpandAll){var ze=(0,me.Z)({},we);delete ze[V];var Ue=[];Object.keys(ze).forEach(function(Rt){var ht=ze[Rt];ht.children&&ht.children.length&&Ue.push(ht.key)}),W.expandedKeys=Ue}else!X&&A.defaultExpandedKeys&&(W.expandedKeys=A.autoExpandParent||A.defaultExpandParent?(0,qe.r7)(A.defaultExpandedKeys,we):A.defaultExpandedKeys);if(W.expandedKeys||delete W.expandedKeys,ee||W.expandedKeys){var Ye=(0,je.oH)(ee||U.treeData,W.expandedKeys||U.expandedKeys,le);W.flattenNodes=Ye}if(A.selectable&&($("selectedKeys")?W.selectedKeys=(0,qe.BT)(A.selectedKeys,A):!X&&A.defaultSelectedKeys&&(W.selectedKeys=(0,qe.BT)(A.defaultSelectedKeys,A))),A.checkable){var Fe;if($("checkedKeys")?Fe=(0,qe.E6)(A.checkedKeys)||{}:!X&&A.defaultCheckedKeys?Fe=(0,qe.E6)(A.defaultCheckedKeys)||{}:ee&&(Fe=(0,qe.E6)(A.checkedKeys)||{checkedKeys:U.checkedKeys,halfCheckedKeys:U.halfCheckedKeys}),Fe){var Ve=Fe,Qe=Ve.checkedKeys,Ie=Qe===void 0?[]:Qe,tt=Ve.halfCheckedKeys,Nt=tt===void 0?[]:tt;if(!A.checkStrictly){var Et=(0,xe.S)(Ie,!0,we);Ie=Et.checkedKeys,Nt=Et.halfCheckedKeys}W.checkedKeys=Ie,W.halfCheckedKeys=Nt}}return $("loadedKeys")&&(W.loadedKeys=A.loadedKeys),W}}]),fe}(F.Component);(0,K.Z)(De,"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,K.Z)(De,"TreeNode",Se.Z);var ve=De,Le=ve},82661:function(Ct,He,S){"use strict";S.d(He,{BT:function(){return F},E6:function(){return L},L0:function(){return K},OM:function(){return w},_5:function(){return l},r7:function(){return O},wA:function(){return m},yx:function(){return P}});var x=S(77654),de=S(43749),me=S(48736),ue=S(59301),G=S(639),p=S(65065),se=S(34061),ne=null;function l(D,C){if(!D)return[];var Q=D.slice(),ce=Q.indexOf(C);return ce>=0&&Q.splice(ce,1),Q}function K(D,C){var Q=(D||[]).slice();return Q.indexOf(C)===-1&&Q.push(C),Q}function P(D){return D.split("-")}function m(D,C){var Q=[],ce=(0,p.Z)(C,D);function ae(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Se.forEach(function(Ne){var Te=Ne.key,je=Ne.children;Q.push(Te),ae(je)})}return ae(ce.children),Q}function _(D){if(D.parent){var C=P(D.pos);return Number(C[C.length-1])===D.parent.children.length-1}return!1}function E(D){var C=P(D.pos);return Number(C[C.length-1])===0}function w(D,C,Q,ce,ae,Se,Ne,Te,je,ie){var M,z=D.clientX,H=D.clientY,Z=D.target.getBoundingClientRect(),Y=Z.top,b=Z.height,y=(ie==="rtl"?-1:1)*(((ae==null?void 0:ae.x)||0)-z),V=(y-12)/ce,he=je.filter(function(Le){var re;return(re=Te[Le])===null||re===void 0||(re=re.children)===null||re===void 0?void 0:re.length}),be=(0,p.Z)(Te,Q.eventKey);if(H<Y+b/2){var Pe=Ne.findIndex(function(Le){return Le.key===be.key}),oe=Pe<=0?0:Pe-1,Ae=Ne[oe].key;be=(0,p.Z)(Te,Ae)}var ke=be.key,et=be,Oe=be.key,qe=0,xe=0;if(!he.includes(ke))for(var it=0;it<V&&_(be);it+=1)be=be.parent,xe+=1;var $e=C.data,De=be.node,ve=!0;return E(be)&&be.level===0&&H<Y+b/2&&Se({dragNode:$e,dropNode:De,dropPosition:-1})&&be.key===Q.eventKey?qe=-1:(et.children||[]).length&&he.includes(Oe)?Se({dragNode:$e,dropNode:De,dropPosition:0})?qe=0:ve=!1:xe===0?V>-1.5?Se({dragNode:$e,dropNode:De,dropPosition:1})?qe=1:ve=!1:Se({dragNode:$e,dropNode:De,dropPosition:0})?qe=0:Se({dragNode:$e,dropNode:De,dropPosition:1})?qe=1:ve=!1:Se({dragNode:$e,dropNode:De,dropPosition:1})?qe=1:ve=!1,{dropPosition:qe,dropLevelOffset:xe,dropTargetKey:be.key,dropTargetPos:be.pos,dragOverNodeKey:Oe,dropContainerKey:qe===0?null:((M=be.parent)===null||M===void 0?void 0:M.key)||null,dropAllowed:ve}}function F(D,C){if(D){var Q=C.multiple;return Q?D.slice():D.length?[D[0]]:D}}var k=function(C){return C};function N(D,C){if(!D)return[];var Q=C||{},ce=Q.processProps,ae=ce===void 0?k:ce,Se=Array.isArray(D)?D:[D];return Se.map(function(Ne){var Te=Ne.children,je=_objectWithoutProperties(Ne,ne),ie=N(Te,C);return React.createElement(TreeNode,_extends({key:je.key},ae(je)),ie)})}function L(D){if(!D)return null;var C;if(Array.isArray(D))C={checkedKeys:D,halfCheckedKeys:void 0};else if((0,de.Z)(D)==="object")C={checkedKeys:D.checked||void 0,halfCheckedKeys:D.halfChecked||void 0};else return(0,me.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return C}function O(D,C){var Q=new Set;function ce(ae){if(!Q.has(ae)){var Se=(0,p.Z)(C,ae);if(Se){Q.add(ae);var Ne=Se.parent,Te=Se.node;Te.disabled||Ne&&ce(Ne.key)}}}return(D||[]).forEach(function(ae){ce(ae)}),(0,x.Z)(Q)}},34643:function(Ct,He,S){"use strict";S.d(He,{S:function(){return se}});var x=S(48736),de=S(65065);function me(ne,l){var K=new Set;return ne.forEach(function(P){l.has(P)||K.add(P)}),K}function ue(ne){var l=ne||{},K=l.disabled,P=l.disableCheckbox,m=l.checkable;return!!(K||P)||m===!1}function G(ne,l,K,P){for(var m=new Set(ne),_=new Set,E=0;E<=K;E+=1){var w=l.get(E)||new Set;w.forEach(function(L){var O=L.key,D=L.node,C=L.children,Q=C===void 0?[]:C;m.has(O)&&!P(D)&&Q.filter(function(ce){return!P(ce.node)}).forEach(function(ce){m.add(ce.key)})})}for(var F=new Set,k=K;k>=0;k-=1){var N=l.get(k)||new Set;N.forEach(function(L){var O=L.parent,D=L.node;if(!(P(D)||!L.parent||F.has(L.parent.key))){if(P(L.parent.node)){F.add(O.key);return}var C=!0,Q=!1;(O.children||[]).filter(function(ce){return!P(ce.node)}).forEach(function(ce){var ae=ce.key,Se=m.has(ae);C&&!Se&&(C=!1),!Q&&(Se||_.has(ae))&&(Q=!0)}),C&&m.add(O.key),Q&&_.add(O.key),F.add(O.key)}})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(me(_,m))}}function p(ne,l,K,P,m){for(var _=new Set(ne),E=new Set(l),w=0;w<=P;w+=1){var F=K.get(w)||new Set;F.forEach(function(O){var D=O.key,C=O.node,Q=O.children,ce=Q===void 0?[]:Q;!_.has(D)&&!E.has(D)&&!m(C)&&ce.filter(function(ae){return!m(ae.node)}).forEach(function(ae){_.delete(ae.key)})})}E=new Set;for(var k=new Set,N=P;N>=0;N-=1){var L=K.get(N)||new Set;L.forEach(function(O){var D=O.parent,C=O.node;if(!(m(C)||!O.parent||k.has(O.parent.key))){if(m(O.parent.node)){k.add(D.key);return}var Q=!0,ce=!1;(D.children||[]).filter(function(ae){return!m(ae.node)}).forEach(function(ae){var Se=ae.key,Ne=_.has(Se);Q&&!Ne&&(Q=!1),!ce&&(Ne||E.has(Se))&&(ce=!0)}),Q||_.delete(D.key),ce&&E.add(D.key),k.add(D.key)}})}return{checkedKeys:Array.from(_),halfCheckedKeys:Array.from(me(E,_))}}function se(ne,l,K,P){var m=[],_;P?_=P:_=ue;var E=new Set(ne.filter(function(N){var L=!!(0,de.Z)(K,N);return L||m.push(N),L})),w=new Map,F=0;Object.keys(K).forEach(function(N){var L=K[N],O=L.level,D=w.get(O);D||(D=new Set,w.set(O,D)),D.add(L),F=Math.max(F,O)}),(0,x.ZP)(!m.length,"Tree missing follow keys: ".concat(m.slice(0,100).map(function(N){return"'".concat(N,"'")}).join(", ")));var k;return l===!0?k=G(E,w,F,_):k=p(E,l.halfCheckedKeys,w,F,_),k}},65065:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return x}});function x(de,me){return de[me]}},34061:function(Ct,He,S){"use strict";S.d(He,{F:function(){return O},H8:function(){return L},I8:function(){return N},km:function(){return m},oH:function(){return F},w$:function(){return _},zn:function(){return w}});var x=S(43749),de=S(77654),me=S(85899),ue=S(42244),G=S(11592),p=S(2738),se=S(48736),ne=S(65065),l=["children"];function K(D,C){return"".concat(D,"-").concat(C)}function P(D){return D&&D.type&&D.type.isTreeNode}function m(D,C){return D!=null?D:C}function _(D){var C=D||{},Q=C.title,ce=C._title,ae=C.key,Se=C.children,Ne=Q||"title";return{title:Ne,_title:ce||[Ne],key:ae||"key",children:Se||"children"}}function E(D,C){var Q=new Map;function ce(ae){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(ae||[]).forEach(function(Ne){var Te=Ne[C.key],je=Ne[C.children];warning(Te!=null,"Tree node must have a certain key: [".concat(Se).concat(Te,"]"));var ie=String(Te);warning(!Q.has(ie)||Te===null||Te===void 0,"Same 'key' exist in the Tree: ".concat(ie)),Q.set(ie,!0),ce(je,"".concat(Se).concat(ie," > "))})}ce(D)}function w(D){function C(Q){var ce=(0,G.Z)(Q);return ce.map(function(ae){if(!P(ae))return(0,se.ZP)(!ae,"Tree/TreeNode can only accept TreeNode as children."),null;var Se=ae.key,Ne=ae.props,Te=Ne.children,je=(0,ue.Z)(Ne,l),ie=(0,me.Z)({key:Se},je),M=C(Te);return M.length&&(ie.children=M),ie}).filter(function(ae){return ae})}return C(D)}function F(D,C,Q){var ce=_(Q),ae=ce._title,Se=ce.key,Ne=ce.children,Te=new Set(C===!0?[]:C),je=[];function ie(M){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return M.map(function(H,Z){for(var Y=K(z?z.pos:"0",Z),b=m(H[Se],Y),y,V=0;V<ae.length;V+=1){var he=ae[V];if(H[he]!==void 0){y=H[he];break}}var be=Object.assign((0,p.Z)(H,[].concat((0,de.Z)(ae),[Se,Ne])),{title:y,key:b,parent:z,pos:Y,children:null,data:H,isStart:[].concat((0,de.Z)(z?z.isStart:[]),[Z===0]),isEnd:[].concat((0,de.Z)(z?z.isEnd:[]),[Z===M.length-1])});return je.push(be),C===!0||Te.has(b)?be.children=ie(H[Ne]||[],be):be.children=[],be})}return ie(D),je}function k(D,C,Q){var ce={};(0,x.Z)(Q)==="object"?ce=Q:ce={externalGetKey:Q},ce=ce||{};var ae=ce,Se=ae.childrenPropName,Ne=ae.externalGetKey,Te=ae.fieldNames,je=_(Te),ie=je.key,M=je.children,z=Se||M,H;Ne?typeof Ne=="string"?H=function(b){return b[Ne]}:typeof Ne=="function"&&(H=function(b){return Ne(b)}):H=function(b,y){return m(b[ie],y)};function Z(Y,b,y,V){var he=Y?Y[z]:D,be=Y?K(y.pos,b):"0",Pe=Y?[].concat((0,de.Z)(V),[Y]):[];if(Y){var oe=H(Y,be),Ae={node:Y,index:b,pos:be,key:oe,parentPos:y.node?y.pos:null,level:y.level+1,nodes:Pe};C(Ae)}he&&he.forEach(function(ke,et){Z(ke,et,{node:Y,pos:be,level:y?y.level+1:-1},Pe)})}Z(null)}function N(D){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Q=C.initWrapper,ce=C.processEntity,ae=C.onProcessFinished,Se=C.externalGetKey,Ne=C.childrenPropName,Te=C.fieldNames,je=arguments.length>2?arguments[2]:void 0,ie=Se||je,M={},z={},H={posEntities:M,keyEntities:z};return Q&&(H=Q(H)||H),k(D,function(Z){var Y=Z.node,b=Z.index,y=Z.pos,V=Z.key,he=Z.parentPos,be=Z.level,Pe=Z.nodes,oe={node:Y,nodes:Pe,index:b,key:V,pos:y,level:be},Ae=m(V,y);M[y]=oe,z[Ae]=oe,oe.parent=M[he],oe.parent&&(oe.parent.children=oe.parent.children||[],oe.parent.children.push(oe)),ce&&ce(oe,H)},{externalGetKey:ie,childrenPropName:Ne,fieldNames:Te}),ae&&ae(H),H}function L(D,C){var Q=C.expandedKeys,ce=C.selectedKeys,ae=C.loadedKeys,Se=C.loadingKeys,Ne=C.checkedKeys,Te=C.halfCheckedKeys,je=C.dragOverNodeKey,ie=C.dropPosition,M=C.keyEntities,z=(0,ne.Z)(M,D),H={eventKey:D,expanded:Q.indexOf(D)!==-1,selected:ce.indexOf(D)!==-1,loaded:ae.indexOf(D)!==-1,loading:Se.indexOf(D)!==-1,checked:Ne.indexOf(D)!==-1,halfChecked:Te.indexOf(D)!==-1,pos:String(z?z.pos:""),dragOver:je===D&&ie===0,dragOverGapTop:je===D&&ie===-1,dragOverGapBottom:je===D&&ie===1};return H}function O(D){var C=D.data,Q=D.expanded,ce=D.selected,ae=D.checked,Se=D.loaded,Ne=D.loading,Te=D.halfChecked,je=D.dragOver,ie=D.dragOverGapTop,M=D.dragOverGapBottom,z=D.pos,H=D.active,Z=D.eventKey,Y=(0,me.Z)((0,me.Z)({},C),{},{expanded:Q,selected:ce,checked:ae,loaded:Se,loading:Ne,halfChecked:Te,dragOver:je,dragOverGapTop:ie,dragOverGapBottom:M,pos:z,active:H,key:Z});return"props"in Y||Object.defineProperty(Y,"props",{get:function(){return(0,se.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),D}}),Y}},49658:function(Ct,He){"use strict";He.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var S=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(S)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(S==null?void 0:S.substr(0,4))}},48911:function(Ct,He,S){"use strict";S.d(He,{Z:function(){return $e}});var x=S(60499),de=S(43749),me=S(85899),ue=S(18642),G=S(72190),p=S(42244),se=S(92310),ne=S.n(se),l=S(29301),K=S(70425),P=S(34280),m=S(59301),_=S(4676),E=m.forwardRef(function(De,ve){var Le=De.height,re=De.offsetY,Re=De.offsetX,fe=De.children,B=De.prefixCls,A=De.onInnerResize,U=De.innerProps,X=De.rtl,W=De.extra,$={},ee={display:"flex",flexDirection:"column"};return re!==void 0&&($={height:Le,position:"relative",overflow:"hidden"},ee=(0,me.Z)((0,me.Z)({},ee),{},(0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)({transform:"translateY(".concat(re,"px)")},X?"marginRight":"marginLeft",-Re),"position","absolute"),"left",0),"right",0),"top",0))),m.createElement("div",{style:$},m.createElement(l.Z,{onResize:function(ge){var we=ge.offsetHeight;we&&A&&A()}},m.createElement("div",(0,x.Z)({style:ee,className:ne()((0,ue.Z)({},"".concat(B,"-holder-inner"),B)),ref:ve},U),fe,W)))});E.displayName="Filler";var w=E;function F(De){var ve=De.children,Le=De.setRef,re=m.useCallback(function(Re){Le(Re)},[]);return m.cloneElement(ve,{ref:re})}function k(De,ve,Le,re,Re,fe,B,A){var U=A.getKey;return De.slice(ve,Le+1).map(function(X,W){var $=ve+W,ee=B(X,$,{style:{width:re},offsetX:Re}),le=U(X);return m.createElement(F,{key:le,setRef:function(we){return fe(X,we)}},ee)})}function N(De,ve,Le,re){var Re=Le-De,fe=ve-Le,B=Math.min(Re,fe)*2;if(re<=B){var A=Math.floor(re/2);return re%2?Le+A+1:Le-A}return Re>fe?Le-(re-fe):Le+(re-Re)}function L(De,ve,Le){var re=De.length,Re=ve.length,fe,B;if(re===0&&Re===0)return null;re<Re?(fe=De,B=ve):(fe=ve,B=De);var A={__EMPTY_ITEM__:!0};function U(ge){return ge!==void 0?Le(ge):A}for(var X=null,W=Math.abs(re-Re)!==1,$=0;$<B.length;$+=1){var ee=U(fe[$]),le=U(B[$]);if(ee!==le){X=$,W=W||ee!==U(B[$+1]);break}}return X===null?null:{index:X,multiple:W}}function O(De,ve,Le){var re=m.useState(De),Re=(0,G.Z)(re,2),fe=Re[0],B=Re[1],A=m.useState(null),U=(0,G.Z)(A,2),X=U[0],W=U[1];return m.useEffect(function(){var $=L(fe||[],De||[],ve);($==null?void 0:$.index)!==void 0&&(Le==null||Le($.index),W(De[$.index])),B(De)},[De]),[X]}var D=S(16089),C=(typeof navigator=="undefined"?"undefined":(0,de.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Q=C,ce=function(De,ve,Le,re){var Re=(0,m.useRef)(!1),fe=(0,m.useRef)(null);function B(){clearTimeout(fe.current),Re.current=!0,fe.current=setTimeout(function(){Re.current=!1},50)}var A=(0,m.useRef)({top:De,bottom:ve,left:Le,right:re});return A.current.top=De,A.current.bottom=ve,A.current.left=Le,A.current.right=re,function(U,X){var W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,$=U?X<0&&A.current.left||X>0&&A.current.right:X<0&&A.current.top||X>0&&A.current.bottom;return W&&$?(clearTimeout(fe.current),Re.current=!1):(!$||Re.current)&&B(),!Re.current&&$}};function ae(De,ve,Le,re,Re,fe,B){var A=(0,m.useRef)(0),U=(0,m.useRef)(null),X=(0,m.useRef)(null),W=(0,m.useRef)(!1),$=ce(ve,Le,re,Re);function ee(Ye,Fe){if(D.Z.cancel(U.current),!$(!1,Fe)){var Ve=Ye;if(!Ve._virtualHandled)Ve._virtualHandled=!0;else return;A.current+=Fe,X.current=Fe,Q||Ve.preventDefault(),U.current=(0,D.Z)(function(){var Qe=W.current?10:1;B(A.current*Qe,!1),A.current=0})}}function le(Ye,Fe){B(Fe,!0),Q||Ye.preventDefault()}var ge=(0,m.useRef)(null),we=(0,m.useRef)(null);function ze(Ye){if(De){D.Z.cancel(we.current),we.current=(0,D.Z)(function(){ge.current=null},2);var Fe=Ye.deltaX,Ve=Ye.deltaY,Qe=Ye.shiftKey,Ie=Fe,tt=Ve;(ge.current==="sx"||!ge.current&&Qe&&Ve&&!Fe)&&(Ie=Ve,tt=0,ge.current="sx");var Nt=Math.abs(Ie),Et=Math.abs(tt);ge.current===null&&(ge.current=fe&&Nt>Et?"x":"y"),ge.current==="y"?ee(Ye,tt):le(Ye,Ie)}}function Ue(Ye){De&&(W.current=Ye.detail===X.current)}return[ze,Ue]}function Se(De,ve,Le,re){var Re=m.useMemo(function(){return[new Map,[]]},[De,Le.id,re]),fe=(0,G.Z)(Re,2),B=fe[0],A=fe[1],U=function(W){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:W,ee=B.get(W),le=B.get($);if(ee===void 0||le===void 0)for(var ge=De.length,we=A.length;we<ge;we+=1){var ze,Ue=De[we],Ye=ve(Ue);B.set(Ye,we);var Fe=(ze=Le.get(Ye))!==null&&ze!==void 0?ze:re;if(A[we]=(A[we-1]||0)+Fe,Ye===W&&(ee=we),Ye===$&&(le=we),ee!==void 0&&le!==void 0)break}return{top:A[ee-1]||0,bottom:A[le]}};return U}var Ne=S(38705),Te=S(17212),je=function(){function De(){(0,Ne.Z)(this,De),(0,ue.Z)(this,"maps",void 0),(0,ue.Z)(this,"id",0),(0,ue.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,Te.Z)(De,[{key:"set",value:function(Le,re){this.diffRecords.set(Le,this.maps[Le]),this.maps[Le]=re,this.id+=1}},{key:"get",value:function(Le){return this.maps[Le]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),De}(),ie=je;function M(De){var ve=parseFloat(De);return isNaN(ve)?0:ve}function z(De,ve,Le){var re=m.useState(0),Re=(0,G.Z)(re,2),fe=Re[0],B=Re[1],A=(0,m.useRef)(new Map),U=(0,m.useRef)(new ie),X=(0,m.useRef)(0);function W(){X.current+=1}function $(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;W();var ge=function(){var Ue=!1;A.current.forEach(function(Ye,Fe){if(Ye&&Ye.offsetParent){var Ve=Ye.offsetHeight,Qe=getComputedStyle(Ye),Ie=Qe.marginTop,tt=Qe.marginBottom,Nt=M(Ie),Et=M(tt),Rt=Ve+Nt+Et;U.current.get(Fe)!==Rt&&(U.current.set(Fe,Rt),Ue=!0)}}),Ue&&B(function(Ye){return Ye+1})};if(le)ge();else{X.current+=1;var we=X.current;Promise.resolve().then(function(){we===X.current&&ge()})}}function ee(le,ge){var we=De(le),ze=A.current.get(we);ge?(A.current.set(we,ge),$()):A.current.delete(we),!ze!=!ge&&(ge?ve==null||ve(le):Le==null||Le(le))}return(0,m.useEffect)(function(){return W},[]),[ee,$,U.current,fe]}var H=14/15;function Z(De,ve,Le){var re=(0,m.useRef)(!1),Re=(0,m.useRef)(0),fe=(0,m.useRef)(0),B=(0,m.useRef)(null),A=(0,m.useRef)(null),U,X=function(le){if(re.current){var ge=Math.ceil(le.touches[0].pageX),we=Math.ceil(le.touches[0].pageY),ze=Re.current-ge,Ue=fe.current-we,Ye=Math.abs(ze)>Math.abs(Ue);Ye?Re.current=ge:fe.current=we;var Fe=Le(Ye,Ye?ze:Ue,!1,le);Fe&&le.preventDefault(),clearInterval(A.current),Fe&&(A.current=setInterval(function(){Ye?ze*=H:Ue*=H;var Ve=Math.floor(Ye?ze:Ue);(!Le(Ye,Ve,!0)||Math.abs(Ve)<=.1)&&clearInterval(A.current)},16))}},W=function(){re.current=!1,U()},$=function(le){U(),le.touches.length===1&&!re.current&&(re.current=!0,Re.current=Math.ceil(le.touches[0].pageX),fe.current=Math.ceil(le.touches[0].pageY),B.current=le.target,B.current.addEventListener("touchmove",X,{passive:!1}),B.current.addEventListener("touchend",W,{passive:!0}))};U=function(){B.current&&(B.current.removeEventListener("touchmove",X),B.current.removeEventListener("touchend",W))},(0,P.Z)(function(){return De&&ve.current.addEventListener("touchstart",$,{passive:!0}),function(){var ee;(ee=ve.current)===null||ee===void 0||ee.removeEventListener("touchstart",$),U(),clearInterval(A.current)}},[De])}function Y(De){return Math.floor(Math.pow(De,.5))}function b(De,ve){var Le="touches"in De?De.touches[0]:De;return Le[ve?"pageX":"pageY"]-window[ve?"scrollX":"scrollY"]}function y(De,ve,Le){m.useEffect(function(){var re=ve.current;if(De&&re){var Re=!1,fe,B,A=function(){D.Z.cancel(fe)},U=function ee(){A(),fe=(0,D.Z)(function(){Le(B),ee()})},X=function(){Re=!1,A()},W=function(le){if(!(le.target.draggable||le.button!==0)){var ge=le;ge._virtualHandled||(ge._virtualHandled=!0,Re=!0)}},$=function(le){if(Re){var ge=b(le,!1),we=re.getBoundingClientRect(),ze=we.top,Ue=we.bottom;if(ge<=ze){var Ye=ze-ge;B=-Y(Ye),U()}else if(ge>=Ue){var Fe=ge-Ue;B=Y(Fe),U()}else A()}};return re.addEventListener("mousedown",W),re.ownerDocument.addEventListener("mouseup",X),re.ownerDocument.addEventListener("mousemove",$),re.ownerDocument.addEventListener("dragend",X),function(){re.removeEventListener("mousedown",W),re.ownerDocument.removeEventListener("mouseup",X),re.ownerDocument.removeEventListener("mousemove",$),re.ownerDocument.removeEventListener("dragend",X),A()}}},[De])}var V=10;function he(De,ve,Le,re,Re,fe,B,A){var U=m.useRef(),X=m.useState(null),W=(0,G.Z)(X,2),$=W[0],ee=W[1];return(0,P.Z)(function(){if($&&$.times<V){if(!De.current){ee(function(St){return(0,me.Z)({},St)});return}fe();var le=$.targetAlign,ge=$.originAlign,we=$.index,ze=$.offset,Ue=De.current.clientHeight,Ye=!1,Fe=le,Ve=null;if(Ue){for(var Qe=le||ge,Ie=0,tt=0,Nt=0,Et=Math.min(ve.length-1,we),Rt=0;Rt<=Et;Rt+=1){var ht=Re(ve[Rt]);tt=Ie;var qt=Le.get(ht);Nt=tt+(qt===void 0?re:qt),Ie=Nt}for(var Vt=Qe==="top"?ze:Ue-ze,bt=Et;bt>=0;bt-=1){var zt=Re(ve[bt]),Tt=Le.get(zt);if(Tt===void 0){Ye=!0;break}if(Vt-=Tt,Vt<=0)break}switch(Qe){case"top":Ve=tt-ze;break;case"bottom":Ve=Nt-Ue+ze;break;default:{var _t=De.current.scrollTop,Ot=_t+Ue;tt<_t?Fe="top":Nt>Ot&&(Fe="bottom")}}Ve!==null&&B(Ve),Ve!==$.lastTop&&(Ye=!0)}Ye&&ee((0,me.Z)((0,me.Z)({},$),{},{times:$.times+1,targetAlign:Fe,lastTop:Ve}))}},[$,De.current]),function(le){if(le==null){A();return}if(D.Z.cancel(U.current),typeof le=="number")B(le);else if(le&&(0,de.Z)(le)==="object"){var ge,we=le.align;"index"in le?ge=le.index:ge=ve.findIndex(function(Ye){return Re(Ye)===le.key});var ze=le.offset,Ue=ze===void 0?0:ze;ee({times:0,index:ge,offset:Ue,originAlign:we})}}}var be=m.forwardRef(function(De,ve){var Le=De.prefixCls,re=De.rtl,Re=De.scrollOffset,fe=De.scrollRange,B=De.onStartMove,A=De.onStopMove,U=De.onScroll,X=De.horizontal,W=De.spinSize,$=De.containerSize,ee=De.style,le=De.thumbStyle,ge=De.showScrollBar,we=m.useState(!1),ze=(0,G.Z)(we,2),Ue=ze[0],Ye=ze[1],Fe=m.useState(null),Ve=(0,G.Z)(Fe,2),Qe=Ve[0],Ie=Ve[1],tt=m.useState(null),Nt=(0,G.Z)(tt,2),Et=Nt[0],Rt=Nt[1],ht=!re,qt=m.useRef(),Vt=m.useRef(),bt=m.useState(ge),zt=(0,G.Z)(bt,2),Tt=zt[0],_t=zt[1],Ot=m.useRef(),St=function(){ge===!0||ge===!1||(clearTimeout(Ot.current),_t(!0),Ot.current=setTimeout(function(){_t(!1)},3e3))},Jt=fe-$||0,Pt=$-W||0,xt=m.useMemo(function(){if(Re===0||Jt===0)return 0;var T=Re/Jt;return T*Pt},[Re,Jt,Pt]),Dt=function(j){j.stopPropagation(),j.preventDefault()},un=m.useRef({top:xt,dragging:Ue,pageY:Qe,startTop:Et});un.current={top:xt,dragging:Ue,pageY:Qe,startTop:Et};var Ft=function(j){Ye(!0),Ie(b(j,X)),Rt(un.current.top),B(),j.stopPropagation(),j.preventDefault()};m.useEffect(function(){var T=function(Ce){Ce.preventDefault()},j=qt.current,te=Vt.current;return j.addEventListener("touchstart",T,{passive:!1}),te.addEventListener("touchstart",Ft,{passive:!1}),function(){j.removeEventListener("touchstart",T),te.removeEventListener("touchstart",Ft)}},[]);var Ht=m.useRef();Ht.current=Jt;var It=m.useRef();It.current=Pt,m.useEffect(function(){if(Ue){var T,j=function(Ce){var Xe=un.current,Ze=Xe.dragging,ut=Xe.pageY,ft=Xe.startTop;D.Z.cancel(T);var Lt=qt.current.getBoundingClientRect(),vt=$/(X?Lt.width:Lt.height);if(Ze){var Kt=(b(Ce,X)-ut)*vt,$t=ft;!ht&&X?$t-=Kt:$t+=Kt;var gt=Ht.current,mt=It.current,Bt=mt?$t/mt:0,kt=Math.ceil(Bt*gt);kt=Math.max(kt,0),kt=Math.min(kt,gt),T=(0,D.Z)(function(){U(kt,X)})}},te=function(){Ye(!1),A()};return window.addEventListener("mousemove",j,{passive:!0}),window.addEventListener("touchmove",j,{passive:!0}),window.addEventListener("mouseup",te,{passive:!0}),window.addEventListener("touchend",te,{passive:!0}),function(){window.removeEventListener("mousemove",j),window.removeEventListener("touchmove",j),window.removeEventListener("mouseup",te),window.removeEventListener("touchend",te),D.Z.cancel(T)}}},[Ue]),m.useEffect(function(){return St(),function(){clearTimeout(Ot.current)}},[Re]),m.useImperativeHandle(ve,function(){return{delayHidden:St}});var rt="".concat(Le,"-scrollbar"),d={position:"absolute",visibility:Tt?null:"hidden"},g={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return X?(Object.assign(d,{height:8,left:0,right:0,bottom:0}),Object.assign(g,(0,ue.Z)({height:"100%",width:W},ht?"left":"right",xt))):(Object.assign(d,(0,ue.Z)({width:8,top:0,bottom:0},ht?"right":"left",0)),Object.assign(g,{width:"100%",height:W,top:xt})),m.createElement("div",{ref:qt,className:ne()(rt,(0,ue.Z)((0,ue.Z)((0,ue.Z)({},"".concat(rt,"-horizontal"),X),"".concat(rt,"-vertical"),!X),"".concat(rt,"-visible"),Tt)),style:(0,me.Z)((0,me.Z)({},d),ee),onMouseDown:Dt,onMouseMove:St},m.createElement("div",{ref:Vt,className:ne()("".concat(rt,"-thumb"),(0,ue.Z)({},"".concat(rt,"-thumb-moving"),Ue)),style:(0,me.Z)((0,me.Z)({},g),le),onMouseDown:Ft}))}),Pe=be,oe=20;function Ae(){var De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Le=De/ve*De;return isNaN(Le)&&(Le=0),Le=Math.max(Le,oe),Math.floor(Le)}var ke=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],et=[],Oe={overflowY:"auto",overflowAnchor:"none"};function qe(De,ve){var Le=De.prefixCls,re=Le===void 0?"rc-virtual-list":Le,Re=De.className,fe=De.height,B=De.itemHeight,A=De.fullHeight,U=A===void 0?!0:A,X=De.style,W=De.data,$=De.children,ee=De.itemKey,le=De.virtual,ge=De.direction,we=De.scrollWidth,ze=De.component,Ue=ze===void 0?"div":ze,Ye=De.onScroll,Fe=De.onVirtualScroll,Ve=De.onVisibleChange,Qe=De.innerProps,Ie=De.extraRender,tt=De.styles,Nt=De.showScrollBar,Et=Nt===void 0?"optional":Nt,Rt=(0,p.Z)(De,ke),ht=m.useCallback(function(rn){return typeof ee=="function"?ee(rn):rn==null?void 0:rn[ee]},[ee]),qt=z(ht,null,null),Vt=(0,G.Z)(qt,4),bt=Vt[0],zt=Vt[1],Tt=Vt[2],_t=Vt[3],Ot=!!(le!==!1&&fe&&B),St=m.useMemo(function(){return Object.values(Tt.maps).reduce(function(rn,Gt){return rn+Gt},0)},[Tt.id,Tt.maps]),Jt=Ot&&W&&(Math.max(B*W.length,St)>fe||!!we),Pt=ge==="rtl",xt=ne()(re,(0,ue.Z)({},"".concat(re,"-rtl"),Pt),Re),Dt=W||et,un=(0,m.useRef)(),Ft=(0,m.useRef)(),Ht=(0,m.useRef)(),It=(0,m.useState)(0),rt=(0,G.Z)(It,2),d=rt[0],g=rt[1],T=(0,m.useState)(0),j=(0,G.Z)(T,2),te=j[0],Ee=j[1],Ce=(0,m.useState)(!1),Xe=(0,G.Z)(Ce,2),Ze=Xe[0],ut=Xe[1],ft=function(){ut(!0)},Lt=function(){ut(!1)},vt={getKey:ht};function Kt(rn){g(function(Gt){var en;typeof rn=="function"?en=rn(Gt):en=rn;var Bn=xn(en);return un.current.scrollTop=Bn,Bn})}var $t=(0,m.useRef)({start:0,end:Dt.length}),gt=(0,m.useRef)(),mt=O(Dt,ht),Bt=(0,G.Z)(mt,1),kt=Bt[0];gt.current=kt;var hn=m.useMemo(function(){if(!Ot)return{scrollHeight:void 0,start:0,end:Dt.length-1,offset:void 0};if(!Jt){var rn;return{scrollHeight:((rn=Ft.current)===null||rn===void 0?void 0:rn.offsetHeight)||0,start:0,end:Dt.length-1,offset:void 0}}for(var Gt=0,en,Bn,Un,Jn=Dt.length,oi=0;oi<Jn;oi+=1){var Hn=Dt[oi],ci=ht(Hn),Ti=Tt.get(ci),di=Gt+(Ti===void 0?B:Ti);di>=d&&en===void 0&&(en=oi,Bn=Gt),di>d+fe&&Un===void 0&&(Un=oi),Gt=di}return en===void 0&&(en=0,Bn=0,Un=Math.ceil(fe/B)),Un===void 0&&(Un=Dt.length-1),Un=Math.min(Un+1,Dt.length-1),{scrollHeight:Gt,start:en,end:Un,offset:Bn}},[Jt,Ot,d,Dt,_t,fe]),En=hn.scrollHeight,Wt=hn.start,Mt=hn.end,Qt=hn.offset;$t.current.start=Wt,$t.current.end=Mt,m.useLayoutEffect(function(){var rn=Tt.getRecord();if(rn.size===1){var Gt=Array.from(rn.keys())[0],en=rn.get(Gt),Bn=Dt[Wt];if(Bn&&en===void 0){var Un=ht(Bn);if(Un===Gt){var Jn=Tt.get(Gt),oi=Jn-B;Kt(function(Hn){return Hn+oi})}}}Tt.resetRecord()},[En]);var gn=m.useState({width:0,height:fe}),Be=(0,G.Z)(gn,2),Ke=Be[0],pt=Be[1],lt=function(Gt){pt({width:Gt.offsetWidth,height:Gt.offsetHeight})},st=(0,m.useRef)(),ct=(0,m.useRef)(),At=m.useMemo(function(){return Ae(Ke.width,we)},[Ke.width,we]),Ut=m.useMemo(function(){return Ae(Ke.height,En)},[Ke.height,En]),cn=En-fe,tn=(0,m.useRef)(cn);tn.current=cn;function xn(rn){var Gt=rn;return Number.isNaN(tn.current)||(Gt=Math.min(Gt,tn.current)),Gt=Math.max(Gt,0),Gt}var an=d<=0,_n=d>=cn,Sn=te<=0,Ln=te>=we,Pn=ce(an,_n,Sn,Ln),pn=function(){return{x:Pt?-te:te,y:d}},yn=(0,m.useRef)(pn()),Rn=(0,K.zX)(function(rn){if(Fe){var Gt=(0,me.Z)((0,me.Z)({},pn()),rn);(yn.current.x!==Gt.x||yn.current.y!==Gt.y)&&(Fe(Gt),yn.current=Gt)}});function In(rn,Gt){var en=rn;Gt?((0,_.flushSync)(function(){Ee(en)}),Rn()):Kt(en)}function wn(rn){var Gt=rn.currentTarget.scrollTop;Gt!==d&&Kt(Gt),Ye==null||Ye(rn),Rn()}var $n=function(Gt){var en=Gt,Bn=we?we-Ke.width:0;return en=Math.max(en,0),en=Math.min(en,Bn),en},Dn=(0,K.zX)(function(rn,Gt){Gt?((0,_.flushSync)(function(){Ee(function(en){var Bn=en+(Pt?-rn:rn);return $n(Bn)})}),Rn()):Kt(function(en){var Bn=en+rn;return Bn})}),Nn=ae(Ot,an,_n,Sn,Ln,!!we,Dn),Xn=(0,G.Z)(Nn,2),Gn=Xn[0],si=Xn[1];Z(Ot,un,function(rn,Gt,en,Bn){var Un=Bn;return Pn(rn,Gt,en)?!1:!Un||!Un._virtualHandled?(Un&&(Un._virtualHandled=!0),Gn({preventDefault:function(){},deltaX:rn?Gt:0,deltaY:rn?0:Gt}),!0):!1}),y(Jt,un,function(rn){Kt(function(Gt){return Gt+rn})}),(0,P.Z)(function(){function rn(en){var Bn=an&&en.detail<0,Un=_n&&en.detail>0;Ot&&!Bn&&!Un&&en.preventDefault()}var Gt=un.current;return Gt.addEventListener("wheel",Gn,{passive:!1}),Gt.addEventListener("DOMMouseScroll",si,{passive:!0}),Gt.addEventListener("MozMousePixelScroll",rn,{passive:!1}),function(){Gt.removeEventListener("wheel",Gn),Gt.removeEventListener("DOMMouseScroll",si),Gt.removeEventListener("MozMousePixelScroll",rn)}},[Ot,an,_n]),(0,P.Z)(function(){if(we){var rn=$n(te);Ee(rn),Rn({x:rn})}},[Ke.width,we]);var Zn=function(){var Gt,en;(Gt=st.current)===null||Gt===void 0||Gt.delayHidden(),(en=ct.current)===null||en===void 0||en.delayHidden()},Qn=he(un,Dt,Tt,B,ht,function(){return zt(!0)},Kt,Zn);m.useImperativeHandle(ve,function(){return{nativeElement:Ht.current,getScrollInfo:pn,scrollTo:function(Gt){function en(Bn){return Bn&&(0,de.Z)(Bn)==="object"&&("left"in Bn||"top"in Bn)}en(Gt)?(Gt.left!==void 0&&Ee($n(Gt.left)),Qn(Gt.top)):Qn(Gt)}}}),(0,P.Z)(function(){if(Ve){var rn=Dt.slice(Wt,Mt+1);Ve(rn,Dt)}},[Wt,Mt,Dt]);var ni=Se(Dt,ht,Tt,B),ii=Ie==null?void 0:Ie({start:Wt,end:Mt,virtual:Jt,offsetX:te,offsetY:Qt,rtl:Pt,getSize:ni}),ei=k(Dt,Wt,Mt,we,te,bt,$,vt),Cn=null;fe&&(Cn=(0,me.Z)((0,ue.Z)({},U?"height":"maxHeight",fe),Oe),Ot&&(Cn.overflowY="hidden",we&&(Cn.overflowX="hidden"),Ze&&(Cn.pointerEvents="none")));var kn={};return Pt&&(kn.dir="rtl"),m.createElement("div",(0,x.Z)({ref:Ht,style:(0,me.Z)((0,me.Z)({},X),{},{position:"relative"}),className:xt},kn,Rt),m.createElement(l.Z,{onResize:lt},m.createElement(Ue,{className:"".concat(re,"-holder"),style:Cn,ref:un,onScroll:wn,onMouseEnter:Zn},m.createElement(w,{prefixCls:re,height:En,offsetX:te,offsetY:Qt,scrollWidth:we,onInnerResize:zt,ref:Ft,innerProps:Qe,rtl:Pt,extra:ii},ei))),Jt&&En>fe&&m.createElement(Pe,{ref:st,prefixCls:re,scrollOffset:d,scrollRange:En,rtl:Pt,onScroll:In,onStartMove:ft,onStopMove:Lt,spinSize:Ut,containerSize:Ke.height,style:tt==null?void 0:tt.verticalScrollBar,thumbStyle:tt==null?void 0:tt.verticalScrollBarThumb,showScrollBar:Et}),Jt&&we>Ke.width&&m.createElement(Pe,{ref:ct,prefixCls:re,scrollOffset:te,scrollRange:we,rtl:Pt,onScroll:In,onStartMove:ft,onStopMove:Lt,spinSize:At,containerSize:Ke.width,horizontal:!0,style:tt==null?void 0:tt.horizontalScrollBar,thumbStyle:tt==null?void 0:tt.horizontalScrollBarThumb,showScrollBar:Et}))}var xe=m.forwardRef(qe);xe.displayName="List";var it=xe,$e=it},83145:function(Ct,He,S){"use strict";Object.defineProperty(He,"__esModule",{value:!0}),He.CopyToClipboard=void 0;var x=me(S(59301)),de=me(S(25769));function me(L){return L&&L.__esModule?L:{default:L}}function ue(L){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ue=function(D){return typeof D}:ue=function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},ue(L)}function G(L,O){var D=Object.keys(L);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(L);O&&(C=C.filter(function(Q){return Object.getOwnPropertyDescriptor(L,Q).enumerable})),D.push.apply(D,C)}return D}function p(L){for(var O=1;O<arguments.length;O++){var D=arguments[O]!=null?arguments[O]:{};O%2?G(D,!0).forEach(function(C){k(L,C,D[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(L,Object.getOwnPropertyDescriptors(D)):G(D).forEach(function(C){Object.defineProperty(L,C,Object.getOwnPropertyDescriptor(D,C))})}return L}function se(L,O){if(L==null)return{};var D=ne(L,O),C,Q;if(Object.getOwnPropertySymbols){var ce=Object.getOwnPropertySymbols(L);for(Q=0;Q<ce.length;Q++)C=ce[Q],!(O.indexOf(C)>=0)&&Object.prototype.propertyIsEnumerable.call(L,C)&&(D[C]=L[C])}return D}function ne(L,O){if(L==null)return{};var D={},C=Object.keys(L),Q,ce;for(ce=0;ce<C.length;ce++)Q=C[ce],!(O.indexOf(Q)>=0)&&(D[Q]=L[Q]);return D}function l(L,O){if(!(L instanceof O))throw new TypeError("Cannot call a class as a function")}function K(L,O){for(var D=0;D<O.length;D++){var C=O[D];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(L,C.key,C)}}function P(L,O,D){return O&&K(L.prototype,O),D&&K(L,D),L}function m(L,O){return O&&(ue(O)==="object"||typeof O=="function")?O:E(L)}function _(L){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(D){return D.__proto__||Object.getPrototypeOf(D)},_(L)}function E(L){if(L===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L}function w(L,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");L.prototype=Object.create(O&&O.prototype,{constructor:{value:L,writable:!0,configurable:!0}}),O&&F(L,O)}function F(L,O){return F=Object.setPrototypeOf||function(C,Q){return C.__proto__=Q,C},F(L,O)}function k(L,O,D){return O in L?Object.defineProperty(L,O,{value:D,enumerable:!0,configurable:!0,writable:!0}):L[O]=D,L}var N=function(L){w(O,L);function O(){var D,C;l(this,O);for(var Q=arguments.length,ce=new Array(Q),ae=0;ae<Q;ae++)ce[ae]=arguments[ae];return C=m(this,(D=_(O)).call.apply(D,[this].concat(ce))),k(E(C),"onClick",function(Se){var Ne=C.props,Te=Ne.text,je=Ne.onCopy,ie=Ne.children,M=Ne.options,z=x.default.Children.only(ie),H=(0,de.default)(Te,M);je&&je(Te,H),z&&z.props&&typeof z.props.onClick=="function"&&z.props.onClick(Se)}),C}return P(O,[{key:"render",value:function(){var C=this.props,Q=C.text,ce=C.onCopy,ae=C.options,Se=C.children,Ne=se(C,["text","onCopy","options","children"]),Te=x.default.Children.only(Se);return x.default.cloneElement(Te,p({},Ne,{onClick:this.onClick}))}}]),O}(x.default.PureComponent);He.CopyToClipboard=N,k(N,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(Ct,He,S){"use strict";var x=S(83145),de=x.CopyToClipboard;de.CopyToClipboard=de,Ct.exports=de},76374:function(Ct,He,S){"use strict";var x=function(){if(typeof Map!="undefined")return Map;function ie(M,z){var H=-1;return M.some(function(Z,Y){return Z[0]===z?(H=Y,!0):!1}),H}return function(){function M(){this.__entries__=[]}return Object.defineProperty(M.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),M.prototype.get=function(z){var H=ie(this.__entries__,z),Z=this.__entries__[H];return Z&&Z[1]},M.prototype.set=function(z,H){var Z=ie(this.__entries__,z);~Z?this.__entries__[Z][1]=H:this.__entries__.push([z,H])},M.prototype.delete=function(z){var H=this.__entries__,Z=ie(H,z);~Z&&H.splice(Z,1)},M.prototype.has=function(z){return!!~ie(this.__entries__,z)},M.prototype.clear=function(){this.__entries__.splice(0)},M.prototype.forEach=function(z,H){H===void 0&&(H=null);for(var Z=0,Y=this.__entries__;Z<Y.length;Z++){var b=Y[Z];z.call(H,b[1],b[0])}},M}()}(),de=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,me=function(){return typeof S.g!="undefined"&&S.g.Math===Math?S.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),ue=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(me):function(ie){return setTimeout(function(){return ie(Date.now())},1e3/60)}}(),G=2;function p(ie,M){var z=!1,H=!1,Z=0;function Y(){z&&(z=!1,ie()),H&&y()}function b(){ue(Y)}function y(){var V=Date.now();if(z){if(V-Z<G)return;H=!0}else z=!0,H=!1,setTimeout(b,M);Z=V}return y}var se=20,ne=["top","right","bottom","left","width","height","size","weight"],l=typeof MutationObserver!="undefined",K=function(){function ie(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=p(this.refresh.bind(this),se)}return ie.prototype.addObserver=function(M){~this.observers_.indexOf(M)||this.observers_.push(M),this.connected_||this.connect_()},ie.prototype.removeObserver=function(M){var z=this.observers_,H=z.indexOf(M);~H&&z.splice(H,1),!z.length&&this.connected_&&this.disconnect_()},ie.prototype.refresh=function(){var M=this.updateObservers_();M&&this.refresh()},ie.prototype.updateObservers_=function(){var M=this.observers_.filter(function(z){return z.gatherActive(),z.hasActive()});return M.forEach(function(z){return z.broadcastActive()}),M.length>0},ie.prototype.connect_=function(){!de||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),l?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},ie.prototype.disconnect_=function(){!de||!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)},ie.prototype.onTransitionEnd_=function(M){var z=M.propertyName,H=z===void 0?"":z,Z=ne.some(function(Y){return!!~H.indexOf(Y)});Z&&this.refresh()},ie.getInstance=function(){return this.instance_||(this.instance_=new ie),this.instance_},ie.instance_=null,ie}(),P=function(ie,M){for(var z=0,H=Object.keys(M);z<H.length;z++){var Z=H[z];Object.defineProperty(ie,Z,{value:M[Z],enumerable:!1,writable:!1,configurable:!0})}return ie},m=function(ie){var M=ie&&ie.ownerDocument&&ie.ownerDocument.defaultView;return M||me},_=Q(0,0,0,0);function E(ie){return parseFloat(ie)||0}function w(ie){for(var M=[],z=1;z<arguments.length;z++)M[z-1]=arguments[z];return M.reduce(function(H,Z){var Y=ie["border-"+Z+"-width"];return H+E(Y)},0)}function F(ie){for(var M=["top","right","bottom","left"],z={},H=0,Z=M;H<Z.length;H++){var Y=Z[H],b=ie["padding-"+Y];z[Y]=E(b)}return z}function k(ie){var M=ie.getBBox();return Q(0,0,M.width,M.height)}function N(ie){var M=ie.clientWidth,z=ie.clientHeight;if(!M&&!z)return _;var H=m(ie).getComputedStyle(ie),Z=F(H),Y=Z.left+Z.right,b=Z.top+Z.bottom,y=E(H.width),V=E(H.height);if(H.boxSizing==="border-box"&&(Math.round(y+Y)!==M&&(y-=w(H,"left","right")+Y),Math.round(V+b)!==z&&(V-=w(H,"top","bottom")+b)),!O(ie)){var he=Math.round(y+Y)-M,be=Math.round(V+b)-z;Math.abs(he)!==1&&(y-=he),Math.abs(be)!==1&&(V-=be)}return Q(Z.left,Z.top,y,V)}var L=function(){return typeof SVGGraphicsElement!="undefined"?function(ie){return ie instanceof m(ie).SVGGraphicsElement}:function(ie){return ie instanceof m(ie).SVGElement&&typeof ie.getBBox=="function"}}();function O(ie){return ie===m(ie).document.documentElement}function D(ie){return de?L(ie)?k(ie):N(ie):_}function C(ie){var M=ie.x,z=ie.y,H=ie.width,Z=ie.height,Y=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,b=Object.create(Y.prototype);return P(b,{x:M,y:z,width:H,height:Z,top:z,right:M+H,bottom:Z+z,left:M}),b}function Q(ie,M,z,H){return{x:ie,y:M,width:z,height:H}}var ce=function(){function ie(M){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Q(0,0,0,0),this.target=M}return ie.prototype.isActive=function(){var M=D(this.target);return this.contentRect_=M,M.width!==this.broadcastWidth||M.height!==this.broadcastHeight},ie.prototype.broadcastRect=function(){var M=this.contentRect_;return this.broadcastWidth=M.width,this.broadcastHeight=M.height,M},ie}(),ae=function(){function ie(M,z){var H=C(z);P(this,{target:M,contentRect:H})}return ie}(),Se=function(){function ie(M,z,H){if(this.activeObservations_=[],this.observations_=new x,typeof M!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=M,this.controller_=z,this.callbackCtx_=H}return ie.prototype.observe=function(M){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(M instanceof m(M).Element))throw new TypeError('parameter 1 is not of type "Element".');var z=this.observations_;z.has(M)||(z.set(M,new ce(M)),this.controller_.addObserver(this),this.controller_.refresh())}},ie.prototype.unobserve=function(M){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(M instanceof m(M).Element))throw new TypeError('parameter 1 is not of type "Element".');var z=this.observations_;z.has(M)&&(z.delete(M),z.size||this.controller_.removeObserver(this))}},ie.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},ie.prototype.gatherActive=function(){var M=this;this.clearActive(),this.observations_.forEach(function(z){z.isActive()&&M.activeObservations_.push(z)})},ie.prototype.broadcastActive=function(){if(this.hasActive()){var M=this.callbackCtx_,z=this.activeObservations_.map(function(H){return new ae(H.target,H.broadcastRect())});this.callback_.call(M,z,M),this.clearActive()}},ie.prototype.clearActive=function(){this.activeObservations_.splice(0)},ie.prototype.hasActive=function(){return this.activeObservations_.length>0},ie}(),Ne=typeof WeakMap!="undefined"?new WeakMap:new x,Te=function(){function ie(M){if(!(this instanceof ie))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var z=K.getInstance(),H=new Se(M,z,this);Ne.set(this,H)}return ie}();["observe","unobserve","disconnect"].forEach(function(ie){Te.prototype[ie]=function(){var M;return(M=Ne.get(this))[ie].apply(M,arguments)}});var je=function(){return typeof me.ResizeObserver!="undefined"?me.ResizeObserver:Te}();He.Z=je},98040:function(Ct){Ct.exports=function(){var He=document.getSelection();if(!He.rangeCount)return function(){};for(var S=document.activeElement,x=[],de=0;de<He.rangeCount;de++)x.push(He.getRangeAt(de));switch(S.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":S.blur();break;default:S=null;break}return He.removeAllRanges(),function(){He.type==="Caret"&&He.removeAllRanges(),He.rangeCount||x.forEach(function(me){He.addRange(me)}),S&&S.focus()}}},82059:function(Ct){var He=arguments[3],S=arguments[4],x=arguments[5],de=JSON.stringify;Ct.exports=function(me,ue){for(var G,p=Object.keys(x),se=0,ne=p.length;se<ne;se++){var l=p[se],K=x[l].exports;if(K===me||K&&K.default===me){G=l;break}}if(!G){G=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var P={},se=0,ne=p.length;se<ne;se++){var l=p[se];P[l]=l}S[G]=["function(require,module,exports){"+me+"(self); }",P]}var m=Math.floor(Math.pow(16,8)*Math.random()).toString(16),_={};_[G]=G,S[m]=["function(require,module,exports){var f = require("+de(G)+");(f.default ? f.default : f)(self);}",_];var E={};w(m);function w(D){E[D]=!0;for(var C in S[D][1]){var Q=S[D][1][C];E[Q]||w(Q)}}var F="("+He+")({"+Object.keys(E).map(function(D){return de(D)+":["+S[D][0]+","+de(S[D][1])+"]"}).join(",")+"},{},["+de(m)+"])",k=window.URL||window.webkitURL||window.mozURL||window.msURL,N=new Blob([F],{type:"text/javascript"});if(ue&&ue.bare)return N;var L=k.createObjectURL(N),O=new Worker(L);return O.objectURL=L,O}},4977:function(Ct){"use strict";Ct.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},16471:function(Ct,He,S){"use strict";S.d(He,{ZP:function(){return Rr}});const x=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},de=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=me},me=Number.MAX_SAFE_INTEGER||9007199254740991;let ue=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}({}),G=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 se={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},ne={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class l{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class K{constructor(e,t,n,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new l(e),this.fast_=new l(t),this.defaultTTFB_=i,this.ttfb_=new l(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:r}=this;n.halfLife!==e&&(this.slow_=new l(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new l(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new l(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,i=e/1e3,r=n/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function P(a,e,t){return(e=F(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function m(){return m=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},m.apply(null,arguments)}function _(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,n)}return t}function E(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_(Object(t),!0).forEach(function(n){P(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function w(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function F(a){var e=w(a,"string");return typeof e=="symbol"?e:e+""}class k{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const n=`[${e}]:`;this.trace=N,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 N=function(){},L={trace:N,debug:N,log:N,warn:N,info:N,error:N};function O(){return m({},L)}function D(a,e){const t=self.console[a];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${a}] >`):N}function C(a,e,t){return e[a]?e[a].bind(e):D(a,t)}const Q=O();function ce(a,e,t){const n=O();if(typeof console=="object"&&a===!0||typeof a=="object"){const i=["debug","log","info","warn","error"];i.forEach(r=>{n[r]=C(r,a,t)});try{n.log(`Debug logs enabled for "${e}" in hls.js version 1.6.15`)}catch(r){return O()}i.forEach(r=>{Q[r]=C(r,a)})}else m(Q,n);return n}const ae=Q;function Se(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Ne(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}function Te(a,e){const t=Object.keys(a),n=Object.keys(e),i=t.length,r=n.length;return!i||!r||i===r&&!t.some(s=>n.indexOf(s)===-1)}function je(a,e=!1){if(typeof TextDecoder!="undefined"){const u=new TextDecoder("utf-8").decode(a);if(e){const h=u.indexOf("\0");return h!==-1?u.substring(0,h):u}return u.replace(/\0/g,"")}const t=a.length;let n,i,r,s="",o=0;for(;o<t;){if(n=a[o++],n===0&&e)return s;if(n===0||n===3)continue;switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s+=String.fromCharCode(n);break;case 12:case 13:i=a[o++],s+=String.fromCharCode((n&31)<<6|i&63);break;case 14:i=a[o++],r=a[o++],s+=String.fromCharCode((n&15)<<12|(i&63)<<6|(r&63)<<0);break}}return s}function ie(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 M(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function z(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var H={exports:{}},Z;function Y(){return Z||(Z=1,function(a,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(c,u,h){if(h=h||{},c=c.trim(),u=u.trim(),!u){if(!h.alwaysNormalize)return c;var f=o.parseURL(c);if(!f)throw new Error("Error trying to parse base URL.");return f.path=o.normalizePath(f.path),o.buildURLFromParts(f)}var v=o.parseURL(u);if(!v)throw new Error("Error trying to parse relative URL.");if(v.scheme)return h.alwaysNormalize?(v.path=o.normalizePath(v.path),o.buildURLFromParts(v)):u;var R=o.parseURL(c);if(!R)throw new Error("Error trying to parse base URL.");if(!R.netLoc&&R.path&&R.path[0]!=="/"){var I=i.exec(R.path);R.netLoc=I[1],R.path=I[2]}R.netLoc&&!R.path&&(R.path="/");var q={scheme:R.scheme,netLoc:v.netLoc,path:null,params:v.params,query:v.query,fragment:v.fragment};if(!v.netLoc&&(q.netLoc=R.netLoc,v.path[0]!=="/"))if(!v.path)q.path=R.path,v.params||(q.params=R.params,v.query||(q.query=R.query));else{var J=R.path,pe=J.substring(0,J.lastIndexOf("/")+1)+v.path;q.path=o.normalizePath(pe)}return q.path===null&&(q.path=h.alwaysNormalize?o.normalizePath(v.path):v.path),o.buildURLFromParts(q)},parseURL:function(c){var u=n.exec(c);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(r,"");c.length!==(c=c.replace(s,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};a.exports=o})()}(H)),H.exports}var b=Y();class y{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 V={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class he{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,ke(this,"stats")}setByteRange(e,t){const n=e.split("@",2);let i;n.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(n[1]),this._byteRange=[i,parseInt(n[0])+i]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[V.AUDIO]:null,[V.VIDEO]:null,[V.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 y),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=b.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[V.AUDIO]=null,e[V.VIDEO]=null,e[V.AUDIOVIDEO]=null}}function be(a){return a.sn!=="initSegment"}class Pe extends he{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange.length){const e=this.byteRange[0],t=this.byteRange[1];if(x(e)&&x(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){var e;const{levelkeys:t}=this;if(!t||t.NONE)return null;if(t.identity)this._decryptdata||(this._decryptdata=t.identity.getDecryptData(this.sn));else if(!((e=this._decryptdata)!=null&&e.keyId)){const n=Object.keys(t);if(n.length===1){const i=this._decryptdata=t[n[0]]||null;i&&(this._decryptdata=i.getDecryptData(this.sn,t))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=x(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){var t;const n=Object.keys(this.levelkeys),i=n.length;if(i>1||i===1&&(t=this.levelkeys[n[0]])!=null&&t.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!x(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return be(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){const t=this.levelkeys;if(t){var n;const i=t[e];i&&!((n=this._decryptdata)!=null&&n.keyId)&&(this._decryptdata=i.getDecryptData(this.sn,t))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,i,r,s=!1){const{elementaryStreams:o}=this,c=o[e];if(!c){o[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:r,partial:s};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,n),c.startDTS=Math.min(c.startDTS,i),c.endDTS=Math.max(c.endDTS,r)}}class oe extends he{constructor(e,t,n,i,r){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function Ae(a,e){const t=Object.getPrototypeOf(a);if(t){const n=Object.getOwnPropertyDescriptor(t,e);return n||Ae(t,e)}}function ke(a,e){const t=Ae(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const et=Math.pow(2,32)-1,Oe=[].push,qe={video:1,audio:2,id3:3,text:4};function xe(a){return String.fromCharCode.apply(null,a)}function it(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function $e(a,e){const t=ve(a,e);return t<0?4294967296+t:t}function De(a,e){let t=$e(a,e);return t*=Math.pow(2,32),t+=$e(a,e+4),t}function ve(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function Le(a){const e=a.byteLength;for(let t=0;t<e;){const n=$e(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 re(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let i=0;i<n;){const r=$e(a,i),s=xe(a.subarray(i+4,i+8)),o=r>1?i+r:n;if(s===e[0])if(e.length===1)t.push(a.subarray(i+8,o));else{const c=re(a.subarray(i+8,o),e.slice(1));c.length&&Oe.apply(t,c)}i=o}return t}function Re(a){const e=[],t=a[0];let n=8;const i=$e(a,n);n+=4;let r=0,s=0;t===0?(r=$e(a,n),s=$e(a,n+4),n+=8):(r=De(a,n),s=De(a,n+8),n+=16),n+=2;let o=a.length+s;const c=it(a,n);n+=2;for(let u=0;u<c;u++){let h=n;const f=$e(a,h);h+=4;const v=f&2147483647;if((f&2147483648)>>>31===1)return ae.warn("SIDX has hierarchical references (not supported)"),null;const I=$e(a,h);h+=4,e.push({referenceSize:v,subsegmentDuration:I,info:{duration:I/i,start:o,end:o+v-1}}),o+=v,h+=4,n=h}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:c,references:e}}function fe(a){const e=[],t=re(a,["moov","trak"]);for(let i=0;i<t.length;i++){const r=t[i],s=re(r,["tkhd"])[0];if(s){let o=s[0];const c=$e(s,o===0?12:20),u=re(r,["mdia","mdhd"])[0];if(u){o=u[0];const h=$e(u,o===0?12:20),f=re(r,["mdia","hdlr"])[0];if(f){const v=xe(f.subarray(8,12)),R={soun:V.AUDIO,vide:V.VIDEO}[v],I=re(r,["mdia","minf","stbl","stsd"])[0],q=B(I);R?(e[c]={timescale:h,type:R,stsd:q},e[R]=E({timescale:h,id:c},q)):e[c]={timescale:h,type:v,stsd:q}}}}}return re(a,["moov","mvex","trex"]).forEach(i=>{const r=$e(i,4),s=e[r];s&&(s.default={duration:$e(i,12),flags:$e(i,20)})}),e}function B(a){const e=a.subarray(8),t=e.subarray(86),n=xe(e.subarray(4,8));let i=n,r;const s=n==="enca"||n==="encv";if(s){const u=re(e,[n])[0].subarray(n==="enca"?28:78);re(u,["sinf"]).forEach(f=>{const v=re(f,["schm"])[0];if(v){const R=xe(v.subarray(4,8));if(R==="cbcs"||R==="cenc"){const I=re(f,["frma"])[0];I&&(i=xe(I))}}})}const o=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const c=re(t,["avcC"])[0];c&&c.length>3&&(i+="."+W(c[1])+W(c[2])+W(c[3]),r=A(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=re(e,[n])[0],u=re(c.subarray(28),["esds"])[0];if(u&&u.length>7){let h=4;if(u[h++]!==3)break;h=X(u,h),h+=2;const f=u[h++];if(f&128&&(h+=2),f&64&&(h+=u[h++]),u[h++]!==4)break;h=X(u,h);const v=u[h++];if(v===64)i+="."+W(v);else break;if(h+=12,u[h++]!==5)break;h=X(u,h);const R=u[h++];let I=(R&248)>>3;I===31&&(I+=1+((R&7)<<3)+((u[h]&224)>>5)),i+="."+I}break}case"hvc1":case"hev1":{const c=re(t,["hvcC"])[0];if(c&&c.length>12){const u=c[1],h=["","A","B","C"][u>>6],f=u&31,v=$e(c,2),R=(u&32)>>5?"H":"L",I=c[12],q=c.subarray(6,12);i+="."+h+f,i+="."+U(v).toString(16).toUpperCase(),i+="."+R+I;let J="";for(let pe=q.length;pe--;){const _e=q[pe];(_e||J)&&(J="."+_e.toString(16).toUpperCase()+J)}i+=J}r=A(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{i=A(i,t)||i;break}case"vp09":{const c=re(t,["vpcC"])[0];if(c&&c.length>6){const u=c[4],h=c[5],f=c[6]>>4&15;i+="."+$(u)+"."+$(h)+"."+$(f)}break}case"av01":{const c=re(t,["av1C"])[0];if(c&&c.length>2){const u=c[1]>>>5,h=c[1]&31,f=c[2]>>>7?"H":"M",v=(c[2]&64)>>6,R=(c[2]&32)>>5,I=u===2&&v?R?12:10:v?10:8,q=(c[2]&16)>>4,J=(c[2]&8)>>3,pe=(c[2]&4)>>2,_e=c[2]&3;i+="."+u+"."+$(h)+f+"."+$(I)+"."+q+"."+J+pe+_e+"."+$(1)+"."+$(1)+"."+$(1)+"."+0,r=A("dav1",t)}break}}return{codec:i,encrypted:s,supplemental:r}}function A(a,e){const t=re(e,["dvvC"]),n=t.length?t[0]:re(e,["dvcC"])[0];if(n){const i=n[2]>>1&127,r=n[2]<<5&32|n[3]>>3&31;return a+"."+$(i)+"."+$(r)}}function U(a){let e=0;for(let t=0;t<32;t++)e|=(a>>t&1)<<31-t;return e>>>0}function X(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 $(a){return(a<10?"0":"")+a}function ee(a,e){if(!a||!e)return;const t=e.keyId;t&&e.isCommonEncryption&&ge(a,(n,i)=>{const r=n.subarray(8,24);r.some(s=>s!==0)||(ae.log(`[eme] Patching keyId in 'enc${i?"a":"v"}>sinf>>tenc' box: ${ie(r)} -> ${ie(t)}`),n.set(t,8))})}function le(a){const e=[];return ge(a,t=>e.push(t.subarray(8,24))),e}function ge(a,e){re(a,["moov","trak"]).forEach(n=>{const i=re(n,["mdia","minf","stbl","stsd"])[0];if(!i)return;const r=i.subarray(8);let s=re(r,["enca"]);const o=s.length>0;o||(s=re(r,["encv"])),s.forEach(c=>{const u=o?c.subarray(28):c.subarray(78);re(u,["sinf"]).forEach(f=>{const v=we(f);v&&e(v,o)})})})}function we(a){const e=re(a,["schm"])[0];if(e){const t=xe(e.subarray(4,8));if(t==="cbcs"||t==="cenc"){const n=re(a,["schi","tenc"])[0];if(n)return n}}}function ze(a,e,t){const n={},i=re(a,["moof","traf"]);for(let r=0;r<i.length;r++){const s=i[r],o=re(s,["tfhd"])[0],c=$e(o,4),u=e[c];if(!u)continue;n[c]||(n[c]={start:NaN,duration:0,sampleCount:0,timescale:u.timescale,type:u.type});const h=n[c],f=re(s,["tfdt"])[0];if(f){const ye=f[0];let Me=$e(f,4);ye===1&&(Me===et?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(Me*=et+1,Me+=$e(f,8))),x(Me)&&(!x(h.start)||Me<h.start)&&(h.start=Me)}const v=u.default,R=$e(o,0)|(v==null?void 0:v.flags);let I=(v==null?void 0:v.duration)||0;R&8&&(R&2?I=$e(o,12):I=$e(o,8));const q=re(s,["trun"]);let J=h.start||0,pe=0,_e=I;for(let ye=0;ye<q.length;ye++){const Me=q[ye],Ge=$e(Me,4),dt=h.sampleCount;h.sampleCount+=Ge;const We=Me[3]&1,ot=Me[3]&4,at=Me[2]&1,Je=Me[2]&2,wt=Me[2]&4,Xt=Me[2]&8;let on=8,mn=Ge;for(We&&(on+=4),ot&&Ge&&(!(Me[on+1]&1)&&h.keyFrameIndex===void 0&&(h.keyFrameIndex=dt),on+=4,at?(_e=$e(Me,on),on+=4):_e=I,Je&&(on+=4),Xt&&(on+=4),J+=_e,pe+=_e,mn--);mn--;)at?(_e=$e(Me,on),on+=4):_e=I,Je&&(on+=4),wt&&(Me[on+1]&1||h.keyFrameIndex===void 0&&(h.keyFrameIndex=h.sampleCount-(mn+1),h.keyFrameStart=J),on+=4),Xt&&(on+=4),J+=_e,pe+=_e;!pe&&I&&(pe+=I*Ge)}h.duration+=pe}if(!Object.keys(n).some(r=>n[r].duration)){let r=1/0,s=0;const o=re(a,["sidx"]);for(let c=0;c<o.length;c++){const u=Re(o[c]);if(u!=null&&u.references){r=Math.min(r,u.earliestPresentationTime/u.timescale);const h=u.references.reduce((f,v)=>f+v.info.duration||0,0);s=Math.max(s,h+u.earliestPresentationTime/u.timescale)}}s&&x(s)&&Object.keys(n).forEach(c=>{n[c].duration||(n[c].duration=s*n[c].timescale-n[c].start)})}return n}function Ue(a){const e={valid:null,remainder:null},t=re(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 Ye(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function Fe(a,e){const t=[],n=e.samples,i=e.timescale,r=e.id;let s=!1;return re(n,["moof"]).map(c=>{const u=c.byteOffset-8;re(c,["traf"]).map(f=>{const v=re(f,["tfdt"]).map(R=>{const I=R[0];let q=$e(R,4);return I===1&&(q*=Math.pow(2,32),q+=$e(R,8)),q/i})[0];return v!==void 0&&(a=v),re(f,["tfhd"]).map(R=>{const I=$e(R,4),q=$e(R,0)&16777215,J=(q&1)!==0,pe=(q&2)!==0,_e=(q&8)!==0;let ye=0;const Me=(q&16)!==0;let Ge=0;const dt=(q&32)!==0;let We=8;I===r&&(J&&(We+=8),pe&&(We+=4),_e&&(ye=$e(R,We),We+=4),Me&&(Ge=$e(R,We),We+=4),dt&&(We+=4),e.type==="video"&&(s=Ve(e.codec)),re(f,["trun"]).map(ot=>{const at=ot[0],Je=$e(ot,0)&16777215,wt=(Je&1)!==0;let Xt=0;const on=(Je&4)!==0,mn=(Je&256)!==0;let ln=0;const jt=(Je&512)!==0;let dn=0;const nn=(Je&1024)!==0,fn=(Je&2048)!==0;let Tn=0;const Zt=$e(ot,4);let Yt=8;wt&&(Xt=$e(ot,Yt),Yt+=4),on&&(Yt+=4);let Mn=Xt+u;for(let Yn=0;Yn<Zt;Yn++){if(mn?(ln=$e(ot,Yt),Yt+=4):ln=ye,jt?(dn=$e(ot,Yt),Yt+=4):dn=Ge,nn&&(Yt+=4),fn&&(at===0?Tn=$e(ot,Yt):Tn=ve(ot,Yt),Yt+=4),e.type===V.VIDEO){let Fn=0;for(;Fn<dn;){const Kn=$e(n,Mn);if(Mn+=4,Qe(s,n[Mn])){const Ii=n.subarray(Mn,Mn+Kn);Ie(Ii,s?2:1,a+Tn/i,t)}Mn+=Kn,Fn+=Kn+4}}a+=ln/i}}))})})}),t}function Ve(a){if(!a)return!1;const e=a.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function Qe(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function Ie(a,e,t,n){const i=tt(a);let r=0;r+=e;let s=0,o=0,c=0;for(;r<i.length;){s=0;do{if(r>=i.length)break;c=i[r++],s+=c}while(c===255);o=0;do{if(r>=i.length)break;c=i[r++],o+=c}while(c===255);const u=i.length-r;let h=r;if(o<u)r+=o;else if(o>u){ae.error(`Malformed SEI payload. ${o} is too small, only ${u} bytes left to parse.`);break}if(s===4){if(i[h++]===181){const v=it(i,h);if(h+=2,v===49){const R=$e(i,h);if(h+=4,R===1195456820){const I=i[h++];if(I===3){const q=i[h++],J=31&q,pe=64&q,_e=pe?2+J*3:0,ye=new Uint8Array(_e);if(pe){ye[0]=q;for(let Me=1;Me<_e;Me++)ye[Me]=i[h++]}n.push({type:I,payloadType:s,pts:t,bytes:ye})}}}}}else if(s===5&&o>16){const f=[];for(let I=0;I<16;I++){const q=i[h++].toString(16);f.push(q.length==1?"0"+q:q),(I===3||I===5||I===7||I===9)&&f.push("-")}const v=o-16,R=new Uint8Array(v);for(let I=0;I<v;I++)R[I]=i[h++];n.push({payloadType:s,pts:t,uuid:f.join(""),userData:je(R),userDataBytes:R})}}}function tt(a){const e=a.byteLength,t=[];let n=1;for(;n<e-2;)a[n]===0&&a[n+1]===0&&a[n+2]===3?(t.push(n+2),n+=2):n++;if(t.length===0)return a;const i=e-t.length,r=new Uint8Array(i);let s=0;for(n=0;n<i;s++,n++)s===t[0]&&(s++,t.shift()),r[n]=a[s];return r}function Nt(a){const e=a[0];let t="",n="",i=0,r=0,s=0,o=0,c=0,u=0;if(e===0){for(;xe(a.subarray(u,u+1))!=="\0";)t+=xe(a.subarray(u,u+1)),u+=1;for(t+=xe(a.subarray(u,u+1)),u+=1;xe(a.subarray(u,u+1))!=="\0";)n+=xe(a.subarray(u,u+1)),u+=1;n+=xe(a.subarray(u,u+1)),u+=1,i=$e(a,12),r=$e(a,16),o=$e(a,20),c=$e(a,24),u=28}else if(e===1){u+=4,i=$e(a,u),u+=4;const f=$e(a,u);u+=4;const v=$e(a,u);for(u+=4,s=Sl(2,32)*f+v,de(s)||(s=Number.MAX_SAFE_INTEGER,ae.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=$e(a,u),u+=4,c=$e(a,u),u+=4;xe(a.subarray(u,u+1))!=="\0";)t+=xe(a.subarray(u,u+1)),u+=1;for(t+=xe(a.subarray(u,u+1)),u+=1;xe(a.subarray(u,u+1))!=="\0";)n+=xe(a.subarray(u,u+1)),u+=1;n+=xe(a.subarray(u,u+1)),u+=1}const h=a.subarray(u,a.byteLength);return{schemeIdUri:t,value:n,timeScale:i,presentationTime:s,presentationTimeDelta:r,eventDuration:o,id:c,payload:h}}function Et(a,...e){const t=e.length;let n=8,i=t;for(;i--;)n+=e[i].byteLength;const r=new Uint8Array(n);for(r[0]=n>>24&255,r[1]=n>>16&255,r[2]=n>>8&255,r[3]=n&255,r.set(a,4),i=0,n=8;i<t;i++)r.set(e[i],n),n+=e[i].byteLength;return r}function Rt(a,e,t){if(a.byteLength!==16)throw new RangeError("Invalid system id");let n,i;n=0,i=new Uint8Array;let r;n>0?(r=new Uint8Array(4),e.length>0&&new DataView(r.buffer).setUint32(0,e.length,!1)):r=new Uint8Array;const s=new Uint8Array(4);return t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),Et([112,115,115,104],new Uint8Array([n,0,0,0]),a,r,i,s,t)}function ht(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let n=0;for(;n+32<t;){const i=new DataView(a,n),r=qt(i);e.push(r),n+=r.size}}return e}function qt(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 r=a.getUint32(8)>>>24;if(r!==0&&r!==1)return{offset:t,size:e};const s=a.buffer,o=ie(new Uint8Array(s,t+12,16));let c=null,u=null,h=0;if(r===0)h=28;else{const v=a.getUint32(28);if(!v||n<32+v*16)return{offset:t,size:e};c=[];for(let R=0;R<v;R++)c.push(new Uint8Array(s,t+32+R*16,16));h=32+v*16}if(!h)return{offset:t,size:e};const f=a.getUint32(h);return e-32<f?{offset:t,size:e}:(u=new Uint8Array(s,t+h+4,f),{version:r,systemId:o,kids:c,data:u,offset:t,size:e})}const Vt=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),bt={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 zt(a,e){const t=bt[e];return!!t&&!!t[a.slice(0,4)]}function Tt(a,e,t=!0){return!a.split(",").some(n=>!_t(n,e,t))}function _t(a,e,t=!0){var n;const i=Se(t);return(n=i==null?void 0:i.isTypeSupported(Ot(a,e)))!=null?n:!1}function Ot(a,e){return`${e}/mp4;codecs=${a}`}function St(a){if(a){const e=a.substring(0,4);return bt.video[e]}return 2}function Jt(a){const e=Vt();return a.split(",").reduce((t,n)=>{const r=e&&Ve(n)?9:bt.video[n];return r?(r*2+t)/(t?3:2):(bt.audio[n]+t)/(t?2:1)},0)}const Pt={};function xt(a,e=!0){if(Pt[a])return Pt[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[a];for(let i=0;i<t.length;i++){var n;if(_t(t[i],"audio",e))return Pt[a]=t[i],t[i];if(t[i]==="mp3"&&(n=Se(e))!=null&&n.isTypeSupported("audio/mpeg"))return""}return a}const Dt=/flac|opus|mp4a\.40\.34/i;function un(a,e=!0){return a.replace(Dt,t=>xt(t.toLowerCase(),e))}function Ft(a,e){const t=[];if(a){const n=a.split(",");for(let i=0;i<n.length;i++)zt(n[i],"video")||t.push(n[i])}return e&&t.push(e),t.join(",")}function Ht(a,e){if(a&&(a.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1)&&(It(a,"audio")||It(a,"video")))return a;if(e){const t=e.split(",");if(t.length>1){if(a){for(let n=t.length;n--;)if(t[n].substring(0,4)===a.substring(0,4))return t[n]}return t[0]}}return e||a}function It(a,e){return zt(a,e)&&_t(a,e)}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 d(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 g(a){const e=Se(a)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function T(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const j={supported:!0,powerEfficient:!0,smooth:!0},te={supported:!1,smooth:!1,powerEfficient:!1},Ee={supported:!0,configurations:[],decodingInfoResults:[j]};function Ce(a,e){return{supported:!1,configurations:e,decodingInfoResults:[te],error:a}}function Xe(a,e,t,n,i,r){const s=a.videoCodec,o=a.audioCodec?a.audioGroups:null,c=r==null?void 0:r.audioCodec,u=r==null?void 0:r.channels,h=u?parseInt(u):c?1/0:2;let f=null;if(o!=null&&o.length)try{o.length===1&&o[0]?f=e.groups[o[0]].channels:f=o.reduce((v,R)=>{if(R){const I=e.groups[R];if(!I)throw new Error(`Audio track group ${R} not found`);Object.keys(I.channels).forEach(q=>{v[q]=(v[q]||0)+I.channels[q]})}return v},{2:0})}catch(v){return!0}return s!==void 0&&(s.split(",").some(v=>Ve(v))||a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(n,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(i,8e6))||!!f&&x(h)&&Object.keys(f).some(v=>parseInt(v)>h)}function Ze(a,e,t,n={}){const i=a.videoCodec;if(!i&&!a.audioCodec||!t)return Promise.resolve(Ee);const r=[],s=ut(a),o=s.length,c=ft(a,e,o>0),u=c.length;for(let h=o||1*u||1;h--;){const f={type:"media-source"};if(o&&(f.video=s[h%o]),u){f.audio=c[h%u];const v=f.audio.bitrate;f.video&&v&&(f.video.bitrate-=v)}r.push(f)}if(i){const h=navigator.userAgent;if(i.split(",").some(f=>Ve(f))&&Vt())return Promise.resolve(Ce(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${h})`),r))}return Promise.all(r.map(h=>{const f=Kt(h);return n[f]||(n[f]=t.decodingInfo(h))})).then(h=>({supported:!h.some(f=>!f.supported),configurations:r,decodingInfoResults:h})).catch(h=>({supported:!1,configurations:r,decodingInfoResults:[],error:h}))}function ut(a){var e;const t=(e=a.videoCodec)==null?void 0:e.split(","),n=vt(a),i=a.width||640,r=a.height||480,s=a.frameRate||30,o=a.videoRange.toLowerCase();return t?t.map(c=>{const u={contentType:Ot(d(c),"video"),width:i,height:r,bitrate:n,framerate:s};return o!=="sdr"&&(u.transferFunction=o),u}):[]}function ft(a,e,t){var n;const i=(n=a.audioCodec)==null?void 0:n.split(","),r=vt(a);return i&&a.audioGroups?a.audioGroups.reduce((s,o)=>{var c;const u=o?(c=e.groups[o])==null?void 0:c.tracks:null;return u?u.reduce((h,f)=>{if(f.groupId===o){const v=parseFloat(f.channels||"");i.forEach(R=>{const I={contentType:Ot(R,"audio"),bitrate:t?Lt(R,r):r};v&&(I.channels=""+v),h.push(I)})}return h},s):s},[]):[]}function Lt(a,e){if(e<=1)return 1;let t=128e3;return a==="ec-3"?t=768e3:a==="ac-3"&&(t=64e4),Math.min(e/2,t)}function vt(a){return Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)/1e3)*1e3||1}function Kt(a){let e="";const{audio:t,video:n}=a;if(n){const i=T(n.contentType);e+=`${i}_r${n.height}x${n.width}f${Math.ceil(n.framerate)}${n.transferFunction||"sd"}_${Math.ceil(n.bitrate/1e5)}`}if(t){const i=T(t.contentType);e+=`${n?"_":""}${i}_c${t.channels}`}return e}const $t=["NONE","TYPE-0","TYPE-1",null];function gt(a){return $t.indexOf(a)>-1}const mt=["SDR","PQ","HLG"];function Bt(a){return!!a&&mt.indexOf(a)>-1}var kt={No:"",Yes:"YES",v2:"v2"};function hn(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,i=n<e/2;return e&&i?t?kt.v2:kt.Yes:kt.No}class En{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 Wt{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 Mt(this._audioGroups,e)}hasSubtitleGroup(e){return Mt(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 Mt(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function Qt(){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 gn(a,e){let t=!1,n=[];if(a&&(t=a!=="SDR",n=[a]),e){n=e.allowedVideoRanges||mt.slice(0);const i=n.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:i&&Qt(),t||(n=["SDR"])}return{preferHDR:t,allowedVideoRanges:n}}const Be=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}},Ke=(a,e)=>JSON.stringify(a,Be(e));function pt(a,e,t,n,i){const r=Object.keys(a),s=n==null?void 0:n.channels,o=n==null?void 0:n.audioCodec,c=i==null?void 0:i.videoCodec,u=s&&parseInt(s)===2;let h=!1,f=!1,v=1/0,R=1/0,I=1/0,q=1/0,J=0,pe=[];const{preferHDR:_e,allowedVideoRanges:ye}=gn(e,i);for(let ot=r.length;ot--;){const at=a[r[ot]];h||(h=at.channels[2]>0),v=Math.min(v,at.minHeight),R=Math.min(R,at.minFramerate),I=Math.min(I,at.minBitrate),ye.filter(wt=>at.videoRanges[wt]>0).length>0&&(f=!0)}v=x(v)?v:0,R=x(R)?R:0;const Me=Math.max(1080,v),Ge=Math.max(30,R);I=x(I)?I:t,t=Math.max(I,t),f||(e=void 0);const dt=r.length>1;return{codecSet:r.reduce((ot,at)=>{const Je=a[at];if(at===ot)return ot;if(pe=f?ye.filter(wt=>Je.videoRanges[wt]>0):[],dt){if(Je.minBitrate>t)return lt(at,`min bitrate of ${Je.minBitrate} > current estimate of ${t}`),ot;if(!Je.hasDefaultAudio)return lt(at,"no renditions with default or auto-select sound found"),ot;if(o&&at.indexOf(o.substring(0,4))%5!==0)return lt(at,`audio codec preference "${o}" not found`),ot;if(s&&!u){if(!Je.channels[s])return lt(at,`no renditions with ${s} channel sound found (channels options: ${Object.keys(Je.channels)})`),ot}else if((!o||u)&&h&&Je.channels[2]===0)return lt(at,"no renditions with stereo sound found"),ot;if(Je.minHeight>Me)return lt(at,`min resolution of ${Je.minHeight} > maximum of ${Me}`),ot;if(Je.minFramerate>Ge)return lt(at,`min framerate of ${Je.minFramerate} > maximum of ${Ge}`),ot;if(!pe.some(wt=>Je.videoRanges[wt]>0))return lt(at,`no variants with VIDEO-RANGE of ${Ke(pe)} found`),ot;if(c&&at.indexOf(c.substring(0,4))%5!==0)return lt(at,`video codec preference "${c}" not found`),ot;if(Je.maxScore<J)return lt(at,`max score of ${Je.maxScore} < selected max of ${J}`),ot}return ot&&(Jt(at)>=Jt(ot)||Je.fragmentError>a[ot].fragmentError)?ot:(q=Je.minIndex,J=Je.maxScore,at)},void 0),videoRanges:pe,preferHDR:_e,minFramerate:R,minBitrate:I,minIndex:q}}function lt(a,e){ae.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function st(a){return a.reduce((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const i=t.channels||"2";return n.channels[i]=(n.channels[i]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function ct(a,e,t,n){return a.slice(t,n+1).reduce((i,r,s)=>{if(!r.codecSet)return i;const o=r.audioGroups;let c=i[r.codecSet];c||(i[r.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:s,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,r.bitrate);const u=Math.min(r.height,r.width);return c.minHeight=Math.min(c.minHeight,u),c.minFramerate=Math.min(c.minFramerate,r.frameRate),c.minIndex=Math.min(c.minIndex,s),c.maxScore=Math.max(c.maxScore,r.score),c.fragmentError+=r.fragmentError,c.videoRanges[r.videoRange]=(c.videoRanges[r.videoRange]||0)+1,o&&o.forEach(h=>{if(!h)return;const f=e.groups[h];f&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?f.hasDefault:f.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(f.channels).forEach(v=>{c.channels[v]=(c.channels[v]||0)+f.channels[v]}))}),i},{})}function At(a){if(!a)return a;const{lang:e,assocLang:t,characteristics:n,channels:i,audioCodec:r}=a;return{lang:e,assocLang:t,characteristics:n,channels:i,audioCodec:r}}function Ut(a,e,t){if("attrs"in a){const n=e.indexOf(a);if(n!==-1)return n}for(let n=0;n<e.length;n++){const i=e[n];if(cn(a,i,t))return n}return-1}function cn(a,e,t){const{groupId:n,name:i,lang:r,assocLang:s,default:o}=a,c=a.forced;return(n===void 0||e.groupId===n)&&(i===void 0||e.name===i)&&(r===void 0||tn(r,e.lang))&&(r===void 0||e.assocLang===s)&&(o===void 0||e.default===o)&&(c===void 0||e.forced===c)&&(!("characteristics"in a)||xn(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function tn(a,e="--"){return a.length===e.length?a===e:a.startsWith(e)||e.startsWith(a)}function xn(a,e=""){const t=a.split(","),n=e.split(",");return t.length===n.length&&!t.some(i=>n.indexOf(i)===-1)}function an(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 _n(a,e,t,n,i){const r=e[n],o=e.reduce((v,R,I)=>{const q=R.uri;return(v[q]||(v[q]=[])).push(I),v},{})[r.uri];o.length>1&&(n=Math.max.apply(Math,o));const c=r.videoRange,u=r.frameRate,h=r.codecSet.substring(0,4),f=Sn(e,n,v=>{if(v.videoRange!==c||v.frameRate!==u||v.codecSet.substring(0,4)!==h)return!1;const R=v.audioGroups,I=t.filter(q=>!R||R.indexOf(q.groupId)!==-1);return Ut(a,I,i)>-1});return f>-1?f:Sn(e,n,v=>{const R=v.audioGroups,I=t.filter(q=>!R||R.indexOf(q.groupId)!==-1);return Ut(a,I,i)>-1})}function Sn(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 Ln(a,e){var t;return!!a&&a!==((t=e.loadLevelObj)==null?void 0:t.uri)}class Pn extends k{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var n;const{fragCurrent:i,partCurrent:r,hls:s}=this,{autoLevelEnabled:o,media:c}=s;if(!i||!c)return;const u=performance.now(),h=r?r.stats:i.stats,f=r?r.duration:i.duration,v=u-h.loading.start,R=s.minAutoLevel,I=i.level,q=this._nextAutoLevel;if(h.aborted||h.loaded&&h.loaded===h.total||I<=R){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const J=q>-1&&q!==I,pe=!!t||J;if(!pe&&(c.paused||!c.playbackRate||!c.readyState))return;const _e=s.mainForwardBufferInfo;if(!pe&&_e===null)return;const ye=this.bwEstimator.getEstimateTTFB(),Me=Math.abs(c.playbackRate);if(v<=Math.max(ye,1e3*(f/(Me*2))))return;const Ge=_e?_e.len/Me:0,dt=h.loading.first?h.loading.first-h.loading.start:-1,We=h.loaded&&dt>-1,ot=this.getBwEstimate(),at=s.levels,Je=at[I],wt=Math.max(h.loaded,Math.round(f*(i.bitrate||Je.averageBitrate)/8));let Xt=We?v-dt:v;Xt<1&&We&&(Xt=Math.min(v,h.loaded*8/ot));const on=We?h.loaded*1e3/Xt:0,mn=ye/1e3,ln=on?(wt-h.loaded)/on:wt*8/ot+mn;if(ln<=Ge)return;const jt=on?on*8:ot,dn=((n=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:n.live)===!0,nn=this.hls.config.abrBandWidthUpFactor;let fn=Number.POSITIVE_INFINITY,Tn;for(Tn=I-1;Tn>R;Tn--){const Yn=at[Tn].maxBitrate,Fn=!at[Tn].details||dn;if(fn=this.getTimeToLoadFrag(mn,jt,f*Yn,Fn),fn<Math.min(Ge,f+mn))break}if(fn>=ln||fn>f*10)return;We?this.bwEstimator.sample(v-Math.min(ye,dt),h.loaded):this.bwEstimator.sampleTTFB(v);const Zt=at[Tn].maxBitrate;this.getBwEstimate()*nn>Zt&&this.resetEstimator(Zt);const Yt=this.findBestLevel(Zt,R,Tn,0,Ge,1,1);Yt>-1&&(Tn=Yt),this.warn(`Fragment ${i.sn}${r?" part "+r.index:""} of level ${I} is loading too slowly;
|
|
Fragment duration: ${i.duration.toFixed(3)}
|
|
Time to underbuffer: ${Ge.toFixed(3)} s
|
|
Estimated load time for current fragment: ${ln.toFixed(3)} s
|
|
Estimated load time for down switch fragment: ${fn.toFixed(3)} s
|
|
TTFB estimate: ${dt|0} ms
|
|
Current BW estimate: ${x(ot)?ot|0:"Unknown"} bps
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
Switching to level ${Tn} @ ${Zt|0} bps`),s.nextLoadLevel=s.nextAutoLevel=Tn,this.clearTimer();const Mn=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===Tn&&Tn>0){const Yn=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${Tn>0?"and switching down":""}
|
|
Fragment duration: ${i.duration.toFixed(3)} s
|
|
Time to underbuffer: ${Yn.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,Tn>R){let Fn=this.findBestLevel(this.hls.levels[R].bitrate,R,Tn,0,Yn,1,1);Fn===-1&&(Fn=R),this.hls.nextLoadLevel=this.hls.nextAutoLevel=Fn,this.resetEstimator(this.hls.levels[Fn].bitrate)}}};J||ln>fn*2?Mn():this.timer=self.setInterval(Mn,fn*1e3),s.trigger(p.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:r,stats:h})},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 K(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(p.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var i;this.fragCurrent=n,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case G.BUFFER_ADD_CODEC_ERROR:case G.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case G.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:i,partCurrent:r}=this;if(n&&i&&n.sn===i.sn&&n.level===i.level){const s=performance.now(),o=r?r.stats:n.stats,c=s-o.loading.start,u=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&u>-1){const f=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(f,u),o.loaded)}else this.bwEstimator.sampleTTFB(c)}break}}}getTimeToLoadFrag(e,t,n,i){const r=e+n/t,s=i?e+this.lastLevelLoadSec:0;return r+s}onLevelLoaded(e,t){const n=this.hls.config,{loading:i}=t.stats,r=i.end-i.first;x(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:n}){const i=n?n.stats:t.stats;if(t.type===ne.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const r=n?n.duration:t.duration,s=this.hls.levels[t.level],o=(s.loaded?s.loaded.bytes:0)+i.loaded,c=(s.loaded?s.loaded.duration:0)+r;s.loaded={bytes:o,duration:c},s.realBitrate=Math.round(8*o/c)}if(t.bitrateTest){const r={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(p.FRAG_BUFFERED,r),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:i}=t,r=i!=null&&i.stats.loaded?i.stats:n.stats;if(r.aborted||this.ignoreFragment(n))return;const s=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,r.loaded),r.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==ne.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,r=this.findBestLevel(n,t,e,0,i,1,1);if(r>-1)return r;const s=this.hls.firstLevel,o=Math.min(Math.max(s,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=n&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const s=this.hls.levels;if(s.length>Math.max(e,r)&&s[e].loadError<=s[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:i,config:r,minAutoLevel:s}=n,o=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),u=this.getStarvationDelay();let h=r.abrBandWidthFactor,f=r.abrBandWidthUpFactor;if(u){const J=this.findBestLevel(c,s,i,u,0,h,f);if(J>=0)return this.rebufferNotice=-1,J}let v=o?Math.min(o,r.maxStarvationDelay):r.maxStarvationDelay;if(!u){const J=this.bitrateTestDelay;J&&(v=(o?Math.min(o,r.maxLoadingDelay):r.maxLoadingDelay)-J,this.info(`bitrate test took ${Math.round(1e3*J)}ms, set first fragment max fetchDuration to ${Math.round(1e3*v)} ms`),h=f=1)}const R=this.findBestLevel(c,s,i,u,v,h,f);if(this.rebufferNotice!==R&&(this.rebufferNotice=R,this.info(`${u?"rebuffering expected":"buffer is empty"}, optimal quality level ${R}`)),R>-1)return R;const I=n.levels[s],q=n.loadLevelObj;return q&&(I==null?void 0:I.bitrate)<q.bitrate?s:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,i,r,s,o){var c;const u=i+r,h=this.lastLoadedFragLevel,f=h===-1?this.hls.firstLevel:h,{fragCurrent:v,partCurrent:R}=this,{levels:I,allAudioTracks:q,loadLevel:J,config:pe}=this.hls;if(I.length===1)return 0;const _e=I[f],ye=!!((c=this.hls.latestLevelDetails)!=null&&c.live),Me=J===-1||h===-1;let Ge,dt="SDR",We=(_e==null?void 0:_e.frameRate)||0;const{audioPreference:ot,videoPreference:at}=pe,Je=this.audioTracksByGroup||(this.audioTracksByGroup=st(q));let wt=-1;if(Me){if(this.firstSelection!==-1)return this.firstSelection;const jt=this.codecTiers||(this.codecTiers=ct(I,Je,t,n)),dn=pt(jt,dt,e,ot,at),{codecSet:nn,videoRanges:fn,minFramerate:Tn,minBitrate:Zt,minIndex:Yt,preferHDR:Mn}=dn;wt=Yt,Ge=nn,dt=Mn?fn[fn.length-1]:fn[0],We=Tn,e=Math.max(e,Zt),this.log(`picked start tier ${Ke(dn)}`)}else Ge=_e==null?void 0:_e.codecSet,dt=_e==null?void 0:_e.videoRange;const Xt=R?R.duration:v?v.duration:0,on=this.bwEstimator.getEstimateTTFB()/1e3,mn=[];for(let jt=n;jt>=t;jt--){var ln;const dn=I[jt],nn=jt>f;if(!dn)continue;if(pe.useMediaCapabilities&&!dn.supportedResult&&!dn.supportedPromise){const Fn=navigator.mediaCapabilities;typeof(Fn==null?void 0:Fn.decodingInfo)=="function"&&Xe(dn,Je,dt,We,e,ot)?(dn.supportedPromise=Ze(dn,Je,Fn,this.supportedCache),dn.supportedPromise.then(Kn=>{if(!this.hls)return;dn.supportedResult=Kn;const Ii=this.hls.levels,xi=Ii.indexOf(dn);Kn.error?this.warn(`MediaCapabilities decodingInfo error: "${Kn.error}" for level ${xi} ${Ke(Kn)}`):Kn.supported?Kn.decodingInfoResults.some(Qi=>Qi.smooth===!1||Qi.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${xi} not smooth or powerEfficient: ${Ke(Kn)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${xi} ${Ke(Kn)}`),xi>-1&&Ii.length>1&&(this.log(`Removing unsupported level ${xi}`),this.hls.removeLevel(xi),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))}).catch(Kn=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${Kn}`)})):dn.supportedResult=Ee}if((Ge&&dn.codecSet!==Ge||dt&&dn.videoRange!==dt||nn&&We>dn.frameRate||!nn&&We>0&&We<dn.frameRate||(ln=dn.supportedResult)!=null&&(ln=ln.decodingInfoResults)!=null&&ln.some(Fn=>Fn.smooth===!1))&&(!Me||jt!==wt)){mn.push(jt);continue}const fn=dn.details,Tn=(R?fn==null?void 0:fn.partTarget:fn==null?void 0:fn.averagetargetduration)||Xt;let Zt;nn?Zt=o*e:Zt=s*e;const Yt=Xt&&i>=Xt*2&&r===0?dn.averageBitrate:dn.maxBitrate,Mn=this.getTimeToLoadFrag(on,Zt,Yt*Tn,fn===void 0);if(Zt>=Yt&&(jt===h||dn.loadError===0&&dn.fragmentError===0)&&(Mn<=on||!x(Mn)||ye&&!this.bitrateTestDelay||Mn<u)){const Fn=this.forcedAutoLevel;return jt!==J&&(Fn===-1||Fn!==J)&&(mn.length&&this.trace(`Skipped level(s) ${mn.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${I[mn[0]].codecs}" ${I[mn[0]].videoRange}; not compatible with "${Ge}" ${dt}`),this.info(`switch candidate:${f}->${jt} adjustedbw(${Math.round(Zt)})-bitrate=${Math.round(Zt-Yt)} ttfb:${on.toFixed(1)} avgDuration:${Tn.toFixed(1)} maxFetchDuration:${u.toFixed(1)} fetchDuration:${Mn.toFixed(1)} firstSelection:${Me} codecSet:${dn.codecSet} videoRange:${dn.videoRange} hls.loadLevel:${J}`)),Me&&(this.firstSelection=jt),jt}}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 pn={search:function(a,e){let t=0,n=a.length-1,i=null,r=null;for(;t<=n;){i=(t+n)/2|0,r=a[i];const s=e(r);if(s>0)t=i+1;else if(s<0)n=i-1;else return r}return null}};function yn(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!x(e))return null;const n=a[0].programDateTime;if(e<(n||0))return null;const i=a[a.length-1].endProgramDateTime;if(e>=(i||0))return null;for(let r=0;r<a.length;++r){const s=a[r];if($n(e,t,s))return s}return null}function Rn(a,e,t=0,n=0,i=.005){let r=null;if(a){r=e[1+a.sn-e[0].sn]||null;const o=a.endDTS-t;o>0&&o<15e-7&&(t+=15e-7),r&&a.level!==r.level&&r.end<=a.end&&(r=e[2+a.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&wn(t,n,r)===0||In(r,a,Math.min(i,n))))return r;const s=pn.search(e,wn.bind(null,t,n));return s&&(s!==a||!r)?s:r}function In(a,e,t){if(e&&e.start===0&&e.level<a.level&&(e.endPTS||0)>0){const n=e.tagList.reduce((i,r)=>(r[0]==="INF"&&(i+=parseFloat(r[1])),i),t);return a.start<=n}return!1}function wn(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 $n(a,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>a}function Dn(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){let n=a.fragments;const{fragmentHint:i}=a;i&&(n=n.concat(i));let r;return pn.search(n,s=>s.cc<e?1:s.cc>e?-1:(r=s,s.end<=t?1:s.start>t?-1:0)),r||null}return null}function Nn(a){switch(a.details){case G.FRAG_LOAD_TIMEOUT:case G.KEY_LOAD_TIMEOUT:case G.LEVEL_LOAD_TIMEOUT:case G.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Xn(a){return a.details.startsWith("key")}function Gn(a){return Xn(a)&&!!a.frag&&!a.frag.decryptdata}function si(a,e){const t=Nn(e);return a.default[`${t?"timeout":"error"}Retry`]}function Zn(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function Qn(a){return E(E({},a),{errorRetry:null,timeoutRetry:null})}function ni(a,e,t,n){if(!a)return!1;const i=n==null?void 0:n.code,r=e<a.maxNumRetry&&(ii(i)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,n,r):r}function ii(a){return ei(a)||!!a&&(a<400||a>499)}function ei(a){return a===0&&navigator.onLine===!1}var Cn={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},kn={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,MoveAllAlternatesMatchingKey:4,SwitchToSDR:8};class rn extends k{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(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}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===ne.MAIN?e.level:this.getVariantIndex()}getVariantIndex(){var e;const t=this.hls,n=t.currentLevel;return(e=t.loadLevelObj)!=null&&e.details||n===-1?t.loadLevel:n}variantHasKey(e,t){if(e){var n;if((n=e.details)!=null&&n.hasKey(t))return!0;const i=e.audioGroups;if(i)return this.hls.allAudioTracks.filter(s=>i.indexOf(s.groupId)>=0).some(s=>{var o;return(o=s.details)==null?void 0:o.hasKey(t)})}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;const i=this.hls,r=t.context;switch(t.details){case G.FRAG_LOAD_ERROR:case G.FRAG_LOAD_TIMEOUT:case G.KEY_LOAD_ERROR:case G.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case G.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction=Gt();return}case G.FRAG_GAP:case G.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Cn.SendAlternateToPenaltyBox;return}case G.LEVEL_EMPTY_ERROR:case G.LEVEL_PARSING_ERROR:{var s;const c=t.parent===ne.MAIN?t.level:i.loadLevel;t.details===G.LEVEL_EMPTY_ERROR&&((s=t.context)!=null&&(s=s.levelDetails)!=null&&s.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c))}return;case G.LEVEL_LOAD_ERROR:case G.LEVEL_LOAD_TIMEOUT:typeof(r==null?void 0:r.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level));return;case G.AUDIO_TRACK_LOAD_ERROR:case G.AUDIO_TRACK_LOAD_TIMEOUT:case G.SUBTITLE_LOAD_ERROR:case G.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const c=i.loadLevelObj;if(c&&(r.type===se.AUDIO_TRACK&&c.hasAudioGroup(r.groupId)||r.type===se.SUBTITLE_TRACK&&c.hasSubtitleGroup(r.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=Cn.SendAlternateToPenaltyBox,t.errorAction.flags=kn.MoveAllAlternatesMatchingHost;return}}return;case G.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:t.errorAction={action:Cn.SendAlternateToPenaltyBox,flags:kn.MoveAllAlternatesMatchingHDCP};return;case G.KEY_SYSTEM_SESSION_UPDATE_FAILED:case G.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case G.KEY_SYSTEM_NO_SESSION:t.errorAction={action:Cn.SendAlternateToPenaltyBox,flags:kn.MoveAllAlternatesMatchingKey};return;case G.BUFFER_ADD_CODEC_ERROR:case G.REMUX_ALLOC_ERROR:case G.BUFFER_APPEND_ERROR:if(!t.errorAction){var o;t.errorAction=this.getLevelSwitchAction(t,(o=t.level)!=null?o:i.loadLevel)}return;case G.INTERNAL_EXCEPTION:case G.BUFFER_APPENDING_ERROR:case G.BUFFER_FULL_ERROR:case G.LEVEL_SWITCH_ERROR:case G.BUFFER_STALLED_ERROR:case G.BUFFER_SEEK_OVER_HOLE:case G.BUFFER_NUDGE_ON_STALL:t.errorAction=Gt();return}t.type===ue.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=Gt())}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,i=si(n.config.playlistLoadPolicy,e),r=this.playlistError++;if(ni(i,r,Nn(e),e.response))return{action:Cn.RetryRequest,flags:kn.None,retryConfig:i,retryCount:r};const o=this.getLevelSwitchAction(e,t);return i&&(o.retryConfig=i,o.retryCount=r),o}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),i=t.levels[n],{fragLoadPolicy:r,keyLoadPolicy:s}=t.config,o=si(Xn(e)?s:r,e),c=t.levels.reduce((h,f)=>h+f.fragmentError,0);if(i&&(e.details!==G.FRAG_GAP&&i.fragmentError++,!Gn(e)&&ni(o,c,Nn(e),e.response)))return{action:Cn.RetryRequest,flags:kn.None,retryConfig:o,retryCount:c};const u=this.getLevelSwitchAction(e,n);return o&&(u.retryConfig=o,u.retryCount=c),u}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var r,s;const u=e.details;i.loadError++,u===G.BUFFER_APPEND_ERROR&&i.fragmentError++;let h=-1;const{levels:f,loadLevel:v,minAutoLevel:R,maxAutoLevel:I}=n;!n.autoLevelEnabled&&!n.config.preserveManualLevelOnError&&(n.loadLevel=-1);const q=(r=e.frag)==null?void 0:r.type,pe=(q===ne.AUDIO&&u===G.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(u===G.BUFFER_ADD_CODEC_ERROR||u===G.BUFFER_APPEND_ERROR))&&f.some(({audioCodec:dt})=>i.audioCodec!==dt),ye=e.sourceBufferName==="video"&&(u===G.BUFFER_ADD_CODEC_ERROR||u===G.BUFFER_APPEND_ERROR)&&f.some(({codecSet:dt,audioCodec:We})=>i.codecSet!==dt&&i.audioCodec===We),{type:Me,groupId:Ge}=(s=e.context)!=null?s:{};for(let dt=f.length;dt--;){const We=(dt+v)%f.length;if(We!==v&&We>=R&&We<=I&&f[We].loadError===0){var o,c;const ot=f[We];if(u===G.FRAG_GAP&&q===ne.MAIN&&e.frag){const at=f[We].details;if(at){const Je=Rn(e.frag,at.fragments,e.frag.start);if(Je!=null&&Je.gap)continue}}else{if(Me===se.AUDIO_TRACK&&ot.hasAudioGroup(Ge)||Me===se.SUBTITLE_TRACK&&ot.hasSubtitleGroup(Ge))continue;if(q===ne.AUDIO&&(o=i.audioGroups)!=null&&o.some(at=>ot.hasAudioGroup(at))||q===ne.SUBTITLE&&(c=i.subtitleGroups)!=null&&c.some(at=>ot.hasSubtitleGroup(at))||pe&&i.audioCodec===ot.audioCodec||ye&&i.codecSet===ot.codecSet||!pe&&i.codecSet!==ot.codecSet)continue}h=We;break}}if(h>-1&&n.loadLevel!==h)return e.levelRetry=!0,this.playlistError=0,{action:Cn.SendAlternateToPenaltyBox,flags:kn.None,nextAutoLevel:h}}return{action:Cn.SendAlternateToPenaltyBox,flags:kn.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case Cn.DoNothing:break;case Cn.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==G.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break;case Cn.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:i}=n,r=n.nextAutoLevel;switch(i){case kn.None:this.switchLevel(e,r);break;case kn.MoveAllAlternatesMatchingHDCP:{const c=this.getVariantLevelIndex(e.frag),u=t.levels[c],h=u==null?void 0:u.attrs["HDCP-LEVEL"];if(n.hdcpLevel=h,h==="NONE")this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(h){t.maxHdcpLevel=$t[$t.indexOf(h)-1],n.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case kn.MoveAllAlternatesMatchingKey:{const c=e.decryptdata;if(c){const u=this.hls.levels,h=u.length;for(let v=h;v--;)if(this.variantHasKey(u[v],c)){var s,o;this.log(`Banned key found in level ${v} (${u[v].bitrate}bps) or audio group "${(s=u[v].audioGroups)==null?void 0:s.join(",")}" (${(o=e.frag)==null?void 0:o.type} fragment) ${ie(c.keyId||[])}`),u[v].fragmentError++,u[v].loadError++,this.log(`Removing level ${v} with key error (${e.error})`),this.hls.removeLevel(v)}const f=e.frag;if(this.hls.levels.length<h)n.resolved=!0;else if(f&&f.type!==ne.MAIN){const v=f.decryptdata;v&&!c.matches(v)&&(n.resolved=!0)}}break}}n.resolved||this.switchLevel(e,r)}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===G.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const n=T(e.mimeType),i=this.hls.levels;for(let r=i.length;r--;)i[r][`${e.sourceBufferName}Codec`]===n&&(this.log(`Removing level ${r} for ${e.details} ("${n}" not supported)`),this.hls.removeLevel(r))}}}function Gt(a){const e={action:Cn.DoNothing,flags:kn.None};return a&&(e.resolved=!0),e}var en={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class Bn{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e&&(e.on(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&&(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.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let i=n.length;i--;){const r=n[i];if(!r)break;if(r.start<=e&&e<=r.end&&r.loaded)return r}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,n){const{fragments:i}=this,r=Object.keys(i);for(let s=r.length;s--;){const o=i[r[s]];if((o==null?void 0:o.body.type)===t&&(!n||o.buffered)){const c=o.body;if(c.start<=e&&e<=c.end)return c}}return null}detectEvictedFragments(e,t,n,i,r){this.timeRanges&&(this.timeRanges[e]=t);const s=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(o=>{const c=this.fragments[o];if(!c||s>=c.body.sn)return;if(!c.buffered&&(!c.loaded||r)){c.body.type===n&&this.removeFragment(c.body);return}const u=c.range[e];if(u){if(u.time.length===0){this.removeFragment(c.body);return}u.time.some(h=>{const f=!this.isTimeBuffered(h.startPTS,h.endPTS,t);return f&&this.removeFragment(c.body),f})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const n=e.frag,i=Jn(n),r=this.fragments[i];if(!r||r.buffered&&n.gap)return;const s=!n.relurl;Object.keys(t).forEach(o=>{const c=n.elementaryStreams[o];if(!c)return;const u=t[o],h=s||c.partial===!0;r.range[o]=this.getBufferedTimes(n,e.part,h,u)}),r.loaded=null,Object.keys(r.range).length?(this.bufferedEnd(r,n),Un(r)||this.removeParts(n.sn-1,n.type)):this.removeFragment(r.body)}bufferedEnd(e,t){e.buffered=!0,(e.body.endList=t.endList||e.body.endList)&&(this.endListFragments[e.body.type]=e)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=oi(n,i=>i.fragment.sn>=e))}fragBuffered(e,t){const n=Jn(e);let i=this.fragments[n];!i&&t&&(i=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,this.bufferedEnd(i,e))}getBufferedTimes(e,t,n,i){const r={time:[],partial:n},s=e.start,o=e.end,c=e.minEndPTS||o,u=e.maxStartPTS||s;for(let h=0;h<i.length;h++){const f=i.start(h)-this.bufferPadding,v=i.end(h)+this.bufferPadding;if(u>=f&&c<=v){r.time.push({startPTS:Math.max(s,i.start(h)),endPTS:Math.min(o,i.end(h))});break}else if(s<v&&o>f){const R=Math.max(s,i.start(h)),I=Math.min(o,i.end(h));I>R&&(r.partial=!0,r.time.push({startPTS:R,endPTS:I}))}else if(o<=f)break}return r}getPartialFragment(e){let t=null,n,i,r,s=0;const{bufferPadding:o,fragments:c}=this;return Object.keys(c).forEach(u=>{const h=c[u];h&&Un(h)&&(i=h.body.start-o,r=h.body.end+o,e>=i&&e<=r&&(n=Math.min(e-i,r-e),s<=n&&(t=h.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Un(t))}getState(e){const t=Jn(e),n=this.fragments[t];return n?n.buffered?Un(n)?en.PARTIAL:en.OK:en.APPENDING:en.NOT_LOADED}isTimeBuffered(e,t,n){let i,r;for(let s=0;s<n.length;s++){if(i=n.start(s)-this.bufferPadding,r=n.end(s)+this.bufferPadding,e>=i&&t<=r)return!0;if(t<=i)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const n=t.frag,i=t.part?null:t,r=Jn(n);this.fragments[r]={body:n,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:i,timeRanges:r,type:s}=t;if(n.sn==="initSegment")return;const o=n.type;if(i){let u=this.activePartLists[o];u||(this.activePartLists[o]=u=[]),u.push(i)}this.timeRanges=r;const c=r[s];this.detectEvictedFragments(s,c,o,i)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Jn(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,n=Object.keys(t);if(!e)return n.length>0;for(let i=n.length;i--;){const r=t[n[i]];if((r==null?void 0:r.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const o=this.fragments[s];if(!o)return;const c=o.body;c.type!==n||i&&!c.gap||c.start<t&&c.end>e&&(o.buffered||r)&&this.removeFragment(c)})}removeFragment(e){const t=Jn(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const i=e.sn;this.activePartLists[e.type]=oi(n,r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const t=(e=this.hls)==null||(e=e.latestLevelDetails)==null?void 0:e.partList;t&&t.forEach(n=>n.clearElementaryStreamInfo())}}function Un(a){var e,t,n;return a.buffered&&!!(a.body.gap||(e=a.range.video)!=null&&e.partial||(t=a.range.audio)!=null&&t.partial||(n=a.range.audiovideo)!=null&&n.partial)}function Jn(a){return`${a.type}_${a.level}_${a.sn}`}function oi(a,e){return a.filter(t=>{const n=e(t);return n||t.clearElementaryStreamInfo(),n})}var Hn={cbc:0,ctr:1};class ci{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 Hn.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case Hn.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 Ti(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class di{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let i=0;i<4;i++)n[i]=t.getUint32(i*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,i=n[0],r=n[1],s=n[2],o=n[3],c=this.invSubMix,u=c[0],h=c[1],f=c[2],v=c[3],R=new Uint32Array(256);let I=0,q=0,J=0;for(J=0;J<256;J++)J<128?R[J]=J<<1:R[J]=J<<1^283;for(J=0;J<256;J++){let pe=q^q<<1^q<<2^q<<3^q<<4;pe=pe>>>8^pe&255^99,e[I]=pe,t[pe]=I;const _e=R[I],ye=R[_e],Me=R[ye];let Ge=R[pe]*257^pe*16843008;i[I]=Ge<<24|Ge>>>8,r[I]=Ge<<16|Ge>>>16,s[I]=Ge<<8|Ge>>>24,o[I]=Ge,Ge=Me*16843009^ye*65537^_e*257^I*16843008,u[pe]=Ge<<24|Ge>>>8,h[pe]=Ge<<16|Ge>>>16,f[pe]=Ge<<8|Ge>>>24,v[pe]=Ge,I?(I=_e^R[R[R[Me^_e]]],q^=R[R[q]]):I=q=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,i=0;for(;i<t.length&&n;)n=t[i]===this.key[i],i++;if(n)return;this.key=t;const r=this.keySize=t.length;if(r!==4&&r!==6&&r!==8)throw new Error("Invalid aes key size="+r);const s=this.ksRows=(r+6+1)*4;let o,c;const u=this.keySchedule=new Uint32Array(s),h=this.invKeySchedule=new Uint32Array(s),f=this.sBox,v=this.rcon,R=this.invSubMix,I=R[0],q=R[1],J=R[2],pe=R[3];let _e,ye;for(o=0;o<s;o++){if(o<r){_e=u[o]=t[o];continue}ye=_e,o%r===0?(ye=ye<<8|ye>>>24,ye=f[ye>>>24]<<24|f[ye>>>16&255]<<16|f[ye>>>8&255]<<8|f[ye&255],ye^=v[o/r|0]<<24):r>6&&o%r===4&&(ye=f[ye>>>24]<<24|f[ye>>>16&255]<<16|f[ye>>>8&255]<<8|f[ye&255]),u[o]=_e=(u[o-r]^ye)>>>0}for(c=0;c<s;c++)o=s-c,c&3?ye=u[o]:ye=u[o-4],c<4||o<=4?h[c]=ye:h[c]=I[f[ye>>>24]]^q[f[ye>>>16&255]]^J[f[ye>>>8&255]]^pe[f[ye&255]],h[c]=h[c]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){const i=this.keySize+6,r=this.invKeySchedule,s=this.invSBox,o=this.invSubMix,c=o[0],u=o[1],h=o[2],f=o[3],v=this.uint8ArrayToUint32Array_(n);let R=v[0],I=v[1],q=v[2],J=v[3];const pe=new Int32Array(e),_e=new Int32Array(pe.length);let ye,Me,Ge,dt,We,ot,at,Je,wt,Xt,on,mn,ln,jt;const dn=this.networkToHostOrderSwap;for(;t<pe.length;){for(wt=dn(pe[t]),Xt=dn(pe[t+1]),on=dn(pe[t+2]),mn=dn(pe[t+3]),We=wt^r[0],ot=mn^r[1],at=on^r[2],Je=Xt^r[3],ln=4,jt=1;jt<i;jt++)ye=c[We>>>24]^u[ot>>16&255]^h[at>>8&255]^f[Je&255]^r[ln],Me=c[ot>>>24]^u[at>>16&255]^h[Je>>8&255]^f[We&255]^r[ln+1],Ge=c[at>>>24]^u[Je>>16&255]^h[We>>8&255]^f[ot&255]^r[ln+2],dt=c[Je>>>24]^u[We>>16&255]^h[ot>>8&255]^f[at&255]^r[ln+3],We=ye,ot=Me,at=Ge,Je=dt,ln=ln+4;ye=s[We>>>24]<<24^s[ot>>16&255]<<16^s[at>>8&255]<<8^s[Je&255]^r[ln],Me=s[ot>>>24]<<24^s[at>>16&255]<<16^s[Je>>8&255]<<8^s[We&255]^r[ln+1],Ge=s[at>>>24]<<24^s[Je>>16&255]<<16^s[We>>8&255]<<8^s[ot&255]^r[ln+2],dt=s[Je>>>24]<<24^s[We>>16&255]<<16^s[ot>>8&255]<<8^s[at&255]^r[ln+3],_e[t]=dn(ye^R),_e[t+1]=dn(dt^I),_e[t+2]=dn(Ge^q),_e[t+3]=dn(Me^J),R=wt,I=Xt,q=on,J=mn,t=t+4}return _e.buffer}}class bi{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=ai(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function ai(a){switch(a){case Hn.cbc:return"AES-CBC";case Hn.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${a}`)}}const hi=16;class gi{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const 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?Ti(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n,i){return this.useSoftware?new Promise((r,s)=>{const o=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(o,t,n,i);const c=this.flush();c?r(c.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n,i)}softwareDecrypt(e,t,n,i){const{currentIV:r,currentResult:s,remainderData:o}=this;if(i!==Hn.cbc||t.byteLength!==16)return ae.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),o&&(e=Ye(o,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;r&&(n=r);let u=this.softwareDecrypter;u||(u=this.softwareDecrypter=new di),u.expandKey(t);const h=s;return this.currentResult=u.decrypt(c.buffer,0,n),this.currentIV=c.slice(-16).buffer,h||null}webCryptoDecrypt(e,t,n,i){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n,i));this.key=t,this.fastAesKey=new bi(this.subtle,t,i)}return this.fastAesKey.expandKey().then(r=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new ci(this.subtle,new Uint8Array(n),i).decrypt(e.buffer,r)):Promise.reject(new Error("web crypto not initialized"))).catch(r=>(ae.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(e,t,n,i)))}onWebCryptoError(e,t,n,i){const r=this.enableSoftwareAES;if(r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,i);const s=this.flush();if(s)return s.buffer}throw new Error("WebCrypto"+(r?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%hi;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(ae.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Mi=Math.pow(2,17);class fi{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 vi({type:ue.NETWORK_ERROR,details:G.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${n?"part list":"url"}`),networkDetails:null}));this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(I=>I[0]==="GAP")){c(Ci(e));return}else e.gap=!1;const u=this.loader=r?new r(i):new s(i),h=_i(e);e.loader=u;const f=Qn(i.fragLoadPolicy.default),v={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:Mi};e.stats=u.stats;const R={onSuccess:(I,q,J,pe)=>{this.resetLoader(e,u);let _e=I.data;J.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(_e.slice(0,16)),_e=_e.slice(16)),o({frag:e,part:null,payload:_e,networkDetails:pe})},onError:(I,q,J,pe)=>{this.resetLoader(e,u),c(new vi({type:ue.NETWORK_ERROR,details:G.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:E({url:n,data:void 0},I),error:new Error(`HTTP Error ${I.code} ${I.text}`),networkDetails:J,stats:pe}))},onAbort:(I,q,J)=>{this.resetLoader(e,u),c(new vi({type:ue.NETWORK_ERROR,details:G.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:J,stats:I}))},onTimeout:(I,q,J)=>{this.resetLoader(e,u),c(new vi({type:ue.NETWORK_ERROR,details:G.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${v.timeout}ms`),networkDetails:J,stats:I}))}};t&&(R.onProgress=(I,q,J,pe)=>t({frag:e,part:null,payload:J,networkDetails:pe})),u.load(h,v,R)})}loadPart(e,t,n){this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(Ci(e,t));return}const u=this.loader=r?new r(i):new s(i),h=_i(e,t);e.loader=u;const f=Qn(i.fragLoadPolicy.default),v={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Mi};t.stats=u.stats,u.load(h,v,{onSuccess:(R,I,q,J)=>{this.resetLoader(e,u),this.updateStatsFromPart(e,t);const pe={frag:e,part:t,payload:R.data,networkDetails:J};n(pe),o(pe)},onError:(R,I,q,J)=>{this.resetLoader(e,u),c(new vi({type:ue.NETWORK_ERROR,details:G.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:E({url:h.url,data:void 0},R),error:new Error(`HTTP Error ${R.code} ${R.text}`),networkDetails:q,stats:J}))},onAbort:(R,I,q)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,u),c(new vi({type:ue.NETWORK_ERROR,details:G.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:q,stats:R}))},onTimeout:(R,I,q)=>{this.resetLoader(e,u),c(new vi({type:ue.NETWORK_ERROR,details:G.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${v.timeout}ms`),networkDetails:q,stats:R}))}})})}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,r=i.total;if(n.loaded+=i.loaded,r){const c=Math.round(e.duration/t.duration),u=Math.min(Math.round(n.loaded/r),c),f=(c-u)*Math.round(n.loaded/u);n.total=n.loaded+f}else n.total=Math.max(n.loaded,n.total);const s=n.loading,o=i.loading;s.start?s.first+=o.first-o.start:(s.start=o.start,s.first=o.first),s.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function _i(a,e=null){const t=e||a,n={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,r=t.byteRangeEndOffset;if(x(i)&&x(r)){var s;let o=i,c=r;if(a.sn==="initSegment"&&Fi((s=a.decryptdata)==null?void 0:s.method)){const u=r-i;u%16&&(c=r+(16-u%16)),i!==0&&(n.resetIV=!0,o=i-16)}n.rangeStart=o,n.rangeEnd=c}return n}function Ci(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:ue.MEDIA_ERROR,details:G.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new vi(n)}function Fi(a){return a==="AES-128"||a==="AES-256"}class vi extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class zi extends k{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class $i{constructor(e,t,n,i=0,r=-1,s=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=Di(),this.buffering={audio:Di(),video:Di(),audiovideo:Di()},this.level=e,this.sn=t,this.id=n,this.size=i,this.part=r,this.partial=s}}function Di(){return{start:0,executeStart:0,executeEnd:0,end:0}}const qi={length:0,start:()=>0,end:()=>0};class bn{static isBuffered(e,t){if(e){const n=bn.getBuffered(e);for(let i=n.length;i--;)if(t>=n.start(i)&&t<=n.end(i))return!0}return!1}static bufferedRanges(e){if(e){const t=bn.getBuffered(e);return bn.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}static bufferInfo(e,t,n){if(e){const i=bn.bufferedRanges(e);if(i.length)return bn.bufferedInfo(i,t,n)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.length>1&&e.sort((h,f)=>h.start-f.start||f.end-h.end);let i=-1,r=[];if(n)for(let h=0;h<e.length;h++){t>=e[h].start&&t<=e[h].end&&(i=h);const f=r.length;if(f){const v=r[f-1].end;e[h].start-v<n?e[h].end>v&&(r[f-1].end=e[h].end):r.push(e[h])}else r.push(e[h])}else r=e;let s=0,o,c=t,u=t;for(let h=0;h<r.length;h++){const f=r[h].start,v=r[h].end;if(i===-1&&t>=f&&t<=v&&(i=h),t+n>=f&&t<v)c=f,u=v,s=u-t;else if(t+n<f){o=f;break}}return{len:s,start:c||0,end:u||0,nextStart:o,buffered:e,bufferedIndex:i}}static getBuffered(e){try{return e.buffered||qi}catch(t){return ae.log("failed to get media.buffered",t),qi}}}const Wi=/\{\$([a-zA-Z0-9-_]+)\}/g;function Si(a){return Wi.test(a)}function er(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(Wi,n=>{const i=n.substring(2,n.length-1),r=t==null?void 0:t[i];return r===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),n):r})}return e}function or(a,e,t){let n=a.variableList;n||(a.variableList=n={});let i,r;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const s=new self.URL(t).searchParams;if(s.has(i))r=s.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(s){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${s.message}`))}}else i=e.NAME,r=e.VALUE;i in n?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):n[i]=r||""}function tr(a,e,t){const n=e.IMPORT;if(t&&n in t){let i=a.variableList;i||(a.variableList=i={}),i[n]=t[n]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}const lr=/^(\d+)x(\d+)$/,Zi=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Vn{constructor(e,t){typeof e=="string"&&(e=Vn.parseAttrList(e,t)),m(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const n=new Uint8Array(t.length/2);for(let i=0;i<t.length/2;i++)n[i]=parseInt(t.slice(i*2,i*2+2),16);return n}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const n=this[e];return(n?n.split(/[ ,]+/):[]).reduce((i,r)=>(i[r.toLowerCase()]=!0,i),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=lr.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let n;const i={},r='"';for(Zi.lastIndex=0;(n=Zi.exec(e))!==null;){const s=n[1].trim();let o=n[2];const c=o.indexOf(r)===0&&o.lastIndexOf(r)===o.length-1;let u=!1;if(c)o=o.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":u=!0}if(t&&(c||u))o=er(t,o);else if(!u&&!c)switch(s){case"CLOSED-CAPTIONS":if(o==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":ae.warn(`${e}: attribute ${s} is missing quotes`)}i[s]=o}return i}}const pi="com.apple.hls.interstitial";function Oi(a){return a!=="ID"&&a!=="CLASS"&&a!=="CUE"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function nr(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class li{constructor(e,t,n=0){var i;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(t==null?void 0:t.tagAnchor)||null,this.tagOrder=(i=t==null?void 0:t.tagOrder)!=null?i:n,t){const r=t.attr;for(const s in r)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]!==r[s]){ae.warn(`DATERANGE tag attribute: "${s}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=s;break}e=m(new Vn({}),r,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const r=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);x(r.getTime())&&(this._endDate=r)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return e===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return e===null||e.programDateTime===null?(ae.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(x(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===pi}get isValid(){return!!this.id&&!this._badValueForSameId&&x(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 ti=10;class mi{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}hasKey(e){return this.encryptedFragments.some(t=>{let n=t.decryptdata;return n||(t.setKeyFormat(e.keyFormat),n=t.decryptdata),!!n&&e.matches(n)})}get hasProgramDateTime(){return this.fragments.length?x(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||ti}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let 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 yi(a,e){return a.length===e.length?!a.some((t,n)=>t!==e[n]):!1}function Ui(a,e){return!a&&!e?!0:!a||!e?!1:yi(a,e)}function Pi(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function ur(a){switch(a){case"AES-128":case"AES-256":return Hn.cbc;case"AES-256-CTR":return Hn.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function gr(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function ir(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function Ir(a){const e=ir(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function sn(a){const e=function(n,i,r){const s=n[i];n[i]=n[r],n[r]=s};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function vn(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),i=n[n.length-1].split(",");if(i.length===2){const r=i[0]==="base64",s=i[1];r?(n.splice(-1,1),t=gr(s)):t=Ir(s)}}return t}const jn=typeof self!="undefined"?self:void 0;var An={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},On={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Yi(a){switch(a){case On.FAIRPLAY:return An.FAIRPLAY;case On.PLAYREADY:return An.PLAYREADY;case On.WIDEVINE:return An.WIDEVINE;case On.CLEARKEY:return An.CLEARKEY}}function wi(a){switch(a){case An.FAIRPLAY:return On.FAIRPLAY;case An.PLAYREADY:return On.PLAYREADY;case An.WIDEVINE:return On.WIDEVINE;case An.CLEARKEY:return On.CLEARKEY}}function cr(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[An.FAIRPLAY,An.WIDEVINE,An.PLAYREADY,An.CLEARKEY].filter(i=>!!e[i]):[];return!n[An.WIDEVINE]&&t&&n.push(An.WIDEVINE),n}const _r=function(a){return jn!=null&&(a=jn.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function hs(a,e,t,n){let i;switch(a){case An.FAIRPLAY:i=["cenc","sinf"];break;case An.WIDEVINE:case An.PLAYREADY:i=["cenc"];break;case An.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Ws(i,e,t,n)}function Ws(a,e,t,n){return[{initDataTypes:a,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(r=>({contentType:`audio/mp4; codecs=${r}`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:t.map(r=>({contentType:`video/mp4; codecs=${r}`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function Zs(a){var e;return!!a&&(a.sessionType==="persistent-license"||!!((e=a.sessionTypes)!=null&&e.some(t=>t==="persistent-license")))}function fs(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),n=t.substring(t.indexOf("<"),t.length),s=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(s){const o=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(o){const c=gr(o).subarray(0,16);return sn(c),c}}return null}let vr={};class Ki{static clearKeyUriToKeyIdMap(){vr={}}static setKeyIdForUri(e,t){vr[e]=t}static addKeyIdForUri(e){const t=Object.keys(vr).length%Number.MAX_SAFE_INTEGER,n=new Uint8Array(16);return new DataView(n.buffer,12,4).setUint32(0,t),vr[e]=n,n}constructor(e,t,n,i=[1],r=null,s){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=i,this.iv=r,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!Pi(e),s!=null&&s.startsWith("0x")&&(this.keyId=new Uint8Array(M(s)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&yi(e.keyFormatVersions,this.keyFormatVersions)&&Ui(e.iv,this.iv)&&Ui(e.keyId,this.keyId)}isSupported(){if(this.method){if(Pi(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case On.FAIRPLAY:case On.WIDEVINE:case On.PLAYREADY:case On.CLEARKEY:return["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e,t){if(!this.encrypted||!this.uri)return null;if(Pi(this.method)){let r=this.iv;return r||(typeof e!="number"&&(ae.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0),r=yr(e)),new Ki(this.method,this.uri,"identity",this.keyFormatVersions,r)}if(this.keyId){const r=vr[this.uri];if(r&&!yi(this.keyId,r)&&Ki.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const n=vn(this.uri);if(n)switch(this.keyFormat){case On.WIDEVINE:if(this.pssh=n,!this.keyId){const r=ht(n.buffer);if(r.length){var i;const s=r[0];this.keyId=(i=s.kids)!=null&&i.length?s.kids[0]:null}}this.keyId||(this.keyId=Nr(t));break;case On.PLAYREADY:{const r=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Rt(r,null,n),this.keyId=fs(n);break}default:{let r=n.subarray(0,16);if(r.length!==16){const s=new Uint8Array(16);s.set(r,16-r.length),r=s}this.keyId=r;break}}if(!this.keyId||this.keyId.byteLength!==16){let r;r=Ys(t),r||(r=Nr(t),r||(r=vr[this.uri])),r&&(this.keyId=r,Ki.setKeyIdForUri(this.uri,r))}return this}}function Ys(a){const e=a==null?void 0:a[On.WIDEVINE];return e?e.keyId:null}function Nr(a){const e=a==null?void 0:a[On.PLAYREADY];if(e){const t=vn(e.uri);if(t)return fs(t)}return null}function yr(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const Zr=/#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,Yr=/#EXT-X-MEDIA:(.*)/g,Xs=/^#EXT(?:INF|-X-TARGETDURATION):/m,Br=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Qs=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 Gi{static findGroup(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(i.id===t)return i}}static resolve(e,t){return b.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return Xs.test(e)}static parseMasterPlaylist(e,t){const n=Si(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},r=[];if(Zr.lastIndex=0,!e.startsWith("#EXTM3U"))return i.playlistParsingError=new Error("no EXTM3U delimiter"),i;let s;for(;(s=Zr.exec(e))!=null;)if(s[1]){var o;const u=new Vn(s[1],i),h=er(i,s[2]),f={attrs:u,bitrate:u.decimalInteger("BANDWIDTH")||u.decimalInteger("AVERAGE-BANDWIDTH"),name:u.NAME,url:Gi.resolve(h,t)},v=u.decimalResolution("RESOLUTION");v&&(f.width=v.width,f.height=v.height),Xr(u.CODECS,f);const R=u["SUPPLEMENTAL-CODECS"];R&&(f.supplemental={},Xr(R,f.supplemental)),(o=f.unknownCodecs)!=null&&o.length||r.push(f),i.levels.push(f)}else if(s[3]){const u=s[3],h=s[4];switch(u){case"SESSION-DATA":{const f=new Vn(h,i),v=f["DATA-ID"];v&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[v]=f);break}case"SESSION-KEY":{const f=ms(h,t,i);f.encrypted&&f.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(f)):ae.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${h}"`);break}case"DEFINE":{{const f=new Vn(h,i);or(i,f,t)}break}case"CONTENT-STEERING":{const f=new Vn(h,i);i.contentSteering={uri:Gi.resolve(f["SERVER-URI"],t),pathwayId:f["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=gs(h);break}}}const c=r.length>0&&r.length<i.levels.length;return i.levels=c?r:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,n){let i;const r={},s=n.levels,o={AUDIO:s.map(u=>({id:u.attrs.AUDIO,audioCodec:u.audioCodec})),SUBTITLES:s.map(u=>({id:u.attrs.SUBTITLES,textCodec:u.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(Yr.lastIndex=0;(i=Yr.exec(e))!==null;){const u=new Vn(i[1],n),h=u.TYPE;if(h){const f=o[h],v=r[h]||[];r[h]=v;const R=u.LANGUAGE,I=u["ASSOC-LANGUAGE"],q=u.CHANNELS,J=u.CHARACTERISTICS,pe=u["INSTREAM-ID"],_e={attrs:u,bitrate:0,id:c++,groupId:u["GROUP-ID"]||"",name:u.NAME||R||"",type:h,default:u.bool("DEFAULT"),autoselect:u.bool("AUTOSELECT"),forced:u.bool("FORCED"),lang:R,url:u.URI?Gi.resolve(u.URI,t):""};if(I&&(_e.assocLang=I),q&&(_e.channels=q),J&&(_e.characteristics=J),pe&&(_e.instreamId=pe),f!=null&&f.length){const ye=Gi.findGroup(f,_e.groupId)||f[0];Sr(_e,ye,"audioCodec"),Sr(_e,ye,"textCodec")}v.push(_e)}}return r}static parseLevelPlaylist(e,t,n,i,r,s){var o;const c={url:t},u=new mi(t),h=u.fragments,f=[];let v=null,R=0,I=0,q=0,J=0,pe=0,_e=null,ye=new Pe(i,c),Me,Ge,dt,We=-1,ot=!1,at=null,Je;if(Br.lastIndex=0,u.m3u8=e,u.hasVariableRefs=Si(e),((o=Br.exec(e))==null?void 0:o[0])!=="#EXTM3U")return u.playlistParsingError=new Error("Missing format identifier #EXTM3U"),u;for(;(Me=Br.exec(e))!==null;){ot&&(ot=!1,ye=new Pe(i,c),ye.playlistOffset=q,ye.setStart(q),ye.sn=R,ye.cc=J,pe&&(ye.bitrate=pe),ye.level=n,v&&(ye.initSegment=v,v.rawProgramDateTime&&(ye.rawProgramDateTime=v.rawProgramDateTime,v.rawProgramDateTime=null),at&&(ye.setByteRange(at),at=null)));const mn=Me[1];if(mn){ye.duration=parseFloat(mn);const ln=(" "+Me[2]).slice(1);ye.title=ln||null,ye.tagList.push(ln?["INF",mn,ln]:["INF",mn])}else if(Me[3]){if(x(ye.duration)){ye.playlistOffset=q,ye.setStart(q),dt&&vs(ye,dt,u),ye.sn=R,ye.level=n,ye.cc=J,h.push(ye);const ln=(" "+Me[3]).slice(1);ye.relurl=er(u,ln),Jr(ye,_e,f),_e=ye,q+=ye.duration,R++,I=0,ot=!0}}else{if(Me=Me[0].match(Qs),!Me){ae.warn("No matches on slow regex match for level playlist!");continue}for(Ge=1;Ge<Me.length&&Me[Ge]===void 0;Ge++);const ln=(" "+Me[Ge]).slice(1),jt=(" "+Me[Ge+1]).slice(1),dn=Me[Ge+2]?(" "+Me[Ge+2]).slice(1):null;switch(ln){case"BYTERANGE":_e?ye.setByteRange(jt,_e):ye.setByteRange(jt);break;case"PROGRAM-DATE-TIME":ye.rawProgramDateTime=jt,ye.tagList.push(["PROGRAM-DATE-TIME",jt]),We===-1&&(We=h.length);break;case"PLAYLIST-TYPE":u.type&&Xi(u,ln,Me),u.type=jt.toUpperCase();break;case"MEDIA-SEQUENCE":u.startSN!==0?Xi(u,ln,Me):h.length>0&&Lr(u,ln,Me),R=u.startSN=parseInt(jt);break;case"SKIP":{u.skippedSegments&&Xi(u,ln,Me);const nn=new Vn(jt,u),fn=nn.decimalInteger("SKIPPED-SEGMENTS");if(x(fn)){u.skippedSegments+=fn;for(let Zt=fn;Zt--;)h.push(null);R+=fn}const Tn=nn.enumeratedString("RECENTLY-REMOVED-DATERANGES");Tn&&(u.recentlyRemovedDateranges=(u.recentlyRemovedDateranges||[]).concat(Tn.split(" ")));break}case"TARGETDURATION":u.targetduration!==0&&Xi(u,ln,Me),u.targetduration=Math.max(parseInt(jt),1);break;case"VERSION":u.version!==null&&Xi(u,ln,Me),u.version=parseInt(jt);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":u.live||Xi(u,ln,Me),u.live=!1;break;case"#":(jt||dn)&&ye.tagList.push(dn?[jt,dn]:[jt]);break;case"DISCONTINUITY":J++,ye.tagList.push(["DIS"]);break;case"GAP":ye.gap=!0,ye.tagList.push([ln]);break;case"BITRATE":ye.tagList.push([ln,jt]),pe=parseInt(jt)*1e3,x(pe)?ye.bitrate=pe:pe=0;break;case"DATERANGE":{const nn=new Vn(jt,u),fn=new li(nn,u.dateRanges[nn.ID],u.dateRangeTagCount);u.dateRangeTagCount++,fn.isValid||u.skippedSegments?u.dateRanges[fn.id]=fn:ae.warn(`Ignoring invalid DATERANGE tag: "${jt}"`),ye.tagList.push(["EXT-X-DATERANGE",jt]);break}case"DEFINE":{{const nn=new Vn(jt,u);"IMPORT"in nn?tr(u,nn,s):or(u,nn,t)}break}case"DISCONTINUITY-SEQUENCE":u.startCC!==0?Xi(u,ln,Me):h.length>0&&Lr(u,ln,Me),u.startCC=J=parseInt(jt);break;case"KEY":{const nn=ms(jt,t,u);if(nn.isSupported()){if(nn.method==="NONE"){dt=void 0;break}dt||(dt={});const fn=dt[nn.keyFormat];fn!=null&&fn.matches(nn)||(fn&&(dt=m({},dt)),dt[nn.keyFormat]=nn)}else ae.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${jt}"`);break}case"START":u.startTimeOffset=gs(jt);break;case"MAP":{const nn=new Vn(jt,u);if(ye.duration){const fn=new Pe(i,c);_s(fn,nn,n,dt),v=fn,ye.initSegment=v,v.rawProgramDateTime&&!ye.rawProgramDateTime&&(ye.rawProgramDateTime=v.rawProgramDateTime)}else{const fn=ye.byteRangeEndOffset;if(fn){const Tn=ye.byteRangeStartOffset;at=`${fn-Tn}@${Tn}`}else at=null;_s(ye,nn,n,dt),v=ye,ot=!0}v.cc=J;break}case"SERVER-CONTROL":{Je&&Xi(u,ln,Me),Je=new Vn(jt),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&&Xi(u,ln,Me);const nn=new Vn(jt);u.partTarget=nn.decimalFloatingPoint("PART-TARGET");break}case"PART":{let nn=u.partList;nn||(nn=u.partList=[]);const fn=I>0?nn[nn.length-1]:void 0,Tn=I++,Zt=new Vn(jt,u),Yt=new oe(Zt,ye,c,Tn,fn);nn.push(Yt),ye.duration+=Yt.duration;break}case"PRELOAD-HINT":{const nn=new Vn(jt,u);u.preloadHint=nn;break}case"RENDITION-REPORT":{const nn=new Vn(jt,u);u.renditionReports=u.renditionReports||[],u.renditionReports.push(nn);break}default:ae.warn(`line parsed but not handled: ${Me}`);break}}}_e&&!_e.relurl?(h.pop(),q-=_e.duration,u.partList&&(u.fragmentHint=_e)):u.partList&&(Jr(ye,_e,f),ye.cc=J,u.fragmentHint=ye,dt&&vs(ye,dt,u)),u.targetduration||(u.playlistParsingError=new Error("Missing Target Duration"));const wt=h.length,Xt=h[0],on=h[wt-1];if(q+=u.skippedSegments*u.targetduration,q>0&&wt&&on){u.averagetargetduration=q/wt;const mn=on.sn;u.endSN=mn!=="initSegment"?mn:0,u.live||(on.endList=!0),We>0&&(Qr(h,We),Xt&&f.unshift(Xt))}return u.fragmentHint&&(q+=u.fragmentHint.duration),u.totalduration=q,f.length&&u.dateRangeTagCount&&Xt&&ps(f,u),u.endCC=J,u}}function ps(a,e){let t=a.length;if(!t)if(e.hasProgramDateTime){const o=e.fragments[e.fragments.length-1];a.push(o),t++}else return;const n=a[t-1],i=e.live?1/0:e.totalduration,r=Object.keys(e.dateRanges);for(let o=r.length;o--;){const c=e.dateRanges[r[o]],u=c.startDate.getTime();c.tagAnchor=n.ref;for(let h=t;h--;){var s;if(((s=a[h])==null?void 0:s.sn)<e.startSN)break;const f=Js(e,u,a,h,i);if(f!==-1){c.tagAnchor=e.fragments[f].ref;break}}}}function Js(a,e,t,n,i){const r=t[n];if(r){const o=r.programDateTime;if(e>=o||n===0){var s;const c=(((s=t[n+1])==null?void 0:s.start)||i)-r.start;if(e<=o+c*1e3){const u=t[n].sn-a.startSN;if(u<0)return-1;const h=a.fragments;if(h.length>t.length){const v=(t[n+1]||h[h.length-1]).sn-a.startSN;for(let R=v;R>u;R--){const I=h[R].programDateTime;if(e>=I&&e<I+h[R].duration*1e3)return R}}return u}}}return-1}function ms(a,e,t){var n,i;const r=new Vn(a,t),s=(n=r.METHOD)!=null?n:"",o=r.URI,c=r.hexadecimalInteger("IV"),u=r.KEYFORMATVERSIONS,h=(i=r.KEYFORMAT)!=null?i:"identity";o&&r.IV&&!c&&ae.error(`Invalid IV: ${r.IV}`);const f=o?Gi.resolve(o,e):"",v=(u||"1").split("/").map(Number).filter(Number.isFinite);return new Ki(s,f,h,v,c,r.KEYID)}function gs(a){const t=new Vn(a).decimalFloatingPoint("TIME-OFFSET");return x(t)?t:null}function Xr(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=t.filter(r=>zt(r,n));i.length&&(e[`${n}Codec`]=i.map(r=>r.split("/")[0]).join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function Sr(a,e,t){const n=e[t];n&&(a[t]=n)}function Qr(a,e){let t=a[e];for(let n=e;n--;){const i=a[n];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function Jr(a,e,t){a.rawProgramDateTime?t.push(a):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime)}function _s(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 vs(a,e,t){a.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&n.push(a)}function Xi(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function Lr(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function qr(a,e){const t=e.startPTS;if(x(t)){let n=0,i;e.sn>a.sn?(n=t-a.start,i=a):(n=a.start-t,i=e),i.duration!==n&&i.setDuration(n)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.setStart(a.start+(a.minEndPTS-a.start)):e.setStart(a.start+a.duration):e.setStart(Math.max(a.start-e.duration,0))}function ys(a,e,t,n,i,r,s){n-t<=0&&(s.warn("Fragment should have a positive duration",e),n=t+e.duration,r=i+e.duration);let c=t,u=n;const h=e.startPTS,f=e.endPTS;if(x(h)){const pe=Math.abs(h-t);a&&pe>a.totalduration?s.warn(`media timestamps and playlist times differ by ${pe}s for level ${e.level} ${a.url}`):x(e.deltaPTS)?e.deltaPTS=Math.max(pe,e.deltaPTS):e.deltaPTS=pe,c=Math.max(t,h),t=Math.min(t,h),i=e.startDTS!==void 0?Math.min(i,e.startDTS):i,u=Math.min(n,f),n=Math.max(n,f),r=e.endDTS!==void 0?Math.max(r,e.endDTS):r}const v=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(n-e.start),e.startPTS=t,e.maxStartPTS=c,e.startDTS=i,e.endPTS=n,e.minEndPTS=u,e.endDTS=r;const R=e.sn;if(!a||R<a.startSN||R>a.endSN)return 0;let I;const q=R-a.startSN,J=a.fragments;for(J[q]=e,I=q;I>0;I--)qr(J[I],J[I-1]);for(I=q;I<J.length-1;I++)qr(J[I],J[I+1]);return a.fragmentHint&&qr(J[J.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,v}function qs(a,e,t){if(a===e)return;let n=null;const i=a.fragments;for(let h=i.length-1;h>=0;h--){const f=i[h].initSegment;if(f){n=f;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let r;ta(a,e,(h,f,v,R)=>{if((!e.startCC||e.skippedSegments)&&f.cc!==h.cc){const I=h.cc-f.cc;for(let q=v;q<R.length;q++)R[q].cc+=I;e.endCC=R[R.length-1].cc}x(h.startPTS)&&x(h.endPTS)&&(f.setStart(f.startPTS=h.startPTS),f.startDTS=h.startDTS,f.maxStartPTS=h.maxStartPTS,f.endPTS=h.endPTS,f.endDTS=h.endDTS,f.minEndPTS=h.minEndPTS,f.setDuration(h.endPTS-h.startPTS),f.duration&&(r=f),e.PTSKnown=e.alignedSliding=!0),h.hasStreams&&(f.elementaryStreams=h.elementaryStreams),f.loader=h.loader,h.hasStats&&(f.stats=h.stats),h.initSegment&&(f.initSegment=h.initSegment,n=h.initSegment)});const s=e.fragments,o=e.fragmentHint?s.concat(e.fragmentHint):s;if(n&&o.forEach(h=>{var f;h&&(!h.initSegment||h.initSegment.relurl===((f=n)==null?void 0:f.relurl))&&(h.initSegment=n)}),e.skippedSegments){if(e.deltaUpdateFailed=s.some(h=>!h),e.deltaUpdateFailed){t.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let h=e.skippedSegments;h--;)s.shift();e.startSN=s[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=Es(a.dateRanges,e,t));const h=a.fragments.filter(f=>f.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let f=1;f<o.length;f++)o[f].programDateTime===null&&Jr(o[f],o[f-1],h);ps(h,e)}e.endCC=s[s.length-1].cc}if(!e.startCC){var c;const h=Wn(a,e.startSN-1);e.startCC=(c=h==null?void 0:h.cc)!=null?c:s[0].cc}ea(a.partList,e.partList,(h,f)=>{f.elementaryStreams=h.elementaryStreams,f.stats=h.stats}),r?ys(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS,t):Ss(a,e),s.length&&(e.totalduration=e.edge-s[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const u=e.advancedDateTime;if(e.advanced&&u){const h=e.edge;e.driftStart||(e.driftStartTime=u,e.driftStart=h),e.driftEndTime=u,e.driftEnd=h}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function Es(a,e,t){const{dateRanges:n,recentlyRemovedDateranges:i}=e,r=m({},a);i&&i.forEach(c=>{delete r[c]});const o=Object.keys(r).length;return o?(Object.keys(n).forEach(c=>{const u=r[c],h=new li(n[c].attr,u);h.isValid?(r[c]=h,u||(h.tagOrder+=o)):t.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${Ke(n[c].attr)}"`)}),r):n}function ea(a,e,t){if(a&&e){let n=0;for(let i=0,r=a.length;i<=r;i++){const s=a[i],o=e[i+n];s&&o&&s.index===o.index&&s.fragment.sn===o.fragment.sn?t(s,o):n--}}}function ta(a,e,t){const n=e.skippedSegments,i=Math.max(a.startSN,e.startSN)-e.startSN,r=(a.fragmentHint?1:0)+(n?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,s=e.startSN-a.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let u=i;u<=r;u++){const h=c[s+u];let f=o[u];if(n&&!f&&h&&(f=e.fragments[u]=h),h&&f){t(h,f,u,o);const v=h.relurl,R=f.relurl;if(v&&Fr(v,R)){e.playlistParsingError=bs(`media sequence mismatch ${f.sn}:`,a,e,h,f);return}else if(h.cc!==f.cc){e.playlistParsingError=bs(`discontinuity sequence mismatch (${h.cc}!=${f.cc})`,a,e,h,f);return}}}}function bs(a,e,t,n,i){return new Error(`${a} ${i.url}
|
|
Playlist starting @${e.startSN}
|
|
${e.m3u8}
|
|
|
|
Playlist starting @${t.startSN}
|
|
${t.m3u8}`)}function Ss(a,e,t=!0){const n=e.startSN+e.skippedSegments-a.startSN,i=a.fragments,r=n>=0;let s=0;if(r&&n<i.length)s=i[n].start;else if(r&&e.startSN===a.endSN+1)s=a.fragmentEnd;else if(r&&t)s=a.fragmentStart+n*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)s=a.fragmentStart;else return;es(e,s)}function es(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 ri(a,e=1/0){let t=1e3*a.targetduration;if(a.updated){const n=a.fragments;if(n.length&&t*4>e){const r=n[n.length-1].duration*1e3;r<t&&(t=r)}}else t/=2;return Math.round(t)}function Wn(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 qn(a,e,t){return a?Ai(a.partList,e,t):null}function Ai(a,e,t){if(a)for(let n=a.length;n--;){const i=a[n];if(i.index===t&&i.fragment.sn===e)return i}return null}function Ri(a){a.forEach((e,t)=>{var n;(n=e.details)==null||n.fragments.forEach(i=>{i.level=t,i.initSegment&&(i.initSegment.level=t)})})}function Fr(a,e){return a!==e&&e?$r(a)!==$r(e):!1}function $r(a){return a.replace(/\?[^?]*$/,"")}function Cr(a,e){for(let n=0,i=a.length;n<i;n++){var t;if(((t=a[n])==null?void 0:t.cc)===e)return a[n]}return null}function xs(a,e){return!!(a&&e.startCC<a.endCC&&e.endCC>a.startCC)}function ts(a,e){const t=a.start+e;a.startPTS=t,a.setStart(t),a.endPTS=t+a.duration}function xr(a,e){const t=e.fragments;for(let n=0,i=t.length;n<i;n++)ts(t[n],a);e.fragmentHint&&ts(e.fragmentHint,a),e.alignedSliding=!0}function ns(a,e){a&&(Ts(e,a),e.alignedSliding||ws(e,a),!e.alignedSliding&&!e.skippedSegments&&Ss(a,e,!1))}function Ts(a,e){if(!xs(e,a))return;const t=Math.min(e.endCC,a.endCC),n=Cr(e.fragments,t),i=Cr(a.fragments,t);if(!n||!i)return;ae.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const r=n.start-i.start;xr(r,a)}function ws(a,e){if(!a.hasProgramDateTime||!e.hasProgramDateTime)return;const t=a.fragments,n=e.fragments;if(!t.length||!n.length)return;let i,r;const s=Math.min(e.endCC,a.endCC);e.startCC<s&&a.startCC<s&&(i=Cr(n,s),r=Cr(t,s)),(!i||!r)&&(i=n[Math.floor(n.length/2)],r=Cr(t,i.cc)||t[Math.floor(t.length/2)]);const o=i.programDateTime,c=r.programDateTime;if(!o||!c)return;const u=(c-o)/1e3-(r.start-i.start);xr(u,a)}function ki(a,e,t){Ni(a,e,t),a.addEventListener(e,t)}function Ni(a,e,t){a.removeEventListener(e,t)}const wl={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}},yt={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 na extends zi{constructor(e,t,n,i,r){super(i,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=yt.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:s,fragCurrent:o,media:c,mediaBuffer:u,state:h}=this,f=c?c.currentTime:0,v=bn.bufferInfo(u||c,f,s.maxBufferHole),R=!v.len;if(this.log(`Media seeking to ${x(f)?f.toFixed(3):f}, state: ${h}, ${R?"out of":"in"} buffer`),this.state===yt.ENDED)this.resetLoadingState();else if(o){const I=s.maxFragLookUpTolerance,q=o.start-I,J=o.start+o.duration+I;if(R||J<v.start||q>v.end){const pe=f>J;(f<q||pe)&&(pe&&o.loader&&(this.log(`Cancelling fragment load for seek (sn: ${o.sn})`),o.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(c){this.fragmentTracker.removeFragmentsInRange(f,1/0,this.playlistType,!0);const I=this.lastCurrentTime;if(f>I&&(this.lastCurrentTime=f),!this.loadingParts){const q=Math.max(v.end,f),J=this.shouldLoadParts(this.getLevelDetails(),q);J&&(this.log(`LL-Part loading ON after seeking to ${f.toFixed(2)} with buffer @${q.toFixed(2)}`),this.loadingParts=J)}}this.hls.hasEnoughToStart||(this.log(`Setting ${R?"startPosition":"nextLoadPosition"} to ${f} for seek without enough to start`),this.nextLoadPosition=f,R&&(this.startPosition=f)),R&&this.state===yt.IDLE&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=r,this.hls=e,this.fragmentLoader=new fi(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new gi(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===yt.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=yt.STOPPED}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return t===-1&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const n=e.end||0,i=this.config.timelineOffset||0;if(n<=i)return!1;const r=e.buffered;this.config.maxBufferHole&&r&&r.length>1&&(e=bn.bufferedInfo(r,e.start,0));const s=e.nextStart;if(s&&s>i&&s<t.edge||this.media.currentTime<e.start)return!1;const c=t.partList;if(c!=null&&c.length){const h=c[c.length-1];return bn.isBuffered(this.media,h.start+h.duration/2)}const u=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(u)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null)return this.levelLastLoaded.details}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;ki(n,"seeking",this.onMediaSeeking),ki(n,"ended",this.onMediaEnded);const i=this.config;this.levels&&i.autoStartLoad&&this.state===yt.STOPPED&&this.startLoad(i.startPosition)}onMediaDetaching(e,t){const n=!!t.transferMedia,i=this.media;if(i!==null){if(i.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),Ni(i,"seeking",this.onMediaSeeking),Ni(i,"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=yt.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this.startFragRequested=!0,this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const i=r=>{const s=r.frag;if(this.fragContextChanged(s)){this.warn(`${s.type} sn: ${s.sn}${r.part?" part: "+r.part.index:""} of ${this.fragInfo(s,!1,r.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(s);return}s.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(e,t,n,i).then(r=>{if(!r)return;const s=this.state,o=r.frag;if(this.fragContextChanged(o)){(s===yt.FRAG_LOADING||!this.fragCurrent&&s===yt.PARSING)&&(this.fragmentTracker.removeFragment(o),this.state=yt.IDLE);return}"payload"in r&&(this.log(`Loaded ${o.type} sn: ${o.sn} of ${this.playlistLabel()} ${o.level}`),this.hls.trigger(p.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===yt.STOPPED||this.state===yt.ERROR||(this.warn(`Frag error: ${(r==null?void 0:r.message)||r}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===en.APPENDING){const r=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,r),o=Math.max(e.duration,s?s.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.sn:0)===1||this.reduceMaxBufferLength(o,e.duration))&&n.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===en.PARTIAL&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(t==null?void 0:t.live)&&t.type!=="EVENT"&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:n};this.hls.trigger(p.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{const i=n==null?void 0:n.frag;if(!i||this.fragContextChanged(i)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:i}=this,{frag:r,payload:s}=n,o=r.decryptdata;if(s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&Pi(o.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer,ur(o.method)).catch(u=>{throw i.trigger(p.ERROR,{type:ue.MEDIA_ERROR,details:G.FRAG_DECRYPT_ERROR,fatal:!1,error:u,reason:u.message,frag:r}),u}).then(u=>{const h=self.performance.now();return i.trigger(p.FRAG_DECRYPTED,{frag:r,payload:u,stats:{tstart:c,tdecrypt:h}}),n.payload=u,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===yt.STOPPED||this.state===yt.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!==yt.STOPPED&&(this.state=yt.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()}unhandledEncryptionError(e,t){var n,i;const r=e.tracks;if(r&&!t.encrypted&&((n=r.audio)!=null&&n.encrypted||(i=r.video)!=null&&i.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const s=this.media,o=new Error(`Encrypted track with no key in ${this.fragInfo(t)} (media ${s?"attached mediaKeys: "+s.mediaKeys:"detached"})`);return this.warn(o.message),!s||s.mediaKeys?!1:(this.hls.trigger(p.ERROR,{type:ue.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_NO_KEYS,fatal:!1,error:o,frag:t}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const 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?wl.toString(bn.getBuffered(n)):"(detached)"})`),be(e)){var i;if(e.type!==ne.SUBTITLE){const s=e.elementaryStreams;if(!Object.keys(s).some(o=>!!s[o])){this.state=yt.IDLE;return}}const r=(i=this.levels)==null?void 0:i[e.level];r!=null&&r.fragmentError&&(this.log(`Resetting level fragment error count of ${r.fragmentError} on frag buffered`),r.fragmentError=0)}this.state=yt.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:i,partsLoaded:r}=e,s=!r||r.length===0||r.some(c=>!c),o=new $i(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!s);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,i){var r;this.fragCurrent=e;const s=t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let o=null;if(e.encrypted&&!((r=e.decryptdata)!=null&&r.key)){if(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=yt.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(v=>{if(!this.fragContextChanged(v.frag))return this.hls.trigger(p.KEY_LOADED,v),this.state===yt.KEY_LOADING&&(this.state=yt.IDLE),v}),this.hls.trigger(p.KEY_LOADING,{frag:e}),this.fragCurrent===null)return this.log("context changed in KEY_LOADING"),Promise.resolve(null)}else e.encrypted||(o=this.keyLoader.loadClear(e,s.encryptedFragments,this.startFragRequested),o&&this.log("[eme] blocking frag load until media-keys acquired"));const c=this.fragPrevious;if(be(e)&&(!c||e.sn!==c.sn)){const v=this.shouldLoadParts(t.details,e.end);v!==this.loadingParts&&(this.log(`LL-Part loading ${v?"ON":"OFF"} loading sn ${c==null?void 0:c.sn}->${e.sn}`),this.loadingParts=v)}if(n=Math.max(e.start,n||0),this.loadingParts&&be(e)){const v=s.partList;if(v&&i){n>s.fragmentEnd&&s.fragmentHint&&(e=s.fragmentHint);const R=this.getNextPart(v,e,n);if(R>-1){const I=v[R];e=this.fragCurrent=I.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${I.index} (${R}/${v.length-1}) of ${this.fragInfo(e,!1,I)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=I.start+I.duration,this.state=yt.FRAG_LOADING;let q;return o?q=o.then(J=>!J||this.fragContextChanged(J.frag)?null:this.doFragPartsLoad(e,I,t,i)).catch(J=>this.handleFragLoadError(J)):q=this.doFragPartsLoad(e,I,t,i).catch(J=>this.handleFragLoadError(J)),this.hls.trigger(p.FRAG_LOADING,{frag:e,part:I,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):q}else if(!e.url||this.loadedEndOfParts(v,n))return Promise.resolve(null)}}if(be(e)&&this.loadingParts){var u;this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${(u=s.partList)==null?void 0:u.filter(v=>v.loaded).map(v=>`[${v.start}-${v.end}]`)}`),this.loadingParts=!1}else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${"["+s.startSN+"-"+s.endSN+"]"}, target: ${parseFloat(n.toFixed(3))}`),x(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=yt.FRAG_LOADING;const h=this.config.progressive&&e.type!==ne.SUBTITLE;let f;return h&&o?f=o.then(v=>!v||this.fragContextChanged(v.frag)?null:this.fragmentLoader.load(e,i)).catch(v=>this.handleFragLoadError(v)):f=Promise.all([this.fragmentLoader.load(e,h?i:void 0),o]).then(([v])=>(!h&&i&&i(v),v)).catch(v=>this.handleFragLoadError(v)),this.hls.trigger(p.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):f}doFragPartsLoad(e,t,n,i){return new Promise((r,s)=>{var o;const c=[],u=(o=n.details)==null?void 0:o.partList,h=f=>{this.fragmentLoader.loadPart(e,f,i).then(v=>{c[f.index]=v;const R=v.part;this.hls.trigger(p.FRAG_LOADED,v);const I=qn(n.details,e.sn,f.index+1)||Ai(u,e.sn,f.index+1);if(I)h(I);else return r({frag:e,part:R,partsLoaded:c})}).catch(s)};h(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;t.frag&&t.details===G.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):t.frag&&t.type===ue.KEY_SYSTEM_ERROR?(t.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(t.frag)):this.hls.trigger(p.ERROR,t)}else this.hls.trigger(p.ERROR,{type:ue.OTHER_ERROR,details:G.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==yt.PARSING){!this.fragCurrent&&this.state!==yt.STOPPED&&this.state!==yt.ERROR&&(this.state=yt.IDLE);return}const{frag:n,part:i,level:r}=t,s=self.performance.now();n.stats.parsing.end=s,i&&(i.stats.parsing.end=s);const o=this.getLevelDetails(),u=o&&n.sn>o.endSN||this.shouldLoadParts(o,n.end);u!==this.loadingParts&&(this.log(`LL-Part loading ${u?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=u),this.updateLevelTiming(n,i,r,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){var n;const r=e.partList[0];if(r.fragment.type===ne.SUBTITLE)return!1;const s=r.end+(((n=e.fragmentHint)==null?void 0:n.duration)||0);if(t>=s){var i;if((this.hls.hasEnoughToStart?((i=this.media)==null?void 0:i.currentTime)||this.lastCurrentTime:this.getLoadPosition())>r.start-r.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:i,sn:r,part:s}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${r} of ${this.playlistLabel()} ${i}. The current chunk will not be buffered.`),null;const o=t[i],c=o.details,u=s>-1?qn(c,r,s):null,h=u?u.fragment:Wn(c,r,n);return h?(n&&n!==h&&(h.stats=n.stats),{frag:h,part:u,level:o}):null}bufferFragmentData(e,t,n,i,r){if(this.state!==yt.PARSING)return;const{data1:s,data2:o}=e;let c=s;if(o&&(c=Ye(s,o)),!c.length)return;const u=this.initPTS[t.cc],h=u?-u.baseTime/u.timescale:void 0,f={type:e.type,frag:t,part:n,chunkMeta:i,offset:h,parent:t.type,data:c};if(this.hls.trigger(p.BUFFER_APPENDING,f),e.dropped&&e.independent&&!n){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!bn.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,i=bn.bufferInfo(t,n,0),r=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),o=Math.max(Math.min(e.start-s,i.end-s),n+s);e.start-o>s&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){var n;const i=this.getLoadPosition();if(!x(i))return null;const s=this.lastCurrentTime>i||(n=this.media)!=null&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,i,t,s)}getFwdBufferInfoAtPos(e,t,n,i){const r=bn.bufferInfo(e,t,i);if(r.len===0&&r.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,n);if(s&&(r.nextStart<=s.end||s.gap)){const o=Math.max(Math.min(r.nextStart,s.end)-t,i);return bn.bufferInfo(e,t,o)}}return r}getMaxBufferLength(e){const{config:t}=this;let n;return e?n=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):n=t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const n=this.config,i=Math.max(Math.min(e-t,n.maxBufferLength),t),r=Math.max(e-t*3,n.maxMaxBufferLength/2,i);return r>=i?(n.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=ne.MAIN){const n=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const n=t.fragments,i=n.length;if(!i)return null;const{config:r}=this,s=n[0].start,o=r.lowLatencyMode&&!!t.partList;let c=null;if(t.live){const f=r.initialLiveManifestSize;if(i<f)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${f})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s){var u;o&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),c=this.getInitialLiveFragment(t);const v=this.hls.startPosition,R=this.hls.liveSyncPosition,I=c?(v!==-1&&v>=s?v:R)||c.start:e;this.log(`Setting startPosition to ${I} to match start frag at live edge. mainStart: ${v} liveSyncPosition: ${R} frag.start: ${(u=c)==null?void 0:u.start}`),this.startPosition=this.nextLoadPosition=I}}else e<=s&&(c=n[0]);if(!c){const f=this.loadingParts?t.partEnd:t.fragmentEnd;c=this.getFragmentAtPosition(e,f,t)}let h=this.filterReplacedPrimary(c,t);if(!h&&c){const f=c.sn-t.startSN;h=this.filterReplacedPrimary(n[f+1]||null,t)}return this.mapToInitFragWhenRequired(h)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===en.OK||n===en.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,i,r){let s=null;if(e.gap&&(s=this.getNextFragment(this.nextLoadPosition,t),s&&!s.gap&&n.nextStart)){const o=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i,0);if(o!==null&&n.len+o.len>=r){const c=s.sn;return this.loopSn!==c&&(this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${c}`),this.loopSn=c),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(Ha(this.config)){var e;if((e=this.hls.interstitialsManager)==null||(e=e.playingItem)==null?void 0:e.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(Ha(this.config)&&e.type!==ne.SUBTITLE){const n=this.hls.interstitialsManager,i=n==null?void 0:n.bufferingItem;if(i){const s=i.event;if(s){if(s.appendInPlace||Math.abs(e.start-i.start)>1||i.start===0)return null}else if(e.end<=i.start&&(t==null?void 0:t.live)===!1||e.start>i.end&&i.nextEvent&&(i.nextEvent.appendInPlace||e.start-i.end>1))return null}const r=n==null?void 0:n.playerQueue;if(r)for(let s=r.length;s--;){const o=r[s].interstitial;if(o.appendInPlace&&e.start>=o.startTime&&e.end<=o.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!e.initSegment.data&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,n){let i=-1,r=!1,s=!0;for(let o=0,c=e.length;o<c;o++){const u=e[o];if(s=s&&!u.independent,i>-1&&n<u.start)break;const h=u.loaded;h?i=-1:(r||(u.independent||s)&&u.fragment===t)&&(u.fragment!==t&&this.warn(`Need buffer at ${n} but next unloaded part starts at ${u.start}`),i=o),r=h}return i}loadedEndOfParts(e,t){let n;for(let i=e.length;i--;){if(n=e[i],!n.loaded)return!1;if(t>n.start)return!0}return!1}getInitialLiveFragment(e){const t=e.fragments,n=this.fragPrevious;let i=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),i=yn(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const r=n.sn+1;if(r>=e.startSN&&r<=e.endSN){const s=t[r-e.startSN];n.cc===s.cc&&(i=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=Dn(e,n.cc,n.end),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const r=this.hls.liveSyncPosition;r!==null&&(i=this.getFragmentAtPosition(r,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,n){const{config:i}=this;let{fragPrevious:r}=this,{fragments:s,endSN:o}=n;const{fragmentHint:c}=n,{maxFragLookUpTolerance:u}=i,h=n.partList,f=!!(this.loadingParts&&h!=null&&h.length&&c);f&&!this.bitrateTest&&h[h.length-1].fragment.sn===c.sn&&(s=s.concat(c),o=c.sn);let v;if(e<t){var R;const q=e<this.lastCurrentTime||e>t-u||(R=this.media)!=null&&R.paused||!this.startFragRequested?0:u;v=Rn(r,s,e,q)}else v=s[s.length-1];if(v){const I=v.sn-n.startSN,q=this.fragmentTracker.getState(v);if((q===en.OK||q===en.PARTIAL&&v.gap)&&(r=v),r&&v.sn===r.sn&&(!f||h[0].fragment.sn>v.sn||!n.live)&&v.level===r.level){const pe=s[I+1];v.sn<o&&this.fragmentTracker.getState(pe)!==en.OK?v=pe:v=null}}return v}alignPlaylists(e,t,n){const i=e.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const r=e.fragmentStart,s=!t,o=e.alignedSliding&&x(r);if(s||!o&&!r){ns(n,e);const c=e.fragmentStart;return this.log(`Live playlist sliding: ${c.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${i}`),c}return r}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;n<t&&(n=-1);const i=this.timelineOffset;if(n===-1){const r=this.startTimeOffset!==null,s=r?this.startTimeOffset:e.startTimeOffset;s!==null&&x(s)?(n=t+s,s<0&&(n+=e.edge),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${s} found in ${r?"multivariant":"media"} playlist`),this.startPosition=n):e.live?(n=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=n=0),this.lastCurrentTime=n+i}this.nextLoadPosition=n+i}getLoadPosition(){var e;const{media:t}=this;let n=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?n=t.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&be(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==yt.FRAG_LOADING_WAITING_RETRY)&&(this.state=yt.IDLE)}onFragmentOrKeyLoadError(e,t){var n;if(t.chunkMeta&&!t.frag){const pe=this.getCurrentContext(t.chunkMeta);pe&&(t.frag=pe.frag)}const i=t.frag;if(!i||i.type!==e||!this.levels)return;if(this.fragContextChanged(i)){var r;this.warn(`Frag load error must match current frag to retry ${i.url} > ${(r=this.fragCurrent)==null?void 0:r.url}`);return}const s=t.details===G.FRAG_GAP;s&&this.fragmentTracker.fragBuffered(i,!0);const o=t.errorAction;if(!o){this.state=yt.ERROR;return}const{action:c,flags:u,retryCount:h=0,retryConfig:f}=o,v=!!f,R=v&&c===Cn.RetryRequest,I=v&&!o.resolved&&u===kn.MoveAllAlternatesMatchingHost,q=(n=this.hls.latestLevelDetails)==null?void 0:n.live;if(!R&&I&&be(i)&&!i.endList&&q&&!Gn(t))this.resetFragmentErrors(e),this.treatAsGap(i),o.resolved=!0;else if((R||I)&&h<f.maxNumRetry){var J;const pe=ei((J=t.response)==null?void 0:J.code),_e=Zn(f,h);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+_e,this.state=yt.FRAG_LOADING_WAITING_RETRY,o.resolved=!0,pe){this.log("Waiting for connection (offline)"),this.retryDate=1/0,t.reason="offline";return}this.warn(`Fragment ${i.sn} of ${e} ${i.level} errored with ${t.details}, retrying loading ${h+1}/${f.maxNumRetry} in ${_e}ms`)}else if(f)if(this.resetFragmentErrors(e),h<f.maxNumRetry)!s&&c!==Cn.RemoveAlternatePermanently&&(o.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${h})`);return}else c===Cn.SendAlternateToPenaltyBox?this.state=yt.WAITING_LEVEL:this.state=yt.ERROR;this.tickImmediate()}checkRetryDate(){const e=self.performance.now(),t=this.retryDate,n=t===1/0;(!t||e>=t||n&&!ei(0))&&(n&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=yt.IDLE)}reduceLengthAndFlushBuffer(e){if(this.state===yt.PARSING||this.state===yt.PARSED){const t=e.frag,n=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,n),r=i&&i.len>.5;r&&this.reduceMaxBufferLength(i.len,(t==null?void 0:t.duration)||10);const s=!r;return s&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===ne.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==yt.STOPPED&&(this.state=yt.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const i=bn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===yt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==yt.STOPPED&&(this.state=yt.IDLE)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=this.levelLastLoaded,t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.log(`Loading context changed while buffering sn ${e.sn} of ${this.playlistLabel()} ${e.level===-1?"<removed>":e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,i){const r=n.details;if(!r){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((c,u)=>{const h=e.elementaryStreams[u];if(h){const f=h.endPTS-h.startPTS;if(f<=0)return this.warn(`Could not parse fragment ${e.sn} ${u} duration reliably (${f})`),c||!1;const v=i?0:ys(r,e,h.startPTS,h.endPTS,h.startDTS,h.endDTS,this);return this.hls.trigger(p.LEVEL_PTS_UPDATED,{details:r,level:n,drift:v,type:u,frag:e,start:h.startPTS,end:h.endPTS}),!0}return c},!1)){var o;const c=((o=this.transmuxer)==null?void 0:o.error)===null;if((n.fragmentError===0||c&&(n.fragmentError<2||e.endList))&&this.treatAsGap(e,n),c){const u=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(u.message),this.hls.trigger(p.ERROR,{type:ue.MEDIA_ERROR,details:G.FRAG_PARSING_ERROR,fatal:!1,error:u,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=yt.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===ne.MAIN?"level":"track"}fragInfo(e,t=!0,n){var i,r;return`${this.playlistLabel()} ${e.level} (${n?"part":"frag"}:[${((i=t&&!n?e.startPTS:(n||e).start)!=null?i:NaN).toFixed(3)}-${((r=t&&!n?e.endPTS:(n||e).end)!=null?r:NaN).toFixed(3)}]${n&&e.type==="main"?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function Ha(a){return!!a.interstitialsController&&a.enableInterstitialPlayback!==!1}class za{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=Al(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function Al(a,e){const t=new Uint8Array(e);let n=0;for(let i=0;i<a.length;i++){const r=a[i];t.set(r,n),n+=r.length}return t}var ia={exports:{}},Wa;function Rl(){return Wa||(Wa=1,function(a){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(c,u,h){this.fn=c,this.context=u,this.once=h||!1}function r(c,u,h,f,v){if(typeof h!="function")throw new TypeError("The listener must be a function");var R=new i(h,f||c,v),I=t?t+u:u;return c._events[I]?c._events[I].fn?c._events[I]=[c._events[I],R]:c._events[I].push(R):(c._events[I]=R,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],h,f;if(this._eventsCount===0)return u;for(f in h=this._events)e.call(h,f)&&u.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(h)):u},o.prototype.listeners=function(u){var h=t?t+u:u,f=this._events[h];if(!f)return[];if(f.fn)return[f.fn];for(var v=0,R=f.length,I=new Array(R);v<R;v++)I[v]=f[v].fn;return I},o.prototype.listenerCount=function(u){var h=t?t+u:u,f=this._events[h];return f?f.fn?1:f.length:0},o.prototype.emit=function(u,h,f,v,R,I){var q=t?t+u:u;if(!this._events[q])return!1;var J=this._events[q],pe=arguments.length,_e,ye;if(J.fn){switch(J.once&&this.removeListener(u,J.fn,void 0,!0),pe){case 1:return J.fn.call(J.context),!0;case 2:return J.fn.call(J.context,h),!0;case 3:return J.fn.call(J.context,h,f),!0;case 4:return J.fn.call(J.context,h,f,v),!0;case 5:return J.fn.call(J.context,h,f,v,R),!0;case 6:return J.fn.call(J.context,h,f,v,R,I),!0}for(ye=1,_e=new Array(pe-1);ye<pe;ye++)_e[ye-1]=arguments[ye];J.fn.apply(J.context,_e)}else{var Me=J.length,Ge;for(ye=0;ye<Me;ye++)switch(J[ye].once&&this.removeListener(u,J[ye].fn,void 0,!0),pe){case 1:J[ye].fn.call(J[ye].context);break;case 2:J[ye].fn.call(J[ye].context,h);break;case 3:J[ye].fn.call(J[ye].context,h,f);break;case 4:J[ye].fn.call(J[ye].context,h,f,v);break;default:if(!_e)for(Ge=1,_e=new Array(pe-1);Ge<pe;Ge++)_e[Ge-1]=arguments[Ge];J[ye].fn.apply(J[ye].context,_e)}}return!0},o.prototype.on=function(u,h,f){return r(this,u,h,f,!1)},o.prototype.once=function(u,h,f){return r(this,u,h,f,!0)},o.prototype.removeListener=function(u,h,f,v){var R=t?t+u:u;if(!this._events[R])return this;if(!h)return s(this,R),this;var I=this._events[R];if(I.fn)I.fn===h&&(!v||I.once)&&(!f||I.context===f)&&s(this,R);else{for(var q=0,J=[],pe=I.length;q<pe;q++)(I[q].fn!==h||v&&!I[q].once||f&&I[q].context!==f)&&J.push(I[q]);J.length?this._events[R]=J.length===1?J[0]:J:s(this,R)}return this},o.prototype.removeAllListeners=function(u){var h;return u?(h=t?t+u:u,this._events[h]&&s(this,h)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,a.exports=o}(ia)),ia.exports}var Il=Rl(),ra=z(Il);const is="1.6.15",Ur={};function Ll(){return typeof __HLS_WORKER_BUNDLE__=="function"}function Cl(){const a=Ur[is];if(a)return a.clientCount++,a;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e),i={worker:new self.Worker(t),objectURL:t,clientCount:1};return Ur[is]=i,i}function Dl(a){const e=Ur[a];if(e)return e.clientCount++,e;const t=new self.URL(a,self.location.href).href,i={worker:new self.Worker(t),scriptURL:t,clientCount:1};return Ur[a]=i,i}function Ol(a){const e=Ur[a||is];if(e&&e.clientCount--===1){const{worker:n,objectURL:i}=e;delete Ur[a||is],i&&self.URL.revokeObjectURL(i),n.terminate()}}function Za(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 sa(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 rs(a,e){const t=e;let n=0;for(;sa(a,e);){n+=10;const i=As(a,e+6);n+=i,Za(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)}function Pl(a,e,t,n){const i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],r=e[t+2],s=r>>2&15;if(s>12){const R=new Error(`invalid ADTS sampling index:${s}`);a.emit(p.ERROR,p.ERROR,{type:ue.MEDIA_ERROR,details:G.FRAG_PARSING_ERROR,fatal:!0,error:R,reason:R.message});return}const o=(r>>6&3)+1,c=e[t+3]>>6&3|(r&1)<<2,u="mp4a.40."+o,h=i[s];let f=s;(o===5||o===29)&&(f-=3);const v=[o<<3|(f&14)>>1,(f&1)<<7|c<<3];return ae.log(`manifest codec:${n}, parsed codec:${u}, channels:${c}, rate:${h} (ADTS object type:${o} sampling index:${s})`),{config:v,samplerate:h,channelCount:c,codec:u,parsedCodec:u,manifestCodec:n}}function Ya(a,e){return a[e]===255&&(a[e+1]&246)===240}function Xa(a,e){return a[e+1]&1?7:9}function aa(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function kl(a,e){return e+5<a.length}function Rs(a,e){return e+1<a.length&&Ya(a,e)}function Ml(a,e){return kl(a,e)&&Ya(a,e)&&aa(a,e)<=a.length-e}function Nl(a,e){if(Rs(a,e)){const t=Xa(a,e);if(e+t>=a.length)return!1;const n=aa(a,e);if(n<=t)return!1;const i=e+n;return i===a.length||Rs(a,i)}return!1}function Qa(a,e,t,n,i){if(!a.samplerate){const r=Pl(e,t,n,i);if(!r)return;m(a,r)}}function Ja(a){return 1024*9e4/a}function Bl(a,e){const t=Xa(a,e);if(e+t<=a.length){const n=aa(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function qa(a,e,t,n,i){const r=Ja(a.samplerate),s=n+i*r,o=Bl(e,t);let c;if(o){const{frameLength:f,headerLength:v}=o,R=v+f,I=Math.max(0,t+R-e.length);I?(c=new Uint8Array(R-v),c.set(e.subarray(t+v,e.length),0)):c=e.subarray(t+v,t+R);const q={unit:c,pts:s};return I||a.samples.push(q),{sample:q,length:R,missing:I}}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 Fl(a,e){return sa(a,e)&&As(a,e+6)+10<=a.length-e}function $l(a){return a instanceof ArrayBuffer?a:a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer}function oa(a,e=0,t=1/0){return Ul(a,e,t,Uint8Array)}function Ul(a,e,t,n){const i=Kl(a);let r=1;"BYTES_PER_ELEMENT"in n&&(r=n.BYTES_PER_ELEMENT);const s=Gl(a)?a.byteOffset:0,o=(s+a.byteLength)/r,c=(s+e)/r,u=Math.floor(Math.max(0,Math.min(c,o))),h=Math.floor(Math.min(u+Math.max(t,0),o));return new n(i,u,h-u)}function Kl(a){return a instanceof ArrayBuffer?a:a.buffer}function Gl(a){return a&&a.buffer instanceof ArrayBuffer&&a.byteLength!==void 0&&a.byteOffset!==void 0}function Vl(a){const e={key:a.type,description:"",data:"",mimeType:null,pictureType:null},t=3;if(a.size<2)return;if(a.data[0]!==t){console.log("Ignore frame with unrecognized character encoding");return}const n=a.data.subarray(1).indexOf(0);if(n===-1)return;const i=je(oa(a.data,1,n)),r=a.data[2+n],s=a.data.subarray(3+n).indexOf(0);if(s===-1)return;const o=je(oa(a.data,3+n,s));let c;return i==="-->"?c=je(oa(a.data,4+n+s)):c=$l(a.data.subarray(4+n+s)),e.mimeType=i,e.pictureType=r,e.description=o,e.data=c,e}function jl(a){if(a.size<2)return;const e=je(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}}function Hl(a){if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=je(a.data.subarray(t),!0);t+=n.length+1;const i=je(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=je(a.data.subarray(1));return{key:a.type,info:"",data:e}}function zl(a){if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=je(a.data.subarray(t),!0);t+=n.length+1;const i=je(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=je(a.data);return{key:a.type,info:"",data:e}}function Wl(a){return a.type==="PRIV"?jl(a):a.type[0]==="W"?zl(a):a.type==="APIC"?Vl(a):Hl(a)}function Zl(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 Is=10,Yl=10;function eo(a){let e=0;const t=[];for(;sa(a,e);){const n=As(a,e+6);a[e+5]>>6&1&&(e+=Is),e+=Is;const i=e+n;for(;e+Yl<i;){const r=Zl(a.subarray(e)),s=Wl(r);s&&t.push(s),e+=r.size+Is}Za(a,e)&&(e+=Is)}return t}function to(a){return a&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp"}function Xl(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 la(a){const e=eo(a);for(let t=0;t<e.length;t++){const n=e[t];if(to(n))return Xl(n)}}let Vi=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 dr(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class ua{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,n,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&(e=Ye(this.cachedData,e),this.cachedData=null);let n=rs(e,0),i=n?n.length:0,r;const s=this._audioTrack,o=this._id3Track,c=n?la(n):void 0,u=e.length;for((this.basePTS===null||this.frameIndex===0&&x(c))&&(this.basePTS=Ql(c,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Vi.audioId3,duration:Number.POSITIVE_INFINITY});i<u;){if(this.canParse(e,i)){const h=this.appendFrame(s,e,i);h?(this.frameIndex++,this.lastPTS=h.sample.pts,i+=h.length,r=i):i=u}else Fl(e,i)?(n=rs(e,i),o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Vi.audioId3,duration:Number.POSITIVE_INFINITY}),i+=n.length,r=i):i++;if(i===u&&r!==u){const h=e.slice(r);this.cachedData?this.cachedData=Ye(this.cachedData,h):this.cachedData=h}}return{audioTrack:s,videoTrack:dr(),id3Track:o,textTrack:dr()}}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:dr(),id3Track:this._id3Track,textTrack:dr()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const Ql=(a,e,t)=>{if(x(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};let Ls=null;const Jl=[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],ql=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],eu=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],tu=[0,1,1,4];function no(a,e,t,n,i){if(t+24>e.length)return;const r=io(e,t);if(r&&t+r.frameLength<=e.length){const s=r.samplesPerFrame*9e4/r.sampleRate,o=n+i*s,c={unit:e.subarray(t,t+r.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(c),{sample:c,length:r.frameLength,missing:0}}}function io(a,e){const t=a[e+1]>>3&3,n=a[e+1]>>1&3,i=a[e+2]>>4&15,r=a[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&r!==3){const s=a[e+2]>>1&1,o=a[e+3]>>6,c=t===3?3-n:n===3?3:4,u=Jl[c*14+i-1]*1e3,f=ql[(t===3?0:t===2?1:2)*3+r],v=o===3?1:2,R=eu[t][n],I=tu[n],q=R*8*I,J=Math.floor(R*u/f+s)*I;if(Ls===null){const ye=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ls=ye?parseInt(ye[1]):0}return!!Ls&&Ls<=87&&n===2&&u>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:f,channelCount:v,frameLength:J,samplesPerFrame:q}}}function ca(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function ro(a,e){return e+1<a.length&&ca(a,e)}function nu(a,e){return ca(a,e)&&4<=a.length-e}function so(a,e){if(e+1<a.length&&ca(a,e)){const n=io(a,e);let i=4;n!=null&&n.frameLength&&(i=n.frameLength);const r=e+i;return r===a.length||ro(a,r)}return!1}class iu extends ua{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const n=rs(e,0);let i=(n==null?void 0:n.length)||0;if(so(e,i))return!1;for(let r=e.length;i<r;i++)if(Nl(e,i))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return Ml(e,t)}appendFrame(e,t,n){Qa(e,this.observer,t,n,e.manifestCodec);const i=qa(e,t,n,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const ao=(a,e)=>{let t=0,n=5;e+=n;const i=new Uint32Array(1),r=new Uint32Array(1),s=new Uint8Array(1);for(;n>0;){s[0]=a[e];const o=Math.min(n,8),c=8-o;r[0]=4278190080>>>24+c<<c,i[0]=(s[0]&r[0])>>c,t=t?t<<o|i[0]:i[0],e+=1,n-=o}return t};class ru extends ua{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const i=oo(e,t,n,this.basePTS,this.frameIndex);if(i!==-1)return{sample:e.samples[e.samples.length-1],length:i,missing:0}}static probe(e){if(!e)return!1;const t=rs(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&la(t)!==void 0&&ao(e,n)<16}}function oo(a,e,t,n,i){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const r=e[t+4]>>6;if(r>=3)return-1;const o=[48e3,44100,32e3][r],c=e[t+4]&63,h=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][c*3+r]*2;if(t+h>e.length)return-1;const f=e[t+6]>>5;let v=0;f===2?v+=2:(f&1&&f!==1&&(v+=2),f&4&&(v+=2));const R=(e[t+6]<<8|e[t+7])>>12-v&1,q=[2,1,2,3,3,4,4,5][f]+R,J=e[t+5]>>3,pe=e[t+5]&7,_e=new Uint8Array([r<<6|J<<1|pe>>2,(pe&3)<<6|f<<3|R<<2|c>>4,c<<4&224]),ye=1536/o*9e4,Me=n+i*ye,Ge=e.subarray(t,t+h);return a.config=_e,a.channelCount=q,a.samplerate=o,a.samples.push({unit:Ge,pts:Me}),h}class su extends ua{resetInitSegment(e,t,n,i){super.resetInitSegment(e,t,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=rs(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&la(t)!==void 0&&ao(e,n)<=16)return!1;for(let i=e.length;n<i;n++)if(so(e,n))return ae.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return nu(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return no(e,t,n,this.basePTS,this.frameIndex)}}const au=/\/emsg[-/]ID3/i;class ou{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,i){const r=this.videoTrack=dr("video",1),s=this.audioTrack=dr("audio",1),o=this.txtTrack=dr("text",1);if(this.id3Track=dr("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=fe(e);if(c.video){const{id:u,timescale:h,codec:f,supplemental:v}=c.video;r.id=u,r.timescale=o.timescale=h,r.codec=f,r.supplemental=v}if(c.audio){const{id:u,timescale:h,codec:f}=c.audio;s.id=u,s.timescale=h,s.codec=f}o.id=qe.text,r.sampleDuration=0,r.duration=s.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return Le(e)}demux(e,t){this.timeOffset=t;let n=e;const i=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=Ye(this.remainderData,e));const o=Ue(n);this.remainderData=o.remainder,i.samples=o.valid||new Uint8Array}else i.samples=n;const s=this.extractID3Track(i,t);return r.samples=Fe(t,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(t,this.timeOffset);return n.samples=Fe(e,t),{videoTrack:t,audioTrack:dr(),id3Track:i,textTrack:dr()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const i=re(e.samples,["emsg"]);i&&i.forEach(r=>{const s=Nt(r);if(au.test(s.schemeIdUri)){const o=lo(s,t);let c=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const u=s.payload;n.samples.push({data:u,len:u.byteLength,dts:o,pts:o,type:Vi.emsg,duration:c})}else if(this.config.enableEmsgKLVMetadata&&s.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const o=lo(s,t);n.samples.push({data:s.payload,len:s.payload.byteLength,dts:o,pts:o,type:Vi.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 lo(a,e){return x(a.presentationTime)?a.presentationTime/a.timeScale:e+a.presentationTimeDelta/a.timeScale}class lu{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new gi(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,Hn.cbc)}decryptAacSample(e,t,n){const i=e[t].unit;if(i.length<=16)return;const r=i.subarray(16,i.length-i.length%16),s=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(s).then(o=>{const c=new Uint8Array(o);i.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)}).catch(n)}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let i=0;for(let r=32;r<e.length-16;r+=160,i+=16)n.set(e.subarray(r,r+16),i);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let i=0;for(let r=32;r<e.length-16;r+=160,i+=16)e.set(n.subarray(i,i+16),r);return e}decryptAvcSample(e,t,n,i,r){const s=tt(r.data),o=this.getAvcEncryptedData(s);this.decryptBuffer(o.buffer).then(c=>{r.data=this.getAvcDecryptedUnit(s,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,i)}).catch(i)}decryptAvcSamples(e,t,n,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){i();return}const r=e[t].units;for(;!(n>=r.length);n++){const s=r[n];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,t,n,i,s),!this.decrypter.isSync()))return}}}}class uo{constructor(){this.VideoSample=null}createVideoSample(e,t,n){return{key:e,frame:!1,pts:t,dts:n,units:[],length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,i;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const r=n.units;i=r[r.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,i=n.length;if(i){const r=n[i-1];e.pts=r.pts,e.dts=r.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,n){const i=t.byteLength;let r=e.naluState||0;const s=r,o=[];let c=0,u,h,f,v=-1,R=0;for(r===-1&&(v=0,R=this.getNALuType(t,0),r=0,c=1);c<i;){if(u=t[c++],!r){r=u?0:1;continue}if(r===1){r=u?0:2;continue}if(!u)r=3;else if(u===1){if(h=c-r-1,v>=0){const I={data:t.subarray(v,h),type:R};o.push(I)}else{const I=this.getLastNalUnit(e.samples);I&&(s&&c<=4-s&&I.state&&(I.data=I.data.subarray(0,I.data.byteLength-s)),h>0&&(I.data=Ye(I.data,t.subarray(0,h)),I.state=0))}c<i?(f=this.getNALuType(t,c),v=c,R=f,r=0):r=-1}else r=0}if(v>=0&&r>=0){const I={data:t.subarray(v,i),type:R,state:r};o.push(I)}if(o.length===0){const I=this.getLastNalUnit(e.samples);I&&(I.data=Ye(I.data,t))}return e.naluState=r,o}}class ss{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,i=new Uint8Array(4),r=Math.min(4,t);if(r===0)throw new Error("no bytes available");i.set(e.subarray(n,n+r)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=r*8,this.bytesAvailable-=r}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&ae.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 uu extends uo{parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let s=this.VideoSample,o,c=!1;n.data=null,s&&r.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach(u=>{var h,f;switch(u.type){case 1:{let q=!1;o=!0;const J=u.data;if(c&&J.length>4){const pe=this.readSliceType(J);(pe===2||pe===4||pe===7||pe===9)&&(q=!0)}if(q){var v;(v=s)!=null&&v.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.frame=!0,s.key=q;break}case 5:o=!0,(h=s)!=null&&h.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 6:{o=!0,Ie(u.data,1,n.pts,t.samples);break}case 7:{var R,I;o=!0,c=!0;const q=u.data,J=this.readSPS(q);if(!e.sps||e.width!==J.width||e.height!==J.height||((R=e.pixelRatio)==null?void 0:R[0])!==J.pixelRatio[0]||((I=e.pixelRatio)==null?void 0:I[1])!==J.pixelRatio[1]){e.width=J.width,e.height=J.height,e.pixelRatio=J.pixelRatio,e.sps=[q];const pe=q.subarray(1,4);let _e="avc1.";for(let ye=0;ye<3;ye++){let Me=pe[ye].toString(16);Me.length<2&&(Me="0"+Me),_e+=Me}e.codec=_e}break}case 8:o=!0,e.pps=[u.data];break;case 9:o=!0,e.audFound=!0,(f=s)!=null&&f.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:o=!0;break;default:o=!1;break}s&&o&&s.units.push(u)}),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new ss(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let n=8,i=8,r;for(let s=0;s<e;s++)i!==0&&(r=t.readEG(),i=(n+r+256)%256),n=i===0?n:i}readSPS(e){const t=new ss(e);let n=0,i=0,r=0,s=0,o,c,u;const h=t.readUByte.bind(t),f=t.readBits.bind(t),v=t.readUEG.bind(t),R=t.readBoolean.bind(t),I=t.skipBits.bind(t),q=t.skipEG.bind(t),J=t.skipUEG.bind(t),pe=this.skipScalingList.bind(this);h();const _e=h();if(f(5),I(3),h(),J(),_e===100||_e===110||_e===122||_e===244||_e===44||_e===83||_e===86||_e===118||_e===128){const ot=v();if(ot===3&&I(1),J(),J(),I(1),R())for(c=ot!==3?8:12,u=0;u<c;u++)R()&&(u<6?pe(16,t):pe(64,t))}J();const ye=v();if(ye===0)v();else if(ye===1)for(I(1),q(),q(),o=v(),u=0;u<o;u++)q();J(),I(1);const Me=v(),Ge=v(),dt=f(1);dt===0&&I(1),I(1),R()&&(n=v(),i=v(),r=v(),s=v());let We=[1,1];if(R()&&R())switch(h()){case 1:We=[1,1];break;case 2:We=[12,11];break;case 3:We=[10,11];break;case 4:We=[16,11];break;case 5:We=[40,33];break;case 6:We=[24,11];break;case 7:We=[20,11];break;case 8:We=[32,11];break;case 9:We=[80,33];break;case 10:We=[18,11];break;case 11:We=[15,11];break;case 12:We=[64,33];break;case 13:We=[160,99];break;case 14:We=[4,3];break;case 15:We=[3,2];break;case 16:We=[2,1];break;case 255:{We=[h()<<8|h(),h()<<8|h()];break}}return{width:Math.ceil((Me+1)*16-n*2-i*2),height:(2-dt)*(Ge+1)*16-(dt?2:4)*(r+s),pixelRatio:We}}}class cu extends uo{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,i){const r=this.parseNALu(e,n.data,i);let s=this.VideoSample,o,c=!1;n.data=null,s&&r.length&&!e.audFound&&(this.pushAccessUnit(s,e),s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach(u=>{var h,f;switch(u.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),s.frame=!0,o=!0;break;case 16:case 17:case 18:case 21:if(o=!0,c){var v;(v=s)!=null&&v.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null)}s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 19:case 20:o=!0,(h=s)!=null&&h.frame&&!s.key&&(this.pushAccessUnit(s,e),s=this.VideoSample=null),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0,s.frame=!0;break;case 39:o=!0,Ie(u.data,2,n.pts,t.samples);break;case 32:o=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=m(e.params,this.readVPS(u.data)),this.initVPS=u.data),e.vps=[u.data];break;case 33:if(o=!0,c=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],u.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const R=this.readSPS(u.data);e.width=R.width,e.height=R.height,e.pixelRatio=R.pixelRatio,e.codec=R.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const I in R.params)e.params[I]=R.params[I]}this.pushParameterSet(e.sps,u.data,e.vps),s||(s=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),s.key=!0;break;case 34:if(o=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const R=this.readPPS(u.data);for(const I in R)e.params[I]=R[I]}this.pushParameterSet(e.pps,u.data,e.vps)}break;case 35:o=!0,e.audFound=!0,(f=s)!=null&&f.frame&&(this.pushAccessUnit(s,e),s=null),s||(s=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:o=!1;break}s&&o&&s.units.push(u)}),i&&s&&(this.pushAccessUnit(s,e),this.VideoSample=null)}pushParameterSet(e,t,n){(n&&n[0]===this.initVPS||!n&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let n=0;for(let i=0;i<e.byteLength;i++)i>=2&&e[i]===3&&e[i-1]===0&&e[i-2]===0||(t[n]=e[i],n++);return new Uint8Array(t.buffer,0,n)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new ss(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const n=t.readBits(3),i=t.readBoolean();return{numTemporalLayers:n+1,temporalIdNested:i}}readSPS(e){const t=new ss(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const n=t.readBits(3);t.readBoolean();const i=t.readBits(2),r=t.readBoolean(),s=t.readBits(5),o=t.readUByte(),c=t.readUByte(),u=t.readUByte(),h=t.readUByte(),f=t.readUByte(),v=t.readUByte(),R=t.readUByte(),I=t.readUByte(),q=t.readUByte(),J=t.readUByte(),pe=t.readUByte(),_e=[],ye=[];for(let zn=0;zn<n;zn++)_e.push(t.readBoolean()),ye.push(t.readBoolean());if(n>0)for(let zn=n;zn<8;zn++)t.readBits(2);for(let zn=0;zn<n;zn++)_e[zn]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),ye[zn]&&t.readUByte();t.readUEG();const Me=t.readUEG();Me==3&&t.skipBits(1);const Ge=t.readUEG(),dt=t.readUEG(),We=t.readBoolean();let ot=0,at=0,Je=0,wt=0;We&&(ot+=t.readUEG(),at+=t.readUEG(),Je+=t.readUEG(),wt+=t.readUEG());const Xt=t.readUEG(),on=t.readUEG(),mn=t.readUEG(),ln=t.readBoolean();for(let zn=ln?0:n;zn<=n;zn++)t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.readBoolean()&&t.readBoolean())for(let Li=0;Li<4;Li++)for(let Ji=0;Ji<(Li===3?2:6);Ji++)if(!t.readBoolean())t.readUEG();else{const ar=Math.min(64,1<<4+(Li<<1));Li>1&&t.readEG();for(let Wr=0;Wr<ar;Wr++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const nn=t.readUEG();let fn=0;for(let zn=0;zn<nn;zn++){let Li=!1;if(zn!==0&&(Li=t.readBoolean()),Li){zn===nn&&t.readUEG(),t.readBoolean(),t.readUEG();let Ji=0;for(let kr=0;kr<=fn;kr++){const ar=t.readBoolean();let Wr=!1;ar||(Wr=t.readBoolean()),(ar||Wr)&&Ji++}fn=Ji}else{const Ji=t.readUEG(),kr=t.readUEG();fn=Ji+kr;for(let ar=0;ar<Ji;ar++)t.readUEG(),t.readBoolean();for(let ar=0;ar<kr;ar++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const zn=t.readUEG();for(let Li=0;Li<zn;Li++){for(let Ji=0;Ji<mn+4;Ji++)t.readBits(1);t.readBits(1)}}let Zt=0,Yt=1,Mn=1,Yn=!0,Fn=1,Kn=0;t.readBoolean(),t.readBoolean();let Ii=!1;if(t.readBoolean()){if(t.readBoolean()){const Mr=t.readUByte(),_l=[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];Mr>0&&Mr<16?(Yt=_l[Mr-1],Mn=zs[Mr-1]):Mr===255&&(Yt=t.readBits(16),Mn=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(),Ii=t.readBoolean(),Ii&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG()),t.readBoolean()&&(Fn=t.readBits(32),Kn=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const zs=t.readBoolean(),vl=t.readBoolean();let cs=!1;(zs||vl)&&(cs=t.readBoolean(),cs&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),cs&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let yl=0;yl<=n;yl++){Yn=t.readBoolean();const jd=Yn||t.readBoolean();let El=!1;jd?t.readEG():El=t.readBoolean();const bl=El?1:t.readUEG()+1;if(zs)for(let ds=0;ds<bl;ds++)t.readUEG(),t.readUEG(),cs&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(vl)for(let ds=0;ds<bl;ds++)t.readUEG(),t.readUEG(),cs&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),Zt=t.readUEG())}let Qi=Ge,mr=dt;if(We){let zn=1,Li=1;Me===1?zn=Li=2:Me==2&&(zn=2),Qi=Ge-zn*at-zn*ot,mr=dt-Li*wt-Li*Je}const Pr=i?["A","B","C"][i]:"",Vd=o<<24|c<<16|u<<8|h;let Va=0;for(let zn=0;zn<32;zn++)Va=(Va|(Vd>>zn&1)<<31-zn)>>>0;let ja=Va.toString(16);return s===1&&ja==="2"&&(ja="6"),{codecString:`hvc1.${Pr}${s}.${ja}.${r?"H":"L"}${pe}.B0`,params:{general_tier_flag:r,general_profile_idc:s,general_profile_space:i,general_profile_compatibility_flags:[o,c,u,h],general_constraint_indicator_flags:[f,v,R,I,q,J],general_level_idc:pe,bit_depth:Xt+8,bit_depth_luma_minus8:Xt,bit_depth_chroma_minus8:on,min_spatial_segmentation_idc:Zt,chroma_format_idc:Me,frame_rate:{fixed:Yn,fps:Kn/Fn}},width:Qi,height:mr,pixelRatio:[Yt,Mn]}}readPPS(e){const t=new ss(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const i=t.readBoolean(),r=t.readBoolean();let s=1;return r&&i?s=0:r?s=3:i&&(s=2),{parallelismType:s}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const Ei=188;class Tr{constructor(e,t,n,i){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=i,this.videoParser=null}static probe(e,t){const n=Tr.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(Ei*5,t-Ei)+1,i=0;for(;i<n;){let r=!1,s=-1,o=0;for(let c=i;c<t;c+=Ei)if(e[c]===71&&(t-c===Ei||e[c+Ei]===71)){if(o++,s===-1&&(s=c,s!==0&&(n=Math.min(s+Ei*99,e.length-Ei)+1)),r||(r=da(e,c)===0),r&&o>1&&(s===0&&o>2||c+Ei>n))return s}else{if(o)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:qe[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,n,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Tr.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=Tr.createTrack("audio",i),this._id3Track=Tr.createTrack("id3"),this._txtTrack=Tr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,i=!1){n||(this.sampleAes=null);let r;const s=this._videoTrack,o=this._audioTrack,c=this._id3Track,u=this._txtTrack;let h=s.pid,f=s.pesData,v=o.pid,R=c.pid,I=o.pesData,q=c.pesData,J=null,pe=this.pmtParsed,_e=this._pmtId,ye=e.length;if(this.remainderData&&(e=Ye(this.remainderData,e),ye=e.length,this.remainderData=null),ye<Ei&&!i)return this.remainderData=e,{audioTrack:o,videoTrack:s,id3Track:c,textTrack:u};const Me=Math.max(0,Tr.syncOffset(e));ye-=(ye-Me)%Ei,ye<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,ye,e.buffer.byteLength-ye));let Ge=0;for(let We=Me;We<ye;We+=Ei)if(e[We]===71){const ot=!!(e[We+1]&64),at=da(e,We),Je=(e[We+3]&48)>>4;let wt;if(Je>1){if(wt=We+5+e[We+4],wt===We+Ei)continue}else wt=We+4;switch(at){case h:ot&&(f&&(r=Kr(f,this.logger))&&(this.readyVideoParser(s.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(s,u,r,!1)),f={data:[],size:0}),f&&(f.data.push(e.subarray(wt,We+Ei)),f.size+=We+Ei-wt);break;case v:if(ot){if(I&&(r=Kr(I,this.logger)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,r);break;case"mp3":this.parseMPEGPES(o,r);break;case"ac3":this.parseAC3PES(o,r);break}I={data:[],size:0}}I&&(I.data.push(e.subarray(wt,We+Ei)),I.size+=We+Ei-wt);break;case R:ot&&(q&&(r=Kr(q,this.logger))&&this.parseID3PES(c,r),q={data:[],size:0}),q&&(q.data.push(e.subarray(wt,We+Ei)),q.size+=We+Ei-wt);break;case 0:ot&&(wt+=e[wt]+1),_e=this._pmtId=du(e,wt);break;case _e:{ot&&(wt+=e[wt]+1);const Xt=hu(e,wt,this.typeSupported,n,this.observer,this.logger);h=Xt.videoPid,h>0&&(s.pid=h,s.segmentCodec=Xt.segmentVideoCodec),v=Xt.audioPid,v>0&&(o.pid=v,o.segmentCodec=Xt.segmentAudioCodec),R=Xt.id3Pid,R>0&&(c.pid=R),J!==null&&!pe&&(this.logger.warn(`MPEG-TS PMT found at ${We} after unknown PID '${J}'. Backtracking to sync byte @${Me} to parse all TS packets.`),J=null,We=Me-188),pe=this.pmtParsed=!0;break}case 17:case 8191:break;default:J=at;break}}else Ge++;Ge>0&&ha(this.observer,new Error(`Found ${Ge} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=f,o.pesData=I,c.pesData=q;const dt={audioTrack:o,videoTrack:s,id3Track:c,textTrack:u};return i&&this.extractRemainingSamples(dt),dt}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:i,textTrack:r}=e,s=n.pesData,o=t.pesData,c=i.pesData;let u;if(s&&(u=Kr(s,this.logger))?(this.readyVideoParser(n.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(n,r,u,!0),n.pesData=null)):n.pesData=s,o&&(u=Kr(o,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,u);break;case"mp3":this.parseMPEGPES(t,u);break;case"ac3":this.parseAC3PES(t,u);break}t.pesData=null}else o!=null&&o.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;c&&(u=Kr(c,this.logger))?(this.parseID3PES(i,u),i.pesData=null):i.pesData=c}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),r=this.sampleAes=new lu(this.observer,this.config,t);return this.decrypt(i,r)}readyVideoParser(e){this.videoParser===null&&(e==="avc"?this.videoParser=new uu:e==="hevc"&&(this.videoParser=new cu))}decrypt(e,t){return new Promise(n=>{const{audioTrack:i,videoTrack:r}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,()=>{n(e)}):n(e)}):r.samples&&t.decryptAvcSamples(r.samples,0,0,()=>{n(e)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let n=0;const i=this.aacOverFlow;let r=t.data;if(i){this.aacOverFlow=null;const f=i.missing,v=i.sample.unit.byteLength;if(f===-1)r=Ye(i.sample.unit,r);else{const R=v-f;i.sample.unit.set(r.subarray(0,f),R),e.samples.push(i.sample),n=i.missing}}let s,o;for(s=n,o=r.length;s<o-1&&!Rs(r,s);s++);if(s!==n){let f;const v=s<o-1;if(v?f=`AAC PES did not start with ADTS header,offset:${s}`:f="No ADTS header found in AAC PES",ha(this.observer,new Error(f),v,this.logger),!v)return}Qa(e,this.observer,r,s,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(i){const f=Ja(e.samplerate);c=i.sample.pts+f}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let u=0,h;for(;s<o;)if(h=qa(e,r,s,c,u),s+=h.length,h.missing){this.aacOverFlow=h;break}else for(u++;s<o-1&&!Rs(r,s);s++);}parseMPEGPES(e,t){const n=t.data,i=n.length;let r=0,s=0;const o=t.pts;if(o===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<i;)if(ro(n,s)){const c=no(e,n,s,o,r);if(c)s+=c.length,r++;else break}else s++}parseAC3PES(e,t){{const n=t.data,i=t.pts;if(i===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const r=n.length;let s=0,o=0,c;for(;o<r&&(c=oo(e,n,o,i,s++))>0;)o+=c}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=m({},t,{type:this._videoTrack?Vi.emsg:Vi.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function da(a,e){return((a[e+1]&31)<<8)+a[e+2]}function du(a,e){return(a[e+10]&31)<<8|a[e+11]}function hu(a,e,t,n,i,r){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=(a[e+1]&15)<<8|a[e+2],c=e+3+o-4,u=(a[e+10]&15)<<8|a[e+11];for(e+=12+u;e<c;){const h=da(a,e),f=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!n){fa("ADTS AAC",r);break}case 15:s.audioPid===-1&&(s.audioPid=h);break;case 21:s.id3Pid===-1&&(s.id3Pid=h);break;case 219:if(!n){fa("H.264",r);break}case 27:s.videoPid===-1&&(s.videoPid=h);break;case 3:case 4:!t.mpeg&&!t.mp3?r.log("MPEG audio found, not supported in this browser"):s.audioPid===-1&&(s.audioPid=h,s.segmentAudioCodec="mp3");break;case 193:if(!n){fa("AC-3",r);break}case 129:t.ac3?s.audioPid===-1&&(s.audioPid=h,s.segmentAudioCodec="ac3"):r.log("AC-3 audio found, not supported in this browser");break;case 6:if(s.audioPid===-1&&f>0){let v=e+5,R=f;for(;R>2;){switch(a[v]){case 106:t.ac3!==!0?r.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=h,s.segmentAudioCodec="ac3");break}const q=a[v+1]+2;v+=q,R-=q}}break;case 194:case 135:return ha(i,new Error("Unsupported EC-3 in M2TS found"),void 0,r),s;case 36:s.videoPid===-1&&(s.videoPid=h,s.segmentVideoCodec="hevc",r.log("HEVC in M2TS found"));break}e+=f+5}return s}function ha(a,e,t,n){n.warn(`parsing error: ${e.message}`),a.emit(p.ERROR,p.ERROR,{type:ue.MEDIA_ERROR,details:G.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function fa(a,e){e.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function Kr(a,e){let t=0,n,i,r,s,o;const c=a.data;if(!a||a.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=Ye(c[0],c[1]),c.splice(1,1);if(n=c[0],(n[0]<<16)+(n[1]<<8)+n[2]===1){if(i=(n[4]<<8)+n[5],i&&i>a.size-6)return null;const h=n[7];h&192&&(s=(n[9]&14)*536870912+(n[10]&255)*4194304+(n[11]&254)*16384+(n[12]&255)*128+(n[13]&254)/2,h&64?(o=(n[14]&14)*536870912+(n[15]&255)*4194304+(n[16]&254)*16384+(n[17]&255)*128+(n[18]&254)/2,s-o>60*9e4&&(e.warn(`${Math.round((s-o)/9e4)}s delta between PTS and DTS, align them`),s=o)):o=s),r=n[8];let f=r+9;if(a.size<=f)return null;a.size-=f;const v=new Uint8Array(a.size);for(let R=0,I=c.length;R<I;R++){n=c[R];let q=n.byteLength;if(f)if(f>q){f-=q;continue}else n=n.subarray(f),q-=f,f=0;v.set(n,t),t+=q}return i&&(i-=r+3),{data:v,pts:s,dts:o,len:i}}return null}class fu{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 wr=Math.pow(2,32)-1;class nt{static init(){nt.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 nt.types)nt.types.hasOwnProperty(e)&&(nt.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]);nt.HDLR_TYPES={video:t,audio:n};const i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r=new Uint8Array([0,0,0,0,0,0,0,0]);nt.STTS=nt.STSC=nt.STCO=r,nt.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),nt.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),nt.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),nt.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);nt.FTYP=nt.box(nt.types.ftyp,s,c,s,o),nt.DINF=nt.box(nt.types.dinf,nt.box(nt.types.dref,i))}static box(e,...t){let n=8,i=t.length;const r=i;for(;i--;)n+=t[i].byteLength;const s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(e,4),i=0,n=8;i<r;i++)s.set(t[i],n),n+=t[i].byteLength;return s}static hdlr(e){return nt.box(nt.types.hdlr,nt.HDLR_TYPES[e])}static mdat(e){return nt.box(nt.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(wr+1)),i=Math.floor(t%(wr+1));return nt.box(nt.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return nt.box(nt.types.mdia,nt.mdhd(e.timescale||0,e.duration||0),nt.hdlr(e.type),nt.minf(e))}static mfhd(e){return nt.box(nt.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"?nt.box(nt.types.minf,nt.box(nt.types.smhd,nt.SMHD),nt.DINF,nt.stbl(e)):nt.box(nt.types.minf,nt.box(nt.types.vmhd,nt.VMHD),nt.DINF,nt.stbl(e))}static moof(e,t,n){return nt.box(nt.types.moof,nt.mfhd(e),nt.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=nt.trak(e[t]);return nt.box.apply(null,[nt.types.moov,nt.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(nt.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=nt.trex(e[t]);return nt.box.apply(null,[nt.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(wr+1)),i=Math.floor(t%(wr+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return nt.box(nt.types.mvhd,r)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let i,r;for(i=0;i<t.length;i++)r=t[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return nt.box(nt.types.sdtp,n)}static stbl(e){return nt.box(nt.types.stbl,nt.stsd(e),nt.box(nt.types.stts,nt.STTS),nt.box(nt.types.stsc,nt.STSC),nt.box(nt.types.stsz,nt.STSZ),nt.box(nt.types.stco,nt.STCO))}static avc1(e){let t=[],n=[],i,r,s;for(i=0;i<e.sps.length;i++)r=e.sps[i],s=r.byteLength,t.push(s>>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(r));for(i=0;i<e.pps.length;i++)r=e.pps[i],s=r.byteLength,n.push(s>>>8&255),n.push(s&255),n=n.concat(Array.prototype.slice.call(r));const o=nt.box(nt.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,h=e.pixelRatio[0],f=e.pixelRatio[1];return nt.box(nt.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,c>>8&255,c&255,u>>8&255,u&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,nt.box(nt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),nt.box(nt.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,f>>24,f>>16&255,f>>8&255,f&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 nt.box(nt.types.mp4a,nt.audioStsd(e),nt.box(nt.types.esds,nt.esds(e)))}static mp3(e){return nt.box(nt.types[".mp3"],nt.audioStsd(e))}static ac3(e){return nt.box(nt.types["ac-3"],nt.audioStsd(e),nt.box(nt.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return nt.box(nt.types.stsd,nt.STSD,nt.mp4a(e));if(t==="ac3"&&e.config)return nt.box(nt.types.stsd,nt.STSD,nt.ac3(e));if(t==="mp3"&&e.codec==="mp3")return nt.box(nt.types.stsd,nt.STSD,nt.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return nt.box(nt.types.stsd,nt.STSD,nt.avc1(e));if(t==="hevc"&&e.vps)return nt.box(nt.types.stsd,nt.STSD,nt.hvc1(e))}else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,n=(e.duration||0)*(e.timescale||0),i=e.width||0,r=e.height||0,s=Math.floor(n/(wr+1)),o=Math.floor(n%(wr+1));return nt.box(nt.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(e,t){const n=nt.sdtp(e),i=e.id,r=Math.floor(t/(wr+1)),s=Math.floor(t%(wr+1));return nt.box(nt.types.traf,nt.box(nt.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),nt.box(nt.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,s>>24,s>>16&255,s>>8&255,s&255])),nt.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,nt.box(nt.types.trak,nt.tkhd(e),nt.mdia(e))}static trex(e){const t=e.id;return nt.box(nt.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],i=n.length,r=12+16*i,s=new Uint8Array(r);let o,c,u,h,f,v;for(t+=8+r,s.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o<i;o++)c=n[o],u=c.duration,h=c.size,f=c.flags,v=c.cts,s.set([u>>>24&255,u>>>16&255,u>>>8&255,u&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,f.isLeading<<2|f.dependsOn,f.isDependedOn<<6|f.hasRedundancy<<4|f.paddingValue<<1|f.isNonSync,f.degradPrio&61440,f.degradPrio&15,v>>>24&255,v>>>16&255,v>>>8&255,v&255],12+16*o);return nt.box(nt.types.trun,s)}static initSegment(e){nt.types||nt.init();const t=nt.moov(e);return Ye(nt.FTYP,t)}static hvc1(e){const t=e.params,n=[e.vps,e.sps,e.pps],i=4,r=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),i-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),n.length]);let s=r.length;for(let I=0;I<n.length;I+=1){s+=3;for(let q=0;q<n[I].length;q+=1)s+=2+n[I][q].length}const o=new Uint8Array(s);o.set(r,0),s=r.length;const c=n.length-1;for(let I=0;I<n.length;I+=1){o.set(new Uint8Array([32+I|(I===c?128:0),0,n[I].length]),s),s+=3;for(let q=0;q<n[I].length;q+=1)o.set(new Uint8Array([n[I][q].length>>8,n[I][q].length&255]),s),s+=2,o.set(n[I][q],s),s+=n[I][q].length}const u=nt.box(nt.types.hvcC,o),h=e.width,f=e.height,v=e.pixelRatio[0],R=e.pixelRatio[1];return nt.box(nt.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,h>>8&255,h&255,f>>8&255,f&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,nt.box(nt.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),nt.box(nt.types.pasp,new Uint8Array([v>>24,v>>16&255,v>>8&255,v&255,R>>24,R>>16&255,R>>8&255,R&255])))}}nt.types=void 0,nt.HDLR_TYPES=void 0,nt.STTS=void 0,nt.STSC=void 0,nt.STCO=void 0,nt.STSZ=void 0,nt.VMHD=void 0,nt.SMHD=void 0,nt.STSD=void 0,nt.FTYP=void 0,nt.DINF=void 0;const co=9e4;function pa(a,e,t=1,n=!1){const i=a*e*t;return n?Math.round(i):i}function pu(a,e,t=1,n=!1){return pa(a,e,1/t,n)}function as(a,e=!1){return pa(a,1e3,1/co,e)}function mu(a,e=1){return pa(a,co,1/e)}function ho(a){const{baseTime:e,timescale:t,trackId:n}=a;return`${e/t} (${e}/${t}) trackId: ${n}`}const gu=10*1e3,_u=1024,vu=1152,yu=1536;let Gr=null,ma=null;function fo(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 Cs extends k{constructor(e,t,n,i){if(super("mp4-remuxer",i),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,Gr===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Gr=s?parseInt(s[1]):0}if(ma===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);ma=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){const t=this._initPTS;(!t||!e||e.trackId!==t.trackId||e.baseTime!==t.baseTime||e.timescale!==t.timescale)&&this.log(`Reset initPTS: ${t&&ho(t)} > ${e&&ho(e)}`),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,i=e.reduce((r,s)=>{let o=s.pts,c=o-r;return c<-4294967296&&(t=!0,o=ji(o,n),c=o-r),c>0?r:o},n);return t&&this.debug("PTS rollover detected"),i}remux(e,t,n,i,r,s,o,c){let u,h,f,v,R,I,q=r,J=r;const pe=e.pid>-1,_e=t.pid>-1,ye=t.samples.length,Me=e.samples.length>0,Ge=o&&ye>0||ye>1;if((!pe||Me)&&(!_e||Ge)||this.ISGenerated||o){if(this.ISGenerated){var We,ot,at,Je;const mn=this.videoTrackConfig;(mn&&(t.width!==mn.width||t.height!==mn.height||((We=t.pixelRatio)==null?void 0:We[0])!==((ot=mn.pixelRatio)==null?void 0:ot[0])||((at=t.pixelRatio)==null?void 0:at[1])!==((Je=mn.pixelRatio)==null?void 0:Je[1]))||!mn&&Ge||this.nextAudioTs===null&&Me)&&this.resetInitSegment()}this.ISGenerated||(f=this.generateIS(e,t,r,s));const wt=this.isVideoContiguous;let Xt=-1,on;if(Ge&&(Xt=Eu(t.samples),!wt&&this.config.forceKeyFrameOnDiscontinuity))if(I=!0,Xt>0){this.warn(`Dropped ${Xt} out of ${ye} video samples due to a missing keyframe`);const mn=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(Xt),t.dropped+=Xt,J+=(t.samples[0].pts-mn)/t.inputTimeScale,on=J}else Xt===-1&&(this.warn(`No keyframe found out of ${ye} video samples`),I=!1);if(this.ISGenerated){if(Me&&Ge){const mn=this.getVideoStartPts(t.samples),jt=(ji(e.samples[0].pts,mn)-mn)/t.inputTimeScale;q+=Math.max(0,jt),J+=Math.max(0,-jt)}if(Me){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),f=this.generateIS(e,t,r,s)),h=this.remuxAudio(e,q,this.isAudioContiguous,s,_e||Ge||c===ne.AUDIO?J:void 0),Ge){const mn=h?h.endPTS-h.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),f=this.generateIS(e,t,r,s)),u=this.remuxVideo(t,J,wt,mn)}}else Ge&&(u=this.remuxVideo(t,J,wt,0));u&&(u.firstKeyFrame=Xt,u.independent=Xt!==-1,u.firstKeyFramePTS=on)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(R=po(n,r,this._initPTS,this._initDTS)),i.samples.length&&(v=mo(i,r,this._initPTS))),{audio:h,video:u,initSegment:f,independent:I,text:v,id3:R}}computeInitPts(e,t,n,i){const r=Math.round(n*t);let s=ji(e,r);if(s<r+t)for(this.log(`Adjusting PTS for rollover in timeline near ${(r-s)/t} ${i}`);s<r+t;)s+=8589934592;return s-r}generateIS(e,t,n,i){const r=e.samples,s=t.samples,o=this.typeSupported,c={},u=this._initPTS;let h=!u||i,f="audio/mp4",v,R,I,q=-1;if(h&&(v=R=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(f="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}c.audio={id:"audio",container:f,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):nt.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(q=e.id,I=e.inputTimeScale,!u||I!==u.timescale?v=R=this.computeInitPts(r[0].pts,I,n,"audio"):h=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:nt.initSegment([t]),metadata:{width:t.width,height:t.height}},h)if(q=t.id,I=t.inputTimeScale,!u||I!==u.timescale){const J=this.getVideoStartPts(s),pe=ji(s[0].dts,J),_e=this.computeInitPts(pe,I,n,"video"),ye=this.computeInitPts(J,I,n,"video");R=Math.min(R,_e),v=Math.min(v,ye)}else h=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,h?(u&&this.warn(`Timestamps at playlist time: ${i?"":"~"}${n} ${v/I} != initPTS: ${u.baseTime/u.timescale} (${u.baseTime}/${u.timescale}) trackId: ${u.trackId}`),this.log(`Found initPTS at playlist time: ${n} offset: ${v/I} (${v}/${I}) trackId: ${q}`),this._initPTS={baseTime:v,timescale:I,trackId:q},this._initDTS={baseTime:R,timescale:I,trackId:q}):v=I=void 0,{tracks:c,initPTS:v,timescale:I,trackId:q}}remuxVideo(e,t,n,i){const r=e.inputTimeScale,s=e.samples,o=[],c=s.length,u=this._initPTS,h=u.baseTime*r/u.timescale;let f=this.nextVideoTs,v=8,R=this.videoSampleDuration,I,q,J=Number.POSITIVE_INFINITY,pe=Number.NEGATIVE_INFINITY,_e=!1;if(!n||f===null){const Zt=h+t*r,Yt=s[0].pts-ji(s[0].dts,s[0].pts);Gr&&f!==null&&Math.abs(Zt-Yt-(f+h))<15e3?n=!0:f=Zt-Yt-h}const ye=f+h;for(let Zt=0;Zt<c;Zt++){const Yt=s[Zt];Yt.pts=ji(Yt.pts,ye),Yt.dts=ji(Yt.dts,ye),Yt.dts<s[Zt>0?Zt-1:Zt].dts&&(_e=!0)}_e&&s.sort(function(Zt,Yt){const Mn=Zt.dts-Yt.dts,Yn=Zt.pts-Yt.pts;return Mn||Yn}),I=s[0].dts,q=s[s.length-1].dts;const Me=q-I,Ge=Me?Math.round(Me/(c-1)):R||e.inputTimeScale/30;if(n){const Zt=I-ye,Yt=Zt>Ge,Mn=Zt<-1;if((Yt||Mn)&&(Yt?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${as(Zt,!0)} ms (${Zt}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${as(-Zt,!0)} ms (${Zt}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!Mn||ye>=s[0].pts||Gr)){I=ye;const Yn=s[0].pts-Zt;if(Yt)s[0].dts=I,s[0].pts=Yn;else{let Fn=!0;for(let Kn=0;Kn<s.length&&!(s[Kn].dts>Yn&&Fn);Kn++){const Ii=s[Kn].pts;if(s[Kn].dts-=Zt,s[Kn].pts-=Zt,Kn<s.length-1){const xi=s[Kn+1].pts,Qi=s[Kn].pts,mr=xi<=Qi,Pr=xi<=Ii;Fn=mr==Pr}}}this.log(`Video: Initial PTS/DTS adjusted: ${as(Yn,!0)}/${as(I,!0)}, delta: ${as(Zt,!0)} ms`)}}I=Math.max(0,I);let dt=0,We=0,ot=I;for(let Zt=0;Zt<c;Zt++){const Yt=s[Zt],Mn=Yt.units,Yn=Mn.length;let Fn=0;for(let Kn=0;Kn<Yn;Kn++)Fn+=Mn[Kn].data.length;We+=Fn,dt+=Yn,Yt.length=Fn,Yt.dts<ot?(Yt.dts=ot,ot+=Ge/4|0||1):ot=Yt.dts,J=Math.min(Yt.pts,J),pe=Math.max(Yt.pts,pe)}q=s[c-1].dts;const at=We+4*dt+8;let Je;try{Je=new Uint8Array(at)}catch(Zt){this.observer.emit(p.ERROR,p.ERROR,{type:ue.MUX_ERROR,details:G.REMUX_ALLOC_ERROR,fatal:!1,error:Zt,bytes:at,reason:`fail allocating video mdat ${at}`});return}const wt=new DataView(Je.buffer);wt.setUint32(0,at),Je.set(nt.types.mdat,4);let Xt=!1,on=Number.POSITIVE_INFINITY,mn=Number.POSITIVE_INFINITY,ln=Number.NEGATIVE_INFINITY,jt=Number.NEGATIVE_INFINITY;for(let Zt=0;Zt<c;Zt++){const Yt=s[Zt],Mn=Yt.units;let Yn=0;for(let Ii=0,xi=Mn.length;Ii<xi;Ii++){const Qi=Mn[Ii],mr=Qi.data,Pr=Qi.data.byteLength;wt.setUint32(v,Pr),v+=4,Je.set(mr,v),v+=Pr,Yn+=4+Pr}let Fn;if(Zt<c-1)R=s[Zt+1].dts-Yt.dts,Fn=s[Zt+1].pts-Yt.pts;else{const Ii=this.config,xi=Zt>0?Yt.dts-s[Zt-1].dts:Ge;if(Fn=Zt>0?Yt.pts-s[Zt-1].pts:Ge,Ii.stretchShortVideoTrack&&this.nextAudioTs!==null){const Qi=Math.floor(Ii.maxBufferHole*r),mr=(i?J+i*r:this.nextAudioTs+h)-Yt.pts;mr>Qi?(R=mr-xi,R<0?R=xi:Xt=!0,this.log(`It is approximately ${mr/90} ms to the next segment; using duration ${R/90} ms for the last video frame.`)):R=xi}else R=xi}const Kn=Math.round(Yt.pts-Yt.dts);on=Math.min(on,R),ln=Math.max(ln,R),mn=Math.min(mn,Fn),jt=Math.max(jt,Fn),o.push(fo(Yt.key,R,Yn,Kn))}if(o.length){if(Gr){if(Gr<70){const Zt=o[0].flags;Zt.dependsOn=2,Zt.isNonSync=0}}else if(ma&&jt-mn<ln-on&&Ge/ln<.025&&o[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let Zt=I;for(let Yt=0,Mn=o.length;Yt<Mn;Yt++){const Yn=Zt+o[Yt].duration,Fn=Zt+o[Yt].cts;if(Yt<Mn-1){const Kn=Yn+o[Yt+1].cts;o[Yt].duration=Kn-Fn}else o[Yt].duration=Yt?o[Yt-1].duration:Ge;o[Yt].cts=0,Zt=Yn}}}R=Xt||!R?Ge:R;const dn=q+R;this.nextVideoTs=f=dn-h,this.videoSampleDuration=R,this.isVideoContiguous=!0;const Tn={data1:nt.moof(e.sequenceNumber++,I,m(e,{samples:o})),data2:Je,startPTS:(J-h)/r,endPTS:(pe+R-h)/r,startDTS:(I-h)/r,endDTS:f/r,type:"video",hasAudio:!1,hasVideo:!0,nb:o.length,dropped:e.dropped};return e.samples=[],e.dropped=0,Tn}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return vu;case"ac3":return yu;default:return _u}}remuxAudio(e,t,n,i,r){const s=e.inputTimeScale,o=e.samplerate?e.samplerate:s,c=s/o,u=this.getSamplesPerFrame(e),h=u*c,f=this._initPTS,v=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,R=[],I=r!==void 0;let q=e.samples,J=v?0:8,pe=this.nextAudioTs||-1;const _e=f.baseTime*s/f.timescale,ye=_e+t*s;if(this.isAudioContiguous=n=n||q.length&&pe>0&&(i&&Math.abs(ye-(pe+_e))<9e3||Math.abs(ji(q[0].pts,ye)-(pe+_e))<20*h),q.forEach(function(jt){jt.pts=ji(jt.pts,ye)}),!n||pe<0){const jt=q.length;if(q=q.filter(dn=>dn.pts>=0),jt!==q.length&&this.warn(`Removed ${q.length-jt} of ${jt} samples (initPTS ${_e} / ${s})`),!q.length)return;r===0?pe=0:i&&!I?pe=Math.max(0,ye-_e):pe=q[0].pts-_e}if(e.segmentCodec==="aac"){const jt=this.config.maxAudioFramesDrift;for(let dn=0,nn=pe+_e;dn<q.length;dn++){const fn=q[dn],Tn=fn.pts,Zt=Tn-nn,Yt=Math.abs(1e3*Zt/s);if(Zt<=-jt*h&&I)dn===0&&(this.warn(`Audio frame @ ${(Tn/s).toFixed(3)}s overlaps marker by ${Math.round(1e3*Zt/s)} ms.`),this.nextAudioTs=pe=Tn-_e,nn=Tn);else if(Zt>=jt*h&&Yt<gu&&I){let Mn=Math.round(Zt/h);for(nn=Tn-Mn*h;nn<0&&Mn&&h;)Mn--,nn+=h;dn===0&&(this.nextAudioTs=pe=nn-_e),this.warn(`Injecting ${Mn} audio frames @ ${((nn-_e)/s).toFixed(3)}s due to ${Math.round(1e3*Zt/s)} ms gap.`);for(let Yn=0;Yn<Mn;Yn++){let Fn=fu.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);Fn||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),Fn=fn.unit.subarray()),q.splice(dn,0,{unit:Fn,pts:nn}),nn+=h,dn++}}fn.pts=nn,nn+=h}}let Me=null,Ge=null,dt,We=0,ot=q.length;for(;ot--;)We+=q[ot].unit.byteLength;for(let jt=0,dn=q.length;jt<dn;jt++){const nn=q[jt],fn=nn.unit;let Tn=nn.pts;if(Ge!==null){const Yt=R[jt-1];Yt.duration=Math.round((Tn-Ge)/c)}else if(n&&e.segmentCodec==="aac"&&(Tn=pe+_e),Me=Tn,We>0){We+=J;try{dt=new Uint8Array(We)}catch(Yt){this.observer.emit(p.ERROR,p.ERROR,{type:ue.MUX_ERROR,details:G.REMUX_ALLOC_ERROR,fatal:!1,error:Yt,bytes:We,reason:`fail allocating audio mdat ${We}`});return}v||(new DataView(dt.buffer).setUint32(0,We),dt.set(nt.types.mdat,4))}else return;dt.set(fn,J);const Zt=fn.byteLength;J+=Zt,R.push(fo(!0,u,Zt,0)),Ge=Tn}const at=R.length;if(!at)return;const Je=R[R.length-1];pe=Ge-_e,this.nextAudioTs=pe+c*Je.duration;const wt=v?new Uint8Array(0):nt.moof(e.sequenceNumber++,Me/c,m({},e,{samples:R}));e.samples=[];const Xt=(Me-_e)/s,on=this.nextAudioTs/s,ln={data1:wt,data2:dt,startPTS:Xt,endPTS:on,startDTS:Xt,endDTS:on,type:"audio",hasAudio:!0,hasVideo:!1,nb:at};return this.isAudioContiguous=!0,ln}}function ji(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 Eu(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function po(a,e,t,n){const i=a.samples.length;if(!i)return;const r=a.inputTimeScale;for(let o=0;o<i;o++){const c=a.samples[o];c.pts=ji(c.pts-t.baseTime*r/t.timescale,e*r)/r,c.dts=ji(c.dts-n.baseTime*r/n.timescale,e*r)/r}const s=a.samples;return a.samples=[],{samples:s}}function mo(a,e,t){const n=a.samples.length;if(!n)return;const i=a.inputTimeScale;for(let s=0;s<n;s++){const o=a.samples[s];o.pts=ji(o.pts-t.baseTime*i/t.timescale,e*i)/i}a.samples.sort((s,o)=>s.pts-o.pts);const r=a.samples;return a.samples=[],{samples:r}}class bu extends k{constructor(e,t,n,i){super("passthrough-remuxer",i),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;const t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,n,i){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(e,i),this.emitInitSegment=!0}generateInitSegment(e,t){let{audioCodec:n,videoCodec:i}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const{audio:r,video:s}=this.initData=fe(e);if(t)ee(e,t);else{const c=r||s;c!=null&&c.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${c.codec}")!`)}r&&(n=go(r,V.AUDIO,this)),s&&(i=go(s,V.VIDEO,this));const o={};r&&s?o.audiovideo={container:"video/mp4",codec:n+","+i,supplemental:s.supplemental,encrypted:s.encrypted,initSegment:e,id:"main"}:r?o.audio={container:"audio/mp4",codec:n,encrypted:r.encrypted,initSegment:e,id:"audio"}:s?o.video={container:"video/mp4",codec:i,supplemental:s.supplemental,encrypted:s.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=o}remux(e,t,n,i,r,s){var o,c;let{initPTS:u,lastEndTime:h}=this;const f={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};x(h)||(h=this.lastEndTime=r||0);const v=t.samples;if(!v.length)return f;const R={initPTS:void 0,timescale:void 0,trackId:void 0};let I=this.initData;if((o=I)!=null&&o.length||(this.generateInitSegment(v),I=this.initData),!((c=I)!=null&&c.length))return this.warn("Failed to generate initSegment."),f;this.emitInitSegment&&(R.tracks=this.initTracks,this.emitInitSegment=!1);const q=ze(v,I,this),J=I.audio?q[I.audio.id]:null,pe=I.video?q[I.video.id]:null,_e=Ds(pe,1/0),ye=Ds(J,1/0),Me=Ds(pe,0,!0),Ge=Ds(J,0,!0);let dt=r,We=0;const ot=J&&(!pe||!u&&ye<_e||u&&u.trackId===I.audio.id),at=ot?J:pe;if(at){const nn=at.timescale,fn=at.start-r*nn,Tn=ot?I.audio.id:I.video.id;dt=at.start/nn,We=ot?Ge-ye:Me-_e,(s||!u)&&(Su(u,dt,r,We)||nn!==u.timescale)&&(u&&this.warn(`Timestamps at playlist time: ${s?"":"~"}${r} ${fn/nn} != initPTS: ${u.baseTime/u.timescale} (${u.baseTime}/${u.timescale}) trackId: ${u.trackId}`),this.log(`Found initPTS at playlist time: ${r} offset: ${dt-r} (${fn}/${nn}) trackId: ${Tn}`),u=null,R.initPTS=fn,R.timescale=nn,R.trackId=Tn)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${r}`);u?(R.initPTS=u.baseTime,R.timescale=u.timescale,R.trackId=u.trackId):((!R.timescale||R.trackId===void 0||R.initPTS===void 0)&&(this.warn("Could not set initPTS"),R.initPTS=dt,R.timescale=1,R.trackId=-1),this.initPTS=u={baseTime:R.initPTS,timescale:R.timescale,trackId:R.trackId});const Je=dt-u.baseTime/u.timescale,wt=Je+We;We>0?this.lastEndTime=wt:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const Xt=!!I.audio,on=!!I.video;let mn="";Xt&&(mn+="audio"),on&&(mn+="video");const ln=(I.audio?I.audio.encrypted:!1)||(I.video?I.video.encrypted:!1),jt={data1:v,startPTS:Je,startDTS:Je,endPTS:wt,endDTS:wt,type:mn,hasAudio:Xt,hasVideo:on,nb:1,dropped:0,encrypted:ln};f.audio=Xt&&!on?jt:void 0,f.video=on?jt:void 0;const dn=pe==null?void 0:pe.sampleCount;if(dn){const nn=pe.keyFrameIndex,fn=nn!==-1;jt.nb=dn,jt.dropped=nn===0||this.isVideoContiguous?0:fn?nn:dn,jt.independent=fn,jt.firstKeyFrame=nn,fn&&pe.keyFrameStart&&(jt.firstKeyFramePTS=(pe.keyFrameStart-u.baseTime)/u.timescale),this.isVideoContiguous||(f.independent=fn),this.isVideoContiguous||(this.isVideoContiguous=fn),jt.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${nn}/${dn} dropped: ${jt.dropped} start: ${jt.firstKeyFramePTS||"NA"}`)}return f.initSegment=R,f.id3=po(n,r,u,u),i.samples.length&&(f.text=mo(i,r,u)),f}}function Ds(a,e,t=!1){return(a==null?void 0:a.start)!==void 0?(a.start+(t?a.duration:0))/a.timescale:e}function Su(a,e,t,n){if(a===null)return!0;const i=Math.max(n,1),r=e-a.baseTime/a.timescale;return Math.abs(r-t)>i}function go(a,e,t){const n=a.codec;return n&&n.length>4?n:e===V.AUDIO?n==="ec-3"||n==="ac-3"||n==="alac"?n:n==="fLaC"||n==="Opus"?un(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 Er;try{Er=self.performance.now.bind(self.performance)}catch(a){Er=Date.now}const Os=[{demux:ou,remux:bu},{demux:Tr,remux:Cs},{demux:iu,remux:Cs},{demux:su,remux:Cs}];Os.splice(2,0,{demux:ru,remux:Cs});class _o{constructor(e,t,n,i,r,s){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.id=r,this.logger=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,i){const r=n.transmuxing;r.executeStart=Er();let s=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:c}=this;i&&(this.currentTransmuxState=i);const{contiguous:u,discontinuity:h,trackSwitch:f,accurateTimeOffset:v,timeOffset:R,initSegmentChange:I}=i||o,{audioCodec:q,videoCodec:J,defaultInitPts:pe,duration:_e,initSegmentData:ye}=c,Me=xu(s,t);if(Me&&Pi(Me.method)){const ot=this.getDecrypter(),at=ur(Me.method);if(ot.isSync()){let Je=ot.softwareDecrypt(s,Me.key.buffer,Me.iv.buffer,at);if(n.part>-1){const Xt=ot.flush();Je=Xt&&Xt.buffer}if(!Je)return r.executeEnd=Er(),ga(n);s=new Uint8Array(Je)}else return this.asyncResult=!0,this.decryptionPromise=ot.webCryptoDecrypt(s,Me.key.buffer,Me.iv.buffer,at).then(Je=>{const wt=this.push(Je,null,n);return this.decryptionPromise=null,wt}),this.decryptionPromise}const Ge=this.needsProbing(h,f);if(Ge){const ot=this.configureTransmuxer(s);if(ot)return this.logger.warn(`[transmuxer] ${ot.message}`),this.observer.emit(p.ERROR,p.ERROR,{type:ue.MEDIA_ERROR,details:G.FRAG_PARSING_ERROR,fatal:!1,error:ot,reason:ot.message}),r.executeEnd=Er(),ga(n)}(h||f||I||Ge)&&this.resetInitSegment(ye,q,J,_e,t),(h||I||Ge)&&this.resetInitialTimestamp(pe),u||this.resetContiguity();const dt=this.transmux(s,Me,R,v,n);this.asyncResult=os(dt);const We=this.currentTransmuxState;return We.contiguous=!0,We.discontinuity=!1,We.trackSwitch=!1,r.executeEnd=Er(),dt}flush(e){const t=e.transmuxing;t.executeStart=Er();const{decrypter:n,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return this.asyncResult=!0,r.then(()=>this.flush(e));const s=[],{timeOffset:o}=i;if(n){const f=n.flush();f&&s.push(this.push(f.buffer,null,e))}const{demuxer:c,remuxer:u}=this;if(!c||!u){t.executeEnd=Er();const f=[ga(e)];return this.asyncResult?Promise.resolve(f):f}const h=c.flush(o);return os(h)?(this.asyncResult=!0,h.then(f=>(this.flushRemux(s,f,e),s))):(this.flushRemux(s,h,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:r,id3Track:s,textTrack:o}=t,{accurateTimeOffset:c,timeOffset:u}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===ne.MAIN?"level":"track"} ${n.level}`);const h=this.remuxer.remux(i,r,s,o,u,c,!0,this.id);e.push({remuxResult:h,chunkMeta:n}),n.transmuxing.executeEnd=Er()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;!t||!n||(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,i,r){const{demuxer:s,remuxer:o}=this;!s||!o||(s.resetInitSegment(e,t,n,i),o.resetInitSegment(e,t,n,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,i,r){let s;return t&&t.method==="SAMPLE-AES"?s=this.transmuxSampleAes(e,t,n,i,r):s=this.transmuxUnencrypted(e,n,i,r),s}transmuxUnencrypted(e,t,n,i){const{audioTrack:r,videoTrack:s,id3Track:o,textTrack:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,s,o,c,t,n,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,n,i,r){return this.demuxer.demuxSampleAes(e,t,n).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,n,i,!1,this.id),chunkMeta:r}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:i}=this;let r;for(let f=0,v=Os.length;f<v;f++){var s;if((s=Os[f].demux)!=null&&s.probe(e,this.logger)){r=Os[f];break}}if(!r)return new Error("Failed to find demuxer by probing fragment data");const o=this.demuxer,c=this.remuxer,u=r.remux,h=r.demux;(!c||!(c instanceof u))&&(this.remuxer=new u(n,t,i,this.logger)),(!o||!(o instanceof h))&&(this.demuxer=new h(n,t,i,this.logger),this.probe=h.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new gi(this.config)),e}}function xu(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 ga=a=>({remuxResult:{},chunkMeta:a});function os(a){return"then"in a&&a.then instanceof Function}class Tu{constructor(e,t,n,i,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=i,this.defaultInitPts=r||null}}class wu{constructor(e,t,n,i,r,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=s}}let vo=0;class yo{constructor(e,t,n,i){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=vo++,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,h=this.hls;if(!(!h||!(u!=null&&u.event)||u.instanceNo!==this.instanceNo))switch(u.event){case"init":{var f;const v=(f=this.workerContext)==null?void 0:f.objectURL;v&&self.URL.revokeObjectURL(v);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}case"workerLog":{h.logger[u.data.logType]&&h.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,h.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:ue.OTHER_ERROR,details:G.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:u})};const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const s=(c,u)=>{u=u||{},u.frag=this.frag||void 0,c===p.ERROR&&(u=u,u.parent=this.id,u.part=this.part,this.error=u.error),this.hls.trigger(c,u)};this.observer=new ra,this.observer.on(p.FRAG_DECRYPTED,s),this.observer.on(p.ERROR,s);const o=g(r.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const c=this.hls.logger;if(r.workerPath||Ll()){try{r.workerPath?(c.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=Dl(r.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=Cl());const{worker:h}=this.workerContext;h.addEventListener("message",this.onWorkerMessage),h.addEventListener("error",this.onWorkerError),h.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:o,id:t,config:Ke(r)})}catch(h){c.warn(`Error setting up "${t}" Web Worker, fallback to inline`,h),this.terminateWorker(),this.error=null,this.transmuxer=new _o(this.observer,o,r,"",t,e.logger)}return}}this.transmuxer=new _o(this.observer,o,r,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=vo++;const t=this.hls.config,n=g(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:Ke(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),Ol(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,n,i,r,s,o,c,u,h){var f,v;u.transmuxing.start=self.performance.now();const{instanceNo:R,transmuxer:I}=this,q=s?s.start:r.start,J=r.decryptdata,pe=this.frag,_e=!(pe&&r.cc===pe.cc),ye=!(pe&&u.level===pe.level),Me=pe?u.sn-pe.sn:-1,Ge=this.part?u.part-this.part.index:-1,dt=Me===0&&u.id>1&&u.id===(pe==null?void 0:pe.stats.chunkCount),We=!ye&&(Me===1||Me===0&&(Ge===1||dt&&Ge<=0)),ot=self.performance.now();(ye||Me||r.stats.parsing.start===0)&&(r.stats.parsing.start=ot),s&&(Ge||!We)&&(s.stats.parsing.start=ot);const at=!(pe&&((f=r.initSegment)==null?void 0:f.url)===((v=pe.initSegment)==null?void 0:v.url)),Je=new wu(_e,We,c,ye,q,at);if(!We||_e||at){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${u.sn}${u.part>-1?" part: "+u.part:""} ${this.id===ne.MAIN?"level":"track"}: ${u.level} id: ${u.id}
|
|
discontinuity: ${_e}
|
|
trackSwitch: ${ye}
|
|
contiguous: ${We}
|
|
accurateTimeOffset: ${c}
|
|
timeOffset: ${q}
|
|
initSegmentChange: ${at}`);const wt=new Tu(n,i,t,o,h);this.configureTransmuxer(wt)}if(this.frag=r,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:R,cmd:"demux",data:e,decryptdata:J,chunkMeta:u,state:Je},e instanceof ArrayBuffer?[e]:[]);else if(I){const wt=I.push(e,J,u,Je);os(wt)?wt.then(Xt=>{this.handleTransmuxComplete(Xt)}).catch(Xt=>{this.transmuxerError(Xt,u,"transmuxer-interface push error")}):this.handleTransmuxComplete(wt)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(n){const i=n.flush(e);os(i)?i.then(r=>{this.handleFlushResult(r,e)}).catch(r=>{this.transmuxerError(r,e,"transmuxer-interface flush error")}):this.handleFlushResult(i,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(p.ERROR,{type:ue.MEDIA_ERROR,details:G.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 Eo=100;class Au extends na{constructor(e,t,n){super(e,t,n,"audio-stream-controller",ne.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r,trackId:s}){if(n===ne.MAIN){const o=t.cc,c=this.fragCurrent;if(this.initPTS[o]={baseTime:i,timescale:r,trackId:s},this.log(`InitPTS for cc: ${o} found from main: ${i/r} (${i}/${r}) trackId: ${s}`),this.mainAnchor=t,this.state===yt.WAITING_INIT_PTS){const u=this.waitingData;(!u&&!this.loadingParts||u&&u.frag.cc!==o)&&this.syncWithAnchor(t,u==null?void 0:u.frag)}else!this.hls.hasEnoughToStart&&c&&c.cc!==o?(c.abortRequests(),this.syncWithAnchor(t,c)):this.state===yt.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var n;const i=((n=this.mainFragLoading)==null?void 0:n.frag)||null;if(t&&(i==null?void 0:i.cc)===t.cc)return;const r=(i||e).cc,s=this.getLevelDetails(),o=this.getLoadPosition(),c=Dn(s,r,o);c&&(this.log(`Syncing with main frag at ${c.start} cc ${c.cc}`),this.startFragRequested=!1,this.nextLoadPosition=c.start,this.resetLoadingState(),this.state===yt.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=yt.STOPPED;return}const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(Eo),n>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=yt.IDLE):this.state=yt.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case yt.IDLE:this.doTickIdle();break;case yt.WAITING_TRACK:{const{levels:e,trackId:t}=this,n=e==null?void 0:e[t],i=n==null?void 0:n.details;if(i&&!this.waitForLive(n)){if(this.waitForCdnTuneIn(i))break;this.state=yt.WAITING_INIT_PTS}break}case yt.FRAG_LOADING_WAITING_RETRY:{this.checkRetryDate();break}case yt.WAITING_INIT_PTS:{const e=this.waitingData;if(e){const{frag:t,part:n,cache:i,complete:r}=e,s=this.mainAnchor;if(this.initPTS[t.cc]!==void 0){this.waitingData=null,this.state=yt.FRAG_LOADING;const o=i.flush().buffer,c={frag:t,part:n,payload:o,networkDetails:null};this._handleFragmentLoadProgress(c),r&&super._handleFragmentLoadComplete(c)}else s&&s.cc!==e.frag.cc&&this.syncWithAnchor(s,e.frag)}else this.state=yt.IDLE}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:n,media:i,trackId:r}=this,s=t.config;if(!this.buffering||!i&&!this.primaryPrefetch&&(this.startFragRequested||!s.startFragPrefetch)||!(n!=null&&n[r]))return;const o=n[r],c=o.details;if(!c||this.waitForLive(o)||this.waitForCdnTuneIn(c)){this.state=yt.WAITING_TRACK,this.startFragRequested=!1;return}const u=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&u&&(this.bufferFlushed=!1,this.afterBufferFlushed(u,V.AUDIO,ne.AUDIO));const h=this.getFwdBufferInfo(u,ne.AUDIO);if(h===null)return;if(!this.switchingTrack&&this._streamEnded(h,c)){t.trigger(p.BUFFER_EOS,{type:"audio"}),this.state=yt.ENDED;return}const f=h.len,v=t.maxBufferLength,R=c.fragments,I=R[0].start,q=this.getLoadPosition(),J=this.flushing?q:h.end;if(this.switchingTrack&&i){const ye=q;c.PTSKnown&&ye<I&&(h.end>I||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=I+.05)}if(f>=v&&!this.switchingTrack&&J<R[R.length-1].start)return;let pe=this.getNextFragment(J,c);if(pe&&this.isLoopLoading(pe,J)&&(pe=this.getNextFragmentLoopLoading(pe,c,h,ne.MAIN,v)),!pe){this.bufferFlushed=!0;return}let _e=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&_e&&be(pe)&&!pe.endList&&(!c.live||!this.loadingParts&&J<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(_e)===en.OK&&(this.mainFragLoading=_e=null),_e&&be(_e))){if(pe.start>_e.end){const Me=this.fragmentTracker.getFragAtPos(J,ne.MAIN);Me&&Me.end>_e.end&&(_e=Me,this.mainFragLoading={frag:Me,targetBufferTime:null})}if(pe.start>_e.end)return}this.loadFragment(pe,o,J)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new Wt(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==yt.STOPPED&&(this.setInterval(Eo),this.state=yt.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(p.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:i}=this,{details:r,id:s,groupId:o,track:c}=t;if(!i){this.warn(`Audio tracks reset while loading track ${s} "${c.name}" of "${o}"`);return}const u=this.mainDetails;if(!u||r.endCC>u.endCC||u.expired){this.cachedTrackLoadedData=t,this.state!==yt.STOPPED&&(this.state=yt.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${c.name}" of "${o}" loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const h=i[s];let f=0;if(r.live||(n=h.details)!=null&&n.live){if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;if(h.details){var v;f=this.alignPlaylists(r,h.details,(v=this.levelLastLoaded)==null?void 0:v.details)}r.alignedSliding||(Ts(r,u),r.alignedSliding||ws(r,u),f=r.fragmentStart)}h.details=r,this.levelLastLoaded=h,this.startFragRequested||this.setStartPosition(u,f),this.hls.trigger(p.AUDIO_TRACK_UPDATED,{details:r,id:s,groupId:t.groupId}),this.state===yt.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=yt.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{config:s,trackId:o,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const u=c[o];if(!u){this.warn("Audio track is undefined on fragment load progress");return}const h=u.details;if(!h){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const f=s.defaultAudioCodec||u.audioCodec||"mp4a.40.2";let v=this.transmuxer;v||(v=this.transmuxer=new yo(this.hls,ne.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const R=this.initPTS[n.cc],I=(t=n.initSegment)==null?void 0:t.data;if(R!==void 0){const J=i?i.index:-1,pe=J!==-1,_e=new $i(n.level,n.sn,n.stats.chunkCount,r.byteLength,J,pe);v.push(r,I,f,"",n,i,h.totalduration,!1,_e,R)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${h.startSN} ,${h.endSN}],track ${o}`);const{cache:q}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new za,complete:!1};q.push(new Uint8Array(r)),this.state!==yt.STOPPED&&(this.state=yt.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===ne.MAIN&&be(t.frag)&&(this.mainFragLoading=t,this.state===yt.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type!==ne.AUDIO){!this.audioOnly&&n.type===ne.MAIN&&!n.elementaryStreams.video&&!n.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(be(n)){this.fragPrevious=n;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(p.AUDIO_TRACK_SWITCHED,E({},r)))}this.fragBufferedComplete(n,i),this.media&&this.tick()}onError(e,t){var n;if(t.fatal){this.state=yt.ERROR;return}switch(t.details){case G.FRAG_GAP:case G.FRAG_PARSING_ERROR:case G.FRAG_DECRYPT_ERROR:case G.FRAG_LOAD_ERROR:case G.FRAG_LOAD_TIMEOUT:case G.KEY_LOAD_ERROR:case G.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ne.AUDIO,t);break;case G.AUDIO_TRACK_LOAD_ERROR:case G.AUDIO_TRACK_LOAD_TIMEOUT:case G.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===yt.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===se.AUDIO_TRACK&&(this.state=yt.IDLE);break;case G.BUFFER_ADD_CODEC_ERROR:case G.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case G.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case G.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==V.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==V.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===yt.ENDED&&(this.state=yt.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,ne.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:c,part:u,level:h}=o,{details:f}=h,{audio:v,text:R,id3:I,initSegment:q}=r;if(this.fragContextChanged(c)||!f){this.fragmentTracker.removeFragment(c);return}if(this.state=yt.PARSING,this.switchingTrack&&v&&this.completeAudioSwitch(this.switchingTrack),q!=null&&q.tracks){const J=c.initSegment||c;if(this.unhandledEncryptionError(q,c))return;this._bufferInitSegment(h,q.tracks,J,s),i.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:J,id:n,tracks:q.tracks})}if(v){const{startPTS:J,endPTS:pe,startDTS:_e,endDTS:ye}=v;u&&(u.elementaryStreams[V.AUDIO]={startPTS:J,endPTS:pe,startDTS:_e,endDTS:ye}),c.setElementaryStreamInfo(V.AUDIO,J,pe,_e,ye),this.bufferFragmentData(v,c,u,s)}if(I!=null&&(t=I.samples)!=null&&t.length){const J=m({id:n,frag:c,details:f},I);i.trigger(p.FRAG_PARSING_METADATA,J)}if(R){const J=m({id:n,frag:c,details:f},R);i.trigger(p.FRAG_PARSING_USERDATA,J)}}_bufferInitSegment(e,t,n,i){if(this.state!==yt.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const r=t.audio;r.id=ne.AUDIO;const s=e.audioCodec;this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${s}/${r.codec}]`),s&&s.split(",").length===1&&(r.levelCodec=s),this.hls.trigger(p.BUFFER_CODECS,t);const o=r.initSegment;if(o!=null&&o.byteLength){const c={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:o};this.hls.trigger(p.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);if(this.switchingTrack||i===en.NOT_LOADED||i===en.PARTIAL){var r;if(!be(e))this._loadInitSegment(e,t);else if((r=t.details)!=null&&r.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=yt.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragmentStart!==t.details.fragmentStart&&ws(t.details,s)}else super.loadFragment(e,t,n)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:n,assocLang:i,characteristics:r,audioCodec:s,channels:o}=this.bufferedTrack;cn({name:t,lang:n,assocLang:i,characteristics:r,audioCodec:s,channels:o},e,an)||(Ln(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,E({},e))}}class _a extends k{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const i=t==null?void 0:t.renditionReports;if(i){let r=-1;for(let s=0;s<i.length;s++){const o=i[s];let c;try{c=new self.URL(o.URI,t.url).href}catch(u){this.warn(`Could not construct new URL for Rendition Report: ${u}`),c=o.URI||""}if(c===e){r=s;break}else c===e.substring(0,c.length)&&(r=s)}if(r!==-1){const s=i[r],o=parseInt(s["LAST-MSN"])||t.lastPartSn;let c=parseInt(s["LAST-PART"])||t.lastPartIndex;if(this.hls.config.lowLatencyMode){const h=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&h>t.partTarget&&(c+=1)}const u=n&&hn(n);return new En(o,c>=0?c:void 0,u)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}return e}playlistLoaded(e,t,n){const{details:i,stats:r}=t,s=self.performance.now(),o=r.loading.first?Math.max(0,s-r.loading.first):0;i.advancedDateTime=Date.now()-o;const c=this.hls.config.timelineOffset;if(c!==i.appliedTimelineOffset){const h=Math.max(c||0,0);i.appliedTimelineOffset=h,i.fragments.forEach(f=>{f.setStart(f.playlistOffset+h)})}if(i.live||n!=null&&n.live){const h="levelInfo"in t?t.levelInfo:t.track;if(i.reloaded(n),n&&i.fragments.length>0){qs(n,i,this);const _e=i.playlistParsingError;if(_e){this.warn(_e);const ye=this.hls;if(!ye.config.ignorePlaylistParsingErrors){var u;const{networkDetails:Me}=t;ye.trigger(p.ERROR,{type:ue.NETWORK_ERROR,details:G.LEVEL_PARSING_ERROR,fatal:!1,url:i.url,error:_e,reason:_e.message,level:t.level||void 0,parent:(u=i.fragments[0])==null?void 0:u.type,networkDetails:Me,stats:r});return}i.playlistParsingError=null}}i.requestScheduled===-1&&(i.requestScheduled=r.loading.start);const f=this.hls.mainForwardBufferInfo,v=f?f.end-f.len:0,R=(i.edge-v)*1e3,I=ri(i,R);if(i.requestScheduled+I<s?i.requestScheduled=s:i.requestScheduled+=I,this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),!this.canLoad||!i.live)return;let q,J,pe;if(i.canBlockReload&&i.endSN&&i.advanced){const _e=this.hls.config.lowLatencyMode,ye=i.lastPartSn,Me=i.endSN,Ge=i.lastPartIndex,dt=Ge!==-1,We=ye===Me;dt?We?(J=Me+1,pe=_e?0:Ge):(J=ye,pe=_e?Ge+1:i.maxPartIndex):J=Me+1;const ot=i.age,at=ot+i.ageHeader;let Je=Math.min(at-i.partTarget,i.targetduration*1.5);if(Je>0){if(at>i.targetduration*3)this.log(`Playlist last advanced ${ot.toFixed(2)}s ago. Omitting segment and part directives.`),J=void 0,pe=void 0;else if(n!=null&&n.tuneInGoal&&at-i.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${Je} with playlist age: ${i.age}`),Je=0;else{const wt=Math.floor(Je/i.targetduration);if(J+=wt,pe!==void 0){const Xt=Math.round(Je%i.targetduration/i.partTarget);pe+=Xt}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${ot.toFixed(2)}s goal: ${Je} skip sn ${wt} to part ${pe}`)}i.tuneInGoal=Je}if(q=this.getDeliveryDirectives(i,t.deliveryDirectives,J,pe),_e||!We){i.requestScheduled=s,this.loadingPlaylist(h,q);return}}else(i.canBlockReload||i.canSkipUntil)&&(q=this.getDeliveryDirectives(i,t.deliveryDirectives,J,pe));q&&J!==void 0&&i.canBlockReload&&(i.requestScheduled=r.loading.first+Math.max(I-o*2,I/2)),this.scheduleLoading(h,q,i)}else this.clearTimer()}scheduleLoading(e,t,n){const i=n||e.details;if(!i){this.loadingPlaylist(e,t);return}const r=self.performance.now(),s=i.requestScheduled;if(r>=s){this.loadingPlaylist(e,t);return}const o=s-r;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(o)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),o)}getDeliveryDirectives(e,t,n,i){let r=hn(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,r=kt.No),new En(n,i,r)}checkRetry(e){const t=e.details,n=Nn(e),i=e.errorAction,{action:r,retryCount:s=0,retryConfig:o}=i||{},c=!!i&&!!o&&(r===Cn.RetryRequest||!i.resolved&&r===Cn.SendAlternateToPenaltyBox);if(c){var u;if(s>=o.maxNumRetry)return!1;if(n&&(u=e.context)!=null&&u.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const h=Zn(o,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" in ${h}ms`)}e.levelRetry=!0,i.resolved=!0}return c}}function bo(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!ls(a[t].attrs,e[t].attrs))return!1;return!0}function ls(a,e,t){const n=a["STABLE-RENDITION-ID"];return n&&!t?n===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(i=>a[i]!==e[i])}function va(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class Ru extends _a{constructor(e){super(e,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:i,details:r}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==i){this.warn(`Audio track with id:${n} and group:${i} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Audio track ${n} "${s.name}" lang:${s.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(o=>(i==null?void 0:i.indexOf(o))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(v=>!n||n.indexOf(v.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(v=>v.default)&&(this.selectDefaultTrack=!1),o.forEach((v,R)=>{v.id=R});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const c=this.hls.config.audioPreference;if(!r&&c){const v=Ut(c,o,an);if(v>-1)r=o[v];else{const R=Ut(c,this.tracks);r=this.tracks[R]}}let u=this.findTrackId(r);u===-1&&r&&(u=this.findTrackId(null));const h={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(p.AUDIO_TRACKS_UPDATED,h);const f=this.trackId;if(u!==-1&&f===-1)this.setAudioTrack(u);else if(o.length&&f===-1){var s;const v=new Error(`No audio track selected for current audio group-ID(s): ${(s=this.groupIds)==null?void 0:s.join(",")} track count: ${o.length}`);this.warn(v.message),this.hls.trigger(p.ERROR,{type:ue.MEDIA_ERROR,details:G.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:v})}}}onError(e,t){t.fatal||!t.context||t.context.type===se.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const i=this.currentTrack;if(i&&cn(e,i,an))return i;const r=Ut(e,this.tracksInGroup,an);if(r>-1){const s=this.tracksInGroup[r];return this.setAudioTrack(r),s}else if(i){let s=t.loadLevel;s===-1&&(s=t.firstAutoLevel);const o=_n(e,t.levels,n,s,an);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const s=Ut(e,n);if(s>-1)return n[s]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e],r=i.details&&!i.details.live;if(e===this.trackId&&i===n&&r||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(p.AUDIO_TRACK_SWITCHING,E({},i)),r))return;const s=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(!(this.selectDefaultTrack&&!i.default)&&(!e||cn(e,i,an)))return n}if(e){const{name:n,lang:i,assocLang:r,characteristics:s,audioCodec:o,channels:c}=e;for(let u=0;u<t.length;u++){const h=t[u];if(cn({name:n,lang:i,assocLang:r,characteristics:s,audioCodec:o,channels:c},h,an))return u}for(let u=0;u<t.length;u++){const h=t[u];if(ls(e.attrs,h.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return u}for(let u=0;u<t.length;u++){const h=t[u];if(ls(e.attrs,h.attrs,["LANGUAGE"]))return u}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&Ln(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),s=e.details,o=s==null?void 0:s.age;this.log(`Loading audio-track ${n} "${e.name}" lang:${e.lang} group:${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(p.AUDIO_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}}class Iu{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,n){if(this.queues===null||this.tracks===null)return;const i=this.queues[t];i.push(e),i.length===1&&!n&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const n={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const n={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(n)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const n=(t=e[0])==null?void 0:t.label;(n==="async-blocker"||n==="async-blocker-prepend")&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(this.queues===null)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(this.queues===null||this.tracks===null)return;const t=this.queues[e];if(t.length){const i=t[0];try{i.execute()}catch(r){var n;if(i.onError(r),this.queues===null||this.tracks===null)return;const s=(n=this.tracks[e])==null?void 0:n.buffer;s!=null&&s.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues!==null&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return((t=this.queues)==null?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return e===null||t===null?"<destroyed>":`
|
|
${this.list("video")}
|
|
${this.list("audio")}
|
|
${this.list("audiovideo")}}`}list(e){var t,n;return(t=this.queues)!=null&&t[e]||(n=this.tracks)!=null&&n[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const n=(t=this.tracks)==null?void 0:t[e],i=n==null?void 0:n.buffer;return i?`SourceBuffer${i.updating?" updating":""}${n.ended?" ended":""}${n.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(n=>n.label).join(", "))||""}}const So=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,xo="HlsJsTrackRemovedError";class Lu extends Error{constructor(e){super(e),this.name=xo}}class Cu extends k{constructor(e,t){super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=n=>{var i;this.hls&&((i=this.mediaSource)==null?void 0:i.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=n=>{const{media:i,mediaSource:r}=this;n&&this.log("Media source opened"),!(!i||!r)&&(r.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(p.MEDIA_ATTACHED,{media:i,mediaSource:r}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:i}=this;n!==i&&this.error(`Media element src was set while attaching MediaSource (${i} > ${n})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=Ne(Se(e.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_APPENDING,this.onBufferAppending,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.BUFFER_EOS,this.onBufferEos,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.FRAG_PARSED,this.onFragParsed,this),e.on(p.FRAG_CHANGED,this.onFragChanged,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_APPENDING,this.onBufferAppending,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_EOS,this.onBufferEos,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.FRAG_PARSED,this.onFragParsed,this),e.off(p.FRAG_CHANGED,this.onFragChanged,this),e.off(p.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const n={};if(this.operationQueue){const r=this.isUpdating();r||this.operationQueue.removeBlockers();const s=this.isQueued();(r||s)&&this.warn(`Transfering MediaSource with${s?" operations in queue":""}${r?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const i=this.transferData;return!this.sourceBufferCount&&i&&i.mediaSource===t?m(n,i.tracks):this.sourceBuffers.forEach(r=>{const[s]=r;s&&(n[s]=m({},this.tracks[s]),this.removeBuffer(s)),r[0]=r[1]=null}),{media:e,mediaSource:t,tracks:n}}initTracks(){const e={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=e,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var n;let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsTotal=i,this.log(`${i} bufferCodec event(s) expected.`),(n=this.transferData)!=null&&n.mediaSource&&this.sourceBufferCount&&i&&this.bufferCreated()}onMediaAttaching(e,t){const n=this.media=t.media;this.transferData=this.overrides=void 0;const i=Se(this.appendSource);if(i){const r=!!t.mediaSource;(r||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const s=this.mediaSource=t.mediaSource||new i;if(this.assignMediaSource(s),r)this._objectUrl=n.src,this.attachTransferred();else{const o=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{n.removeAttribute("src");const c=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||c&&s instanceof c,To(n),Du(n,o),n.load()}catch(c){n.src=o}else n.src=o}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,n;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(n=e.constructor)==null?void 0:n.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const n=this.tracks,i=t.tracks,r=i?Object.keys(i):null,s=r?r.length:0,o=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(i&&r&&s){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
|
|
required tracks: ${Ke(n,(c,u)=>c==="initSegment"?void 0:u)};
|
|
transfer tracks: ${Ke(i,(c,u)=>c==="initSegment"?void 0:u)}}`),!Te(i,n)){t.mediaSource=null,t.tracks=void 0;const c=e.currentTime,u=this.details,h=Math.max(c,(u==null?void 0:u.fragments[0].start)||0);if(h-c>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${c} -> ${h}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(i)}"->"${Object.keys(n)}") start time: ${h} currentTime: ${c}`),this.onMediaDetaching(p.MEDIA_DETACHING,{}),this.onMediaAttaching(p.MEDIA_ATTACHING,t),e.currentTime=h;return}this.transferData=void 0,r.forEach(c=>{const u=c,h=i[u];if(h){const f=h.buffer;if(f){const v=this.fragmentTracker,R=h.id;if(v.hasFragments(R)||v.hasParts(R)){const J=bn.getBuffered(f);v.detectEvictedFragments(u,J,R,null,!0)}const I=ya(u),q=[u,f];this.sourceBuffers[I]=q,f.updating&&this.operationQueue&&this.operationQueue.prependBlocker(u),this.trackSourceBuffer(u,h)}}}),o(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),o()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const n=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:i,mediaSource:r,_objectUrl:s}=this;if(r){if(this.log(`media source ${n?"transferring":"detaching"}`),n)this.sourceBuffers.forEach(([o])=>{o&&this.removeBuffer(o)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const o=r.readyState==="open";try{const c=r.sourceBuffers;for(let u=c.length;u--;)o&&c[u].abort(),r.removeSourceBuffer(c[u]);o&&r.endOfStream()}catch(c){this.warn(`onMediaDetaching: ${c.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(r.removeEventListener("startstreaming",this._onStartStreaming),r.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}i&&(i.removeEventListener("emptied",this._onMediaEmptied),n||(s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(i.removeAttribute("src"),this.appendSource&&To(i),i.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(p.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const n=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),n)try{var i;(i=this.mediaSource)!=null&&i.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(r){this.warn(`onBufferReset ${e}`,r)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[ya(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new Iu(this.tracks)}onBufferCodecs(e,t){var n;const i=this.tracks,r=Object.keys(t);this.log(`BUFFER_CODECS: "${r}" (current SB count ${this.sourceBufferCount})`);const s="audiovideo"in t&&(i.audio||i.video)||i.audiovideo&&("audio"in t||"video"in t),o=!s&&this.sourceBufferCount&&this.media&&r.some(c=>!i[c]);if(s||o){this.warn(`Unsupported transition between "${Object.keys(i)}" and "${r}" SourceBuffers`);return}r.forEach(c=>{var u,h;const f=t[c],{id:v,codec:R,levelCodec:I,container:q,metadata:J,supplemental:pe}=f;let _e=i[c];const ye=(u=this.transferData)==null||(u=u.tracks)==null?void 0:u[c],Me=ye!=null&&ye.buffer?ye:_e,Ge=(Me==null?void 0:Me.pendingCodec)||(Me==null?void 0:Me.codec),dt=Me==null?void 0:Me.levelCodec;_e||(_e=i[c]={buffer:void 0,listeners:[],codec:R,supplemental:pe,container:q,levelCodec:I,metadata:J,id:v});const We=Ht(Ge,dt),ot=We==null?void 0:We.replace(So,"$1");let at=Ht(R,I);const Je=(h=at)==null?void 0:h.replace(So,"$1");at&&We&&ot!==Je&&(c.slice(0,5)==="audio"&&(at=un(at,this.appendSource)),this.log(`switching codec ${Ge} to ${at}`),at!==(_e.pendingCodec||_e.codec)&&(_e.pendingCodec=at),_e.container=q,this.appendChangeType(c,q,at))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!t.video&&((n=t.audio)==null?void 0:n.id)==="main"&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks())}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{const n=this.tracks[t];return e[t]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},e},{})}appendChangeType(e,t,n){const i=`${t};codecs=${n}`,r={label:`change-type=${i}`,execute:()=>{const s=this.tracks[e];if(s){const o=s.buffer;o!=null&&o.changeType&&(this.log(`changing ${e} sourceBuffer type to ${i}`),o.changeType(i),s.codec=n,s.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:s=>{this.warn(`Failed to change ${e} SourceBuffer type`,s)}};this.append(r,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const n=e.start,i=n+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(n,ne.MAIN))==null?void 0:t.gap)===!0)return;const s={label:"block-audio",execute:()=>{var o;const c=this.tracks.video;(this.lastVideoAppendEnd>i||c!=null&&c.buffer&&bn.isBuffered(c.buffer,i)||((o=this.fragmentTracker.getAppendedFrag(i,ne.MAIN))==null?void 0:o.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:o=>{this.warn("Error executing block-audio operation",o)}};this.blockedAudioAppend={op:s,frag:e},this.append(s,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:n}=this,{data:i,type:r,parent:s,frag:o,part:c,chunkMeta:u,offset:h}=t,f=u.buffering[r],{sn:v,cc:R}=o,I=self.performance.now();f.start=I;const q=o.stats.buffering,J=c?c.stats.buffering:null;q.start===0&&(q.start=I),J&&J.start===0&&(J.start=I);const pe=n.audio;let _e=!1;r==="audio"&&(pe==null?void 0:pe.container)==="audio/mpeg"&&(_e=!this.lastMpegAudioChunk||u.id===1||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);const ye=n.video,Me=ye==null?void 0:ye.buffer;if(Me&&v!=="initSegment"){const We=c||o,ot=this.blockedAudioAppend;if(r==="audio"&&s!=="main"&&!this.blockedAudioAppend&&!(ye.ending||ye.ended)){const Je=We.start+We.duration*.05,wt=Me.buffered,Xt=this.currentOp("video");!wt.length&&!Xt?this.blockAudio(We):!Xt&&!bn.isBuffered(Me,Je)&&this.lastVideoAppendEnd<Je&&this.blockAudio(We)}else if(r==="video"){const at=We.end;if(ot){const Je=ot.frag.start;(at>Je||at<this.lastVideoAppendEnd||bn.isBuffered(Me,Je))&&this.unblockAudio()}this.lastVideoAppendEnd=at}}const Ge=(c||o).start,dt={label:`append-${r}`,execute:()=>{var We;f.executeStart=self.performance.now();const ot=(We=this.tracks[r])==null?void 0:We.buffer;ot&&(_e?this.updateTimestampOffset(ot,Ge,.1,r,v,R):h!==void 0&&x(h)&&this.updateTimestampOffset(ot,h,1e-6,r,v,R)),this.appendExecutor(i,r)},onStart:()=>{},onComplete:()=>{const We=self.performance.now();f.executeEnd=f.end=We,q.first===0&&(q.first=We),J&&J.first===0&&(J.first=We);const ot={};this.sourceBuffers.forEach(([at,Je])=>{at&&(ot[at]=bn.getBuffered(Je))}),this.appendErrors[r]=0,r==="audio"||r==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(p.BUFFER_APPENDED,{type:r,frag:o,part:c,chunkMeta:u,parent:o.type,timeRanges:ot})},onError:We=>{var ot;const at={type:ue.MEDIA_ERROR,parent:o.type,details:G.BUFFER_APPEND_ERROR,sourceBufferName:r,frag:o,part:c,chunkMeta:u,error:We,err:We,fatal:!1},Je=(ot=this.media)==null?void 0:ot.error;if(We.code===DOMException.QUOTA_EXCEEDED_ERR||We.name=="QuotaExceededError"||"quota"in We)at.details=G.BUFFER_FULL_ERROR;else if(We.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!Je)at.errorAction=Gt(!0);else if(We.name===xo&&this.sourceBufferCount===0)at.errorAction=Gt(!0);else{const wt=++this.appendErrors[r];this.warn(`Failed ${wt}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${Je||"no media error"})`),(wt>=this.hls.config.appendErrorMaxRetry||Je)&&(at.fatal=!0)}this.hls.trigger(p.ERROR,at)}};this.log(`queuing "${r}" append sn: ${v}${c?" p: "+c.index:""} of ${o.type===ne.MAIN?"level":"track"} ${o.level} cc: ${R}`),this.append(dt,r,this.isPending(this.tracks[r]))}getFlushOp(e,t,n){return this.log(`queuing "${e}" remove ${t}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(p.BUFFER_FLUSHED,{type:e})},onError:i=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,i)}}}onBufferFlushing(e,t){const{type:n,startOffset:i,endOffset:r}=t;n?this.append(this.getFlushOp(n,i,r),n):this.sourceBuffers.forEach(([s])=>{s&&this.append(this.getFlushOp(s,i,r),s)})}onFragParsed(e,t){const{frag:n,part:i}=t,r=[],s=i?i.elementaryStreams:n.elementaryStreams;s[V.AUDIOVIDEO]?r.push("audiovideo"):(s[V.AUDIO]&&r.push("audio"),s[V.VIDEO]&&r.push("video"));const o=()=>{const c=self.performance.now();n.stats.buffering.end=c,i&&(i.stats.buffering.end=c);const u=i?i.stats:n.stats;this.hls.trigger(p.FRAG_BUFFERED,{frag:n,part:i,stats:u,id:n.type})};r.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(o,r).catch(c=>{this.warn(`Fragment buffered callback ${c}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{if(e){const t=this.tracks[e];if(t)return!t.ended||t.ending}return!1})}onBufferEos(e,t){var n;this.sourceBuffers.forEach(([s])=>{if(s){const o=this.tracks[s];(!t.type||t.type===s)&&(o.ending=!0,o.ended||(o.ended=!0,this.log(`${s} buffer reached EOS`)))}});const i=((n=this.overrides)==null?void 0:n.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([s])=>{var o;return s&&!((o=this.tracks[s])!=null&&o.ended)})?i?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:s}=this;if(!s||s.readyState!=="open"){s&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${s.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),s.endOfStream(),this.hls.trigger(p.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(p.BUFFERED_TO_END,void 0)):t.type==="video"&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,t){if(t.details===G.BUFFER_APPEND_ERROR&&t.frag){var n;const i=(n=t.errorAction)==null?void 0:n.nextAutoLevel;x(i)&&i!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.sourceBufferCount)return;const i=e.config,r=n.currentTime,s=t.levelTargetDuration,o=t.live&&i.liveBackBufferLength!==null?i.liveBackBufferLength:i.backBufferLength;if(x(o)&&o>=0){const u=Math.max(o,s),h=Math.floor(r/s)*s-u;this.flushBackBuffer(r,s,h)}const c=i.frontBufferFlushThreshold;if(x(c)&&c>0){const u=Math.max(i.maxBufferLength,c),h=Math.max(u,s),f=Math.floor(r/s)*s+h;this.flushFrontBuffer(r,s,f)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach(([i,r])=>{if(r){const o=bn.getBuffered(r);if(o.length>0&&n>o.start(0)){var s;this.hls.trigger(p.BACK_BUFFER_REACHED,{bufferEnd:n});const c=this.tracks[i];if((s=this.details)!=null&&s.live)this.hls.trigger(p.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(c!=null&&c.ended){this.log(`Cannot flush ${i} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:i})}}})}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach(([i,r])=>{if(r){const s=bn.getBuffered(r),o=s.length;if(o<2)return;const c=s.start(o-1),u=s.end(o-1);if(n>c||e>=c&&e<=u)return;this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:i})}})}getDurationAndRange(){var e;const{details:t,mediaSource:n}=this;if(!t||!this.media||(n==null?void 0:n.readyState)!=="open")return null;const i=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&n.setLiveSeekableRange){const u=Math.max(0,t.fragmentStart),h=Math.max(u,i);return{duration:1/0,start:u,end:h}}return{duration:1/0}}const r=(e=this.overrides)==null?void 0:e.duration;if(r)return x(r)?{duration:r}:null;const s=this.media.duration,o=x(n.duration)?n.duration:0;return i>o&&i>s||!x(s)?{duration:i}:null}updateMediaSource({duration:e,start:t,end:n}){const i=this.mediaSource;!this.media||!i||i.readyState!=="open"||(i.duration!==e&&(x(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),i.duration=e),t!==void 0&&n!==void 0&&(this.log(`MediaSource duration is set to ${i.duration}. Setting seekable range to ${t}-${n}.`),i.setLiveSeekableRange(t,n)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${Ke(n)}`),this.tracksReady){var i;const r=(i=this.transferData)==null?void 0:i.tracks;r&&Object.keys(r).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,n])=>{if(t){const i=this.tracks[t];e[t]={buffer:n,container:i.container,codec:i.codec,supplemental:i.supplemental,levelCodec:i.levelCodec,id:i.id,metadata:i.metadata}}}),this.hls.trigger(p.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([t])=>{this.executeNext(t)})}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(p.ERROR,{type:ue.MEDIA_ERROR,details:G.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const r in e){const s=r,o=e[s];if(this.isPending(o)){const c=this.getTrackCodec(o,s),u=`${o.container};codecs=${c}`;o.codec=c,this.log(`creating sourceBuffer(${u})${this.currentOp(s)?" Queued":""} ${Ke(o)}`);try{const h=n.addSourceBuffer(u),f=ya(s),v=[s,h];t[f]=v,o.buffer=h}catch(h){var i;this.error(`error while trying to add sourceBuffer: ${h.message}`),this.shiftAndExecuteNext(s),(i=this.operationQueue)==null||i.removeBlockers(),delete this.tracks[s],this.hls.trigger(p.ERROR,{type:ue.MEDIA_ERROR,details:G.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,sourceBufferName:s,mimeType:u,parent:o.id});return}this.trackSourceBuffer(s,o)}}this.bufferCreated()}getTrackCodec(e,t){const n=e.supplemental;let i=e.codec;n&&(t==="video"||t==="audiovideo")&&Tt(n,"video")&&(i=Ft(i,n));const r=Ht(i,e.levelCodec);return r?t.slice(0,5)==="audio"?un(r,this.appendSource):r:""}trackSourceBuffer(e,t){const n=t.buffer;if(!n)return;const i=this.getTrackCodec(t,e);this.tracks[e]={buffer:n,codec:i,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(r,s)=>{const o=s.removedRanges;o!=null&&o.length&&this.hls.trigger(p.BUFFER_FLUSHED,{type:r})})}get mediaSrc(){var e,t;const n=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return n==null?void 0:n.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const n=this.currentOp(e);n&&(n.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var n;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${i}`,t),this.hls.trigger(p.ERROR,{type:ue.MEDIA_ERROR,details:G.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.currentOp(e);r&&r.onError(i)}updateTimestampOffset(e,t,n,i,r,s){const o=t-e.timestampOffset;Math.abs(o)>=n&&(this.log(`Updating ${i} SourceBuffer timestampOffset to ${t} (sn: ${r} cc: ${s})`),e.timestampOffset=t)}removeExecutor(e,t,n){const{media:i,mediaSource:r}=this,s=this.tracks[e],o=s==null?void 0:s.buffer;if(!i||!r||!o){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const c=x(i.duration)?i.duration:1/0,u=x(r.duration)?r.duration:1/0,h=Math.max(0,t),f=Math.min(n,c,u);f>h&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${h},${f}] from the ${e} SourceBuffer`),o.remove(h,f)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],i=n==null?void 0:n.buffer;if(!i)throw new Lu(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,i.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:n}=this,i=t.map(s=>this.appendBlocker(s));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(i).then(s=>{n===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var n;const i=(n=this.tracks[t])==null?void 0:n.buffer;!i||i.updating||this.shiftAndExecuteNext(t)})}append(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((e,t)=>e+(this.isPending(this.tracks[t])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[t])=>e+(t?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,t,n){const i=this.tracks[e];if(!i)return;const r=i.buffer;if(!r)return;const s=n.bind(this,e);i.listeners.push({event:t,listener:s}),r.addEventListener(t,s)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const n=t.buffer;n&&(t.listeners.forEach(i=>{n.removeEventListener(i.event,i.listener)}),t.listeners.length=0)}}function To(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function Du(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}function ya(a){return a==="audio"?1:0}class Ea{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&&x(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter((i,r)=>this.isLevelAllowed(i)&&r<=e);return this.clientRect=null,Ea.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,!t.width&&!t.height&&(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(t){}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some(n=>e.bitrate===n.bitrate&&e.width===n.width&&e.height===n.height)}static getMaxLevelByMediaSize(e,t,n){if(!(e!=null&&e.length))return-1;const i=(o,c)=>c?o.width!==c.width||o.height!==c.height:!0;let r=e.length-1;const s=Math.max(t,n);for(let o=0;o<e.length;o+=1){const c=e[o];if((c.width>=s||c.height>=s)&&i(c,e[o+1])){r=o;break}}return r}}const Bi={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},Ou={HLS:"h"};class hr{constructor(e,t){Array.isArray(e)&&(e=e.map(n=>n instanceof hr?n:new hr(n))),this.value=e,this.params=t}}const Pu="Dict";function ku(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 Mu(a,e,t,n){return new Error(`failed to ${a} "${ku(e)}" as ${t}`,{cause:n})}function fr(a,e,t){return Mu("serialize",a,e,t)}class wo{constructor(e){this.description=e}}const Ao="Bare Item",Nu="Boolean";function Bu(a){if(typeof a!="boolean")throw fr(a,Nu);return a?"?1":"?0"}function Fu(a){return btoa(String.fromCharCode(...a))}const $u="Byte Sequence";function Uu(a){if(ArrayBuffer.isView(a)===!1)throw fr(a,$u);return`:${Fu(a)}:`}const Ku="Integer";function Gu(a){return a<-999999999999999||999999999999999<a}function Ro(a){if(Gu(a))throw fr(a,Ku);return a.toString()}function Vu(a){return`@${Ro(a.getTime()/1e3)}`}function Io(a,e){if(a<0)return-Io(-a,e);const t=Math.pow(10,e);if(Math.abs(a*t%1-.5)<Number.EPSILON){const i=Math.floor(a*t);return(i%2===0?i:i+1)/t}else return Math.round(a*t)/t}const ju="Decimal";function Hu(a){const e=Io(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw fr(a,ju);const t=e.toString();return t.includes(".")?t:`${t}.0`}const zu="String",Wu=/[\x00-\x1f\x7f]+/;function Zu(a){if(Wu.test(a))throw fr(a,zu);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Yu(a){return a.description||a.toString().slice(7,-1)}const Xu="Token";function Lo(a){const e=Yu(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw fr(e,Xu);return e}function ba(a){switch(typeof a){case"number":if(!x(a))throw fr(a,Ao);return Number.isInteger(a)?Ro(a):Hu(a);case"string":return Zu(a);case"symbol":return Lo(a);case"boolean":return Bu(a);case"object":if(a instanceof Date)return Vu(a);if(a instanceof Uint8Array)return Uu(a);if(a instanceof wo)return Lo(a);default:throw fr(a,Ao)}}const Qu="Key";function Sa(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw fr(a,Qu);return a}function xa(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${Sa(e)}`:`;${Sa(e)}=${ba(t)}`).join("")}function Co(a){return a instanceof hr?`${ba(a.value)}${xa(a.params)}`:ba(a)}function Ju(a){return`(${a.value.map(Co).join(" ")})${xa(a.params)}`}function qu(a,e={whitespace:!0}){if(typeof a!="object"||a==null)throw fr(a,Pu);const t=a instanceof Map?a.entries():Object.entries(a),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof hr||(r=new hr(r));let s=Sa(i);return r.value===!0?s+=xa(r.params):(s+="=",Array.isArray(r.value)?s+=Ju(r):s+=Co(r)),s}).join(`,${n}`)}function Do(a,e){return qu(a,e)}const pr="CMCD-Object",ui="CMCD-Request",Dr="CMCD-Session",Ar="CMCD-Status",ec={br:pr,ab:pr,d:pr,ot:pr,tb:pr,tpb:pr,lb:pr,tab:pr,lab:pr,url:pr,pb:ui,bl:ui,tbl:ui,dl:ui,ltc:ui,mtp:ui,nor:ui,nrr:ui,rc:ui,sn:ui,sta:ui,su:ui,ttfb:ui,ttfbb:ui,ttlb:ui,cmsdd:ui,cmsds:ui,smrt:ui,df:ui,cs:ui,ts:ui,cid:Dr,pr:Dr,sf:Dr,sid:Dr,st:Dr,v:Dr,msd:Dr,bs:Ar,bsd:Ar,cdn:Ar,rtp:Ar,bg:Ar,pt:Ar,ec:Ar,e:Ar},tc={REQUEST:ui};function nc(a){return Object.keys(a).reduce((e,t)=>{var n;return(n=a[t])===null||n===void 0||n.forEach(i=>e[i]=t),e},{})}function ic(a,e){const t={};if(!a)return t;const n=Object.keys(a),i=e?nc(e):{};return n.reduce((r,s)=>{var o;const c=ec[s]||i[s]||tc.REQUEST,u=(o=r[c])!==null&&o!==void 0?o:r[c]={};return u[s]=a[s],r},t)}function rc(a){return["ot","sf","st","e","sta"].includes(a)}function sc(a){return typeof a=="number"?x(a):a!=null&&a!==""&&a!==!1}const Oo="event";function ac(a,e){const t=new URL(a),n=new URL(e);if(t.origin!==n.origin)return a;const i=t.pathname.split("/").slice(1),r=n.pathname.split("/").slice(1,-1);for(;i[0]===r[0];)i.shift(),r.shift();for(;r.length;)r.shift(),i.unshift("..");return i.join("/")+t.search+t.hash}const Ps=a=>Math.round(a),Ta=(a,e)=>Array.isArray(a)?a.map(t=>Ta(t,e)):a instanceof hr&&typeof a.value=="string"?new hr(Ta(a.value,e),a.params):(e.baseUrl&&(a=ac(a,e.baseUrl)),e.version===1?encodeURIComponent(a):a),ks=a=>Ps(a/100)*100,oc={br:Ps,d:Ps,bl:ks,dl:ks,mtp:ks,nor:(a,e)=>{let t=a;return e.version>=2&&(a instanceof hr&&typeof a.value=="string"?t=new hr([a]):typeof a=="string"&&(t=[a])),Ta(t,e)},rtp:ks,tb:Ps},Po="request",ko="response",wa=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],lc=["e"],uc=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function Ms(a){return uc.test(a)}function cc(a){return wa.includes(a)||lc.includes(a)||Ms(a)}const Mo=["d","dl","nor","ot","rtp","su"];function dc(a){return wa.includes(a)||Mo.includes(a)||Ms(a)}const hc=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];function fc(a){return wa.includes(a)||Mo.includes(a)||hc.includes(a)||Ms(a)}const pc=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function mc(a){return pc.includes(a)||Ms(a)}const gc={[ko]:fc,[Oo]:cc,[Po]:dc};function No(a,e={}){const t={};if(a==null||typeof a!="object")return t;const n=e.version||a.v||1,i=e.reportingMode||Po,r=n===1?mc:gc[i];let s=Object.keys(a).filter(r);const o=e.filter;typeof o=="function"&&(s=s.filter(o));const c=i===ko||i===Oo;c&&!s.includes("ts")&&s.push("ts"),n>1&&!s.includes("v")&&s.push("v");const u=m({},oc,e.formatters),h={version:n,reportingMode:i,baseUrl:e.baseUrl};return s.sort().forEach(f=>{let v=a[f];const R=u[f];if(typeof R=="function"&&(v=R(v,h)),f==="v"){if(n===1)return;v=n}f=="pr"&&v===1||(c&&f==="ts"&&!x(v)&&(v=Date.now()),sc(v)&&(rc(f)&&typeof v=="string"&&(v=new wo(v)),t[f]=v))}),t}function _c(a,e={}){const t={};if(!a)return t;const n=No(a,e),i=ic(n,e==null?void 0:e.customHeaderMap);return Object.entries(i).reduce((r,[s,o])=>{const c=Do(o,{whitespace:!1});return c&&(r[s]=c),r},t)}function vc(a,e,t){return m(a,_c(e,t))}const yc="CMCD";function Ec(a,e={}){return a?Do(No(a,e),{whitespace:!1}):""}function bc(a,e={}){if(!a)return"";const t=Ec(a,e);return encodeURIComponent(t)}function Sc(a,e={}){if(!a)return"";const t=bc(a,e);return`${yc}=${t}`}const Bo=/CMCD=[^&#]+/;function xc(a,e,t){const n=Sc(e,t);if(!n)return a;if(Bo.test(a))return a.replace(Bo,n);const i=a.includes("?")?"&":"?";return`${a}${i}${n}`}class Tc{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:Bi.MANIFEST,su:!this.initialized})}catch(r){this.hls.logger.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const{frag:r,part:s}=i,o=this.hls.levels[r.level],c=this.getObjectType(r),u={d:(s||r).duration*1e3,ot:c};(c===Bi.VIDEO||c===Bi.AUDIO||c==Bi.MUXED)&&(u.br=o.bitrate/1e3,u.tb=this.getTopBandwidth(c)/1e3,u.bl=this.getBufferLength(c));const h=s?this.getNextPart(s):this.getNextFrag(r);h!=null&&h.url&&h.url!==r.url&&(u.nor=h.url),this.apply(i,u)}catch(r){this.hls.logger.warn("Could not generate segment CMCD data.",r)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||e.sessionId,this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHED,this.onMediaDetached,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHED,this.onMediaDetached,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,i;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:Ou.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){m(t,this.createData());const n=t.ot===Bi.INIT||t.ot===Bi.VIDEO||t.ot===Bi.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((s,o)=>(i.includes(o)&&(s[o]=t[o]),s),{}));const r={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),vc(e.headers,t,r)):e.url=xc(e.url,t,r)}getNextFrag(e){var t;const n=(t=this.hls.levels[e.level])==null?void 0:t.details;if(n){const i=e.sn-n.startSN;return n.fragments[i+1]}}getNextPart(e){var t;const{index:n,fragment:i}=e,r=(t=this.hls.levels[i.level])==null||(t=t.details)==null?void 0:t.partList;if(r){const{sn:s}=i;for(let o=r.length-1;o>=0;o--){const c=r[o];if(c.index===n&&c.fragment.sn===s)return r[o+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Bi.TIMED_TEXT;if(e.sn==="initSegment")return Bi.INIT;if(t==="audio")return Bi.AUDIO;if(t==="main")return this.hls.audioTracks.length?Bi.VIDEO:Bi.MUXED}getTopBandwidth(e){let t=0,n;const i=this.hls;if(e===Bi.AUDIO)n=i.audioTracks;else{const r=i.maxAutoLevel,s=r>-1?r+1:i.levels.length;n=i.levels.slice(0,s)}return n.forEach(r=>{r.bitrate>t&&(t=r.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,n=e===Bi.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:bn.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new n(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,s,o){t(r),this.loader.load(r,s,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new n(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,s,o){t(r),this.loader.load(r,s,o)}}}}const wc=3e5;class Ac extends k{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,t)=>(e.indexOf(t.pathwayId)===-1&&e.push(t.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(n=>n!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:n}=t;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((n==null?void 0:n.action)===Cn.SendAlternateToPenaltyBox&&n.flags===kn.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this._pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:o,pathwayId:c,type:u}=t.context;o&&i?s=this.getPathwayForGroupId(o,u,s):c&&(s=c)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!r&&i&&(r=this.pathways()),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==s),t.details===G.BUFFER_APPEND_ERROR&&!t.fatal?n.resolved=!0:n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${i&&i.length} priorities: ${Ke(r)} penalized: ${Ke(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this._pathwayPriority=e;let t;const n=this.penalizedPathways,i=performance.now();Object.keys(n).forEach(r=>{i-n[r]>wc&&delete n[r]});for(let r=0;r<e.length;r++){const s=e[r];if(s in n)continue;if(s===this.pathwayId)return;const o=this.hls.nextLoadLevel,c=this.hls.levels[o];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,Ri(t),this.hls.trigger(p.LEVELS_UPDATED,{levels:t});const u=this.hls.levels[o];c&&u&&this.levels&&(u.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&u.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${u.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let r=0;r<i.length;r++)if(t===se.AUDIO_TRACK&&i[r].hasAudioGroup(e)||t===se.SUBTITLE_TRACK&&i[r].hasSubtitleGroup(e))return i[r].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},i={};e.forEach(r=>{const{ID:s,"BASE-ID":o,"URI-REPLACEMENT":c}=r;if(t.some(h=>h.pathwayId===s))return;const u=this.getLevelsForPathway(o).map(h=>{const f=new Vn(h.attrs);f["PATHWAY-ID"]=s;const v=f.AUDIO&&`${f.AUDIO}_clone_${s}`,R=f.SUBTITLES&&`${f.SUBTITLES}_clone_${s}`;v&&(n[f.AUDIO]=v,f.AUDIO=v),R&&(i[f.SUBTITLES]=R,f.SUBTITLES=R);const I=$o(h.uri,f["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),q=new Wt({attrs:f,audioCodec:h.audioCodec,bitrate:h.bitrate,height:h.height,name:h.name,url:I,videoCodec:h.videoCodec,width:h.width});if(h.audioGroups)for(let J=1;J<h.audioGroups.length;J++)q.addGroupId("audio",`${h.audioGroups[J]}_clone_${s}`);if(h.subtitleGroups)for(let J=1;J<h.subtitleGroups.length;J++)q.addGroupId("text",`${h.subtitleGroups[J]}_clone_${s}`);return q});t.push(...u),Fo(this.audioTracks,n,c,s),Fo(this.subtitleTracks,i,c,s)})}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);let i;try{i=new self.URL(e)}catch(h){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const h=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+h)}const r={responseType:"json",url:i.href},s=t.steeringManifestLoadPolicy.default,o=s.errorRetry||s.timeoutRetry||{},c={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},u={onSuccess:(h,f,v,R)=>{this.log(`Loaded steering manifest: "${i}"`);const I=h.data;if((I==null?void 0:I.VERSION)!==1){this.log(`Steering VERSION ${I.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=I.TTL;const{"RELOAD-URI":q,"PATHWAY-CLONES":J,"PATHWAY-PRIORITY":pe}=I;if(q)try{this.uri=new self.URL(q,i).href}catch(ye){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${q}`);return}this.scheduleRefresh(this.uri||v.url),J&&this.clonePathways(J);const _e={steeringManifest:I,url:i.toString()};this.hls.trigger(p.STEERING_MANIFEST_LOADED,_e),pe&&this.updatePathwayPriority(pe)},onError:(h,f,v,R)=>{if(this.log(`Error loading steering manifest: ${h.code} ${h.text} (${f.url})`),this.stopLoad(),h.code===410){this.enabled=!1,this.log(`Steering manifest ${f.url} no longer available`);return}let I=this.timeToLoad*1e3;if(h.code===429){const q=this.loader;if(typeof(q==null?void 0:q.getResponseHeader)=="function"){const J=q.getResponseHeader("Retry-After");J&&(I=parseFloat(J)*1e3)}this.log(`Steering manifest ${f.url} rate limited`);return}this.scheduleRefresh(this.uri||f.url,I)},onTimeout:(h,f,v)=>{this.log(`Timeout loading steering manifest (${f.url})`),this.scheduleRefresh(this.uri||f.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,c,u)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const i=(n=this.hls)==null?void 0:n.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function Fo(a,e,t,n){a&&Object.keys(e).forEach(i=>{const r=a.filter(s=>s.groupId===i).map(s=>{const o=m({},s);return o.details=void 0,o.attrs=new Vn(o.attrs),o.url=o.attrs.URI=$o(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[i],o.attrs["PATHWAY-ID"]=n,o});a.push(...r)})}function $o(a,e,t,n){const{HOST:i,PARAMS:r,[t]:s}=n;let o;e&&(o=s==null?void 0:s[e],o&&(a=o));const c=new self.URL(a);return i&&!o&&(c.host=i),r&&Object.keys(r).sort().forEach(u=>{u&&c.searchParams.set(u,r[u])}),c.href}class Vr extends k{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.mediaResolved=void 0,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=Vr.CDMCleanupPromise?[Vr.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=t=>{const{initDataType:n,initData:i}=t,r=`"${t.type}" event: init data type: "${n}"`;if(this.debug(r),i!==null){if(!this.keyFormatPromise){let s=Object.keys(this.keySystemAccessPromises);s.length||(s=cr(this.config));const o=s.map(wi).filter(c=>!!c);this.keyFormatPromise=this.getKeyFormatPromise(o)}this.keyFormatPromise.then(s=>{const o=Yi(s);if(n!=="sinf"||o!==An.FAIRPLAY){this.log(`Ignoring "${t.type}" event with init data type: "${n}" for selected key-system ${o}`);return}let c;try{const R=xe(new Uint8Array(i)),I=gr(JSON.parse(R).sinf),q=we(I);if(!q)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=new Uint8Array(q.subarray(8,24))}catch(R){this.warn(`${r} Failed to parse sinf: ${R}`);return}const u=ie(c),{keyIdToKeySessionPromise:h,mediaKeySessions:f}=this;let v=h[u];for(let R=0;R<f.length;R++){const I=f[R],q=I.decryptdata;if(!q.keyId)continue;const J=ie(q.keyId);if(yi(c,q.keyId)||q.uri.replace(/-/g,"").indexOf(u)!==-1){if(v=h[J],!v)continue;if(q.pssh)break;delete h[J],q.pssh=new Uint8Array(i),q.keyId=c,v=h[u]=v.then(()=>this.generateRequestWithPreferredKeySession(I,n,i,"encrypted-event-key-match")),v.catch(pe=>this.handleError(pe));break}}v||this.handleError(new Error(`Key ID ${u} not encountered in playlist. Key-system sessions ${f.length}.`))}).catch(s=>this.handleError(s))}},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,i=t==null?void 0:t[e];if(i)return i.licenseUrl;if(e===An.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==null?void 0:t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(s,o,c)=>!!s&&c.indexOf(s)===o,i=t.map(s=>s.audioCodec).filter(n),r=t.map(s=>s.videoCodec).filter(n);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise((s,o)=>{const c=u=>{const h=u.shift();this.getMediaKeysPromise(h,i,r).then(f=>s({keySystem:h,mediaKeys:f})).catch(f=>{u.length?c(u):f instanceof Hi?o(f):o(new Hi({type:ue.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_NO_ACCESS,error:f,fatal:!0},f.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return _r===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return n(e,t)}getMediaKeysPromise(e,t,n){var i;const r=hs(e,t,n,this.config.drmSystemOptions||{});let s=this.keySystemAccessPromises[e],o=(i=s)==null?void 0:i.keySystemAccess;if(!o){this.log(`Requesting encrypted media "${e}" key-system access with config: ${Ke(r)}`),o=this.requestMediaKeySystemAccess(e,r);const c=s=this.keySystemAccessPromises[e]={keySystemAccess:o};return o.catch(u=>{this.log(`Failed to obtain access to key-system "${e}": ${u}`)}),o.then(u=>{this.log(`Access for key-system "${u.keySystem}" obtained`);const h=this.fetchServerCertificate(e);this.log(`Create media-keys for "${e}"`);const f=c.mediaKeys=u.createMediaKeys().then(v=>(this.log(`Media-keys created for "${e}"`),c.hasMediaKeys=!0,h.then(R=>R?this.setMediaKeysServerCertificate(v,e,R):v)));return f.catch(v=>{this.error(`Failed to create media-keys for "${e}"}: ${v}`)}),f})}return o.then(()=>s.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${ie(e.keyId||[])} keyUri: ${e.uri}`);const i=n.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),i=Ns(t),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(n,r,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}updateKeySession(e,t){const n=e.mediaKeysSession;return this.log(`Updating key-session "${n.sessionId}" for keyId ${ie(e.decryptdata.keyId||[])}
|
|
} (data length: ${t.byteLength})`),n.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>wi(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:n})=>this.attemptSetMediaKeys(t,n))}selectKeySystem(e){return new Promise((t,n)=>{this.getKeySystemSelectionPromise(e).then(({keySystem:i})=>{const r=wi(i);r?t(r):n(new Error(`Unable to find format for key-system "${i}"`))}).catch(n)})}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=cr(this.config),n=e.map(Yi).filter(i=>!!i&&t.indexOf(i)!==-1);return this.selectKeySystem(n)}getKeyStatus(e){const{mediaKeySessions:t}=this;for(let n=0;n<t.length;n++){const i=Rc(e,t[n]);if(i)return i}}loadKey(e){const t=e.keyInfo.decryptdata,n=Ns(t),i=this.bannedKeyIds[n];if(i||this.getKeyStatus(t)==="internal-error"){const o=Uo(i||"internal-error",t);return this.handleError(o,e.frag),Promise.reject(o)}const r=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${r}`);const s=this.keyIdToKeySessionPromise[n];if(!s){const o=this.getKeySystemForKeyPromise(t).then(({keySystem:c,mediaKeys:u})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${r}`),this.attemptSetMediaKeys(c,u).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:c,mediaKeys:u,decryptdata:t}))))).then(c=>{const u="cenc",h=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(c,u,h,"playlist-key")});return o.catch(c=>this.handleError(c,e.frag)),this.keyIdToKeySessionPromise[n]=o,o}return s.catch(o=>{if(o instanceof Hi){const c=E({},o.data);this.getKeyStatus(t)==="internal-error"&&(c.decryptdata=t);const u=new Hi(c,o.message);this.handleError(u,e.frag)}}),s}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e,t){if(this.hls)if(e instanceof Hi){t&&(e.data.frag=t);const n=e.data.decryptdata;this.error(`${e.message}${n?` (${ie(n.keyId||[])})`:""}`),this.hls.trigger(p.ERROR,e.data)}else this.error(e.message),this.hls.trigger(p.ERROR,{type:ue.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0})}getKeySystemForKeyPromise(e){const t=Ns(e),n=this.keyIdToKeySessionPromise[t];if(!n){const i=Yi(e.keyFormat),r=i?[i]:cr(this.config);return this.attemptKeySystemAccess(r)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=cr(this.config)),e.length===0)throw new Hi({type:ue.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${Ke({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaResolved=void 0,this.mediaKeys===t)return Promise.resolve();const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(n).then(()=>this.media?this.media.setMediaKeys(t):new Promise((r,s)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return s(new Error("Attempted to set mediaKeys without media element attached"));this.mediaKeys=t,this.media.setMediaKeys(t).then(r).catch(s)}}));return this.mediaKeys=t,this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>n.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(e,t,n,i){var r;const s=(r=this.config.drmSystems)==null||(r=r[e.keySystem])==null?void 0:r.generateRequest;if(s)try{const I=s.call(this.hls,t,n,e);if(!I)throw new Error("Invalid response from configured generateRequest filter");t=I.initDataType,n=I.initData?I.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(I){if(this.warn(I.message),this.hls&&this.hls.config.debug)throw I}if(n===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const o=Ns(e.decryptdata),c=e.decryptdata.uri;this.log(`Generating key-session request for "${i}" keyId: ${o} URI: ${c} (init data type: ${t} length: ${n.byteLength})`);const u=new ra,h=e._onmessage=I=>{const q=e.mediaKeysSession;if(!q){u.emit("error",new Error("invalid state"));return}const{messageType:J,message:pe}=I;this.log(`"${J}" message event for session "${q.sessionId}" message size: ${pe.byteLength}`),J==="license-request"||J==="license-renewal"?this.renewLicense(e,pe).catch(_e=>{u.eventNames().length?u.emit("error",_e):this.handleError(_e)}):J==="license-release"?e.keySystem===An.FAIRPLAY&&this.updateKeySession(e,ir("acknowledged")).then(()=>this.removeSession(e)).catch(_e=>this.handleError(_e)):this.warn(`unhandled media key message type "${J}"`)},f=(I,q)=>{q.keyStatus=I;let J;I.startsWith("usable")?u.emit("resolved"):I==="internal-error"||I==="output-restricted"||I==="output-downscaled"?J=Uo(I,q.decryptdata):I==="expired"?J=new Error(`key expired (keyId: ${o})`):I==="released"?J=new Error("key released"):I==="status-pending"||this.warn(`unhandled key status change "${I}" (keyId: ${o})`),J&&(u.eventNames().length?u.emit("error",J):this.handleError(J))},v=e._onkeystatuseschange=I=>{if(!e.mediaKeysSession){u.emit("error",new Error("invalid state"));return}const J=this.getKeyStatuses(e);if(!Object.keys(J).some(Me=>J[Me]!=="status-pending"))return;if(J[o]==="expired"){this.log(`Expired key ${Ke(J)} in key-session "${e.mediaKeysSession.sessionId}"`),this.renewKeySession(e);return}let _e=J[o];if(_e)f(_e,e);else{var ye;e.keyStatusTimeouts||(e.keyStatusTimeouts={}),(ye=e.keyStatusTimeouts)[o]||(ye[o]=self.setTimeout(()=>{if(!e.mediaKeysSession||!this.mediaKeys)return;const Ge=this.getKeyStatus(e.decryptdata);if(Ge&&Ge!=="status-pending")return this.log(`No status for keyId ${o} in key-session "${e.mediaKeysSession.sessionId}". Using session key-status ${Ge} from other session.`),f(Ge,e);this.log(`key status for ${o} in key-session "${e.mediaKeysSession.sessionId}" timed out after 1000ms`),_e="internal-error",f(_e,e)},1e3)),this.log(`No status for keyId ${o} (${Ke(J)}).`)}};ki(e.mediaKeysSession,"message",h),ki(e.mediaKeysSession,"keystatuseschange",v);const R=new Promise((I,q)=>{u.on("error",q),u.on("resolved",I)});return e.mediaKeysSession.generateRequest(t,n).then(()=>{this.log(`Request generated for key-session "${e.mediaKeysSession.sessionId}" keyId: ${o} URI: ${c}`)}).catch(I=>{throw new Hi({type:ue.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_NO_SESSION,error:I,decryptdata:e.decryptdata,fatal:!1},`Error generating key-session request: ${I}`)}).then(()=>R).catch(I=>(u.removeAllListeners(),this.removeSession(e).then(()=>{throw I}))).then(()=>(u.removeAllListeners(),e))}getKeyStatuses(e){const t={};return e.mediaKeysSession.keyStatuses.forEach((n,i)=>{if(typeof i=="string"&&typeof n=="object"){const o=i;i=n,n=o}const r="buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i);if(e.keySystem===An.PLAYREADY&&r.length===16){const o=ie(r);t[o]=n,sn(r)}const s=ie(r);n==="internal-error"&&(this.bannedKeyIds[s]=n),this.log(`key status change "${n}" for keyStatuses keyId: ${s} key-session "${e.mediaKeysSession.sessionId}"`),t[s]=n}),t}fetchServerCertificate(e){const t=this.config,n=t.loader,i=new n(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise((s,o)=>{const c={responseType:"arraybuffer",url:r},u=t.certLoadPolicy.default,h={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(v,R,I,q)=>{s(v.data)},onError:(v,R,I,q)=>{o(new Hi({type:ue.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:I,response:E({url:c.url,data:void 0},v)},`"${e}" certificate request failed (${r}). Status: ${v.code} (${v.text})`))},onTimeout:(v,R,I)=>{o(new Hi({type:ue.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:I,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(v,R,I)=>{o(new Error("aborted"))}};i.load(c,h,f)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((i,r)=>{e.setServerCertificate(n).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${n.byteLength}) on "${t}"`),i(e)}).catch(s=>{r(new Hi({type:ue.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:s,fatal:!0},s.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(i=>{throw new Hi({type:ue.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:e.decryptdata,error:i,fatal:!1},i.message)}))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(n,"application/xml"),r=i.querySelectorAll("HttpHeader");if(r.length>0){let h;for(let f=0,v=r.length;f<v;f++){var s,o;h=r[f];const R=(s=h.querySelector("name"))==null?void 0:s.textContent,I=(o=h.querySelector("value"))==null?void 0:o.textContent;R&&I&&e.setRequestHeader(R,I)}}const c=i.querySelector("Challenge"),u=c==null?void 0:c.textContent;if(!u)throw new Error("Cannot find <Challenge> in key message");return ir(atob(u))}setupLicenseXHR(e,t,n,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,n,i)}).catch(s=>{if(!n.decryptdata)throw s;return e.open("POST",t,!0),r.call(this.hls,e,t,n,i)}).then(s=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:s||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((i,r)=>{const s=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${s}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let c=o.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const u=this.config.licenseResponseCallback;if(u)try{c=u.call(this.hls,o,s,e)}catch(h){this.error(h)}i(c)}else{const c=n.errorRetry,u=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||o.status>=400&&o.status<500)r(new Hi({type:ue.KEY_SYSTEM_ERROR,details:G.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,fatal:!0,networkDetails:o,response:{url:s,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${s}). Status: ${o.status} (${o.statusText})`));else{const h=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${h} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,s,e,t).then(({xhr:c,licenseChallenge:u})=>{e.keySystem==An.PLAYREADY&&(u=this.unpackPlayReadyKeyMessage(c,u)),c.send(u)}).catch(r)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,ki(n,"encrypted",this.onMediaEncrypted),ki(n,"waitingforkey",this.onWaitingForKey);const i=this.mediaResolved;i?i():this.mediaKeys=n.mediaKeys}onMediaDetached(){const e=this.media;e&&(Ni(e,"encrypted",this.onMediaEncrypted),Ni(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};const t=this.mediaResolved;if(t&&t(),!this.mediaKeys&&!this.mediaKeySessions.length)return;const n=this.media,i=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,Ki.clearKeyUriToKeyIdMap();const r=i.length;Vr.CDMCleanupPromise=Promise.all(i.map(s=>this.removeSession(s)).concat((n==null||(e=n.setMediaKeys(null))==null?void 0:e.catch(s=>{this.log(`Could not clear media keys: ${s}`),this.hls&&this.hls.trigger(p.ERROR,{type:ue.OTHER_ERROR,details:G.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${s}`)})}))||Promise.resolve())).catch(s=>{this.log(`Could not close sessions and clear media keys: ${s}`),this.hls&&this.hls.trigger(p.ERROR,{type:ue.OTHER_ERROR,details:G.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${s}`)})}).then(()=>{r&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this._clear()}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=t.reduce((i,r)=>(i.indexOf(r.keyFormat)===-1&&i.push(r.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n,decryptdata:i}=e;if(t){this.log(`Remove licenses and keys and close session "${t.sessionId}" keyId: ${ie((i==null?void 0:i.keyId)||[])}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),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{keyStatusTimeouts:s}=e;s&&Object.keys(s).forEach(u=>self.clearTimeout(s[u]));const{drmSystemOptions:o}=this.config;return(Zs(o)?new Promise((u,h)=>{self.setTimeout(()=>h(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(u).catch(h)}):Promise.resolve()).catch(u=>{this.log(`Could not remove session: ${u}`),this.hls&&this.hls.trigger(p.ERROR,{type:ue.OTHER_ERROR,details:G.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${u}`)})}).then(()=>t.close()).catch(u=>{this.log(`Could not close session: ${u}`),this.hls&&this.hls.trigger(p.ERROR,{type:ue.OTHER_ERROR,details:G.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${u}`)})})}return Promise.resolve()}}Vr.CDMCleanupPromise=void 0;function Ns(a){if(!a)throw new Error("Could not read keyId of undefined decryptdata");if(a.keyId===null)throw new Error("keyId is null");return ie(a.keyId)}function Rc(a,e){if(a.keyId&&e.mediaKeysSession.keyStatuses.has(a.keyId))return e.mediaKeysSession.keyStatuses.get(a.keyId);if(a.matches(e.decryptdata))return e.keyStatus}class Hi extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}function Uo(a,e){const t=a==="output-restricted",n=t?G.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:G.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new Hi({type:ue.KEY_SYSTEM_ERROR,details:n,fatal:!1,decryptdata:e},t?"HDCP level output restricted":`key status changed to "${a}"`)}class Ic{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(p.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(p.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,n){const i=performance.now();if(t){if(this.lastTime){const r=i-this.lastTime,s=n-this.lastDroppedFrames,o=t-this.lastDecodedFrames,c=1e3*s/r,u=this.hls;if(u.trigger(p.FPS_DROP,{currentDropped:s,currentDecoded:o,totalDroppedFrames:n}),c>0&&s>u.config.fpsDroppedMonitoringThreshold*o){let h=u.currentLevel;u.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=h)&&(h=h-1,u.trigger(p.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:u.currentLevel}),u.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}function Ko(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 Go(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){ae.debug(`[texttrack-utils]: ${n}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,a.addCue(i)}catch(i){ae.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function jr(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 Aa(a,e,t,n){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=Cc(a.cues,e,t);for(let s=0;s<r.length;s++)(!n||n(r[s]))&&a.removeCue(r[s])}i==="disabled"&&(a.mode=i)}function Lc(a,e){if(e<=a[0].startTime)return 0;const t=a.length-1;if(e>a[t].endTime)return-1;let n=0,i=t,r;for(;n<=i;)if(r=Math.floor((i+n)/2),e<a[r].startTime)i=r-1;else if(e>a[r].startTime&&n<t)n=r+1;else return r;return a[n].startTime-e<e-a[i].startTime?n:i}function Cc(a,e,t){const n=[],i=Lc(a,e);if(i>-1)for(let r=i,s=a.length;r<s;r++){const o=a[r];if(o.startTime>=e&&o.endTime<=t)n.push(o);else if(o.startTime>t)return n}return n}function Bs(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 Dc extends _a{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=Bs(this.media.textTracks);for(let r=0;r<n.length;r++)if(n[r].mode==="hidden")t=n[r];else if(n[r].mode==="showing"){t=n[r];break}const i=this.findTrackForTextTrack(t);this.subtitleTrack!==i&&this.setSubtitleTrack(i)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const n=this.media;if(!n)return;const i=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,i)return;Bs(n.textTracks).forEach(s=>{jr(s)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:i,details:r}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==i){this.warn(`Subtitle track with id:${n} and group:${i} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Subtitle track ${n} "${s.name}" lang:${s.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,i=this.groupIds;let r=this.currentTrack;if(!n||(i==null?void 0:i.length)!==(n==null?void 0:n.length)||n!=null&&n.some(s=>(i==null?void 0:i.indexOf(s))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const s=this.tracks.filter(h=>!n||n.indexOf(h.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(h=>h.default)&&(this.selectDefaultTrack=!1),s.forEach((h,f)=>{h.id=f});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const o=this.hls.config.subtitlePreference;if(!r&&o){this.selectDefaultTrack=!1;const h=Ut(o,s);if(h>-1)r=s[h];else{const f=Ut(o,this.tracks);r=this.tracks[f]}}let c=this.findTrackId(r);c===-1&&r&&(c=this.findTrackId(null));const u={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(p.SUBTITLE_TRACKS_UPDATED,u),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i<t.length;i++){const r=t[i];if(!(n&&!r.default||!n&&!e)&&(!e||cn(r,e)))return i}if(e){for(let i=0;i<t.length;i++){const r=t[i];if(ls(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const r=t[i];if(ls(e.attrs,r.attrs,["LANGUAGE"]))return i}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const i=t[n];if(va(i,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===se.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&&cn(e,n))return n;const i=Ut(e,this.tracksInGroup);if(i>-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(n)return null;{const r=Ut(e,t);if(r>-1)return t[r]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,i=e.groupId,r=this.getUrlWithDirectives(e.url,t),s=e.details,o=s==null?void 0:s.age;this.log(`Loading subtitle ${n} "${e.name}" lang:${e.lang} group:${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${r}`),this.hls.trigger(p.SUBTITLE_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Bs(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter(r=>va(n,r))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(r=>{r.mode!=="disabled"&&r!==i&&(r.mode="disabled")}),i){const r=this.subtitleDisplay?"showing":"hidden";i.mode!==r&&(i.mode=r)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!x(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:e});return}const r=!!i.details&&!i.details.live;if(e===this.trackId&&i===n&&r)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:s,groupId:o="",name:c,type:u,url:h}=i;this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:s,groupId:o,name:c,type:u,url:h});const f=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(f)}}function Oc(){try{return crypto.randomUUID()}catch(a){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const r=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?r:r&3|8).toString(16)})}}}function us(a){let e=5381,t=a.length;for(;t;)e=e*33^a.charCodeAt(--t);return(e>>>0).toString()}const Hr=.025;let Fs=function(a){return a[a.Point=0]="Point",a[a.Range=1]="Range",a}({});function Pc(a,e,t){return`${a.identifier}-${t+1}-${us(e)}`}class kc{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 Ra(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=Ra(t,e);return t-n<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=x(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 Ra(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)<Hr))}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 Mc(this)}}function Ra(a,e){return a-e.start<e.duration/2&&!(Math.abs(a-(e.start+e.duration))<Hr)?e.start:e.start+e.duration}function Vo(a,e,t){const n=new self.URL(a,t);return n.protocol!=="data:"&&n.searchParams.set("_HLS_primary_id",e),n}function Ia(a,e){for(;(t=a.assetList[++e])!=null&&t.error;)var t;return e}function Mc(a){return`["${a.identifier}" ${a.cue.pre?"<pre>":a.cue.post?"<post>":""}${a.timelineStart.toFixed(2)}-${a.resumeTime.toFixed(2)}]`}function zr(a){const e=a.timelineStart,t=a.duration||0;return`["${a.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class Nc{constructor(e,t,n,i){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(p.PLAYOUT_LIMIT_REACHED,{})};const r=this.hls=new e(t);this.interstitial=n,this.assetItem=i;const s=()=>{this.hasDetails=!0};r.once(p.LEVEL_LOADED,s),r.once(p.AUDIO_TRACK_LOADED,s),r.once(p.SUBTITLE_TRACK_LOADED,s),r.on(p.MEDIA_ATTACHING,(o,{media:c})=>{this.removeMediaListeners(),this.mediaAttached=c,this.interstitial.playoutLimit&&(c.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&r.on(p.BUFFER_APPENDED,()=>{const h=this.bufferedEnd;this.reachedPlayout(h)&&(this._bufferedEosTime=h,r.trigger(p.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const e=this.hls;if(e)if(e.url)e.levels.length&&!e.started&&e.startLoad(-1,!0);else{let t=this.assetItem.uri;try{t=Vo(t,e.config.primarySessionId||"").href}catch(n){}e.loadSource(t)}}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e)return!1;const n=Math.min(this._bufferedEosTime||1/0,this.duration),i=this.timelineOffset,r=bn.bufferInfo(e,i,0);return this.getAssetTime(r.end)>=n-.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=bn.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;if(!e)return 0;const t=this.interstitial.playoutLimit;if(t){const n=t-this.startOffset;if(n>0&&n<e)return n}return e}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const n=e-t;if(Math.abs(n)>1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,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&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){var t;this.loadSource(),(t=this.hls)==null||t.attachMedia(e)}detachMedia(){var e;this.removeMediaListeners(),this.mediaAttached=null,(e=this.hls)==null||e.detachMedia()}resumeBuffering(){var e;(e=this.hls)==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.hls)==null||e.pauseBuffering()}transferMedia(){var e;return this.bufferSnapShot(),((e=this.hls)==null?void 0:e.transferMedia())||null}resetDetails(){const e=this.hls;if(e&&this.hasDetails){e.stopLoad();const t=n=>delete n.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,n){var i;(i=this.hls)==null||i.on(e,t)}once(e,t,n){var i;(i=this.hls)==null||i.once(e,t)}off(e,t,n){var i;(i=this.hls)==null||i.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${zr(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const jo=.033;class Bc extends k{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((n,i)=>e<=i.startOffset&&t>i.startOffset?(delete i.error,n+1):n,0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let n=-1;e.nextEvent?n=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(n=this.findEventIndex(e.previousEvent.identifier)+1);const i=this.items;if(i)for(i[n]||(t===void 0&&(t=e.start),n=this.findItemIndexAtTime(t));n>=0&&(r=i[n])!=null&&r.event;){var r;n--}return n}findItemIndexAtTime(e,t){const n=this.items;if(n)for(let i=0;i<n.length;i++){let r=n[i];if(t&&t!=="primary"&&(r=r[t]),e===r.start||e>r.start&&e<r.end)return i}return-1}findJumpRestrictedIndex(e,t){const n=this.items;if(n)for(let i=e;i<=t&&n[i];i++){const r=n[i].event;if(r!=null&&r.restrictions.jump&&!r.appendInPlace)return i}return-1}findEventIndex(e){const t=this.items;if(t)for(let i=t.length;i--;){var n;if(((n=t[i].event)==null?void 0:n.identifier)===e)return i}return-1}findAssetIndex(e,t){const n=e.assetList,i=n.length;if(i>1)for(let r=0;r<i;r++){const s=n[r];if(!s.error){const o=s.timelineStart;if(t===o||t>o&&(t<o+(s.duration||0)||r===i-1))return r}}return 0}get assetIdAtEnd(){var e;const t=(e=this.items)==null||(e=e[this.length-1])==null?void 0:e.event;if(t){const n=t.assetList,i=n[n.length-1];if(i)return i.identifier}return null}parseInterstitialDateRanges(e,t){const n=e.main.details,{dateRanges:i}=n,r=this.events,s=this.parseDateRanges(i,{url:n.url},t),o=Object.keys(i),c=r?r.filter(u=>!o.includes(u.identifier)):[];s.length&&s.sort((u,h)=>{const f=u.cue.pre,v=u.cue.post,R=h.cue.pre,I=h.cue.post;if(f&&!R)return-1;if(R&&!f||v&&!I)return 1;if(I&&!v)return-1;if(!f&&!R&&!v&&!I){const q=u.startTime,J=h.startTime;if(q!==J)return q-J}return u.dateRange.tagOrder-h.dateRange.tagOrder}),this.events=s,c.forEach(u=>{this.removeEvent(u)}),this.updateSchedule(e,c)}updateSchedule(e,t=[],n=!1){const i=this.events||[];if(i.length||t.length||this.length<2){const r=this.items,s=this.parseSchedule(i,e);(n||t.length||(r==null?void 0:r.length)!==s.length||s.some((c,u)=>Math.abs(c.playout.start-r[u].playout.start)>.005||Math.abs(c.playout.end-r[u].playout.end)>.005))&&(this.items=s,this.onScheduleUpdate(t,r))}}parseDateRanges(e,t,n){const i=[],r=Object.keys(e);for(let s=0;s<r.length;s++){const o=r[s],c=e[o];if(c.isInterstitial){let u=this.eventMap[o];u?u.setDateRange(c):(u=new kc(c,t),this.eventMap[o]=u,n===!1&&(u.appendInPlace=n)),i.push(u)}}return i}parseSchedule(e,t){const n=[],i=t.main.details,r=i.live?1/0:i.edge;let s=0;if(e=e.filter(c=>!c.error&&!(c.cue.once&&c.hasPlayed)),e.length){this.resolveOffsets(e,t);let c=0,u=0;if(e.forEach((h,f)=>{const v=h.cue.pre,R=h.cue.post,I=e[f-1]||null,q=h.appendInPlace,J=R?r:h.startOffset,pe=h.duration,_e=h.timelineOccupancy===Fs.Range?pe:0,ye=h.resumptionOffset,Me=(I==null?void 0:I.startTime)===J,Ge=J+h.cumulativeDuration;let dt=q?Ge+pe:J+ye;if(v||!R&&J<=0){const ot=u;u+=_e,h.timelineStart=Ge;const at=s;s+=pe,n.push({event:h,start:Ge,end:dt,playout:{start:at,end:s},integrated:{start:ot,end:u}})}else if(J<=r){if(!Me){const Je=J-c;if(Je>jo){const wt=c,Xt=u;u+=Je;const on=s;s+=Je;const mn={previousEvent:e[f-1]||null,nextEvent:h,start:wt,end:wt+Je,playout:{start:on,end:s},integrated:{start:Xt,end:u}};n.push(mn)}else Je>0&&I&&(I.cumulativeDuration+=Je,n[n.length-1].end=J)}R&&(dt=Ge),h.timelineStart=Ge;const ot=u;u+=_e;const at=s;s+=pe,n.push({event:h,start:Ge,end:dt,playout:{start:at,end:s},integrated:{start:ot,end:u}})}else return;const We=h.resumeTime;R||We>r?c=r:c=We}),c<r){var o;const h=c,f=u,v=r-c;u+=v;const R=s;s+=v,n.push({previousEvent:((o=n[n.length-1])==null?void 0:o.event)||null,nextEvent:null,start:c,end:h+v,playout:{start:R,end:s},integrated:{start:f,end:u}})}this.setDurations(r,s,u)}else n.push({previousEvent:null,nextEvent:null,start:0,end:r,playout:{start:0,end:r},integrated:{start:0,end:r}}),this.setDurations(r,r,r);return n}setDurations(e,t,n){this.durations={primary:e,playout:t,integrated:n}}resolveOffsets(e,t){const n=t.main.details,i=n.live?1/0:n.edge;let r=0,s=-1;e.forEach((o,c)=>{const u=o.cue.pre,h=o.cue.post,f=u?0:h?i:o.startTime;this.updateAssetDurations(o),s===f?o.cumulativeDuration=r:(r=0,s=f),!h&&o.snapOptions.in&&(o.resumeAnchor=Rn(null,n.fragments,o.startOffset+o.resumptionOffset,0,0)||void 0),o.appendInPlace&&!o.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(o,t)||(o.appendInPlace=!1)),!o.appendInPlace&&c+1<e.length&&e[c+1].startTime-e[c].resumeTime<jo&&(e[c+1].appendInPlace=!1,e[c+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${o}`));const R=x(o.resumeOffset)?o.resumeOffset:o.duration;r+=R})}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,i=e.startTime+e.resumptionOffset;return Math.abs(n-i)>Hr?(this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${i}`),!1):!Object.keys(t).some(s=>{const o=t[s].details,c=o.edge;if(n>=c)return this.log(`"${e.identifier}" resumption ${n} past ${s} playlist end ${c}`),!1;const u=Rn(null,o.fragments,n);if(!u)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${s} playlist (${o.fragStart}-${o.fragmentEnd})`),!0;const h=s==="audio"?.175:0;return Math.abs(u.start-n)<Hr+h||Math.abs(u.end-n)<Hr+h?!1:(this.log(`"${e.identifier}" resumption ${n} not aligned with ${s} fragment bounds (${u.start}-${u.end} sn: ${u.sn} cc: ${u.cc})`),!0)})}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let n=0,i=!1,r=!1;for(let s=0;s<e.assetList.length;s++){const o=e.assetList[s],c=t+n;o.startOffset=n,o.timelineStart=c,i||(i=o.duration===null),r||(r=!!o.error);const u=o.error?0:o.duration||0;n+=u}i&&!r?e.duration=Math.max(n,e.duration):e.duration=n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function rr(a){return`[${a.event?'"'+a.event.identifier+'"':"primary"}: ${a.start.toFixed(2)}-${a.end.toFixed(2)}]`}class Fc{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let i;try{i=Vo(n,this.hls.sessionId,e.baseUrl)}catch(v){const R=this.assignAssetListError(e,G.ASSET_LIST_LOAD_ERROR,v,n);this.hls.trigger(p.ERROR,R);return}t&&i.protocol!=="data:"&&i.searchParams.set("_HLS_start_offset",""+t);const r=this.hls.config,s=r.loader,o=new s(r),c={responseType:"json",url:i.href},u=r.interstitialAssetListLoadPolicy.default,h={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(v,R,I,q)=>{const J=v.data,pe=J==null?void 0:J.ASSETS;if(!Array.isArray(pe)){const _e=this.assignAssetListError(e,G.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),I.url,R,q);this.hls.trigger(p.ERROR,_e);return}e.assetListResponse=J,this.hls.trigger(p.ASSET_LIST_LOADED,{event:e,assetListResponse:J,networkDetails:q})},onError:(v,R,I,q)=>{const J=this.assignAssetListError(e,G.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${v.code} ${v.text} (${R.url})`),R.url,q,I);this.hls.trigger(p.ERROR,J)},onTimeout:(v,R,I)=>{const q=this.assignAssetListError(e,G.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${R.url})`),R.url,v,I);this.hls.trigger(p.ERROR,q)}};return o.load(c,h,f),this.hls.trigger(p.ASSET_LIST_LOADING,{event:e}),o}assignAssetListError(e,t,n,i,r,s){return e.error=n,{type:ue.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:i,error:n,networkDetails:s,stats:r}}}function Ho(a){var e;a==null||(e=a.play())==null||e.catch(()=>{})}function $s(a,e){return`[${a}] Advancing timeline position to ${e}`}class $c extends k{constructor(e,t){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled||!this.schedule)return;const i=n-this.timelinePos;if(Math.abs(i)<1/7056e5)return;const s=i<=-.01;this.timelinePos=n,this.bufferedPos=n;const o=this.playingItem;if(!o){this.checkBuffer();return}if(s&&this.schedule.resetErrorsInRange(n,n-i)&&this.updateSchedule(!0),this.checkBuffer(),s&&n<o.start||n>=o.end){var c;const R=this.findItemIndex(o);let I=this.schedule.findItemIndexAtTime(n);if(I===-1&&(I=R+(s?-1:1),this.log(`seeked ${s?"back ":""}to position not covered by schedule ${n} (resolving from ${R} to ${I})`)),!this.isInterstitial(o)&&(c=this.media)!=null&&c.paused&&(this.shouldPlay=!1),!s&&I>R){const q=this.schedule.findJumpRestrictedIndex(R+1,I);if(q>R){this.setSchedulePosition(q);return}}this.setSchedulePosition(I);return}const u=this.playingAsset;if(!u){if(this.playingLastItem&&this.isInterstitial(o)){const R=o.event.assetList[0];R&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(n,R))}return}const h=u.timelineStart,f=u.duration||0;if(s&&n<h||n>=h+f){var v;(v=o.event)!=null&&v.appendInPlace&&(this.clearAssetPlayers(o.event,o),this.flushFrontBuffer(n)),this.setScheduleToAssetAtTime(n,u)}},this.onTimeupdate=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;if(n>this.timelinePos)this.timelinePos=n,n>this.bufferedPos&&this.checkBuffer();else return;const i=this.playingItem;if(!i||this.playingLastItem)return;if(n>=i.end){this.timelinePos=i.end;const o=this.findItemIndex(i);this.setSchedulePosition(o+1)}const r=this.playingAsset;if(!r)return;const s=r.timelineStart+(r.duration||0);n>=s&&this.setScheduleToAssetAtTime(n,r)},this.onScheduleUpdate=(n,i)=>{const r=this.schedule;if(!r)return;const s=this.playingItem,o=r.events||[],c=r.items||[],u=r.durations,h=n.map(q=>q.identifier),f=!!(o.length||h.length);(f||i)&&this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o}
|
|
Schedule: ${c.map(q=>rr(q))} pos: ${this.timelinePos}`),h.length&&this.log(`Removed events ${h}`);let v=null,R=null;s&&(v=this.updateItem(s,this.timelinePos),this.itemsMatch(s,v)?this.playingItem=v:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const I=this.bufferingItem;if(I&&(R=this.updateItem(I,this.bufferedPos),this.itemsMatch(I,R)?this.bufferingItem=R:I.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(I.event,null))),n.forEach(q=>{q.assetList.forEach(J=>{this.clearAssetPlayer(J.identifier,null)})}),this.playerQueue.forEach(q=>{if(q.interstitial.appendInPlace){const J=q.assetItem.timelineStart,pe=q.timelineOffset-J;if(pe)try{q.timelineOffset=J}catch(_e){Math.abs(pe)>Hr&&this.warn(`${_e} ("${q.assetId}" ${q.timelineOffset}->${J})`)}}}),f||i){if(this.hls.trigger(p.INTERSTITIALS_UPDATED,{events:o.slice(0),schedule:c.slice(0),durations:u,removedIds:h}),this.isInterstitial(s)&&h.includes(s.event.identifier)){this.warn(`Interstitial "${s.event.identifier}" removed while playing`),this.primaryFallback(s.event);return}s&&this.trimInPlace(v,s),I&&R!==v&&this.trimInPlace(R,I),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new Fc(e),this.schedule=new Bc(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e&&(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.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){Ni(e,"play",this.onPlay),Ni(e,"pause",this.onPause),Ni(e,"seeking",this.onSeeking),Ni(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;ki(n,"seeking",this.onSeeking),ki(n,"timeupdate",this.onTimeupdate),ki(n,"play",this.onPlay),ki(n,"pause",this.onPause)}onMediaAttached(e,t){const n=this.effectivePlayingItem,i=this.detachedData;if(this.detachedData=null,n===null)this.checkStart();else if(!i){this.clearScheduleState();const r=this.findItemIndex(n);this.setSchedulePosition(r)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const n=!!t.transferMedia,i=this.media;if(this.media=null,!n&&(i&&this.removeMediaListeners(i),this.detachedData)){const r=this.getBufferingPlayer();r&&(this.log(`Removing schedule state for detachedData and ${r}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,r.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const e=this,t=()=>e.bufferingItem||e.waitingItem,n=f=>f&&e.getAssetPlayer(f.identifier),i=(f,v,R,I,q)=>{if(f){let J=f[v].start;const pe=f.event;if(pe){if(v==="playout"||pe.timelineOccupancy!==Fs.Point){const _e=n(R);(_e==null?void 0:_e.interstitial)===pe&&(J+=_e.assetItem.startOffset+_e[q])}}else{const _e=I==="bufferedPos"?s():e[I];J+=_e-f.start}return J}return 0},r=(f,v)=>{var R;if(f!==0&&v!=="primary"&&(R=e.schedule)!=null&&R.length){var I;const q=e.schedule.findItemIndexAtTime(f),J=(I=e.schedule.items)==null?void 0:I[q];if(J){const pe=J[v].start-J.start;return f+pe}}return f},s=()=>{const f=e.bufferedPos;return f===Number.MAX_VALUE?o("primary"):Math.max(f,0)},o=f=>{var v,R;return(v=e.primaryDetails)!=null&&v.live?e.primaryDetails.edge:((R=e.schedule)==null?void 0:R.durations[f])||0},c=(f,v)=>{var R,I;const q=e.effectivePlayingItem;if(q!=null&&(R=q.event)!=null&&R.restrictions.skip||!e.schedule)return;e.log(`seek to ${f} "${v}"`);const J=e.effectivePlayingItem,pe=e.schedule.findItemIndexAtTime(f,v),_e=(I=e.schedule.items)==null?void 0:I[pe],ye=e.getBufferingPlayer(),Me=ye==null?void 0:ye.interstitial,Ge=Me==null?void 0:Me.appendInPlace,dt=J&&e.itemsMatch(J,_e);if(J&&(Ge||dt)){const We=n(e.playingAsset),ot=(We==null?void 0:We.media)||e.primaryMedia;if(ot){const at=v==="primary"?ot.currentTime:i(J,v,e.playingAsset,"timelinePos","currentTime"),Je=f-at,wt=(Ge?at:ot.currentTime)+Je;if(wt>=0&&(!We||Ge||wt<=We.duration)){ot.currentTime=wt;return}}}if(_e){let We=f;if(v!=="primary"){const at=_e[v].start,Je=f-at;We=_e.start+Je}const ot=!e.isInterstitial(_e);if((!e.isInterstitial(J)||J.event.appendInPlace)&&(ot||_e.event.appendInPlace)){const at=e.media||(Ge?ye==null?void 0:ye.media:null);at&&(at.currentTime=We)}else if(J){const at=e.findItemIndex(J);if(pe>at){const wt=e.schedule.findJumpRestrictedIndex(at+1,pe);if(wt>at){e.setSchedulePosition(wt);return}}let Je=0;if(ot)e.timelinePos=We,e.checkBuffer();else{const wt=_e.event.assetList,Xt=f-(_e[v]||_e).start;for(let on=wt.length;on--;){const mn=wt[on];if(mn.duration&&Xt>=mn.startOffset&&Xt<mn.startOffset+mn.duration){Je=on;break}}}e.setSchedulePosition(pe,Je)}}},u=()=>{const f=e.effectivePlayingItem;if(e.isInterstitial(f))return f;const v=t();return e.isInterstitial(v)?v:null},h={get bufferedEnd(){const f=t(),v=e.bufferingItem;if(v&&v===f){var R;return i(v,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-v.playout.start||((R=e.bufferingAsset)==null?void 0:R.startOffset)||0}return 0},get currentTime(){const f=u(),v=e.effectivePlayingItem;return v&&v===f?i(v,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-v.playout.start:0},set currentTime(f){const v=u(),R=e.effectivePlayingItem;R&&R===v&&c(f+R.playout.start,"playout")},get duration(){const f=u();return f?f.playout.end-f.playout.start:0},get assetPlayers(){var f;const v=(f=u())==null?void 0:f.event.assetList;return v?v.map(R=>e.getAssetPlayer(R.identifier)):[]},get playingIndex(){var f;const v=(f=u())==null?void 0:f.event;return v&&e.effectivePlayingAsset?v.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return u()}};return this.manager={get events(){var f;return((f=e.schedule)==null||(f=f.events)==null?void 0:f.slice(0))||[]},get schedule(){var f;return((f=e.schedule)==null||(f=f.items)==null?void 0:f.slice(0))||[]},get interstitialPlayer(){return u()?h:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const f=t();return e.findItemIndex(f)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const f=e.effectivePlayingItem;return e.findItemIndex(f)},primary:{get bufferedEnd(){return s()},get currentTime(){const f=e.timelinePos;return f>0?f:0},set currentTime(f){c(f,"primary")},get duration(){return o("primary")},get seekableStart(){var f;return((f=e.primaryDetails)==null?void 0:f.fragmentStart)||0}},integrated:{get bufferedEnd(){return i(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return i(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(f){c(f,"integrated")},get duration(){return o("integrated")},get seekableStart(){var f;return r(((f=e.primaryDetails)==null?void 0:f.fragmentStart)||0,"integrated")}},skip:()=>{const f=e.effectivePlayingItem,v=f==null?void 0:f.event;if(v&&!v.restrictions.skip){const R=e.findItemIndex(f);if(v.appendInPlace){const I=f.playout.start+f.event.duration;c(I+.001,"playout")}else e.advanceAfterAssetEnded(v,R,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,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;if(this.mediaSelection===null)return;const n=this.waitingItem||this.playingItem;if(this.isInterstitial(n)&&!n.event.appendInPlace)return;let i=this.media;!i&&(e=this.bufferingItem)!=null&&(e=e.event)!=null&&e.appendInPlace&&(i=this.primaryMedia);const r=(t=i)==null?void 0:t.currentTime;if(!(r===void 0||!x(r)))return r}get primaryMedia(){var e;return this.media||((e=this.detachedData)==null?void 0:e.media)||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,t){const n=this.getAssetPlayer(e);n&&this.transferMediaFromPlayer(n,t)}transferMediaFromPlayer(e,t){const n=e.interstitial.appendInPlace,i=e.media;if(n&&i===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&i){this.detachedData={media:i};return}const r=e.transferMedia();this.log(`transfer MediaSource from ${e} ${Ke(r)}`),this.detachedData=r}else t&&i&&(this.shouldPlay||(this.shouldPlay=!i.paused))}transferMediaTo(e,t){var n,i;if(e.media===t)return;let r=null;const s=this.hls,o=e!==s,c=o&&e.interstitial.appendInPlace,u=(n=this.detachedData)==null?void 0:n.mediaSource;let h;if(s.media)c&&(r=s.transferMedia(),this.detachedData=r),h="Primary";else if(u){const I=this.getBufferingPlayer();I?(r=I.transferMedia(),h=`${I}`):h="detached MediaSource"}else h="detached media";if(!r){if(u)r=this.detachedData,this.log(`using detachedData: MediaSource ${Ke(r)}`);else if(!this.detachedData||s.media===t){const I=this.playerQueue;I.length>1&&I.forEach(q=>{if(o&&q.interstitial.appendInPlace!==c){const J=q.interstitial;this.clearInterstitial(q.interstitial,null),J.appendInPlace=!1,J.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${J}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const f=r&&"mediaSource"in r&&((i=r.mediaSource)==null?void 0:i.readyState)!=="closed",v=f&&r?r:t;this.log(`${f?"transfering MediaSource":"attaching media"} to ${o?e:"Primary"} from ${h} (media.currentTime: ${t.currentTime})`);const R=this.schedule;if(v===r&&R){const I=o&&e.assetId===R.assetIdAtEnd;v.overrides={duration:R.duration,endOfStream:!o||I,cueRemoval:!o}}e.attachMedia(v)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e==null?void 0:e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const n=this.timelinePos,i=this.effectivePlayingItem;if(n===-1){const r=this.hls.startPosition;if(this.log($s("checkStart",r)),this.timelinePos=r,t.length&&t[0].cue.pre){const s=e.findEventIndex(t[0].identifier);this.setSchedulePosition(s)}else if(r>=0||!this.primaryLive){const s=this.timelinePos=r>0?r:0,o=e.findItemIndexAtTime(s);this.setSchedulePosition(o)}}else if(i&&!this.playingItem){const r=e.findItemIndex(i);this.setSchedulePosition(r)}}advanceAssetBuffering(e,t){const n=e.event,i=n.findAssetIndex(t),r=Ia(n,i);if(!n.isAssetPastPlayoutLimit(r))this.bufferedToEvent(e,r);else if(this.schedule){var s;const o=(s=this.schedule.items)==null?void 0:s[this.findItemIndex(e)+1];o&&this.bufferedToItem(o)}}advanceAfterAssetEnded(e,t,n){const i=Ia(e,n);if(e.isAssetPastPlayoutLimit(i)){if(this.schedule){const r=this.schedule.items;if(r){const s=t+1,o=r.length;if(s>=o){this.setSchedulePosition(-1);return}const c=e.resumeTime;this.timelinePos<c&&(this.log($s("advanceAfterAssetEnded",c)),this.timelinePos=c,e.appendInPlace&&this.advanceInPlace(c),this.checkBuffer(this.bufferedPos<c)),this.setSchedulePosition(s)}}}else{if(e.appendInPlace){const r=e.assetList[i];r&&this.advanceInPlace(r.timelineStart)}this.setSchedulePosition(t,i)}}setScheduleToAssetAtTime(e,t){const n=this.schedule;if(!n)return;const i=t.parentIdentifier,r=n.getEvent(i);if(r){const s=n.findEventIndex(i),o=n.findAssetIndex(r,e);this.advanceAfterAssetEnded(r,s,o-1)}}setSchedulePosition(e,t){var n;const i=(n=this.schedule)==null?void 0:n.items;if(!i||this.playbackDisabled)return;const r=e>=0?i[e]:null;this.log(`setSchedulePosition ${e}, ${t} (${r&&rr(r)}) pos: ${this.timelinePos}`);const s=this.waitingItem||this.playingItem,o=this.playingLastItem;if(this.isInterstitial(s)){const h=s.event,f=this.playingAsset,v=f==null?void 0:f.identifier,R=v?this.getAssetPlayer(v):null;if(R&&v&&(!this.eventItemsMatch(s,r)||t!==void 0&&v!==h.assetList[t].identifier)){var c;const I=h.findAssetIndex(f);if(this.log(`INTERSTITIAL_ASSET_ENDED ${I+1}/${h.assetList.length} ${zr(f)}`),this.endedAsset=f,this.playingAsset=null,this.hls.trigger(p.INTERSTITIAL_ASSET_ENDED,{asset:f,assetListIndex:I,event:h,schedule:i.slice(0),scheduleIndex:e,player:R}),s!==this.playingItem){this.itemsMatch(s,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(h,this.findItemIndex(this.playingItem),I);return}this.retreiveMediaSource(v,r),R.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&R.detachMedia()}if(!this.eventItemsMatch(s,r)&&(this.endedItem=s,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${h} ${rr(s)}`),h.hasPlayed=!0,this.hls.trigger(p.INTERSTITIAL_ENDED,{event:h,schedule:i.slice(0),scheduleIndex:e}),h.cue.once)){var u;this.updateSchedule();const I=(u=this.schedule)==null?void 0:u.items;if(r&&I){const q=this.findItemIndex(r);this.advanceSchedule(q,I,t,s,o)}return}}this.advanceSchedule(e,i,t,s,o)}advanceSchedule(e,t,n,i,r){const s=this.schedule;if(!s)return;const o=t[e]||null,c=this.primaryMedia,u=this.playerQueue;if(u.length&&u.forEach(h=>{const f=h.interstitial,v=s.findEventIndex(f.identifier);(v<e||v>e+1)&&this.clearInterstitial(f,o)}),this.isInterstitial(o)){this.timelinePos=Math.min(Math.max(this.timelinePos,o.start),o.end);const h=o.event;if(n===void 0){n=s.findAssetIndex(h,this.timelinePos);const I=Ia(h,n-1);if(h.isAssetPastPlayoutLimit(I)||h.appendInPlace&&this.timelinePos===o.end){this.advanceAfterAssetEnded(h,e,n);return}n=I}const f=this.waitingItem;this.assetsBuffered(o,c)||this.setBufferingItem(o);let v=this.preloadAssets(h,n);if(this.eventItemsMatch(o,f||i)||(this.waitingItem=o,this.log(`INTERSTITIAL_STARTED ${rr(o)} ${h.appendInPlace?"append in place":""}`),this.hls.trigger(p.INTERSTITIAL_STARTED,{event:h,schedule:t.slice(0),scheduleIndex:e})),!h.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${h}`);return}if(h.assetListLoader&&(h.assetListLoader.destroy(),h.assetListLoader=void 0),!c){this.log(`Waiting for attachMedia to start Interstitial ${h}`);return}this.waitingItem=this.endedItem=null,this.playingItem=o;const R=h.assetList[n];if(!R){this.advanceAfterAssetEnded(h,e,n||0);return}if(v||(v=this.getAssetPlayer(R.identifier)),v===null||v.destroyed){const I=h.assetList.length;this.warn(`asset ${n+1}/${I} player destroyed ${h}`),v=this.createAssetPlayer(h,R,n),v.loadSource()}if(!this.eventItemsMatch(o,this.bufferingItem)&&h.appendInPlace&&this.isAssetBuffered(R))return;this.startAssetPlayer(v,n,t,e,c),this.shouldPlay&&Ho(v.media)}else o?(this.resumePrimary(o,e,i),this.shouldPlay&&Ho(this.hls.media)):r&&this.isInterstitial(i)&&(this.endedItem=null,this.playingItem=i,i.event.appendInPlace||this.attachPrimary(s.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e;return(e=this.mediaSelection)==null?void 0:e.main.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,n){var i,r;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${rr(e)}`),!((i=this.detachedData)!=null&&i.mediaSource)){let o=this.timelinePos;(o<e.start||o>=e.end)&&(o=this.getPrimaryResumption(e,t),this.log($s("resumePrimary",o)),this.timelinePos=o),this.attachPrimary(o,e)}if(!n)return;const s=(r=this.schedule)==null?void 0:r.items;s&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${rr(e)}`),this.hls.trigger(p.INTERSTITIALS_PRIMARY_RESUMED,{schedule:s.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const n=e.start;if(this.primaryLive){const i=this.primaryDetails;if(t===0)return this.hls.startPosition;if(i&&(n<i.fragmentStart||n>i.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:bn.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,n){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const i=this.primaryMedia;if(!i)return;const r=this.hls;r.media?this.checkBuffer():(this.transferMediaTo(r,i),n&&this.startLoadingPrimaryAt(e,n)),n||(this.log($s("attachPrimary",e)),this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}startLoadingPrimaryAt(e,t){var n;const i=this.hls;!i.loadingEnabled||!i.media||Math.abs((((n=i.mainForwardBufferInfo)==null?void 0:n.start)||i.media.currentTime)-e)>.5?i.startLoad(e,t):i.bufferingEnabled||i.resumeBuffering()}onManifestLoading(){var e;this.stopLoad(),(e=this.schedule)==null||e.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(p.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(p.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1||!this.schedule)return;const n=this.hls.levels[t.level];if(!n.details)return;const i=E(E({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=i,this.schedule.parseInterstitialDateRanges(i,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const n=this.hls.audioTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=E(E({},this.altSelection),{},{audio:n});return}const r=E(E({},i),{},{audio:n});this.mediaSelection=r}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],i=this.mediaSelection;if(!i){this.altSelection=E(E({},this.altSelection),{},{subtitles:n});return}const r=E(E({},i),{},{subtitles:n});this.mediaSelection=r}onAudioTrackSwitching(e,t){const n=At(t);this.playerQueue.forEach(({hls:i})=>i&&(i.setAudioOption(t)||i.setAudioOption(n)))}onSubtitleTrackSwitch(e,t){const n=At(t);this.playerQueue.forEach(({hls:i})=>i&&(i.setSubtitleOption(t)||t.id!==-1&&i.setSubtitleOption(n)))}onBufferCodecs(e,t){const n=t.tracks;n&&(this.requiredTracks=n)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const i=this.timelinePos;this.bufferedPos=i,this.checkBuffer()}}onBufferedToEnd(e){if(!this.schedule)return;const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let i=0;i<t.length;i++){const r=t[i];if(r.cue.post){var n;const s=this.schedule.findEventIndex(r.identifier),o=(n=this.schedule.items)==null?void 0:n[s];this.isInterstitial(o)&&this.eventItemsMatch(o,this.bufferingItem)&&this.bufferedToItem(o,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const n=this.findItemIndex(t);this.setSchedulePosition(n+1)}else this.shouldPlay=!1}updateItem(e,t){var n;const i=(n=this.schedule)==null?void 0:n.items;if(e&&i){const r=this.findItemIndex(e,t);return i[r]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((r,s)=>{e.event.isAssetPastPlayoutLimit(s)&&this.clearAssetPlayer(r.identifier,null)});const n=e.end+.25,i=bn.bufferInfo(this.primaryMedia,n,0);(i.end>n||(i.nextStart||0)>n)&&(this.log(`trim buffered interstitial ${rr(e)} (was ${rr(t)})`),this.attachPrimary(n,null,!0),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?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t;const n=this.mediaSelection;n&&((t=this.schedule)==null||t.updateSchedule(n,[],e))}checkBuffer(e){var t;const n=(t=this.schedule)==null?void 0:t.items;if(!n)return;const i=bn.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=i.len<1),this.updateBufferedPos(i.end,n,e)}updateBufferedPos(e,t,n){const i=this.schedule,r=this.bufferingItem;if(this.bufferedPos>e||!i)return;if(t.length===1&&this.itemsMatch(t[0],r)){this.bufferedPos=e;return}const s=this.playingItem,o=this.findItemIndex(s);let c=i.findItemIndexAtTime(e);if(this.bufferedPos<e){var u;const h=this.findItemIndex(r),f=Math.min(h+1,t.length-1),v=t[f];if((c===-1&&r&&e>=r.end||(u=v.event)!=null&&u.appendInPlace&&e+.01>=v.start)&&(c=f),this.isInterstitial(r)){const R=r.event;if(f-o>1&&R.appendInPlace===!1||R.assetList.length===0&&R.assetListLoader)return}if(this.bufferedPos=e,c>h&&c>o)this.bufferedToItem(v);else{const R=this.primaryDetails;this.primaryLive&&R&&e>R.edge-R.targetduration&&v.start<R.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(v)&&this.preloadAssets(v.event,0)}}else n&&s&&!this.itemsMatch(s,r)&&(c===o?this.bufferedToItem(s):c===o+1&&this.bufferedToItem(t[c]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(i=>{const r=this.getAssetPlayer(i.identifier);return!(r!=null&&r.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,n=this.schedule;if(!this.itemsMatch(e,t)&&n){const{items:i,events:r}=n;if(!i||!r)return t;const s=this.isInterstitial(e),o=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const c=o?o.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${rr(e)}`+(t?` (${c.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(s){const u=n.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach((h,f)=>{const v=this.getAssetPlayer(h.identifier);v&&(f===u&&v.loadSource(),v.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(u=>u.pauseBuffering());this.hls.trigger(p.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:r.slice(0),schedule:i.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);return t}bufferedToItem(e,t=0){const n=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(n!==null){this.bufferingAsset=null;const i=this.detachedData;i?i.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),n=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(n)}bufferedToEvent(e,t){const n=e.event,i=n.assetList.length===0&&!n.assetListLoader,r=n.cue.once;if(i||!r){const s=this.preloadAssets(n,t);if(s!=null&&s.interstitial.appendInPlace){const o=this.primaryMedia;o&&this.bufferAssetPlayer(s,o)}}}preloadAssets(e,t){const n=e.assetUrl,i=e.assetList.length,r=i===0&&!e.assetListLoader,s=e.cue.once;if(r){const c=e.timelineStart;if(e.appendInPlace){var o;const v=this.playingItem;!this.isInterstitial(v)&&(v==null||(o=v.nextEvent)==null?void 0:o.identifier)===e.identifier&&this.flushFrontBuffer(c+.25)}let u,h=0;if(!this.playingItem&&this.primaryLive&&(h=this.hls.startPosition,h===-1&&(h=this.hls.liveSyncPosition||0)),h&&!(e.cue.pre||e.cue.post)){const v=h-c;v>0&&(u=Math.round(v*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:i} ${e}${u?` live-start: ${h} start-offset: ${u}`:""}`),n)return this.createAsset(e,0,0,c,e.duration,n);const f=this.assetListLoader.loadAssetList(e,u);f&&(e.assetListLoader=f)}else if(!s&&i){for(let u=t;u<i;u++){const h=e.assetList[u],f=this.getAssetPlayerQueueIndex(h.identifier);(f===-1||this.playerQueue[f].destroyed)&&!h.error&&this.createAssetPlayer(e,h,u)}const c=e.assetList[t];if(c){const u=this.getAssetPlayer(c.identifier);return u&&u.loadSource(),u}}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(i=>{this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:i})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let n=0;n<t.length;n++)if(e===t[n].assetId)return n;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t){for(let n=0;n<e.length;n++)if(e[n].media===t)return e[n]}return null}createAsset(e,t,n,i,r,s){const o={parentIdentifier:e.identifier,identifier:Pc(e,s,t),duration:r,startOffset:n,timelineStart:i,uri:s};return this.createAssetPlayer(e,o,t)}createAssetPlayer(e,t,n){const i=this.hls,r=i.userConfig;let s=r.videoPreference;const o=i.loadLevelObj||i.levels[i.currentLevel];(s||o)&&(s=m({},s),o.videoCodec&&(s.videoCodec=o.videoCodec),o.videoRange&&(s.allowedVideoRanges=[o.videoRange]));const c=i.audioTracks[i.audioTrack],u=i.subtitleTracks[i.subtitleTrack];let h=0;if(this.primaryLive||e.appendInPlace){const Me=this.timelinePos-t.timelineStart;if(Me>1){const Ge=t.duration;Ge&&Me<Ge&&(h=Me)}}const f=t.identifier,v=E(E({},r),{},{maxMaxBufferLength:Math.min(180,i.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:i.sessionId,assetPlayerId:f,abrEwmaDefaultEstimate:i.bandwidthEstimate,interstitialsController:void 0,startPosition:h,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:c||r.audioPreference,subtitlePreference:u||r.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(v.timelineOffset=t.timelineStart));const R=v.cmcd;R!=null&&R.sessionId&&R.contentId&&(v.cmcd=m({},R,{contentId:us(t.uri)})),this.getAssetPlayer(f)&&this.warn(`Duplicate date range identifier ${e} and asset ${f}`);const I=new Nc(this.HlsPlayerClass,v,e,t);this.playerQueue.push(I),e.assetList[n]=t;let q=!0;const J=Me=>{if(Me.live){var Ge;const ot=new Error(`Interstitials MUST be VOD assets ${e}`),at={fatal:!0,type:ue.OTHER_ERROR,details:G.INTERSTITIAL_ASSET_ITEM_ERROR,error:ot},Je=((Ge=this.schedule)==null?void 0:Ge.findEventIndex(e.identifier))||-1;this.handleAssetItemError(at,e,Je,n,ot.message);return}const dt=Me.edge-Me.fragmentStart,We=t.duration;(q||We===null||dt>We)&&(q=!1,this.log(`Interstitial asset "${f}" duration change ${We} > ${dt}`),t.duration=dt,this.updateSchedule())};I.on(p.LEVEL_UPDATED,(Me,{details:Ge})=>J(Ge)),I.on(p.LEVEL_PTS_UPDATED,(Me,{details:Ge})=>J(Ge)),I.on(p.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const pe=(Me,Ge)=>{const dt=this.getAssetPlayer(f);if(dt&&Ge.tracks){dt.off(p.BUFFER_CODECS,pe),dt.tracks=Ge.tracks;const We=this.primaryMedia;this.bufferingAsset===dt.assetItem&&We&&!dt.media&&this.bufferAssetPlayer(dt,We)}};I.on(p.BUFFER_CODECS,pe);const _e=()=>{var Me;const Ge=this.getAssetPlayer(f);if(this.log(`buffered to end of asset ${Ge}`),!Ge||!this.schedule)return;const dt=this.schedule.findEventIndex(e.identifier),We=(Me=this.schedule.items)==null?void 0:Me[dt];this.isInterstitial(We)&&this.advanceAssetBuffering(We,t)};I.on(p.BUFFERED_TO_END,_e);const ye=Me=>()=>{if(!this.getAssetPlayer(f)||!this.schedule)return;this.shouldPlay=!0;const dt=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,dt,Me)};return I.once(p.MEDIA_ENDED,ye(n)),I.once(p.PLAYOUT_LIMIT_REACHED,ye(1/0)),I.on(p.ERROR,(Me,Ge)=>{if(!this.schedule)return;const dt=this.getAssetPlayer(f);if(Ge.details===G.BUFFER_STALLED_ERROR){if(dt!=null&&dt.appendInPlace){this.handleInPlaceStall(e);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(Ge,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${Ge.error} ${e}`)}),I.on(p.DESTROYING,()=>{if(!this.getAssetPlayer(f)||!this.schedule)return;const Ge=new Error(`Asset player destroyed unexpectedly ${f}`),dt={fatal:!0,type:ue.OTHER_ERROR,details:G.INTERSTITIAL_ASSET_ITEM_ERROR,error:Ge};this.handleAssetItemError(dt,e,this.schedule.findEventIndex(e.identifier),n,Ge.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${zr(t)}`),this.hls.trigger(p.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:I}),I}clearInterstitial(e,t){this.clearAssetPlayers(e,t),e.reset()}clearAssetPlayers(e,t){e.assetList.forEach(n=>{this.clearAssetPlayer(n.identifier,t)})}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){const i=this.playerQueue[n];this.log(`clear ${i} toSegment: ${t&&rr(t)}`),this.transferMediaFromPlayer(i,t),this.playerQueue.splice(n,1),i.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,n,i,r){const{interstitial:s,assetItem:o,assetId:c}=e,u=s.assetList.length,h=this.playingAsset;this.endedAsset=null,this.playingAsset=o,(!h||h.identifier!==c)&&(h&&(this.clearAssetPlayer(h.identifier,n[i]),delete h.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${u} ${zr(o)}`),this.hls.trigger(p.INTERSTITIAL_ASSET_STARTED,{asset:o,assetListIndex:t,event:s,schedule:n.slice(0),scheduleIndex:i,player:e})),this.bufferAssetPlayer(e,r)}bufferAssetPlayer(e,t){var n,i;if(!this.schedule)return;const{interstitial:r,assetItem:s}=e,o=this.schedule.findEventIndex(r.identifier),c=(n=this.schedule.items)==null?void 0:n[o];if(!c)return;e.loadSource(),this.setBufferingItem(c),this.bufferingAsset=s;const u=this.getBufferingPlayer();if(u===e)return;const h=r.appendInPlace;if(h&&(u==null?void 0:u.interstitial.appendInPlace)===!1)return;const f=(u==null?void 0:u.tracks)||((i=this.detachedData)==null?void 0:i.tracks)||this.requiredTracks;if(h&&s!==this.playingAsset){if(!e.tracks){this.log(`Waiting for track info before buffering ${e}`);return}if(f&&!Te(f,e.tracks)){const v=new Error(`Asset ${zr(s)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(f)}')`),R={fatal:!0,type:ue.OTHER_ERROR,details:G.INTERSTITIAL_ASSET_ITEM_ERROR,error:v},I=r.findAssetIndex(s);this.handleAssetItemError(R,r,o,I,v.message);return}}this.transferMediaTo(e,t)}handleInPlaceStall(e){const t=this.schedule,n=this.primaryMedia;if(!t||!n)return;const i=n.currentTime,r=t.findAssetIndex(e,i),s=e.assetList[r];if(s){const o=this.getAssetPlayer(s.identifier);if(o){const c=o.currentTime||i-s.timelineStart,u=o.duration-c;if(this.warn(`Stalled at ${c} of ${c+u} in ${o} ${e} (media.currentTime: ${i})`),c&&(u/n.playbackRate<.5||o.bufferedInPlaceToEnd(n))&&o.hls){const h=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,h,r)}}}}advanceInPlace(e){const t=this.primaryMedia;t&&t.currentTime<e&&(t.currentTime=e)}handleAssetItemError(e,t,n,i,r){if(e.details===G.BUFFER_STALLED_ERROR)return;const s=t.assetList[i]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${s&&zr(s)} ${e.error}`),!this.schedule)return;const o=(s==null?void 0:s.identifier)||"",c=this.getAssetPlayerQueueIndex(o),u=this.playerQueue[c]||null,h=this.schedule.items,f=m({},e,{fatal:!1,errorAction:Gt(!0),asset:s,assetListIndex:i,event:t,schedule:h,scheduleIndex:n,player:u});if(this.hls.trigger(p.INTERSTITIAL_ASSET_ERROR,f),!e.fatal)return;const v=this.playingAsset,R=this.bufferingAsset,I=new Error(r);if(s&&(this.clearAssetPlayer(o,null),s.error=I),!t.assetList.some(q=>!q.error))t.error=I;else for(let q=i;q<t.assetList.length;q++)this.resetAssetPlayer(t.assetList[q].identifier);this.updateSchedule(!0),t.error?this.primaryFallback(t):v&&v.identifier===o?this.advanceAfterAssetEnded(t,n,i):R&&R.identifier===o&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,R)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem;let i=this.timelinePos;if(n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${i} playing: ${rr(n)} error: ${e.error}`),i===-1&&(i=this.hls.startPosition);const s=this.updateItem(n,i);this.itemsMatch(n,s)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t))}else if(i===-1){this.checkStart();return}if(!this.schedule)return;const r=this.schedule.findItemIndexAtTime(i);this.setSchedulePosition(r)}onAssetListLoaded(e,t){var n,i;const r=t.event,s=r.identifier,o=t.assetListResponse.ASSETS;if(!((n=this.schedule)!=null&&n.hasEvent(s)))return;const c=r.timelineStart,u=r.duration;let h=0;o.forEach((q,J)=>{const pe=parseFloat(q.DURATION);this.createAsset(r,J,h,c+h,pe,q.URI),h+=pe}),r.duration=h,this.log(`Loaded asset-list with duration: ${h} (was: ${u}) ${r}`);const f=this.waitingItem,v=(f==null?void 0:f.event.identifier)===s;this.updateSchedule();const R=(i=this.bufferingItem)==null?void 0:i.event;if(v){var I;const q=this.schedule.findEventIndex(s),J=(I=this.schedule.items)==null?void 0:I[q];if(J){if(!this.playingItem&&this.timelinePos>J.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==q){r.error=new Error(`Interstitial ${o.length?"no longer within playback range":"asset-list is empty"} ${this.timelinePos} ${r}`),this.log(r.error.message),this.updateSchedule(!0),this.primaryFallback(r);return}this.setBufferingItem(J)}this.setSchedulePosition(q)}else if((R==null?void 0:R.identifier)===s){const q=r.assetList[0];if(q){const J=this.getAssetPlayer(q.identifier);if(R.appendInPlace){const pe=this.primaryMedia;J&&pe&&this.bufferAssetPlayer(J,pe)}else J&&J.loadSource()}}}onError(e,t){if(this.schedule)switch(t.details){case G.ASSET_LIST_PARSING_ERROR:case G.ASSET_LIST_LOAD_ERROR:case G.ASSET_LIST_LOAD_TIMEOUT:{const n=t.interstitial;n&&(this.updateSchedule(!0),this.primaryFallback(n));break}case G.BUFFER_STALLED_ERROR:{const n=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(n)&&n.event.appendInPlace){this.handleInPlaceStall(n.event);return}this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}const zo=500;class Uc extends na{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",ne.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=yt.IDLE,this.setInterval(zo),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:i}=t;if(this.fragContextChanged(n)||(be(n)&&(this.fragPrevious=n),this.state=yt.IDLE),!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let s;const o=n.start;for(let u=0;u<r.length;u++)if(o>=r[u].start&&o<=r[u].end){s=r[u];break}const c=n.start+n.duration;s?s.end=c:(s={start:o,end:c},r.push(s)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:n,endOffset:i}=t;if(n===0&&i!==Number.POSITIVE_INFINITY){const r=i-1;if(r<=0)return;t.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach(s=>{for(let o=0;o<s.length;){if(s[o].end<=r){s.shift();continue}else if(s[o].start<r)s[o].start=r;else break;o++}}),this.fragmentTracker.removeFragmentsInRange(n,r,ne.SUBTITLE)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===ne.SUBTITLE&&(t.details===G.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==yt.STOPPED&&(this.state=yt.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&bo(this.levels,t)){this.levels=t.map(n=>new Wt(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const i=new Wt(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,ne.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.state!==yt.STOPPED&&this.setInterval(zo)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:i,levels:r}=this,{details:s,id:o}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const c=r[o];if(o>=r.length||!c)return;this.log(`Subtitle track ${o} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let u=0;if(s.live||(n=c.details)!=null&&n.live){if(s.deltaUpdateFailed)return;const f=this.mainDetails;if(!f){this.startFragRequested=!1;return}const v=f.fragments[0];if(!c.details)s.hasProgramDateTime&&f.hasProgramDateTime?(ws(s,f),u=s.fragmentStart):v&&(u=v.start,es(s,u));else{var h;u=this.alignPlaylists(s,c.details,(h=this.levelLastLoaded)==null?void 0:h.details),u===0&&v&&(u=v.start,es(s,u))}f&&!this.startFragRequested&&this.setStartPosition(f,u)}c.details=s,this.levelLastLoaded=c,o===i&&(this.hls.trigger(p.SUBTITLE_TRACK_UPDATED,{details:s,id:o,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===yt.IDLE&&(Rn(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),c.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,i=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&i!=null&&i.key&&i.iv&&Pi(i.method)){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer,ur(i.method)).catch(o=>{throw r.trigger(p.ERROR,{type:ue.MEDIA_ERROR,details:G.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const c=performance.now();r.trigger(p.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:s,tdecrypt:c}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=yt.IDLE})}}doTick(){if(!this.media){this.state=yt.IDLE;return}if(this.state===yt.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details||this.waitForLive(n))return;const{config:i}=this,r=this.getLoadPosition(),s=bn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:o,len:c}=s,u=n.details,h=this.hls.maxBufferLength+u.levelTargetDuration;if(c>h)return;const f=u.fragments,v=f.length,R=u.edge;let I=null;const q=this.fragPrevious;if(o<R){const _e=i.maxFragLookUpTolerance,ye=o>R-_e?0:_e;I=Rn(q,f,Math.max(f[0].start,o),ye),!I&&q&&q.start<f[0].start&&(I=f[0])}else I=f[v-1];if(I=this.filterReplacedPrimary(I,n.details),!I)return;const J=I.sn-u.startSN,pe=f[J-1];if(pe&&pe.cc===I.cc&&this.fragmentTracker.getState(pe)===en.NOT_LOADED&&(I=pe),this.fragmentTracker.getState(I)===en.NOT_LOADED){const _e=this.mapToInitFragWhenRequired(I);_e&&this.loadFragment(_e,n,o)}}}loadFragment(e,t,n){be(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Kc(this.tracksBuffered[this.currentTrackId]||[])}}class Kc{constructor(e){this.buffered=void 0;const t=(n,i,r)=>{if(i=i>>>0,i>r-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${r})`);return e[i][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}const Gc={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},Wo=a=>String.fromCharCode(Gc[a]||a),sr=15,br=100,Vc={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},jc={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Hc={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},zc={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Wc=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Zc{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;ae.log(`${this.time} [${e}] ${n}`)}}}const Or=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class Zo{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let n=0;n<t.length;n++){const i=t[n];e.hasOwnProperty(i)&&(this[i]=e[i])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class Yc{constructor(){this.uchar=" ",this.penState=new Zo}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 Xc{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Zo,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<br;t++)this.chars.push(new Yc);this.logger=e}equals(e){for(let t=0;t<br;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<br;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<br;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>br&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=br)}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=Wo(e);if(this.pos>=br){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<br;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<br;n++){const i=this.chars[n].uchar;i!==" "&&(t=!1),e.push(i)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class La{constructor(e){this.rows=[],this.currRow=sr-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<sr;t++)this.rows.push(new Xc(e));this.logger=e}reset(){for(let e=0;e<sr;e++)this.rows[e].clear();this.currRow=sr-1}equals(e){let t=!0;for(let n=0;n<sr;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<sr;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<sr;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 = "+Ke(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let o=0;o<sr;o++)this.rows[o].clear();const r=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const o=s.rows[r].cueStartTime,c=this.logger.time;if(o!==null&&c!==null&&o<c)for(let u=0;u<this.nrRollUpRows;u++)this.rows[t-this.nrRollUpRows+u+1].copy(s.rows[r+u])}}this.currRow=t;const n=this.rows[this.currRow];if(e.indent!==null){const r=e.indent,s=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[s].penState.foreground}const i={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+Ke(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",i=-1;for(let r=0;r<sr;r++){const s=this.rows[r].getTextString();s&&(i=r+1,e?t.push("Row "+i+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(e?n="["+t.join(" | ")+"]":n=t.join(`
|
|
`)),n}getTextAndFormat(){return this.rows}}class Yo{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 La(n),this.nonDisplayedMemory=new La(n),this.lastOutputScreen=new La(n),this.currRollUpRow=this.displayedMemory.rows[sr-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[sr-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let n=0;n<e.length;n++)this.writeScreen.insertChar(e[n]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[n]}this.logger.log(2,"MIDROW: "+Ke(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=Jc(),this.logger=void 0;const i=this.logger=new Zc;this.channels=[null,new Yo(e,t,i),new Yo(e+1,n,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n<t.length;n+=2){const i=t[n]&127,r=t[n+1]&127;let s=!1,o=null;if(i===0&&r===0)continue;this.logger.log(3,()=>"["+Or([t[n],t[n+1]])+"] -> ("+Or([i,r])+")");const c=this.cmdHistory;if(i>=16&&i<=31){if(Qc(i,r,c)){Us(null,null,c),this.logger.log(3,()=>"Repeated command ("+Or([i,r])+") is dropped");continue}Us(i,r,this.cmdHistory),s=this.parseCmd(i,r),s||(s=this.parseMidrow(i,r)),s||(s=this.parsePAC(i,r)),s||(s=this.parseBackgroundAttributes(i,r))}else Us(null,null,c);if(!s&&(o=this.parseChars(i,r),o)){const h=this.currentChannel;h&&h>0?this.channels[h].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Or([i,r])+" orig: "+Or([t[n],t[n+1]]))}}parseCmd(e,t){const n=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(n||i))return!1;const r=e===20||e===21||e===23?1:2,s=this.channels[r];return e===20||e===21||e===28||e===29?t===32?s.ccRCL():t===33?s.ccBS():t===34?s.ccAOF():t===35?s.ccAON():t===36?s.ccDER():t===37?s.ccRU(2):t===38?s.ccRU(3):t===39?s.ccRU(4):t===40?s.ccFON():t===41?s.ccRDC():t===42?s.ccTR():t===43?s.ccRTD():t===44?s.ccEDM():t===45?s.ccCR():t===46?s.ccENM():t===47&&s.ccEOC():s.ccTO(t-32),this.currentChannel=r,!0}parseMidrow(e,t){let n=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?n=1:n=2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[n];return i?(i.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+Or([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let n;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,r=(e===16||e===24)&&t>=64&&t<=95;if(!(i||r))return!1;const s=e<=23?1:2;t>=64&&t<=95?n=s===1?Vc[e]:Hc[e]:n=s===1?jc[e]:zc[e];const o=this.channels[s];return o?(o.setPAC(this.interpretPAC(n,t)),this.currentChannel=s,!0):!1}interpretPAC(e,t){let n;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-64,i.underline=(n&1)===1,n<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((n-16)/2)*4,i}parseChars(e,t){let n,i=null,r=null;if(e>=25?(n=2,r=e-8):(n=1,r=e),r>=17&&r<=19){let s;r===17?s=t+80:r===18?s=t+112:s=t+144,this.logger.log(2,()=>"Special char '"+Wo(s)+"' in channel "+n),i=[s]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+Or(i).join(",")),i}parseBackgroundAttributes(e,t){const n=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(n||i))return!1;let r;const s={};e===16||e===24?(r=Math.floor((t-32)/2),s.background=Wc[r],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(s),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}Us(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 Us(a,e,t){t.a=a,t.b=e}function Qc(a,e,t){return t.a===a&&t.b===e}function Jc(){return{a:null,b:null}}var Ca=function(){if(jn!=null&&jn.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,c){if(typeof c!="string"||!Array.isArray(o))return!1;const u=c.toLowerCase();return~o.indexOf(u)?u:!1}function n(o){return t(a,o)}function i(o){return t(e,o)}function r(o,...c){let u=1;for(;u<arguments.length;u++){const h=arguments[u];for(const f in h)o[f]=h[f]}return o}function s(o,c,u){const h=this,f={enumerable:!0};h.hasBeenReset=!1;let v="",R=!1,I=o,q=c,J=u,pe=null,_e="",ye=!0,Me="auto",Ge="start",dt=50,We="middle",ot=50,at="middle";Object.defineProperty(h,"id",r({},f,{get:function(){return v},set:function(Je){v=""+Je}})),Object.defineProperty(h,"pauseOnExit",r({},f,{get:function(){return R},set:function(Je){R=!!Je}})),Object.defineProperty(h,"startTime",r({},f,{get:function(){return I},set:function(Je){if(typeof Je!="number")throw new TypeError("Start time must be set to a number.");I=Je,this.hasBeenReset=!0}})),Object.defineProperty(h,"endTime",r({},f,{get:function(){return q},set:function(Je){if(typeof Je!="number")throw new TypeError("End time must be set to a number.");q=Je,this.hasBeenReset=!0}})),Object.defineProperty(h,"text",r({},f,{get:function(){return J},set:function(Je){J=""+Je,this.hasBeenReset=!0}})),Object.defineProperty(h,"region",r({},f,{get:function(){return pe},set:function(Je){pe=Je,this.hasBeenReset=!0}})),Object.defineProperty(h,"vertical",r({},f,{get:function(){return _e},set:function(Je){const wt=n(Je);if(wt===!1)throw new SyntaxError("An invalid or illegal string was specified.");_e=wt,this.hasBeenReset=!0}})),Object.defineProperty(h,"snapToLines",r({},f,{get:function(){return ye},set:function(Je){ye=!!Je,this.hasBeenReset=!0}})),Object.defineProperty(h,"line",r({},f,{get:function(){return Me},set:function(Je){if(typeof Je!="number"&&Je!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");Me=Je,this.hasBeenReset=!0}})),Object.defineProperty(h,"lineAlign",r({},f,{get:function(){return Ge},set:function(Je){const wt=i(Je);if(!wt)throw new SyntaxError("An invalid or illegal string was specified.");Ge=wt,this.hasBeenReset=!0}})),Object.defineProperty(h,"position",r({},f,{get:function(){return dt},set:function(Je){if(Je<0||Je>100)throw new Error("Position must be between 0 and 100.");dt=Je,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",r({},f,{get:function(){return We},set:function(Je){const wt=i(Je);if(!wt)throw new SyntaxError("An invalid or illegal string was specified.");We=wt,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",r({},f,{get:function(){return ot},set:function(Je){if(Je<0||Je>100)throw new Error("Size must be between 0 and 100.");ot=Je,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",r({},f,{get:function(){return at},set:function(Je){const wt=i(Je);if(!wt)throw new SyntaxError("An invalid or illegal string was specified.");at=wt,this.hasBeenReset=!0}})),h.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class qc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Qo(a){function e(n,i,r,s){return(n|0)*3600+(i|0)*60+(r|0)+parseFloat(s||0)}const t=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class ed{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let i=0;i<n.length;++i)if(t===n[i]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function Jo(a,e,t,n){const i=n?a.split(n):[a];for(const r in i){if(typeof i[r]!="string")continue;const s=i[r].split(t);if(s.length!==2)continue;const o=s[0],c=s[1];e(o,c)}}const Da=new Ca(0,0,""),Ks=Da.align==="middle"?"middle":"center";function td(a,e,t){const n=a;function i(){const o=Qo(a);if(o===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function r(o,c){const u=new ed;Jo(o,function(v,R){let I;switch(v){case"region":for(let q=t.length-1;q>=0;q--)if(t[q].id===R){u.set(v,t[q].region);break}break;case"vertical":u.alt(v,R,["rl","lr"]);break;case"line":I=R.split(","),u.integer(v,I[0]),u.percent(v,I[0])&&u.set("snapToLines",!1),u.alt(v,I[0],["auto"]),I.length===2&&u.alt("lineAlign",I[1],["start",Ks,"end"]);break;case"position":I=R.split(","),u.percent(v,I[0]),I.length===2&&u.alt("positionAlign",I[1],["start",Ks,"end","line-left","line-right","auto"]);break;case"size":u.percent(v,R);break;case"align":u.alt(v,R,["start",Ks,"end","left","right"]);break}},/:/,/\s/),c.region=u.get("region",null),c.vertical=u.get("vertical","");let h=u.get("line","auto");h==="auto"&&Da.line===-1&&(h=-1),c.line=h,c.lineAlign=u.get("lineAlign","start"),c.snapToLines=u.get("snapToLines",!0),c.size=u.get("size",100),c.align=u.get("align",Ks);let f=u.get("position","auto");f==="auto"&&Da.position===50&&(f=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=f}function s(){a=a.replace(/^\s+/,"")}if(s(),e.startTime=i(),s(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);a=a.slice(3),s(),e.endTime=i(),s(),r(a,e)}function qo(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}class nd{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new qc,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function n(){let r=t.buffer,s=0;for(r=qo(r);s<r.length&&r[s]!=="\r"&&r[s]!==`
|
|
`;)++s;const o=r.slice(0,s);return r[s]==="\r"&&++s,r[s]===`
|
|
`&&++s,t.buffer=r.slice(s),o}function i(r){Jo(r,function(s,o){},/:/)}try{let r="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;r=n();const o=r.match(/^()?WEBVTT([ \t].*)?$/);if(!(o!=null&&o[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let s=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1:r=n(),t.state){case"HEADER":/:/.test(r)?i(r):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;if(t.cue=new Ca(0,0,""),t.state="CUE",r.indexOf("-->")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{td(r,t.cue,t.regionList)}catch(o){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=r.indexOf("-->")!==-1;if(!r||o&&(s=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
|
`),t.cue.text+=r}continue;case"BADCUE":r||(t.state="ID")}}}catch(r){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
|
|
|
|
`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const id=/\r\n|\n\r|\n|\r/g,Oa=function(e,t,n=0){return e.slice(n,n+t.length)===t},rd=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),r=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!x(t)||!x(n)||!x(i)||!x(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*i,t+=60*60*1e3*r,t};function Pa(a,e,t){return us(a.toString())+us(e.toString())+us(t)}const sd=function(e,t,n){let i=e[t],r=e[i.prevCC];if(!r||!r.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(s=r)!=null&&s.new;){var s;e.ccOffset+=i.start-r.start,i.new=!1,i=r,r=e[i.prevCC]}e.presentationOffset=n};function ad(a,e,t,n,i,r,s){const o=new nd,c=je(new Uint8Array(a)).trim().replace(id,`
|
|
`).split(`
|
|
`),u=[],h=e?mu(e.baseTime,e.timescale):0;let f="00:00.000",v=0,R=0,I,q=!0;o.oncue=function(J){const pe=t[n];let _e=t.ccOffset;const ye=(v-h)/9e4;if(pe!=null&&pe.new&&(R!==void 0?_e=t.ccOffset=pe.start:sd(t,n,ye)),ye){if(!e){I=new Error("Missing initPTS for VTT MPEGTS");return}_e=ye-t.presentationOffset}const Me=J.endTime-J.startTime,Ge=ji((J.startTime+_e-R)*9e4,i*9e4)/9e4;J.startTime=Math.max(Ge,0),J.endTime=Math.max(Ge+Me,0);const dt=J.text.trim();J.text=decodeURIComponent(encodeURIComponent(dt)),J.id||(J.id=Pa(J.startTime,J.endTime,dt)),J.endTime>0&&u.push(J)},o.onparsingerror=function(J){I=J},o.onflush=function(){if(I){s(I);return}r(u)},c.forEach(J=>{if(q)if(Oa(J,"X-TIMESTAMP-MAP=")){q=!1,J.slice(16).split(",").forEach(pe=>{Oa(pe,"LOCAL:")?f=pe.slice(6):Oa(pe,"MPEGTS:")&&(v=parseInt(pe.slice(7)))});try{R=rd(f)/1e3}catch(pe){I=pe}return}else J===""&&(q=!1);o.parse(J+`
|
|
`)}),o.flush()}const ka="stpp.ttml.im1t",el=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,tl=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,od={left:"start",center:"center",right:"end",start:"start",end:"end"};function nl(a,e,t,n){const i=re(new Uint8Array(a),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(o=>je(o)),s=pu(e.baseTime,1,e.timescale);try{r.forEach(o=>t(ld(o,s)))}catch(o){n(o)}}function ld(a,e){const i=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(r).reduce((f,v)=>(f[v]=i.getAttribute(`ttp:${v}`)||r[v],f),{}),o=i.getAttribute("xml:space")!=="preserve",c=il(Ma(i,"styling","style")),u=il(Ma(i,"layout","region")),h=Ma(i,"body","[begin]");return[].map.call(h,f=>{const v=rl(f,o);if(!v||!f.hasAttribute("begin"))return null;const R=Ba(f.getAttribute("begin"),s),I=Ba(f.getAttribute("dur"),s);let q=Ba(f.getAttribute("end"),s);if(R===null)throw sl(f);if(q===null){if(I===null)throw sl(f);q=R+I}const J=new Ca(R-e,q-e,v);J.id=Pa(J.startTime,J.endTime,J.text);const pe=u[f.getAttribute("region")],_e=c[f.getAttribute("style")],ye=ud(pe,_e,c),{textAlign:Me}=ye;if(Me){const Ge=od[Me];Ge&&(J.lineAlign=Ge),J.align=Me}return m(J,ye),J}).filter(f=>f!==null)}function Ma(a,e,t){const n=a.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function il(a){return a.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function rl(a,e){return[].slice.call(a.childNodes).reduce((t,n,i)=>{var r;return n.nodeName==="br"&&i?t+`
|
|
`:(r=n.childNodes)!=null&&r.length?rl(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function ud(a,e,t){const n="http://www.w3.org/ns/ttml#styling";let i=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return s&&t.hasOwnProperty(s)&&(i=t[s]),r.reduce((o,c)=>{const u=Na(e,n,c)||Na(a,n,c)||Na(i,n,c);return u&&(o[c]=u),o},{})}function Na(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function sl(a){return new Error(`Could not parse ttml timestamp ${a}`)}function Ba(a,e){if(!a)return null;let t=Qo(a);return t===null&&(el.test(a)?t=cd(a,e):tl.test(a)&&(t=dd(a,e))),t}function cd(a,e){const t=el.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 dd(a,e){const t=tl.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 Gs{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 hd{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=ll(),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 Gs(this,"textTrack1"),t=new Gs(this,"textTrack2"),n=new Gs(this,"textTrack3"),i=new Gs(this,"textTrack4");this.cea608Parser1=new Xo(1,e,t),this.cea608Parser2=new Xo(3,n,i)}addCues(e,t,n,i,r){let s=!1;for(let o=r.length;o--;){const c=r[o],u=fd(c[0],c[1],t,n);if(u>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],n),s=!0,u/(n-t)>.5))return}if(s||r.push([t,n]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,n,i)}else{const o=this.Cues.newCue(null,t,n,i);this.hls.trigger(p.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r,trackId:s}){const{unparsedVttFrags:o}=this;n===ne.MAIN&&(this.initPTS[t.cc]={baseTime:i,timescale:r,trackId:s}),o.length&&(this.unparsedVttFrags=[],o.forEach(c=>{this.initPTS[c.frag.cc]?this.onFragLoaded(p.FRAG_LOADED,c):this.hls.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i<n.textTracks.length;i++){const r=n.textTracks[i];if(ol(r,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return r}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:i}=this,{label:r,languageCode:s}=t[e],o=this.getExistingTrack(r,s);if(o)n[e]=o,jr(n[e]),Ko(n[e],i);else{const c=this.createTextTrack("captions",r,s);c&&(c[e]=!0,n[e]=c)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n=t.label,i={_id:e,label:n,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(p.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(e,t,n){const i=this.media;if(i)return i.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const n=!!t.transferMedia;if(this.media=null,n)return;const{captionsTracks:i}=this;Object.keys(i).forEach(r=>{jr(i[r]),delete i[r]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=ll(),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++)jr(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],i=n.some(r=>r.textCodec===ka);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(bo(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,o=s?Bs(s.textTracks):null;if(this.tracks.forEach((c,u)=>{let h;if(o){let f=null;for(let v=0;v<o.length;v++)if(o[v]&&ol(o[v],c)){f=o[v],o[v]=null;break}f&&(h=f)}if(h)jr(h);else{const f=al(c);h=this.createTextTrack(f,c.name,c.lang),h&&(h.mode="disabled")}h&&this.textTracks.push(h)}),o!=null&&o.length){const c=o.filter(u=>u!==null).map(u=>u.label);c.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${c.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const s=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(p.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(n=>{const i=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!i)return;const r=`textTrack${i[1]}`,s=this.captionsProperties[r];s&&(s.label=n.name,n.lang&&(s.languageCode=n.lang),s.media=n)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===ne.MAIN){var n,i;const{cea608Parser1:r,cea608Parser2:s,lastSn:o}=this,{cc:c,sn:u}=t.frag,h=(n=(i=t.part)==null?void 0:i.index)!=null?n:-1;r&&s&&(u!==o+1||u===o&&h!==this.lastPartIndex+1||c!==this.lastCc)&&(r.reset(),s.reset()),this.lastCc=c,this.lastSn=u,this.lastPartIndex=h}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===ne.SUBTITLE)if(i.byteLength){const r=n.decryptdata,s="stats"in t;if(r==null||!r.encrypted||s){const o=this.tracks[n.level],c=this.vttCCs;c[n.cc]||(c[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),o&&o.textCodec===ka?this._parseIMSC1(n,i):this._parseVTTs(t)}}else this.hls.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;nl(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),n.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{n.logger.log(`Failed to parse IMSC1: ${i}`),n.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:n,payload:i}=e,{initPTS:r,unparsedVttFrags:s}=this,o=r.length-1;if(!r[n.cc]&&o===-1){s.push(e);return}const c=this.hls,u=(t=n.initSegment)!=null&&t.data?Ye(n.initSegment.data,new Uint8Array(i)).buffer:i;ad(u,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,h=>{this._appendCues(h,n.level),c.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},h=>{const f=h.message==="Missing initPTS for VTT MPEGTS";f?s.push(e):this._fallbackToIMSC1(n,i),c.logger.log(`Failed to parse VTT cue: ${h}`),!(f&&o>n.cc)&&c.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:h})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||nl(t,this.initPTS[e.cc],()=>{n.textCodec=ka,this._parseIMSC1(e,t)},()=>{n.textCodec="wvtt"})}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(r=>Go(i,r))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;n.trigger(p.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===ne.SUBTITLE&&this.onFragLoaded(p.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:i}=t;if(!(n.type===ne.MAIN&&this.closedCaptionsForLevel(n)==="NONE"))for(let r=0;r<i.length;r++){const s=i[r].bytes;if(s){this.cea608Parser1||this.initCea608Parsers();const o=this.extractCea608Data(s);this.cea608Parser1.addData(i[r].pts,o[0]),this.cea608Parser2.addData(i[r].pts,o[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:i,type:r}){const{media:s}=this;if(!(!s||s.currentTime<n)){if(!r||r==="video"){const{captionsTracks:o}=this;Object.keys(o).forEach(c=>Aa(o[c],t,n))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(c=>Aa(o[c],t,i))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let i=2;for(let r=0;r<n;r++){const s=e[i++],o=127&e[i++],c=127&e[i++];if(o===0&&c===0)continue;if((4&s)!==0){const h=3&s;(h===0||h===1)&&(t[h].push(o),t[h].push(c))}}return t}}function al(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function ol(a,e){return!!a&&a.kind===al(e)&&va(e,a)}function fd(a,e,t,n){return Math.min(e,n)-Math.max(a,t)}function ll(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const pd=/\s/,md={newCue(a,e,t,n){const i=[];let r,s,o,c,u;const h=self.VTTCue||self.TextTrackCue;for(let v=0;v<n.rows.length;v++)if(r=n.rows[v],o=!0,c=0,u="",!r.isEmpty()){var f;for(let q=0;q<r.chars.length;q++)pd.test(r.chars[q].uchar)&&o?c++:(u+=r.chars[q].uchar,o=!1);r.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const R=qo(u.trim()),I=Pa(e,t,R);a!=null&&(f=a.cues)!=null&&f.getCueById(I)||(s=new h(e,t,R),s.id=I,s.line=v+1,s.align="left",s.position=10+Math.min(80,Math.floor(c*8/32)*10),i.push(s))}return a&&i.length&&(i.sort((v,R)=>v.line==="auto"||R.line==="auto"?0:v.line>8&&R.line>8?R.line-v.line:v.line-R.line),i.forEach(v=>Go(a,v))),i}};function gd(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const _d=/(\d+)-(\d+)\/(\d+)/;class ul{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||bd,this.controller=new self.AbortController,this.stats=new y}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const r=vd(e,this.controller.signal),s=e.responseType==="arraybuffer",o=s?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:u}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=c&&x(c)?c:u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},t.timeout),(os(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(f=>{var v;this.response=this.loader=f;const R=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,e,this.response))},u-(R-i.loading.start)),!f.ok){const{status:q,statusText:J}=f;throw new Sd(J||"fetch, bad network response",q,f)}i.loading.first=R,i.total=Ed(f.headers)||i.total;const I=(v=this.callbacks)==null?void 0:v.onProgress;return I&&x(t.highWaterMark)?this.loadProgressively(f,i,e,t.highWaterMark,I):s?f.arrayBuffer():e.responseType==="json"?f.json():f.text()}).then(f=>{var v,R;const I=this.response;if(!I)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const q=f[o];q&&(i.loaded=i.total=q);const J={url:I.url,data:f,code:I.status},pe=(v=this.callbacks)==null?void 0:v.onProgress;pe&&!x(t.highWaterMark)&&pe(i,e,f,I),(R=this.callbacks)==null||R.onSuccess(J,i,e,I)}).catch(f=>{var v;if(self.clearTimeout(this.requestTimeout),i.aborted)return;const R=f&&f.code||0,I=f?f.message:null;(v=this.callbacks)==null||v.onError({code:R,text:I},e,f?f.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,i=0,r){const s=new za,o=e.body.getReader(),c=()=>o.read().then(u=>{if(u.done)return s.dataLength&&r(t,n,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const h=u.value,f=h.length;return t.loaded+=f,f<i||s.dataLength?(s.push(h),s.dataLength>=i&&r(t,n,s.flush().buffer,e)):r(t,n,h.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function vd(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(m({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function yd(a){const e=_d.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function Ed(a){const e=a.get("Content-Range");if(e){const n=yd(e);if(x(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function bd(a,e){return new self.Request(a.url,e)}class Sd extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const xd=/^age:\s*[\d.]+\s*$/im;class cl{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 y,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return r(n,t.url)}).catch(s=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),r(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(s=>{var o;(o=this.callbacks)==null||o.onError({code:n.status,text:s.message},t,n,i)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:s}=n.loadPolicy;if(i)for(const o in i)e.setRequestHeader(o,i[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=r&&x(r)?r:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const i=t.readyState,r=this.config;if(!n.aborted&&i>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const u=t.status,h=t.responseType==="text"?t.responseText:null;if(u>=200&&u<300){const I=h!=null?h:t.response;if(I!=null){var s,o;n.loading.end=Math.max(self.performance.now(),n.loading.first);const q=t.responseType==="arraybuffer"?I.byteLength:I.length;n.loaded=n.total=q,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);const J=(s=this.callbacks)==null?void 0:s.onProgress;J&&J(n,e,I,t);const pe={url:t.responseURL,data:I,code:u};(o=this.callbacks)==null||o.onSuccess(pe,n,e,t);return}}const f=r.loadPolicy.errorRetry,v=n.retry,R={url:e.url,data:void 0,code:u};if(ni(f,v,!1,R))this.retry(f);else{var c;ae.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(ni(e,t,!0))this.retry(e);else{var n;ae.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=Zn(e,n.retry),n.retry++,ae.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&&xd.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 Td={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},wd=E(E({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:cl,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Pn,bufferController:Cu,capLevelController:Ea,errorController:rn,fpsController:Ic,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:_r,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:Td},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},Ad()),{},{subtitleStreamController:Uc,subtitleTrackController:Dc,timelineController:hd,audioStreamController:Au,audioTrackController:Ru,emeController:Vr,cmcdController:Tc,contentSteeringController:Ac,interstitialsController:$c});function Ad(){return{cueHandler:md,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 Rd(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=Fa(a),i=["manifest","level","frag"],r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(s=>{const o=`${s==="level"?"playlist":s}LoadPolicy`,c=e[o]===void 0,u=[];r.forEach(h=>{const f=`${s}Loading${h}`,v=e[f];if(v!==void 0&&c){u.push(f);const R=n[o].default;switch(e[o]={default:R},h){case"TimeOut":R.maxLoadTimeMs=v,R.maxTimeToFirstByteMs=v;break;case"MaxRetry":R.errorRetry.maxNumRetry=v,R.timeoutRetry.maxNumRetry=v;break;case"RetryDelay":R.errorRetry.retryDelayMs=v,R.timeoutRetry.retryDelayMs=v;break;case"MaxRetryTimeout":R.errorRetry.maxRetryDelayMs=v,R.timeoutRetry.maxRetryDelayMs=v;break}}}),u.length&&t.warn(`hls.js config: "${u.join('", "')}" setting(s) are deprecated, use "${o}": ${Ke(e[o])}`)}),E(E({},n),e)}function Fa(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(Fa):Object.keys(a).reduce((e,t)=>(e[t]=Fa(a[t]),e),{}):a}function Id(a,e){const t=a.loader;t!==ul&&t!==cl?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):gd()&&(a.loader=ul,a.progressive=!0,a.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const Vs=2,Ld=.1,Cd=.05,Dd=100;class Od extends zi{constructor(e,t){super("gap-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var 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(Dd),this.mediaSource=t.mediaSource;const n=this.media=t.media;ki(n,"playing",this.onMediaPlaying),ki(n,"waiting",this.onMediaWaiting),ki(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(Ni(n,"playing",this.onMediaPlaying),Ni(n,"waiting",this.onMediaWaiting),Ni(n,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var n,i;const r=(n=this.hls)==null?void 0:n.config;if(!r)return;const s=this.media;if(!s)return;const{seeking:o}=s,c=this.seeking&&!o,u=!this.seeking&&o,h=s.paused&&!o||s.ended||s.playbackRate===0;if(this.seeking=o,e!==t){t&&(this.ended=0),this.moved=!0,o||(this.nudgeRetry=0,r.nudgeOnVideoHole&&!h&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(u||c){c&&this.stallResolved(e);return}if(h){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(!bn.getBuffered(s).length){this.nudgeRetry=0;return}const f=bn.bufferInfo(s,e,0),v=f.nextStart||0,R=this.fragmentTracker;if(o&&R&&this.hls){const dt=dl(this.hls.inFlightFragments,e),We=f.len>Vs,ot=!v||dt||v-e>Vs&&!R.getPartialFragment(e);if(We||ot)return;this.moved=!1}const I=(i=this.hls)==null?void 0:i.latestLevelDetails;if(!this.moved&&this.stalled!==null&&R){if(!(f.len>0)&&!v)return;const We=Math.max(v,f.start||0)-e,at=!!(I!=null&&I.live)?I.targetduration*2:Vs,Je=js(e,R);if(We>0&&(We<=at||Je)){s.paused||this._trySkipBufferHole(Je);return}}const q=r.detectStallWithCurrentTimeMs,J=self.performance.now(),pe=this.waiting;let _e=this.stalled;if(_e===null)if(pe>0&&J-pe<q)_e=this.stalled=pe;else{this.stalled=J;return}const ye=J-_e;if(!o&&(ye>=q||pe)&&this.hls){var Me;if(((Me=this.mediaSource)==null?void 0:Me.readyState)==="ended"&&!(I!=null&&I.live)&&Math.abs(e-((I==null?void 0:I.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(p.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(f),!this.media||!this.hls)return}const Ge=bn.bufferInfo(s,e,r.maxBufferHole);this._tryFixBufferStall(Ge,ye,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(p.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;const i=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(n=this.buffered.audio)!=null&&n.length&&i&&i.length>1&&e>i.end(0)){const r=bn.bufferedInfo(bn.timeRangesToArray(this.buffered.audio),e,0);if(r.len>1&&t>=r.start){const s=bn.timeRangesToArray(i),o=bn.bufferedInfo(s,t,0).bufferedIndex;if(o>-1&&o<s.length-1){const c=bn.bufferedInfo(s,e,0).bufferedIndex,u=s[o].end,h=s[o+1].start;if((c===-1||c>o)&&h-u<1&&e-u<2){const f=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${u} -> ${h} buffered index: ${c}`);this.warn(f.message),this.media.currentTime+=1e-6;let v=js(e,this.fragmentTracker);v&&"fragment"in v?v=v.fragment:v||(v=void 0);const R=bn.bufferInfo(this.media,e,0);this.hls.trigger(p.ERROR,{type:ue.MEDIA_ERROR,details:G.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:f,reason:f.message,frag:v,buffer:R.len,bufferInfo:R})}}}}}_tryFixBufferStall(e,t,n){var i,r;const{fragmentTracker:s,media:o}=this,c=(i=this.hls)==null?void 0:i.config;if(!o||!s||!c)return;const u=(r=this.hls)==null?void 0:r.latestLevelDetails,h=js(n,s);if((h||u!=null&&u.live&&n<u.fragmentStart)&&(this._trySkipBufferHole(h)||!this.media))return;const f=e.buffered,v=this.adjacentTraversal(e,n);(f&&f.length>1&&e.len>c.maxBufferHole||e.nextStart&&(e.nextStart-n<c.maxBufferHole||v))&&(t>c.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const n=this.fragmentTracker,i=e.nextStart;if(n&&i){const r=n.getFragAtPos(t,ne.MAIN),s=n.getFragAtPos(i,ne.MAIN);if(r&&s)return s.sn-r.sn<2}return!1}_reportStall(e){const{hls:t,media:n,stallReported:i,stalled:r}=this;if(!i&&r!==null&&n&&t){this.stallReported=!0;const s=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${Ke(e)})`);this.warn(s.message),t.trigger(p.ERROR,{type:ue.MEDIA_ERROR,details:G.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:e.len,bufferInfo:e,stalled:{start:r}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:n,media:i}=this,r=(t=this.hls)==null?void 0:t.config;if(!i||!n||!r)return 0;const s=i.currentTime,o=bn.bufferInfo(i,s,0),c=s<o.start?o.start:o.nextStart;if(c&&this.hls){const h=o.len<=r.maxBufferHole,f=o.len>0&&o.len<1&&i.readyState<3,v=c-s;if(v>0&&(h||f)){if(v>r.maxBufferHole){let I=!1;if(s===0){const q=n.getAppendedFrag(0,ne.MAIN);q&&c<q.end&&(I=!0)}if(!I&&e){var u;if(!((u=this.hls.loadLevelObj)!=null&&u.details)||dl(this.hls.inFlightFragments,c))return 0;let J=!1,pe=e.end;for(;pe<c;){const _e=js(pe,n);if(_e)pe+=_e.duration;else{J=!0;break}}if(J)return 0}}const R=Math.max(c+Cd,s+Ld);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${R}`),this.moved=!0,i.currentTime=R,!(e!=null&&e.gap)){const I=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${R}`),q={type:ue.MEDIA_ERROR,details:G.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:I,reason:I.message,buffer:o.len,bufferInfo:o};e&&("fragment"in e?q.part=e:q.frag=e),this.hls.trigger(p.ERROR,q)}return R}}return 0}_tryNudgeBuffer(e){const{hls:t,media:n,nudgeRetry:i}=this,r=t==null?void 0:t.config;if(!n||!r)return 0;const s=n.currentTime;if(this.nudgeRetry++,i<r.nudgeMaxRetry){const o=s+(i+1)*r.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${s} to ${o}`);this.warn(c.message),n.currentTime=o,t.trigger(p.ERROR,{type:ue.MEDIA_ERROR,details:G.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const o=new Error(`Playhead still not moving while enough data buffered @${s} after ${r.nudgeMaxRetry} nudges`);this.error(o.message),t.trigger(p.ERROR,{type:ue.MEDIA_ERROR,details:G.BUFFER_STALLED_ERROR,error:o,fatal:!0,buffer:e.len,bufferInfo:e})}}}function dl(a,e){const t=hl(a.main);if(t&&t.start<=e)return t;const n=hl(a.audio);return n&&n.start<=e?n:null}function hl(a){if(!a)return null;switch(a.state){case yt.IDLE:case yt.STOPPED:case yt.ENDED:case yt.ERROR:return null}return a.frag}function js(a,e){return e.getAppendedFrag(a,ne.MAIN)||e.getPartialFragment(a)}const Pd=.25;function $a(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Ua(a,e,t,n,i){let r=new a(e,t,"");try{r.value=n,i&&(r.type=i)}catch(s){r=new a(e,t,Ke(i?E({type:i},n):n))}return r}const Hs=(()=>{const a=$a();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class kd{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(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&&(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&&(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(){var e;const t=(e=this.hls)==null?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&jr(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 Ko(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:n,enableID3MetadataCues:i}=this.hls.config;if(!n&&!i)return;const{samples:r}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=$a();if(s)for(let o=0;o<r.length;o++){const c=r[o].type;if(c===Vi.emsg&&!n||!i)continue;const u=eo(r[o].data),h=r[o].pts;let f=h+r[o].duration;f>Hs&&(f=Hs),f-h<=0&&(f=h+Pd);for(let R=0;R<u.length;R++){const I=u[R];if(!to(I)){this.updateId3CueEnds(h,c);const q=Ua(s,h,f,I,c);q&&this.id3Track.addCue(q)}}}}updateId3CueEnds(e,t){var n;const i=(n=this.id3Track)==null?void 0:n.cues;if(i)for(let r=i.length;r--;){const s=i[r];s.type===t&&s.startTime<e&&s.endTime===Hs&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:i}){const{id3Track:r,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:o,enableID3MetadataCues:c}}=s;if(r&&(o||c)){let u;i==="audio"?u=h=>h.type===Vi.audioId3&&c:i==="video"?u=h=>h.type===Vi.emsg&&o:u=h=>h.type===Vi.audioId3&&c||h.type===Vi.emsg&&o,Aa(r,t,n,u)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;const{assetPlayerId:n,timelineOffset:i,enableDateRangeMetadataCues:r,interstitialsController:s}=this.hls.config;if(!r)return;const o=$a();if(n&&i&&!s){const{fragmentStart:q,fragmentEnd:J}=e;let pe=this.assetCue;pe?(pe.startTime=q,pe.endTime=J):o&&(pe=this.assetCue=Ua(o,q,J,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),pe&&(pe.id=n,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(pe),pe.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:c}=this,{dateRanges:u}=e,h=Object.keys(u);let f=this.dateRangeCuesAppended;if(c&&t){var v;if((v=c.cues)!=null&&v.length){const q=Object.keys(f).filter(J=>!h.includes(J));for(let J=q.length;J--;){var R;const pe=q[J],_e=(R=f[pe])==null?void 0:R.cues;delete f[pe],_e&&Object.keys(_e).forEach(ye=>{const Me=_e[ye];if(Me){Me.removeEventListener("enter",this.onEventCueEnter);try{c.removeCue(Me)}catch(Ge){}}})}}else f=this.dateRangeCuesAppended={}}const I=e.fragments[e.fragments.length-1];if(!(h.length===0||!x(I==null?void 0:I.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let q=0;q<h.length;q++){const J=h[q],pe=u[J],_e=pe.startTime,ye=f[J],Me=(ye==null?void 0:ye.cues)||{};let Ge=(ye==null?void 0:ye.durationKnown)||!1,dt=Hs;const{duration:We,endDate:ot}=pe;if(ot&&We!==null)dt=_e+We,Ge=!0;else if(pe.endOnNext&&!Ge){const Je=h.reduce((wt,Xt)=>{if(Xt!==pe.id){const on=u[Xt];if(on.class===pe.class&&on.startDate>pe.startDate&&(!wt||pe.startDate<wt.startDate))return on}return wt},null);Je&&(dt=Je.startTime,Ge=!0)}const at=Object.keys(pe.attr);for(let Je=0;Je<at.length;Je++){const wt=at[Je];if(!Oi(wt))continue;const Xt=Me[wt];if(Xt)Ge&&!(ye!=null&&ye.durationKnown)?Xt.endTime=dt:Math.abs(Xt.startTime-_e)>.01&&(Xt.startTime=_e,Xt.endTime=dt);else if(o){let on=pe.attr[wt];nr(wt)&&(on=M(on));const ln=Ua(o,_e,dt,{key:wt,data:on},Vi.dateRange);ln&&(ln.id=J,this.id3Track.addCue(ln),Me[wt]=ln,s&&(wt==="X-ASSET-LIST"||wt==="X-ASSET-URL")&&ln.addEventListener("enter",this.onEventCueEnter))}}f[J]={cues:Me,dateRange:pe,durationKnown:Ge}}}}}class Md{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,n=this.levelDetails;if(!t||!n)return;this.currentTime=t.currentTime;const i=this.computeLatency();if(i===null)return;this._latency=i;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:s}=this.config;if(!r||s===1||!n.live)return;const o=this.targetLatency;if(o===null)return;const c=i-o,u=Math.min(this.maxLatency,o+n.targetduration);if(c<u&&c>.05&&this.forwardBufferLength>1){const f=Math.min(2,Math.max(1,s)),v=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,R=Math.min(f,Math.max(1,v));this.changeMediaPlaybackRate(t,R)}else t.playbackRate!==1&&t.playbackRate!==0&&this.changeMediaPlaybackRate(t,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return((e=this.hls)==null?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:t,partHoldBack:n,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:s,lowLatencyMode:o}=this.config,c=this.hls.userConfig;let u=o&&n||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||u===0)&&(u=r!==void 0?r:s*i);const h=i;return u+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,h)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;const n=this.levelDetails;if(n===null)return null;const i=n.edge,r=e-t-this.edgeStalled,s=i-n.totalduration,o=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,r),o)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var n;t.details===G.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(n=this.levelDetails)!=null&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var n,i;e.playbackRate!==t&&((n=this.hls)==null||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(i=this.targetLatency)==null?void 0:i.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class Nd extends _a{constructor(e,t){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,i=[],r={},s={};let o=!1,c=!1,u=!1;t.levels.forEach(h=>{const f=h.attrs;let{audioCodec:v,videoCodec:R}=h;v&&(h.audioCodec=v=un(v,n)||void 0),R&&(R=h.videoCodec=rt(R));const{width:I,height:q,unknownCodecs:J}=h,pe=(J==null?void 0:J.length)||0;if(o||(o=!!(I&&q)),c||(c=!!R),u||(u=!!v),pe||v&&!this.isAudioSupported(v)||R&&!this.isVideoSupported(R)){this.log(`Some or all CODECS not supported "${f.CODECS}"`);return}const{CODECS:_e,"FRAME-RATE":ye,"HDCP-LEVEL":Me,"PATHWAY-ID":Ge,RESOLUTION:dt,"VIDEO-RANGE":We}=f,at=`${`${Ge||"."}-`}${h.bitrate}-${dt}-${ye}-${_e}-${We}-${Me}`;if(r[at])if(r[at].uri!==h.url&&!h.attrs["PATHWAY-ID"]){const Je=s[at]+=1;h.attrs["PATHWAY-ID"]=new Array(Je+1).join(".");const wt=this.createLevel(h);r[at]=wt,i.push(wt)}else r[at].addGroupId("audio",f.AUDIO),r[at].addGroupId("text",f.SUBTITLES);else{const Je=this.createLevel(h);r[at]=Je,s[at]=1,i.push(Je)}}),this.filterAndSortMediaOptions(i,t,o,c,u)}createLevel(e){const t=new Wt(e),n=e.supplemental;if(n!=null&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const i=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(i.message),t.supportedResult=Ce(i,[])}return t}isAudioSupported(e){return Tt(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Tt(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,i,r){var s;let o=[],c=[],u=e;const h=((s=t.stats)==null?void 0:s.parsing)||{};if((n||i)&&r&&(u=u.filter(({videoCodec:_e,videoRange:ye,width:Me,height:Ge})=>(!!_e||!!(Me&&Ge))&&Bt(ye))),u.length===0){Promise.resolve().then(()=>{if(this.hls){let _e="no level with compatible codecs found in manifest",ye=_e;t.levels.length&&(ye=`one or more CODECS in variant not supported: ${Ke(t.levels.map(Ge=>Ge.attrs.CODECS).filter((Ge,dt,We)=>We.indexOf(Ge)===dt))}`,this.warn(ye),_e+=` (${ye})`);const Me=new Error(_e);this.hls.trigger(p.ERROR,{type:ue.MEDIA_ERROR,details:G.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:Me,reason:ye})}}),h.end=performance.now();return}t.audioTracks&&(o=t.audioTracks.filter(_e=>!_e.audioCodec||this.isAudioSupported(_e.audioCodec)),fl(o)),t.subtitles&&(c=t.subtitles,fl(c));const f=u.slice(0);u.sort((_e,ye)=>{if(_e.attrs["HDCP-LEVEL"]!==ye.attrs["HDCP-LEVEL"])return(_e.attrs["HDCP-LEVEL"]||"")>(ye.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&_e.height!==ye.height)return _e.height-ye.height;if(_e.frameRate!==ye.frameRate)return _e.frameRate-ye.frameRate;if(_e.videoRange!==ye.videoRange)return mt.indexOf(_e.videoRange)-mt.indexOf(ye.videoRange);if(_e.videoCodec!==ye.videoCodec){const Me=St(_e.videoCodec),Ge=St(ye.videoCodec);if(Me!==Ge)return Ge-Me}if(_e.uri===ye.uri&&_e.codecSet!==ye.codecSet){const Me=Jt(_e.codecSet),Ge=Jt(ye.codecSet);if(Me!==Ge)return Ge-Me}return _e.averageBitrate!==ye.averageBitrate?_e.averageBitrate-ye.averageBitrate:0});let v=f[0];if(this.steering&&(u=this.steering.filterParsedLevels(u),u.length!==f.length)){for(let _e=0;_e<f.length;_e++)if(f[_e].pathwayId===u[0].pathwayId){v=f[_e];break}}this._levels=u;for(let _e=0;_e<u.length;_e++)if(u[_e]===v){var R;this._firstLevel=_e;const ye=v.bitrate,Me=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${u.length} level(s) found, first bitrate: ${ye}`),((R=this.hls.userConfig)==null?void 0:R.abrEwmaDefaultEstimate)===void 0){const Ge=Math.min(ye,this.hls.config.abrEwmaDefaultEstimateMax);Ge>Me&&Me===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=Ge)}break}const I=r&&!i,q=this.hls.config,J=!!(q.audioStreamController&&q.audioTrackController),pe={levels:u,audioTracks:o,subtitleTracks:c,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:J&&!I&&o.some(_e=>!!_e.url)};h.end=performance.now(),this.hls.trigger(p.MANIFEST_PARSED,pe)}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 h=new Error("invalid level idx"),f=e<0;if(this.hls.trigger(p.ERROR,{type:ue.OTHER_ERROR,details:G.LEVEL_SWITCH_ERROR,level:e,fatal:f,error:h,reason:h.message}),f)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,s=t[e],o=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,n===e&&i&&r===o)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${o?" with Pathway "+o:""} from level ${n}${r?" with Pathway "+r:""}`);const c={level:e,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width,height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError,name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(p.LEVEL_SWITCHING,c);const u=s.details;if(!u||u.live){const h=this.switchParams(s.uri,i==null?void 0:i.details,u);this.loadPlaylist(h)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),n=e.filter(i=>t.indexOf(i)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=n}}onError(e,t){t.fatal||!t.context||t.context.type===se.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===ne.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(r=>!!n[r]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var n;const{level:i,details:r}=t,s=t.levelInfo;if(!s){var o;this.warn(`Invalid level index ${i}`),(o=t.deliveryDirectives)!=null&&o.skip&&(r.deltaUpdateFailed=!0);return}if(s===this.currentLevel||t.withoutMultiVariant){s.fragmentError===0&&(s.loadError=0);let c=s.details;c===t.details&&c.advanced&&(c=void 0),this.playlistLoaded(i,t,c)}else(n=t.deliveryDirectives)!=null&&n.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=this.getUrlWithDirectives(e.uri,t),i=this.currentLevelIndex,r=e.attrs["PATHWAY-ID"],s=e.details,o=s==null?void 0:s.age;this.log(`Loading level index ${i}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${r?" Pathway "+r:""}${o&&s.live?" age "+o.toFixed(1)+(s.type?" "+s.type||0:""):""} ${n}`),this.hls.trigger(p.LEVEL_LOADING,{url:n,level:i,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const n=this._levels.filter((r,s)=>s!==e?!0:(this.steering&&this.steering.removeLevel(r),r===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,r.details&&r.details.fragments.forEach(o=>o.level=-1)),!1));Ri(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const i=n.length-1;this._firstLevel=Math.min(this._firstLevel,i),this._startLevel&&(this._startLevel=Math.min(this._startLevel,i)),this.hls.trigger(p.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(p.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function fl(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}function pl(){return self.SourceBuffer||self.WebKitSourceBuffer}function ml(){if(!Se())return!1;const e=pl();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function Bd(){if(!ml())return!1;const a=Se();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(Ot(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(Ot(e,"audio"))))}function Fd(){var a;const e=pl();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const $d=100;class Ud extends na{constructor(e,t,n){super(e,t,n,"stream-controller",ne.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const i=this.media,r=i?i.currentTime:null;if(r===null||!x(r)||(this.log(`Media seeked to ${r.toFixed(3)}`),!this.getBufferedFrag(r)))return;const s=this.getFwdBufferInfoAtPos(i,r,ne.MAIN,0);if(s===null||s.len===0){this.warn(`Main forward buffer length at ${r} on "seeked" event ${s?s.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:n,hls:i}=this;if(this.stopLoad(),this.setInterval($d),this.level=-1,!this.startFragRequested){let r=i.startLevel;r===-1&&(i.config.testBandwidth&&this.levels.length>1?(r=0,this.bitrateTest=!0):r=i.firstAutoLevel),i.nextLoadLevel=r,this.level=i.loadLevel,this._hasEnoughToStart=!!t}n>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=yt.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=yt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case yt.WAITING_LEVEL:{const{levels:e,level:t}=this,n=e==null?void 0:e[t],i=n==null?void 0:n.details;if(i&&(!i.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(i))break;this.state=yt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=yt.IDLE;break}break}case yt.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===yt.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:i}=this;if(t===null||!i&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const r=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[r]))return;const s=n[r],o=this.getMainFwdBufferInfo();if(o===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(o,c)){const q={};this.altAudio===2&&(q.type="video"),this.hls.trigger(p.BUFFER_EOS,q),this.state=yt.ENDED;return}if(!this.buffering)return;e.loadLevel!==r&&e.manualLevel===-1&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=e.nextLoadLevel=r;const u=s.details;if(!u||this.state===yt.WAITING_LEVEL||this.waitForLive(s)){this.level=r,this.state=yt.WAITING_LEVEL,this.startFragRequested=!1;return}const h=o.len,f=this.getMaxBufferLength(s.maxBitrate);if(h>=f)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const v=this.backtrackFragment?this.backtrackFragment.start:o.end;let R=this.getNextFragment(v,u);if(this.couldBacktrack&&!this.fragPrevious&&R&&be(R)&&this.fragmentTracker.getState(R)!==en.OK){var I;const J=((I=this.backtrackFragment)!=null?I:R).sn-u.startSN,pe=u.fragments[J-1];pe&&R.cc===pe.cc&&(R=pe,this.fragmentTracker.removeFragment(pe))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(R&&this.isLoopLoading(R,v)){if(!R.gap){const J=this.audioOnly&&!this.altAudio?V.AUDIO:V.VIDEO,pe=(J===V.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;pe&&this.afterBufferFlushed(pe,J,ne.MAIN)}R=this.getNextFragmentLoopLoading(R,u,o,ne.MAIN,f)}R&&(R.initSegment&&!R.initSegment.data&&!this.bitrateTest&&(R=R.initSegment),this.loadFragment(R,s,v))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);i===en.NOT_LOADED||i===en.PARTIAL?be(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,ne.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let n;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(r!=null&&r.live){const o=this.getMainFwdBufferInfo();if(!o||o.len<r.targetduration*2)return}if(!t.paused&&e){const o=this.hls.nextLoadLevel,c=e[o],u=this.fragLastKbps;u&&this.fragCurrent?n=this.fragCurrent.duration*c.maxBitrate/(1e3*u)+1:n=0}else n=0;const s=this.getBufferedFrag(t.currentTime+n);if(s){const o=this.followingBufferedFrag(s);if(o){this.abortCurrentFrag();const c=o.maxStartPTS?o.maxStartPTS:o.start,u=o.duration,h=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(h,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 yt.KEY_LOADING:case yt.FRAG_LOADING:case yt.FRAG_LOADING_WAITING_RETRY:case yt.PARSING:case yt.PARSED:this.state=yt.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;ki(n,"playing",this.onMediaPlaying),ki(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(Ni(n,"playing",this.onMediaPlaying),Ni(n,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(p.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let n=!1,i=!1;for(let r=0;r<t.levels.length;r++){const s=t.levels[r].audioCodec;s&&(n=n||s.indexOf("mp4a.40.2")!==-1,i=i||s.indexOf("mp4a.40.5")!==-1)}this.audioCodecSwitch=n&&i&&!Fd(),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!==yt.IDLE)return;const i=t.levelInfo;(!i.details||i.details.live&&(this.levelLastLoaded!==i||i.details.expired)||this.waitForCdnTuneIn(i.details))&&(this.state=yt.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:i,startFragRequested:r}=this,s=t.level,o=t.details,c=o.totalduration;if(!i){this.warn(`Levels were reset while loading level ${s}`);return}this.log(`Level ${s} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""}, cc [${o.startCC}, ${o.endCC}] duration:${c}`);const u=t.levelInfo,h=this.fragCurrent;h&&(this.state===yt.FRAG_LOADING||this.state===yt.FRAG_LOADING_WAITING_RETRY)&&h.level!==t.level&&h.loader&&this.abortCurrentFrag();let f=0;if(o.live||(n=u.details)!=null&&n.live){var v;if(this.checkLiveUpdate(o),o.deltaUpdateFailed)return;f=this.alignPlaylists(o,u.details,(v=this.levelLastLoaded)==null?void 0:v.details)}if(u.details=o,this.levelLastLoaded=u,r||this.setStartPosition(o,f),this.hls.trigger(p.LEVEL_UPDATED,{details:o,level:s}),this.state===yt.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=yt.IDLE}r&&o.live&&this.synchronizeToLiveEdge(o),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const i=this.hls.liveSyncPosition,r=this.getLoadPosition(),s=e.fragmentStart,o=e.edge,c=r>=s-t.maxFragLookUpTolerance&&r<=o;if(i!==null&&n.duration>i&&(r<i||!c)){const h=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!c&&n.readyState<4||r<o-h)&&(this._hasEnoughToStart||(this.nextLoadPosition=i),n.readyState))if(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${i.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var u;const f=bn.bufferInfo(n,i,0);if(!((u=f.buffered)!=null&&u.length)){n.currentTime=i;return}if(f.start<=r){n.currentTime=i;return}const{nextStart:R}=bn.bufferedInfo(f.buffered,r,0);R&&(n.currentTime=R)}else n.currentTime=i}}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:i,payload:r}=e,{levels:s}=this;if(!s){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const o=s[n.level];if(!o){this.warn(`Level ${n.level} not found on progress`);return}const c=o.details;if(!c){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const u=o.videoCodec,h=c.PTSKnown||!c.live,f=(t=n.initSegment)==null?void 0:t.data,v=this._getAudioCodec(o),R=this.transmuxer=this.transmuxer||new yo(this.hls,ne.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),I=i?i.index:-1,q=I!==-1,J=new $i(n.level,n.sn,n.stats.chunkCount,r.byteLength,I,q),pe=this.initPTS[n.cc];R.push(r,f,v,u,n,i,c.totalduration,h,J,pe)}onAudioTrackSwitching(e,t){const n=this.hls,i=this.altAudio!==0;if(Ln(t.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const s=this.fragCurrent;s&&(this.log("Switching to main audio track, cancel main fragment load"),s.abortRequests(),this.fragmentTracker.removeFragment(s)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(i){this.altAudio=0,this.fragmentTracker.removeAllFragments(),n.once(p.BUFFER_FLUSHED,()=>{this.hls&&this.hls.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=Ln(t.url,this.hls);if(n){const i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){const n=t.tracks;let i,r,s=!1;for(const o in n){const c=n[o];if(c.id==="main"){if(r=o,i=c,o==="video"){const u=n[o];u&&(this.videoBuffer=u.buffer)}}else s=!0}s&&i?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:i}=t,r=n.type===ne.MAIN;if(r){if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===yt.PARSED&&(this.state=yt.IDLE);return}const o=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),be(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}const s=this.media;s&&(!this._hasEnoughToStart&&bn.getBuffered(s).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),r&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var n;if(t.fatal){this.state=yt.ERROR;return}switch(t.details){case G.FRAG_GAP:case G.FRAG_PARSING_ERROR:case G.FRAG_DECRYPT_ERROR:case G.FRAG_LOAD_ERROR:case G.FRAG_LOAD_TIMEOUT:case G.KEY_LOAD_ERROR:case G.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ne.MAIN,t);break;case G.LEVEL_LOAD_ERROR:case G.LEVEL_LOAD_TIMEOUT:case G.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===yt.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===se.LEVEL&&(this.state=yt.IDLE);break;case G.BUFFER_ADD_CODEC_ERROR:case G.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case G.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case G.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=yt.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==V.AUDIO||!this.altAudio){const n=(t===V.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;n&&(this.afterBufferFlushed(n,t,ne.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}const i=this.timelineOffset;i&&n&&(n+=i);const r=this.getLevelDetails(),s=bn.getBuffered(e),o=s.length?s.start(0):0,c=o-n,u=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||c>0&&(c<u||this.loadingParts&&c<2*((r==null?void 0:r.partTarget)||0)))&&(this.log(`adjusting start position by ${c} to match buffer start`),n+=c,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${o}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(n=>{const{hls:i}=this,r=n==null?void 0:n.frag;if(!r||this.fragContextChanged(r))return;t.fragmentError=0,this.state=yt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const s=r.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),i.trigger(p.FRAG_LOADED,n),r.bitrateTest=!1}).catch(n=>{this.state===yt.STOPPED||this.state===yt.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){const t=this.playlistType,{hls:n}=this,{remuxResult:i,chunkMeta:r}=e,s=this.getCurrentContext(r);if(!s){this.resetWhenMissingContext(r);return}const{frag:o,part:c,level:u}=s,{video:h,text:f,id3:v,initSegment:R}=i,{details:I}=u,q=this.altAudio?void 0:i.audio;if(this.fragContextChanged(o)){this.fragmentTracker.removeFragment(o);return}if(this.state=yt.PARSING,R){const J=R.tracks;if(J){const Me=o.initSegment||o;if(this.unhandledEncryptionError(R,o))return;this._bufferInitSegment(u,J,Me,r),n.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:Me,id:t,tracks:J})}const pe=R.initPTS,_e=R.timescale,ye=this.initPTS[o.cc];if(x(pe)&&(!ye||ye.baseTime!==pe||ye.timescale!==_e)){const Me=R.trackId;this.initPTS[o.cc]={baseTime:pe,timescale:_e,trackId:Me},n.trigger(p.INIT_PTS_FOUND,{frag:o,id:t,initPTS:pe,timescale:_e,trackId:Me})}}if(h&&I){q&&h.type==="audiovideo"&&this.logMuxedErr(o);const J=I.fragments[o.sn-1-I.startSN],pe=o.sn===I.startSN,_e=!J||o.cc>J.cc;if(i.independent!==!1){const{startPTS:ye,endPTS:Me,startDTS:Ge,endDTS:dt}=h;if(c)c.elementaryStreams[h.type]={startPTS:ye,endPTS:Me,startDTS:Ge,endDTS:dt};else if(h.firstKeyFrame&&h.independent&&r.id===1&&!_e&&(this.couldBacktrack=!0),h.dropped&&h.independent){const We=this.getMainFwdBufferInfo(),ot=(We?We.end:this.getLoadPosition())+this.config.maxBufferHole,at=h.firstKeyFramePTS?h.firstKeyFramePTS:ye;if(!pe&&ot<at-this.config.maxBufferHole&&!_e){this.backtrack(o);return}else _e&&(o.gap=!0);o.setElementaryStreamInfo(h.type,o.start,Me,o.start,dt,!0)}else pe&&ye-(I.appliedTimelineOffset||0)>Vs&&(o.gap=!0);o.setElementaryStreamInfo(h.type,ye,Me,Ge,dt),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(h,o,c,r,pe||_e)}else if(pe||_e)o.gap=!0;else{this.backtrack(o);return}}if(q){const{startPTS:J,endPTS:pe,startDTS:_e,endDTS:ye}=q;c&&(c.elementaryStreams[V.AUDIO]={startPTS:J,endPTS:pe,startDTS:_e,endDTS:ye}),o.setElementaryStreamInfo(V.AUDIO,J,pe,_e,ye),this.bufferFragmentData(q,o,c,r)}if(I&&v!=null&&v.samples.length){const J={id:t,frag:o,details:I,samples:v.samples};n.trigger(p.FRAG_PARSING_METADATA,J)}if(I&&f){const J={id:t,frag:o,details:I,samples:f.samples};n.trigger(p.FRAG_PARSING_USERDATA,J)}}logMuxedErr(e){this.warn(`${be(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,i){if(this.state!==yt.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));const{audio:r,video:s,audiovideo:o}=t;if(r){const u=e.audioCodec;let h=Ht(r.codec,u);h==="mp4a"&&(h="mp4a.40.5");const f=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){h&&(h.indexOf("mp4a.40.5")!==-1?h="mp4a.40.2":h="mp4a.40.5");const v=r.metadata;v&&"channelCount"in v&&(v.channelCount||1)!==1&&f.indexOf("firefox")===-1&&(h="mp4a.40.5")}h&&h.indexOf("mp4a.40.5")!==-1&&f.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(h="mp4a.40.2",this.log(`Android: force audio codec to ${h}`)),u&&u!==h&&this.log(`Swapping manifest audio codec "${u}" for "${h}"`),r.levelCodec=h,r.id=ne.MAIN,this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${h||""}/${u||""}/${r.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=ne.MAIN;const u=s.codec;if((u==null?void 0:u.length)===4)switch(u){case"hvc1":case"hev1":s.codec="hvc1.1.6.L120.90";break;case"av01":s.codec="av01.0.04M.08";break;case"avc1":s.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${u}]${s.codec!==u?" parsed-corrected="+s.codec:""}${s.supplemental?" supplemental="+s.supplemental:""}`),delete t.audiovideo}o&&(this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),delete t.video,delete t.audio);const c=Object.keys(t);if(c.length){if(this.hls.trigger(p.BUFFER_CODECS,t),!this.hls)return;c.forEach(u=>{const f=t[u].initSegment;f!=null&&f.byteLength&&this.hls.trigger(p.BUFFER_APPENDING,{type:u,data:f,frag:n,part:null,chunkMeta:i,parent:n.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,ne.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=yt.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(bn.isBuffered(e,n)?t=this.getAppendedFrag(n):bn.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,r=t.level;(!i||t.sn!==i.sn||i.level!==r)&&(this.fragPlaying=t,this.hls.trigger(p.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(p.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return x(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(x(t)){const n=this.getLevelDetails(),i=this.currentFrag||(n?Rn(null,n.fragments,t):null);if(i){const r=i.programDateTime;if(r!==null){const s=r+(t-i.start)*1e3;return new Date(s)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Kd extends k{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyIdToKeyInfo){const i=this.keyIdToKeyInfo[n].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=G.KEY_LOAD_ERROR,n,i,r){return new vi({type:ue.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:n,networkDetails:i})}loadClear(e,t,n){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let i=0,r=t.length;i<r;i++){const s=t[i];if(e.cc<=s.cc&&(!be(e)||!be(s)||e.sn<s.sn)||!n&&i==r-1)return this.emeController.selectKeySystemFormat(s).then(o=>{if(!this.emeController)return;s.setKeyFormat(o);const c=Yi(o);if(c)return this.emeController.getKeySystemAccess([c])})}if(this.config.requireKeySystemAccessOnStart){const i=cr(this.config);if(i.length)return this.emeController.getKeySystemAccess(i)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const u=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,G.KEY_LOAD_ERROR,u))}const s=r.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,G.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));const o=Ka(r);let c=this.keyIdToKeyInfo[o];if((n=c)!=null&&n.decryptdata.key)return r.key=c.decryptdata.key,Promise.resolve({frag:e,keyInfo:c});if(this.emeController&&(i=c)!=null&&i.keyLoadPromise)switch(this.emeController.getKeyStatus(c.decryptdata)){case"usable":case"usable-in-future":return c.keyLoadPromise.then(h=>{const{keyInfo:f}=h;return r.key=f.decryptdata.key,{frag:e,keyInfo:f}})}switch(this.log(`${this.keyIdToKeyInfo[o]?"Rel":"L"}oading${r.keyId?" keyId: "+ie(r.keyId):""} URI: ${r.uri} from ${e.type} ${e.level}`),c=this.keyIdToKeyInfo[o]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(c,e):this.loadKeyEME(c,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(c,e);default:return Promise.reject(this.createKeyLoadError(e,G.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var i;if(!e.decryptdata.keyId&&(i=t.initSegment)!=null&&i.data){const s=le(t.initSegment.data);if(s.length){let o=s[0];o.some(c=>c!==0)?(this.log(`Using keyId found in init segment ${ie(o)}`),Ki.setKeyIdForUri(e.decryptdata.uri,o)):(o=Ki.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${ie(o)}`)),e.decryptdata.keyId=o}}if(!e.decryptdata.keyId&&!be(t))return Promise.resolve(n);const r=this.emeController.loadKey(n);return(e.keyLoadPromise=r.then(s=>(e.mediaKeySessionContext=s,n))).catch(s=>{throw e.keyLoadPromise=null,"data"in s&&(s.data.frag=t),s})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,i=n.loader,r=new i(n);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise((s,o)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},u=n.keyLoadPolicy.default,h={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(v,R,I,q)=>{const{frag:J,keyInfo:pe}=I,_e=Ka(pe.decryptdata);if(!J.decryptdata||pe!==this.keyIdToKeyInfo[_e])return o(this.createKeyLoadError(J,G.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),q));pe.decryptdata.key=J.decryptdata.key=new Uint8Array(v.data),J.keyLoader=null,pe.loader=null,s({frag:J,keyInfo:pe})},onError:(v,R,I,q)=>{this.resetLoader(R),o(this.createKeyLoadError(t,G.KEY_LOAD_ERROR,new Error(`HTTP Error ${v.code} loading key ${v.text}`),I,E({url:c.url,data:void 0},v)))},onTimeout:(v,R,I)=>{this.resetLoader(R),o(this.createKeyLoadError(t,G.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),I))},onAbort:(v,R,I)=>{this.resetLoader(R),o(this.createKeyLoadError(t,G.INTERNAL_ABORTED,new Error("key loading aborted"),I))}};r.load(c,h,f)})}resetLoader(e){const{frag:t,keyInfo:n,url:i}=e,r=n.loader;t.keyLoader===r&&(t.keyLoader=null,n.loader=null);const s=Ka(n.decryptdata)||i;delete this.keyIdToKeyInfo[s],r&&r.destroy()}}function Ka(a){if(a.keyFormat!==On.FAIRPLAY){const e=a.keyId;if(e)return ie(e)}return a.uri}function gl(a){const{type:e}=a;switch(e){case se.AUDIO_TRACK:return ne.AUDIO;case se.SUBTITLE_TRACK:return ne.SUBTITLE;default:return ne.MAIN}}function Ga(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Gd{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,i=t.loader,r=n||i,s=new r(t);return this.loaders[e.type]=s,s}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:se.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:r,url:s,deliveryDirectives:o,levelInfo:c}=t;this.load({id:n,level:i,pathwayId:r,responseType:"text",type:se.LEVEL,url:s,deliveryDirectives:o,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s,track:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:se.AUDIO_TRACK,url:r,deliveryDirectives:s,levelOrTrack:o})}onSubtitleTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s,track:o}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:se.SUBTITLE_TRACK,url:r,deliveryDirectives:s,levelOrTrack:o})}onLevelsUpdated(e,t){const n=this.loaders[se.LEVEL];if(n){const i=n.context;i&&!t.levels.some(r=>r===i.levelOrTrack)&&(n.abort(),delete this.loaders[se.LEVEL])}}load(e){var t;const n=this.hls.config;let i=this.getInternalLoader(e);if(i){const u=this.hls.logger,h=i.context;if(h&&h.levelOrTrack===e.levelOrTrack&&(h.url===e.url||h.deliveryDirectives&&!e.deliveryDirectives)){h.url===e.url?u.log(`[playlist-loader]: ignore ${e.url} ongoing request`):u.log(`[playlist-loader]: ignore ${e.url} in favor of ${h.url}`);return}u.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===se.MANIFEST?r=n.manifestLoadPolicy.default:r=m({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),x((t=e.deliveryDirectives)==null?void 0:t.part)){let u;if(e.type===se.LEVEL&&e.level!==null?u=this.hls.levels[e.level].details:e.type===se.AUDIO_TRACK&&e.id!==null?u=this.hls.audioTracks[e.id].details:e.type===se.SUBTITLE_TRACK&&e.id!==null&&(u=this.hls.subtitleTracks[e.id].details),u){const h=u.partTarget,f=u.targetduration;if(h&&f){const v=Math.max(h*3,f*.8)*1e3;r=m({},r,{maxTimeToFirstByteMs:Math.min(v,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(v,r.maxTimeToFirstByteMs)})}}}const s=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},c={onSuccess:(u,h,f,v)=>{const R=this.getInternalLoader(f);this.resetInternalLoader(f.type);const I=u.data;h.parsing.start=performance.now(),Gi.isMediaPlaylist(I)||f.type!==se.MANIFEST?this.handleTrackOrLevelPlaylist(u,h,f,v||null,R):this.handleMasterPlaylist(u,h,f,v)},onError:(u,h,f,v)=>{this.handleNetworkError(h,f,!1,u,v)},onTimeout:(u,h,f)=>{this.handleNetworkError(h,f,!0,void 0,u)}};i.load(e,o,c)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,i){const r=this.hls,s=e.data,o=Ga(e,n),c=Gi.parseMasterPlaylist(s,o);if(c.playlistParsingError){t.parsing.end=performance.now(),this.handleManifestParsingError(e,n,c.playlistParsingError,i,t);return}const{contentSteering:u,levels:h,sessionData:f,sessionKeys:v,startTimeOffset:R,variableList:I}=c;this.variableList=I,h.forEach(_e=>{const{unknownCodecs:ye}=_e;if(ye){const{preferManagedMediaSource:Me}=this.hls.config;let{audioCodec:Ge,videoCodec:dt}=_e;for(let We=ye.length;We--;){const ot=ye[We];Tt(ot,"audio",Me)?(_e.audioCodec=Ge=Ge?`${Ge},${ot}`:ot,bt.audio[Ge.substring(0,4)]=2,ye.splice(We,1)):Tt(ot,"video",Me)&&(_e.videoCodec=dt=dt?`${dt},${ot}`:ot,bt.video[dt.substring(0,4)]=2,ye.splice(We,1))}}});const{AUDIO:q=[],SUBTITLES:J,"CLOSED-CAPTIONS":pe}=Gi.parseMasterPlaylistMedia(s,o,c);q.length&&!q.some(ye=>!ye.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),q.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Vn({}),bitrate:0,url:""})),r.trigger(p.MANIFEST_LOADED,{levels:h,audioTracks:q,subtitles:J,captions:pe,contentSteering:u,url:o,stats:t,networkDetails:i,sessionData:f,sessionKeys:v,startTimeOffset:R,variableList:I})}handleTrackOrLevelPlaylist(e,t,n,i,r){const s=this.hls,{id:o,level:c,type:u}=n,h=Ga(e,n),f=x(c)?c:x(o)?o:0,v=gl(n),R=Gi.parseLevelPlaylist(e.data,h,f,v,0,this.variableList);if(u===se.MANIFEST){const I={attrs:new Vn({}),bitrate:0,details:R,name:"",url:h};R.requestScheduled=t.loading.start+ri(R,0),s.trigger(p.MANIFEST_LOADED,{levels:[I],audioTracks:[],url:h,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=R,this.handlePlaylistLoaded(R,e,t,n,i,r)}handleManifestParsingError(e,t,n,i,r){this.hls.trigger(p.ERROR,{type:ue.NETWORK_ERROR,details:G.MANIFEST_PARSING_ERROR,fatal:t.type===se.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:i,stats:r})}handleNetworkError(e,t,n=!1,i,r){let s=`A network ${n?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===se.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===se.AUDIO_TRACK||e.type===se.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let c=G.UNKNOWN,u=!1;const h=this.getInternalLoader(e);switch(e.type){case se.MANIFEST:c=n?G.MANIFEST_LOAD_TIMEOUT:G.MANIFEST_LOAD_ERROR,u=!0;break;case se.LEVEL:c=n?G.LEVEL_LOAD_TIMEOUT:G.LEVEL_LOAD_ERROR,u=!1;break;case se.AUDIO_TRACK:c=n?G.AUDIO_TRACK_LOAD_TIMEOUT:G.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case se.SUBTITLE_TRACK:c=n?G.SUBTITLE_TRACK_LOAD_TIMEOUT:G.SUBTITLE_LOAD_ERROR,u=!1;break}h&&this.resetInternalLoader(e.type);const f={type:ue.NETWORK_ERROR,details:c,fatal:u,url:e.url,loader:h,context:e,error:o,networkDetails:t,stats:r};if(i){const v=(t==null?void 0:t.url)||e.url;f.response=E({url:v,data:void 0},i)}this.hls.trigger(p.ERROR,f)}handlePlaylistLoaded(e,t,n,i,r,s){const o=this.hls,{type:c,level:u,levelOrTrack:h,id:f,groupId:v,deliveryDirectives:R}=i,I=Ga(t,i),q=gl(i);let J=typeof i.level=="number"&&q===ne.MAIN?u:void 0;const pe=e.playlistParsingError;if(pe){if(this.hls.logger.warn(`${pe} ${e.url}`),!o.config.ignorePlaylistParsingErrors){o.trigger(p.ERROR,{type:ue.NETWORK_ERROR,details:G.LEVEL_PARSING_ERROR,fatal:!1,url:I,error:pe,reason:pe.message,response:t,context:i,level:J,parent:q,networkDetails:r,stats:n});return}e.playlistParsingError=null}if(!e.fragments.length){const _e=e.playlistParsingError=new Error("No Segments found in Playlist");o.trigger(p.ERROR,{type:ue.NETWORK_ERROR,details:G.LEVEL_EMPTY_ERROR,fatal:!1,url:I,error:_e,reason:_e.message,response:t,context:i,level:J,parent:q,networkDetails:r,stats:n});return}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case se.MANIFEST:case se.LEVEL:if(J){if(!h)J=0;else if(h!==o.levels[J]){const _e=o.levels.indexOf(h);_e>-1&&(J=_e)}}o.trigger(p.LEVEL_LOADED,{details:e,levelInfo:h||o.levels[0],level:J||0,id:f||0,stats:n,networkDetails:r,deliveryDirectives:R,withoutMultiVariant:c===se.MANIFEST});break;case se.AUDIO_TRACK:o.trigger(p.AUDIO_TRACK_LOADED,{details:e,track:h,id:f||0,groupId:v||"",stats:n,networkDetails:r,deliveryDirectives:R});break;case se.SUBTITLE_TRACK:o.trigger(p.SUBTITLE_TRACK_LOADED,{details:e,track:h,id:f||0,groupId:v||"",stats:n,networkDetails:r,deliveryDirectives:R});break}}}class Rr{static get version(){return is}static isMSESupported(){return ml()}static isSupported(){return Bd()}static getMediaSource(){return Se()}static get Events(){return p}static get MetadataSchema(){return Vi}static get ErrorTypes(){return ue}static get ErrorDetails(){return G}static get DefaultConfig(){return Rr.defaultConfig?Rr.defaultConfig:wd}static set DefaultConfig(e){Rr.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 ra,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=ce(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=Rd(Rr.DefaultConfig,e,t);this.userConfig=e,n.progressive&&Id(n,t);const{abrController:i,bufferController:r,capLevelController:s,errorController:o,fpsController:c}=n,u=new o(this),h=this.abrController=new i(this),f=new Bn(this),v=n.interstitialsController,R=v?this.interstitialsController=new v(this,Rr):null,I=this.bufferController=new r(this,f),q=this.capLevelController=new s(this),J=new c(this),pe=new Gd(this),_e=n.contentSteeringController,ye=_e?new _e(this):null,Me=this.levelController=new Nd(this,ye),Ge=new kd(this),dt=new Kd(this.config,this.logger),We=this.streamController=new Ud(this,f,dt),ot=this.gapController=new Od(this,f);q.setStreamController(We),J.setStreamController(We);const at=[pe,Me,We];R&&at.splice(1,0,R),ye&&at.splice(1,0,ye),this.networkControllers=at;const Je=[h,I,ot,q,J,Ge,f];this.audioTrackController=this.createController(n.audioTrackController,at);const wt=n.audioStreamController;wt&&at.push(this.audioStreamController=new wt(this,f,dt)),this.subtitleTrackController=this.createController(n.subtitleTrackController,at);const Xt=n.subtitleStreamController;Xt&&at.push(this.subtititleStreamController=new Xt(this,f,dt)),this.createController(n.timelineController,Je),dt.emeController=this.emeController=this.createController(n.emeController,Je),this.cmcdController=this.createController(n.cmcdController,Je),this.latencyController=this.createController(Md,Je),this.coreComponents=Je,at.push(u);const on=u.onErrorOut;typeof on=="function"&&this.on(p.ERROR,on,u),this.on(p.MANIFEST_LOADED,pe.onManifestLoaded,pe)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,i){this._emitter.off(e,t,n,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const i=e===p.ERROR;this.trigger(p.ERROR,{type:ue.OTHER_ERROR,details:G.INTERNAL_EXCEPTION,fatal:i,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(p.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const r=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(p.ERROR,{type:ue.OTHER_ERROR,details:G.ATTACH_MEDIA_ERROR,fatal:!0,error:r});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,n=t?e.media:e,i=t?e:{media:n};this._media=n,this.trigger(p.MEDIA_ATTACHING,i)}detachMedia(){this.logger.log("detachMedia"),this.trigger(p.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(p.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,i=this._url=b.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${i}`),t&&n&&(n!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(p.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),!(!this.started||!this.networkControllers));n++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[ne.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[ne.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[ne.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=Oc()),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){gt(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let i=0;i<n;i++)if(e[i].maxBitrate>=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,n)for(let r=i;r--;){const s=e[r].attrs["HDCP-LEVEL"];if(s&&s<=n)return r}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const n=st(t);return Ze(e,n,navigator.mediaCapabilities)}}Rr.defaultConfig=void 0}}]);
|
|
}()); |