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.
147 lines
1.1 MiB
147 lines
1.1 MiB
!(function(){var Za=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[6444],{70557:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return le}});var B=b(92413),q=b(59301),ve={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"},fe=ve,oe=b(7657),Z=function(K,D){return q.createElement(oe.Z,(0,B.Z)({},K,{ref:D,icon:fe}))},_e=q.forwardRef(Z),le=_e},18785:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return le}});var B=b(92413),q=b(59301),ve={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"},fe=ve,oe=b(7657),Z=function(K,D){return q.createElement(oe.Z,(0,B.Z)({},K,{ref:D,icon:fe}))},_e=q.forwardRef(Z),le=_e},52671:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return le}});var B=b(92413),q=b(59301),ve={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"},fe=ve,oe=b(7657),Z=function(K,D){return q.createElement(oe.Z,(0,B.Z)({},K,{ref:D,icon:fe}))},_e=q.forwardRef(Z),le=_e},8657:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return le}});var B=b(92413),q=b(59301),ve={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"},fe=ve,oe=b(7657),Z=function(K,D){return q.createElement(oe.Z,(0,B.Z)({},K,{ref:D,icon:fe}))},_e=q.forwardRef(Z),le=_e},56082:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return le}});var B=b(92413),q=b(59301),ve={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"},fe=ve,oe=b(7657),Z=function(K,D){return q.createElement(oe.Z,(0,B.Z)({},K,{ref:D,icon:fe}))},_e=q.forwardRef(Z),le=_e},33853:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return le}});var B=b(92413),q=b(59301),ve={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"},fe=ve,oe=b(7657),Z=function(K,D){return q.createElement(oe.Z,(0,B.Z)({},K,{ref:D,icon:fe}))},_e=q.forwardRef(Z),le=_e},15075:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return le}});var B=b(92413),q=b(59301),ve={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"},fe=ve,oe=b(7657),Z=function(K,D){return q.createElement(oe.Z,(0,B.Z)({},K,{ref:D,icon:fe}))},_e=q.forwardRef(Z),le=_e},43531:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return le}});var B=b(92413),q=b(59301),ve={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"},fe=ve,oe=b(7657),Z=function(K,D){return q.createElement(oe.Z,(0,B.Z)({},K,{ref:D,icon:fe}))},_e=q.forwardRef(Z),le=_e},38819:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return le}});var B=b(92413),q=b(59301),ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},fe=ve,oe=b(7657),Z=function(K,D){return q.createElement(oe.Z,(0,B.Z)({},K,{ref:D,icon:fe}))},_e=q.forwardRef(Z),le=_e},35593:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return Pe}});var B=b(33708),q=b(33606),ve=b(37061),fe=b(43403),oe=b(92310),Z=b.n(oe),_e=b(29301),le=b(76846),o=b(96452),K=b(6089),D=b(80402),f=b(34280),u=b(49658),g=b(59301),m=b(92413),I=b(77900),H=b(8654);function L(J){var ue=J.prefixCls,W=J.align,M=J.arrow,pe=J.arrowPos,k=M||{},N=k.className,P=k.content,ne=pe.x,F=ne===void 0?0:ne,se=pe.y,de=se===void 0?0:se,ge=g.useRef();if(!W||!W.points)return null;var be={position:"absolute"};if(W.autoArrow!==!1){var Le=W.points[0],Ne=W.points[1],ze=Le[0],Ie=Le[1],Ke=Ne[0],je=Ne[1];ze===Ke||!["t","b"].includes(ze)?be.top=de:ze==="t"?be.top=0:be.bottom=0,Ie===je||!["l","r"].includes(Ie)?be.left=F:Ie==="l"?be.left=0:be.right=0}return g.createElement("div",{ref:ge,className:Z()("".concat(ue,"-arrow"),N),style:be},P)}function w(J){var ue=J.prefixCls,W=J.open,M=J.zIndex,pe=J.mask,k=J.motion;return pe?g.createElement(I.default,(0,m.Z)({},k,{motionAppear:!0,visible:W,removeOnLeave:!0}),function(N){var P=N.className;return g.createElement("div",{style:{zIndex:M},className:Z()("".concat(ue,"-mask"),P)})}):null}var O=g.memo(function(J){var ue=J.children;return ue},function(J,ue){return ue.cache}),A=O,E=g.forwardRef(function(J,ue){var W=J.popup,M=J.className,pe=J.prefixCls,k=J.style,N=J.target,P=J.onVisibleChanged,ne=J.open,F=J.keepDom,se=J.fresh,de=J.onClick,ge=J.mask,be=J.arrow,Le=J.arrowPos,Ne=J.align,ze=J.motion,Ie=J.maskMotion,Ke=J.forceRender,je=J.getPopupContainer,Ce=J.autoDestroy,vt=J.portal,st=J.zIndex,St=J.onMouseEnter,Ze=J.onMouseLeave,Ht=J.onPointerEnter,Kt=J.ready,zt=J.offsetX,Ot=J.offsetY,ht=J.offsetR,yt=J.offsetB,ut=J.onAlign,Ct=J.onPrepare,ft=J.stretch,Mt=J.targetWidth,Qt=J.targetHeight,Jt=typeof W=="function"?W():W,ln=ne||F,an=(je==null?void 0:je.length)>0,jt=g.useState(!je||!an),Wt=(0,q.Z)(jt,2),pt=Wt[0],Xe=Wt[1];if((0,f.Z)(function(){!pt&&an&&N&&Xe(!0)},[pt,an,N]),!pt)return null;var c="auto",p={left:"-1000vw",top:"-1000vh",right:c,bottom:c};if(Kt||!ne){var x,G=Ne.points,re=Ne.dynamicInset||((x=Ne._experimental)===null||x===void 0?void 0:x.dynamicInset),ye=re&&G[0][1]==="r",Ae=re&&G[0][0]==="b";ye?(p.right=ht,p.left=c):(p.left=zt,p.right=c),Ae?(p.bottom=yt,p.top=c):(p.top=Ot,p.bottom=c)}var tt={};return ft&&(ft.includes("height")&&Qt?tt.height=Qt:ft.includes("minHeight")&&Qt&&(tt.minHeight=Qt),ft.includes("width")&&Mt?tt.width=Mt:ft.includes("minWidth")&&Mt&&(tt.minWidth=Mt)),ne||(tt.pointerEvents="none"),g.createElement(vt,{open:Ke||ln,getContainer:je&&function(){return je(N)},autoDestroy:Ce},g.createElement(w,{prefixCls:pe,open:ne,zIndex:st,mask:ge,motion:Ie}),g.createElement(_e.Z,{onResize:ut,disabled:!ne},function(Qe){return g.createElement(I.default,(0,m.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Ke,leavedClassName:"".concat(pe,"-hidden")},ze,{onAppearPrepare:Ct,onEnterPrepare:Ct,visible:ne,onVisibleChanged:function(Ft){var Vt;ze==null||(Vt=ze.onVisibleChanged)===null||Vt===void 0||Vt.call(ze,Ft),P(Ft)}}),function(at,Ft){var Vt=at.className,ot=at.style,qt=Z()(pe,Vt,M);return g.createElement("div",{ref:(0,H.sQ)(Qe,ue,Ft),className:qt,style:(0,B.Z)((0,B.Z)((0,B.Z)((0,B.Z)({"--arrow-x":"".concat(Le.x||0,"px"),"--arrow-y":"".concat(Le.y||0,"px")},p),tt),ot),{},{boxSizing:"border-box",zIndex:st},k),onMouseEnter:St,onMouseLeave:Ze,onPointerEnter:Ht,onClick:de},be&&g.createElement(L,{prefixCls:pe,arrow:be,arrowPos:Le,align:Ne}),g.createElement(A,{cache:!ne&&!se},Jt))})}))}),Q=E,te=g.forwardRef(function(J,ue){var W=J.children,M=J.getTriggerDOMNode,pe=(0,H.Yr)(W),k=g.useCallback(function(P){(0,H.mH)(ue,M?M(P):P)},[M]),N=(0,H.x1)(k,W.ref);return pe?g.cloneElement(W,{ref:N}):W}),ie=te,Ee=g.createContext(null),we=Ee;function xe(J){return J?Array.isArray(J)?J:[J]:[]}function he(J,ue,W,M){return g.useMemo(function(){var pe=xe(W!=null?W:ue),k=xe(M!=null?M:ue),N=new Set(pe),P=new Set(k);return J&&(N.has("hover")&&(N.delete("hover"),N.add("click")),P.has("hover")&&(P.delete("hover"),P.add("click"))),[N,P]},[J,ue,W,M])}var V=b(29194);function T(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],W=arguments.length>2?arguments[2]:void 0;return W?J[0]===ue[0]:J[0]===ue[0]&&J[1]===ue[1]}function C(J,ue,W,M){for(var pe=W.points,k=Object.keys(J),N=0;N<k.length;N+=1){var P,ne=k[N];if(T((P=J[ne])===null||P===void 0?void 0:P.points,pe,M))return"".concat(ue,"-placement-").concat(ne)}return""}function R(J,ue,W,M){return ue||(W?{motionName:"".concat(J,"-").concat(W)}:M?{motionName:M}:null)}function z(J){return J.ownerDocument.defaultView}function Y(J){for(var ue=[],W=J==null?void 0:J.parentElement,M=["hidden","scroll","clip","auto"];W;){var pe=z(W).getComputedStyle(W),k=pe.overflowX,N=pe.overflowY,P=pe.overflow;[k,N,P].some(function(ne){return M.includes(ne)})&&ue.push(W),W=W.parentElement}return ue}function y(J){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(J)?ue:J}function v(J){return y(parseFloat(J),0)}function $(J,ue){var W=(0,B.Z)({},J);return(ue||[]).forEach(function(M){if(!(M instanceof HTMLBodyElement||M instanceof HTMLHtmlElement)){var pe=z(M).getComputedStyle(M),k=pe.overflow,N=pe.overflowClipMargin,P=pe.borderTopWidth,ne=pe.borderBottomWidth,F=pe.borderLeftWidth,se=pe.borderRightWidth,de=M.getBoundingClientRect(),ge=M.offsetHeight,be=M.clientHeight,Le=M.offsetWidth,Ne=M.clientWidth,ze=v(P),Ie=v(ne),Ke=v(F),je=v(se),Ce=y(Math.round(de.width/Le*1e3)/1e3),vt=y(Math.round(de.height/ge*1e3)/1e3),st=(Le-Ne-Ke-je)*Ce,St=(ge-be-ze-Ie)*vt,Ze=ze*vt,Ht=Ie*vt,Kt=Ke*Ce,zt=je*Ce,Ot=0,ht=0;if(k==="clip"){var yt=v(N);Ot=yt*Ce,ht=yt*vt}var ut=de.x+Kt-Ot,Ct=de.y+Ze-ht,ft=ut+de.width+2*Ot-Kt-zt-st,Mt=Ct+de.height+2*ht-Ze-Ht-St;W.left=Math.max(W.left,ut),W.top=Math.max(W.top,Ct),W.right=Math.min(W.right,ft),W.bottom=Math.min(W.bottom,Mt)}}),W}function j(J){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,W="".concat(ue),M=W.match(/^(.*)\%$/);return M?J*(parseFloat(M[1])/100):parseFloat(W)}function me(J,ue){var W=ue||[],M=(0,q.Z)(W,2),pe=M[0],k=M[1];return[j(J.width,pe),j(J.height,k)]}function Se(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[J[0],J[1]]}function Te(J,ue){var W=ue[0],M=ue[1],pe,k;return W==="t"?k=J.y:W==="b"?k=J.y+J.height:k=J.y+J.height/2,M==="l"?pe=J.x:M==="r"?pe=J.x+J.width:pe=J.x+J.width/2,{x:pe,y:k}}function De(J,ue){var W={t:"b",b:"t",l:"r",r:"l"};return J.map(function(M,pe){return pe===ue?W[M]||"c":M}).join("")}function qe(J,ue,W,M,pe,k,N){var P=g.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:pe[M]||{}}),ne=(0,q.Z)(P,2),F=ne[0],se=ne[1],de=g.useRef(0),ge=g.useMemo(function(){return ue?Y(ue):[]},[ue]),be=g.useRef({}),Le=function(){be.current={}};J||Le();var Ne=(0,K.Z)(function(){if(ue&&W&&J){let ai=function(Qn,mi){var Ei=arguments.length>2&&arguments[2]!==void 0?arguments[2]:qt,si=Jt.x+Qn,ci=Jt.y+mi,Vi=si+x,sr=ci+p,Bi=Math.max(si,Ei.left),dr=Math.max(ci,Ei.top),Wi=Math.min(Vi,Ei.right),Zi=Math.min(sr,Ei.bottom);return Math.max(0,(Wi-Bi)*(Zi-dr))},Ti=function(){$n=Jt.y+Xt,Pn=$n+p,Kn=Jt.x+cn,Yn=Kn+x};var Ke,je,Ce=ue,vt=Ce.ownerDocument,st=z(Ce),St=st.getComputedStyle(Ce),Ze=St.width,Ht=St.height,Kt=St.position,zt=Ce.style.left,Ot=Ce.style.top,ht=Ce.style.right,yt=Ce.style.bottom,ut=Ce.style.overflow,Ct=(0,B.Z)((0,B.Z)({},pe[M]),k),ft=vt.createElement("div");(Ke=Ce.parentElement)===null||Ke===void 0||Ke.appendChild(ft),ft.style.left="".concat(Ce.offsetLeft,"px"),ft.style.top="".concat(Ce.offsetTop,"px"),ft.style.position=Kt,ft.style.height="".concat(Ce.offsetHeight,"px"),ft.style.width="".concat(Ce.offsetWidth,"px"),Ce.style.left="0",Ce.style.top="0",Ce.style.right="auto",Ce.style.bottom="auto",Ce.style.overflow="hidden";var Mt;if(Array.isArray(W))Mt={x:W[0],y:W[1],width:0,height:0};else{var Qt=W.getBoundingClientRect();Mt={x:Qt.x,y:Qt.y,width:Qt.width,height:Qt.height}}var Jt=Ce.getBoundingClientRect(),ln=vt.documentElement,an=ln.clientWidth,jt=ln.clientHeight,Wt=ln.scrollWidth,pt=ln.scrollHeight,Xe=ln.scrollTop,c=ln.scrollLeft,p=Jt.height,x=Jt.width,G=Mt.height,re=Mt.width,ye={left:0,top:0,right:an,bottom:jt},Ae={left:-c,top:-Xe,right:Wt-c,bottom:pt-Xe},tt=Ct.htmlRegion,Qe="visible",at="visibleFirst";tt!=="scroll"&&tt!==at&&(tt=Qe);var Ft=tt===at,Vt=$(Ae,ge),ot=$(ye,ge),qt=tt===Qe?ot:Vt,At=Ft?ot:qt;Ce.style.left="auto",Ce.style.top="auto",Ce.style.right="0",Ce.style.bottom="0";var Fe=Ce.getBoundingClientRect();Ce.style.left=zt,Ce.style.top=Ot,Ce.style.right=ht,Ce.style.bottom=yt,Ce.style.overflow=ut,(je=Ce.parentElement)===null||je===void 0||je.removeChild(ft);var Be=y(Math.round(x/parseFloat(Ze)*1e3)/1e3),ct=y(Math.round(p/parseFloat(Ht)*1e3)/1e3);if(Be===0||ct===0||(0,le.Sh)(W)&&!(0,V.Z)(W))return;var It=Ct.offset,Pt=Ct.targetOffset,dn=me(Jt,It),fn=(0,q.Z)(dn,2),Lt=fn[0],Et=fn[1],Oe=me(Mt,Pt),Me=(0,q.Z)(Oe,2),He=Me[0],nt=Me[1];Mt.x-=He,Mt.y-=nt;var Ye=Ct.points||[],et=(0,q.Z)(Ye,2),Je=et[0],Dt=et[1],Zt=Se(Dt),Ut=Se(Je),rn=Te(Mt,Zt),on=Te(Jt,Ut),_n=(0,B.Z)({},Ct),cn=rn.x-on.x+Lt,Xt=rn.y-on.y+Et,An=ai(cn,Xt),gn=ai(cn,Xt,ot),On=Te(Mt,["t","l"]),wn=Te(Jt,["t","l"]),xn=Te(Mt,["b","r"]),vn=Te(Jt,["b","r"]),En=Ct.overflow||{},Cn=En.adjustX,Un=En.adjustY,Ln=En.shiftX,hn=En.shiftY,$t=function(mi){return typeof mi=="boolean"?mi:mi>=0},$n,Pn,Kn,Yn;Ti();var ti=$t(Un),Jn=Ut[0]===Zt[0];if(ti&&Ut[0]==="t"&&(Pn>At.bottom||be.current.bt)){var jn=Xt;Jn?jn-=p-G:jn=On.y-vn.y-Et;var Vn=ai(cn,jn),li=ai(cn,jn,ot);Vn>An||Vn===An&&(!Ft||li>=gn)?(be.current.bt=!0,Xt=jn,Et=-Et,_n.points=[De(Ut,0),De(Zt,0)]):be.current.bt=!1}if(ti&&Ut[0]==="b"&&($n<At.top||be.current.tb)){var Bt=Xt;Jn?Bt+=p-G:Bt=xn.y-wn.y-Et;var Gt=ai(cn,Bt),pn=ai(cn,Bt,ot);Gt>An||Gt===An&&(!Ft||pn>=gn)?(be.current.tb=!0,Xt=Bt,Et=-Et,_n.points=[De(Ut,0),De(Zt,0)]):be.current.tb=!1}var Tn=$t(Cn),kn=Ut[1]===Zt[1];if(Tn&&Ut[1]==="l"&&(Yn>At.right||be.current.rl)){var Xn=cn;kn?Xn-=x-re:Xn=On.x-vn.x-Lt;var Mn=ai(Xn,Xt),ui=ai(Xn,Xt,ot);Mn>An||Mn===An&&(!Ft||ui>=gn)?(be.current.rl=!0,cn=Xn,Lt=-Lt,_n.points=[De(Ut,1),De(Zt,1)]):be.current.rl=!1}if(Tn&&Ut[1]==="r"&&(Kn<At.left||be.current.lr)){var fi=cn;kn?fi+=x-re:fi=xn.x-wn.x-Lt;var vi=ai(fi,Xt),ri=ai(fi,Xt,ot);vi>An||vi===An&&(!Ft||ri>=gn)?(be.current.lr=!0,cn=fi,Lt=-Lt,_n.points=[De(Ut,1),De(Zt,1)]):be.current.lr=!1}Ti();var Wn=Ln===!0?0:Ln;typeof Wn=="number"&&(Kn<ot.left&&(cn-=Kn-ot.left-Lt,Mt.x+re<ot.left+Wn&&(cn+=Mt.x-ot.left+re-Wn)),Yn>ot.right&&(cn-=Yn-ot.right-Lt,Mt.x>ot.right-Wn&&(cn+=Mt.x-ot.right+Wn)));var ni=hn===!0?0:hn;typeof ni=="number"&&($n<ot.top&&(Xt-=$n-ot.top-Et,Mt.y+G<ot.top+ni&&(Xt+=Mt.y-ot.top+G-ni)),Pn>ot.bottom&&(Xt-=Pn-ot.bottom-Et,Mt.y>ot.bottom-ni&&(Xt+=Mt.y-ot.bottom+ni)));var yi=Jt.x+cn,Si=yi+x,hi=Jt.y+Xt,Ai=hi+p,pi=Mt.x,Ci=pi+re,ki=Mt.y,Pi=ki+G,zi=Math.max(yi,pi),ji=Math.min(Si,Ci),wi=(zi+ji)/2,qi=wi-yi,Ni=Math.max(hi,ki),Ii=Math.min(Ai,Pi),er=(Ni+Ii)/2,Mi=er-hi;N==null||N(ue,_n);var Di=Fe.right-Jt.x-(cn+Jt.width),Fi=Fe.bottom-Jt.y-(Xt+Jt.height);se({ready:!0,offsetX:cn/Be,offsetY:Xt/ct,offsetR:Di/Be,offsetB:Fi/ct,arrowX:qi/Be,arrowY:Mi/ct,scaleX:Be,scaleY:ct,align:_n})}}),ze=function(){de.current+=1;var je=de.current;Promise.resolve().then(function(){de.current===je&&Ne()})},Ie=function(){se(function(je){return(0,B.Z)((0,B.Z)({},je),{},{ready:!1})})};return(0,f.Z)(Ie,[M]),(0,f.Z)(function(){J||Ie()},[J]),[F.ready,F.offsetX,F.offsetY,F.offsetR,F.offsetB,F.arrowX,F.arrowY,F.scaleX,F.scaleY,F.align,ze]}var lt=b(26407);function We(J,ue,W,M,pe){(0,f.Z)(function(){if(J&&ue&&W){let de=function(){M(),pe()};var k=ue,N=W,P=Y(k),ne=Y(N),F=z(N),se=new Set([F].concat((0,lt.Z)(P),(0,lt.Z)(ne)));return se.forEach(function(ge){ge.addEventListener("scroll",de,{passive:!0})}),F.addEventListener("resize",de,{passive:!0}),M(),function(){se.forEach(function(ge){ge.removeEventListener("scroll",de),F.removeEventListener("resize",de)})}}},[J,ue,W])}var Tt=b(48736),dt=b(16089);function wt(J,ue,W,M,pe,k,N,P){var ne=g.useRef(J),F=g.useRef(!1);ne.current!==J&&(F.current=!0,ne.current=J),g.useEffect(function(){var se=(0,dt.Z)(function(){F.current=!1});return function(){dt.Z.cancel(se)}},[J]),g.useEffect(function(){if(ue&&M&&(!pe||k)){var se=function(){var Kt=!1,zt=function(yt){var ut=yt.target;Kt=N(ut)},Ot=function(yt){var ut=yt.target;!F.current&&ne.current&&!Kt&&!N(ut)&&P(!1)};return[zt,Ot]},de=se(),ge=(0,q.Z)(de,2),be=ge[0],Le=ge[1],Ne=se(),ze=(0,q.Z)(Ne,2),Ie=ze[0],Ke=ze[1],je=z(M);je.addEventListener("mousedown",be,!0),je.addEventListener("click",Le,!0),je.addEventListener("contextmenu",Le,!0);var Ce=(0,o.A)(W);if(Ce&&(Ce.addEventListener("mousedown",Ie,!0),Ce.addEventListener("click",Ke,!0),Ce.addEventListener("contextmenu",Ke,!0)),0)var vt,st,St,Ze;return function(){je.removeEventListener("mousedown",be,!0),je.removeEventListener("click",Le,!0),je.removeEventListener("contextmenu",Le,!0),Ce&&(Ce.removeEventListener("mousedown",Ie,!0),Ce.removeEventListener("click",Ke,!0),Ce.removeEventListener("contextmenu",Ke,!0))}}},[ue,W,M,pe,k])}var Rt=["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 _t(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fe.Z,ue=g.forwardRef(function(W,M){var pe=W.prefixCls,k=pe===void 0?"rc-trigger-popup":pe,N=W.children,P=W.action,ne=P===void 0?"hover":P,F=W.showAction,se=W.hideAction,de=W.popupVisible,ge=W.defaultPopupVisible,be=W.onPopupVisibleChange,Le=W.afterPopupVisibleChange,Ne=W.mouseEnterDelay,ze=W.mouseLeaveDelay,Ie=ze===void 0?.1:ze,Ke=W.focusDelay,je=W.blurDelay,Ce=W.mask,vt=W.maskClosable,st=vt===void 0?!0:vt,St=W.getPopupContainer,Ze=W.forceRender,Ht=W.autoDestroy,Kt=W.destroyPopupOnHide,zt=W.popup,Ot=W.popupClassName,ht=W.popupStyle,yt=W.popupPlacement,ut=W.builtinPlacements,Ct=ut===void 0?{}:ut,ft=W.popupAlign,Mt=W.zIndex,Qt=W.stretch,Jt=W.getPopupClassNameFromAlign,ln=W.fresh,an=W.alignPoint,jt=W.onPopupClick,Wt=W.onPopupAlign,pt=W.arrow,Xe=W.popupMotion,c=W.maskMotion,p=W.popupTransitionName,x=W.popupAnimation,G=W.maskTransitionName,re=W.maskAnimation,ye=W.className,Ae=W.getTriggerDOMNode,tt=(0,ve.Z)(W,Rt),Qe=Ht||Kt||!1,at=g.useState(!1),Ft=(0,q.Z)(at,2),Vt=Ft[0],ot=Ft[1];(0,f.Z)(function(){ot((0,u.Z)())},[]);var qt=g.useRef({}),At=g.useContext(we),Fe=g.useMemo(function(){return{registerSubPopup:function(en,In){qt.current[en]=In,At==null||At.registerSubPopup(en,In)}}},[At]),Be=(0,D.Z)(),ct=g.useState(null),It=(0,q.Z)(ct,2),Pt=It[0],dn=It[1],fn=(0,K.Z)(function(sn){(0,le.Sh)(sn)&&Pt!==sn&&dn(sn),At==null||At.registerSubPopup(Be,sn)}),Lt=g.useState(null),Et=(0,q.Z)(Lt,2),Oe=Et[0],Me=Et[1],He=g.useRef(null),nt=(0,K.Z)(function(sn){(0,le.Sh)(sn)&&Oe!==sn&&(Me(sn),He.current=sn)}),Ye=g.Children.only(N),et=(Ye==null?void 0:Ye.props)||{},Je={},Dt=(0,K.Z)(function(sn){var en,In,qn=Oe;return(qn==null?void 0:qn.contains(sn))||((en=(0,o.A)(qn))===null||en===void 0?void 0:en.host)===sn||sn===qn||(Pt==null?void 0:Pt.contains(sn))||((In=(0,o.A)(Pt))===null||In===void 0?void 0:In.host)===sn||sn===Pt||Object.values(qt.current).some(function(Dn){return(Dn==null?void 0:Dn.contains(sn))||sn===Dn})}),Zt=R(k,Xe,x,p),Ut=R(k,c,re,G),rn=g.useState(ge||!1),on=(0,q.Z)(rn,2),_n=on[0],cn=on[1],Xt=de!=null?de:_n,An=(0,K.Z)(function(sn){de===void 0&&cn(sn)});(0,f.Z)(function(){cn(de||!1)},[de]);var gn=g.useRef(Xt);gn.current=Xt;var On=g.useRef([]);On.current=[];var wn=(0,K.Z)(function(sn){var en;An(sn),((en=On.current[On.current.length-1])!==null&&en!==void 0?en:Xt)!==sn&&(On.current.push(sn),be==null||be(sn))}),xn=g.useRef(),vn=function(){clearTimeout(xn.current)},En=function(en){var In=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;vn(),In===0?wn(en):xn.current=setTimeout(function(){wn(en)},In*1e3)};g.useEffect(function(){return vn},[]);var Cn=g.useState(!1),Un=(0,q.Z)(Cn,2),Ln=Un[0],hn=Un[1];(0,f.Z)(function(sn){(!sn||Xt)&&hn(!0)},[Xt]);var $t=g.useState(null),$n=(0,q.Z)($t,2),Pn=$n[0],Kn=$n[1],Yn=g.useState([0,0]),ti=(0,q.Z)(Yn,2),Jn=ti[0],jn=ti[1],Vn=function(en){jn([en.clientX,en.clientY])},li=qe(Xt,Pt,an?Jn:Oe,yt,Ct,ft,Wt),Bt=(0,q.Z)(li,11),Gt=Bt[0],pn=Bt[1],Tn=Bt[2],kn=Bt[3],Xn=Bt[4],Mn=Bt[5],ui=Bt[6],fi=Bt[7],vi=Bt[8],ri=Bt[9],Wn=Bt[10],ni=he(Vt,ne,F,se),yi=(0,q.Z)(ni,2),Si=yi[0],hi=yi[1],Ai=Si.has("click"),pi=hi.has("click")||hi.has("contextMenu"),Ci=(0,K.Z)(function(){Ln||Wn()}),ki=function(){gn.current&&an&&pi&&En(!1)};We(Xt,Oe,Pt,Ci,ki),(0,f.Z)(function(){Ci()},[Jn,yt]),(0,f.Z)(function(){Xt&&!(Ct!=null&&Ct[yt])&&Ci()},[JSON.stringify(ft)]);var Pi=g.useMemo(function(){var sn=C(Ct,k,ri,an);return Z()(sn,Jt==null?void 0:Jt(ri))},[ri,Jt,Ct,k,an]);g.useImperativeHandle(M,function(){return{nativeElement:He.current,forceAlign:Ci}});var zi=g.useState(0),ji=(0,q.Z)(zi,2),wi=ji[0],qi=ji[1],Ni=g.useState(0),Ii=(0,q.Z)(Ni,2),er=Ii[0],Mi=Ii[1],Di=function(){if(Qt&&Oe){var en=Oe.getBoundingClientRect();qi(en.width),Mi(en.height)}},Fi=function(){Di(),Ci()},ai=function(en){hn(!1),Wn(),Le==null||Le(en)},Ti=function(){return new Promise(function(en){Di(),Kn(function(){return en})})};(0,f.Z)(function(){Pn&&(Wn(),Pn(),Kn(null))},[Pn]);function Qn(sn,en,In,qn){Je[sn]=function(Dn){var Oi;qn==null||qn(Dn),En(en,In);for(var hr=arguments.length,ar=new Array(hr>1?hr-1:0),tr=1;tr<hr;tr++)ar[tr-1]=arguments[tr];(Oi=et[sn])===null||Oi===void 0||Oi.call.apply(Oi,[et,Dn].concat(ar))}}(Ai||pi)&&(Je.onClick=function(sn){var en;gn.current&&pi?En(!1):!gn.current&&Ai&&(Vn(sn),En(!0));for(var In=arguments.length,qn=new Array(In>1?In-1:0),Dn=1;Dn<In;Dn++)qn[Dn-1]=arguments[Dn];(en=et.onClick)===null||en===void 0||en.call.apply(en,[et,sn].concat(qn))}),wt(Xt,pi,Oe,Pt,Ce,st,Dt,En);var mi=Si.has("hover"),Ei=hi.has("hover"),si,ci;mi&&(Qn("onMouseEnter",!0,Ne,function(sn){Vn(sn)}),Qn("onPointerEnter",!0,Ne,function(sn){Vn(sn)}),si=function(en){(Xt||Ln)&&Pt!==null&&Pt!==void 0&&Pt.contains(en.target)&&En(!0,Ne)},an&&(Je.onMouseMove=function(sn){var en;(en=et.onMouseMove)===null||en===void 0||en.call(et,sn)})),Ei&&(Qn("onMouseLeave",!1,Ie),Qn("onPointerLeave",!1,Ie),ci=function(){En(!1,Ie)}),Si.has("focus")&&Qn("onFocus",!0,Ke),hi.has("focus")&&Qn("onBlur",!1,je),Si.has("contextMenu")&&(Je.onContextMenu=function(sn){var en;gn.current&&hi.has("contextMenu")?En(!1):(Vn(sn),En(!0)),sn.preventDefault();for(var In=arguments.length,qn=new Array(In>1?In-1:0),Dn=1;Dn<In;Dn++)qn[Dn-1]=arguments[Dn];(en=et.onContextMenu)===null||en===void 0||en.call.apply(en,[et,sn].concat(qn))}),ye&&(Je.className=Z()(et.className,ye));var Vi=(0,B.Z)((0,B.Z)({},et),Je),sr={},Bi=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Bi.forEach(function(sn){tt[sn]&&(sr[sn]=function(){for(var en,In=arguments.length,qn=new Array(In),Dn=0;Dn<In;Dn++)qn[Dn]=arguments[Dn];(en=Vi[sn])===null||en===void 0||en.call.apply(en,[Vi].concat(qn)),tt[sn].apply(tt,qn)})});var dr=g.cloneElement(Ye,(0,B.Z)((0,B.Z)({},Vi),sr)),Wi={x:Mn,y:ui},Zi=pt?(0,B.Z)({},pt!==!0?pt:{}):null;return g.createElement(g.Fragment,null,g.createElement(_e.Z,{disabled:!Xt,ref:nt,onResize:Fi},g.createElement(ie,{getTriggerDOMNode:Ae},dr)),g.createElement(we.Provider,{value:Fe},g.createElement(Q,{portal:J,ref:fn,prefixCls:k,popup:zt,className:Z()(Ot,Pi),style:ht,target:Oe,onMouseEnter:si,onMouseLeave:ci,onPointerEnter:si,zIndex:Mt,open:Xt,keepDom:Ln,fresh:ln,onClick:jt,mask:Ce,motion:Zt,maskMotion:Ut,onVisibleChanged:ai,onPrepare:Ti,forceRender:Ze,autoDestroy:Qe,getPopupContainer:St,align:ri,arrow:Zi,arrowPos:Wi,ready:Gt,offsetX:pn,offsetY:Tn,offsetR:kn,offsetB:Xn,onAlign:Ci,stretch:Qt,targetWidth:wi/fi,targetHeight:er/vi})))});return ue}var Pe=_t(fe.Z)},8797:function(bt,ke,b){"use strict";var B=b(59301),q=b(93314),ve=b(3113),fe=Object.defineProperty,oe=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,_e=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,K=(g,m,I)=>m in g?fe(g,m,{enumerable:!0,configurable:!0,writable:!0,value:I}):g[m]=I,D=(g,m)=>{for(var I in m||(m={}))le.call(m,I)&&K(g,I,m[I]);if(_e)for(var I of _e(m))o.call(m,I)&&K(g,I,m[I]);return g},f=(g,m)=>oe(g,Z(m));const u=({img:g,buttonProps:m={},styles:I={},customText:H,ButtonText:L,ButtonClick:w,Buttonclass:O,ButtonTwo:A,imgStyles:E,loading:Q=!1})=>B.createElement("section",{className:"tc animated fadeIn",style:D(D({},{color:"#999",margin:"100px auto",visibility:Q?"hidden":"visible"}),I)},B.createElement("img",{src:g||q,style:f(D({},E),{pointerEvents:"none",userSelect:"none"})}),B.createElement("p",{className:"mt20 font14"},H||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),L&&B.createElement(ve.ZP,D({className:O,onClick:w},m),L),A&&A);ke.Z=u},23210:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return O}});var B=b(59301),q={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},ve=b(3113),fe=b(70557),oe=b(23954),Z=b(6848),_e=b(955),le=b(94941),o=b(8797),K=b(3294),D=b(19381),f=b(59301),u=Object.defineProperty,g=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,H=(A,E,Q)=>E in A?u(A,E,{enumerable:!0,configurable:!0,writable:!0,value:Q}):A[E]=Q,L=(A,E)=>{for(var Q in E||(E={}))m.call(E,Q)&&H(A,Q,E[Q]);if(g)for(var Q of g(E))I.call(E,Q)&&H(A,Q,E[Q]);return A},w=(A,E,Q)=>new Promise((te,ie)=>{var Ee=he=>{try{xe(Q.next(he))}catch(V){ie(V)}},we=he=>{try{xe(Q.throw(he))}catch(V){ie(V)}},xe=he=>he.done?te(he.value):Promise.resolve(he.value).then(Ee,we);xe((Q=Q.apply(A,E)).next())}),O=({editOffice:A="view",data:E,theme:Q,type:te,filename:ie,monacoEditor:Ee,className:we,style:xe,close:he,onClose:V,hasMask:T,disabledDownload:C,onImgDimensions:R,showNodata:z,recordInfo:Y})=>{const[y,v]=(0,B.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[$,j]=(0,B.useState)(""),[me,Se]=(0,B.useState)(),Te=window.ENV==="build"?"/react/build":"",De=location.host.startsWith("localhost")?K.Z.PROXY_SERVER:K.Z.API_SERVER,lt=10*(1024*1024),We=(0,B.useRef)();E!=null&&E.startsWith("/api")&&te!=="txt"&&(E=K.Z.API_SERVER+E);const Tt=_t=>_t.substring(_t.lastIndexOf("/")+1).split(".").pop();ie&&Ee&&(Ee.filename=ie),(0,B.useEffect)(()=>{var _t,Pe;const J=(Pe=(_t=document.cookie)==null?void 0:_t.replace(/\s/g,""))==null?void 0:Pe.split(";");J==null||J.map(ue=>{let W=ue.split("=");W[0]==="_educoder_session"&&j(W[1])})},[]),(0,B.useEffect)(()=>{te==="office"&&(E.indexOf("bigfilescdn.")>-1||E.indexOf("bigfiles1")>-1?Se({url:E,fileType:Tt(E),model:E.indexOf("model=edit")?"edit":"view"}):dt())},[te,E]);const dt=()=>w(void 0,null,function*(){console.log("data:",E);let _t=E;E.startsWith("http")||(_t=location.origin+_t);let Pe=new URL(_t).pathname.split("/").pop();const J=yield(0,le.gJ)({attachment_id:Pe});J.url=De+J.url,Se(J)}),wt=()=>{if(E.startsWith("http")||E.startsWith("blob:")){Rt();return}(0,_e.Sv)(ie||"educoder",E,ie)},Rt=()=>{Y&&(0,D.fc)({id:Y==null?void 0:Y.id,watch_type:1,course_id:Y==null?void 0:Y.course_id}),(0,_e.Nd)(ie||"educoder",decodeURIComponent(E))};return f.createElement("div",{style:L({},xe||{}),className:`${T&&q.bgBlack} ${te?q.wrp:"hide"}`},he&&f.createElement("div",{className:q.close,ref:We},!!R&&f.createElement(Z.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>We.current},f.createElement("span",{onClick:()=>{V(),R()}},f.createElement("i",{className:"icon-yulanpizhu"}))),!C&&f.createElement(Z.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>We.current},f.createElement("span",{onClick:Rt},f.createElement("i",{className:"icon-quxiaozhiding"}))),f.createElement(Z.Z,{title:"\u5173\u95ED",getPopupContainer:()=>We.current},f.createElement("span",{className:"",onClick:V},f.createElement("i",{className:"icon-guanbi1"})))),f.createElement("div",{className:`${q[we]} ${we} ${q.monaco} ${te==="txt"?"show":"hide"}`},te==="txt"&&f.createElement(f.Fragment,null,f.createElement(oe.ZP,L({},Ee)))),te==="audio"&&f.createElement("audio",{src:`${(E==null?void 0:E.indexOf("http://"))>-1||(E==null?void 0:E.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${E}`,autoPlay:!0}),te==="video"&&f.createElement(f.Fragment,null,(E==null?void 0:E.indexOf("http"))>-1?f.createElement("video",{controls:!0,src:`${E}`,autoPlay:!0}):f.createElement("video",{controls:!0,src:`data:video/mp4;base64,${E}`,autoPlay:!0})),te==="office"&&me&&f.createElement("iframe",{src:`${Te}/office.html?key=${me.key}&url=${btoa(me.url)}&callbackUrl=${De+(me.callbackUrl||"")}&fileType=${me.fileType}&title=${me.title||""}&model=${A}&officeServer=${K.Z.ONLYOFFICE}&disabledDownload=${!!C}`}),te==="html"&&f.createElement("iframe",{src:E+"&disposition=inline"}),te==="pdf"&&f.createElement("iframe",{src:`${Te}/js/pdfview/index.html?filename=${ie||"educoder.pdf"}&url=${encodeURIComponent(E)}&disabledDownload=${!!C}`}),te==="image"&&f.createElement("img",{src:`${(E==null?void 0:E.indexOf("http://"))>-1||(E==null?void 0:E.indexOf("https://"))>-1?"":"data:image/png;base64,"}${E}`}),(te==="other"||te==="download")&&f.createElement(f.Fragment,null,z?f.createElement(o.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:f.createElement(ve.ZP,{icon:f.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:wt,disabled:C},"\u4E0B\u8F7D")}):f.createElement(ve.ZP,{type:"primary",size:"middle",onClick:wt,disabled:C},f.createElement(fe.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},71839:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return m}});var B=b(59301),q=b(8591),ve=b(38854),fe=b(29382),oe=b(40846),Z=b(24065),_e=b(56102),le=b(4901),o={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=(I,H,L)=>new Promise((w,O)=>{var A=te=>{try{Q(L.next(te))}catch(ie){O(ie)}},E=te=>{try{Q(L.throw(te))}catch(ie){O(ie)}},Q=te=>te.done?w(te.value):Promise.resolve(te.value).then(A,E);Q((L=L.apply(I,H)).next())});function D(I){if(isNaN(I))return{minutes:"00",seconds:"00"};const H=new Date(I*1e3).toISOString().substr(11,8);return{hour:H.substr(0,2),minutes:H.substr(3,2),seconds:H.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function f(I,H){return I-H}function u(I){I.sort(f);let H=0;for(let L=0;L<I.length-1;L++){let w=Math.abs(I[L+1]-I[L]);w<21&&(H+=w)}return H}const g=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;var m=(0,B.forwardRef)(({allow_skip:I,src:H,toLog:L,videoId:w,logWatchHistory:O,courseId:A=null,startTime:E,handlePause:Q=()=>{},handlePlay:te=()=>{},handlePlayEnded:ie=()=>{},autoPlay:Ee=!1,onPlayEnded:we=()=>{},isShowWaterMark:xe=!0},he)=>{var V;H=H==null?void 0:H.replace("http://","https://");const C=((V=H==null?void 0:H.split("."))==null?void 0:V.pop())==="flv",R=(0,B.useRef)(),z=(0,B.useRef)(),Y=(0,B.useRef)(),y=(0,B.useRef)(),v=(0,B.useRef)(),$=(0,B.useRef)(),j=(0,B.useRef)(),me=(0,B.useRef)(),Se=(0,B.useRef)(),Te=(0,B.useRef)(),De=(0,B.useRef)(),qe=(0,B.useRef)(),lt=(0,B.useRef)(),We=(0,B.useRef)(),Tt=navigator.userAgent.toLowerCase().match(g),dt=Tt?Tt[0]:"pc",wt=(0,B.useRef)(!1),Rt=(0,Z.eY)();let _t=0,Pe=0,J=0,ue=null,W=!1,M=20,pe=1,k=!1,N=!1,P=[];(0,B.useImperativeHandle)(he,()=>({getLastUpdatedTime:()=>R.current.currentTime,getDuration:()=>R.current.duration})),q.ZP.config({maxCount:1,getContainer:()=>Y.current});const ne=(0,B.useCallback)((Ne,ze=!1)=>{let Ie={point:R.current.currentTime};ue?(Ie.log_id=ue,Ie.watch_duration=u(P),Ie.total_duration=Pe):(A?(Ie.video_id=parseInt(w,10),Ie.course_id=A):Ie.video_id=w,Ie.duration=_t,Ie.device=dt),ze&&(Ie.ed="1");function Ke(){return K(this,null,function*(){k=!0,ue=yield O==null?void 0:O(Ie),k=!1,Ne&&Ne()})}Ke()},[w,A]);(0,B.useEffect)(()=>{R.current&&(y.current.style.display="none",v.current.style.display="block"),q.ZP.destroy();let Ne=null;return fe.Z.isSupported&&C&&H&&(H==null?void 0:H.indexOf(".m3u8"))<0?(Ne=fe.Z.createPlayer({type:"flv",volume:.8,cors:!0,url:H,muted:!1}),R.current&&(Ne.attachMediaElement(R.current),Ne.load())):R.current.setAttribute("src",H),se(),()=>{Ne&&(Ne.unload(),Ne.pause(),Ne.destroy(),Ne=null)}},[R,C,H]);function F(){R.current.paused?(y.current.style.display="none",v.current.style.display="block"):(y.current.style.display="block",v.current.style.display="none")}function se(){De.current.style.display="none",lt.current.style.display="none",qe.current.style.display="none",R.current.muted||R.current.volume===0?De.current.style.display="block":R.current.volume>0&&R.current.volume<=.5?lt.current.style.display="block":qe.current.style.display="block"}(0,B.useEffect)(()=>{const Ne=document.getElementById("play"),ze=document.querySelectorAll(".playback-icons use");function Ie(){te(),E&&!wt.current&&(R.current.currentTime=E),wt.current=!0,P.push(R.current.currentTime),W||(W=!0,L&&ne())}function Ke(){return K(this,null,function*(){F(),P.push(R.current.currentTime),L&&ne(()=>{ue=null,J=0,W=!1,k=!1,N=!1,P=[],Pe=0,pe=1},!0),we()})}function je(){$.current.value=Math.round(R.current.currentTime),j.current.value=Math.round(R.current.currentTime)}function Ce(){const ut=D(Math.round(R.current.currentTime));Se.current.innerText=`${ut.hour>0?ut.hour+":":""}${ut.minutes}:${ut.seconds}`,Se.current.setAttribute("datetime",`${ut.hour>0?" "+ut.hour+" ":""}${ut.minutes}m ${ut.seconds}s`)}function vt(){var ut,Ct,ft,Mt,Qt,Jt,ln;const an=Math.round((ut=R.current)==null?void 0:ut.duration);(ft=(Ct=$.current)==null?void 0:Ct.setAttribute)==null||ft.call(Ct,"max",an),(Qt=(Mt=j.current)==null?void 0:Mt.setAttribute)==null||Qt.call(Mt,"max",an);const jt=D(an);me.current&&(me.current.innerText=`${jt.hour>0?jt.hour+":":""}${jt.minutes}:${jt.seconds}`,(ln=(Jt=me.current).setAttribute)==null||ln.call(Jt,"datetime",`${jt.hour>0?" "+jt.hour+" ":""}${jt.minutes}m ${jt.seconds}s`))}function st(){try{const ut=Math.round(R.current.duration);$.current.setAttribute("max",ut),j.current.setAttribute("max",ut);const Ct=D(ut);me.current.innerText=`${Ct.hour>0?Ct.hour+":":""}${Ct.minutes}:${Ct.seconds}`,me.current.setAttribute("datetime",`${Ct.hour>0?" "+Ct.hour+" ":""}${Ct.minutes}m ${Ct.seconds}s`),je(),Ce();const{width:ft,height:Mt,x:Qt,y:Jt}=z.current.getBoundingClientRect();if(Qt<0||Jt<0||!ft)return;if(!N){let ln=R.current.currentTime,an=ln-J;Math.abs(an)<10?(Pe+=Math.abs(an),J=ln,k||Pe-pe*M>=0&&(pe++,P.push(J),L&&ne())):(J=ln,L&&ne())}}catch(ut){console.log(ut)}}function St(){N=!0}function Ze(){R.current.playing&&P.push(R.current.currentTime,J),J=R.current.currentTime,N=!1}function Ht(){_t=R.current.duration,_t<=20&&(M=_t/3),R.current.addEventListener("play",Ie)}function Kt(ut){ut.preventDefault(),(0,le.vp)()?(R.current.style.width="100%",R.current.style.height="100%"):R.current.style.cssText=""}function zt(){Q()}function Ot(ut){if(!I){q.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");return}const Ct=ut.target.dataset.seek?ut.target.dataset.seek:ut.target.value;R.current.currentTime=Ct,j.current.value=Ct,$.current.value=Ct}function ht(ut){const Ct=Math.round(ut.offsetX/ut.target.clientWidth*parseInt(ut.target.getAttribute("max"),10));$.current.setAttribute("data-seek",Ct);const ft=D(Ct);Te.current.textContent=`${ft.hour>0?ft.hour+":":""}${ft.minutes}:${ft.seconds}`;const Mt=R.current.getBoundingClientRect();Te.current.style.left=`${ut.pageX-Mt.left}px`}function yt(ut){switch(ut.code){case"Space":ut.preventDefault(),be();break;case"ArrowRight":if(ut.preventDefault(),!I){q.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(R.current.currentTime>=R.current.duration)break;R.current.currentTime=parseInt(R.current.currentTime)+5,je();break;case"ArrowLeft":if(ut.preventDefault(),!I){q.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(R.current.currentTime===0)break;R.current.currentTime=parseInt(R.current.currentTime)-5,je();break;case"ArrowUp":ut.preventDefault(),R.current.volume<1&&(R.current.volume=(parseInt(R.current.volume*10)+1)/10);break;case"ArrowDown":ut.preventDefault(),R.current.volume>0&&(R.current.volume=(parseInt(R.current.volume*10)-1)/10);break}}return Y.current.addEventListener((0,le.gH)(),Kt),R.current.addEventListener("canplay",Ht),R.current.addEventListener("ended",Ke),R.current.addEventListener("seeking",St),R.current.addEventListener("seeked",Ze),R.current.addEventListener("loadedmetadata",vt),$.current.addEventListener("mousemove",ht),$.current.addEventListener("input",Ot),R.current.addEventListener("timeupdate",st),R.current.addEventListener("pause",zt),R.current.addEventListener("volumechange",se),document.addEventListener("keydown",yt),()=>{var ut,Ct,ft,Mt,Qt,Jt,ln,an,jt,Wt,pt,Xe;(ut=R.current)==null||ut.removeEventListener("canplay",Ht),(Ct=R.current)==null||Ct.removeEventListener("play",Ie),(ft=R.current)==null||ft.removeEventListener("ended",Ke),(Mt=R.current)==null||Mt.removeEventListener("seeking",St),(Qt=R.current)==null||Qt.removeEventListener("seeked",Ze),(Jt=$.current)==null||Jt.removeEventListener("mousemove",ht),(ln=$.current)==null||ln.removeEventListener("input",Ot),(an=R.current)==null||an.removeEventListener("timeupdate",st),(jt=R.current)==null||jt.removeEventListener("pause",zt),(Wt=R.current)==null||Wt.removeEventListener("loadedmetadata",vt),(pt=R.current)==null||pt.removeEventListener("volumechange",se),document.removeEventListener("keydown",yt),(Xe=R.current)!=null&&Xe.playing&&(P.push(J,R.current.currentTime),L&&ne())}},[R,H]),(0,B.useEffect)(()=>{if(R.current.onended=()=>{ie(R)},R.current.oncontextmenu=()=>!1,(H==null?void 0:H.indexOf(".m3u8"))>-1){if(R.current.canPlayType("application/vnd.apple.mpegurl"))R.current.src=H;else if(oe.ZP.isSupported()){var Ne=new oe.ZP;Ne.loadSource(H),Ne.attachMedia(R.current)}}},[H]);const[de,ge]=(0,B.useState)(1),be=()=>{R.current.paused||R.current.ended?R.current.play():R.current.pause(),F()};function Le(){R.current.muted=!R.current.muted,R.current.muted?(We.current.setAttribute("data-volume",volume.value),We.current.value=0):We.current.value=We.current.dataset.volume}return B.createElement("div",{style:{position:"relative"},ref:Y},B.createElement("div",{ref:z,className:`${o.watermark} animated_alternate animate__animated_10s animate__infinite animate__stepstart ${o.animate__loop}`},xe&&Rt?Rt.login:" "),B.createElement("div",{className:o.container},B.createElement("div",{className:o["video-container"],id:"video-container"},B.createElement("div",{className:o["playback-animation"],id:"playback-animation"},B.createElement("svg",{className:o["playback-icons"]},B.createElement("use",{className:"hidden",href:"#play-icon"}),B.createElement("use",{href:"#pause"}))),B.createElement("video",{className:o.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:R,autoPlay:Ee}),B.createElement("div",{className:`${o["video-controls"]} `,id:"video-controls"},B.createElement("div",{className:o["bottom-controls"]},B.createElement("div",{className:o["left-controls"]},B.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:be},B.createElement("svg",{className:o["playback-icons"]},B.createElement("use",{ref:v,href:"#play-icon"}),B.createElement("use",{ref:y,style:{display:"none"},href:"#pause"}))),B.createElement("div",{className:o.time},B.createElement("time",{id:"time-elapsed",ref:Se},"00:00"),B.createElement("span",null," / "),B.createElement("time",{id:"duration",ref:me},"00:00"))),B.createElement("div",{className:o["right-controls"]},I&&B.createElement(ve.Z,{placement:"top",overlayClassName:o.rateOverlay,getPopupContainer:Ne=>Ne.parentNode,menu:{items:[{key:"1",label:B.createElement("span",{onClick:()=>{ge(1),R.current.playbackRate=1}},"1.0x")},{key:"2",label:B.createElement("span",{onClick:()=>{ge(1.5),R.current.playbackRate=1.5}},"1.5x")},{key:"3",label:B.createElement("span",{onClick:()=>{ge(2),R.current.playbackRate=2}},"2.0x")}]}},B.createElement("div",{className:`${o.controlText} mr5`},"\u500D\u901F")),B.createElement(_e.CopyToClipboard,{text:H,onCopy:()=>q.ZP.success("\u590D\u5236\u6210\u529F")},B.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},B.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),B.createElement("div",{className:o["volume-controls"]},B.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:o["volume-button"],id:"volume-button",onClick:Le},B.createElement("i",{ref:De,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),B.createElement("i",{ref:lt,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),B.createElement("i",{ref:qe,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),B.createElement("input",{className:o.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:We,style:{display:"none"},onClick:se})),B.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:o["fullscreen-button"],onClick:()=>{(0,le.vp)()?(0,le.BU)():(0,le.Dj)(Y.current)}},B.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),B.createElement("div",{className:o["video-progress"]},B.createElement("progress",{ref:j,value:"0",min:"0"}),B.createElement("input",{className:o.seek,ref:$,value:"0",min:"0",type:"range",step:"1"}),B.createElement("div",{className:o["seek-tooltip"],ref:Te,id:"seek-tooltip"},"00:00"))))),B.createElement("svg",{style:{display:"none"}},B.createElement("defs",null,B.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},B.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),B.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},B.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),B.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},B.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"})),B.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},B.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"})),B.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},B.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"})),B.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},B.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"})),B.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},B.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"})),B.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},B.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"})))))})},23954:function(bt,ke,b){"use strict";b.d(ke,{SV:function(){return pe},ZP:function(){return M}});var B=b(59301),q=b(76374);const ve={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},fe={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},oe={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(`
|
|
`)}]},Z={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(`
|
|
`)}]},_e={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 le=b(53184),o=b.n(le),K=Object.defineProperty,D=Object.defineProperties,f=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,I=(k,N,P)=>N in k?K(k,N,{enumerable:!0,configurable:!0,writable:!0,value:P}):k[N]=P,H=(k,N)=>{for(var P in N||(N={}))g.call(N,P)&&I(k,P,N[P]);if(u)for(var P of u(N))m.call(N,P)&&I(k,P,N[P]);return k},L=(k,N)=>D(k,f(N)),w=(k,N,P)=>new Promise((ne,F)=>{var se=be=>{try{ge(P.next(be))}catch(Le){F(Le)}},de=be=>{try{ge(P.throw(be))}catch(Le){F(Le)}},ge=be=>be.done?ne(be.value):Promise.resolve(be.value).then(se,de);ge((P=P.apply(k,N)).next())});const O={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},A=(k,N)=>N.map(P=>({label:P,kind:k.languages.CompletionItemKind.Keyword,insertText:P})),E=k=>Object.keys(O.tables).map(N=>({label:N,kind:k.languages.CompletionItemKind.Variable,insertText:N})),Q=(k,N)=>{const P=O.tables[k];return P?P.map(ne=>({label:ne,kind:N.languages.CompletionItemKind.Field,insertText:ne})):[]};function te(k,N,P,ne,F){let se=N.getWordUntilPosition(P),de={startLineNumber:P.lineNumber,endLineNumber:P.lineNumber,startColumn:se.startColumn,endColumn:se.endColumn},ge=ne.map(be=>({label:be,kind:k.languages.CompletionItemKind.Keyword,insertText:be,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:de}));return F.map(be=>{ge.push(L(H({},be),{range:de}))}),ge}var ie=k=>{O.languages.map(F=>(k.languages.registerDocumentFormattingEditProvider(F,{provideDocumentFormattingEdits(se,de,ge){return w(this,null,function*(){const be=o()(se.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:se.getFullModelRange(),text:be}]})}}),F));const N=oe.quickKey.map(F=>({label:F.label,kind:k.languages.CompletionItemKind.Method,insertText:F.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet})),P=Z.quickKey.map(F=>({label:F.label,kind:k.languages.CompletionItemKind.Method,insertText:F.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet})),ne=fe.quickKey.map(F=>({label:F.label,kind:k.languages.CompletionItemKind.Method,insertText:F.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet}));k.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(F,se){var de=F.getWordUntilPosition(se),ge={startLineNumber:se.lineNumber,endLineNumber:se.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},be=F.getLineContent(se.lineNumber).substring(de.startColumn-2,de.endColumn);return{suggestions:[...oe.keywords.map(Le=>({label:Le,kind:k.languages.CompletionItemKind.Function,documentation:Le,insertText:Le,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge})),...oe.quickKey.map(Le=>({label:Le.label,kind:k.languages.CompletionItemKind.Function,documentation:Le.content,insertText:be.startsWith("#")?Le.content.replace(/#/,""):Le.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}}),k.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(F,se){var de=F.getWordUntilPosition(se),ge={startLineNumber:se.lineNumber,endLineNumber:se.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn};return{suggestions:[...ve.keywords.map(be=>({label:be,kind:k.languages.CompletionItemKind.Function,documentation:be,insertText:be,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}}),k.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(F,se){var de=F.getWordUntilPosition(se),ge={startLineNumber:se.lineNumber,endLineNumber:se.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},be=F.getLineContent(se.lineNumber).substring(de.startColumn-2,de.endColumn);return{suggestions:[...fe.keywords.map(Le=>({label:Le,kind:k.languages.CompletionItemKind.Function,documentation:Le,insertText:Le,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge})),...fe.quickKey.map(Le=>({label:Le.label,kind:k.languages.CompletionItemKind.Function,documentation:Le.content,insertText:be.startsWith("#")?Le.content.replace(/#/,""):Le.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}}),k.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(F,se){var de=F.getWordUntilPosition(se),ge={startLineNumber:se.lineNumber,endLineNumber:se.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},be=F.getLineContent(se.lineNumber).substring(de.startColumn-2,de.endColumn);return{suggestions:[..._e.keywords.map(Le=>({label:Le,kind:k.languages.CompletionItemKind.Function,documentation:Le,insertText:Le,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge})),..._e.quickKey.map(Le=>({label:Le.label,kind:k.languages.CompletionItemKind.Function,documentation:Le.content,insertText:be.startsWith("#")?Le.content.replace(/#/,""):Le.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}}),k.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(F,se){var de=F.getWordUntilPosition(se),ge={startLineNumber:se.lineNumber,endLineNumber:se.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},be=F.getLineContent(se.lineNumber).substring(de.startColumn-2,de.endColumn);return{suggestions:[...Z.keywords.map(Le=>({label:Le,kind:k.languages.CompletionItemKind.Function,documentation:Le,insertText:Le,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge})),...Z.quickKey.map(Le=>({label:Le.label,kind:k.languages.CompletionItemKind.Function,documentation:Le.content,insertText:be.startsWith("#")?Le.content.replace(/#/,""):Le.content,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}))]}}})};const Ee="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var we=Object.defineProperty,xe=(k,N,P)=>N in k?we(k,N,{enumerable:!0,configurable:!0,writable:!0,value:P}):k[N]=P,he=(k,N,P)=>xe(k,typeof N!="symbol"?N+"":N,P);const V=class Ya{constructor(N,P,ne){this.placeholder=N,this.editor=P,this.monaco=ne,P.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Ya.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)}};he(V,"ID","editor.widget.placeholderHint");var C=V,R=b(96236),z=b(8591),Y=b(6848),y=b(89392),v=b(34604),$=b(56102),j=Object.defineProperty,me=Object.defineProperties,Se=Object.getOwnPropertyDescriptors,Te=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable,lt=(k,N,P)=>N in k?j(k,N,{enumerable:!0,configurable:!0,writable:!0,value:P}):k[N]=P,We=(k,N)=>{for(var P in N||(N={}))De.call(N,P)&<(k,P,N[P]);if(Te)for(var P of Te(N))qe.call(N,P)&<(k,P,N[P]);return k},Tt=(k,N)=>me(k,Se(N)),dt=(k,N)=>{var P={};for(var ne in k)De.call(k,ne)&&N.indexOf(ne)<0&&(P[ne]=k[ne]);if(k!=null&&Te)for(var ne of Te(k))N.indexOf(ne)<0&&qe.call(k,ne)&&(P[ne]=k[ne]);return P},wt=(k,N,P)=>new Promise((ne,F)=>{var se=be=>{try{ge(P.next(be))}catch(Le){F(Le)}},de=be=>{try{ge(P.throw(be))}catch(Le){F(Le)}},ge=be=>be.done?ne(be.value):Promise.resolve(be.value).then(se,de);ge((P=P.apply(k,N)).next())});function Rt(k){return/^\d+$/.test(k)?`${k}px`:k}function _t(){}let Pe=!1;const J={"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 ue(k=[]){let N=k;if(Array.isArray(k)){for(let P=0;P<k.length;P++){let ne=J[k[P]];if(ne)return ne}return N[0]}return J[N]||N}let W=null;var M=k=>{var N=k,{width:P="100%",height:ne="100%",value:F,language:se="javascript",style:de={},options:ge={},overrideServices:be={},theme:Le="vs-dark",onEditBlur:Ne,isCopy:ze=!1,onSave:Ie,autoHeight:Ke=!1,forbidCopy:je=!1,onChange:Ce=_t,editorDidMount:vt=_t,onFocus:st=_t,onBreakPoint:St=_t,breakPointValue:Ze=[],filename:Ht="educoder.txt",errorLine:Kt,errorContent:zt="",highlightLine:Ot,openBreakPoint:ht=!1,placeholder:yt=""}=N,ut=dt(N,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder"]);const Ct=(0,B.useRef)(),ft=(0,B.useRef)({}),Mt=(0,B.useRef)(),Qt=(0,B.useRef)(),Jt=(0,B.useRef)([]),ln=(0,B.useRef)(!1),an=(0,B.useRef)(),jt=(0,B.useRef)(),Wt=(0,B.useRef)(!1),[pt,Xe]=(0,B.useState)(!1);function c(){let Fe;return Ct.current&&(Fe=new q.Z(Be=>{for(let ct of Be)(ct.target.offsetHeight>0||ct.target.offsetWidth>0)&&ft.current.instance.layout()}),Fe.observe(Ct.current)),Fe}function p(){z.ZP.warning({content:decodeURIComponent(Ee),key:"monaco-editor-tip"})}const x=()=>{let Fe=ft.current.instance;if(F!=null&&Fe&&pt){const Be=Fe.getModel();Be&&F!==Be.getValue()&&(Pe=!0,Be.setValue(F),Fe.layout(),Pe=!1)}};(0,B.useEffect)(()=>{const Fe=v.Z.subscribe("formatDocument",Be=>{var ct;let It=ft.current.instance;(ct=It==null?void 0:It.getAction)==null||ct.call(It,"editor.action.formatDocument").run()});return window.updateMonacoValue=Be=>{Ce(Be)},Fe},[]),(0,B.useEffect)(()=>{var Fe;let Be=ft.current.instance;Qt.current&&clearTimeout(Qt.current),Qt.current=setTimeout(()=>{x()},500),F&&(F!=null&&F.length)&&((Fe=Be==null?void 0:Be.updateOptions)==null||Fe.call(Be,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(F.split(/\r\n|\r|\n/g).length))+3,5)}))},[F,pt,ft.current]),(0,B.useEffect)(()=>{if(Kt&&ft.current&&ft.current.instance){let Be=ft.current.instance;Be.changeViewZones(function(ct){var It=document.createElement("div");It.style.padding="10px 20px",It.style.width="calc(100% - 20px)",It.className="my-error-line-wrp",It.innerHTML=zt,ct.addZone({afterLineNumber:Kt||11,heightInLines:3,domNode:It})});var Fe={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}};Be.addOverlayWidget(Fe),Be.revealPositionInCenter({lineNumber:20,column:1})}},[Kt,ft.current,pt]);const G=(Fe="",Be)=>{if(!Fe||Fe.trim()==="")return!0;const It=ft.current.instance.getModel().getLineTokens(Be);let Pt=!1;for(let dn=0;dn<2;dn++)It.getStandardTokenType(dn)===1&&(Pt=!0);return Pt};(0,B.useEffect)(()=>{var Fe;const Be=(Fe=ft.current)==null?void 0:Fe.instance;if(Be&&pt&&je){const ct=Be.onDidBlurEditorWidget(()=>{Wt.current=!1}),It=Be.onDidFocusEditorText(()=>{Wt.current=!0});return()=>{ct.dispose(),It.dispose()}}},[ft.current,pt,je]),(0,B.useEffect)(()=>{var Fe;if((Fe=ft.current)!=null&&Fe.instance&&pt&&ht){let Be=ft.current.instance,ct=Be.getModel();if(!ct)return;(()=>{var et;let Je=[],Dt=[];const Zt=ct.getAllDecorations();for(let rn of Zt)rn.options.className==="highlighted-line"&&(Je.push((et=rn==null?void 0:rn.range)==null?void 0:et.startLineNumber),Dt.push(rn==null?void 0:rn.id));if(Ot===Je[0])return;ct.deltaDecorations(Dt,[]);const Ut=ct.getLineCount();Ot&&Ot<=Ut&&(Be.deltaDecorations([],[{range:new W.Range(Ot,1,Ot,ct.getLineMaxColumn(Ot)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Be.revealLineInCenter(Ot))})();const Pt=(et=!1)=>{var Je;let Dt=[],Zt=[];const Ut=ct.getAllDecorations();for(let rn of Ut)rn.options.linesDecorationsClassName==="breakpoints-select"&&(Dt.push((Je=rn==null?void 0:rn.range)==null?void 0:Je.startLineNumber),Zt.push(rn==null?void 0:rn.id));if(et)return{lines:Dt,ids:Zt};St(Dt)},dn=et=>wt(void 0,null,function*(){let Je={range:new W.Range(et,1,et,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield ct.deltaDecorations([],[Je]),Pt()}),fn=et=>wt(void 0,null,function*(){let Je=[];const Dt=Be.getLineDecorations(et);for(let Zt of Dt)Zt.options.linesDecorationsClassName==="breakpoints-select"&&Je.push(Zt.id);yield ct.deltaDecorations(Je,[]),Pt()}),Lt=et=>{let Je=Be.getLineDecorations(et);for(let Dt of Je)if(Dt.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,y.isEqual)(Ze,Pt(!0).lines)){ct.deltaDecorations(Pt(!0).ids,[]);const et=Ze.map(Je=>({range:new W.Range(Je,1,Je,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));ct.deltaDecorations([],et)}const Et=Be.onDidChangeModelContent(et=>{let Je=Be.getPosition();if(Je){let Dt=Je.lineNumber;clearTimeout(jt.current),jt.current=setTimeout(()=>{G(ct.getLineContent(Dt),Dt)?fn(Dt):Lt(Dt)?(fn(Dt),dn(Dt)):Pt()},100)}}),Oe=Be.onMouseDown(et=>{var Je,Dt,Zt;if(et.target.detail&&((Zt=(Dt=(Je=et.target)==null?void 0:Je.element)==null?void 0:Dt.className)!=null&&Zt.includes("line-numbers"))){let Ut=et.target.position.lineNumber;if(G(ct.getLineContent(Ut),Ut))return;Lt(Ut)?fn(Ut):dn(Ut)}}),Me=et=>{let Je={range:new W.Range(et,1,et,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Jt.current=Be.deltaDecorations(Jt.current,[Je])},He=()=>{Jt.current=Be.deltaDecorations(Jt.current,[])},nt=Be.onMouseMove(et=>{var Je,Dt,Zt;if(He(),et.target.detail&&((Zt=(Dt=(Je=et.target)==null?void 0:Je.element)==null?void 0:Dt.className)!=null&&Zt.includes("line-numbers"))){let Ut=et.target.position.lineNumber;if(G(ct.getLineContent(Ut),Ut))return;Me(Ut)}}),Ye=Be.onMouseLeave(()=>{He()});return()=>{Et.dispose(),Oe.dispose(),nt.dispose(),Ye.dispose()}}},[ft.current,pt,Ze,Ot,ht,se]),(0,B.useEffect)(()=>{var Fe;(Fe=ft.current)!=null&&Fe.instance&&ht&&ft.current.instance.setPosition({lineNumber:0,column:0})},[Ot]);function re(){let Fe=ft.current.instance;if(Fe){const Be=Fe.getSelection(),ct=ft.current.pastePos||{},It=new W.Range(ct.startLineNumber||Be.endLineNumber,ct.startColumn||Be.endColumn,ct.endLineNumber||Be.endLineNumber,ct.endColumn||Be.endColumn);setTimeout(()=>{Fe.executeEdits("",[{range:It,text:""}])},300)}}function ye(Fe){(window.navigator.platform.match("Mac")?Fe.metaKey:Fe.ctrlKey)&&Fe.keyCode==83&&(Fe.preventDefault(),Ie())}const Ae=()=>{if(Ke&&ft.current.instance){const Fe=ft.current.instance.getContentHeight();qt(Fe<ne?ne:Fe)}else qt(ne)};function tt(Fe){var Be=document.createEvent("MouseEvents");Be.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Fe.dispatchEvent(Be)}const Qe=Fe=>{if(!Wt.current)return;const{keyCode:Be,ctrlKey:ct,metaKey:It,target:Pt,type:dn}=Fe;return(dn==="paste"||(Be===67||Be===86)&&(It||ct))&&Pt.nodeName==="TEXTAREA"&&(p(),Fe.preventDefault()),!1};function at(Fe,Be){var ct=window.URL||window.webkitURL||window,It=new Blob([Be]),Pt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Pt.href=ct.createObjectURL(It),Pt.download=Fe,tt(Pt)}(0,B.useEffect)(()=>{Ae()},[Ae]),(0,B.useEffect)(()=>{Ct.current&&!pt&&Promise.all([b.e(8909),b.e(3267)]).then(b.bind(b,71448)).then(Fe=>{try{W=Fe,ft.current.instance=W.editor.create(Ct.current,{value:F,language:ue(se),theme:Le,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},be);const Be=ft.current.instance;let Pt=[...R.BH._menuItems].find(Et=>Et[0]._debugName=="EditorContext")[1],dn=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],fn=(Et,Oe)=>{var Me,He;let nt=Et._first;do Oe.includes((He=(Me=nt.element)==null?void 0:Me.command)==null?void 0:He.id)&&Et._remove(nt);while(nt=nt.next)};if(vt(Be,W),setTimeout(()=>{Ae(),ft.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{at(Ht||"educoder.txt",Be.getValue())}})},500),ft.current.subscription=Be.onDidChangeModelContent(Et=>{ln.current?clearTimeout(an.current):(Ae(),Ce(Be.getValue(),Et)),an.current=setTimeout(()=>{ln.current=!1},500)}),window.Monaco||ie(W,ue(se)),je&&(fn(Pt,dn),Ct.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Qe),window.removeEventListener("paste",Qe),window.addEventListener("keydown",Qe),window.addEventListener("paste",Qe)),window.Monaco=W,Ne&&Be.onDidBlurEditorWidget(()=>{Ne(Be.getValue())}),st&&Be.onDidFocusEditorText(()=>{st(Be.getValue())}),je)try{Be.onDidPaste(Et=>{const Oe=Be.getSelection(),Me=ft.current.pastePos||{},He=new W.Range(Me.startLineNumber||Oe.endLineNumber,Me.startColumn||Oe.endColumn,Me.endLineNumber||Oe.endLineNumber,Me.endColumn||Oe.endColumn);Be.executeEdits("",[{range:Et.range,text:""}])})}catch(Et){}let Lt=c();return yt&&typeof yt=="string"&&new C(yt,Be,W),Xe(!0),()=>{const Et=ft.current.instance;Et.dispose();const Oe=Et.getModel();Oe&&Oe.dispose(),ft.current.subscription&&ft.current.subscription.dispose(),Lt.unobserve(Ct.current)}}catch(Be){}})},[]),(0,B.useEffect)(()=>{if(ft.current.instance&&pt)return document.addEventListener("keydown",ye,!1),()=>{document.removeEventListener("keydown",ye)}},[Ie,pt]),(0,B.useEffect)(()=>{let Fe=ft.current.instance;if(Fe&&pt){let Be=ue(se);W.editor.setModelLanguage(Fe.getModel(),Be)}},[se,pt]),(0,B.useEffect)(()=>{ft.current.instance&&pt&&W.editor.setTheme(Le)},[Le,pt]),(0,B.useEffect)(()=>{let Fe=ft.current.instance;Mt.current=ge,Fe&&pt&&(Fe.updateOptions(We({},ge)),setTimeout(()=>{Fe.getModel().updateOptions(We({},ge))},200))},[JSON.stringify(ge),pt]),(0,B.useEffect)(()=>{let Fe=ft.current.instance;Fe&&pt&&Fe.layout()},[P,ne,pt]);const[Ft,Vt]=(0,B.useState)(Rt(P)),[ot,qt]=(0,B.useState)(Rt(ne)),At=Tt(We({},de),{width:Ft,height:ot,position:"relative"});return B.createElement("div",{className:"my-monaco-editor",ref:Ct,style:At},ze&&B.createElement($.CopyToClipboard,{text:F,onCopy:()=>z.ZP.success("\u590D\u5236\u6210\u529F")},B.createElement(Y.Z,{title:"\u590D\u5236\u4EE3\u7801"},B.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},B.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function pe({width:k="100%",height:N="100%",original:P,modified:ne,language:F,options:se={}}){const de=(0,B.useRef)(),[ge,be]=(0,B.useState)(null);function Le(Ke){let je;return de.current&&(je=new q.Z(Ce=>{for(let vt of Ce)(vt.target.offsetHeight>0||vt.target.offsetWidth>0)&&Ke.layout()}),je.observe(de.current)),je}(0,B.useEffect)(()=>(de.current&&Promise.all([b.e(8909),b.e(9404)]).then(b.bind(b,2550)).then(Ke=>{W=Ke;const je=W.editor.createDiffEditor(de.current,Tt(We({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},se),{wordWrap:!0}));be(je);let Ce=Le(je);return()=>{je.dispose();const vt=je.getModel();vt&&vt.dispose(),Ce.unobserve(de.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,B.useEffect)(()=>{ge&&ge.setModel({original:W.editor.createModel(P,F),modified:W.editor.createModel(ne,F)})},[P,ne,F,ge]);const Ne=Rt(k),ze=Rt(N),Ie={width:Ne,height:ze};return B.createElement("div",{className:"my-diff-editor",ref:de,style:Ie})}},58856:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return q}});var B=b(59301);function q(ve,fe){const oe=(0,B.useRef)();(0,B.useEffect)(()=>{oe.current=ve}),(0,B.useEffect)(()=>{function Z(){oe.current()}if(fe!==null){let _e=setInterval(Z,fe);return()=>clearInterval(_e)}},[fe])}},64930:function(bt,ke,b){"use strict";b.r(ke),b.d(ke,{default:function(){return F},formatQuery:function(){return P}});var B=b(59301),q=b(89070),ve=b(71418),fe={bg:"bg___eq_Aq",container:"container___j770l",widthle:"widthle___ouh1T"},oe=b(24334),Z=b(71839),_e=b(43418),le=b(13570),o=b(78673),K=b(64165),D={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"},f=b(58856),u=b(75730),g=b(955),m=b(59301),I=Object.defineProperty,H=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,O=(se,de,ge)=>de in se?I(se,de,{enumerable:!0,configurable:!0,writable:!0,value:ge}):se[de]=ge,A=(se,de)=>{for(var ge in de||(de={}))L.call(de,ge)&&O(se,ge,de[ge]);if(H)for(var ge of H(de))w.call(de,ge)&&O(se,ge,de[ge]);return se},E=(se,de)=>{var ge={};for(var be in se)L.call(se,be)&&de.indexOf(be)<0&&(ge[be]=se[be]);if(se!=null&&H)for(var be of H(se))de.indexOf(be)<0&&w.call(se,be)&&(ge[be]=se[be]);return ge},Q=(se,de,ge)=>new Promise((be,Le)=>{var Ne=Ke=>{try{Ie(ge.next(Ke))}catch(je){Le(je)}},ze=Ke=>{try{Ie(ge.throw(Ke))}catch(je){Le(je)}},Ie=Ke=>Ke.done?be(Ke.value):Promise.resolve(Ke.value).then(Ne,ze);Ie((ge=ge.apply(se,de)).next())});const te=se=>{var de=se,{videoDetail:ge,globalSetting:be,loading:Le,dispatch:Ne}=de,ze=E(de,["videoDetail","globalSetting","loading","dispatch"]);const{queryParams:Ie,selectParams:Ke,videoList:je}=ge,{subject_id:Ce,videoId:vt}=Ie,{checkBoxValue:st,radioValue:St}=Ke,Ze={videoId:vt},Ht={query:Ie},Kt=(0,B.useRef)(),zt=(0,B.useRef)(),Ot=(0,B.useRef)(),ht=(0,B.useRef)(5),{video_item:yt}=ge.detail||{};(0,f.Z)(()=>Q(void 0,null,function*(){zt.current&&(console.log("videoRef lastUpdatedTime: ",Kt.current.getLastUpdatedTime()),console.log(Kt.current),yield ut())}),ht.current*1e3);const ut=(jt=!1)=>{const Wt=jt?{is_f:1}:{};return(0,u.DH)(A(A({},Wt),{id:Ze.videoId,point:Kt.current.getLastUpdatedTime(),total:Kt.current.getDuration()}))},Ct=jt=>(jt.ed==="1"&&(zt.current=!1,ut(!0)),!zt.current&&!jt.ed&&(zt.current=!0,ht.current=Kt.current.getDuration()<=5?1:5,ut()),Ne({type:"userDetail/logWatchHistory",payload:jt})),ft=()=>{zt.current=!1},Mt=()=>{zt.current=!0},Qt=()=>{Ot.current=5,_e.default.confirm({width:600,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BF7\u7ED9\u672C\u89C6\u9891\u8BC4\u5206",content:m.createElement("div",{className:"tc font14"},m.createElement(le.Z,{defaultValue:Ot.current,onChange:jt=>Ot.current=jt,className:D.modalRating})),onOk:()=>Q(void 0,null,function*(){if((yield(0,u.jK)({id:Ze.videoId,star:Ot.current})).status===0){const{course_id:Wt}=(0,g.oP)();Ne({type:"videoDetail/getVideoDetail",payload:{id:Ze.videoId,videoId:Ze.videoId,course_id:Wt,subject_id:Ce}})}})})},Jt=jt=>{const Wt=window.filterVideoSign,pt=Wt.findIndex(re=>re.id===vt);if(pt===Wt.length-1)return;const c=Wt[pt+1].id,p=Wt[pt+1].can_view,x=Wt[pt+1].link,G=Wt[pt+1].is_public;if(window.checkBoxValue){if(x){window.open(x);return}if(!p){_e.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:m.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(!G){_e.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:m.createElement("div",{className:"tc font14"},"\u4E0B\u4E00\u6761\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}Ne({type:"videoDetail/handleListItemClick",payload:{videoId:c}}),window.videoTimer=setTimeout(()=>{jt.current.play()},2e3)}},ln=(jt,Wt)=>{if(jt==="checkBox"){const pt=Wt;window.checkBoxValue=pt,Ne({type:"videoDetail/setSelectValue",payload:{radioValue:St,checkBoxValue:pt}});return}Ne({type:"videoDetail/setSelectValue",payload:{checkBoxValue:st,radioValue:Wt.target.value}})},an=()=>je.findIndex(pt=>pt.id===vt)===je.length-1?m.createElement("div",null,"\u5F53\u524D\u5DF2\u662F\u6700\u540E\u4E00\u4E2A\u89C6\u9891"):m.createElement("div",null,m.createElement(o.Z,{onChange:pt=>{ln("checkBox",pt)},defaultChecked:st,size:"small"}),m.createElement("span",{className:D.zdbf},"\u81EA\u52A8\u64AD\u653E\u4E0B\u4E00\u4E2A\u89C6\u9891"));return m.createElement("aside",{className:D.contentWrap},m.createElement("aside",{className:D.wrap},m.createElement("header",null),m.createElement("div",{className:D.title},yt==null?void 0:yt.name),!(yt!=null&&yt.can_edit)&&!(yt!=null&&yt.is_public)?m.createElement(K.Z,{description:"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85"}):m.createElement(Z.Z,{ref:Kt,startTime:yt==null?void 0:yt.last_point,src:yt!=null&&yt.is_link?yt==null?void 0:yt.link:(yt==null?void 0:yt.play_url)&&oe.Base64.decode(yt==null?void 0:yt.play_url),videoId:yt==null?void 0:yt.video_id,logWatchHistory:Ct,handlePause:ft,handlePlay:Mt,allow_skip:yt==null?void 0:yt.allow_skip,handlePlayEnded:Jt,toLog:()=>{}}),m.createElement("div",{className:D.footer},m.createElement("div",{className:D.footer_left},m.createElement("div",{className:D.pingfen},"\u8BC4\u5206"),m.createElement(le.Z,{value:yt==null?void 0:yt.star,disabled:!0,className:D.rating,style:{color:"#FFA100",fontSize:12,marginLeft:10}}),m.createElement("div",{className:D.fenshu},(yt==null?void 0:yt.star)||0,"\u5206")),!(yt!=null&&yt.can_edit)&&!(yt!=null&&yt.is_public)?null:m.createElement("div",null,m.createElement("div",{className:D.checkBox},an()))),m.createElement("div",{className:"mt10"},(yt==null?void 0:yt.description)&&m.createElement("span",{className:D.introName},"\u7B80\u4ECB\uFF1A",yt.description))))};var ie=(0,q.connect)(({videoDetail:se,loading:de,globalSetting:ge})=>({videoDetail:se,globalSetting:ge,loading:de}))(te),Ee=b(8591),we=b(17574),xe={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"},he=b(94941),V=b(49692),T=b(3294),C=b(59301),R=Object.defineProperty,z=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,y=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable,j=(se,de,ge)=>de in se?R(se,de,{enumerable:!0,configurable:!0,writable:!0,value:ge}):se[de]=ge,me=(se,de)=>{for(var ge in de||(de={}))v.call(de,ge)&&j(se,ge,de[ge]);if(y)for(var ge of y(de))$.call(de,ge)&&j(se,ge,de[ge]);return se},Se=(se,de)=>z(se,Y(de)),Te=(se,de)=>{var ge={};for(var be in se)v.call(se,be)&&de.indexOf(be)<0&&(ge[be]=se[be]);if(se!=null&&y)for(var be of y(se))de.indexOf(be)<0&&$.call(se,be)&&(ge[be]=se[be]);return ge},De=(se,de,ge)=>new Promise((be,Le)=>{var Ne=Ke=>{try{Ie(ge.next(Ke))}catch(je){Le(je)}},ze=Ke=>{try{Ie(ge.throw(Ke))}catch(je){Le(je)}},Ie=Ke=>Ke.done?be(Ke.value):Promise.resolve(Ke.value).then(Ne,ze);Ie((ge=ge.apply(se,de)).next())});const qe=[{name:"\u5B9E\u8DF5\u9879\u76EE",type:"Shixun",icon:C.createElement("i",{className:"iconfont icon-shixun2 font20"}),bq:C.createElement("span",{style:{border:"1px solid #FF9D18",color:"#FF9D18"},className:xe.s1},"\u5B9E\u8BAD")},{name:"\u89C6\u9891\u9879\u76EE",type:"VideoItem",icon:C.createElement("i",{className:"iconfont icon-shipin font20"}),bq:C.createElement("span",{style:{border:"1px solid #9B18FF",color:"#9B18FF"},className:xe.s1},"\u89C6\u9891")},{name:"\u6559\u5B66\u8BFE\u4EF6",type:"Attachment",icon:C.createElement("i",{className:"iconfont icon-jiaoxueanli font20"}),bq:C.createElement("span",{style:{border:"1px solid #3061D0",color:"#3061D0"},className:xe.s1},"\u8D44\u6599")},{name:"\u7A7A\u76EE\u5F55",type:"StageCatalog",icon:C.createElement("i",{className:"iconfont icon-kongbai font20"}),bq:C.createElement("span",null)}],lt=se=>{var de=se,{dispatch:ge,pathsDetail:be,videoDetail:Le,user:Ne}=de,ze=Te(de,["dispatch","pathsDetail","videoDetail","user"]);const{queryParams:Ie,stages:Ke,cust_seq:je,active:Ce}=Le,{subject_id:vt,course_id:st}=Ie,St=(0,q.useParams)(),[Ze]=(0,q.useSearchParams)(),[Ht,Kt]=(0,B.useState)([]),[zt,Ot]=(0,B.useState)([(Ce==null?void 0:Ce.id)||Number(St.videoId)]),[ht,yt]=(0,B.useState)("\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55"),ut=[".PDF",".DOC",".DOCX",".XLS",".XLSX",".PPT",".PPTX"];(0,B.useEffect)(()=>{ge(vt?{type:"videoDetail/getStageData",payload:{subject_id:vt,page_type:"video"}}:{type:"videoDetail/getCourseStageData",payload:{coursesId:st}})},[]),(0,B.useEffect)(()=>{Ct()},[Le==null?void 0:Le.stages]);const Ct=()=>{let pt=Ht;Ke.forEach((Xe,c)=>{pt.push({title:C.createElement("div",{title:Xe.stage_name,className:xe.title},Xe.stage_name),value:Xe==null?void 0:Xe.stage_id,key:Xe==null?void 0:Xe.stage_id,icon:C.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:ft(Xe.items||[])})}),Kt(pt)},ft=pt=>{function Xe(c){var p;const x=c.children,G=Array.isArray(x)&&x.length>0,re=c==null?void 0:c.id,{name:ye,item_type:Ae,id:tt}=c,Qe=(p=qe.find(Vt=>Vt.type===Ae))==null?void 0:p.bq,at=xe.brght,Ft=Ce.id===tt?`${at} ${xe.active}`:at;return{title:C.createElement("div",{onClick:()=>ln(c),className:at,title:ye},Qe,C.createElement("div",{className:xe.s3},ye)),value:re,key:re,icon:C.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:G?x==null?void 0:x.map(Vt=>Xe(Vt)):[]}}return pt==null?void 0:pt.map(c=>Xe(c))},Mt=(pt,Xe)=>De(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 c=Xe?yield(0,V.BK)({id:pt}):yield(0,V.Ir)({id:pt});if(ge({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),c!=null&&c.game_identifier||c!=null&&c.identifier){(0,g.xg)(Xe?`/tasks/${c==null?void 0:c.identifier}/jupyter`:`/tasks/${c.game_identifier}`);return}(c==null?void 0:c.status)===2?Jt(c==null?void 0:c.message):(c==null?void 0:c.status)===3&&Qt(c==null?void 0:c.message)}),Qt=pt=>{_e.default.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:C.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",pt,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},Jt=pt=>{pt=pt!=null&&pt.includes(".json")?pt:`${pt}.json`,_e.default.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:C.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:()=>De(void 0,null,function*(){const Xe=yield(0,he.L8)({url:pt});if(!Xe)return;Ee.ZP.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF01");const c=yield(0,V.Ir)({id:Xe.shixun_identifier});if(c!=null&&c.game_identifier){(0,g.xg)(`/tasks/${c.game_identifier}`);return}(c==null?void 0:c.status)===2?Jt(c==null?void 0:c.message):(c==null?void 0:c.status)===3&&Qt(c==null?void 0:c.message)})})},ln=pt=>{var Xe,c,p,x,G;if((pt==null?void 0:pt.item_type)==="StageCatalog")return;clearTimeout(window.videoTimer);const{id:re,item_type:ye,identifier:Ae,is_jupyter:tt,url:Qe,link:at}=pt;if(ye==="VideoItem"&&!at){if(!((Xe=Ne.userInfo)!=null&&Xe.admin)&&!((c=Ne.userInfo)!=null&&c.business)&&!pt.can_view){_e.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:C.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:re}}),ge({type:"videoDetail/getVideoDetail",payload:Se(me({id:re},Ie),{videoId:re}),callback:Ft=>{if(Ft&&Ft.video_item&&!Ft.video_item.can_edit&&!pt.is_public){_e.default.info({centered:!0,width:400,okText:"\u77E5\u9053\u5566",icon:null,content:C.createElement("div",{className:"tc font14"},"\u5F53\u524D\u89C6\u9891\u6682\u672A\u516C\u5F00\uFF0C\u656C\u8BF7\u671F\u5F85")});return}}});return}if(ye==="VideoItem"&&at){pt.link&&(0,u.DH)({is_f:1,id:pt.id,point:0,total:0}),window.open(at);return}if(ye==="Shixun"){Mt(Ae,tt);return}if(ye==="Attachment"){if(at){(0,g.xg)(at);return}let Ft=(x=pt==null?void 0:pt.name)==null?void 0:x.substr((p=pt==null?void 0:pt.name)==null?void 0:p.lastIndexOf("."));if(ut.includes(Ft.toUpperCase())){ge({type:"videoDetail/handleListItemClick",payload:{attachmentId:re}});return}else{if(!((G=be.detail)!=null&&G.allow_download)){Ee.ZP.info("\u6559\u5B66\u8BFE\u4EF6\u4E0D\u652F\u6301\u4E0B\u8F7D");return}(0,g.FH)(pt.name,T.Z.API_SERVER+pt.url);return}}window.open(T.Z.IMG_SERVER+Qe)},an=pt=>{let Xe=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],c=["","\u5341","\u767E","\u5343","\u4E07"];pt=parseInt(pt);let p=re=>{let ye=re.toString().split("").reverse(),Ae="";for(var tt=0;tt<ye.length;tt++)Ae=(tt==0&&ye[tt]==0||tt>0&&ye[tt]==0&&ye[tt-1]==0?"":Xe[ye[tt]]+(ye[tt]==0?c[0]:c[tt]))+Ae;return Ae},x=Math.floor(pt/1e4),G=pt%1e4;return G.toString().length<4&&(G="0"+G),x?p(x)+"\u4E07"+p(G):p(pt)},jt=(pt,Xe,c,p)=>{var x;const{name:G,item_type:re,id:ye}=pt,Ae=`${Xe+1}-${c+1}-${p+1}`,tt=(x=qe.find(Ft=>Ft.type===re))==null?void 0:x.icon,Qe=xe.brght,at=Ce.id===ye?`${Qe} ${xe.active}`:Qe;return C.createElement("div",{key:Ae,onClick:()=>ln(pt),className:at,style:{paddingLeft:52}},C.createElement("span",{className:xe.s1},tt),!!je&&C.createElement("span",{className:xe.s2},Ae),C.createElement("span",{className:xe.s3},"\u203B ",G))},Wt=(pt,Xe,c)=>{var p;const{name:x,item_type:G,id:re,children:ye}=pt,Ae=`${Xe+1}-${c+1}`,tt=(p=qe.find(Ft=>Ft.type===G))==null?void 0:p.icon,Qe=xe.brght,at=Ce.id===re?`${Qe} ${xe.active}`:Qe;return C.createElement(B.Fragment,{key:Ae},C.createElement("div",{onClick:()=>ln(pt),className:at},C.createElement("span",{className:xe.s1},tt),!!je&&C.createElement("span",{className:xe.s2},Ae),C.createElement("span",{className:xe.s3},"\u203B ",x)),!!ye.length&&ye.map((Ft,Vt)=>jt(Ft,Xe,c,Vt)))};return C.createElement("aside",{className:xe.list},C.createElement("div",{className:xe.tabs_style},C.createElement("div",{className:xe.tabs_item,onClick:()=>{yt("\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55")}},"\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55",ht=="\u8BFE\u7A0B\u8D44\u6E90\u76EE\u5F55"&&C.createElement("div",{className:xe.tabs_item_active}))),C.createElement("div",{className:xe.tree_style},(Ht==null?void 0:Ht.length)>0&&C.createElement(we.default,{selectedKeys:zt,onSelect:(pt,Xe)=>{Ot([...pt])},blockNode:!0,treeData:Ht,defaultExpandAll:!0,className:xe.tree_line})))};var We=(0,q.connect)(({user:se,videoDetail:de,loading:ge,globalSetting:be,pathsDetail:Le})=>({user:se,videoDetail:de,globalSetting:be,loading:ge,pathsDetail:Le}))(lt),Tt=b(23210),dt=b(59301),wt=Object.defineProperty,Rt=Object.defineProperties,_t=Object.getOwnPropertyDescriptors,Pe=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,W=(se,de,ge)=>de in se?wt(se,de,{enumerable:!0,configurable:!0,writable:!0,value:ge}):se[de]=ge,M=(se,de)=>{for(var ge in de||(de={}))J.call(de,ge)&&W(se,ge,de[ge]);if(Pe)for(var ge of Pe(de))ue.call(de,ge)&&W(se,ge,de[ge]);return se},pe=(se,de)=>Rt(se,_t(de)),k=(se,de)=>{var ge={};for(var be in se)J.call(se,be)&&de.indexOf(be)<0&&(ge[be]=se[be]);if(se!=null&&Pe)for(var be of Pe(se))de.indexOf(be)<0&&ue.call(se,be)&&(ge[be]=se[be]);return ge},N=(se,de,ge)=>new Promise((be,Le)=>{var Ne=Ke=>{try{Ie(ge.next(Ke))}catch(je){Le(je)}},ze=Ke=>{try{Ie(ge.throw(Ke))}catch(je){Le(je)}},Ie=Ke=>Ke.done?be(Ke.value):Promise.resolve(Ke.value).then(Ne,ze);Ie((ge=ge.apply(se,de)).next())});const P=se=>{const{subject_id:de}=se;return{subject_id:de,course_id:de}},ne=se=>{var de=se,{videoDetail:ge,globalSetting:be,loading:Le,pathsDetail:Ne,dispatch:ze}=de,Ie=k(de,["videoDetail","globalSetting","loading","pathsDetail","dispatch"]),Ke,je;const{queryParams:Ce,videoList:vt,attachmentList:st,active:St}=ge,{subject_id:Ze,videoId:Ht}=Ce,Kt={videoId:Ht};(0,B.useEffect)(()=>{if(St){const{item_type:ht,id:yt}=St;ht==="VideoItem"&&ze({type:"videoDetail/getVideoDetail",payload:pe(M({},Ce),{id:yt})})}},[St.id]),console.log("---",St),(0,B.useEffect)(()=>{Ze&&zt()},[]);function zt(){return N(this,null,function*(){const ht=yield ze({type:"pathsDetail/getPathsDetail",payload:{id:Ze}})})}(0,B.useEffect)(()=>{var ht,yt;(0,g.Dk)((yt=(ht=ge.detail)==null?void 0:ht.video_item)==null?void 0:yt.name)},[ge]);let Ot={width:1200};return St&&St.item_type==="Attachment"&&St.content_type==="application/pdf"&&(Ot={width:1250,marginLeft:(document.body.clientWidth-1200)/2}),dt.createElement(ve.Z,{spinning:!1},dt.createElement("section",{className:fe.bg},dt.createElement("div",{className:fe.container,style:Ot},dt.createElement(We,null),St&&St.item_type==="VideoItem"&&dt.createElement(ie,null),St&&St.item_type==="Attachment"&&St.content_type==="application/pdf"&&St.url&&dt.createElement("div",{className:fe.widthle},dt.createElement(Tt.Z,{disabledDownload:!((Ke=Ne.detail)!=null&&Ke.allow_download),type:"pdf",filename:St.name,data:T.Z.API_SERVER+St.url,style:{position:"absolute",zIndex:1}})),St&&St.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(St.content_type)&&St.url&&dt.createElement("div",{className:fe.widthle},dt.createElement(Tt.Z,{disabledDownload:!((je=Ne.detail)!=null&&je.allow_download),type:"office",data:T.Z.API_SERVER+St.url,style:{position:"absolute",zIndex:1}})))))};var F=(0,q.connect)(({videoDetail:se,loading:de,globalSetting:ge,pathsDetail:be})=>({videoDetail:se,globalSetting:ge,loading:de,pathsDetail:be}))(ne)},4901:function(bt,ke,b){"use strict";b.d(ke,{BU:function(){return q},Dj:function(){return B},gH:function(){return ve},vp:function(){return fe}});function B(oe){try{oe.mozRequestFullScreen?oe.mozRequestFullScreen():oe.webkitRequestFullScreen&&oe.webkitRequestFullScreen()}catch(Z){console.log(Z,":e")}}function q(){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 ve=()=>{if(document.webkitExitFullscreen)return"webkitfullscreenchange";if(document.exitFullscreen)return"fullscreenchange";if(document.msExitFullscreen)return"msfullscreenchange";if(document.mozCancelFullScreen)return"mozfullscreenchange"};function fe(){var oe=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement,Z=document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",oe),window.isFullScreen?window.isFullScreen:oe!=null}},29382:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return pt}});class B{static install(){Object.setPrototypeOf=Object.setPrototypeOf||function(c,p){return c.__proto__=p,c},Object.assign=Object.assign||function(c){if(c==null)throw new TypeError("Cannot convert undefined or null to object");let p=Object(c);for(let x=1;x<arguments.length;x++){let G=arguments[x];if(G!=null)for(let re in G)G.hasOwnProperty(re)&&(p[re]=G[re])}return p},typeof self.Promise!="function"&&b(3867).polyfill()}}B.install();var q=B,ve=b(86204),fe=b.n(ve);class oe{static e(c,p){(!c||oe.FORCE_GLOBAL_TAG)&&(c=oe.GLOBAL_TAG);let x=`[${c}] > ${p}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","error",x),oe.ENABLE_ERROR&&(console.error?console.error(x):console.warn?console.warn(x):console.log(x))}static i(c,p){(!c||oe.FORCE_GLOBAL_TAG)&&(c=oe.GLOBAL_TAG);let x=`[${c}] > ${p}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","info",x),oe.ENABLE_INFO&&(console.info?console.info(x):console.log(x))}static w(c,p){(!c||oe.FORCE_GLOBAL_TAG)&&(c=oe.GLOBAL_TAG);let x=`[${c}] > ${p}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","warn",x),oe.ENABLE_WARN&&(console.warn?console.warn(x):console.log(x))}static d(c,p){(!c||oe.FORCE_GLOBAL_TAG)&&(c=oe.GLOBAL_TAG);let x=`[${c}] > ${p}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","debug",x),oe.ENABLE_DEBUG&&(console.debug?console.debug(x):console.log(x))}static v(c,p){(!c||oe.FORCE_GLOBAL_TAG)&&(c=oe.GLOBAL_TAG);let x=`[${c}] > ${p}`;oe.ENABLE_CALLBACK&&oe.emitter.emit("log","verbose",x),oe.ENABLE_VERBOSE&&console.log(x)}}oe.GLOBAL_TAG="flv.js",oe.FORCE_GLOBAL_TAG=!1,oe.ENABLE_ERROR=!0,oe.ENABLE_INFO=!0,oe.ENABLE_WARN=!0,oe.ENABLE_DEBUG=!0,oe.ENABLE_VERBOSE=!0,oe.ENABLE_CALLBACK=!1,oe.emitter=new(fe());var Z=oe;class _e{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(c){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=c,this._totalBytes+=c):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=c,this._totalBytes+=c):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=c,this._totalBytes+=c,this._lastCheckpoint=this._now())}get currentKBps(){this.addBytes(0);let c=(this._now()-this._lastCheckpoint)/1e3;return c==0&&(c=1),this._intervalBytes/c/1024}get lastSecondKBps(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}get averageKBps(){let c=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/c/1024}}var le=_e;class o{constructor(c){this._message=c}get name(){return"RuntimeException"}get message(){return this._message}toString(){return this.name+": "+this.message}}class K extends o{constructor(c){super(c)}get name(){return"IllegalStateException"}}class D extends o{constructor(c){super(c)}get name(){return"InvalidArgumentException"}}class f extends o{constructor(c){super(c)}get name(){return"NotImplementedException"}}const u={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},g={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"};class m{constructor(c){this._type=c||"undefined",this._status=u.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}destroy(){this._status=u.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}isWorking(){return this._status===u.kConnecting||this._status===u.kBuffering}get type(){return this._type}get status(){return this._status}get needStashBuffer(){return this._needStash}get onContentLengthKnown(){return this._onContentLengthKnown}set onContentLengthKnown(c){this._onContentLengthKnown=c}get onURLRedirect(){return this._onURLRedirect}set onURLRedirect(c){this._onURLRedirect=c}get onDataArrival(){return this._onDataArrival}set onDataArrival(c){this._onDataArrival=c}get onError(){return this._onError}set onError(c){this._onError=c}get onComplete(){return this._onComplete}set onComplete(c){this._onComplete=c}open(c,p){throw new f("Unimplemented abstract function!")}abort(){throw new f("Unimplemented abstract function!")}}let I={};function H(){let Xe=self.navigator.userAgent.toLowerCase(),c=/(edge)\/([\w.]+)/.exec(Xe)||/(opr)[\/]([\w.]+)/.exec(Xe)||/(chrome)[ \/]([\w.]+)/.exec(Xe)||/(iemobile)[\/]([\w.]+)/.exec(Xe)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Xe)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(Xe)||/(webkit)[ \/]([\w.]+)/.exec(Xe)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(Xe)||/(msie) ([\w.]+)/.exec(Xe)||Xe.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(Xe)||Xe.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(Xe)||[],p=/(ipad)/.exec(Xe)||/(ipod)/.exec(Xe)||/(windows phone)/.exec(Xe)||/(iphone)/.exec(Xe)||/(kindle)/.exec(Xe)||/(android)/.exec(Xe)||/(windows)/.exec(Xe)||/(mac)/.exec(Xe)||/(linux)/.exec(Xe)||/(cros)/.exec(Xe)||[],x={browser:c[5]||c[3]||c[1]||"",version:c[2]||c[4]||"0",majorVersion:c[4]||c[2]||"0",platform:p[0]||""},G={};if(x.browser){G[x.browser]=!0;let re=x.majorVersion.split(".");G.version={major:parseInt(x.majorVersion,10),string:x.version},re.length>1&&(G.version.minor=parseInt(re[1],10)),re.length>2&&(G.version.build=parseInt(re[2],10))}if(x.platform&&(G[x.platform]=!0),(G.chrome||G.opr||G.safari)&&(G.webkit=!0),G.rv||G.iemobile){G.rv&&delete G.rv;let re="msie";x.browser=re,G[re]=!0}if(G.edge){delete G.edge;let re="msedge";x.browser=re,G[re]=!0}if(G.opr){let re="opera";x.browser=re,G[re]=!0}if(G.safari&&G.android){let re="android";x.browser=re,G[re]=!0}G.name=x.browser,G.platform=x.platform;for(let re in I)I.hasOwnProperty(re)&&delete I[re];Object.assign(I,G)}H();var L=I;class w extends m{static isSupported(){try{let c=L.msedge&&L.version.minor>=15048,p=L.msedge?c:!0;return self.fetch&&self.ReadableStream&&p}catch(c){return!1}}constructor(c,p){super("fetch-stream-loader"),this.TAG="FetchStreamLoader",this._seekHandler=c,this._config=p,this._needStash=!0,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),super.destroy()}open(c,p){this._dataSource=c,this._range=p;let x=c.url;this._config.reuseRedirectedURL&&c.redirectedURL!=null&&(x=c.redirectedURL);let G=this._seekHandler.getConfig(x,p),re=new self.Headers;if(typeof G.headers=="object"){let Ae=G.headers;for(let tt in Ae)Ae.hasOwnProperty(tt)&&re.append(tt,Ae[tt])}let ye={method:"GET",headers:re,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(let Ae in this._config.headers)re.append(Ae,this._config.headers[Ae]);c.cors===!1&&(ye.mode="same-origin"),c.withCredentials&&(ye.credentials="include"),c.referrerPolicy&&(ye.referrerPolicy=c.referrerPolicy),this._status=u.kConnecting,self.fetch(G.url,ye).then(Ae=>{if(this._requestAbort){this._requestAbort=!1,this._status=u.kIdle;return}if(Ae.ok&&Ae.status>=200&&Ae.status<=299){if(Ae.url!==G.url&&this._onURLRedirect){let Qe=this._seekHandler.removeURLParameters(Ae.url);this._onURLRedirect(Qe)}let tt=Ae.headers.get("Content-Length");return tt!=null&&(this._contentLength=parseInt(tt),this._contentLength!==0&&this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)),this._pump.call(this,Ae.body.getReader())}else if(this._status=u.kError,this._onError)this._onError(g.HTTP_STATUS_CODE_INVALID,{code:Ae.status,msg:Ae.statusText});else throw new o("FetchStreamLoader: Http code invalid, "+Ae.status+" "+Ae.statusText)}).catch(Ae=>{if(this._status=u.kError,this._onError)this._onError(g.EXCEPTION,{code:-1,msg:Ae.message});else throw Ae})}abort(){this._requestAbort=!0}_pump(c){return c.read().then(p=>{if(p.done)if(this._contentLength!==null&&this._receivedLength<this._contentLength){this._status=u.kError;let x=g.EARLY_EOF,G={code:-1,msg:"Fetch stream meet Early-EOF"};if(this._onError)this._onError(x,G);else throw new o(G.msg)}else this._status=u.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=u.kComplete,c.cancel();this._status=u.kBuffering;let x=p.value.buffer,G=this._range.from+this._receivedLength;this._receivedLength+=x.byteLength,this._onDataArrival&&this._onDataArrival(x,G,this._receivedLength),this._pump(c)}}).catch(p=>{if(p.code===11&&L.msedge)return;this._status=u.kError;let x=0,G=null;if((p.code===19||p.message==="network error")&&(this._contentLength===null||this._contentLength!==null&&this._receivedLength<this._contentLength)?(x=g.EARLY_EOF,G={code:p.code,msg:"Fetch stream meet Early-EOF"}):(x=g.EXCEPTION,G={code:p.code,msg:p.message}),this._onError)this._onError(x,G);else throw new o(G.msg)})}}var O=w;class A extends m{static isSupported(){try{let c=new XMLHttpRequest;return c.open("GET","https://example.com",!0),c.responseType="moz-chunked-arraybuffer",c.responseType==="moz-chunked-arraybuffer"}catch(c){return Z.w("MozChunkedLoader",c.message),!1}}constructor(c,p){super("xhr-moz-chunked-loader"),this.TAG="MozChunkedLoader",this._seekHandler=c,this._config=p,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(c,p){this._dataSource=c,this._range=p;let x=c.url;this._config.reuseRedirectedURL&&c.redirectedURL!=null&&(x=c.redirectedURL);let G=this._seekHandler.getConfig(x,p);this._requestURL=G.url;let re=this._xhr=new XMLHttpRequest;if(re.open("GET",G.url,!0),re.responseType="moz-chunked-arraybuffer",re.onreadystatechange=this._onReadyStateChange.bind(this),re.onprogress=this._onProgress.bind(this),re.onloadend=this._onLoadEnd.bind(this),re.onerror=this._onXhrError.bind(this),c.withCredentials&&(re.withCredentials=!0),typeof G.headers=="object"){let ye=G.headers;for(let Ae in ye)ye.hasOwnProperty(Ae)&&re.setRequestHeader(Ae,ye[Ae])}if(typeof this._config.headers=="object"){let ye=this._config.headers;for(let Ae in ye)ye.hasOwnProperty(Ae)&&re.setRequestHeader(Ae,ye[Ae])}this._status=u.kConnecting,re.send()}abort(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=u.kComplete}_onReadyStateChange(c){let p=c.target;if(p.readyState===2){if(p.responseURL!=null&&p.responseURL!==this._requestURL&&this._onURLRedirect){let x=this._seekHandler.removeURLParameters(p.responseURL);this._onURLRedirect(x)}if(p.status!==0&&(p.status<200||p.status>299))if(this._status=u.kError,this._onError)this._onError(g.HTTP_STATUS_CODE_INVALID,{code:p.status,msg:p.statusText});else throw new o("MozChunkedLoader: Http code invalid, "+p.status+" "+p.statusText);else this._status=u.kBuffering}}_onProgress(c){if(this._status===u.kError)return;this._contentLength===null&&c.total!==null&&c.total!==0&&(this._contentLength=c.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));let p=c.target.response,x=this._range.from+this._receivedLength;this._receivedLength+=p.byteLength,this._onDataArrival&&this._onDataArrival(p,x,this._receivedLength)}_onLoadEnd(c){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===u.kError)return;this._status=u.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}_onXhrError(c){this._status=u.kError;let p=0,x=null;if(this._contentLength&&c.loaded<this._contentLength?(p=g.EARLY_EOF,x={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(p=g.EXCEPTION,x={code:-1,msg:c.constructor.name+" "+c.type}),this._onError)this._onError(p,x);else throw new o(x.msg)}}var E=A;class Q extends null{static isSupported(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;let c=new XMLHttpRequest;return c.open("GET","https://example.com",!0),c.responseType="ms-stream",c.responseType==="ms-stream"}catch(c){return Log.w("MSStreamLoader",c.message),!1}}constructor(c,p){super("xhr-msstream-loader"),this.TAG="MSStreamLoader",this._seekHandler=c,this._config=p,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(c,p){this._internalOpen(c,p,!1)}_internalOpen(c,p,x){this._dataSource=c,x?this._currentRange=p:this._totalRange=p;let G=c.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?G=this._currentRedirectedURL:c.redirectedURL!=null&&(G=c.redirectedURL));let re=this._seekHandler.getConfig(G,p);this._currentRequestURL=re.url;let ye=this._reader=new self.MSStreamReader;ye.onprogress=this._msrOnProgress.bind(this),ye.onload=this._msrOnLoad.bind(this),ye.onerror=this._msrOnError.bind(this);let Ae=this._xhr=new XMLHttpRequest;if(Ae.open("GET",re.url,!0),Ae.responseType="ms-stream",Ae.onreadystatechange=this._xhrOnReadyStateChange.bind(this),Ae.onerror=this._xhrOnError.bind(this),c.withCredentials&&(Ae.withCredentials=!0),typeof re.headers=="object"){let tt=re.headers;for(let Qe in tt)tt.hasOwnProperty(Qe)&&Ae.setRequestHeader(Qe,tt[Qe])}if(typeof this._config.headers=="object"){let tt=this._config.headers;for(let Qe in tt)tt.hasOwnProperty(Qe)&&Ae.setRequestHeader(Qe,tt[Qe])}this._isReconnecting?this._isReconnecting=!1:this._status=LoaderStatus.kConnecting,Ae.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(c){let p=c.target;if(p.readyState===2)if(p.status>=200&&p.status<=299){if(this._status=LoaderStatus.kBuffering,p.responseURL!=null){let G=this._seekHandler.removeURLParameters(p.responseURL);p.responseURL!==this._currentRequestURL&&G!==this._currentRedirectedURL&&(this._currentRedirectedURL=G,this._onURLRedirect&&this._onURLRedirect(G))}let x=p.getResponseHeader("Content-Length");if(x!=null&&this._contentLength==null){let G=parseInt(x);G>0&&(this._contentLength=G,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=LoaderStatus.kError,this._onError)this._onError(LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:p.status,msg:p.statusText});else throw new RuntimeException("MSStreamLoader: Http code invalid, "+p.status+" "+p.statusText);else if(p.readyState===3&&p.status>=200&&p.status<=299){this._status=LoaderStatus.kBuffering;let x=p.response;this._reader.readAsArrayBuffer(x)}}_xhrOnError(c){this._status=LoaderStatus.kError;let p=LoaderErrors.EXCEPTION,x={code:-1,msg:c.constructor.name+" "+c.type};if(this._onError)this._onError(p,x);else throw new RuntimeException(x.msg)}_msrOnProgress(c){let x=c.target.result;if(x==null){this._doReconnectIfNeeded();return}let G=x.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=x.byteLength;let re=this._totalRange.from+this._receivedLength;this._receivedLength+=G.byteLength,this._onDataArrival&&this._onDataArrival(G,re,this._receivedLength),x.byteLength>=this._bufferLimit&&(Log.v(this.TAG,`MSStream buffer exceeded max size near ${re+G.byteLength}, reconnecting...`),this._doReconnectIfNeeded())}_doReconnectIfNeeded(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();let c={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,c,!0)}}_msrOnLoad(c){this._status=LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}_msrOnError(c){this._status=LoaderStatus.kError;let p=0,x=null;if(this._contentLength&&this._receivedLength<this._contentLength?(p=LoaderErrors.EARLY_EOF,x={code:-1,msg:"MSStream meet Early-Eof"}):(p=LoaderErrors.EARLY_EOF,x={code:-1,msg:c.constructor.name+" "+c.type}),this._onError)this._onError(p,x);else throw new RuntimeException(x.msg)}}var te=null;class ie extends m{static isSupported(){try{let c=new XMLHttpRequest;return c.open("GET","https://example.com",!0),c.responseType="arraybuffer",c.responseType==="arraybuffer"}catch(c){return Z.w("RangeLoader",c.message),!1}}constructor(c,p){super("xhr-range-loader"),this.TAG="RangeLoader",this._seekHandler=c,this._config=p,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 le,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(c,p){this._dataSource=c,this._range=p,this._status=u.kConnecting;let x=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(x=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!x?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}_openSubRange(){let c=this._currentChunkSizeKB*1024,p=this._range.from+this._receivedLength,x=p+c;this._contentLength!=null&&x-this._range.from>=this._contentLength&&(x=this._range.from+this._contentLength-1),this._currentRequestRange={from:p,to:x},this._internalOpen(this._dataSource,this._currentRequestRange)}_internalOpen(c,p){this._lastTimeLoaded=0;let x=c.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?x=this._currentRedirectedURL:c.redirectedURL!=null&&(x=c.redirectedURL));let G=this._seekHandler.getConfig(x,p);this._currentRequestURL=G.url;let re=this._xhr=new XMLHttpRequest;if(re.open("GET",G.url,!0),re.responseType="arraybuffer",re.onreadystatechange=this._onReadyStateChange.bind(this),re.onprogress=this._onProgress.bind(this),re.onload=this._onLoad.bind(this),re.onerror=this._onXhrError.bind(this),c.withCredentials&&(re.withCredentials=!0),typeof G.headers=="object"){let ye=G.headers;for(let Ae in ye)ye.hasOwnProperty(Ae)&&re.setRequestHeader(Ae,ye[Ae])}if(typeof this._config.headers=="object"){let ye=this._config.headers;for(let Ae in ye)ye.hasOwnProperty(Ae)&&re.setRequestHeader(Ae,ye[Ae])}re.send()}abort(){this._requestAbort=!0,this._internalAbort(),this._status=u.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(c){let p=c.target;if(p.readyState===2){if(p.responseURL!=null){let x=this._seekHandler.removeURLParameters(p.responseURL);p.responseURL!==this._currentRequestURL&&x!==this._currentRedirectedURL&&(this._currentRedirectedURL=x,this._onURLRedirect&&this._onURLRedirect(x))}if(p.status>=200&&p.status<=299){if(this._waitForTotalLength)return;this._status=u.kBuffering}else if(this._status=u.kError,this._onError)this._onError(g.HTTP_STATUS_CODE_INVALID,{code:p.status,msg:p.statusText});else throw new o("RangeLoader: Http code invalid, "+p.status+" "+p.statusText)}}_onProgress(c){if(this._status===u.kError)return;if(this._contentLength===null){let x=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,x=!0;let G=c.total;this._internalAbort(),G!=null&G!==0&&(this._totalLength=G)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,x){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}let p=c.loaded-this._lastTimeLoaded;this._lastTimeLoaded=c.loaded,this._speedSampler.addBytes(p)}_normalizeSpeed(c){let p=this._chunkSizeKBList,x=p.length-1,G=0,re=0,ye=x;if(c<p[0])return p[0];for(;re<=ye;){if(G=re+Math.floor((ye-re)/2),G===x||c>=p[G]&&c<p[G+1])return p[G];p[G]<c?re=G+1:ye=G-1}}_onLoad(c){if(this._status===u.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;let p=this._speedSampler.lastSecondKBps;if(p===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(p=this._speedSampler.currentKBps)),p!==0){let ye=this._normalizeSpeed(p);this._currentSpeedNormalized!==ye&&(this._currentSpeedNormalized=ye,this._currentChunkSizeKB=ye)}let x=c.target.response,G=this._range.from+this._receivedLength;this._receivedLength+=x.byteLength;let re=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():re=!0,this._onDataArrival&&this._onDataArrival(x,G,this._receivedLength),re&&(this._status=u.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}_onXhrError(c){this._status=u.kError;let p=0,x=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(p=g.EARLY_EOF,x={code:-1,msg:"RangeLoader meet Early-Eof"}):(p=g.EXCEPTION,x={code:-1,msg:c.constructor.name+" "+c.type}),this._onError)this._onError(p,x);else throw new o(x.msg)}}var Ee=ie;class we extends m{static isSupported(){try{return typeof self.WebSocket!="undefined"}catch(c){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(c){try{let p=this._ws=new self.WebSocket(c.url);p.binaryType="arraybuffer",p.onopen=this._onWebSocketOpen.bind(this),p.onclose=this._onWebSocketClose.bind(this),p.onmessage=this._onWebSocketMessage.bind(this),p.onerror=this._onWebSocketError.bind(this),this._status=u.kConnecting}catch(p){this._status=u.kError;let x={code:p.code,msg:p.message};if(this._onError)this._onError(g.EXCEPTION,x);else throw new o(x.msg)}}abort(){let c=this._ws;c&&(c.readyState===0||c.readyState===1)&&(this._requestAbort=!0,c.close()),this._ws=null,this._status=u.kComplete}_onWebSocketOpen(c){this._status=u.kBuffering}_onWebSocketClose(c){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=u.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}_onWebSocketMessage(c){if(c.data instanceof ArrayBuffer)this._dispatchArrayBuffer(c.data);else if(c.data instanceof Blob){let p=new FileReader;p.onload=()=>{this._dispatchArrayBuffer(p.result)},p.readAsArrayBuffer(c.data)}else{this._status=u.kError;let p={code:-1,msg:"Unsupported WebSocket message type: "+c.data.constructor.name};if(this._onError)this._onError(g.EXCEPTION,p);else throw new o(p.msg)}}_dispatchArrayBuffer(c){let p=c,x=this._receivedLength;this._receivedLength+=p.byteLength,this._onDataArrival&&this._onDataArrival(p,x,this._receivedLength)}_onWebSocketError(c){this._status=u.kError;let p={code:c.code,msg:c.message};if(this._onError)this._onError(g.EXCEPTION,p);else throw new o(p.msg)}}var xe=we;class he{constructor(c){this._zeroStart=c||!1}getConfig(c,p){let x={};if(p.from!==0||p.to!==-1){let G;p.to!==-1?G=`bytes=${p.from.toString()}-${p.to.toString()}`:G=`bytes=${p.from.toString()}-`,x.Range=G}else this._zeroStart&&(x.Range="bytes=0-");return{url:c,headers:x}}removeURLParameters(c){return c}}var V=he;class T{constructor(c,p){this._startName=c,this._endName=p}getConfig(c,p){let x=c;if(p.from!==0||p.to!==-1){let G=!0;x.indexOf("?")===-1&&(x+="?",G=!1),G&&(x+="&"),x+=`${this._startName}=${p.from.toString()}`,p.to!==-1&&(x+=`&${this._endName}=${p.to.toString()}`)}return{url:x,headers:{}}}removeURLParameters(c){let p=c.split("?")[0],x,G=c.indexOf("?");G!==-1&&(x=c.substring(G+1));let re="";if(x!=null&&x.length>0){let ye=x.split("&");for(let Ae=0;Ae<ye.length;Ae++){let tt=ye[Ae].split("="),Qe=Ae>0;tt[0]!==this._startName&&tt[0]!==this._endName&&(Qe&&(re+="&"),re+=ye[Ae])}}return re.length===0?p:p+"?"+re}}var C=T;class R{constructor(c,p,x){this.TAG="IOController",this._config=p,this._extraData=x,this._stashInitialSize=1024*384,p.stashInitialSize!=null&&p.stashInitialSize>0&&(this._stashInitialSize=p.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,p.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=c,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(c.url),this._refTotalLength=c.filesize?c.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new le,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(c){this._extraData=c}get onDataArrival(){return this._onDataArrival}set onDataArrival(c){this._onDataArrival=c}get onSeeked(){return this._onSeeked}set onSeeked(c){this._onSeeked=c}get onError(){return this._onError}set onError(c){this._onError=c}get onComplete(){return this._onComplete}set onComplete(c){this._onComplete=c}get onRedirect(){return this._onRedirect}set onRedirect(c){this._onRedirect=c}get onRecoveredEarlyEof(){return this._onRecoveredEarlyEof}set onRecoveredEarlyEof(c){this._onRecoveredEarlyEof=c}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===Ee?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}get loaderType(){return this._loader.type}_selectSeekHandler(){let c=this._config;if(c.seekType==="range")this._seekHandler=new V(this._config.rangeLoadZeroStart);else if(c.seekType==="param"){let p=c.seekParamStart||"bstart",x=c.seekParamEnd||"bend";this._seekHandler=new C(p,x)}else if(c.seekType==="custom"){if(typeof c.customSeekHandler!="function")throw new D("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new c.customSeekHandler}else throw new D(`Invalid seekType in config: ${c.seekType}`)}_selectLoader(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=xe;else if(O.isSupported())this._loaderClass=O;else if(E.isSupported())this._loaderClass=E;else if(Ee.isSupported())this._loaderClass=Ee;else throw new o("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(c){this._currentRange={from:0,to:-1},c&&(this._currentRange.from=c),this._speedSampler.reset(),c||(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 c=this._resumeFrom;this._resumeFrom=0,this._internalSeek(c,!0)}}seek(c){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(c,!0)}_internalSeek(c,p){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(p),this._loader.destroy(),this._loader=null;let x={from:c,to:-1};this._currentRange={from:x.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,x),this._onSeeked&&this._onSeeked()}updateUrl(c){if(!c||typeof c!="string"||c.length===0)throw new D("Url must be a non-empty string!");this._dataSource.url=c}_expandBuffer(c){let p=this._stashSize;for(;p+1024*1024*1<c;)p*=2;if(p+=1024*1024*1,p===this._bufferSize)return;let x=new ArrayBuffer(p);if(this._stashUsed>0){let G=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(x,0,p).set(G,0)}this._stashBuffer=x,this._bufferSize=p}_normalizeSpeed(c){let p=this._speedNormalizeList,x=p.length-1,G=0,re=0,ye=x;if(c<p[0])return p[0];for(;re<=ye;){if(G=re+Math.floor((ye-re)/2),G===x||c>=p[G]&&c<p[G+1])return p[G];p[G]<c?re=G+1:ye=G-1}}_adjustStashSize(c){let p=0;this._config.isLive||c<512?p=c:c>=512&&c<=1024?p=Math.floor(c*1.5):p=c*2,p>8192&&(p=8192);let x=p*1024+1024*1024*1;this._bufferSize<x&&this._expandBuffer(x),this._stashSize=p*1024}_dispatchChunks(c,p){return this._currentRange.to=p+c.byteLength-1,this._onDataArrival(c,p)}_onURLRedirect(c){this._redirectedURL=c,this._onRedirect&&this._onRedirect(c)}_onContentLengthKnown(c){c&&this._fullRequestFlag&&(this._totalLength=c,this._fullRequestFlag=!1)}_onLoaderChunkArrival(c,p,x){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(c.byteLength);let G=this._speedSampler.lastSecondKBps;if(G!==0){let re=this._normalizeSpeed(G);this._speedNormalized!==re&&(this._speedNormalized=re,this._adjustStashSize(re))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=p),this._stashUsed+c.byteLength<=this._stashSize)new Uint8Array(this._stashBuffer,0,this._stashSize).set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength;else{let re=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){let ye=this._stashBuffer.slice(0,this._stashUsed),Ae=this._dispatchChunks(ye,this._stashByteStart);if(Ae<ye.byteLength){if(Ae>0){let tt=new Uint8Array(ye,Ae);re.set(tt,0),this._stashUsed=tt.byteLength,this._stashByteStart+=Ae}}else this._stashUsed=0,this._stashByteStart+=Ae;this._stashUsed+c.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+c.byteLength),re=new Uint8Array(this._stashBuffer,0,this._bufferSize)),re.set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength}else{let ye=this._dispatchChunks(c,p);if(ye<c.byteLength){let Ae=c.byteLength-ye;Ae>this._bufferSize&&(this._expandBuffer(Ae),re=new Uint8Array(this._stashBuffer,0,this._bufferSize)),re.set(new Uint8Array(c,ye),0),this._stashUsed+=Ae,this._stashByteStart=p+ye}}}else if(this._stashUsed===0){let re=this._dispatchChunks(c,p);if(re<c.byteLength){let ye=c.byteLength-re;ye>this._bufferSize&&this._expandBuffer(ye),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(c,re),0),this._stashUsed+=ye,this._stashByteStart=p+re}}else{this._stashUsed+c.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+c.byteLength);let re=new Uint8Array(this._stashBuffer,0,this._bufferSize);re.set(new Uint8Array(c),this._stashUsed),this._stashUsed+=c.byteLength;let ye=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(ye<this._stashUsed&&ye>0){let Ae=new Uint8Array(this._stashBuffer,ye);re.set(Ae,0)}this._stashUsed-=ye,this._stashByteStart+=ye}}_flushStashBuffer(c){if(this._stashUsed>0){let p=this._stashBuffer.slice(0,this._stashUsed),x=this._dispatchChunks(p,this._stashByteStart),G=p.byteLength-x;if(x<p.byteLength)if(c)Z.w(this.TAG,`${G} bytes unconsumed data remain when flush buffer, dropped`);else{if(x>0){let re=new Uint8Array(this._stashBuffer,0,this._bufferSize),ye=new Uint8Array(p,x);re.set(ye,0),this._stashUsed=ye.byteLength,this._stashByteStart+=x}return 0}return this._stashUsed=0,this._stashByteStart=0,G}return 0}_onLoaderComplete(c,p){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}_onLoaderError(c,p){switch(Z.e(this.TAG,`Loader error, code = ${p.code}, msg = ${p.msg}`),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,c=g.UNRECOVERABLE_EARLY_EOF),c){case g.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){let x=this._currentRange.to+1;x<this._totalLength&&(Z.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(x,!1));return}c=g.UNRECOVERABLE_EARLY_EOF;break}case g.UNRECOVERABLE_EARLY_EOF:case g.CONNECTING_TIMEOUT:case g.HTTP_STATUS_CODE_INVALID:case g.EXCEPTION:break}if(this._onError)this._onError(c,p);else throw new o("IOException: "+p.msg)}}var z=R;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 y(){return Object.assign({},Y)}class v{static supportMSEH264Playback(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}static supportNetworkStreamIO(){let c=new z({},y()),p=c.loaderType;return c.destroy(),p=="fetch-stream-loader"||p=="xhr-moz-chunked-loader"}static getNetworkLoaderTypeName(){let c=new z({},y()),p=c.loaderType;return c.destroy(),p}static supportNativeMediaPlayback(c){v.videoElement==null&&(v.videoElement=window.document.createElement("video"));let p=v.videoElement.canPlayType(c);return p==="probably"||p=="maybe"}static getFeatureList(){let c={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return c.mseFlvPlayback=v.supportMSEH264Playback(),c.networkStreamIO=v.supportNetworkStreamIO(),c.networkLoaderName=v.getNetworkLoaderTypeName(),c.mseLiveFlvPlayback=c.mseFlvPlayback&&c.networkStreamIO,c.nativeMP4H264Playback=v.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),c.nativeWebmVP8Playback=v.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),c.nativeWebmVP9Playback=v.supportNativeMediaPlayback('video/webm; codecs="vp9"'),c}}var $=v,me={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 Se{static get forceGlobalTag(){return Z.FORCE_GLOBAL_TAG}static set forceGlobalTag(c){Z.FORCE_GLOBAL_TAG=c,Se._notifyChange()}static get globalTag(){return Z.GLOBAL_TAG}static set globalTag(c){Z.GLOBAL_TAG=c,Se._notifyChange()}static get enableAll(){return Z.ENABLE_VERBOSE&&Z.ENABLE_DEBUG&&Z.ENABLE_INFO&&Z.ENABLE_WARN&&Z.ENABLE_ERROR}static set enableAll(c){Z.ENABLE_VERBOSE=c,Z.ENABLE_DEBUG=c,Z.ENABLE_INFO=c,Z.ENABLE_WARN=c,Z.ENABLE_ERROR=c,Se._notifyChange()}static get enableDebug(){return Z.ENABLE_DEBUG}static set enableDebug(c){Z.ENABLE_DEBUG=c,Se._notifyChange()}static get enableVerbose(){return Z.ENABLE_VERBOSE}static set enableVerbose(c){Z.ENABLE_VERBOSE=c,Se._notifyChange()}static get enableInfo(){return Z.ENABLE_INFO}static set enableInfo(c){Z.ENABLE_INFO=c,Se._notifyChange()}static get enableWarn(){return Z.ENABLE_WARN}static set enableWarn(c){Z.ENABLE_WARN=c,Se._notifyChange()}static get enableError(){return Z.ENABLE_ERROR}static set enableError(c){Z.ENABLE_ERROR=c,Se._notifyChange()}static getConfig(){return{globalTag:Z.GLOBAL_TAG,forceGlobalTag:Z.FORCE_GLOBAL_TAG,enableVerbose:Z.ENABLE_VERBOSE,enableDebug:Z.ENABLE_DEBUG,enableInfo:Z.ENABLE_INFO,enableWarn:Z.ENABLE_WARN,enableError:Z.ENABLE_ERROR,enableCallback:Z.ENABLE_CALLBACK}}static applyConfig(c){Z.GLOBAL_TAG=c.globalTag,Z.FORCE_GLOBAL_TAG=c.forceGlobalTag,Z.ENABLE_VERBOSE=c.enableVerbose,Z.ENABLE_DEBUG=c.enableDebug,Z.ENABLE_INFO=c.enableInfo,Z.ENABLE_WARN=c.enableWarn,Z.ENABLE_ERROR=c.enableError,Z.ENABLE_CALLBACK=c.enableCallback}static _notifyChange(){let c=Se.emitter;if(c.listenerCount("change")>0){let p=Se.getConfig();c.emit("change",p)}}static registerListener(c){Se.emitter.addListener("change",c)}static removeListener(c){Se.emitter.removeListener("change",c)}static addLogListener(c){Z.emitter.addListener("log",c),Z.emitter.listenerCount("log")>0&&(Z.ENABLE_CALLBACK=!0,Se._notifyChange())}static removeLogListener(c){Z.emitter.removeListener("log",c),Z.emitter.listenerCount("log")===0&&(Z.ENABLE_CALLBACK=!1,Se._notifyChange())}}Se.emitter=new(fe());var Te=Se;class De{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 c=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,p=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&&c&&p}isSeekable(){return this.hasKeyframesIndex===!0}getNearestKeyframe(c){if(this.keyframesIndex==null)return null;let p=this.keyframesIndex,x=this._search(p.times,c);return{index:x,milliseconds:p.times[x],fileposition:p.filepositions[x]}}_search(c,p){let x=0,G=c.length-1,re=0,ye=0,Ae=G;for(p<c[0]&&(x=0,ye=Ae+1);ye<=Ae;)if(re=ye+Math.floor((Ae-ye)/2),re===G||p>=c[re]&&p<c[re+1]){x=re;break}else c[re]<p?ye=re+1:Ae=re-1;return x}}var qe=De;function lt(Xe,c,p){let x=Xe;if(c+p<x.length){for(;p--;)if((x[++c]&192)!==128)return!1;return!0}else return!1}function We(Xe){let c=[],p=Xe,x=0,G=Xe.length;for(;x<G;){if(p[x]<128){c.push(String.fromCharCode(p[x])),++x;continue}else if(!(p[x]<192)){if(p[x]<224){if(lt(p,x,1)){let re=(p[x]&31)<<6|p[x+1]&63;if(re>=128){c.push(String.fromCharCode(re&65535)),x+=2;continue}}}else if(p[x]<240){if(lt(p,x,2)){let re=(p[x]&15)<<12|(p[x+1]&63)<<6|p[x+2]&63;if(re>=2048&&(re&63488)!==55296){c.push(String.fromCharCode(re&65535)),x+=3;continue}}}else if(p[x]<248&<(p,x,3)){let re=(p[x]&7)<<18|(p[x+1]&63)<<12|(p[x+2]&63)<<6|p[x+3]&63;if(re>65536&&re<1114112){re-=65536,c.push(String.fromCharCode(re>>>10|55296)),c.push(String.fromCharCode(re&1023|56320)),x+=4;continue}}}c.push("\uFFFD"),++x}return c.join("")}var Tt=We;let dt=function(){let Xe=new ArrayBuffer(2);return new DataView(Xe).setInt16(0,256,!0),new Int16Array(Xe)[0]===256}();class wt{static parseScriptData(c,p,x){let G={};try{let re=wt.parseValue(c,p,x),ye=wt.parseValue(c,p+re.size,x-re.size);G[re.data]=ye.data}catch(re){Z.e("AMF",re.toString())}return G}static parseObject(c,p,x){if(x<3)throw new K("Data not enough when parse ScriptDataObject");let G=wt.parseString(c,p,x),re=wt.parseValue(c,p+G.size,x-G.size),ye=re.objectEnd;return{data:{name:G.data,value:re.data},size:G.size+re.size,objectEnd:ye}}static parseVariable(c,p,x){return wt.parseObject(c,p,x)}static parseString(c,p,x){if(x<2)throw new K("Data not enough when parse String");let re=new DataView(c,p,x).getUint16(0,!dt),ye;return re>0?ye=Tt(new Uint8Array(c,p+2,re)):ye="",{data:ye,size:2+re}}static parseLongString(c,p,x){if(x<4)throw new K("Data not enough when parse LongString");let re=new DataView(c,p,x).getUint32(0,!dt),ye;return re>0?ye=Tt(new Uint8Array(c,p+4,re)):ye="",{data:ye,size:4+re}}static parseDate(c,p,x){if(x<10)throw new K("Data size invalid when parse Date");let G=new DataView(c,p,x),re=G.getFloat64(0,!dt),ye=G.getInt16(8,!dt);return re+=ye*60*1e3,{data:new Date(re),size:10}}static parseValue(c,p,x){if(x<1)throw new K("Data not enough when parse Value");let G=new DataView(c,p,x),re=1,ye=G.getUint8(0),Ae,tt=!1;try{switch(ye){case 0:Ae=G.getFloat64(1,!dt),re+=8;break;case 1:{Ae=!!G.getUint8(1),re+=1;break}case 2:{let Qe=wt.parseString(c,p+1,x-1);Ae=Qe.data,re+=Qe.size;break}case 3:{Ae={};let Qe=0;for((G.getUint32(x-4,!dt)&16777215)===9&&(Qe=3);re<x-4;){let at=wt.parseObject(c,p+re,x-re-Qe);if(at.objectEnd)break;Ae[at.data.name]=at.data.value,re+=at.size}re<=x-3&&(G.getUint32(re-1,!dt)&16777215)===9&&(re+=3);break}case 8:{Ae={},re+=4;let Qe=0;for((G.getUint32(x-4,!dt)&16777215)===9&&(Qe=3);re<x-8;){let at=wt.parseVariable(c,p+re,x-re-Qe);if(at.objectEnd)break;Ae[at.data.name]=at.data.value,re+=at.size}re<=x-3&&(G.getUint32(re-1,!dt)&16777215)===9&&(re+=3);break}case 9:Ae=void 0,re=1,tt=!0;break;case 10:{Ae=[];let Qe=G.getUint32(1,!dt);re+=4;for(let at=0;at<Qe;at++){let Ft=wt.parseValue(c,p+re,x-re);Ae.push(Ft.data),re+=Ft.size}break}case 11:{let Qe=wt.parseDate(c,p+1,x-1);Ae=Qe.data,re+=Qe.size;break}case 12:{let Qe=wt.parseString(c,p+1,x-1);Ae=Qe.data,re+=Qe.size;break}default:re=x,Z.w("AMF","Unsupported AMF value type "+ye)}}catch(Qe){Z.e("AMF",Qe.toString())}return{data:Ae,size:re,objectEnd:tt}}}var Rt=wt;class _t{constructor(c){this.TAG="ExpGolomb",this._buffer=c,this._buffer_index=0,this._total_bytes=c.byteLength,this._total_bits=c.byteLength*8,this._current_word=0,this._current_word_bits_left=0}destroy(){this._buffer=null}_fillCurrentWord(){let c=this._total_bytes-this._buffer_index;if(c<=0)throw new K("ExpGolomb: _fillCurrentWord() but no bytes available");let p=Math.min(4,c),x=new Uint8Array(4);x.set(this._buffer.subarray(this._buffer_index,this._buffer_index+p)),this._current_word=new DataView(x.buffer).getUint32(0,!1),this._buffer_index+=p,this._current_word_bits_left=p*8}readBits(c){if(c>32)throw new D("ExpGolomb: readBits() bits exceeded max 32bits!");if(c<=this._current_word_bits_left){let ye=this._current_word>>>32-c;return this._current_word<<=c,this._current_word_bits_left-=c,ye}let p=this._current_word_bits_left?this._current_word:0;p=p>>>32-this._current_word_bits_left;let x=c-this._current_word_bits_left;this._fillCurrentWord();let G=Math.min(x,this._current_word_bits_left),re=this._current_word>>>32-G;return this._current_word<<=G,this._current_word_bits_left-=G,p=p<<G|re,p}readBool(){return this.readBits(1)===1}readByte(){return this.readBits(8)}_skipLeadingZero(){let c;for(c=0;c<this._current_word_bits_left;c++)if(this._current_word&2147483648>>>c)return this._current_word<<=c,this._current_word_bits_left-=c,c;return this._fillCurrentWord(),c+this._skipLeadingZero()}readUEG(){let c=this._skipLeadingZero();return this.readBits(c+1)-1}readSEG(){let c=this.readUEG();return c&1?c+1>>>1:-1*(c>>>1)}}var Pe=_t;class J{static _ebsp2rbsp(c){let p=c,x=p.byteLength,G=new Uint8Array(x),re=0;for(let ye=0;ye<x;ye++)ye>=2&&p[ye]===3&&p[ye-1]===0&&p[ye-2]===0||(G[re]=p[ye],re++);return new Uint8Array(G.buffer,0,re)}static parseSPS(c){let p=J._ebsp2rbsp(c),x=new Pe(p);x.readByte();let G=x.readByte();x.readByte();let re=x.readByte();x.readUEG();let ye=J.getProfileString(G),Ae=J.getLevelString(re),tt=1,Qe=420,at=[0,420,422,444],Ft=8;if((G===100||G===110||G===122||G===244||G===44||G===83||G===86||G===118||G===128||G===138||G===144)&&(tt=x.readUEG(),tt===3&&x.readBits(1),tt<=3&&(Qe=at[tt]),Ft=x.readUEG()+8,x.readUEG(),x.readBits(1),x.readBool())){let rn=tt!==3?8:12;for(let on=0;on<rn;on++)x.readBool()&&(on<6?J._skipScalingList(x,16):J._skipScalingList(x,64))}x.readUEG();let Vt=x.readUEG();if(Vt===0)x.readUEG();else if(Vt===1){x.readBits(1),x.readSEG(),x.readSEG();let rn=x.readUEG();for(let on=0;on<rn;on++)x.readSEG()}let ot=x.readUEG();x.readBits(1);let qt=x.readUEG(),At=x.readUEG(),Fe=x.readBits(1);Fe===0&&x.readBits(1),x.readBits(1);let Be=0,ct=0,It=0,Pt=0;x.readBool()&&(Be=x.readUEG(),ct=x.readUEG(),It=x.readUEG(),Pt=x.readUEG());let fn=1,Lt=1,Et=0,Oe=!0,Me=0,He=0;if(x.readBool()){if(x.readBool()){let rn=x.readByte(),on=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],_n=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];rn>0&&rn<16?(fn=on[rn-1],Lt=_n[rn-1]):rn===255&&(fn=x.readByte()<<8|x.readByte(),Lt=x.readByte()<<8|x.readByte())}if(x.readBool()&&x.readBool(),x.readBool()&&(x.readBits(4),x.readBool()&&x.readBits(24)),x.readBool()&&(x.readUEG(),x.readUEG()),x.readBool()){let rn=x.readBits(32),on=x.readBits(32);Oe=x.readBool(),Me=on,He=rn*2,Et=Me/He}}let Ye=1;(fn!==1||Lt!==1)&&(Ye=fn/Lt);let et=0,Je=0;if(tt===0)et=1,Je=2-Fe;else{let rn=tt===3?1:2,on=tt===1?2:1;et=rn,Je=on*(2-Fe)}let Dt=(qt+1)*16,Zt=(2-Fe)*((At+1)*16);Dt-=(Be+ct)*et,Zt-=(It+Pt)*Je;let Ut=Math.ceil(Dt*Ye);return x.destroy(),x=null,{profile_string:ye,level_string:Ae,bit_depth:Ft,ref_frames:ot,chroma_format:Qe,chroma_format_string:J.getChromaFormatString(Qe),frame_rate:{fixed:Oe,fps:Et,fps_den:He,fps_num:Me},sar_ratio:{width:fn,height:Lt},codec_size:{width:Dt,height:Zt},present_size:{width:Ut,height:Zt}}}static _skipScalingList(c,p){let x=8,G=8,re=0;for(let ye=0;ye<p;ye++)G!==0&&(re=c.readSEG(),G=(x+re+256)%256),x=G===0?x:G}static getProfileString(c){switch(c){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(c){return(c/10).toFixed(1)}static getChromaFormatString(c){switch(c){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}var ue=J,M={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};function pe(Xe){return Xe>>>8&255|(Xe&255)<<8}function k(Xe){return(Xe&4278190080)>>>24|(Xe&16711680)>>>8|(Xe&65280)<<8|(Xe&255)<<24}function N(Xe,c){return Xe[c]<<24|Xe[c+1]<<16|Xe[c+2]<<8|Xe[c+3]}class P{constructor(c,p){this.TAG="FLVDemuxer",this._config=p,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=c.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=c.hasAudioTrack,this._hasVideo=c.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new qe,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 x=new ArrayBuffer(2);return new DataView(x).setInt16(0,256,!0),new Int16Array(x)[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(c){let p=new Uint8Array(c),x={match:!1};if(p[0]!==70||p[1]!==76||p[2]!==86||p[3]!==1)return x;let G=(p[4]&4)>>>2!==0,re=(p[4]&1)!==0,ye=N(p,5);return ye<9?x:{match:!0,consumed:ye,dataOffset:ye,hasAudioTrack:G,hasVideoTrack:re}}bindDataSource(c){return c.onDataArrival=this.parseChunks.bind(this),this}get onTrackMetadata(){return this._onTrackMetadata}set onTrackMetadata(c){this._onTrackMetadata=c}get onMediaInfo(){return this._onMediaInfo}set onMediaInfo(c){this._onMediaInfo=c}get onMetaDataArrived(){return this._onMetaDataArrived}set onMetaDataArrived(c){this._onMetaDataArrived=c}get onScriptDataArrived(){return this._onScriptDataArrived}set onScriptDataArrived(c){this._onScriptDataArrived=c}get onError(){return this._onError}set onError(c){this._onError=c}get onDataAvailable(){return this._onDataAvailable}set onDataAvailable(c){this._onDataAvailable=c}get timestampBase(){return this._timestampBase}set timestampBase(c){this._timestampBase=c}get overridedDuration(){return this._duration}set overridedDuration(c){this._durationOverrided=!0,this._duration=c,this._mediaInfo.duration=c}set overridedHasAudio(c){this._hasAudioFlagOverrided=!0,this._hasAudio=c,this._mediaInfo.hasAudio=c}set overridedHasVideo(c){this._hasVideoFlagOverrided=!0,this._hasVideo=c,this._mediaInfo.hasVideo=c}resetMediaInfo(){this._mediaInfo=new qe}_isInitialMetadataDispatched(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}parseChunks(c,p){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new K("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let x=0,G=this._littleEndian;if(p===0)if(c.byteLength>13)x=P.probe(c).dataOffset;else return 0;for(this._firstParse&&(this._firstParse=!1,p+x!==this._dataOffset&&Z.w(this.TAG,"First time parsing but chunk byteStart invalid!"),new DataView(c,x).getUint32(0,!G)!==0&&Z.w(this.TAG,"PrevTagSize0 !== 0 !!!"),x+=4);x<c.byteLength;){this._dispatch=!0;let re=new DataView(c,x);if(x+11+4>c.byteLength)break;let ye=re.getUint8(0),Ae=re.getUint32(0,!G)&16777215;if(x+11+Ae+4>c.byteLength)break;if(ye!==8&&ye!==9&&ye!==18){Z.w(this.TAG,`Unsupported tag type ${ye}, skipped`),x+=11+Ae+4;continue}let tt=re.getUint8(4),Qe=re.getUint8(5),at=re.getUint8(6),Ft=re.getUint8(7),Vt=at|Qe<<8|tt<<16|Ft<<24;(re.getUint32(7,!G)&16777215)!==0&&Z.w(this.TAG,"Meet tag which has StreamID != 0!");let qt=x+11;switch(ye){case 8:this._parseAudioData(c,qt,Ae,Vt);break;case 9:this._parseVideoData(c,qt,Ae,Vt,p+x);break;case 18:this._parseScriptData(c,qt,Ae);break}let At=re.getUint32(11+Ae,!G);At!==11+Ae&&Z.w(this.TAG,`Invalid PrevTagSize ${At}`),x+=11+Ae+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),x}_parseScriptData(c,p,x){let G=Rt.parseScriptData(c,p,x);if(G.hasOwnProperty("onMetaData")){if(G.onMetaData==null||typeof G.onMetaData!="object"){Z.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&Z.w(this.TAG,"Found another onMetaData tag!"),this._metadata=G;let re=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},re)),typeof re.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=re.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof re.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=re.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof re.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=re.audiodatarate),typeof re.videodatarate=="number"&&(this._mediaInfo.videoDataRate=re.videodatarate),typeof re.width=="number"&&(this._mediaInfo.width=re.width),typeof re.height=="number"&&(this._mediaInfo.height=re.height),typeof re.duration=="number"){if(!this._durationOverrided){let ye=Math.floor(re.duration*this._timescale);this._duration=ye,this._mediaInfo.duration=ye}}else this._mediaInfo.duration=0;if(typeof re.framerate=="number"){let ye=Math.floor(re.framerate*1e3);if(ye>0){let Ae=ye/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Ae,this._referenceFrameRate.fps_num=ye,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Ae}}if(typeof re.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;let ye=re.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(ye),re.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=re,Z.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(G).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},G))}_parseKeyframesIndex(c){let p=[],x=[];for(let G=1;G<c.times.length;G++){let re=this._timestampBase+Math.floor(c.times[G]*1e3);p.push(re),x.push(c.filepositions[G])}return{times:p,filepositions:x}}_parseAudioData(c,p,x,G){if(x<=1){Z.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;let re=this._littleEndian,Ae=new DataView(c,p,x).getUint8(0),tt=Ae>>>4;if(tt!==2&&tt!==10){this._onError(M.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+tt);return}let Qe=0,at=(Ae&12)>>>2;if(at>=0&&at<=4)Qe=this._flvSoundRateTable[at];else{this._onError(M.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+at);return}let Ft=(Ae&2)>>>1,Vt=Ae&1,ot=this._audioMetadata,qt=this._audioTrack;if(ot||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),ot=this._audioMetadata={},ot.type="audio",ot.id=qt.id,ot.timescale=this._timescale,ot.duration=this._duration,ot.audioSampleRate=Qe,ot.channelCount=Vt===0?1:2),tt===10){let At=this._parseAACAudioData(c,p+1,x-1);if(At==null)return;if(At.packetType===0){ot.config&&Z.w(this.TAG,"Found another AudioSpecificConfig!");let Fe=At.data;ot.audioSampleRate=Fe.samplingRate,ot.channelCount=Fe.channelCount,ot.codec=Fe.codec,ot.originalCodec=Fe.originalCodec,ot.config=Fe.config,ot.refSampleDuration=1024/ot.audioSampleRate*ot.timescale,Z.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",ot);let Be=this._mediaInfo;Be.audioCodec=ot.originalCodec,Be.audioSampleRate=ot.audioSampleRate,Be.audioChannelCount=ot.channelCount,Be.hasVideo?Be.videoCodec!=null&&(Be.mimeType='video/x-flv; codecs="'+Be.videoCodec+","+Be.audioCodec+'"'):Be.mimeType='video/x-flv; codecs="'+Be.audioCodec+'"',Be.isComplete()&&this._onMediaInfo(Be)}else if(At.packetType===1){let Fe=this._timestampBase+G,Be={unit:At.data,length:At.data.byteLength,dts:Fe,pts:Fe};qt.samples.push(Be),qt.length+=At.data.length}else Z.e(this.TAG,`Flv: Unsupported AAC data type ${At.packetType}`)}else if(tt===2){if(!ot.codec){let ct=this._parseMP3AudioData(c,p+1,x-1,!0);if(ct==null)return;ot.audioSampleRate=ct.samplingRate,ot.channelCount=ct.channelCount,ot.codec=ct.codec,ot.originalCodec=ct.originalCodec,ot.refSampleDuration=1152/ot.audioSampleRate*ot.timescale,Z.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",ot);let It=this._mediaInfo;It.audioCodec=ot.codec,It.audioSampleRate=ot.audioSampleRate,It.audioChannelCount=ot.channelCount,It.audioDataRate=ct.bitRate,It.hasVideo?It.videoCodec!=null&&(It.mimeType='video/x-flv; codecs="'+It.videoCodec+","+It.audioCodec+'"'):It.mimeType='video/x-flv; codecs="'+It.audioCodec+'"',It.isComplete()&&this._onMediaInfo(It)}let At=this._parseMP3AudioData(c,p+1,x-1,!1);if(At==null)return;let Fe=this._timestampBase+G,Be={unit:At,length:At.byteLength,dts:Fe,pts:Fe};qt.samples.push(Be),qt.length+=At.length}}_parseAACAudioData(c,p,x){if(x<=1){Z.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}let G={},re=new Uint8Array(c,p,x);return G.packetType=re[0],re[0]===0?G.data=this._parseAACAudioSpecificConfig(c,p+1,x-1):G.data=re.subarray(1),G}_parseAACAudioSpecificConfig(c,p,x){let G=new Uint8Array(c,p,x),re=null,ye=0,Ae=0,tt=null,Qe=0,at=null;if(ye=Ae=G[0]>>>3,Qe=(G[0]&7)<<1|G[1]>>>7,Qe<0||Qe>=this._mpegSamplingRates.length){this._onError(M.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}let Ft=this._mpegSamplingRates[Qe],Vt=(G[1]&120)>>>3;if(Vt<0||Vt>=8){this._onError(M.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}ye===5&&(at=(G[1]&7)<<1|G[2]>>>7,tt=(G[2]&124)>>>2);let ot=self.navigator.userAgent.toLowerCase();return ot.indexOf("firefox")!==-1?Qe>=6?(ye=5,re=new Array(4),at=Qe-3):(ye=2,re=new Array(2),at=Qe):ot.indexOf("android")!==-1?(ye=2,re=new Array(2),at=Qe):(ye=5,at=Qe,re=new Array(4),Qe>=6?at=Qe-3:Vt===1&&(ye=2,re=new Array(2),at=Qe)),re[0]=ye<<3,re[0]|=(Qe&15)>>>1,re[1]=(Qe&15)<<7,re[1]|=(Vt&15)<<3,ye===5&&(re[1]|=(at&15)>>>1,re[2]=(at&1)<<7,re[2]|=8,re[3]=0),{config:re,samplingRate:Ft,channelCount:Vt,codec:"mp4a.40."+ye,originalCodec:"mp4a.40."+Ae}}_parseMP3AudioData(c,p,x,G){if(x<4){Z.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}let re=this._littleEndian,ye=new Uint8Array(c,p,x),Ae=null;if(G){if(ye[0]!==255)return;let tt=ye[1]>>>3&3,Qe=(ye[1]&6)>>1,at=(ye[2]&240)>>>4,Ft=(ye[2]&12)>>>2,ot=(ye[3]>>>6&3)!==3?2:1,qt=0,At=0,Fe=34,Be="mp3";switch(tt){case 0:qt=this._mpegAudioV25SampleRateTable[Ft];break;case 2:qt=this._mpegAudioV20SampleRateTable[Ft];break;case 3:qt=this._mpegAudioV10SampleRateTable[Ft];break}switch(Qe){case 1:Fe=34,at<this._mpegAudioL3BitRateTable.length&&(At=this._mpegAudioL3BitRateTable[at]);break;case 2:Fe=33,at<this._mpegAudioL2BitRateTable.length&&(At=this._mpegAudioL2BitRateTable[at]);break;case 3:Fe=32,at<this._mpegAudioL1BitRateTable.length&&(At=this._mpegAudioL1BitRateTable[at]);break}Ae={bitRate:At,samplingRate:qt,channelCount:ot,codec:Be,originalCodec:Be}}else Ae=ye;return Ae}_parseVideoData(c,p,x,G,re){if(x<=1){Z.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;let ye=new Uint8Array(c,p,x)[0],Ae=(ye&240)>>>4,tt=ye&15;if(tt!==7){this._onError(M.CODEC_UNSUPPORTED,`Flv: Unsupported codec in video frame: ${tt}`);return}this._parseAVCVideoPacket(c,p+1,x-1,G,re,Ae)}_parseAVCVideoPacket(c,p,x,G,re,ye){if(x<4){Z.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}let Ae=this._littleEndian,tt=new DataView(c,p,x),Qe=tt.getUint8(0),Ft=(tt.getUint32(0,!Ae)&16777215)<<8>>8;if(Qe===0)this._parseAVCDecoderConfigurationRecord(c,p+4,x-4);else if(Qe===1)this._parseAVCVideoData(c,p+4,x-4,G,re,ye,Ft);else if(Qe!==2){this._onError(M.FORMAT_ERROR,`Flv: Invalid video packet type ${Qe}`);return}}_parseAVCDecoderConfigurationRecord(c,p,x){if(x<7){Z.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}let G=this._videoMetadata,re=this._videoTrack,ye=this._littleEndian,Ae=new DataView(c,p,x);G?typeof G.avcc!="undefined"&&Z.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),G=this._videoMetadata={},G.type="video",G.id=re.id,G.timescale=this._timescale,G.duration=this._duration);let tt=Ae.getUint8(0),Qe=Ae.getUint8(1),at=Ae.getUint8(2),Ft=Ae.getUint8(3);if(tt!==1||Qe===0){this._onError(M.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(Ae.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(M.FORMAT_ERROR,`Flv: Strange NaluLengthSizeMinusOne: ${this._naluLengthSize-1}`);return}let Vt=Ae.getUint8(5)&31;if(Vt===0){this._onError(M.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else Vt>1&&Z.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ${Vt}`);let ot=6;for(let At=0;At<Vt;At++){let Fe=Ae.getUint16(ot,!ye);if(ot+=2,Fe===0)continue;let Be=new Uint8Array(c,p+ot,Fe);ot+=Fe;let ct=ue.parseSPS(Be);if(At!==0)continue;G.codecWidth=ct.codec_size.width,G.codecHeight=ct.codec_size.height,G.presentWidth=ct.present_size.width,G.presentHeight=ct.present_size.height,G.profile=ct.profile_string,G.level=ct.level_string,G.bitDepth=ct.bit_depth,G.chromaFormat=ct.chroma_format,G.sarRatio=ct.sar_ratio,G.frameRate=ct.frame_rate,(ct.frame_rate.fixed===!1||ct.frame_rate.fps_num===0||ct.frame_rate.fps_den===0)&&(G.frameRate=this._referenceFrameRate);let It=G.frameRate.fps_den,Pt=G.frameRate.fps_num;G.refSampleDuration=G.timescale*(It/Pt);let dn=Be.subarray(1,4),fn="avc1.";for(let Et=0;Et<3;Et++){let Oe=dn[Et].toString(16);Oe.length<2&&(Oe="0"+Oe),fn+=Oe}G.codec=fn;let Lt=this._mediaInfo;Lt.width=G.codecWidth,Lt.height=G.codecHeight,Lt.fps=G.frameRate.fps,Lt.profile=G.profile,Lt.level=G.level,Lt.refFrames=ct.ref_frames,Lt.chromaFormat=ct.chroma_format_string,Lt.sarNum=G.sarRatio.width,Lt.sarDen=G.sarRatio.height,Lt.videoCodec=fn,Lt.hasAudio?Lt.audioCodec!=null&&(Lt.mimeType='video/x-flv; codecs="'+Lt.videoCodec+","+Lt.audioCodec+'"'):Lt.mimeType='video/x-flv; codecs="'+Lt.videoCodec+'"',Lt.isComplete()&&this._onMediaInfo(Lt)}let qt=Ae.getUint8(ot);if(qt===0){this._onError(M.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else qt>1&&Z.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ${qt}`);ot++;for(let At=0;At<qt;At++){let Fe=Ae.getUint16(ot,!ye);ot+=2,Fe!==0&&(ot+=Fe)}G.avcc=new Uint8Array(x),G.avcc.set(new Uint8Array(c,p,x),0),Z.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",G)}_parseAVCVideoData(c,p,x,G,re,ye,Ae){let tt=this._littleEndian,Qe=new DataView(c,p,x),at=[],Ft=0,Vt=0;const ot=this._naluLengthSize;let qt=this._timestampBase+G,At=ye===1;for(;Vt<x;){if(Vt+4>=x){Z.w(this.TAG,`Malformed Nalu near timestamp ${qt}, offset = ${Vt}, dataSize = ${x}`);break}let Fe=Qe.getUint32(Vt,!tt);if(ot===3&&(Fe>>>=8),Fe>x-ot){Z.w(this.TAG,`Malformed Nalus near timestamp ${qt}, NaluSize > DataSize!`);return}let Be=Qe.getUint8(Vt+ot)&31;Be===5&&(At=!0);let ct=new Uint8Array(c,p+Vt,ot+Fe),It={type:Be,data:ct};at.push(It),Ft+=ct.byteLength,Vt+=ot+Fe}if(at.length){let Fe=this._videoTrack,Be={units:at,length:Ft,isKeyframe:At,dts:qt,cts:Ae,pts:qt+Ae};At&&(Be.fileposition=re),Fe.samples.push(Be),Fe.length+=Ft}}}var ne=P;class F{static init(){F.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 p in F.types)F.types.hasOwnProperty(p)&&(F.types[p]=[p.charCodeAt(0),p.charCodeAt(1),p.charCodeAt(2),p.charCodeAt(3)]);let c=F.constants={};c.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),c.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),c.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),c.STSC=c.STCO=c.STTS,c.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),c.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]),c.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]),c.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),c.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),c.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}static box(c){let p=8,x=null,G=Array.prototype.slice.call(arguments,1),re=G.length;for(let Ae=0;Ae<re;Ae++)p+=G[Ae].byteLength;x=new Uint8Array(p),x[0]=p>>>24&255,x[1]=p>>>16&255,x[2]=p>>>8&255,x[3]=p&255,x.set(c,4);let ye=8;for(let Ae=0;Ae<re;Ae++)x.set(G[Ae],ye),ye+=G[Ae].byteLength;return x}static generateInitSegment(c){let p=F.box(F.types.ftyp,F.constants.FTYP),x=F.moov(c),G=new Uint8Array(p.byteLength+x.byteLength);return G.set(p,0),G.set(x,p.byteLength),G}static moov(c){let p=F.mvhd(c.timescale,c.duration),x=F.trak(c),G=F.mvex(c);return F.box(F.types.moov,p,x,G)}static mvhd(c,p){return F.box(F.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,c>>>24&255,c>>>16&255,c>>>8&255,c&255,p>>>24&255,p>>>16&255,p>>>8&255,p&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(c){return F.box(F.types.trak,F.tkhd(c),F.mdia(c))}static tkhd(c){let p=c.id,x=c.duration,G=c.presentWidth,re=c.presentHeight;return F.box(F.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,p>>>24&255,p>>>16&255,p>>>8&255,p&255,0,0,0,0,x>>>24&255,x>>>16&255,x>>>8&255,x&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,G>>>8&255,G&255,0,0,re>>>8&255,re&255,0,0]))}static mdia(c){return F.box(F.types.mdia,F.mdhd(c),F.hdlr(c),F.minf(c))}static mdhd(c){let p=c.timescale,x=c.duration;return F.box(F.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,p>>>24&255,p>>>16&255,p>>>8&255,p&255,x>>>24&255,x>>>16&255,x>>>8&255,x&255,85,196,0,0]))}static hdlr(c){let p=null;return c.type==="audio"?p=F.constants.HDLR_AUDIO:p=F.constants.HDLR_VIDEO,F.box(F.types.hdlr,p)}static minf(c){let p=null;return c.type==="audio"?p=F.box(F.types.smhd,F.constants.SMHD):p=F.box(F.types.vmhd,F.constants.VMHD),F.box(F.types.minf,p,F.dinf(),F.stbl(c))}static dinf(){return F.box(F.types.dinf,F.box(F.types.dref,F.constants.DREF))}static stbl(c){return F.box(F.types.stbl,F.stsd(c),F.box(F.types.stts,F.constants.STTS),F.box(F.types.stsc,F.constants.STSC),F.box(F.types.stsz,F.constants.STSZ),F.box(F.types.stco,F.constants.STCO))}static stsd(c){return c.type==="audio"?c.codec==="mp3"?F.box(F.types.stsd,F.constants.STSD_PREFIX,F.mp3(c)):F.box(F.types.stsd,F.constants.STSD_PREFIX,F.mp4a(c)):F.box(F.types.stsd,F.constants.STSD_PREFIX,F.avc1(c))}static mp3(c){let p=c.channelCount,x=c.audioSampleRate,G=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,p,0,16,0,0,0,0,x>>>8&255,x&255,0,0]);return F.box(F.types[".mp3"],G)}static mp4a(c){let p=c.channelCount,x=c.audioSampleRate,G=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,p,0,16,0,0,0,0,x>>>8&255,x&255,0,0]);return F.box(F.types.mp4a,G,F.esds(c))}static esds(c){let p=c.config||[],x=p.length,G=new Uint8Array([0,0,0,0,3,23+x,0,1,0,4,15+x,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([x]).concat(p).concat([6,1,2]));return F.box(F.types.esds,G)}static avc1(c){let p=c.avcc,x=c.codecWidth,G=c.codecHeight,re=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,x>>>8&255,x&255,G>>>8&255,G&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 F.box(F.types.avc1,re,F.box(F.types.avcC,p))}static mvex(c){return F.box(F.types.mvex,F.trex(c))}static trex(c){let p=c.id,x=new Uint8Array([0,0,0,0,p>>>24&255,p>>>16&255,p>>>8&255,p&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return F.box(F.types.trex,x)}static moof(c,p){return F.box(F.types.moof,F.mfhd(c.sequenceNumber),F.traf(c,p))}static mfhd(c){let p=new Uint8Array([0,0,0,0,c>>>24&255,c>>>16&255,c>>>8&255,c&255]);return F.box(F.types.mfhd,p)}static traf(c,p){let x=c.id,G=F.box(F.types.tfhd,new Uint8Array([0,0,0,0,x>>>24&255,x>>>16&255,x>>>8&255,x&255])),re=F.box(F.types.tfdt,new Uint8Array([0,0,0,0,p>>>24&255,p>>>16&255,p>>>8&255,p&255])),ye=F.sdtp(c),Ae=F.trun(c,ye.byteLength+16+16+8+16+8+8);return F.box(F.types.traf,G,re,Ae,ye)}static sdtp(c){let p=c.samples||[],x=p.length,G=new Uint8Array(4+x);for(let re=0;re<x;re++){let ye=p[re].flags;G[re+4]=ye.isLeading<<6|ye.dependsOn<<4|ye.isDependedOn<<2|ye.hasRedundancy}return F.box(F.types.sdtp,G)}static trun(c,p){let x=c.samples||[],G=x.length,re=12+16*G,ye=new Uint8Array(re);p+=8+re,ye.set([0,0,15,1,G>>>24&255,G>>>16&255,G>>>8&255,G&255,p>>>24&255,p>>>16&255,p>>>8&255,p&255],0);for(let Ae=0;Ae<G;Ae++){let tt=x[Ae].duration,Qe=x[Ae].size,at=x[Ae].flags,Ft=x[Ae].cts;ye.set([tt>>>24&255,tt>>>16&255,tt>>>8&255,tt&255,Qe>>>24&255,Qe>>>16&255,Qe>>>8&255,Qe&255,at.isLeading<<2|at.dependsOn,at.isDependedOn<<6|at.hasRedundancy<<4|at.isNonSync,0,0,Ft>>>24&255,Ft>>>16&255,Ft>>>8&255,Ft&255],12+16*Ae)}return F.box(F.types.trun,ye)}static mdat(c){return F.box(F.types.mdat,c)}}F.init();var se=F;class de{static getSilentFrame(c,p){if(c==="mp4a.40.2"){if(p===1)return new Uint8Array([0,200,0,128,35,128]);if(p===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(p===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(p===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(p===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(p===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(p===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(p===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(p===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=de;class be{constructor(c,p,x,G,re){this.dts=c,this.pts=p,this.duration=x,this.originalDts=G,this.isSyncPoint=re,this.fileposition=null}}class Le{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(c){c.isSyncPoint=!0,this.syncPoints.push(c)}}class Ne{constructor(){this._list=[]}clear(){this._list=[]}appendArray(c){let p=this._list;c.length!==0&&(p.length>0&&c[0].originalDts<p[p.length-1].originalDts&&this.clear(),Array.prototype.push.apply(p,c))}getLastSyncPointBeforeDts(c){if(this._list.length==0)return null;let p=this._list,x=0,G=p.length-1,re=0,ye=0,Ae=G;for(c<p[0].dts&&(x=0,ye=Ae+1);ye<=Ae;)if(re=ye+Math.floor((Ae-ye)/2),re===G||c>=p[re].dts&&c<p[re+1].dts){x=re;break}else p[re].dts<c?ye=re+1:Ae=re-1;return this._list[x]}}class ze{constructor(c){this._type=c,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(c){let p=this._list;if(p.length===0)return-2;let x=p.length-1,G=0,re=0,ye=x,Ae=0;if(c<p[0].originalBeginDts)return Ae=-1,Ae;for(;re<=ye;)if(G=re+Math.floor((ye-re)/2),G===x||c>p[G].lastSample.originalDts&&c<p[G+1].originalBeginDts){Ae=G;break}else p[G].originalBeginDts<c?re=G+1:ye=G-1;return Ae}_searchNearestSegmentAfter(c){return this._searchNearestSegmentBefore(c)+1}append(c){let p=this._list,x=c,G=this._lastAppendLocation,re=0;G!==-1&&G<p.length&&x.originalBeginDts>=p[G].lastSample.originalDts&&(G===p.length-1||G<p.length-1&&x.originalBeginDts<p[G+1].originalBeginDts)?re=G+1:p.length>0&&(re=this._searchNearestSegmentBefore(x.originalBeginDts)+1),this._lastAppendLocation=re,this._list.splice(re,0,x)}getLastSegmentBefore(c){let p=this._searchNearestSegmentBefore(c);return p>=0?this._list[p]:null}getLastSampleBefore(c){let p=this.getLastSegmentBefore(c);return p!=null?p.lastSample:null}getLastSyncPointBefore(c){let p=this._searchNearestSegmentBefore(c),x=this._list[p].syncPoints;for(;x.length===0&&p>0;)p--,x=this._list[p].syncPoints;return x.length>0?x[x.length-1]:null}}class Ie{constructor(c){this.TAG="MP4Remuxer",this._config=c,this._isLive=c.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 ze("audio"),this._videoSegmentInfoList=new ze("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(L.chrome&&(L.version.major<50||L.version.major===50&&L.version.build<2661)),this._fillSilentAfterSeek=L.msedge||L.msie,this._mp3UseMpegAudio=!L.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(c){return c.onDataAvailable=this.remux.bind(this),c.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}get onInitSegment(){return this._onInitSegment}set onInitSegment(c){this._onInitSegment=c}get onMediaSegment(){return this._onMediaSegment}set onMediaSegment(c){this._onMediaSegment=c}insertDiscontinuity(){this._audioNextDts=this._videoNextDts=void 0}seek(c){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}remux(c,p){if(!this._onMediaSegment)throw new K("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(c,p),this._remuxVideo(p),this._remuxAudio(c)}_onTrackMetadataReceived(c,p){let x=null,G="mp4",re=p.codec;if(c==="audio")this._audioMeta=p,p.codec==="mp3"&&this._mp3UseMpegAudio?(G="mpeg",re="",x=new Uint8Array):x=se.generateInitSegment(p);else if(c==="video")this._videoMeta=p,x=se.generateInitSegment(p);else return;if(!this._onInitSegment)throw new K("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(c,{type:c,data:x.buffer,codec:re,container:`${c}/${G}`,mediaDuration:p.duration})}_calculateDtsBase(c,p){this._dtsBaseInited||(c.samples&&c.samples.length&&(this._audioDtsBase=c.samples[0].dts),p.samples&&p.samples.length&&(this._videoDtsBase=p.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}flushStashedSamples(){let c=this._videoStashedLastSample,p=this._audioStashedLastSample,x={type:"video",id:1,sequenceNumber:0,samples:[],length:0};c!=null&&(x.samples.push(c),x.length=c.length);let G={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};p!=null&&(G.samples.push(p),G.length=p.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(x,!0),this._remuxAudio(G,!0)}_remuxAudio(c,p){if(this._audioMeta==null)return;let x=c,G=x.samples,re,ye=-1,Ae=-1,tt=-1,Qe=this._audioMeta.refSampleDuration,at=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,Ft=this._dtsBaseInited&&this._audioNextDts===void 0,Vt=!1;if(!G||G.length===0||G.length===1&&!p)return;let ot=0,qt=null,At=0;at?(ot=0,At=x.length):(ot=8,At=8+x.length);let Fe=null;if(G.length>1&&(Fe=G.pop(),At-=Fe.length),this._audioStashedLastSample!=null){let Lt=this._audioStashedLastSample;this._audioStashedLastSample=null,G.unshift(Lt),At+=Lt.length}Fe!=null&&(this._audioStashedLastSample=Fe);let Be=G[0].dts-this._dtsBase;if(this._audioNextDts)re=Be-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())re=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(Vt=!0);else{let Lt=this._audioSegmentInfoList.getLastSampleBefore(Be);if(Lt!=null){let Et=Be-(Lt.originalDts+Lt.duration);Et<=3&&(Et=0);let Oe=Lt.dts+Lt.duration+Et;re=Be-Oe}else re=0}if(Vt){let Lt=Be-re,Et=this._videoSegmentInfoList.getLastSegmentBefore(Be);if(Et!=null&&Et.beginDts<Lt){let Oe=ge.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(Oe){let Me=Et.beginDts,He=Lt-Et.beginDts;Z.v(this.TAG,`InsertPrefixSilentAudio: dts: ${Me}, duration: ${He}`),G.unshift({unit:Oe,dts:Me,pts:Me}),At+=Oe.byteLength}}else Vt=!1}let ct=[];for(let Lt=0;Lt<G.length;Lt++){let Et=G[Lt],Oe=Et.unit,Me=Et.dts-this._dtsBase,He=Me-re;ye===-1&&(ye=He);let nt=0;Lt!==G.length-1?nt=G[Lt+1].dts-this._dtsBase-re-He:Fe!=null?nt=Fe.dts-this._dtsBase-re-He:ct.length>=1?nt=ct[ct.length-1].duration:nt=Math.floor(Qe);let Ye=!1,et=null;if(nt>Qe*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!L.safari){Ye=!0;let Je=Math.abs(nt-Qe),Dt=Math.ceil(Je/Qe),Zt=He+Qe;Z.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
|
|
dts: ${He+nt} ms, expected: ${He+Math.round(Qe)} ms, delta: ${Math.round(Je)} ms, generate: ${Dt} frames`);let Ut=ge.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);Ut==null&&(Z.w(this.TAG,`Unable to generate silent frame for ${this._audioMeta.originalCodec} with ${this._audioMeta.channelCount} channels, repeat last frame`),Ut=Oe),et=[];for(let on=0;on<Dt;on++){let _n=Math.round(Zt);if(et.length>0){let Xt=et[et.length-1];Xt.duration=_n-Xt.dts}let cn={dts:_n,pts:_n,cts:0,unit:Ut,size:Ut.byteLength,duration:0,originalDts:Me,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};et.push(cn),At+=cn.size,Zt+=Qe}let rn=et[et.length-1];rn.duration=He+nt-rn.dts,nt=Math.round(Qe)}ct.push({dts:He,pts:He,cts:0,unit:Et.unit,size:Et.unit.byteLength,duration:nt,originalDts:Me,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),Ye&&ct.push.apply(ct,et)}at?qt=new Uint8Array(At):(qt=new Uint8Array(At),qt[0]=At>>>24&255,qt[1]=At>>>16&255,qt[2]=At>>>8&255,qt[3]=At&255,qt.set(se.types.mdat,4));for(let Lt=0;Lt<ct.length;Lt++){let Et=ct[Lt].unit;qt.set(Et,ot),ot+=Et.byteLength}let It=ct[ct.length-1];Ae=It.dts+It.duration,this._audioNextDts=Ae;let Pt=new Le;Pt.beginDts=ye,Pt.endDts=Ae,Pt.beginPts=ye,Pt.endPts=Ae,Pt.originalBeginDts=ct[0].originalDts,Pt.originalEndDts=It.originalDts+It.duration,Pt.firstSample=new be(ct[0].dts,ct[0].pts,ct[0].duration,ct[0].originalDts,!1),Pt.lastSample=new be(It.dts,It.pts,It.duration,It.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(Pt),x.samples=ct,x.sequenceNumber++;let dn=null;at?dn=new Uint8Array:dn=se.moof(x,ye),x.samples=[],x.length=0;let fn={type:"audio",data:this._mergeBoxes(dn,qt).buffer,sampleCount:ct.length,info:Pt};at&&Ft&&(fn.timestampOffset=ye),this._onMediaSegment("audio",fn)}_remuxVideo(c,p){if(this._videoMeta==null)return;let x=c,G=x.samples,re,ye=-1,Ae=-1,tt=-1,Qe=-1;if(!G||G.length===0||G.length===1&&!p)return;let at=8,Ft=null,Vt=8+c.length,ot=null;if(G.length>1&&(ot=G.pop(),Vt-=ot.length),this._videoStashedLastSample!=null){let It=this._videoStashedLastSample;this._videoStashedLastSample=null,G.unshift(It),Vt+=It.length}ot!=null&&(this._videoStashedLastSample=ot);let qt=G[0].dts-this._dtsBase;if(this._videoNextDts)re=qt-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())re=0;else{let It=this._videoSegmentInfoList.getLastSampleBefore(qt);if(It!=null){let Pt=qt-(It.originalDts+It.duration);Pt<=3&&(Pt=0);let dn=It.dts+It.duration+Pt;re=qt-dn}else re=0}let At=new Le,Fe=[];for(let It=0;It<G.length;It++){let Pt=G[It],dn=Pt.dts-this._dtsBase,fn=Pt.isKeyframe,Lt=dn-re,Et=Pt.cts,Oe=Lt+Et;ye===-1&&(ye=Lt,tt=Oe);let Me=0;if(It!==G.length-1?Me=G[It+1].dts-this._dtsBase-re-Lt:ot!=null?Me=ot.dts-this._dtsBase-re-Lt:Fe.length>=1?Me=Fe[Fe.length-1].duration:Me=Math.floor(this._videoMeta.refSampleDuration),fn){let He=new be(Lt,Oe,Me,Pt.dts,!0);He.fileposition=Pt.fileposition,At.appendSyncPoint(He)}Fe.push({dts:Lt,pts:Oe,cts:Et,units:Pt.units,size:Pt.length,isKeyframe:fn,duration:Me,originalDts:dn,flags:{isLeading:0,dependsOn:fn?2:1,isDependedOn:fn?1:0,hasRedundancy:0,isNonSync:fn?0:1}})}Ft=new Uint8Array(Vt),Ft[0]=Vt>>>24&255,Ft[1]=Vt>>>16&255,Ft[2]=Vt>>>8&255,Ft[3]=Vt&255,Ft.set(se.types.mdat,4);for(let It=0;It<Fe.length;It++){let Pt=Fe[It].units;for(;Pt.length;){let fn=Pt.shift().data;Ft.set(fn,at),at+=fn.byteLength}}let Be=Fe[Fe.length-1];if(Ae=Be.dts+Be.duration,Qe=Be.pts+Be.duration,this._videoNextDts=Ae,At.beginDts=ye,At.endDts=Ae,At.beginPts=tt,At.endPts=Qe,At.originalBeginDts=Fe[0].originalDts,At.originalEndDts=Be.originalDts+Be.duration,At.firstSample=new be(Fe[0].dts,Fe[0].pts,Fe[0].duration,Fe[0].originalDts,Fe[0].isKeyframe),At.lastSample=new be(Be.dts,Be.pts,Be.duration,Be.originalDts,Be.isKeyframe),this._isLive||this._videoSegmentInfoList.append(At),x.samples=Fe,x.sequenceNumber++,this._forceFirstIDR){let It=Fe[0].flags;It.dependsOn=2,It.isNonSync=0}let ct=se.moof(x,ye);x.samples=[],x.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(ct,Ft).buffer,sampleCount:Fe.length,info:At})}_mergeBoxes(c,p){let x=new Uint8Array(c.byteLength+p.byteLength);return x.set(c,0),x.set(p,c.byteLength),x}}var Ke=Ie,Ce={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 vt{constructor(c,p){this.TAG="TransmuxingController",this._emitter=new(fe()),this._config=p,c.segments||(c.segments=[{duration:c.duration,filesize:c.filesize,url:c.url}]),typeof c.cors!="boolean"&&(c.cors=!0),typeof c.withCredentials!="boolean"&&(c.withCredentials=!1),this._mediaDataSource=c,this._currentSegmentIndex=0;let x=0;this._mediaDataSource.segments.forEach(G=>{G.timestampBase=x,x+=G.duration,G.cors=c.cors,G.withCredentials=c.withCredentials,p.referrerPolicy&&(G.referrerPolicy=p.referrerPolicy)}),!isNaN(x)&&this._mediaDataSource.duration!==x&&(this._mediaDataSource.duration=x),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(c,p){this._emitter.addListener(c,p)}off(c,p){this._emitter.removeListener(c,p)}start(){this._loadSegment(0),this._enableStatisticsReporter()}_loadSegment(c,p){this._currentSegmentIndex=c;let x=this._mediaDataSource.segments[c],G=this._ioctl=new z(x,this._config,c);G.onError=this._onIOException.bind(this),G.onSeeked=this._onIOSeeked.bind(this),G.onComplete=this._onIOComplete.bind(this),G.onRedirect=this._onIORedirect.bind(this),G.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),p?this._demuxer.bindDataSource(this._ioctl):G.onDataArrival=this._onInitChunkArrival.bind(this),G.open(p)}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(c){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;let p=this._searchSegmentIndexContains(c);if(p===this._currentSegmentIndex){let x=this._mediaInfo.segments[p];if(x==null)this._pendingSeekTime=c;else{let G=x.getNearestKeyframe(c);this._remuxer.seek(G.milliseconds),this._ioctl.seek(G.fileposition),this._pendingResolveSeekPoint=G.milliseconds}}else{let x=this._mediaInfo.segments[p];if(x==null)this._pendingSeekTime=c,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(p);else{let G=x.getNearestKeyframe(c);this._internalAbort(),this._remuxer.seek(c),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[p].timestampBase,this._loadSegment(p,G.fileposition),this._pendingResolveSeekPoint=G.milliseconds,this._reportSegmentMediaInfo(p)}}this._enableStatisticsReporter()}_searchSegmentIndexContains(c){let p=this._mediaDataSource.segments,x=p.length-1;for(let G=0;G<p.length;G++)if(c<p[G].timestampBase){x=G-1;break}return x}_onInitChunkArrival(c,p){let x=null,G=0;if(p>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,G=this._demuxer.parseChunks(c,p);else if((x=ne.probe(c)).match){this._demuxer=new ne(x,this._config),this._remuxer||(this._remuxer=new Ke(this._config));let re=this._mediaDataSource;re.duration!=null&&!isNaN(re.duration)&&(this._demuxer.overridedDuration=re.duration),typeof re.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=re.hasAudio),typeof re.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=re.hasVideo),this._demuxer.timestampBase=re.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),G=this._demuxer.parseChunks(c,p)}else x=null,Z.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(()=>{this._internalAbort()}),this._emitter.emit(Ce.DEMUX_ERROR,M.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),G=0;return G}_onMediaInfo(c){this._mediaInfo==null&&(this._mediaInfo=Object.assign({},c),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,qe.prototype));let p=Object.assign({},c);Object.setPrototypeOf(p,qe.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=p,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(()=>{let x=this._pendingSeekTime;this._pendingSeekTime=null,this.seek(x)})}_onMetaDataArrived(c){this._emitter.emit(Ce.METADATA_ARRIVED,c)}_onScriptDataArrived(c){this._emitter.emit(Ce.SCRIPTDATA_ARRIVED,c)}_onIOSeeked(){this._remuxer.insertDiscontinuity()}_onIOComplete(c){let x=c+1;x<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(x)):(this._remuxer.flushStashedSamples(),this._emitter.emit(Ce.LOADING_COMPLETE),this._disableStatisticsReporter())}_onIORedirect(c){let p=this._ioctl.extraData;this._mediaDataSource.segments[p].redirectedURL=c}_onIORecoveredEarlyEof(){this._emitter.emit(Ce.RECOVERED_EARLY_EOF)}_onIOException(c,p){Z.e(this.TAG,`IOException: type = ${c}, code = ${p.code}, msg = ${p.msg}`),this._emitter.emit(Ce.IO_ERROR,c,p),this._disableStatisticsReporter()}_onDemuxException(c,p){Z.e(this.TAG,`DemuxException: type = ${c}, info = ${p}`),this._emitter.emit(Ce.DEMUX_ERROR,c,p)}_onRemuxerInitSegmentArrival(c,p){this._emitter.emit(Ce.INIT_SEGMENT,c,p)}_onRemuxerMediaSegmentArrival(c,p){if(this._pendingSeekTime==null&&(this._emitter.emit(Ce.MEDIA_SEGMENT,c,p),this._pendingResolveSeekPoint!=null&&c==="video")){let x=p.info.syncPoints,G=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,L.safari&&x.length>0&&x[0].originalDts===G&&(G=x[0].pts),this._emitter.emit(Ce.RECOMMEND_SEEKPOINT,G)}}_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(c){let p=this._mediaInfo.segments[c],x=Object.assign({},p);x.duration=this._mediaInfo.duration,x.segmentCount=this._mediaInfo.segmentCount,delete x.segments,delete x.keyframesIndex,this._emitter.emit(Ce.MEDIA_INFO,x)}_reportStatisticsInfo(){let c={};c.url=this._ioctl.currentURL,c.hasRedirect=this._ioctl.hasRedirect,c.hasRedirect&&(c.redirectedURL=this._ioctl.currentRedirectedURL),c.speed=this._ioctl.currentSpeed,c.loaderType=this._ioctl.loaderType,c.currentSegmentIndex=this._currentSegmentIndex,c.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(Ce.STATISTICS_INFO,c)}}var st=vt,Ze=function(Xe){let c="TransmuxingWorker",p=null,x=At.bind(this);q.install(),Xe.addEventListener("message",function(Fe){switch(Fe.data.cmd){case"init":p=new st(Fe.data.param[0],Fe.data.param[1]),p.on(Ce.IO_ERROR,Vt.bind(this)),p.on(Ce.DEMUX_ERROR,ot.bind(this)),p.on(Ce.INIT_SEGMENT,G.bind(this)),p.on(Ce.MEDIA_SEGMENT,re.bind(this)),p.on(Ce.LOADING_COMPLETE,ye.bind(this)),p.on(Ce.RECOVERED_EARLY_EOF,Ae.bind(this)),p.on(Ce.MEDIA_INFO,tt.bind(this)),p.on(Ce.METADATA_ARRIVED,Qe.bind(this)),p.on(Ce.SCRIPTDATA_ARRIVED,at.bind(this)),p.on(Ce.STATISTICS_INFO,Ft.bind(this)),p.on(Ce.RECOMMEND_SEEKPOINT,qt.bind(this));break;case"destroy":p&&(p.destroy(),p=null),Xe.postMessage({msg:"destroyed"});break;case"start":p.start();break;case"stop":p.stop();break;case"seek":p.seek(Fe.data.param);break;case"pause":p.pause();break;case"resume":p.resume();break;case"logging_config":{let Be=Fe.data.param;Te.applyConfig(Be),Be.enableCallback===!0?Te.addLogListener(x):Te.removeLogListener(x);break}}});function G(Fe,Be){let ct={msg:Ce.INIT_SEGMENT,data:{type:Fe,data:Be}};Xe.postMessage(ct,[Be.data])}function re(Fe,Be){let ct={msg:Ce.MEDIA_SEGMENT,data:{type:Fe,data:Be}};Xe.postMessage(ct,[Be.data])}function ye(){let Fe={msg:Ce.LOADING_COMPLETE};Xe.postMessage(Fe)}function Ae(){let Fe={msg:Ce.RECOVERED_EARLY_EOF};Xe.postMessage(Fe)}function tt(Fe){let Be={msg:Ce.MEDIA_INFO,data:Fe};Xe.postMessage(Be)}function Qe(Fe){let Be={msg:Ce.METADATA_ARRIVED,data:Fe};Xe.postMessage(Be)}function at(Fe){let Be={msg:Ce.SCRIPTDATA_ARRIVED,data:Fe};Xe.postMessage(Be)}function Ft(Fe){let Be={msg:Ce.STATISTICS_INFO,data:Fe};Xe.postMessage(Be)}function Vt(Fe,Be){Xe.postMessage({msg:Ce.IO_ERROR,data:{type:Fe,info:Be}})}function ot(Fe,Be){Xe.postMessage({msg:Ce.DEMUX_ERROR,data:{type:Fe,info:Be}})}function qt(Fe){Xe.postMessage({msg:Ce.RECOMMEND_SEEKPOINT,data:Fe})}function At(Fe,Be){Xe.postMessage({msg:"logcat_callback",data:{type:Fe,logcat:Be}})}};class Ht{constructor(c,p){if(this.TAG="Transmuxer",this._emitter=new(fe()),p.enableWorker&&typeof Worker!="undefined")try{let x=b(82059);this._worker=x(Ze),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[c,p]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},Te.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:Te.getConfig()})}catch(x){Z.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new st(c,p)}else this._controller=new st(c,p);if(this._controller){let x=this._controller;x.on(Ce.IO_ERROR,this._onIOError.bind(this)),x.on(Ce.DEMUX_ERROR,this._onDemuxError.bind(this)),x.on(Ce.INIT_SEGMENT,this._onInitSegment.bind(this)),x.on(Ce.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),x.on(Ce.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),x.on(Ce.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),x.on(Ce.MEDIA_INFO,this._onMediaInfo.bind(this)),x.on(Ce.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),x.on(Ce.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),x.on(Ce.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),x.on(Ce.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}destroy(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),Te.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}on(c,p){this._emitter.addListener(c,p)}off(c,p){this._emitter.removeListener(c,p)}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(c){this._worker?this._worker.postMessage({cmd:"seek",param:c}):this._controller.seek(c)}pause(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}resume(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}_onInitSegment(c,p){Promise.resolve().then(()=>{this._emitter.emit(Ce.INIT_SEGMENT,c,p)})}_onMediaSegment(c,p){Promise.resolve().then(()=>{this._emitter.emit(Ce.MEDIA_SEGMENT,c,p)})}_onLoadingComplete(){Promise.resolve().then(()=>{this._emitter.emit(Ce.LOADING_COMPLETE)})}_onRecoveredEarlyEof(){Promise.resolve().then(()=>{this._emitter.emit(Ce.RECOVERED_EARLY_EOF)})}_onMediaInfo(c){Promise.resolve().then(()=>{this._emitter.emit(Ce.MEDIA_INFO,c)})}_onMetaDataArrived(c){Promise.resolve().then(()=>{this._emitter.emit(Ce.METADATA_ARRIVED,c)})}_onScriptDataArrived(c){Promise.resolve().then(()=>{this._emitter.emit(Ce.SCRIPTDATA_ARRIVED,c)})}_onStatisticsInfo(c){Promise.resolve().then(()=>{this._emitter.emit(Ce.STATISTICS_INFO,c)})}_onIOError(c,p){Promise.resolve().then(()=>{this._emitter.emit(Ce.IO_ERROR,c,p)})}_onDemuxError(c,p){Promise.resolve().then(()=>{this._emitter.emit(Ce.DEMUX_ERROR,c,p)})}_onRecommendSeekpoint(c){Promise.resolve().then(()=>{this._emitter.emit(Ce.RECOMMEND_SEEKPOINT,c)})}_onLoggingConfigChanged(c){this._worker&&this._worker.postMessage({cmd:"logging_config",param:c})}_onWorkerMessage(c){let p=c.data,x=p.data;if(p.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(p.msg){case Ce.INIT_SEGMENT:case Ce.MEDIA_SEGMENT:this._emitter.emit(p.msg,x.type,x.data);break;case Ce.LOADING_COMPLETE:case Ce.RECOVERED_EARLY_EOF:this._emitter.emit(p.msg);break;case Ce.MEDIA_INFO:Object.setPrototypeOf(x,qe.prototype),this._emitter.emit(p.msg,x);break;case Ce.METADATA_ARRIVED:case Ce.SCRIPTDATA_ARRIVED:case Ce.STATISTICS_INFO:this._emitter.emit(p.msg,x);break;case Ce.IO_ERROR:case Ce.DEMUX_ERROR:this._emitter.emit(p.msg,x.type,x.info);break;case Ce.RECOMMEND_SEEKPOINT:this._emitter.emit(p.msg,x);break;case"logcat_callback":Z.emitter.emit("log",x.type,x.logcat);break;default:break}}}var Kt=Ht,Ot={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};class ht{constructor(c){this.TAG="MSEController",this._config=c,this._emitter=new(fe()),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 Ne}destroy(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}on(c,p){this._emitter.addListener(c,p)}off(c,p){this._emitter.removeListener(c,p)}attachMediaElement(c){if(this._mediaSource)throw new K("MediaSource has been attached to an HTMLMediaElement!");let p=this._mediaSource=new window.MediaSource;p.addEventListener("sourceopen",this.e.onSourceOpen),p.addEventListener("sourceended",this.e.onSourceEnded),p.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=c,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),c.src=this._mediaSourceObjectURL}detachMediaElement(){if(this._mediaSource){let c=this._mediaSource;for(let p in this._sourceBuffers){let x=this._pendingSegments[p];x.splice(0,x.length),this._pendingSegments[p]=null,this._pendingRemoveRanges[p]=null,this._lastInitSegments[p]=null;let G=this._sourceBuffers[p];if(G){if(c.readyState!=="closed"){try{c.removeSourceBuffer(G)}catch(re){Z.e(this.TAG,re.message)}G.removeEventListener("error",this.e.onSourceBufferError),G.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[p]=null,this._sourceBuffers[p]=null}}if(c.readyState==="open")try{c.endOfStream()}catch(p){Z.e(this.TAG,p.message)}c.removeEventListener("sourceopen",this.e.onSourceOpen),c.removeEventListener("sourceended",this.e.onSourceEnded),c.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(c,p){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(c),this._pendingSegments[c.type].push(c);return}let x=c,G=`${x.container}`;x.codec&&x.codec.length>0&&(G+=`;codecs=${x.codec}`);let re=!1;if(Z.v(this.TAG,"Received Initialization Segment, mimeType: "+G),this._lastInitSegments[x.type]=x,G!==this._mimeTypes[x.type]){if(this._mimeTypes[x.type])Z.v(this.TAG,`Notice: ${x.type} mimeType changed, origin: ${this._mimeTypes[x.type]}, target: ${G}`);else{re=!0;try{let ye=this._sourceBuffers[x.type]=this._mediaSource.addSourceBuffer(G);ye.addEventListener("error",this.e.onSourceBufferError),ye.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(ye){Z.e(this.TAG,ye.message),this._emitter.emit(Ot.ERROR,{code:ye.code,msg:ye.message});return}}this._mimeTypes[x.type]=G}p||this._pendingSegments[x.type].push(x),re||this._sourceBuffers[x.type]&&!this._sourceBuffers[x.type].updating&&this._doAppendSegments(),L.safari&&x.container==="audio/mpeg"&&x.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=x.mediaDuration/1e3,this._updateMediaSourceDuration())}appendMediaSegment(c){let p=c;this._pendingSegments[p.type].push(p),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();let x=this._sourceBuffers[p.type];x&&!x.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}seek(c){for(let p in this._sourceBuffers){if(!this._sourceBuffers[p])continue;let x=this._sourceBuffers[p];if(this._mediaSource.readyState==="open")try{x.abort()}catch(re){Z.e(this.TAG,re.message)}this._idrList.clear();let G=this._pendingSegments[p];if(G.splice(0,G.length),this._mediaSource.readyState!=="closed"){for(let re=0;re<x.buffered.length;re++){let ye=x.buffered.start(re),Ae=x.buffered.end(re);this._pendingRemoveRanges[p].push({start:ye,end:Ae})}if(x.updating||this._doRemoveRanges(),L.safari){let re=this._lastInitSegments[p];re&&(this._pendingSegments[p].push(re),x.updating||this._doAppendSegments())}}}}endOfStream(){let c=this._mediaSource,p=this._sourceBuffers;if(!c||c.readyState!=="open"){c&&c.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}p.video&&p.video.updating||p.audio&&p.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,c.endOfStream())}getNearestKeyframe(c){return this._idrList.getLastSyncPointBeforeDts(c)}_needCleanupSourceBuffer(){if(!this._config.autoCleanupSourceBuffer)return!1;let c=this._mediaElement.currentTime;for(let p in this._sourceBuffers){let x=this._sourceBuffers[p];if(x){let G=x.buffered;if(G.length>=1&&c-G.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}_doCleanupSourceBuffer(){let c=this._mediaElement.currentTime;for(let p in this._sourceBuffers){let x=this._sourceBuffers[p];if(x){let G=x.buffered,re=!1;for(let ye=0;ye<G.length;ye++){let Ae=G.start(ye),tt=G.end(ye);if(Ae<=c&&c<tt+3){if(c-Ae>=this._config.autoCleanupMaxBackwardDuration){re=!0;let Qe=c-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[p].push({start:Ae,end:Qe})}}else tt<c&&(re=!0,this._pendingRemoveRanges[p].push({start:Ae,end:tt}))}re&&!x.updating&&this._doRemoveRanges()}}}_updateMediaSourceDuration(){let c=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open"||c.video&&c.video.updating||c.audio&&c.audio.updating)return;let p=this._mediaSource.duration,x=this._pendingMediaDuration;x>0&&(isNaN(p)||x>p)&&(Z.v(this.TAG,`Update MediaSource duration from ${p} to ${x}`),this._mediaSource.duration=x),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}_doRemoveRanges(){for(let c in this._pendingRemoveRanges){if(!this._sourceBuffers[c]||this._sourceBuffers[c].updating)continue;let p=this._sourceBuffers[c],x=this._pendingRemoveRanges[c];for(;x.length&&!p.updating;){let G=x.shift();p.remove(G.start,G.end)}}}_doAppendSegments(){let c=this._pendingSegments;for(let p in c)if(!(!this._sourceBuffers[p]||this._sourceBuffers[p].updating)&&c[p].length>0){let x=c[p].shift();if(x.timestampOffset){let G=this._sourceBuffers[p].timestampOffset,re=x.timestampOffset/1e3;Math.abs(G-re)>.1&&(Z.v(this.TAG,`Update MPEG audio timestampOffset from ${G} to ${re}`),this._sourceBuffers[p].timestampOffset=re),delete x.timestampOffset}if(!x.data||x.data.byteLength===0)continue;try{this._sourceBuffers[p].appendBuffer(x.data),this._isBufferFull=!1,p==="video"&&x.hasOwnProperty("info")&&this._idrList.appendArray(x.info.syncPoints)}catch(G){this._pendingSegments[p].unshift(x),G.code===22?(this._isBufferFull||this._emitter.emit(Ot.BUFFER_FULL),this._isBufferFull=!0):(Z.e(this.TAG,G.message),this._emitter.emit(Ot.ERROR,{code:G.code,msg:G.message}))}}}_onSourceOpen(){if(Z.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){let c=this._pendingSourceBufferInit;for(;c.length;){let p=c.shift();this.appendInitSegment(p,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(Ot.SOURCE_OPEN)}_onSourceEnded(){Z.v(this.TAG,"MediaSource onSourceEnded")}_onSourceClose(){Z.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 c=this._pendingSegments;return c.video.length>0||c.audio.length>0}_hasPendingRemoveRanges(){let c=this._pendingRemoveRanges;return c.video.length>0||c.audio.length>0}_onSourceBufferUpdateEnd(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(Ot.UPDATE_END)}_onSourceBufferError(c){Z.e(this.TAG,`SourceBuffer Error: ${c}`)}}var yt=ht;const ut={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Ct={NETWORK_EXCEPTION:g.EXCEPTION,NETWORK_STATUS_CODE_INVALID:g.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:g.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:g.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:M.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:M.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:M.CODEC_UNSUPPORTED};class ft{constructor(c,p){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(fe()),this._config=y(),typeof p=="object"&&Object.assign(this._config,p),c.type.toLowerCase()!=="flv")throw new D("FlvPlayer requires an flv MediaDataSource input!");c.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=c,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 x=L.chrome&&(L.version.major<50||L.version.major===50&&L.version.build<2661);this._alwaysSeekKeyframe=!!(x||L.msedge||L.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(c,p){c===me.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(me.MEDIA_INFO,this.mediaInfo)}):c===me.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(me.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(c,p)}off(c,p){this._emitter.removeListener(c,p)}attachMediaElement(c){if(this._mediaElement=c,c.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),c.addEventListener("seeking",this.e.onvSeeking),c.addEventListener("canplay",this.e.onvCanPlay),c.addEventListener("stalled",this.e.onvStalled),c.addEventListener("progress",this.e.onvProgress),this._msectl=new yt(this._config),this._msectl.on(Ot.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(Ot.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(Ot.SOURCE_OPEN,()=>{this._mseSourceOpened=!0,this._hasPendingLoad&&(this._hasPendingLoad=!1,this.load())}),this._msectl.on(Ot.ERROR,p=>{this._emitter.emit(me.ERROR,ut.MEDIA_ERROR,Ct.MEDIA_MSE_ERROR,p)}),this._msectl.attachMediaElement(c),this._pendingSeekTime!=null)try{c.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(p){}}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 Kt(this._mediaDataSource,this._config),this._transmuxer.on(Ce.INIT_SEGMENT,(c,p)=>{this._msectl.appendInitSegment(p)}),this._transmuxer.on(Ce.MEDIA_SEGMENT,(c,p)=>{if(this._msectl.appendMediaSegment(p),this._config.lazyLoad&&!this._config.isLive){let x=this._mediaElement.currentTime;p.info.endDts>=(x+this._config.lazyLoadMaxDuration)*1e3&&this._progressChecker==null&&(Z.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}),this._transmuxer.on(Ce.LOADING_COMPLETE,()=>{this._msectl.endOfStream(),this._emitter.emit(me.LOADING_COMPLETE)}),this._transmuxer.on(Ce.RECOVERED_EARLY_EOF,()=>{this._emitter.emit(me.RECOVERED_EARLY_EOF)}),this._transmuxer.on(Ce.IO_ERROR,(c,p)=>{this._emitter.emit(me.ERROR,ut.NETWORK_ERROR,c,p)}),this._transmuxer.on(Ce.DEMUX_ERROR,(c,p)=>{this._emitter.emit(me.ERROR,ut.MEDIA_ERROR,c,{code:-1,msg:p})}),this._transmuxer.on(Ce.MEDIA_INFO,c=>{this._mediaInfo=c,this._emitter.emit(me.MEDIA_INFO,Object.assign({},c))}),this._transmuxer.on(Ce.METADATA_ARRIVED,c=>{this._emitter.emit(me.METADATA_ARRIVED,c)}),this._transmuxer.on(Ce.SCRIPTDATA_ARRIVED,c=>{this._emitter.emit(me.SCRIPTDATA_ARRIVED,c)}),this._transmuxer.on(Ce.STATISTICS_INFO,c=>{this._statisticsInfo=this._fillStatisticsInfo(c),this._emitter.emit(me.STATISTICS_INFO,Object.assign({},this._statisticsInfo))}),this._transmuxer.on(Ce.RECOMMEND_SEEKPOINT,c=>{this._mediaElement&&!this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=c/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(c){this._mediaElement.volume=c}get muted(){return this._mediaElement.muted}set muted(c){this._mediaElement.muted=c}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(c){this._mediaElement?this._internalSeek(c):this._pendingSeekTime=c}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(c){if(c.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return c;let p=!0,x=0,G=0;if(this._mediaElement.getVideoPlaybackQuality){let re=this._mediaElement.getVideoPlaybackQuality();x=re.totalVideoFrames,G=re.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(x=this._mediaElement.webkitDecodedFrameCount,G=this._mediaElement.webkitDroppedFrameCount):p=!1;return p&&(c.decodedFrames=x,c.droppedFrames=G),c}_onmseUpdateEnd(){if(!this._config.lazyLoad||this._config.isLive)return;let c=this._mediaElement.buffered,p=this._mediaElement.currentTime,x=0,G=0;for(let re=0;re<c.length;re++){let ye=c.start(re),Ae=c.end(re);if(ye<=p&&p<Ae){x=ye,G=Ae;break}}G>=p+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(Z.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}_onmseBufferFull(){Z.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 c=this._mediaElement.currentTime,p=this._mediaElement.buffered,x=!1;for(let G=0;G<p.length;G++){let re=p.start(G),ye=p.end(G);if(c>=re&&c<ye){c>=ye-this._config.lazyLoadRecoverDuration&&(x=!0);break}}x&&(window.clearInterval(this._progressChecker),this._progressChecker=null,x&&(Z.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}_isTimepointBuffered(c){let p=this._mediaElement.buffered;for(let x=0;x<p.length;x++){let G=p.start(x),re=p.end(x);if(c>=G&&c<re)return!0}return!1}_internalSeek(c){let p=this._isTimepointBuffered(c),x=!1,G=0;if(c<1&&this._mediaElement.buffered.length>0){let re=this._mediaElement.buffered.start(0);(re<1&&c<re||L.safari)&&(x=!0,G=L.safari?.1:re)}if(x)this._requestSetTime=!0,this._mediaElement.currentTime=G;else if(p){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=c;else{let re=this._msectl.getNearestKeyframe(Math.floor(c*1e3));this._requestSetTime=!0,re!=null?this._mediaElement.currentTime=re.dts/1e3:this._mediaElement.currentTime=c}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(c),this._transmuxer.seek(Math.floor(c*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=c)}_checkAndApplyUnbufferedSeekpoint(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){let c=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(c)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(c),this._transmuxer.seek(Math.floor(c*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=c))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_checkAndResumeStuckPlayback(c){let p=this._mediaElement;if(c||!this._receivedCanPlay||p.readyState<2){let x=p.buffered;x.length>0&&p.currentTime<x.start(0)&&(Z.w(this.TAG,`Playback seems stuck at ${p.currentTime}, seek to ${x.start(0)}`),this._requestSetTime=!0,this._mediaElement.currentTime=x.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}_onvLoadedMetadata(c){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}_onvSeeking(c){let p=this._mediaElement.currentTime,x=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(p<1&&x.length>0){let G=x.start(0);if(G<1&&p<G||L.safari){this._requestSetTime=!0,this._mediaElement.currentTime=L.safari?.1:G;return}}if(this._isTimepointBuffered(p)){if(this._alwaysSeekKeyframe){let G=this._msectl.getNearestKeyframe(Math.floor(p*1e3));G!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=G.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:p,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_onvCanPlay(c){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}_onvStalled(c){this._checkAndResumeStuckPlayback(!0)}_onvProgress(c){this._checkAndResumeStuckPlayback()}}var Mt=ft;class Qt{constructor(c,p){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(fe()),this._config=y(),typeof p=="object"&&Object.assign(this._config,p),c.type.toLowerCase()==="flv")throw new D("NativePlayer does't support flv MediaDataSource input!");if(c.hasOwnProperty("segments"))throw new D(`NativePlayer(${c.type}) doesn't support multipart playback!`);this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=c,this._mediaElement=null}destroy(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(c,p){c===me.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(me.MEDIA_INFO,this.mediaInfo)}):c===me.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(me.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(c,p)}off(c,p){this._emitter.removeListener(c,p)}attachMediaElement(c){if(this._mediaElement=c,c.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{c.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(p){}}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(c){this._mediaElement.volume=c}get muted(){return this._mediaElement.muted}set muted(c){this._mediaElement.muted=c}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(c){this._mediaElement?this._mediaElement.currentTime=c:this._pendingSeekTime=c}get mediaInfo(){let p={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(p.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(p.width=this._mediaElement.videoWidth,p.height=this._mediaElement.videoHeight)),p}get statisticsInfo(){let c={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return c;let p=!0,x=0,G=0;if(this._mediaElement.getVideoPlaybackQuality){let re=this._mediaElement.getVideoPlaybackQuality();x=re.totalVideoFrames,G=re.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(x=this._mediaElement.webkitDecodedFrameCount,G=this._mediaElement.webkitDroppedFrameCount):p=!1;return p&&(c.decodedFrames=x,c.droppedFrames=G),c}_onvLoadedMetadata(c){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(me.MEDIA_INFO,this.mediaInfo)}_reportStatisticsInfo(){this._emitter.emit(me.STATISTICS_INFO,this.statisticsInfo)}}var Jt=Qt;q.install();function ln(Xe,c){let p=Xe;if(p==null||typeof p!="object")throw new D("MediaDataSource must be an javascript object!");if(!p.hasOwnProperty("type"))throw new D("MediaDataSource must has type field to indicate video file type!");switch(p.type){case"flv":return new Mt(p,c);default:return new Jt(p,c)}}function an(){return $.supportMSEH264Playback()}function jt(){return $.getFeatureList()}let Wt={};Wt.createPlayer=ln,Wt.isSupported=an,Wt.getFeatureList=jt,Wt.BaseLoader=m,Wt.LoaderStatus=u,Wt.LoaderErrors=g,Wt.Events=me,Wt.ErrorTypes=ut,Wt.ErrorDetails=Ct,Wt.FlvPlayer=Mt,Wt.NativePlayer=Jt,Wt.LoggingControl=Te,Object.defineProperty(Wt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var pt=Wt},36785:function(bt,ke,b){"use strict";b.d(ke,{o2:function(){return oe},yT:function(){return Z}});var B=b(26407),q=b(33166);const ve=q.i.map(_e=>`${_e}-inverse`),fe=["success","processing","error","default","warning"];function oe(_e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,B.Z)(ve),(0,B.Z)(q.i)).includes(_e):q.i.includes(_e)}function Z(_e){return fe.includes(_e)}},79676:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return Z}});var B=b(19447);function q(_e,le,o,K){if(K===!1)return{adjustX:!1,adjustY:!1};const D=K&&typeof K=="object"?K:{},f={};switch(_e){case"top":case"bottom":f.shiftX=le.dropdownArrowOffset*2+o;break;case"left":case"right":f.shiftY=le.dropdownArrowOffsetVertical*2+o;break}const u=Object.assign(Object.assign({},f),D);return u.shiftX||(u.adjustX=!0),u.shiftY||(u.adjustY=!0),u}const ve={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"]}},fe={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"]}},oe=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function Z(_e){const{arrowWidth:le,autoAdjustOverflow:o,arrowPointAtCenter:K,offset:D,borderRadius:f,visibleFirst:u}=_e,g=le/2,m={};return Object.keys(ve).forEach(I=>{const H=K&&fe[I]||ve[I],L=Object.assign(Object.assign({},H),{offset:[0,0]});switch(m[I]=L,oe.has(I)&&(L.autoArrow=!1),I){case"top":case"topLeft":case"topRight":L.offset[1]=-g-D;break;case"bottom":case"bottomLeft":case"bottomRight":L.offset[1]=g+D;break;case"left":case"leftTop":case"leftBottom":L.offset[0]=-g-D;break;case"right":case"rightTop":case"rightBottom":L.offset[0]=g+D;break}const w=(0,B.fS)({contentRadius:f,limitVerticalRadius:!0});if(K)switch(I){case"topLeft":case"bottomLeft":L.offset[0]=-w.dropdownArrowOffset-g;break;case"topRight":case"bottomRight":L.offset[0]=w.dropdownArrowOffset+g;break;case"leftTop":case"rightTop":L.offset[1]=-w.dropdownArrowOffset-g;break;case"leftBottom":case"rightBottom":L.offset[1]=w.dropdownArrowOffset+g;break}L.overflow=q(I,w,le,o),u&&(L.htmlRegion="visibleFirst")}),m}},98447:function(bt,ke,b){"use strict";b.d(ke,{C2:function(){return oe}});var B=b(17313),q=b(37613),ve=b(83116);const fe=Z=>{const{checkboxCls:_e}=Z,le=`${_e}-wrapper`;return[{[`${_e}-group`]:Object.assign(Object.assign({},(0,B.Wf)(Z)),{display:"inline-flex",flexWrap:"wrap",columnGap:Z.marginXS,[`> ${Z.antCls}-row`]:{flex:1}}),[le]:Object.assign(Object.assign({},(0,B.Wf)(Z)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${le}`]:{marginInlineStart:0},[`&${le}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[_e]:Object.assign(Object.assign({},(0,B.Wf)(Z)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:Z.borderRadiusSM,alignSelf:"center",[`${_e}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${_e}-inner`]:Object.assign({},(0,B.oN)(Z))},[`${_e}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:Z.checkboxSize,height:Z.checkboxSize,direction:"ltr",backgroundColor:Z.colorBgContainer,border:`${Z.lineWidth}px ${Z.lineType} ${Z.colorBorder}`,borderRadius:Z.borderRadiusSM,borderCollapse:"separate",transition:`all ${Z.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:Z.checkboxSize/14*5,height:Z.checkboxSize/14*8,border:`${Z.lineWidthBold}px solid ${Z.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${Z.motionDurationFast} ${Z.motionEaseInBack}, opacity ${Z.motionDurationFast}`}},"& + span":{paddingInlineStart:Z.paddingXS,paddingInlineEnd:Z.paddingXS}})},{[`
|
|
${le}:not(${le}-disabled),
|
|
${_e}:not(${_e}-disabled)
|
|
`]:{[`&:hover ${_e}-inner`]:{borderColor:Z.colorPrimary}},[`${le}:not(${le}-disabled)`]:{[`&:hover ${_e}-checked:not(${_e}-disabled) ${_e}-inner`]:{backgroundColor:Z.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${_e}-checked:not(${_e}-disabled):after`]:{borderColor:Z.colorPrimaryHover}}},{[`${_e}-checked`]:{[`${_e}-inner`]:{backgroundColor:Z.colorPrimary,borderColor:Z.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${Z.motionDurationMid} ${Z.motionEaseOutBack} ${Z.motionDurationFast}`}}},[`
|
|
${le}-checked:not(${le}-disabled),
|
|
${_e}-checked:not(${_e}-disabled)
|
|
`]:{[`&:hover ${_e}-inner`]:{backgroundColor:Z.colorPrimaryHover,borderColor:"transparent"}}},{[_e]:{"&-indeterminate":{[`${_e}-inner`]:{backgroundColor:Z.colorBgContainer,borderColor:Z.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:Z.fontSizeLG/2,height:Z.fontSizeLG/2,backgroundColor:Z.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${le}-disabled`]:{cursor:"not-allowed"},[`${_e}-disabled`]:{[`&, ${_e}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${_e}-inner`]:{background:Z.colorBgContainerDisabled,borderColor:Z.colorBorder,"&:after":{borderColor:Z.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:Z.colorTextDisabled},[`&${_e}-indeterminate ${_e}-inner::after`]:{background:Z.colorTextDisabled}}}]};function oe(Z,_e){const le=(0,q.TS)(_e,{checkboxCls:`.${Z}`,checkboxSize:_e.controlInteractiveSize});return[fe(le)]}ke.ZP=(0,ve.Z)("Checkbox",(Z,_e)=>{let{prefixCls:le}=_e;return[oe(le,Z)]})},91857:function(bt,ke,b){"use strict";var B=b(59301),q=b(38819),ve=b(92310),fe=b.n(ve),oe=b(31561),Z=b(70425),_e=b(18929),le=b(2738),o=b(79676),K=b(53487),D=b(92343),f=b(36355),u=b(20834),g=b(40875),m=b(88088),I=b(47211);const H=null,L=E=>{const{menu:Q,arrow:te,prefixCls:ie,children:Ee,trigger:we,disabled:xe,dropdownRender:he,getPopupContainer:V,overlayClassName:T,rootClassName:C,open:R,onOpenChange:z,visible:Y,onVisibleChange:y,mouseEnterDelay:v=.15,mouseLeaveDelay:$=.1,autoAdjustOverflow:j=!0,placement:me="",overlay:Se,transitionName:Te}=E,{getPopupContainer:De,getPrefixCls:qe,direction:lt}=B.useContext(f.E_),We=B.useMemo(()=>{const se=qe();return Te!==void 0?Te:me.includes("top")?`${se}-slide-down`:`${se}-slide-up`},[qe,me,Te]),Tt=B.useMemo(()=>me?me.includes("Center")?me.slice(0,me.indexOf("Center")):me:lt==="rtl"?"bottomRight":"bottomLeft",[me,lt]),dt=qe("dropdown",ie),[wt,Rt]=(0,I.Z)(dt),[,_t]=(0,m.Z)(),Pe=B.Children.only(Ee),J=(0,D.Tm)(Pe,{className:fe()(`${dt}-trigger`,{[`${dt}-rtl`]:lt==="rtl"},Pe.props.className),disabled:xe}),ue=xe?[]:we;let W;ue&&ue.includes("contextMenu")&&(W=!0);const[M,pe]=(0,_e.Z)(!1,{value:R!=null?R:Y}),k=(0,Z.useEvent)(se=>{z==null||z(se),y==null||y(se),pe(se)}),N=fe()(T,C,Rt,{[`${dt}-rtl`]:lt==="rtl"}),P=(0,o.Z)({arrowPointAtCenter:typeof te=="object"&&te.pointAtCenter,autoAdjustOverflow:j,offset:_t.marginXXS,arrowWidth:te?_t.sizePopupArrow:0,borderRadius:_t.borderRadius}),ne=B.useCallback(()=>{pe(!1)},[]),F=()=>{let se;return Q!=null&&Q.items?se=B.createElement(u.default,Object.assign({},Q)):typeof Se=="function"?se=Se():se=Se,he&&(se=he(se)),se=B.Children.only(typeof se=="string"?B.createElement("span",null,se):se),B.createElement(g.J,{prefixCls:`${dt}-menu`,expandIcon:B.createElement("span",{className:`${dt}-menu-submenu-arrow`},B.createElement(q.Z,{className:`${dt}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:ne,validator:de=>{let{mode:ge}=de}},se)};return wt(B.createElement(oe.Z,Object.assign({alignPoint:W},(0,le.Z)(E,["rootClassName"]),{mouseEnterDelay:v,mouseLeaveDelay:$,visible:M,builtinPlacements:P,arrow:!!te,overlayClassName:N,prefixCls:dt,getPopupContainer:V||De,transitionName:We,trigger:ue,overlay:F,placement:Tt,onVisibleChange:k}),J))};function w(E){return Object.assign(Object.assign({},E),{align:{overflow:{adjustX:!1,adjustY:!1}}})}const O=(0,K.Z)(L,"dropdown",E=>E,w),A=E=>B.createElement(O,Object.assign({},E),B.createElement("span",null));L._InternalPanelDoNotUseOrYouWillBeFired=A,ke.Z=L},38854:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return m}});var B=b(91857),q=b(92310),ve=b.n(q),fe=b(59301),oe=b(18785),Z=b(3113),_e=b(36355),le=b(81327),o=b(33234),K=b(47211),D=function(I,H){var L={};for(var w in I)Object.prototype.hasOwnProperty.call(I,w)&&H.indexOf(w)<0&&(L[w]=I[w]);if(I!=null&&typeof Object.getOwnPropertySymbols=="function")for(var O=0,w=Object.getOwnPropertySymbols(I);O<w.length;O++)H.indexOf(w[O])<0&&Object.prototype.propertyIsEnumerable.call(I,w[O])&&(L[w[O]]=I[w[O]]);return L};const f=I=>{const{getPopupContainer:H,getPrefixCls:L,direction:w}=fe.useContext(_e.E_),{prefixCls:O,type:A="default",danger:E,disabled:Q,loading:te,onClick:ie,htmlType:Ee,children:we,className:xe,menu:he,arrow:V,autoFocus:T,overlay:C,trigger:R,align:z,open:Y,onOpenChange:y,placement:v,getPopupContainer:$,href:j,icon:me=fe.createElement(oe.Z,null),title:Se,buttonsRender:Te=F=>F,mouseEnterDelay:De,mouseLeaveDelay:qe,overlayClassName:lt,overlayStyle:We,destroyPopupOnHide:Tt,dropdownRender:dt}=I,wt=D(I,["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"]),Rt=L("dropdown",O),_t=`${Rt}-button`,[Pe,J]=(0,K.Z)(Rt),ue={menu:he,arrow:V,autoFocus:T,align:z,disabled:Q,trigger:Q?[]:R,onOpenChange:y,getPopupContainer:$||H,mouseEnterDelay:De,mouseLeaveDelay:qe,overlayClassName:lt,overlayStyle:We,destroyPopupOnHide:Tt,dropdownRender:dt},{compactSize:W,compactItemClassnames:M}=(0,o.ri)(Rt,w),pe=ve()(_t,M,xe,J);"overlay"in I&&(ue.overlay=C),"open"in I&&(ue.open=Y),"placement"in I?ue.placement=v:ue.placement=w==="rtl"?"bottomLeft":"bottomRight";const k=fe.createElement(Z.ZP,{type:A,danger:E,disabled:Q,loading:te,onClick:ie,htmlType:Ee,href:j,title:Se},we),N=fe.createElement(Z.ZP,{type:A,danger:E,icon:me}),[P,ne]=Te([k,N]);return Pe(fe.createElement(le.Z.Compact,Object.assign({className:pe,size:W,block:!0},wt),P,fe.createElement(B.Z,Object.assign({},ue),ne)))};f.__ANT_BUTTON=!0;var u=f;const g=B.Z;g.Button=u;var m=g},47211:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return D}});var B=b(17313),q=b(13826),ve=b(92899),fe=b(29878),oe=b(19447),Z=b(83116),_e=b(37613),o=f=>{const{componentCls:u,menuCls:g,colorError:m,colorTextLightSolid:I}=f,H=`${g}-item`;return{[`${u}, ${u}-menu-submenu`]:{[`${g} ${H}`]:{[`&${H}-danger:not(${H}-disabled)`]:{color:m,"&:hover":{color:I,backgroundColor:m}}}}}};const K=f=>{const{componentCls:u,menuCls:g,zIndexPopup:m,dropdownArrowDistance:I,sizePopupArrow:H,antCls:L,iconCls:w,motionDurationMid:O,dropdownPaddingVertical:A,fontSize:E,dropdownEdgeChildPadding:Q,colorTextDisabled:te,fontSizeIcon:ie,controlPaddingHorizontal:Ee,colorBgElevated:we}=f;return[{[u]:Object.assign(Object.assign({},(0,B.Wf)(f)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:m,display:"block","&::before":{position:"absolute",insetBlock:-I+H/2,zIndex:-9999,opacity:1e-4,content:'""'},[`&-trigger${L}-btn`]:{[`& > ${w}-down, & > ${L}-btn-icon > ${w}-down`]:{fontSize:ie}},[`${u}-wrap`]:{position:"relative",[`${L}-btn > ${w}-down`]:{fontSize:ie},[`${w}-down::before`]:{transition:`transform ${O}`}},[`${u}-wrap-open`]:{[`${w}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${L}-slide-down-enter${L}-slide-down-enter-active${u}-placement-bottomLeft,
|
|
&${L}-slide-down-appear${L}-slide-down-appear-active${u}-placement-bottomLeft,
|
|
&${L}-slide-down-enter${L}-slide-down-enter-active${u}-placement-bottom,
|
|
&${L}-slide-down-appear${L}-slide-down-appear-active${u}-placement-bottom,
|
|
&${L}-slide-down-enter${L}-slide-down-enter-active${u}-placement-bottomRight,
|
|
&${L}-slide-down-appear${L}-slide-down-appear-active${u}-placement-bottomRight`]:{animationName:q.fJ},[`&${L}-slide-up-enter${L}-slide-up-enter-active${u}-placement-topLeft,
|
|
&${L}-slide-up-appear${L}-slide-up-appear-active${u}-placement-topLeft,
|
|
&${L}-slide-up-enter${L}-slide-up-enter-active${u}-placement-top,
|
|
&${L}-slide-up-appear${L}-slide-up-appear-active${u}-placement-top,
|
|
&${L}-slide-up-enter${L}-slide-up-enter-active${u}-placement-topRight,
|
|
&${L}-slide-up-appear${L}-slide-up-appear-active${u}-placement-topRight`]:{animationName:q.Qt},[`&${L}-slide-down-leave${L}-slide-down-leave-active${u}-placement-bottomLeft,
|
|
&${L}-slide-down-leave${L}-slide-down-leave-active${u}-placement-bottom,
|
|
&${L}-slide-down-leave${L}-slide-down-leave-active${u}-placement-bottomRight`]:{animationName:q.Uw},[`&${L}-slide-up-leave${L}-slide-up-leave-active${u}-placement-topLeft,
|
|
&${L}-slide-up-leave${L}-slide-up-leave-active${u}-placement-top,
|
|
&${L}-slide-up-leave${L}-slide-up-leave-active${u}-placement-topRight`]:{animationName:q.ly}})},(0,oe.ZP)(f,{colorBg:we,limitVerticalRadius:!0,arrowPlacement:{top:!0,bottom:!0}}),{[`${u} ${g}`]:{position:"relative",margin:0},[`${g}-submenu-popup`]:{position:"absolute",zIndex:m,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${u}, ${u}-menu-submenu`]:{[g]:Object.assign(Object.assign({padding:Q,listStyleType:"none",backgroundColor:we,backgroundClip:"padding-box",borderRadius:f.borderRadiusLG,outline:"none",boxShadow:f.boxShadowSecondary},(0,B.Qy)(f)),{[`${g}-item-group-title`]:{padding:`${A}px ${Ee}px`,color:f.colorTextDescription,transition:`all ${O}`},[`${g}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${g}-item-icon`]:{minWidth:E,marginInlineEnd:f.marginXS,fontSize:f.fontSizeSM},[`${g}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${O}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${g}-item, ${g}-submenu-title`]:Object.assign(Object.assign({clear:"both",margin:0,padding:`${A}px ${Ee}px`,color:f.colorText,fontWeight:"normal",fontSize:E,lineHeight:f.lineHeight,cursor:"pointer",transition:`all ${O}`,borderRadius:f.borderRadiusSM,"&:hover, &-active":{backgroundColor:f.controlItemBgHover}},(0,B.Qy)(f)),{"&-selected":{color:f.colorPrimary,backgroundColor:f.controlItemBgActive,"&:hover, &-active":{backgroundColor:f.controlItemBgActiveHover}},"&-disabled":{color:te,cursor:"not-allowed","&:hover":{color:te,backgroundColor:we,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${f.marginXXS}px 0`,overflow:"hidden",lineHeight:0,backgroundColor:f.colorSplit},[`${u}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:f.paddingXS,[`${u}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:f.colorTextDescription,fontSize:ie,fontStyle:"normal"}}}),[`${g}-item-group-list`]:{margin:`0 ${f.marginXS}px`,padding:0,listStyle:"none"},[`${g}-submenu-title`]:{paddingInlineEnd:Ee+f.fontSizeSM},[`${g}-submenu-vertical`]:{position:"relative"},[`${g}-submenu${g}-submenu-disabled ${u}-menu-submenu-title`]:{[`&, ${u}-menu-submenu-arrow-icon`]:{color:te,backgroundColor:we,cursor:"not-allowed"}},[`${g}-submenu-selected ${u}-menu-submenu-title`]:{color:f.colorPrimary}})}},[(0,q.oN)(f,"slide-up"),(0,q.oN)(f,"slide-down"),(0,ve.Fm)(f,"move-up"),(0,ve.Fm)(f,"move-down"),(0,fe._y)(f,"zoom-big")]]};var D=(0,Z.Z)("Dropdown",(f,u)=>{let{rootPrefixCls:g}=u;const{marginXXS:m,sizePopupArrow:I,controlHeight:H,fontSize:L,lineHeight:w,paddingXXS:O,componentCls:A,borderRadiusLG:E}=f,Q=(H-L*w)/2,{dropdownArrowOffset:te}=(0,oe.fS)({contentRadius:E}),ie=(0,_e.TS)(f,{menuCls:`${A}-menu`,rootPrefixCls:g,dropdownArrowDistance:I/2+m,dropdownArrowOffset:te,dropdownPaddingVertical:Q,dropdownEdgeChildPadding:O});return[K(ie),o(ie)]},f=>({zIndexPopup:f.zIndexPopupBase+50}))},64165:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return O}});var B=b(92310),q=b.n(B),ve=b(59301),fe=b(36355),oe=b(9763),Z=b(64993),_e=b(88088),o=()=>{const[,A]=(0,_e.Z)(),Q=new Z.C(A.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return ve.createElement("svg",{style:Q,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},ve.createElement("g",{fill:"none",fillRule:"evenodd"},ve.createElement("g",{transform:"translate(24 31.67)"},ve.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),ve.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"}),ve.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)"}),ve.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"}),ve.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"})),ve.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"}),ve.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},ve.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),ve.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},D=()=>{const[,A]=(0,_e.Z)(),{colorFill:E,colorFillTertiary:Q,colorFillQuaternary:te,colorBgContainer:ie}=A,{borderColor:Ee,shadowColor:we,contentColor:xe}=(0,ve.useMemo)(()=>({borderColor:new Z.C(E).onBackground(ie).toHexShortString(),shadowColor:new Z.C(Q).onBackground(ie).toHexShortString(),contentColor:new Z.C(te).onBackground(ie).toHexShortString()}),[E,Q,te,ie]);return ve.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},ve.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},ve.createElement("ellipse",{fill:we,cx:"32",cy:"33",rx:"32",ry:"7"}),ve.createElement("g",{fillRule:"nonzero",stroke:Ee},ve.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"}),ve.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:xe}))))},f=b(83116),u=b(37613);const g=A=>{const{componentCls:E,margin:Q,marginXS:te,marginXL:ie,fontSize:Ee,lineHeight:we}=A;return{[E]:{marginInline:te,fontSize:Ee,lineHeight:we,textAlign:"center",[`${E}-image`]:{height:A.emptyImgHeight,marginBottom:te,opacity:A.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${E}-description`]:{color:A.colorText},[`${E}-footer`]:{marginTop:Q},"&-normal":{marginBlock:ie,color:A.colorTextDisabled,[`${E}-description`]:{color:A.colorTextDisabled},[`${E}-image`]:{height:A.emptyImgHeightMD}},"&-small":{marginBlock:te,color:A.colorTextDisabled,[`${E}-image`]:{height:A.emptyImgHeightSM}}}}};var m=(0,f.Z)("Empty",A=>{const{componentCls:E,controlHeightLG:Q}=A,te=(0,u.TS)(A,{emptyImgCls:`${E}-img`,emptyImgHeight:Q*2.5,emptyImgHeightMD:Q,emptyImgHeightSM:Q*.875});return[g(te)]}),I=function(A,E){var Q={};for(var te in A)Object.prototype.hasOwnProperty.call(A,te)&&E.indexOf(te)<0&&(Q[te]=A[te]);if(A!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,te=Object.getOwnPropertySymbols(A);ie<te.length;ie++)E.indexOf(te[ie])<0&&Object.prototype.propertyIsEnumerable.call(A,te[ie])&&(Q[te[ie]]=A[te[ie]]);return Q};const H=ve.createElement(o,null),L=ve.createElement(D,null),w=A=>{var{className:E,rootClassName:Q,prefixCls:te,image:ie=H,description:Ee,children:we,imageStyle:xe,style:he}=A,V=I(A,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:T,direction:C,empty:R}=ve.useContext(fe.E_),z=T("empty",te),[Y,y]=m(z),[v]=(0,oe.Z)("Empty"),$=typeof Ee!="undefined"?Ee:v==null?void 0:v.description,j=typeof $=="string"?$:"empty";let me=null;return typeof ie=="string"?me=ve.createElement("img",{alt:j,src:ie}):me=ie,Y(ve.createElement("div",Object.assign({className:q()(y,z,R==null?void 0:R.className,{[`${z}-normal`]:ie===L,[`${z}-rtl`]:C==="rtl"},E,Q),style:Object.assign(Object.assign({},R==null?void 0:R.style),he)},V),ve.createElement("div",{className:`${z}-image`,style:xe},me),$&&ve.createElement("div",{className:`${z}-description`},$),we&&ve.createElement("div",{className:`${z}-footer`},we)))};w.PRESENTED_IMAGE_DEFAULT=H,w.PRESENTED_IMAGE_SIMPLE=L;var O=w},45818:function(bt,ke,b){"use strict";b.d(ke,{D:function(){return O},Z:function(){return Q}});var B=b(92413),q=b(59301),ve={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"},fe=ve,oe=b(7657),Z=function(ie,Ee){return q.createElement(oe.Z,(0,B.Z)({},ie,{ref:Ee,icon:fe}))},_e=q.forwardRef(Z),le=_e,o=b(33853),K=b(38819),D=b(92310),f=b.n(D),u=b(2738),m=te=>!isNaN(parseFloat(te))&&isFinite(te),I=b(36355),H=b(84966),L=function(te,ie){var Ee={};for(var we in te)Object.prototype.hasOwnProperty.call(te,we)&&ie.indexOf(we)<0&&(Ee[we]=te[we]);if(te!=null&&typeof Object.getOwnPropertySymbols=="function")for(var xe=0,we=Object.getOwnPropertySymbols(te);xe<we.length;xe++)ie.indexOf(we[xe])<0&&Object.prototype.propertyIsEnumerable.call(te,we[xe])&&(Ee[we[xe]]=te[we[xe]]);return Ee};const w={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},O=q.createContext({}),A=(()=>{let te=0;return function(){let ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return te+=1,`${ie}${te}`}})();var Q=q.forwardRef((te,ie)=>{const{prefixCls:Ee,className:we,trigger:xe,children:he,defaultCollapsed:V=!1,theme:T="dark",style:C={},collapsible:R=!1,reverseArrow:z=!1,width:Y=200,collapsedWidth:y=80,zeroWidthTriggerStyle:v,breakpoint:$,onCollapse:j,onBreakpoint:me}=te,Se=L(te,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:Te}=(0,q.useContext)(H.Gs),[De,qe]=(0,q.useState)("collapsed"in te?te.collapsed:V),[lt,We]=(0,q.useState)(!1);(0,q.useEffect)(()=>{"collapsed"in te&&qe(te.collapsed)},[te.collapsed]);const Tt=(J,ue)=>{"collapsed"in te||qe(J),j==null||j(J,ue)},dt=(0,q.useRef)();dt.current=J=>{We(J.matches),me==null||me(J.matches),De!==J.matches&&Tt(J.matches,"responsive")},(0,q.useEffect)(()=>{function J(W){return dt.current(W)}let ue;if(typeof window!="undefined"){const{matchMedia:W}=window;if(W&&$&&$ in w){ue=W(`(max-width: ${w[$]})`);try{ue.addEventListener("change",J)}catch(M){ue.addListener(J)}J(ue)}}return()=>{try{ue==null||ue.removeEventListener("change",J)}catch(W){ue==null||ue.removeListener(J)}}},[$]),(0,q.useEffect)(()=>{const J=A("ant-sider-");return Te.addSider(J),()=>Te.removeSider(J)},[]);const wt=()=>{Tt(!De,"clickTrigger")},{getPrefixCls:Rt}=(0,q.useContext)(I.E_),_t=()=>{const J=Rt("layout-sider",Ee),ue=(0,u.Z)(Se,["collapsed"]),W=De?y:Y,M=m(W)?`${W}px`:String(W),pe=parseFloat(String(y||0))===0?q.createElement("span",{onClick:wt,className:f()(`${J}-zero-width-trigger`,`${J}-zero-width-trigger-${z?"right":"left"}`),style:v},xe||q.createElement(le,null)):null,P={expanded:z?q.createElement(K.Z,null):q.createElement(o.Z,null),collapsed:z?q.createElement(o.Z,null):q.createElement(K.Z,null)}[De?"collapsed":"expanded"],ne=xe!==null?pe||q.createElement("div",{className:`${J}-trigger`,onClick:wt,style:{width:M}},xe||P):null,F=Object.assign(Object.assign({},C),{flex:`0 0 ${M}`,maxWidth:M,minWidth:M,width:M}),se=f()(J,`${J}-${T}`,{[`${J}-collapsed`]:!!De,[`${J}-has-trigger`]:R&&xe!==null&&!pe,[`${J}-below`]:!!lt,[`${J}-zero-width`]:parseFloat(M)===0},we);return q.createElement("aside",Object.assign({className:se},ue,{style:F,ref:ie}),q.createElement("div",{className:`${J}-children`},he),R||lt&&pe?ne:null)},Pe=q.useMemo(()=>({siderCollapsed:De}),[De]);return q.createElement(O.Provider,{value:Pe},_t())})},84966:function(bt,ke,b){"use strict";b.d(ke,{VY:function(){return O},$_:function(){return w},h4:function(){return L},Gs:function(){return u},ZP:function(){return A}});var B=b(26407),q=b(92310),ve=b.n(q),fe=b(2738),oe=b(59301),Z=b(36355),_e=b(83116),o=E=>{const{componentCls:Q,bodyBg:te,lightSiderBg:ie,lightTriggerBg:Ee,lightTriggerColor:we}=E;return{[`${Q}-sider-light`]:{background:ie,[`${Q}-sider-trigger`]:{color:we,background:Ee},[`${Q}-sider-zero-width-trigger`]:{color:we,background:Ee,border:`1px solid ${te}`,borderInlineStart:0}}}};const K=E=>{const{antCls:Q,componentCls:te,colorText:ie,triggerColor:Ee,footerBg:we,triggerBg:xe,headerHeight:he,headerPadding:V,headerColor:T,footerPadding:C,triggerHeight:R,zeroTriggerHeight:z,zeroTriggerWidth:Y,motionDurationMid:y,motionDurationSlow:v,fontSize:$,borderRadius:j,bodyBg:me,headerBg:Se,siderBg:Te}=E;return{[te]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:me,"&, *":{boxSizing:"border-box"},[`&${te}-has-sider`]:{flexDirection:"row",[`> ${te}, > ${te}-content`]:{width:0}},[`${te}-header, &${te}-footer`]:{flex:"0 0 auto"},[`${te}-sider`]:{position:"relative",minWidth:0,background:Te,transition:`all ${y}, background 0s`,"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,[`${Q}-menu${Q}-menu-inline-collapsed`]:{width:"auto"}},"&-has-trigger":{paddingBottom:R},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:R,color:Ee,lineHeight:`${R}px`,textAlign:"center",background:xe,cursor:"pointer",transition:`all ${y}`},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:he,insetInlineEnd:-Y,zIndex:1,width:Y,height:z,color:Ee,fontSize:E.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:Te,borderStartStartRadius:0,borderStartEndRadius:j,borderEndEndRadius:j,borderEndStartRadius:0,cursor:"pointer",transition:`background ${v} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${v}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:-Y,borderStartStartRadius:j,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:j}}}}},o(E)),{"&-rtl":{direction:"rtl"}}),[`${te}-header`]:{height:he,padding:V,color:T,lineHeight:`${he}px`,background:Se,[`${Q}-menu`]:{lineHeight:"inherit"}},[`${te}-footer`]:{padding:C,color:ie,fontSize:$,background:we},[`${te}-content`]:{flex:"auto",minHeight:0}}};var D=(0,_e.Z)("Layout",E=>[K(E)],E=>{const{colorBgLayout:Q,controlHeight:te,controlHeightLG:ie,colorText:Ee,controlHeightSM:we,marginXXS:xe,colorTextLightSolid:he,colorBgContainer:V}=E,T=ie*1.25;return{colorBgHeader:"#001529",colorBgBody:Q,colorBgTrigger:"#002140",bodyBg:Q,headerBg:"#001529",headerHeight:te*2,headerPadding:`0 ${T}px`,headerColor:Ee,footerPadding:`${we}px ${T}px`,footerBg:Q,siderBg:"#001529",triggerHeight:ie+xe*2,triggerBg:"#002140",triggerColor:he,zeroTriggerWidth:ie,zeroTriggerHeight:ie,lightSiderBg:V,lightTriggerBg:V,lightTriggerColor:Ee}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),f=function(E,Q){var te={};for(var ie in E)Object.prototype.hasOwnProperty.call(E,ie)&&Q.indexOf(ie)<0&&(te[ie]=E[ie]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ee=0,ie=Object.getOwnPropertySymbols(E);Ee<ie.length;Ee++)Q.indexOf(ie[Ee])<0&&Object.prototype.propertyIsEnumerable.call(E,ie[Ee])&&(te[ie[Ee]]=E[ie[Ee]]);return te};const u=oe.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}});function g(E){let{suffixCls:Q,tagName:te,displayName:ie}=E;return Ee=>oe.forwardRef((xe,he)=>oe.createElement(Ee,Object.assign({ref:he,suffixCls:Q,tagName:te},xe)))}const m=oe.forwardRef((E,Q)=>{const{prefixCls:te,suffixCls:ie,className:Ee,tagName:we}=E,xe=f(E,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:he}=oe.useContext(Z.E_),V=he("layout",te),[T,C]=D(V),R=ie?`${V}-${ie}`:V;return T(oe.createElement(we,Object.assign({className:ve()(te||R,Ee,C),ref:Q},xe)))}),I=oe.forwardRef((E,Q)=>{const{direction:te}=oe.useContext(Z.E_),[ie,Ee]=oe.useState([]),{prefixCls:we,className:xe,rootClassName:he,children:V,hasSider:T,tagName:C,style:R}=E,z=f(E,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),Y=(0,fe.Z)(z,["suffixCls"]),{getPrefixCls:y,layout:v}=oe.useContext(Z.E_),$=y("layout",we),[j,me]=D($),Se=ve()($,{[`${$}-has-sider`]:typeof T=="boolean"?T:ie.length>0,[`${$}-rtl`]:te==="rtl"},v==null?void 0:v.className,xe,he,me),Te=oe.useMemo(()=>({siderHook:{addSider:De=>{Ee(qe=>[].concat((0,B.Z)(qe),[De]))},removeSider:De=>{Ee(qe=>qe.filter(lt=>lt!==De))}}}),[]);return j(oe.createElement(u.Provider,{value:Te},oe.createElement(C,Object.assign({ref:Q,className:Se,style:Object.assign(Object.assign({},v==null?void 0:v.style),R)},Y),V)))}),H=g({tagName:"div",displayName:"Layout"})(I),L=g({suffixCls:"header",tagName:"header",displayName:"Header"})(m),w=g({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(m),O=g({suffixCls:"content",tagName:"main",displayName:"Content"})(m);var A=H},40875:function(bt,ke,b){"use strict";b.d(ke,{J:function(){return Z}});var B=b(59301),q=b(33234),ve=b(70425),fe=function(_e,le){var o={};for(var K in _e)Object.prototype.hasOwnProperty.call(_e,K)&&le.indexOf(K)<0&&(o[K]=_e[K]);if(_e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var D=0,K=Object.getOwnPropertySymbols(_e);D<K.length;D++)le.indexOf(K[D])<0&&Object.prototype.propertyIsEnumerable.call(_e,K[D])&&(o[K[D]]=_e[K[D]]);return o};const oe=B.createContext(null),Z=B.forwardRef((_e,le)=>{const{children:o}=_e,K=fe(_e,["children"]),D=B.useContext(oe),f=B.useMemo(()=>Object.assign(Object.assign({},D),K),[D,K.prefixCls,K.mode,K.selectable]);return B.createElement(oe.Provider,{value:f},B.createElement(q.BR,null,(0,ve.supportNodeRef)(o)?B.cloneElement(o,{ref:le}):o))});ke.Z=oe},20834:function(bt,ke,b){"use strict";b.d(ke,{default:function(){return Pe}});var B=b(15285),q=b(59301),ve=b(45818),fe=b(92310),oe=b.n(fe),Z=b(36355),_e=function(J,ue){var W={};for(var M in J)Object.prototype.hasOwnProperty.call(J,M)&&ue.indexOf(M)<0&&(W[M]=J[M]);if(J!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pe=0,M=Object.getOwnPropertySymbols(J);pe<M.length;pe++)ue.indexOf(M[pe])<0&&Object.prototype.propertyIsEnumerable.call(J,M[pe])&&(W[M[pe]]=J[M[pe]]);return W},o=J=>{const{prefixCls:ue,className:W,dashed:M}=J,pe=_e(J,["prefixCls","className","dashed"]),{getPrefixCls:k}=q.useContext(Z.E_),N=k("menu",ue),P=oe()({[`${N}-item-divider-dashed`]:!!M},W);return q.createElement(B.iz,Object.assign({className:P},pe))},K=b(11592),D=b(2738),f=b(6848),u=b(92343),m=(0,q.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),H=J=>{var ue;const{className:W,children:M,icon:pe,title:k,danger:N}=J,{prefixCls:P,firstLevel:ne,direction:F,disableMenuItemTitleTooltip:se,inlineCollapsed:de}=q.useContext(m),ge=Ke=>{const je=q.createElement("span",{className:`${P}-title-content`},M);return(!pe||(0,u.l$)(M)&&M.type==="span")&&M&&Ke&&ne&&typeof M=="string"?q.createElement("div",{className:`${P}-inline-collapsed-noicon`},M.charAt(0)):je},{siderCollapsed:be}=q.useContext(ve.D);let Le=k;typeof k=="undefined"?Le=ne?M:"":k===!1&&(Le="");const Ne={title:Le};!be&&!de&&(Ne.title=null,Ne.open=!1);const ze=(0,K.Z)(M).length;let Ie=q.createElement(B.ck,Object.assign({},(0,D.Z)(J,["title","icon","danger"]),{className:oe()({[`${P}-item-danger`]:N,[`${P}-item-only-child`]:(pe?ze+1:ze)===1},W),title:typeof k=="string"?k:void 0}),(0,u.Tm)(pe,{className:oe()((0,u.l$)(pe)?(ue=pe.props)===null||ue===void 0?void 0:ue.className:"",`${P}-item-icon`)}),ge(de));return se||(Ie=q.createElement(f.Z,Object.assign({},Ne,{placement:F==="rtl"?"left":"right",overlayClassName:`${P}-inline-collapsed-tooltip`}),Ie)),Ie},w=J=>{var ue;const{popupClassName:W,icon:M,title:pe,theme:k}=J,N=q.useContext(m),{prefixCls:P,inlineCollapsed:ne,theme:F}=N,se=(0,B.Xl)();let de;if(!M)de=ne&&!se.length&&pe&&typeof pe=="string"?q.createElement("div",{className:`${P}-inline-collapsed-noicon`},pe.charAt(0)):q.createElement("span",{className:`${P}-title-content`},pe);else{const be=(0,u.l$)(pe)&&pe.type==="span";de=q.createElement(q.Fragment,null,(0,u.Tm)(M,{className:oe()((0,u.l$)(M)?(ue=M.props)===null||ue===void 0?void 0:ue.className:"",`${P}-item-icon`)}),be?pe:q.createElement("span",{className:`${P}-title-content`},pe))}const ge=q.useMemo(()=>Object.assign(Object.assign({},N),{firstLevel:!1}),[N]);return q.createElement(m.Provider,{value:ge},q.createElement(B.Wd,Object.assign({},(0,D.Z)(J,["icon"]),{title:de,popupClassName:oe()(P,W,`${P}-${k||F}`)})))},O=b(18785),A=b(70425),E=b(62892),Q=b(40875),te=function(J,ue){var W={};for(var M in J)Object.prototype.hasOwnProperty.call(J,M)&&ue.indexOf(M)<0&&(W[M]=J[M]);if(J!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pe=0,M=Object.getOwnPropertySymbols(J);pe<M.length;pe++)ue.indexOf(M[pe])<0&&Object.prototype.propertyIsEnumerable.call(J,M[pe])&&(W[M[pe]]=J[M[pe]]);return W};function ie(J){return(J||[]).map((ue,W)=>{if(ue&&typeof ue=="object"){const M=ue,{label:pe,children:k,key:N,type:P}=M,ne=te(M,["label","children","key","type"]),F=N!=null?N:`tmp-${W}`;return k||P==="group"?P==="group"?q.createElement(B.BW,Object.assign({key:F},ne,{title:pe}),ie(k)):q.createElement(w,Object.assign({key:F},ne,{title:pe}),ie(k)):P==="divider"?q.createElement(o,Object.assign({key:F},ne)):q.createElement(H,Object.assign({key:F},ne),pe)}return null}).filter(ue=>ue)}function Ee(J){return q.useMemo(()=>J&&ie(J),[J])}var we=b(64993),xe=b(17313),he=b(8378),V=b(13826),T=b(29878),C=b(83116),R=b(37613),Y=J=>{const{componentCls:ue,motionDurationSlow:W,horizontalLineHeight:M,colorSplit:pe,lineWidth:k,lineType:N,itemPaddingInline:P}=J;return{[`${ue}-horizontal`]:{lineHeight:M,border:0,borderBottom:`${k}px ${N} ${pe}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${ue}-item, ${ue}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:P},[`> ${ue}-item:hover,
|
|
> ${ue}-item-active,
|
|
> ${ue}-submenu ${ue}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${ue}-item, ${ue}-submenu-title`]:{transition:[`border-color ${W}`,`background ${W}`].join(",")},[`${ue}-submenu-arrow`]:{display:"none"}}}},v=J=>{let{componentCls:ue,menuArrowOffset:W}=J;return{[`${ue}-rtl`]:{direction:"rtl"},[`${ue}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${ue}-rtl${ue}-vertical,
|
|
${ue}-submenu-rtl ${ue}-vertical`]:{[`${ue}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${W})`},"&::after":{transform:`rotate(45deg) translateY(${W})`}}}}};const $=J=>Object.assign({},(0,xe.oN)(J));var me=(J,ue)=>{const{componentCls:W,itemColor:M,itemSelectedColor:pe,groupTitleColor:k,itemBg:N,subMenuItemBg:P,itemSelectedBg:ne,activeBarHeight:F,activeBarWidth:se,activeBarBorderWidth:de,motionDurationSlow:ge,motionEaseInOut:be,motionEaseOut:Le,itemPaddingInline:Ne,motionDurationMid:ze,itemHoverColor:Ie,lineType:Ke,colorSplit:je,itemDisabledColor:Ce,dangerItemColor:vt,dangerItemHoverColor:st,dangerItemSelectedColor:St,dangerItemActiveBg:Ze,dangerItemSelectedBg:Ht,itemHoverBg:Kt,itemActiveBg:zt,menuSubMenuBg:Ot,horizontalItemSelectedColor:ht,horizontalItemSelectedBg:yt,horizontalItemBorderRadius:ut,horizontalItemHoverBg:Ct,popupBg:ft}=J;return{[`${W}-${ue}, ${W}-${ue} > ${W}`]:{color:M,background:N,[`&${W}-root:focus-visible`]:Object.assign({},$(J)),[`${W}-item-group-title`]:{color:k},[`${W}-submenu-selected`]:{[`> ${W}-submenu-title`]:{color:pe}},[`${W}-item-disabled, ${W}-submenu-disabled`]:{color:`${Ce} !important`},[`${W}-item:not(${W}-item-selected):not(${W}-submenu-selected)`]:{[`&:hover, > ${W}-submenu-title:hover`]:{color:Ie}},[`&:not(${W}-horizontal)`]:{[`${W}-item:not(${W}-item-selected)`]:{"&:hover":{backgroundColor:Kt},"&:active":{backgroundColor:zt}},[`${W}-submenu-title`]:{"&:hover":{backgroundColor:Kt},"&:active":{backgroundColor:zt}}},[`${W}-item-danger`]:{color:vt,[`&${W}-item:hover`]:{[`&:not(${W}-item-selected):not(${W}-submenu-selected)`]:{color:st}},[`&${W}-item:active`]:{background:Ze}},[`${W}-item a`]:{"&, &:hover":{color:"inherit"}},[`${W}-item-selected`]:{color:pe,[`&${W}-item-danger`]:{color:St},"a, a:hover":{color:"inherit"}},[`& ${W}-item-selected`]:{backgroundColor:ne,[`&${W}-item-danger`]:{backgroundColor:Ht}},[`${W}-item, ${W}-submenu-title`]:{[`&:not(${W}-item-disabled):focus-visible`]:Object.assign({},$(J))},[`&${W}-submenu > ${W}`]:{backgroundColor:Ot},[`&${W}-popup > ${W}`]:{backgroundColor:ft},[`&${W}-horizontal`]:Object.assign(Object.assign({},ue==="dark"?{borderBottom:0}:{}),{[`> ${W}-item, > ${W}-submenu`]:{top:de,marginTop:-de,marginBottom:0,borderRadius:ut,"&::after":{position:"absolute",insetInline:Ne,bottom:0,borderBottom:`${F}px solid transparent`,transition:`border-color ${ge} ${be}`,content:'""'},"&:hover, &-active, &-open":{background:Ct,"&::after":{borderBottomWidth:F,borderBottomColor:ht}},"&-selected":{color:ht,backgroundColor:yt,"&:hover":{backgroundColor:yt},"&::after":{borderBottomWidth:F,borderBottomColor:ht}}}}),[`&${W}-root`]:{[`&${W}-inline, &${W}-vertical`]:{borderInlineEnd:`${de}px ${Ke} ${je}`}},[`&${W}-inline`]:{[`${W}-sub${W}-inline`]:{background:P},[`${W}-item, ${W}-submenu-title`]:de&&se?{width:`calc(100% + ${de}px)`}:{},[`${W}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${se}px solid ${pe}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${ze} ${Le}`,`opacity ${ze} ${Le}`].join(","),content:'""'},[`&${W}-item-danger`]:{"&::after":{borderInlineEndColor:St}}},[`${W}-selected, ${W}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${ze} ${be}`,`opacity ${ze} ${be}`].join(",")}}}}}};const Se=J=>{const{componentCls:ue,itemHeight:W,itemMarginInline:M,padding:pe,menuArrowSize:k,marginXS:N,itemMarginBlock:P}=J,ne=pe+k+N;return{[`${ue}-item`]:{position:"relative",overflow:"hidden"},[`${ue}-item, ${ue}-submenu-title`]:{height:W,lineHeight:`${W}px`,paddingInline:pe,overflow:"hidden",textOverflow:"ellipsis",marginInline:M,marginBlock:P,width:`calc(100% - ${M*2}px)`},[`> ${ue}-item,
|
|
> ${ue}-submenu > ${ue}-submenu-title`]:{height:W,lineHeight:`${W}px`},[`${ue}-item-group-list ${ue}-submenu-title,
|
|
${ue}-submenu-title`]:{paddingInlineEnd:ne}}};var De=J=>{const{componentCls:ue,iconCls:W,itemHeight:M,colorTextLightSolid:pe,dropdownWidth:k,controlHeightLG:N,motionDurationMid:P,motionEaseOut:ne,paddingXL:F,itemMarginInline:se,fontSizeLG:de,motionDurationSlow:ge,paddingXS:be,boxShadowSecondary:Le,collapsedWidth:Ne,collapsedIconSize:ze}=J,Ie={height:M,lineHeight:`${M}px`,listStylePosition:"inside",listStyleType:"disc"};return[{[ue]:{"&-inline, &-vertical":Object.assign({[`&${ue}-root`]:{boxShadow:"none"}},Se(J))},[`${ue}-submenu-popup`]:{[`${ue}-vertical`]:Object.assign(Object.assign({},Se(J)),{boxShadow:Le})}},{[`${ue}-submenu-popup ${ue}-vertical${ue}-sub`]:{minWidth:k,maxHeight:`calc(100vh - ${N*2.5}px)`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${ue}-inline`]:{width:"100%",[`&${ue}-root`]:{[`${ue}-item, ${ue}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${ge}`,`background ${ge}`,`padding ${P} ${ne}`].join(","),[`> ${ue}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${ue}-sub${ue}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${ue}-submenu > ${ue}-submenu-title`]:Ie,[`& ${ue}-item-group-title`]:{paddingInlineStart:F}},[`${ue}-item`]:Ie}},{[`${ue}-inline-collapsed`]:{width:Ne,[`&${ue}-root`]:{[`${ue}-item, ${ue}-submenu ${ue}-submenu-title`]:{[`> ${ue}-inline-collapsed-noicon`]:{fontSize:de,textAlign:"center"}}},[`> ${ue}-item,
|
|
> ${ue}-item-group > ${ue}-item-group-list > ${ue}-item,
|
|
> ${ue}-item-group > ${ue}-item-group-list > ${ue}-submenu > ${ue}-submenu-title,
|
|
> ${ue}-submenu > ${ue}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${de/2}px - ${se}px)`,textOverflow:"clip",[`
|
|
${ue}-submenu-arrow,
|
|
${ue}-submenu-expand-icon
|
|
`]:{opacity:0},[`${ue}-item-icon, ${W}`]:{margin:0,fontSize:ze,lineHeight:`${M}px`,"+ span":{display:"inline-block",opacity:0}}},[`${ue}-item-icon, ${W}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${ue}-item-icon, ${W}`]:{display:"none"},"a, a:hover":{color:pe}},[`${ue}-item-group-title`]:Object.assign(Object.assign({},xe.vS),{paddingInline:be})}}]};const qe=J=>{const{componentCls:ue,motionDurationSlow:W,motionDurationMid:M,motionEaseInOut:pe,motionEaseOut:k,iconCls:N,iconSize:P,iconMarginInlineEnd:ne}=J;return{[`${ue}-item, ${ue}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${W}`,`background ${W}`,`padding ${W} ${pe}`].join(","),[`${ue}-item-icon, ${N}`]:{minWidth:P,fontSize:P,transition:[`font-size ${M} ${k}`,`margin ${W} ${pe}`,`color ${W}`].join(","),"+ span":{marginInlineStart:ne,opacity:1,transition:[`opacity ${W} ${pe}`,`margin ${W}`,`color ${W}`].join(",")}},[`${ue}-item-icon`]:Object.assign({},(0,xe.Ro)()),[`&${ue}-item-only-child`]:{[`> ${N}, > ${ue}-item-icon`]:{marginInlineEnd:0}}},[`${ue}-item-disabled, ${ue}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${ue}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},lt=J=>{const{componentCls:ue,motionDurationSlow:W,motionEaseInOut:M,borderRadius:pe,menuArrowSize:k,menuArrowOffset:N}=J;return{[`${ue}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:J.margin,width:k,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${W} ${M}, opacity ${W}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:k*.6,height:k*.15,backgroundColor:"currentcolor",borderRadius:pe,transition:[`background ${W} ${M}`,`transform ${W} ${M}`,`top ${W} ${M}`,`color ${W} ${M}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${N})`},"&::after":{transform:`rotate(-45deg) translateY(${N})`}}}}},We=J=>{const{antCls:ue,componentCls:W,fontSize:M,motionDurationSlow:pe,motionDurationMid:k,motionEaseInOut:N,paddingXS:P,padding:ne,colorSplit:F,lineWidth:se,zIndexPopup:de,borderRadiusLG:ge,subMenuItemBorderRadius:be,menuArrowSize:Le,menuArrowOffset:Ne,lineType:ze,menuPanelMaskInset:Ie,groupTitleLineHeight:Ke,groupTitleFontSize:je}=J;return[{"":{[`${W}`]:Object.assign(Object.assign({},(0,xe.dF)()),{"&-hidden":{display:"none"}})},[`${W}-submenu-hidden`]:{display:"none"}},{[W]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,xe.Wf)(J)),(0,xe.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:M,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${pe} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${W}-item`]:{flex:"none"}},[`${W}-item, ${W}-submenu, ${W}-submenu-title`]:{borderRadius:J.itemBorderRadius},[`${W}-item-group-title`]:{padding:`${P}px ${ne}px`,fontSize:je,lineHeight:Ke,transition:`all ${pe}`},[`&-horizontal ${W}-submenu`]:{transition:[`border-color ${pe} ${N}`,`background ${pe} ${N}`].join(",")},[`${W}-submenu, ${W}-submenu-inline`]:{transition:[`border-color ${pe} ${N}`,`background ${pe} ${N}`,`padding ${k} ${N}`].join(",")},[`${W}-submenu ${W}-sub`]:{cursor:"initial",transition:[`background ${pe} ${N}`,`padding ${pe} ${N}`].join(",")},[`${W}-title-content`]:{transition:`color ${pe}`},[`${W}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${W}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:F,borderStyle:ze,borderWidth:0,borderTopWidth:se,marginBlock:se,padding:0,"&-dashed":{borderStyle:"dashed"}}}),qe(J)),{[`${W}-item-group`]:{[`${W}-item-group-list`]:{margin:0,padding:0,[`${W}-item, ${W}-submenu-title`]:{paddingInline:`${M*2}px ${ne}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:de,borderRadius:ge,boxShadow:"none",transformOrigin:"0 0",[`&${W}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:`${Ie}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:Ie},"\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:J.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:J.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:J.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:J.paddingXS},[`> ${W}`]:Object.assign(Object.assign(Object.assign({borderRadius:ge},qe(J)),lt(J)),{[`${W}-item, ${W}-submenu > ${W}-submenu-title`]:{borderRadius:be},[`${W}-submenu-title::after`]:{transition:`transform ${pe} ${N}`}})}}),lt(J)),{[`&-inline-collapsed ${W}-submenu-arrow,
|
|
&-inline ${W}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${Ne})`},"&::after":{transform:`rotate(45deg) translateX(-${Ne})`}},[`${W}-submenu-open${W}-submenu-inline > ${W}-submenu-title > ${W}-submenu-arrow`]:{transform:`translateY(-${Le*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${Ne})`},"&::before":{transform:`rotate(45deg) translateX(${Ne})`}}})},{[`${ue}-layout-header`]:{[W]:{lineHeight:"inherit"}}}]};var Tt=(J,ue)=>(0,C.Z)("Menu",M=>{if(ue===!1)return[];const{colorBgElevated:pe,colorPrimary:k,colorTextLightSolid:N,controlHeightLG:P,fontSize:ne,darkItemColor:F,darkDangerItemColor:se,darkItemBg:de,darkSubMenuItemBg:ge,darkItemSelectedColor:be,darkItemSelectedBg:Le,darkDangerItemSelectedBg:Ne,darkItemHoverBg:ze,darkGroupTitleColor:Ie,darkItemHoverColor:Ke,darkItemDisabledColor:je,darkDangerItemHoverColor:Ce,darkDangerItemSelectedColor:vt,darkDangerItemActiveBg:st}=M,St=ne/7*5,Ze=(0,R.TS)(M,{menuArrowSize:St,menuHorizontalHeight:P*1.15,menuArrowOffset:`${St*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:pe}),Ht=(0,R.TS)(Ze,{itemColor:F,itemHoverColor:Ke,groupTitleColor:Ie,itemSelectedColor:be,itemBg:de,popupBg:de,subMenuItemBg:ge,itemActiveBg:"transparent",itemSelectedBg:Le,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:ze,itemDisabledColor:je,dangerItemColor:se,dangerItemHoverColor:Ce,dangerItemSelectedColor:vt,dangerItemActiveBg:st,dangerItemSelectedBg:Ne,menuSubMenuBg:ge,horizontalItemSelectedColor:N,horizontalItemSelectedBg:k});return[We(Ze),Y(Ze),De(Ze),me(Ze,"light"),me(Ht,"dark"),v(Ze),(0,he.Z)(Ze),(0,V.oN)(Ze,"slide-up"),(0,V.oN)(Ze,"slide-down"),(0,T._y)(Ze,"zoom-big")]},M=>{const{colorPrimary:pe,colorError:k,colorTextDisabled:N,colorErrorBg:P,colorText:ne,colorTextDescription:F,colorBgContainer:se,colorFillAlter:de,colorFillContent:ge,lineWidth:be,lineWidthBold:Le,controlItemBgActive:Ne,colorBgTextHover:ze,controlHeightLG:Ie,lineHeight:Ke,colorBgElevated:je,marginXXS:Ce,padding:vt,fontSize:st,controlHeightSM:St,fontSizeLG:Ze,colorTextLightSolid:Ht,colorErrorHover:Kt}=M,zt=new we.C(Ht).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:M.zIndexPopupBase+50,radiusItem:M.borderRadiusLG,itemBorderRadius:M.borderRadiusLG,radiusSubMenuItem:M.borderRadiusSM,subMenuItemBorderRadius:M.borderRadiusSM,colorItemText:ne,itemColor:ne,colorItemTextHover:ne,itemHoverColor:ne,colorItemTextHoverHorizontal:pe,horizontalItemHoverColor:pe,colorGroupTitle:F,groupTitleColor:F,colorItemTextSelected:pe,itemSelectedColor:pe,colorItemTextSelectedHorizontal:pe,horizontalItemSelectedColor:pe,colorItemBg:se,itemBg:se,colorItemBgHover:ze,itemHoverBg:ze,colorItemBgActive:ge,itemActiveBg:Ne,colorSubItemBg:de,subMenuItemBg:de,colorItemBgSelected:Ne,itemSelectedBg:Ne,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:0,colorActiveBarHeight:Le,activeBarHeight:Le,colorActiveBarBorderSize:be,activeBarBorderWidth:be,colorItemTextDisabled:N,itemDisabledColor:N,colorDangerItemText:k,dangerItemColor:k,colorDangerItemTextHover:k,dangerItemHoverColor:k,colorDangerItemTextSelected:k,dangerItemSelectedColor:k,colorDangerItemBgActive:P,dangerItemActiveBg:P,colorDangerItemBgSelected:P,dangerItemSelectedBg:P,itemMarginInline:M.marginXXS,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:Ie,groupTitleLineHeight:Ke,collapsedWidth:Ie*2,popupBg:je,itemMarginBlock:Ce,itemPaddingInline:vt,horizontalLineHeight:`${Ie*1.15}px`,iconSize:st,iconMarginInlineEnd:St-st,collapsedIconSize:Ze,groupTitleFontSize:st,darkItemDisabledColor:new we.C(Ht).setAlpha(.25).toRgbString(),darkItemColor:zt,darkDangerItemColor:k,darkItemBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:Ht,darkItemSelectedBg:pe,darkDangerItemSelectedBg:k,darkItemHoverBg:"transparent",darkGroupTitleColor:zt,darkItemHoverColor:Ht,darkDangerItemHoverColor:Kt,darkDangerItemSelectedColor:Ht,darkDangerItemActiveBg:k}},{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"]]})(J),dt=function(J,ue){var W={};for(var M in J)Object.prototype.hasOwnProperty.call(J,M)&&ue.indexOf(M)<0&&(W[M]=J[M]);if(J!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pe=0,M=Object.getOwnPropertySymbols(J);pe<M.length;pe++)ue.indexOf(M[pe])<0&&Object.prototype.propertyIsEnumerable.call(J,M[pe])&&(W[M[pe]]=J[M[pe]]);return W},Rt=(0,q.forwardRef)((J,ue)=>{var W,M;const pe=q.useContext(Q.Z),k=pe||{},{getPrefixCls:N,getPopupContainer:P,direction:ne,menu:F}=q.useContext(Z.E_),se=N(),{prefixCls:de,className:ge,style:be,theme:Le="light",expandIcon:Ne,_internalDisableMenuItemTitleTooltip:ze,inlineCollapsed:Ie,siderCollapsed:Ke,items:je,children:Ce,rootClassName:vt,mode:st,selectable:St,onClick:Ze,overflowedIndicatorPopupClassName:Ht}=J,Kt=dt(J,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),zt=(0,D.Z)(Kt,["collapsedWidth"]),Ot=Ee(je)||Ce;(W=k.validator)===null||W===void 0||W.call(k,{mode:st});const ht=(0,A.useEvent)(function(){var Wt;Ze==null||Ze.apply(void 0,arguments),(Wt=k.onClick)===null||Wt===void 0||Wt.call(k)}),yt=k.mode||st,ut=St!=null?St:k.selectable,Ct=q.useMemo(()=>Ke!==void 0?Ke:Ie,[Ie,Ke]),ft={horizontal:{motionName:`${se}-slide-up`},inline:(0,E.Z)(se),other:{motionName:`${se}-zoom-big`}},Mt=N("menu",de||k.prefixCls),[Qt,Jt]=Tt(Mt,!pe),ln=oe()(`${Mt}-${Le}`,F==null?void 0:F.className,ge);let an;if(typeof Ne=="function")an=Ne;else if(Ne===null||Ne===!1)an=null;else if(k.expandIcon===null||k.expandIcon===!1)an=null;else{const Wt=Ne!=null?Ne:k.expandIcon;an=(0,u.Tm)(Wt,{className:oe()(`${Mt}-submenu-expand-icon`,(0,u.l$)(Wt)?(M=Wt.props)===null||M===void 0?void 0:M.className:"")})}const jt=q.useMemo(()=>({prefixCls:Mt,inlineCollapsed:Ct||!1,direction:ne,firstLevel:!0,theme:Le,mode:yt,disableMenuItemTitleTooltip:ze}),[Mt,Ct,ne,ze,Le]);return Qt(q.createElement(Q.Z.Provider,{value:null},q.createElement(m.Provider,{value:jt},q.createElement(B.ZP,Object.assign({getPopupContainer:P,overflowedIndicator:q.createElement(O.Z,null),overflowedIndicatorPopupClassName:oe()(Mt,`${Mt}-${Le}`,Ht),mode:yt,selectable:ut,onClick:ht},zt,{inlineCollapsed:Ct,style:Object.assign(Object.assign({},F==null?void 0:F.style),be),className:ln,prefixCls:Mt,direction:ne,defaultMotions:ft,expandIcon:an,ref:ue,rootClassName:oe()(vt,Jt)}),Ot))))});const _t=(0,q.forwardRef)((J,ue)=>{const W=(0,q.useRef)(null),M=q.useContext(ve.D);return(0,q.useImperativeHandle)(ue,()=>({menu:W.current,focus:pe=>{var k;(k=W.current)===null||k===void 0||k.focus(pe)}})),q.createElement(Rt,Object.assign({ref:W},J,M))});_t.Item=H,_t.SubMenu=w,_t.Divider=o,_t.ItemGroup=B.BW;var Pe=_t},13570:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return $}});var B=b(92413),q=b(59301),ve={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"},fe=ve,oe=b(7657),Z=function(me,Se){return q.createElement(oe.Z,(0,B.Z)({},me,{ref:Se,icon:fe}))},_e=q.forwardRef(Z),le=_e,o=b(92310),K=b.n(o),D=b(400),f=b(33606),u=b(37061),g=b(18929),m=b(10228),I=b(26112);function H(j,me){var Se=j.disabled,Te=j.prefixCls,De=j.character,qe=j.characterRender,lt=j.index,We=j.count,Tt=j.value,dt=j.allowHalf,wt=j.focused,Rt=j.onHover,_t=j.onClick,Pe=function(P){Rt(P,lt)},J=function(P){_t(P,lt)},ue=function(P){P.keyCode===m.Z.ENTER&&_t(P,lt)},W=lt+1,M=new Set([Te]);Tt===0&<===0&&wt?M.add("".concat(Te,"-focused")):dt&&Tt+.5>=W&&Tt<W?(M.add("".concat(Te,"-half")),M.add("".concat(Te,"-active")),wt&&M.add("".concat(Te,"-focused"))):(W<=Tt?M.add("".concat(Te,"-full")):M.add("".concat(Te,"-zero")),W===Tt&&wt&&M.add("".concat(Te,"-focused")));var pe=typeof De=="function"?De(j):De,k=q.createElement("li",{className:K()(Array.from(M)),ref:me},q.createElement("div",{onClick:Se?null:J,onKeyDown:Se?null:ue,onMouseMove:Se?null:Pe,role:"radio","aria-checked":Tt>lt?"true":"false","aria-posinset":lt+1,"aria-setsize":We,tabIndex:Se?-1:0},q.createElement("div",{className:"".concat(Te,"-first")},pe),q.createElement("div",{className:"".concat(Te,"-second")},pe)));return qe&&(k=qe(k,j)),k}var L=q.forwardRef(H);function w(){var j=q.useRef({});function me(Te){return j.current[Te]}function Se(Te){return function(De){j.current[Te]=De}}return[me,Se]}function O(j){var me=j.pageXOffset,Se="scrollLeft";if(typeof me!="number"){var Te=j.document;me=Te.documentElement[Se],typeof me!="number"&&(me=Te.body[Se])}return me}function A(j){var me,Se,Te=j.ownerDocument,De=Te.body,qe=Te&&Te.documentElement,lt=j.getBoundingClientRect();return me=lt.left,Se=lt.top,me-=qe.clientLeft||De.clientLeft||0,Se-=qe.clientTop||De.clientTop||0,{left:me,top:Se}}function E(j){var me=A(j),Se=j.ownerDocument,Te=Se.defaultView||Se.parentWindow;return me.left+=O(Te),me.left}var Q=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function te(j,me){var Se,Te=j.prefixCls,De=Te===void 0?"rc-rate":Te,qe=j.className,lt=j.defaultValue,We=j.value,Tt=j.count,dt=Tt===void 0?5:Tt,wt=j.allowHalf,Rt=wt===void 0?!1:wt,_t=j.allowClear,Pe=_t===void 0?!0:_t,J=j.character,ue=J===void 0?"\u2605":J,W=j.characterRender,M=j.disabled,pe=j.direction,k=pe===void 0?"ltr":pe,N=j.tabIndex,P=N===void 0?0:N,ne=j.autoFocus,F=j.onHoverChange,se=j.onChange,de=j.onFocus,ge=j.onBlur,be=j.onKeyDown,Le=j.onMouseLeave,Ne=(0,u.Z)(j,Q),ze=w(),Ie=(0,f.Z)(ze,2),Ke=Ie[0],je=Ie[1],Ce=q.useRef(null),vt=function(){if(!M){var Ae;(Ae=Ce.current)===null||Ae===void 0||Ae.focus()}};q.useImperativeHandle(me,function(){return{focus:vt,blur:function(){if(!M){var Ae;(Ae=Ce.current)===null||Ae===void 0||Ae.blur()}}}});var st=(0,g.Z)(lt||0,{value:We}),St=(0,f.Z)(st,2),Ze=St[0],Ht=St[1],Kt=(0,g.Z)(null),zt=(0,f.Z)(Kt,2),Ot=zt[0],ht=zt[1],yt=function(Ae,tt){var Qe=k==="rtl",at=Ae+1;if(Rt){var Ft=Ke(Ae),Vt=E(Ft),ot=Ft.clientWidth;(Qe&&tt-Vt>ot/2||!Qe&&tt-Vt<ot/2)&&(at-=.5)}return at},ut=function(Ae){Ht(Ae),se==null||se(Ae)},Ct=q.useState(!1),ft=(0,f.Z)(Ct,2),Mt=ft[0],Qt=ft[1],Jt=function(){Qt(!0),de==null||de()},ln=function(){Qt(!1),ge==null||ge()},an=q.useState(null),jt=(0,f.Z)(an,2),Wt=jt[0],pt=jt[1],Xe=function(Ae,tt){var Qe=yt(tt,Ae.pageX);Qe!==Ot&&(pt(Qe),ht(null)),F==null||F(Qe)},c=function(Ae){M||(pt(null),ht(null),F==null||F(void 0)),Ae&&(Le==null||Le(Ae))},p=function(Ae,tt){var Qe=yt(tt,Ae.pageX),at=!1;Pe&&(at=Qe===Ze),c(),ut(at?0:Qe),ht(at?Qe:null)},x=function(Ae){var tt=Ae.keyCode,Qe=k==="rtl",at=Ze;tt===m.Z.RIGHT&&at<dt&&!Qe?(Rt?at+=.5:at+=1,ut(at),Ae.preventDefault()):tt===m.Z.LEFT&&at>0&&!Qe||tt===m.Z.RIGHT&&at>0&&Qe?(Rt?at-=.5:at-=1,ut(at),Ae.preventDefault()):tt===m.Z.LEFT&&at<dt&&Qe&&(Rt?at+=.5:at+=1,ut(at),Ae.preventDefault()),be==null||be(Ae)};q.useEffect(function(){ne&&!M&&vt()},[]);var G=new Array(dt).fill(0).map(function(ye,Ae){return q.createElement(L,{ref:je(Ae),index:Ae,count:dt,disabled:M,prefixCls:"".concat(De,"-star"),allowHalf:Rt,value:Wt===null?Ze:Wt,onClick:p,onHover:Xe,key:ye||Ae,character:ue,characterRender:W,focused:Mt})}),re=K()(De,qe,(Se={},(0,D.Z)(Se,"".concat(De,"-disabled"),M),(0,D.Z)(Se,"".concat(De,"-rtl"),k==="rtl"),Se));return q.createElement("ul",(0,B.Z)({className:re,onMouseLeave:c,tabIndex:M?-1:P,onFocus:M?null:Jt,onBlur:M?null:ln,onKeyDown:M?null:x,ref:Ce,role:"radiogroup"},(0,I.Z)(Ne,{aria:!0,data:!0,attr:!0})),G)}var ie=q.forwardRef(te),Ee=ie,we=b(36355),xe=b(6848),he=b(17313),V=b(83116),T=b(37613);const C=j=>{const{componentCls:me}=j;return{[`${me}-star`]:{position:"relative",display:"inline-block",color:"inherit",cursor:"pointer","&:not(:last-child)":{marginInlineEnd:j.marginXS},"> div":{transition:`all ${j.motionDurationMid}, outline 0s`,"&:hover":{transform:j.starHoverScale},"&:focus":{outline:0},"&:focus-visible":{outline:`${j.lineWidth}px dashed ${j.starColor}`,transform:j.starHoverScale}},"&-first, &-second":{color:j.starBg,transition:`all ${j.motionDurationMid}`,userSelect:"none",[j.iconCls]:{verticalAlign:"middle"}},"&-first":{position:"absolute",top:0,insetInlineStart:0,width:"50%",height:"100%",overflow:"hidden",opacity:0},[`&-half ${me}-star-first, &-half ${me}-star-second`]:{opacity:1},[`&-half ${me}-star-first, &-full ${me}-star-second`]:{color:"inherit"}}}},R=j=>({[`&-rtl${j.componentCls}`]:{direction:"rtl"}}),z=j=>{const{componentCls:me}=j;return{[me]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,he.Wf)(j)),{display:"inline-block",margin:0,padding:0,color:j.starColor,fontSize:j.starSize,lineHeight:"unset",listStyle:"none",outline:"none",[`&-disabled${me} ${me}-star`]:{cursor:"default","> div:hover":{transform:"scale(1)"}}}),C(j)),{[`+ ${me}-text`]:{display:"inline-block",marginInlineStart:j.marginXS,fontSize:j.fontSize}}),R(j))}};var Y=(0,V.Z)("Rate",j=>{const me=(0,T.TS)(j,{});return[z(me)]},j=>({starColor:j.yellow6,starSize:j.controlHeightLG*.5,starHoverScale:"scale(1.1)",starBg:j.colorFillContent})),y=function(j,me){var Se={};for(var Te in j)Object.prototype.hasOwnProperty.call(j,Te)&&me.indexOf(Te)<0&&(Se[Te]=j[Te]);if(j!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,Te=Object.getOwnPropertySymbols(j);De<Te.length;De++)me.indexOf(Te[De])<0&&Object.prototype.propertyIsEnumerable.call(j,Te[De])&&(Se[Te[De]]=j[Te[De]]);return Se},$=q.forwardRef((j,me)=>{const{prefixCls:Se,className:Te,rootClassName:De,style:qe,tooltips:lt,character:We=q.createElement(le,null)}=j,Tt=y(j,["prefixCls","className","rootClassName","style","tooltips","character"]),dt=(M,pe)=>{let{index:k}=pe;return lt?q.createElement(xe.Z,{title:lt[k]},M):M},{getPrefixCls:wt,direction:Rt,rate:_t}=q.useContext(we.E_),Pe=wt("rate",Se),[J,ue]=Y(Pe),W=Object.assign(Object.assign({},_t==null?void 0:_t.style),qe);return J(q.createElement(Ee,Object.assign({ref:me,character:We,characterRender:dt},Tt,{className:K()(Te,De,ue,_t==null?void 0:_t.className),style:W,prefixCls:Pe,direction:Rt})))})},81327:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return H}});var B=b(59301),q=b(92310),ve=b.n(q),fe=b(11592),oe=b(36355),Z=b(33234);const _e=B.createContext({latestIndex:0}),le=_e.Provider;var K=L=>{let{className:w,index:O,children:A,split:E,style:Q}=L;const{latestIndex:te}=B.useContext(_e);return A==null?null:B.createElement(B.Fragment,null,B.createElement("div",{className:w,style:Q},A),O<te&&E&&B.createElement("span",{className:`${w}-split`},E))},D=b(2856);function f(L){return["small","middle","large"].includes(L)}function u(L){return L?typeof L=="number"&&!Number.isNaN(L):!1}var g=function(L,w){var O={};for(var A in L)Object.prototype.hasOwnProperty.call(L,A)&&w.indexOf(A)<0&&(O[A]=L[A]);if(L!=null&&typeof Object.getOwnPropertySymbols=="function")for(var E=0,A=Object.getOwnPropertySymbols(L);E<A.length;E++)w.indexOf(A[E])<0&&Object.prototype.propertyIsEnumerable.call(L,A[E])&&(O[A[E]]=L[A[E]]);return O};const I=B.forwardRef((L,w)=>{var O,A;const{getPrefixCls:E,space:Q,direction:te}=B.useContext(oe.E_),{size:ie=(Q==null?void 0:Q.size)||"small",align:Ee,className:we,rootClassName:xe,children:he,direction:V="horizontal",prefixCls:T,split:C,style:R,wrap:z=!1,classNames:Y,styles:y}=L,v=g(L,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[$,j]=Array.isArray(ie)?ie:[ie,ie],me=f(j),Se=f($),Te=u(j),De=u($),qe=(0,fe.Z)(he,{keepEmpty:!0}),lt=Ee===void 0&&V==="horizontal"?"center":Ee,We=E("space",T),[Tt,dt]=(0,D.Z)(We),wt=ve()(We,Q==null?void 0:Q.className,dt,`${We}-${V}`,{[`${We}-rtl`]:te==="rtl",[`${We}-align-${lt}`]:lt,[`${We}-gap-row-${j}`]:me,[`${We}-gap-col-${$}`]:Se},we,xe),Rt=ve()(`${We}-item`,(O=Y==null?void 0:Y.item)!==null&&O!==void 0?O:(A=Q==null?void 0:Q.classNames)===null||A===void 0?void 0:A.item);let _t=0;const Pe=qe.map((W,M)=>{var pe,k;W!=null&&(_t=M);const N=W&&W.key||`${Rt}-${M}`;return B.createElement(K,{className:Rt,key:N,index:M,split:C,style:(pe=y==null?void 0:y.item)!==null&&pe!==void 0?pe:(k=Q==null?void 0:Q.styles)===null||k===void 0?void 0:k.item},W)}),J=B.useMemo(()=>({latestIndex:_t}),[_t]);if(qe.length===0)return null;const ue={};return z&&(ue.flexWrap="wrap"),!Se&&De&&(ue.columnGap=$),!me&&Te&&(ue.rowGap=j),Tt(B.createElement("div",Object.assign({ref:w,className:wt,style:Object.assign(Object.assign(Object.assign({},ue),Q==null?void 0:Q.style),R)},v),B.createElement(le,{value:J},Pe)))});I.Compact=Z.ZP;var H=I},8378:function(bt,ke){"use strict";const b=B=>({[B.componentCls]:{[`${B.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${B.motionDurationMid} ${B.motionEaseInOut},
|
|
opacity ${B.motionDurationMid} ${B.motionEaseInOut} !important`}},[`${B.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${B.motionDurationMid} ${B.motionEaseInOut},
|
|
opacity ${B.motionDurationMid} ${B.motionEaseInOut} !important`}}});ke.Z=b},92899:function(bt,ke,b){"use strict";b.d(ke,{Fm:function(){return f}});var B=b(93083),q=b(95406);const ve=new B.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),fe=new B.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),oe=new B.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Z=new B.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),_e=new B.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),le=new B.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),o=new B.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 B.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),D={"move-up":{inKeyframes:o,outKeyframes:K},"move-down":{inKeyframes:ve,outKeyframes:fe},"move-left":{inKeyframes:oe,outKeyframes:Z},"move-right":{inKeyframes:_e,outKeyframes:le}},f=(u,g)=>{const{antCls:m}=u,I=`${m}-${g}`,{inKeyframes:H,outKeyframes:L}=D[g];return[(0,q.R)(I,H,L,u.motionDurationMid),{[`
|
|
${I}-enter,
|
|
${I}-appear
|
|
`]:{opacity:0,animationTimingFunction:u.motionEaseOutCirc},[`${I}-leave`]:{animationTimingFunction:u.motionEaseInOutCirc}}]}},13826:function(bt,ke,b){"use strict";b.d(ke,{Qt:function(){return oe},Uw:function(){return fe},fJ:function(){return ve},ly:function(){return Z},oN:function(){return f}});var B=b(93083),q=b(95406);const ve=new B.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),fe=new B.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),oe=new B.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),Z=new B.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),_e=new B.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),le=new B.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),o=new B.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),K=new B.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),D={"slide-up":{inKeyframes:ve,outKeyframes:fe},"slide-down":{inKeyframes:oe,outKeyframes:Z},"slide-left":{inKeyframes:_e,outKeyframes:le},"slide-right":{inKeyframes:o,outKeyframes:K}},f=(u,g)=>{const{antCls:m}=u,I=`${m}-${g}`,{inKeyframes:H,outKeyframes:L}=D[g];return[(0,q.R)(I,H,L,u.motionDurationMid),{[`
|
|
${I}-enter,
|
|
${I}-appear
|
|
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:u.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${I}-leave`]:{animationTimingFunction:u.motionEaseInQuint}}]}},19447:function(bt,ke,b){"use strict";b.d(ke,{ZP:function(){return oe},fS:function(){return ve},qN:function(){return q}});var B=b(47585);const q=8;function ve(Z){const _e=q,{contentRadius:le,limitVerticalRadius:o}=Z,K=le>12?le+2:12;return{dropdownArrowOffset:K,dropdownArrowOffsetVertical:o?_e:K}}function fe(Z,_e){return Z?_e:{}}function oe(Z,_e){const{componentCls:le,sizePopupArrow:o,borderRadiusXS:K,borderRadiusOuter:D,boxShadowPopoverArrow:f}=Z,{colorBg:u,contentRadius:g=Z.borderRadiusLG,limitVerticalRadius:m,arrowDistance:I=0,arrowPlacement:H={left:!0,right:!0,top:!0,bottom:!0}}=_e,{dropdownArrowOffsetVertical:L,dropdownArrowOffset:w}=ve({contentRadius:g,limitVerticalRadius:m});return{[le]:Object.assign(Object.assign(Object.assign(Object.assign({[`${le}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,B.r)(o,K,D,u,f)),{"&:before":{background:u}})]},fe(!!H.top,{[[`&-placement-top ${le}-arrow`,`&-placement-topLeft ${le}-arrow`,`&-placement-topRight ${le}-arrow`].join(",")]:{bottom:I,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${le}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${le}-arrow`]:{left:{_skip_check_:!0,value:w}},[`&-placement-topRight ${le}-arrow`]:{right:{_skip_check_:!0,value:w}}})),fe(!!H.bottom,{[[`&-placement-bottom ${le}-arrow`,`&-placement-bottomLeft ${le}-arrow`,`&-placement-bottomRight ${le}-arrow`].join(",")]:{top:I,transform:"translateY(-100%)"},[`&-placement-bottom ${le}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${le}-arrow`]:{left:{_skip_check_:!0,value:w}},[`&-placement-bottomRight ${le}-arrow`]:{right:{_skip_check_:!0,value:w}}})),fe(!!H.left,{[[`&-placement-left ${le}-arrow`,`&-placement-leftTop ${le}-arrow`,`&-placement-leftBottom ${le}-arrow`].join(",")]:{right:{_skip_check_:!0,value:I},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${le}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${le}-arrow`]:{top:L},[`&-placement-leftBottom ${le}-arrow`]:{bottom:L}})),fe(!!H.right,{[[`&-placement-right ${le}-arrow`,`&-placement-rightTop ${le}-arrow`,`&-placement-rightBottom ${le}-arrow`].join(",")]:{left:{_skip_check_:!0,value:I},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${le}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${le}-arrow`]:{top:L},[`&-placement-rightBottom ${le}-arrow`]:{bottom:L}}))}}},47585:function(bt,ke,b){"use strict";b.d(ke,{r:function(){return B}});const B=(q,ve,fe,oe,Z)=>{const _e=q/2,le=0,o=_e,K=fe*1/Math.sqrt(2),D=_e-fe*(1-1/Math.sqrt(2)),f=_e-ve*(1/Math.sqrt(2)),u=fe*(Math.sqrt(2)-1)+ve*(1/Math.sqrt(2)),g=2*_e-f,m=u,I=2*_e-K,H=D,L=2*_e-le,w=o,O=_e*Math.sqrt(2)+fe*(Math.sqrt(2)-2),A=fe*(Math.sqrt(2)-1);return{pointerEvents:"none",width:q,height:q,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:q,height:q/2,background:oe,clipPath:{_multi_value_:!0,value:[`polygon(${A}px 100%, 50% ${A}px, ${2*_e-A}px 100%, ${A}px 100%)`,`path('M ${le} ${o} A ${fe} ${fe} 0 0 0 ${K} ${D} L ${f} ${u} A ${ve} ${ve} 0 0 1 ${g} ${m} L ${I} ${H} A ${fe} ${fe} 0 0 0 ${L} ${w} Z')`]},content:'""'},"&::after":{content:'""',position:"absolute",width:O,height:O,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${ve}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:Z,zIndex:0,background:"transparent"}}}},78673:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return V}});var B=b(58617),q=b(92310),ve=b.n(q),fe=b(92413),oe=b(400),Z=b(33606),_e=b(37061),le=b(59301),o=b(18929),K=b(10228),D=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],f=le.forwardRef(function(T,C){var R,z=T.prefixCls,Y=z===void 0?"rc-switch":z,y=T.className,v=T.checked,$=T.defaultChecked,j=T.disabled,me=T.loadingIcon,Se=T.checkedChildren,Te=T.unCheckedChildren,De=T.onClick,qe=T.onChange,lt=T.onKeyDown,We=(0,_e.Z)(T,D),Tt=(0,o.Z)(!1,{value:v,defaultValue:$}),dt=(0,Z.Z)(Tt,2),wt=dt[0],Rt=dt[1];function _t(W,M){var pe=wt;return j||(pe=W,Rt(pe),qe==null||qe(pe,M)),pe}function Pe(W){W.which===K.Z.LEFT?_t(!1,W):W.which===K.Z.RIGHT&&_t(!0,W),lt==null||lt(W)}function J(W){var M=_t(!wt,W);De==null||De(M,W)}var ue=ve()(Y,y,(R={},(0,oe.Z)(R,"".concat(Y,"-checked"),wt),(0,oe.Z)(R,"".concat(Y,"-disabled"),j),R));return le.createElement("button",(0,fe.Z)({},We,{type:"button",role:"switch","aria-checked":wt,disabled:j,className:ue,ref:C,onKeyDown:Pe,onClick:J}),me,le.createElement("span",{className:"".concat(Y,"-inner")},le.createElement("span",{className:"".concat(Y,"-inner-checked")},Se),le.createElement("span",{className:"".concat(Y,"-inner-unchecked")},Te)))});f.displayName="Switch";var u=f,g=b(14088),m=b(36355),I=b(1684),H=b(19716),L=b(64993),w=b(17313),O=b(83116),A=b(37613);const E=T=>{const{componentCls:C,trackHeightSM:R,trackPadding:z,trackMinWidthSM:Y,innerMinMarginSM:y,innerMaxMarginSM:v,handleSizeSM:$}=T,j=`${C}-inner`;return{[C]:{[`&${C}-small`]:{minWidth:Y,height:R,lineHeight:`${R}px`,[`${C}-inner`]:{paddingInlineStart:v,paddingInlineEnd:y,[`${j}-checked`]:{marginInlineStart:`calc(-100% + ${$+z*2}px - ${v*2}px)`,marginInlineEnd:`calc(100% - ${$+z*2}px + ${v*2}px)`},[`${j}-unchecked`]:{marginTop:-R,marginInlineStart:0,marginInlineEnd:0}},[`${C}-handle`]:{width:$,height:$},[`${C}-loading-icon`]:{top:($-T.switchLoadingIconSize)/2,fontSize:T.switchLoadingIconSize},[`&${C}-checked`]:{[`${C}-inner`]:{paddingInlineStart:y,paddingInlineEnd:v,[`${j}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${j}-unchecked`]:{marginInlineStart:`calc(100% - ${$+z*2}px + ${v*2}px)`,marginInlineEnd:`calc(-100% + ${$+z*2}px - ${v*2}px)`}},[`${C}-handle`]:{insetInlineStart:`calc(100% - ${$+z}px)`}},[`&:not(${C}-disabled):active`]:{[`&:not(${C}-checked) ${j}`]:{[`${j}-unchecked`]:{marginInlineStart:T.marginXXS/2,marginInlineEnd:-T.marginXXS/2}},[`&${C}-checked ${j}`]:{[`${j}-checked`]:{marginInlineStart:-T.marginXXS/2,marginInlineEnd:T.marginXXS/2}}}}}}},Q=T=>{const{componentCls:C,handleSize:R}=T;return{[C]:{[`${C}-loading-icon${T.iconCls}`]:{position:"relative",top:(R-T.fontSize)/2,color:T.switchLoadingIconColor,verticalAlign:"top"},[`&${C}-checked ${C}-loading-icon`]:{color:T.switchColor}}}},te=T=>{const{componentCls:C,motion:R,trackPadding:z,handleBg:Y,handleShadow:y,handleSize:v}=T,$=`${C}-handle`;return{[C]:{[$]:{position:"absolute",top:z,insetInlineStart:z,width:v,height:v,transition:`all ${T.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:Y,borderRadius:v/2,boxShadow:y,transition:`all ${T.switchDuration} ease-in-out`,content:'""'}},[`&${C}-checked ${$}`]:{insetInlineStart:`calc(100% - ${v+z}px)`},[`&:not(${C}-disabled):active`]:R?{[`${$}::before`]:{insetInlineEnd:T.switchHandleActiveInset,insetInlineStart:0},[`&${C}-checked ${$}::before`]:{insetInlineEnd:0,insetInlineStart:T.switchHandleActiveInset}}:{}}}},ie=T=>{const{componentCls:C,trackHeight:R,trackPadding:z,innerMinMargin:Y,innerMaxMargin:y,handleSize:v}=T,$=`${C}-inner`;return{[C]:{[$]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:y,paddingInlineEnd:Y,transition:`padding-inline-start ${T.switchDuration} ease-in-out, padding-inline-end ${T.switchDuration} ease-in-out`,[`${$}-checked, ${$}-unchecked`]:{display:"block",color:T.colorTextLightSolid,fontSize:T.fontSizeSM,transition:`margin-inline-start ${T.switchDuration} ease-in-out, margin-inline-end ${T.switchDuration} ease-in-out`,pointerEvents:"none"},[`${$}-checked`]:{marginInlineStart:`calc(-100% + ${v+z*2}px - ${y*2}px)`,marginInlineEnd:`calc(100% - ${v+z*2}px + ${y*2}px)`},[`${$}-unchecked`]:{marginTop:-R,marginInlineStart:0,marginInlineEnd:0}},[`&${C}-checked ${$}`]:{paddingInlineStart:Y,paddingInlineEnd:y,[`${$}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${$}-unchecked`]:{marginInlineStart:`calc(100% - ${v+z*2}px + ${y*2}px)`,marginInlineEnd:`calc(-100% + ${v+z*2}px - ${y*2}px)`}},[`&:not(${C}-disabled):active`]:{[`&:not(${C}-checked) ${$}`]:{[`${$}-unchecked`]:{marginInlineStart:z*2,marginInlineEnd:-z*2}},[`&${C}-checked ${$}`]:{[`${$}-checked`]:{marginInlineStart:-z*2,marginInlineEnd:z*2}}}}}},Ee=T=>{const{componentCls:C,trackHeight:R,trackMinWidth:z}=T;return{[C]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,w.Wf)(T)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:z,height:R,lineHeight:`${R}px`,verticalAlign:"middle",background:T.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${T.motionDurationMid}`,userSelect:"none",[`&:hover:not(${C}-disabled)`]:{background:T.colorTextTertiary}}),(0,w.Qy)(T)),{[`&${C}-checked`]:{background:T.switchColor,[`&:hover:not(${C}-disabled)`]:{background:T.colorPrimaryHover}},[`&${C}-loading, &${C}-disabled`]:{cursor:"not-allowed",opacity:T.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${C}-rtl`]:{direction:"rtl"}})}};var we=(0,O.Z)("Switch",T=>{const C=(0,A.TS)(T,{switchDuration:T.motionDurationMid,switchColor:T.colorPrimary,switchDisabledOpacity:T.opacityLoading,switchLoadingIconSize:T.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${T.opacityLoading})`,switchHandleActiveInset:"-30%"});return[Ee(C),ie(C),te(C),Q(C),E(C)]},T=>{const{fontSize:C,lineHeight:R,controlHeight:z,colorWhite:Y}=T,y=C*R,v=z/2,$=2,j=y-$*2,me=v-$*2;return{trackHeight:y,trackHeightSM:v,trackMinWidth:j*2+$*4,trackMinWidthSM:me*2+$*2,trackPadding:$,handleBg:Y,handleSize:j,handleSizeSM:me,handleShadow:`0 2px 4px 0 ${new L.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:j/2,innerMaxMargin:j+$+$*2,innerMinMarginSM:me/2,innerMaxMarginSM:me+$+$*2}}),xe=function(T,C){var R={};for(var z in T)Object.prototype.hasOwnProperty.call(T,z)&&C.indexOf(z)<0&&(R[z]=T[z]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Y=0,z=Object.getOwnPropertySymbols(T);Y<z.length;Y++)C.indexOf(z[Y])<0&&Object.prototype.propertyIsEnumerable.call(T,z[Y])&&(R[z[Y]]=T[z[Y]]);return R};const he=le.forwardRef((T,C)=>{const{prefixCls:R,size:z,disabled:Y,loading:y,className:v,rootClassName:$,style:j}=T,me=xe(T,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:Se,direction:Te,switch:De}=le.useContext(m.E_),qe=le.useContext(I.Z),lt=(Y!=null?Y:qe)||y,We=Se("switch",R),Tt=le.createElement("div",{className:`${We}-handle`},y&&le.createElement(B.Z,{className:`${We}-loading-icon`})),[dt,wt]=we(We),Rt=(0,H.Z)(z),_t=ve()(De==null?void 0:De.className,{[`${We}-small`]:Rt==="small",[`${We}-loading`]:y,[`${We}-rtl`]:Te==="rtl"},v,$,wt),Pe=Object.assign(Object.assign({},De==null?void 0:De.style),j);return dt(le.createElement(g.Z,{component:"Switch"},le.createElement(u,Object.assign({},me,{prefixCls:We,className:_t,style:Pe,disabled:lt,ref:C,loadingIcon:Tt}))))});he.__ANT_SWITCH=!0;var V=he},33166:function(bt,ke,b){"use strict";b.d(ke,{i:function(){return B}});const B=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"]},45157:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return q}});var B=b(33166);function q(ve,fe){return B.i.reduce((oe,Z)=>{const _e=ve[`${Z}1`],le=ve[`${Z}3`],o=ve[`${Z}6`],K=ve[`${Z}7`];return Object.assign(Object.assign({},oe),fe(Z,{lightColor:_e,lightBorderColor:le,darkColor:o,textColor:K}))},{})}},6848:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return xe}});var B=b(59301),q=b(92310),ve=b.n(q),fe=b(55477),oe=b(18929),Z=b(62892),_e=b(79676),le=b(92343),o=b(36355),K=b(33234),D=b(88088),f=b(17313),u=b(29878),g=b(19447),m=b(45157),I=b(37613),H=b(83116);const L=he=>{const{componentCls:V,tooltipMaxWidth:T,tooltipColor:C,tooltipBg:R,tooltipBorderRadius:z,zIndexPopup:Y,controlHeight:y,boxShadowSecondary:v,paddingSM:$,paddingXS:j,tooltipRadiusOuter:me}=he;return[{[V]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,f.Wf)(he)),{position:"absolute",zIndex:Y,display:"block",width:"max-content",maxWidth:T,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":R,[`${V}-inner`]:{minWidth:y,minHeight:y,padding:`${$/2}px ${j}px`,color:C,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:R,borderRadius:z,boxShadow:v,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${V}-inner`]:{borderRadius:Math.min(z,g.qN)}},[`${V}-content`]:{position:"relative"}}),(0,m.Z)(he,(Se,Te)=>{let{darkColor:De}=Te;return{[`&${V}-${Se}`]:{[`${V}-inner`]:{backgroundColor:De},[`${V}-arrow`]:{"--antd-arrow-background-color":De}}}})),{"&-rtl":{direction:"rtl"}})},(0,g.ZP)((0,I.TS)(he,{borderRadiusOuter:me}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:z,limitVerticalRadius:!0}),{[`${V}-pure`]:{position:"relative",maxWidth:"none",margin:he.sizePopupArrow}}]};var w=(he,V)=>(0,H.Z)("Tooltip",C=>{if(V===!1)return[];const{borderRadius:R,colorTextLightSolid:z,colorBgDefault:Y,borderRadiusOuter:y}=C,v=(0,I.TS)(C,{tooltipMaxWidth:250,tooltipColor:z,tooltipBorderRadius:R,tooltipBg:Y,tooltipRadiusOuter:y>4?4:y});return[L(v),(0,u._y)(C,"zoom-big-fast")]},C=>{let{zIndexPopupBase:R,colorBgSpotlight:z}=C;return{zIndexPopup:R+70,colorBgDefault:z}},{resetStyle:!1})(he),O=b(36785);function A(he,V){const T=(0,O.o2)(V),C=ve()({[`${he}-${V}`]:V&&T}),R={},z={};return V&&!T&&(R.background=V,z["--antd-arrow-background-color"]=V),{className:C,overlayStyle:R,arrowStyle:z}}var Q=he=>{const{prefixCls:V,className:T,placement:C="top",title:R,color:z,overlayInnerStyle:Y}=he,{getPrefixCls:y}=B.useContext(o.E_),v=y("tooltip",V),[$,j]=w(v,!0),me=A(v,z),Se=me.arrowStyle,Te=Object.assign(Object.assign({},Y),me.overlayStyle),De=ve()(j,v,`${v}-pure`,`${v}-placement-${C}`,T,me.className);return $(B.createElement("div",{className:De,style:Se},B.createElement("div",{className:`${v}-arrow`}),B.createElement(fe.G,Object.assign({},he,{className:j,prefixCls:v,overlayInnerStyle:Te}),R)))},te=function(he,V){var T={};for(var C in he)Object.prototype.hasOwnProperty.call(he,C)&&V.indexOf(C)<0&&(T[C]=he[C]);if(he!=null&&typeof Object.getOwnPropertySymbols=="function")for(var R=0,C=Object.getOwnPropertySymbols(he);R<C.length;R++)V.indexOf(C[R])<0&&Object.prototype.propertyIsEnumerable.call(he,C[R])&&(T[C[R]]=he[C[R]]);return T};const ie=(he,V)=>{const T={},C=Object.assign({},he);return V.forEach(R=>{he&&R in he&&(T[R]=he[R],delete C[R])}),{picked:T,omitted:C}};function Ee(he,V){const T=he.type;if((T.__ANT_BUTTON===!0||he.type==="button")&&he.props.disabled||T.__ANT_SWITCH===!0&&(he.props.disabled||he.props.loading)||T.__ANT_RADIO===!0&&he.props.disabled){const{picked:C,omitted:R}=ie(he.props.style,["position","left","right","top","bottom","float","display","zIndex"]),z=Object.assign(Object.assign({display:"inline-block"},C),{cursor:"not-allowed",width:he.props.block?"100%":void 0}),Y=Object.assign(Object.assign({},R),{pointerEvents:"none"}),y=(0,le.Tm)(he,{style:Y,className:null});return B.createElement("span",{style:z,className:ve()(he.props.className,`${V}-disabled-compatible-wrapper`)},y)}return he}const we=B.forwardRef((he,V)=>{var T,C;const{prefixCls:R,openClassName:z,getTooltipContainer:Y,overlayClassName:y,color:v,overlayInnerStyle:$,children:j,afterOpenChange:me,afterVisibleChange:Se,destroyTooltipOnHide:Te,arrow:De=!0,title:qe,overlay:lt,builtinPlacements:We,arrowPointAtCenter:Tt=!1,autoAdjustOverflow:dt=!0}=he,wt=!!De,[,Rt]=(0,D.Z)(),{getPopupContainer:_t,getPrefixCls:Pe,direction:J}=B.useContext(o.E_),ue=B.useRef(null),W=()=>{var yt;(yt=ue.current)===null||yt===void 0||yt.forceAlign()};B.useImperativeHandle(V,()=>({forceAlign:W,forcePopupAlign:()=>{W()}}));const[M,pe]=(0,oe.Z)(!1,{value:(T=he.open)!==null&&T!==void 0?T:he.visible,defaultValue:(C=he.defaultOpen)!==null&&C!==void 0?C:he.defaultVisible}),k=!qe&&!lt&&qe!==0,N=yt=>{var ut,Ct;pe(k?!1:yt),k||((ut=he.onOpenChange)===null||ut===void 0||ut.call(he,yt),(Ct=he.onVisibleChange)===null||Ct===void 0||Ct.call(he,yt))},P=B.useMemo(()=>{var yt,ut;let Ct=Tt;return typeof De=="object"&&(Ct=(ut=(yt=De.pointAtCenter)!==null&&yt!==void 0?yt:De.arrowPointAtCenter)!==null&&ut!==void 0?ut:Tt),We||(0,_e.Z)({arrowPointAtCenter:Ct,autoAdjustOverflow:dt,arrowWidth:wt?Rt.sizePopupArrow:0,borderRadius:Rt.borderRadius,offset:Rt.marginXXS,visibleFirst:!0})},[Tt,De,We,Rt]),ne=B.useMemo(()=>qe===0?qe:lt||qe||"",[lt,qe]),F=B.createElement(K.BR,null,typeof ne=="function"?ne():ne),{getPopupContainer:se,placement:de="top",mouseEnterDelay:ge=.1,mouseLeaveDelay:be=.1,overlayStyle:Le,rootClassName:Ne}=he,ze=te(he,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),Ie=Pe("tooltip",R),Ke=Pe(),je=he["data-popover-inject"];let Ce=M;!("open"in he)&&!("visible"in he)&&k&&(Ce=!1);const vt=Ee((0,le.l$)(j)&&!(0,le.M2)(j)?j:B.createElement("span",null,j),Ie),st=vt.props,St=!st.className||typeof st.className=="string"?ve()(st.className,z||`${Ie}-open`):st.className,[Ze,Ht]=w(Ie,!je),Kt=A(Ie,v),zt=Kt.arrowStyle,Ot=Object.assign(Object.assign({},$),Kt.overlayStyle),ht=ve()(y,{[`${Ie}-rtl`]:J==="rtl"},Kt.className,Ne,Ht);return Ze(B.createElement(fe.Z,Object.assign({},ze,{showArrow:wt,placement:de,mouseEnterDelay:ge,mouseLeaveDelay:be,prefixCls:Ie,overlayClassName:ht,overlayStyle:Object.assign(Object.assign({},zt),Le),getTooltipContainer:se||Y||_t,ref:ue,builtinPlacements:P,overlay:F,visible:Ce,onVisibleChange:N,afterVisibleChange:me!=null?me:Se,overlayInnerStyle:Ot,arrowContent:B.createElement("span",{className:`${Ie}-arrow-content`}),motion:{motionName:(0,Z.m)(Ke,"zoom-big-fast",he.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!Te}),Ce?(0,le.Tm)(vt,{className:St}):vt))});we._InternalPanelDoNotUseOrYouWillBeFired=Q;var xe=we},17574:function(bt,ke,b){"use strict";b.d(ke,{default:function(){return v}});var B=b(23130),q=b(26407),ve=b(52671),fe=b(8657),oe=b(92413),Z=b(59301),_e={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"},le=_e,o=b(7657),K=function(j,me){return Z.createElement(o.Z,(0,oe.Z)({},j,{ref:me,icon:le}))},D=Z.forwardRef(K),f=D,u=b(92310),g=b.n(u),m=b(35654),I=b(71430),H=b(36355),L=b(56082),w=b(62892),O=b(20648);const A=4;function E($){const{dropPosition:j,dropLevelOffset:me,prefixCls:Se,indent:Te,direction:De="ltr"}=$,qe=De==="ltr"?"left":"right",lt=De==="ltr"?"right":"left",We={[qe]:-me*Te+A,[lt]:0};switch(j){case-1:We.top=-3;break;case 1:We.bottom=-3;break;default:We.bottom=-3,We[qe]=Te+A;break}return Z.createElement("div",{style:We,className:`${Se}-drop-indicator`})}var Q=b(71997),ie=Z.forwardRef(($,j)=>{const{getPrefixCls:me,direction:Se,virtual:Te,tree:De}=Z.useContext(H.E_),{prefixCls:qe,className:lt,showIcon:We=!1,showLine:Tt,switcherIcon:dt,blockNode:wt=!1,children:Rt,checkable:_t=!1,selectable:Pe=!0,draggable:J,motion:ue,style:W}=$,M=me("tree",qe),pe=me(),k=ue!=null?ue:Object.assign(Object.assign({},(0,w.Z)(pe)),{motionAppear:!1}),N=Object.assign(Object.assign({},$),{checkable:_t,selectable:Pe,showIcon:We,motion:k,blockNode:wt,showLine:!!Tt,dropIndicatorRender:E}),[P,ne]=(0,O.ZP)(M),F=Z.useMemo(()=>{if(!J)return!1;let de={};switch(typeof J){case"function":de.nodeDraggable=J;break;case"object":de=Object.assign({},J);break;default:break}return de.icon!==!1&&(de.icon=de.icon||Z.createElement(L.Z,null)),de},[J]),se=de=>Z.createElement(Q.Z,{prefixCls:M,switcherIcon:dt,treeNodeProps:de,showLine:Tt});return P(Z.createElement(B.Z,Object.assign({itemHeight:20,ref:j,virtual:Te},N,{style:Object.assign(Object.assign({},De==null?void 0:De.style),W),prefixCls:M,className:g()({[`${M}-icon-hide`]:!We,[`${M}-block-node`]:wt,[`${M}-unselectable`]:!Pe,[`${M}-rtl`]:Se==="rtl"},De==null?void 0:De.className,lt,ne),direction:Se,checkable:_t&&Z.createElement("span",{className:`${M}-checkbox-inner`}),selectable:Pe,switcherIcon:se,draggable:F}),Rt))}),Ee;(function($){$[$.None=0]="None",$[$.Start=1]="Start",$[$.End=2]="End"})(Ee||(Ee={}));function we($,j){function me(Se){const{key:Te,children:De}=Se;j(Te,Se)!==!1&&we(De||[],j)}$.forEach(me)}function xe($){let{treeData:j,expandedKeys:me,startKey:Se,endKey:Te}=$;const De=[];let qe=Ee.None;if(Se&&Se===Te)return[Se];if(!Se||!Te)return[];function lt(We){return We===Se||We===Te}return we(j,We=>{if(qe===Ee.End)return!1;if(lt(We)){if(De.push(We),qe===Ee.None)qe=Ee.Start;else if(qe===Ee.Start)return qe=Ee.End,!1}else qe===Ee.Start&&De.push(We);return me.includes(We)}),De}function he($,j){const me=(0,q.Z)(j),Se=[];return we($,(Te,De)=>{const qe=me.indexOf(Te);return qe!==-1&&(Se.push(De),me.splice(qe,1)),!!me.length}),Se}var V=function($,j){var me={};for(var Se in $)Object.prototype.hasOwnProperty.call($,Se)&&j.indexOf(Se)<0&&(me[Se]=$[Se]);if($!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Te=0,Se=Object.getOwnPropertySymbols($);Te<Se.length;Te++)j.indexOf(Se[Te])<0&&Object.prototype.propertyIsEnumerable.call($,Se[Te])&&(me[Se[Te]]=$[Se[Te]]);return me};function T($){const{isLeaf:j,expanded:me}=$;return j?Z.createElement(ve.Z,null):me?Z.createElement(fe.Z,null):Z.createElement(f,null)}function C($){let{treeData:j,children:me}=$;return j||(0,I.zn)(me)}const R=($,j)=>{var{defaultExpandAll:me,defaultExpandParent:Se,defaultExpandedKeys:Te}=$,De=V($,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const qe=Z.useRef(),lt=Z.useRef(),We=()=>{const{keyEntities:F}=(0,I.I8)(C(De));let se;return me?se=Object.keys(F):Se?se=(0,m.r7)(De.expandedKeys||Te||[],F):se=De.expandedKeys||Te,se},[Tt,dt]=Z.useState(De.selectedKeys||De.defaultSelectedKeys||[]),[wt,Rt]=Z.useState(()=>We());Z.useEffect(()=>{"selectedKeys"in De&&dt(De.selectedKeys)},[De.selectedKeys]),Z.useEffect(()=>{"expandedKeys"in De&&Rt(De.expandedKeys)},[De.expandedKeys]);const _t=(F,se)=>{var de;return"expandedKeys"in De||Rt(F),(de=De.onExpand)===null||de===void 0?void 0:de.call(De,F,se)},Pe=(F,se)=>{var de;const{multiple:ge}=De,{node:be,nativeEvent:Le}=se,{key:Ne=""}=be,ze=C(De),Ie=Object.assign(Object.assign({},se),{selected:!0}),Ke=(Le==null?void 0:Le.ctrlKey)||(Le==null?void 0:Le.metaKey),je=Le==null?void 0:Le.shiftKey;let Ce;ge&&Ke?(Ce=F,qe.current=Ne,lt.current=Ce,Ie.selectedNodes=he(ze,Ce)):ge&&je?(Ce=Array.from(new Set([].concat((0,q.Z)(lt.current||[]),(0,q.Z)(xe({treeData:ze,expandedKeys:wt,startKey:Ne,endKey:qe.current}))))),Ie.selectedNodes=he(ze,Ce)):(Ce=[Ne],qe.current=Ne,lt.current=Ce,Ie.selectedNodes=he(ze,Ce)),(de=De.onSelect)===null||de===void 0||de.call(De,Ce,Ie),"selectedKeys"in De||dt(Ce)},{getPrefixCls:J,direction:ue}=Z.useContext(H.E_),{prefixCls:W,className:M,showIcon:pe=!0,expandAction:k="click"}=De,N=V(De,["prefixCls","className","showIcon","expandAction"]),P=J("tree",W),ne=g()(`${P}-directory`,{[`${P}-directory-rtl`]:ue==="rtl"},M);return Z.createElement(ie,Object.assign({icon:T,ref:j,blockNode:!0},N,{showIcon:pe,expandAction:k,prefixCls:P,className:ne,expandedKeys:wt,selectedKeys:Tt,onSelect:Pe,onExpand:_t}))};var Y=Z.forwardRef(R);const y=ie;y.DirectoryTree=Y,y.TreeNode=B.O;var v=y},20648:function(bt,ke,b){"use strict";b.d(ke,{TM:function(){return u},Yk:function(){return f}});var B=b(93083),q=b(98447),ve=b(17313),fe=b(8378),oe=b(37613),Z=b(83116);const _e=new B.Keyframes("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),le=(g,m)=>({[`.${g}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${m.motionDurationSlow}`}}}),o=(g,m)=>({[`.${g}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:m.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${m.lineWidthBold}px solid ${m.colorPrimary}`,borderRadius:"50%",content:'""'}}}),K=(g,m)=>{const{treeCls:I,treeNodeCls:H,treeNodePadding:L,titleHeight:w,nodeSelectedBg:O,nodeHoverBg:A}=m,E=m.paddingXS;return{[I]:Object.assign(Object.assign({},(0,ve.Wf)(m)),{background:m.colorBgContainer,borderRadius:m.borderRadius,transition:`background-color ${m.motionDurationSlow}`,[`&${I}-rtl`]:{[`${I}-switcher`]:{"&_close":{[`${I}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${I}-active-focused)`]:Object.assign({},(0,ve.oN)(m)),[`${I}-list-holder-inner`]:{alignItems:"flex-start"},[`&${I}-block-node`]:{[`${I}-list-holder-inner`]:{alignItems:"stretch",[`${I}-node-content-wrapper`]:{flex:"auto"},[`${H}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:L,insetInlineStart:0,border:`1px solid ${m.colorPrimary}`,opacity:0,animationName:_e,animationDuration:m.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${H}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${L}px 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${I}-node-content-wrapper`]:{color:m.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${I}-node-content-wrapper`]:Object.assign({},(0,ve.oN)(m)),[`&:not(${H}-disabled).filter-node ${I}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{[`${I}-draggable-icon`]:{flexShrink:0,width:w,lineHeight:`${w}px`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${m.motionDurationSlow}`,[`${H}:hover &`]:{opacity:.45}},[`&${H}-disabled`]:{[`${I}-draggable-icon`]:{visibility:"hidden"}}}},[`${I}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:w}},[`${I}-draggable-icon`]:{visibility:"hidden"},[`${I}-switcher`]:Object.assign(Object.assign({},le(g,m)),{position:"relative",flex:"none",alignSelf:"stretch",width:w,margin:0,lineHeight:`${w}px`,textAlign:"center",cursor:"pointer",userSelect:"none","&-noop":{cursor:"default"},"&_close":{[`${I}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:m.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:w/2,bottom:-L,marginInlineStart:-1,borderInlineEnd:`1px solid ${m.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:w/2*.8,height:w/2,borderBottom:`1px solid ${m.colorBorder}`,content:'""'}}}),[`${I}-checkbox`]:{top:"initial",marginInlineEnd:E},[`${I}-node-content-wrapper, ${I}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:w,margin:0,padding:`0 ${m.paddingXS/2}px`,color:"inherit",lineHeight:`${w}px`,background:"transparent",borderRadius:m.borderRadius,cursor:"pointer",transition:`all ${m.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:A},[`&${I}-node-selected`]:{backgroundColor:O},[`${I}-iconEle`]:{display:"inline-block",width:w,height:w,lineHeight:`${w}px`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${I}-unselectable ${I}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${I}-node-content-wrapper`]:Object.assign({lineHeight:`${w}px`,userSelect:"none"},o(g,m)),[`${H}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${m.colorPrimary}`}},"&-show-line":{[`${I}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:w/2,bottom:-L,borderInlineEnd:`1px solid ${m.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${I}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${H}-leaf-last`]:{[`${I}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${w/2}px !important`}}}}})}},D=g=>{const{treeCls:m,treeNodeCls:I,treeNodePadding:H,directoryNodeSelectedBg:L,directoryNodeSelectedColor:w}=g;return{[`${m}${m}-directory`]:{[I]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:H,insetInlineStart:0,transition:`background-color ${g.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:g.controlItemBgHover}},"> *":{zIndex:1},[`${m}-switcher`]:{transition:`color ${g.motionDurationMid}`},[`${m}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${m}-node-selected`]:{color:w,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:L},[`${m}-switcher`]:{color:w},[`${m}-node-content-wrapper`]:{color:w,background:"transparent"}}}}}},f=(g,m)=>{const I=`.${g}`,H=`${I}-treenode`,L=m.paddingXS/2,w=(0,oe.TS)(m,{treeCls:I,treeNodeCls:H,treeNodePadding:L});return[K(g,w),D(w)]},u=g=>{const{controlHeightSM:m}=g;return{titleHeight:m,nodeHoverBg:g.controlItemBgHover,nodeSelectedBg:g.controlItemBgActive}};ke.ZP=(0,Z.Z)("Tree",(g,m)=>{let{prefixCls:I}=m;return[{[g.componentCls]:(0,q.C2)(`${I}-checkbox`,g)},f(I,g),(0,fe.Z)(g)]},g=>{const{colorTextLightSolid:m,colorPrimary:I}=g;return Object.assign(Object.assign({},u(g)),{directoryNodeSelectedColor:m,directoryNodeSelectedBg:I})})},71997:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return H}});var B=b(92413),q=b(59301),ve={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"},fe=ve,oe=b(7657),Z=function(w,O){return q.createElement(oe.Z,(0,B.Z)({},w,{ref:O,icon:fe}))},_e=q.forwardRef(Z),le=_e,o=b(52671),K=b(58617),D=b(15075),f=b(43531),u=b(92310),g=b.n(u),m=b(92343),H=L=>{const{prefixCls:w,switcherIcon:O,treeNodeProps:A,showLine:E}=L,{isLeaf:Q,expanded:te,loading:ie}=A;if(ie)return q.createElement(K.Z,{className:`${w}-switcher-loading-icon`});let Ee;if(E&&typeof E=="object"&&(Ee=E.showLeafIcon),Q){if(!E)return null;if(typeof Ee!="boolean"&&Ee){const he=typeof Ee=="function"?Ee(A):Ee,V=`${w}-switcher-line-custom-icon`;return(0,m.l$)(he)?(0,m.Tm)(he,{className:g()(he.props.className||"",V)}):he}return Ee?q.createElement(o.Z,{className:`${w}-switcher-line-icon`}):q.createElement("span",{className:`${w}-switcher-leaf-line`})}const we=`${w}-switcher-icon`,xe=typeof O=="function"?O(A):O;return(0,m.l$)(xe)?(0,m.Tm)(xe,{className:g()(xe.props.className||"",we)}):xe!==void 0?xe:E?te?q.createElement(D.Z,{className:`${w}-switcher-line-icon`}):q.createElement(f.Z,{className:`${w}-switcher-line-icon`}):q.createElement(le,{className:we})}},25769:function(bt,ke,b){"use strict";var B=b(98040),q={"text/plain":"Text","text/html":"Url",default:"Text"},ve="Copy to clipboard: #{key}, Enter";function fe(Z){var _e=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return Z.replace(/#{\s*key\s*}/g,_e)}function oe(Z,_e){var le,o,K,D,f,u,g=!1;_e||(_e={}),le=_e.debug||!1;try{K=B(),D=document.createRange(),f=document.getSelection(),u=document.createElement("span"),u.textContent=Z,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",function(I){if(I.stopPropagation(),_e.format)if(I.preventDefault(),typeof I.clipboardData=="undefined"){le&&console.warn("unable to use e.clipboardData"),le&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var H=q[_e.format]||q.default;window.clipboardData.setData(H,Z)}else I.clipboardData.clearData(),I.clipboardData.setData(_e.format,Z);_e.onCopy&&(I.preventDefault(),_e.onCopy(I.clipboardData))}),document.body.appendChild(u),D.selectNodeContents(u),f.addRange(D);var m=document.execCommand("copy");if(!m)throw new Error("copy command was unsuccessful");g=!0}catch(I){le&&console.error("unable to copy using execCommand: ",I),le&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(_e.format||"text",Z),_e.onCopy&&_e.onCopy(window.clipboardData),g=!0}catch(H){le&&console.error("unable to copy using clipboardData: ",H),le&&console.error("falling back to prompt"),o=fe("message"in _e?_e.message:ve),window.prompt(o,Z)}}finally{f&&(typeof f.removeRange=="function"?f.removeRange(D):f.removeAllRanges()),u&&document.body.removeChild(u),K()}return g}bt.exports=oe},3867:function(bt,ke,b){var B=b(97671);(function(q,ve){bt.exports=ve()})(this,function(){"use strict";function q(N){var P=typeof N;return N!==null&&(P==="object"||P==="function")}function ve(N){return typeof N=="function"}var fe=void 0;Array.isArray?fe=Array.isArray:fe=function(N){return Object.prototype.toString.call(N)==="[object Array]"};var oe=fe,Z=0,_e=void 0,le=void 0,o=function(P,ne){E[Z]=P,E[Z+1]=ne,Z+=2,Z===2&&(le?le(Q):ie())};function K(N){le=N}function D(N){o=N}var f=typeof window!="undefined"?window:void 0,u=f||{},g=u.MutationObserver||u.WebKitMutationObserver,m=typeof self=="undefined"&&typeof B!="undefined"&&{}.toString.call(B)==="[object process]",I=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function H(){return function(){return B.nextTick(Q)}}function L(){return typeof _e!="undefined"?function(){_e(Q)}:A()}function w(){var N=0,P=new g(Q),ne=document.createTextNode("");return P.observe(ne,{characterData:!0}),function(){ne.data=N=++N%2}}function O(){var N=new MessageChannel;return N.port1.onmessage=Q,function(){return N.port2.postMessage(0)}}function A(){var N=setTimeout;return function(){return N(Q,1)}}var E=new Array(1e3);function Q(){for(var N=0;N<Z;N+=2){var P=E[N],ne=E[N+1];P(ne),E[N]=void 0,E[N+1]=void 0}Z=0}function te(){try{var N=Function("return this")().require("vertx");return _e=N.runOnLoop||N.runOnContext,L()}catch(P){return A()}}var ie=void 0;m?ie=H():g?ie=w():I?ie=O():f===void 0?ie=te():ie=A();function Ee(N,P){var ne=this,F=new this.constructor(he);F[xe]===void 0&&wt(F);var se=ne._state;if(se){var de=arguments[se-1];o(function(){return lt(se,F,de,ne._result)})}else De(ne,F,N,P);return F}function we(N){var P=this;if(N&&typeof N=="object"&&N.constructor===P)return N;var ne=new P(he);return j(ne,N),ne}var xe=Math.random().toString(36).substring(2);function he(){}var V=void 0,T=1,C=2;function R(){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(N,P,ne,F){try{N.call(P,ne,F)}catch(se){return se}}function y(N,P,ne){o(function(F){var se=!1,de=Y(ne,P,function(ge){se||(se=!0,P!==ge?j(F,ge):Se(F,ge))},function(ge){se||(se=!0,Te(F,ge))},"Settle: "+(F._label||" unknown promise"));!se&&de&&(se=!0,Te(F,de))},N)}function v(N,P){P._state===T?Se(N,P._result):P._state===C?Te(N,P._result):De(P,void 0,function(ne){return j(N,ne)},function(ne){return Te(N,ne)})}function $(N,P,ne){P.constructor===N.constructor&&ne===Ee&&P.constructor.resolve===we?v(N,P):ne===void 0?Se(N,P):ve(ne)?y(N,P,ne):Se(N,P)}function j(N,P){if(N===P)Te(N,R());else if(q(P)){var ne=void 0;try{ne=P.then}catch(F){Te(N,F);return}$(N,P,ne)}else Se(N,P)}function me(N){N._onerror&&N._onerror(N._result),qe(N)}function Se(N,P){N._state===V&&(N._result=P,N._state=T,N._subscribers.length!==0&&o(qe,N))}function Te(N,P){N._state===V&&(N._state=C,N._result=P,o(me,N))}function De(N,P,ne,F){var se=N._subscribers,de=se.length;N._onerror=null,se[de]=P,se[de+T]=ne,se[de+C]=F,de===0&&N._state&&o(qe,N)}function qe(N){var P=N._subscribers,ne=N._state;if(P.length!==0){for(var F=void 0,se=void 0,de=N._result,ge=0;ge<P.length;ge+=3)F=P[ge],se=P[ge+ne],F?lt(ne,F,se,de):se(de);N._subscribers.length=0}}function lt(N,P,ne,F){var se=ve(ne),de=void 0,ge=void 0,be=!0;if(se){try{de=ne(F)}catch(Le){be=!1,ge=Le}if(P===de){Te(P,z());return}}else de=F;P._state!==V||(se&&be?j(P,de):be===!1?Te(P,ge):N===T?Se(P,de):N===C&&Te(P,de))}function We(N,P){try{P(function(F){j(N,F)},function(F){Te(N,F)})}catch(ne){Te(N,ne)}}var Tt=0;function dt(){return Tt++}function wt(N){N[xe]=Tt++,N._state=void 0,N._result=void 0,N._subscribers=[]}function Rt(){return new Error("Array Methods must be provided an Array")}var _t=function(){function N(P,ne){this._instanceConstructor=P,this.promise=new P(he),this.promise[xe]||wt(this.promise),oe(ne)?(this.length=ne.length,this._remaining=ne.length,this._result=new Array(this.length),this.length===0?Se(this.promise,this._result):(this.length=this.length||0,this._enumerate(ne),this._remaining===0&&Se(this.promise,this._result))):Te(this.promise,Rt())}return N.prototype._enumerate=function(ne){for(var F=0;this._state===V&&F<ne.length;F++)this._eachEntry(ne[F],F)},N.prototype._eachEntry=function(ne,F){var se=this._instanceConstructor,de=se.resolve;if(de===we){var ge=void 0,be=void 0,Le=!1;try{ge=ne.then}catch(ze){Le=!0,be=ze}if(ge===Ee&&ne._state!==V)this._settledAt(ne._state,F,ne._result);else if(typeof ge!="function")this._remaining--,this._result[F]=ne;else if(se===pe){var Ne=new se(he);Le?Te(Ne,be):$(Ne,ne,ge),this._willSettleAt(Ne,F)}else this._willSettleAt(new se(function(ze){return ze(ne)}),F)}else this._willSettleAt(de(ne),F)},N.prototype._settledAt=function(ne,F,se){var de=this.promise;de._state===V&&(this._remaining--,ne===C?Te(de,se):this._result[F]=se),this._remaining===0&&Se(de,this._result)},N.prototype._willSettleAt=function(ne,F){var se=this;De(ne,void 0,function(de){return se._settledAt(T,F,de)},function(de){return se._settledAt(C,F,de)})},N}();function Pe(N){return new _t(this,N).promise}function J(N){var P=this;return oe(N)?new P(function(ne,F){for(var se=N.length,de=0;de<se;de++)P.resolve(N[de]).then(ne,F)}):new P(function(ne,F){return F(new TypeError("You must pass an array to race."))})}function ue(N){var P=this,ne=new P(he);return Te(ne,N),ne}function W(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function M(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var pe=function(){function N(P){this[xe]=dt(),this._result=this._state=void 0,this._subscribers=[],he!==P&&(typeof P!="function"&&W(),this instanceof N?We(this,P):M())}return N.prototype.catch=function(ne){return this.then(null,ne)},N.prototype.finally=function(ne){var F=this,se=F.constructor;return ve(ne)?F.then(function(de){return se.resolve(ne()).then(function(){return de})},function(de){return se.resolve(ne()).then(function(){throw de})}):F.then(ne,ne)},N}();pe.prototype.then=Ee,pe.all=Pe,pe.race=J,pe.resolve=we,pe.reject=ue,pe._setScheduler=K,pe._setAsap=D,pe._asap=o;function k(){var N=void 0;if(typeof b.g!="undefined")N=b.g;else if(typeof self!="undefined")N=self;else try{N=Function("return this")()}catch(F){throw new Error("polyfill failed because global object is unavailable in this environment")}var P=N.Promise;if(P){var ne=null;try{ne=Object.prototype.toString.call(P.resolve())}catch(F){}if(ne==="[object Promise]"&&!P.cast)return}N.Promise=pe}return pe.polyfill=k,pe.Promise=pe,pe})},86204:function(bt){"use strict";var ke=typeof Reflect=="object"?Reflect:null,b=ke&&typeof ke.apply=="function"?ke.apply:function(O,A,E){return Function.prototype.apply.call(O,A,E)},B;ke&&typeof ke.ownKeys=="function"?B=ke.ownKeys:Object.getOwnPropertySymbols?B=function(O){return Object.getOwnPropertyNames(O).concat(Object.getOwnPropertySymbols(O))}:B=function(O){return Object.getOwnPropertyNames(O)};function q(w){console&&console.warn&&console.warn(w)}var ve=Number.isNaN||function(O){return O!==O};function fe(){fe.init.call(this)}bt.exports=fe,bt.exports.once=I,fe.EventEmitter=fe,fe.prototype._events=void 0,fe.prototype._eventsCount=0,fe.prototype._maxListeners=void 0;var oe=10;function Z(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}Object.defineProperty(fe,"defaultMaxListeners",{enumerable:!0,get:function(){return oe},set:function(w){if(typeof w!="number"||w<0||ve(w))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+w+".");oe=w}}),fe.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},fe.prototype.setMaxListeners=function(O){if(typeof O!="number"||O<0||ve(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 _e(w){return w._maxListeners===void 0?fe.defaultMaxListeners:w._maxListeners}fe.prototype.getMaxListeners=function(){return _e(this)},fe.prototype.emit=function(O){for(var A=[],E=1;E<arguments.length;E++)A.push(arguments[E]);var Q=O==="error",te=this._events;if(te!==void 0)Q=Q&&te.error===void 0;else if(!Q)return!1;if(Q){var ie;if(A.length>0&&(ie=A[0]),ie instanceof Error)throw ie;var Ee=new Error("Unhandled error."+(ie?" ("+ie.message+")":""));throw Ee.context=ie,Ee}var we=te[O];if(we===void 0)return!1;if(typeof we=="function")b(we,this,A);else for(var xe=we.length,he=u(we,xe),E=0;E<xe;++E)b(he[E],this,A);return!0};function le(w,O,A,E){var Q,te,ie;if(Z(A),te=w._events,te===void 0?(te=w._events=Object.create(null),w._eventsCount=0):(te.newListener!==void 0&&(w.emit("newListener",O,A.listener?A.listener:A),te=w._events),ie=te[O]),ie===void 0)ie=te[O]=A,++w._eventsCount;else if(typeof ie=="function"?ie=te[O]=E?[A,ie]:[ie,A]:E?ie.unshift(A):ie.push(A),Q=_e(w),Q>0&&ie.length>Q&&!ie.warned){ie.warned=!0;var Ee=new Error("Possible EventEmitter memory leak detected. "+ie.length+" "+String(O)+" listeners added. Use emitter.setMaxListeners() to increase limit");Ee.name="MaxListenersExceededWarning",Ee.emitter=w,Ee.type=O,Ee.count=ie.length,q(Ee)}return w}fe.prototype.addListener=function(O,A){return le(this,O,A,!1)},fe.prototype.on=fe.prototype.addListener,fe.prototype.prependListener=function(O,A){return le(this,O,A,!0)};function o(){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(w,O,A){var E={fired:!1,wrapFn:void 0,target:w,type:O,listener:A},Q=o.bind(E);return Q.listener=A,E.wrapFn=Q,Q}fe.prototype.once=function(O,A){return Z(A),this.on(O,K(this,O,A)),this},fe.prototype.prependOnceListener=function(O,A){return Z(A),this.prependListener(O,K(this,O,A)),this},fe.prototype.removeListener=function(O,A){var E,Q,te,ie,Ee;if(Z(A),Q=this._events,Q===void 0)return this;if(E=Q[O],E===void 0)return this;if(E===A||E.listener===A)--this._eventsCount===0?this._events=Object.create(null):(delete Q[O],Q.removeListener&&this.emit("removeListener",O,E.listener||A));else if(typeof E!="function"){for(te=-1,ie=E.length-1;ie>=0;ie--)if(E[ie]===A||E[ie].listener===A){Ee=E[ie].listener,te=ie;break}if(te<0)return this;te===0?E.shift():g(E,te),E.length===1&&(Q[O]=E[0]),Q.removeListener!==void 0&&this.emit("removeListener",O,Ee||A)}return this},fe.prototype.off=fe.prototype.removeListener,fe.prototype.removeAllListeners=function(O){var A,E,Q;if(E=this._events,E===void 0)return this;if(E.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):E[O]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete E[O]),this;if(arguments.length===0){var te=Object.keys(E),ie;for(Q=0;Q<te.length;++Q)ie=te[Q],ie!=="removeListener"&&this.removeAllListeners(ie);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(A=E[O],typeof A=="function")this.removeListener(O,A);else if(A!==void 0)for(Q=A.length-1;Q>=0;Q--)this.removeListener(O,A[Q]);return this};function D(w,O,A){var E=w._events;if(E===void 0)return[];var Q=E[O];return Q===void 0?[]:typeof Q=="function"?A?[Q.listener||Q]:[Q]:A?m(Q):u(Q,Q.length)}fe.prototype.listeners=function(O){return D(this,O,!0)},fe.prototype.rawListeners=function(O){return D(this,O,!1)},fe.listenerCount=function(w,O){return typeof w.listenerCount=="function"?w.listenerCount(O):f.call(w,O)},fe.prototype.listenerCount=f;function f(w){var O=this._events;if(O!==void 0){var A=O[w];if(typeof A=="function")return 1;if(A!==void 0)return A.length}return 0}fe.prototype.eventNames=function(){return this._eventsCount>0?B(this._events):[]};function u(w,O){for(var A=new Array(O),E=0;E<O;++E)A[E]=w[E];return A}function g(w,O){for(;O+1<w.length;O++)w[O]=w[O+1];w.pop()}function m(w){for(var O=new Array(w.length),A=0;A<O.length;++A)O[A]=w[A].listener||w[A];return O}function I(w,O){return new Promise(function(A,E){function Q(ie){w.removeListener(O,te),E(ie)}function te(){typeof w.removeListener=="function"&&w.removeListener("error",Q),A([].slice.call(arguments))}L(w,O,te,{once:!0}),O!=="error"&&H(w,Q,{once:!0})})}function H(w,O,A){typeof w.on=="function"&&L(w,"error",O,A)}function L(w,O,A,E){if(typeof w.on=="function")E.once?w.once(O,A):w.on(O,A);else if(typeof w.addEventListener=="function")w.addEventListener(O,function Q(te){E.once&&w.removeEventListener(O,Q),A(te)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof w)}},24334:function(bt,ke,b){var B,q;(function(ve,fe){bt.exports=fe(ve)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof b.g!="undefined"?b.g:this,function(ve){"use strict";ve=ve||{};var fe=ve.Base64,oe="2.6.4",Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_e=function(T){for(var C={},R=0,z=T.length;R<z;R++)C[T.charAt(R)]=R;return C}(Z),le=String.fromCharCode,o=function(T){if(T.length<2){var C=T.charCodeAt(0);return C<128?T:C<2048?le(192|C>>>6)+le(128|C&63):le(224|C>>>12&15)+le(128|C>>>6&63)+le(128|C&63)}else{var C=65536+(T.charCodeAt(0)-55296)*1024+(T.charCodeAt(1)-56320);return le(240|C>>>18&7)+le(128|C>>>12&63)+le(128|C>>>6&63)+le(128|C&63)}},K=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,D=function(T){return T.replace(K,o)},f=function(T){var C=[0,2,1][T.length%3],R=T.charCodeAt(0)<<16|(T.length>1?T.charCodeAt(1):0)<<8|(T.length>2?T.charCodeAt(2):0),z=[Z.charAt(R>>>18),Z.charAt(R>>>12&63),C>=2?"=":Z.charAt(R>>>6&63),C>=1?"=":Z.charAt(R&63)];return z.join("")},u=ve.btoa&&typeof ve.btoa=="function"?function(T){return ve.btoa(T)}:function(T){if(T.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return T.replace(/[\s\S]{1,3}/g,f)},g=function(T){return u(D(String(T)))},m=function(T){return T.replace(/[+\/]/g,function(C){return C=="+"?"-":"_"}).replace(/=/g,"")},I=function(T,C){return C?m(g(T)):g(T)},H=function(T){return I(T,!0)},L;ve.Uint8Array&&(L=function(T,C){for(var R="",z=0,Y=T.length;z<Y;z+=3){var y=T[z],v=T[z+1],$=T[z+2],j=y<<16|v<<8|$;R+=Z.charAt(j>>>18)+Z.charAt(j>>>12&63)+(typeof v!="undefined"?Z.charAt(j>>>6&63):"=")+(typeof $!="undefined"?Z.charAt(j&63):"=")}return C?m(R):R});var w=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,O=function(T){switch(T.length){case 4:var C=(7&T.charCodeAt(0))<<18|(63&T.charCodeAt(1))<<12|(63&T.charCodeAt(2))<<6|63&T.charCodeAt(3),R=C-65536;return le((R>>>10)+55296)+le((R&1023)+56320);case 3:return le((15&T.charCodeAt(0))<<12|(63&T.charCodeAt(1))<<6|63&T.charCodeAt(2));default:return le((31&T.charCodeAt(0))<<6|63&T.charCodeAt(1))}},A=function(T){return T.replace(w,O)},E=function(T){var C=T.length,R=C%4,z=(C>0?_e[T.charAt(0)]<<18:0)|(C>1?_e[T.charAt(1)]<<12:0)|(C>2?_e[T.charAt(2)]<<6:0)|(C>3?_e[T.charAt(3)]:0),Y=[le(z>>>16),le(z>>>8&255),le(z&255)];return Y.length-=[0,0,2,1][R],Y.join("")},Q=ve.atob&&typeof ve.atob=="function"?function(T){return ve.atob(T)}:function(T){return T.replace(/\S{1,4}/g,E)},te=function(T){return Q(String(T).replace(/[^A-Za-z0-9\+\/]/g,""))},ie=function(T){return A(Q(T))},Ee=function(T){return String(T).replace(/[-_]/g,function(C){return C=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},we=function(T){return ie(Ee(T))},xe;ve.Uint8Array&&(xe=function(T){return Uint8Array.from(te(Ee(T)),function(C){return C.charCodeAt(0)})});var he=function(){var T=ve.Base64;return ve.Base64=fe,T};if(ve.Base64={VERSION:oe,atob:te,btoa:u,fromBase64:we,toBase64:I,utob:D,encode:I,encodeURI:H,btou:A,decode:we,noConflict:he,fromUint8Array:L,toUint8Array:xe},typeof Object.defineProperty=="function"){var V=function(T){return{value:T,enumerable:!1,writable:!0,configurable:!0}};ve.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",V(function(){return we(this)})),Object.defineProperty(String.prototype,"toBase64",V(function(T){return I(this,T)})),Object.defineProperty(String.prototype,"toBase64URI",V(function(){return I(this,!0)}))}}return ve.Meteor&&(Base64=ve.Base64),bt.exports?bt.exports.Base64=ve.Base64:(B=[],q=function(){return ve.Base64}.apply(ke,B),q!==void 0&&(bt.exports=q)),{Base64:ve.Base64}})},53184:function(bt,ke,b){"use strict";var B,q;function ve(fe,oe,Z){var _e=function(le,o){return fe.js_beautify(le,o)};return _e.js=fe.js_beautify,_e.css=oe.css_beautify,_e.html=Z.html_beautify,_e.js_beautify=fe.js_beautify,_e.css_beautify=oe.css_beautify,_e.html_beautify=Z.html_beautify,_e}B=[b(58553),b(87804),b(40998)],q=function(fe,oe,Z){return ve(fe,oe,Z)}.apply(ke,B),q!==void 0&&(bt.exports=q)},87804:function(bt,ke){var b,B;(function(){var q;(function(){"use strict";var fe=[,,function(le){function o(f){this.__parent=f,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}o.prototype.clone_empty=function(){var f=new o(this.__parent);return f.set_indent(this.__indent_count,this.__alignment_count),f},o.prototype.item=function(f){return f<0?this.__items[this.__items.length+f]:this.__items[f]},o.prototype.has_match=function(f){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(f))return!0;return!1},o.prototype.set_indent=function(f,u){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},o.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},o.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},o.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},o.prototype.is_empty=function(){return this.__items.length===0},o.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},o.prototype.push=function(f){this.__items.push(f);var u=f.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=f.length-u:this.__character_count+=f.length},o.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},o.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},o.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},o.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},o.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function K(f,u){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),u=u||"",f.indent_level>0&&(u=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}K.prototype.get_indent_size=function(f,u){var g=this.__base_string_length;return u=u||0,f<0&&(g=0),g+=f*this.__indent_size,g+=u,g},K.prototype.get_indent_string=function(f,u){var g=this.__base_string;return u=u||0,f<0&&(f=0,g=""),u+=f*this.__indent_size,this.__ensure_cache(u),g+=this.__cache[u],g},K.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},K.prototype.__add_column=function(){var f=this.__cache.length,u=0,g="";this.__indent_size&&f>=this.__indent_size&&(u=Math.floor(f/this.__indent_size),f-=u*this.__indent_size,g=new Array(u+1).join(this.__indent_string)),f&&(g+=new Array(f+1).join(" ")),this.__cache.push(g)};function D(f,u){this.__indent_cache=new K(f,u),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new o(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}D.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},D.prototype.get_line_number=function(){return this.__lines.length},D.prototype.get_indent_string=function(f,u){return this.__indent_cache.get_indent_string(f,u)},D.prototype.get_indent_size=function(f,u){return this.__indent_cache.get_indent_size(f,u)},D.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},D.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},D.prototype.get_code=function(f){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var g=this.__lines.join(`
|
|
`);return f!==`
|
|
`&&(g=g.replace(/[\n]/g,f)),g},D.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},D.prototype.set_indent=function(f,u){return f=f||0,u=u||0,this.next_line.set_indent(f,u),this.__lines.length>1?(this.current_line.set_indent(f,u),!0):(this.current_line.set_indent(),!1)},D.prototype.add_raw_token=function(f){for(var u=0;u<f.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(f.whitespace_before),this.current_line.push(f.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},D.prototype.add_token=function(f){this.__add_space_before_token(),this.current_line.push(f),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},D.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},D.prototype.remove_indent=function(f){for(var u=this.__lines.length;f<u;)this.__lines[f]._remove_indent(),f++;this.current_line._remove_wrap_indent()},D.prototype.trim=function(f){for(f=f===void 0?!1:f,this.current_line.trim();f&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},D.prototype.just_added_newline=function(){return this.current_line.is_empty()},D.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},D.prototype.ensure_empty_line_above=function(f,u){for(var g=this.__lines.length-2;g>=0;){var m=this.__lines[g];if(m.is_empty())break;if(m.item(0).indexOf(f)!==0&&m.item(-1)!==u){this.__lines.splice(g+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}g--}},le.exports.Output=D},,,,function(le){function o(f,u){this.raw_options=K(f,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}o.prototype._get_array=function(f,u){var g=this.raw_options[f],m=u||[];return typeof g=="object"?g!==null&&typeof g.concat=="function"&&(m=g.concat()):typeof g=="string"&&(m=g.split(/[^a-zA-Z0-9_\/\-]+/)),m},o.prototype._get_boolean=function(f,u){var g=this.raw_options[f],m=g===void 0?!!u:!!g;return m},o.prototype._get_characters=function(f,u){var g=this.raw_options[f],m=u||"";return typeof g=="string"&&(m=g.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),m},o.prototype._get_number=function(f,u){var g=this.raw_options[f];u=parseInt(u,10),isNaN(u)&&(u=0);var m=parseInt(g,10);return isNaN(m)&&(m=u),m},o.prototype._get_selection=function(f,u,g){var m=this._get_selection_list(f,u,g);if(m.length!==1)throw new Error("Invalid Option Value: The option '"+f+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[f]+"'");return m[0]},o.prototype._get_selection_list=function(f,u,g){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(g=g||[u[0]],!this._is_valid_selection(g,u))throw new Error("Invalid Default Value!");var m=this._get_array(f,g);if(!this._is_valid_selection(m,u))throw new Error("Invalid Option Value: The option '"+f+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[f]+"'");return m},o.prototype._is_valid_selection=function(f,u){return f.length&&u.length&&!f.some(function(g){return u.indexOf(g)===-1})};function K(f,u){var g={};f=D(f);var m;for(m in f)m!==u&&(g[m]=f[m]);if(u&&f[u])for(m in f[u])g[m]=f[u][m];return g}function D(f){var u={},g;for(g in f){var m=g.replace(/-/g,"_");u[m]=f[g]}return u}le.exports.Options=o,le.exports.normalizeOpts=D,le.exports.mergeOpts=K},,function(le){var o=RegExp.prototype.hasOwnProperty("sticky");function K(D){this.__input=D||"",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 D=null;return this.hasNext()&&(D=this.__input.charAt(this.__position),this.__position+=1),D},K.prototype.peek=function(D){var f=null;return D=D||0,D+=this.__position,D>=0&&D<this.__input_length&&(f=this.__input.charAt(D)),f},K.prototype.__match=function(D,f){D.lastIndex=f;var u=D.exec(this.__input);return u&&!(o&&D.sticky)&&u.index!==f&&(u=null),u},K.prototype.test=function(D,f){return f=f||0,f+=this.__position,f>=0&&f<this.__input_length?!!this.__match(D,f):!1},K.prototype.testChar=function(D,f){var u=this.peek(f);return D.lastIndex=0,u!==null&&D.test(u)},K.prototype.match=function(D){var f=this.__match(D,this.__position);return f?this.__position+=f[0].length:f=null,f},K.prototype.read=function(D,f,u){var g="",m;return D&&(m=this.match(D),m&&(g+=m[0])),f&&(m||!D)&&(g+=this.readUntil(f,u)),g},K.prototype.readUntil=function(D,f){var u="",g=this.__position;D.lastIndex=this.__position;var m=D.exec(this.__input);return m?(g=m.index,f&&(g+=m[0].length)):g=this.__input_length,u=this.__input.substring(this.__position,g),this.__position=g,u},K.prototype.readUntilAfter=function(D){return this.readUntil(D,!0)},K.prototype.get_regexp=function(D,f){var u=null,g="g";return f&&o&&(g="y"),typeof D=="string"&&D!==""?u=new RegExp(D,g):D&&(u=new RegExp(D.source,g)),u},K.prototype.get_literal_regexp=function(D){return RegExp(D.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},K.prototype.peekUntilAfter=function(D){var f=this.__position,u=this.readUntilAfter(D);return this.__position=f,u},K.prototype.lookBack=function(D){var f=this.__position-1;return f>=D.length&&this.__input.substring(f-D.length,f).toLowerCase()===D},le.exports.InputScanner=K},,,,,function(le){function o(K,D){K=typeof K=="string"?K:K.source,D=typeof D=="string"?D:D.source,this.__directives_block_pattern=new RegExp(K+/ beautify( \w+[:]\w+)+ /.source+D,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(K+/\sbeautify\signore:end\s/.source+D,"g")}o.prototype.get_directives=function(K){if(!K.match(this.__directives_block_pattern))return null;var D={};this.__directive_pattern.lastIndex=0;for(var f=this.__directive_pattern.exec(K);f;)D[f[1]]=f[2],f=this.__directive_pattern.exec(K);return D},o.prototype.readIgnored=function(K){return K.readUntilAfter(this.__directives_end_ignore_pattern)},le.exports.Directives=o},,function(le,o,K){var D=K(16).Beautifier,f=K(17).Options;function u(g,m){var I=new D(g,m);return I.beautify()}le.exports=u,le.exports.defaultOptions=function(){return new f}},function(le,o,K){var D=K(17).Options,f=K(2).Output,u=K(8).InputScanner,g=K(13).Directives,m=new g(/\/\*/,/\*\//),I=/\r\n|[\r\n]/,H=/\r\n|[\r\n]/g,L=/\s/,w=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,A=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function E(Q,te){this._source_text=Q||"",this._options=new D(te),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"]}E.prototype.eatString=function(Q){var te="";for(this._ch=this._input.next();this._ch;){if(te+=this._ch,this._ch==="\\")te+=this._input.next();else if(Q.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return te},E.prototype.eatWhitespace=function(Q){for(var te=L.test(this._input.peek()),ie=0;L.test(this._input.peek());)this._ch=this._input.next(),Q&&this._ch===`
|
|
`&&(ie===0||ie<this._options.max_preserve_newlines)&&(ie++,this._output.add_new_line(!0));return te},E.prototype.foundNestedPseudoClass=function(){for(var Q=0,te=1,ie=this._input.peek(te);ie;){if(ie==="{")return!0;if(ie==="(")Q+=1;else if(ie===")"){if(Q===0)return!1;Q-=1}else if(ie===";"||ie==="}")return!1;te++,ie=this._input.peek(te)}return!1},E.prototype.print_string=function(Q){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(Q)},E.prototype.preserveSingleSpace=function(Q){Q&&(this._output.space_before_token=!0)},E.prototype.indent=function(){this._indentLevel++},E.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},E.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var Q=this._source_text,te=this._options.eol;te==="auto"&&(te=`
|
|
`,Q&&I.test(Q||"")&&(te=Q.match(I)[0])),Q=Q.replace(H,`
|
|
`);var ie=Q.match(/^[\t ]*/)[0];this._output=new f(this._options,ie),this._input=new u(Q),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var Ee=0,we=!1,xe=!1,he=!1,V=!1,T=!1,C=this._ch,R=!1,z,Y,y;z=this._input.read(w),Y=z!=="",y=C,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),C=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var v=this._input.read(O),$=m.get_directives(v);$&&$.ignore==="start"&&(v+=m.readIgnored(this._input)),this.print_string(v),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(A)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(Y),this.print_string(this._ch);var j=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);j.match(/[ :]$/)&&(j=this.eatString(": ").replace(/\s+$/,""),this.print_string(j),this._output.space_before_token=!0),Ee===0&&j.indexOf(":")!==-1&&(xe=!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 me=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);me.match(/[ :]$/)&&(me=this.eatString(": ").replace(/\s+$/,""),this.print_string(me),this._output.space_before_token=!0),Ee===0&&me.indexOf(":")!==-1?(xe=!0,this.indent()):me in this.NESTED_AT_RULE?(this._nestedLevel+=1,me in this.CONDITIONAL_GROUP_RULE&&(he=!0)):Ee===0&&!xe&&(V=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(Y),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")xe&&(xe=!1,this.outdent()),V=!1,he?(he=!1,we=this._indentLevel>=this._nestedLevel):we=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&we&&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)):(y==="("?this._output.space_before_token=!1:y!==","&&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(),y==="{"&&this._output.trim(!0),xe&&(this.outdent(),xe=!1),this.print_string(this._ch),we=!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 Se=0;Se<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Se++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Se])){R=!0;break}(we||he)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!V&&Ee===0?(this.print_string(":"),xe||(xe=!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 Te=y==='"'||y==="'";this.preserveSingleSpace(Te||Y),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")R=!1,Ee===0?(xe&&(this.outdent(),xe=!1),V=!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(),Ee++,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(")")),Ee&&(Ee--,this.outdent()));else{var De=!1;this._input.lookBack("with")&&(De=!0),this.preserveSingleSpace(Y||De),this.print_string(this._ch),xe&&y==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),T=!0):(this.eatWhitespace(),Ee++,this.indent())}else if(this._ch===")")Ee&&(Ee--,this.outdent()),T&&this._input.peek()===";"&&this._options.selector_separator_newline&&(T=!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&&(!xe||T)&&Ee===0&&!V?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!xe&&Ee===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&L.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(Y),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),L.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var qe=y==='"'||y==="'";this.preserveSingleSpace(qe||Y),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&R&&this._output.add_new_line()}var lt=this._output.get_code(te);return lt},le.exports.Beautifier=E},function(le,o,K){var D=K(6).Options;function f(u){D.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var g=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||g;var m=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var I=0;I<m.length;I++)m[I]!=="expand"?this.brace_style="collapse":this.brace_style=m[I]}f.prototype=new D,le.exports.Options=f}],oe={};function Z(le){var o=oe[le];if(o!==void 0)return o.exports;var K=oe[le]={exports:{}};return fe[le](K,K.exports,Z),K.exports}var _e=Z(15);q=_e})();var ve=q;b=[],B=function(){return{css_beautify:ve}}.apply(ke,b),B!==void 0&&(bt.exports=B)})()},40998:function(bt,ke,b){var B,q;(function(){var ve;(function(){"use strict";var _e=[,,function(D){function f(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=[]}f.prototype.clone_empty=function(){var m=new f(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},f.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},f.prototype.has_match=function(m){for(var I=this.__items.length-1;I>=0;I--)if(this.__items[I].match(m))return!0;return!1},f.prototype.set_indent=function(m,I){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=I||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},f.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)},f.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},f.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},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(m){this.__items.push(m);var I=m.lastIndexOf(`
|
|
`);I!==-1?this.__character_count=m.length-I:this.__character_count+=m.length},f.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.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 u(m,I){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)),I=I||"",m.indent_level>0&&(I=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=I,this.__base_string_length=I.length}u.prototype.get_indent_size=function(m,I){var H=this.__base_string_length;return I=I||0,m<0&&(H=0),H+=m*this.__indent_size,H+=I,H},u.prototype.get_indent_string=function(m,I){var H=this.__base_string;return I=I||0,m<0&&(m=0,H=""),I+=m*this.__indent_size,this.__ensure_cache(I),H+=this.__cache[I],H},u.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},u.prototype.__add_column=function(){var m=this.__cache.length,I=0,H="";this.__indent_size&&m>=this.__indent_size&&(I=Math.floor(m/this.__indent_size),m-=I*this.__indent_size,H=new Array(I+1).join(this.__indent_string)),m&&(H+=new Array(m+1).join(" ")),this.__cache.push(H)};function g(m,I){this.__indent_cache=new u(m,I),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 f(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(m,I){return this.__indent_cache.get_indent_string(m,I)},g.prototype.get_indent_size=function(m,I){return this.__indent_cache.get_indent_size(m,I)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(m){this.trim(!0);var I=this.current_line.pop();I&&(I[I.length-1]===`
|
|
`&&(I=I.replace(/\n+$/g,"")),this.current_line.push(I)),this._end_with_newline&&this.__add_outputline();var H=this.__lines.join(`
|
|
`);return m!==`
|
|
`&&(H=H.replace(/[\n]/g,m)),H},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(m,I){return m=m||0,I=I||0,this.next_line.set_indent(m,I),this.__lines.length>1?(this.current_line.set_indent(m,I),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(m){for(var I=0;I<m.newlines;I++)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},g.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()},g.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(" "))},g.prototype.remove_indent=function(m){for(var I=this.__lines.length;m<I;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},g.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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(m,I){for(var H=this.__lines.length-2;H>=0;){var L=this.__lines[H];if(L.is_empty())break;if(L.item(0).indexOf(m)!==0&&L.item(-1)!==I){this.__lines.splice(H+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}H--}},D.exports.Output=g},function(D){function f(u,g,m,I){this.type=u,this.text=g,this.comments_before=null,this.newlines=m||0,this.whitespace_before=I||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}D.exports.Token=f},,,function(D){function f(m,I){this.raw_options=u(m,I),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"])}f.prototype._get_array=function(m,I){var H=this.raw_options[m],L=I||[];return typeof H=="object"?H!==null&&typeof H.concat=="function"&&(L=H.concat()):typeof H=="string"&&(L=H.split(/[^a-zA-Z0-9_\/\-]+/)),L},f.prototype._get_boolean=function(m,I){var H=this.raw_options[m],L=H===void 0?!!I:!!H;return L},f.prototype._get_characters=function(m,I){var H=this.raw_options[m],L=I||"";return typeof H=="string"&&(L=H.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),L},f.prototype._get_number=function(m,I){var H=this.raw_options[m];I=parseInt(I,10),isNaN(I)&&(I=0);var L=parseInt(H,10);return isNaN(L)&&(L=I),L},f.prototype._get_selection=function(m,I,H){var L=this._get_selection_list(m,I,H);if(L.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
|
|
`+I+`
|
|
You passed in: '`+this.raw_options[m]+"'");return L[0]},f.prototype._get_selection_list=function(m,I,H){if(!I||I.length===0)throw new Error("Selection list cannot be empty.");if(H=H||[I[0]],!this._is_valid_selection(H,I))throw new Error("Invalid Default Value!");var L=this._get_array(m,H);if(!this._is_valid_selection(L,I))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
|
|
`+I+`
|
|
You passed in: '`+this.raw_options[m]+"'");return L},f.prototype._is_valid_selection=function(m,I){return m.length&&I.length&&!m.some(function(H){return I.indexOf(H)===-1})};function u(m,I){var H={};m=g(m);var L;for(L in m)L!==I&&(H[L]=m[L]);if(I&&m[I])for(L in m[I])H[L]=m[I][L];return H}function g(m){var I={},H;for(H in m){var L=H.replace(/-/g,"_");I[L]=m[H]}return I}D.exports.Options=f,D.exports.normalizeOpts=g,D.exports.mergeOpts=u},,function(D){var f=RegExp.prototype.hasOwnProperty("sticky");function u(g){this.__input=g||"",this.__input_length=this.__input.length,this.__position=0}u.prototype.restart=function(){this.__position=0},u.prototype.back=function(){this.__position>0&&(this.__position-=1)},u.prototype.hasNext=function(){return this.__position<this.__input_length},u.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},u.prototype.peek=function(g){var m=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(m=this.__input.charAt(g)),m},u.prototype.__match=function(g,m){g.lastIndex=m;var I=g.exec(this.__input);return I&&!(f&&g.sticky)&&I.index!==m&&(I=null),I},u.prototype.test=function(g,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(g,m):!1},u.prototype.testChar=function(g,m){var I=this.peek(m);return g.lastIndex=0,I!==null&&g.test(I)},u.prototype.match=function(g){var m=this.__match(g,this.__position);return m?this.__position+=m[0].length:m=null,m},u.prototype.read=function(g,m,I){var H="",L;return g&&(L=this.match(g),L&&(H+=L[0])),m&&(L||!g)&&(H+=this.readUntil(m,I)),H},u.prototype.readUntil=function(g,m){var I="",H=this.__position;g.lastIndex=this.__position;var L=g.exec(this.__input);return L?(H=L.index,m&&(H+=L[0].length)):H=this.__input_length,I=this.__input.substring(this.__position,H),this.__position=H,I},u.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},u.prototype.get_regexp=function(g,m){var I=null,H="g";return m&&f&&(H="y"),typeof g=="string"&&g!==""?I=new RegExp(g,H):g&&(I=new RegExp(g.source,H)),I},u.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},u.prototype.peekUntilAfter=function(g){var m=this.__position,I=this.readUntilAfter(g);return this.__position=m,I},u.prototype.lookBack=function(g){var m=this.__position-1;return m>=g.length&&this.__input.substring(m-g.length,m).toLowerCase()===g},D.exports.InputScanner=u},function(D,f,u){var g=u(8).InputScanner,m=u(3).Token,I=u(10).TokenStream,H=u(11).WhitespacePattern,L={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},w=function(O,A){this._input=new g(O),this._options=A||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new H(this._input)};w.prototype.tokenize=function(){this._input.restart(),this.__tokens=new I,this._reset();for(var O,A=new m(L.START,""),E=null,Q=[],te=new I;A.type!==L.EOF;){for(O=this._get_next_token(A,E);this._is_comment(O);)te.add(O),O=this._get_next_token(A,E);te.isEmpty()||(O.comments_before=te,te=new I),O.parent=E,this._is_opening(O)?(Q.push(E),E=O):E&&this._is_closing(O,E)&&(O.opened=E,E.closed=O,E=Q.pop(),O.parent=E),O.previous=A,A.next=O,this.__tokens.add(O),A=O}return this.__tokens},w.prototype._is_first_token=function(){return this.__tokens.isEmpty()},w.prototype._reset=function(){},w.prototype._get_next_token=function(O,A){this._readWhitespace();var E=this._input.read(/.+/g);return E?this._create_token(L.RAW,E):this._create_token(L.EOF,"")},w.prototype._is_comment=function(O){return!1},w.prototype._is_opening=function(O){return!1},w.prototype._is_closing=function(O,A){return!1},w.prototype._create_token=function(O,A){var E=new m(O,A,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return E},w.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},D.exports.Tokenizer=w,D.exports.TOKEN=L},function(D){function f(u){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=u}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position<this.__tokens_length},f.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__tokens[this.__position],this.__position+=1),u},f.prototype.peek=function(u){var g=null;return u=u||0,u+=this.__position,u>=0&&u<this.__tokens_length&&(g=this.__tokens[u]),g},f.prototype.add=function(u){this.__parent_token&&(u.parent=this.__parent_token),this.__tokens.push(u),this.__tokens_length+=1},D.exports.TokenStream=f},function(D,f,u){var g=u(12).Pattern;function m(I,H){g.call(this,I,H),H?this._line_regexp=this._input.get_regexp(H._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new g,m.prototype.__set_whitespace_patterns=function(I,H){I+="\\t ",H+="\\n\\r",this._match_pattern=this._input.get_regexp("["+I+H+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+H+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var I=this._input.read(this._match_pattern);if(I===" ")this.whitespace_before_token=" ";else if(I){var H=this.__split(this._newline_regexp,I);this.newline_count=H.length-1,this.whitespace_before_token=H[this.newline_count]}return I},m.prototype.matching=function(I,H){var L=this._create();return L.__set_whitespace_patterns(I,H),L._update(),L},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(I,H){I.lastIndex=0;for(var L=0,w=[],O=I.exec(H);O;)w.push(H.substring(L,O.index)),L=O.index+O[0].length,O=I.exec(H);return L<H.length?w.push(H.substring(L,H.length)):w.push(""),w},D.exports.WhitespacePattern=m},function(D){function f(u,g){this._input=u,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,g&&(this._starting_pattern=this._input.get_regexp(g._starting_pattern,!0),this._match_pattern=this._input.get_regexp(g._match_pattern,!0),this._until_pattern=this._input.get_regexp(g._until_pattern),this._until_after=g._until_after)}f.prototype.read=function(){var u=this._input.read(this._starting_pattern);return(!this._starting_pattern||u)&&(u+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),u},f.prototype.read_match=function(){return this._input.match(this._match_pattern)},f.prototype.until_after=function(u){var g=this._create();return g._until_after=!0,g._until_pattern=this._input.get_regexp(u),g._update(),g},f.prototype.until=function(u){var g=this._create();return g._until_after=!1,g._until_pattern=this._input.get_regexp(u),g._update(),g},f.prototype.starting_with=function(u){var g=this._create();return g._starting_pattern=this._input.get_regexp(u,!0),g._update(),g},f.prototype.matching=function(u){var g=this._create();return g._match_pattern=this._input.get_regexp(u,!0),g._update(),g},f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){},D.exports.Pattern=f},function(D){function f(u,g){u=typeof u=="string"?u:u.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(u+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(u+/\sbeautify\signore:end\s/.source+g,"g")}f.prototype.get_directives=function(u){if(!u.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(u);m;)g[m[1]]=m[2],m=this.__directive_pattern.exec(u);return g},f.prototype.readIgnored=function(u){return u.readUntilAfter(this.__directives_end_ignore_pattern)},D.exports.Directives=f},function(D,f,u){var g=u(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function I(H,L){g.call(this,H,L),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),L&&(this.__template_pattern=this._input.get_regexp(L.__template_pattern),this._excluded=Object.assign(this._excluded,L._excluded),this._disabled=Object.assign(this._disabled,L._disabled));var w=new g(H);this.__patterns={handlebars_comment:w.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:w.starting_with(/{{{/).until_after(/}}}/),handlebars:w.starting_with(/{{/).until_after(/}}/),php:w.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:w.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:w.starting_with(/{%/).until_after(/%}/),django_value:w.starting_with(/{{/).until_after(/}}/),django_comment:w.starting_with(/{#/).until_after(/#}/),smarty:w.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:w.starting_with(/{\*/).until_after(/\*}/),smarty_literal:w.starting_with(/{literal}/).until_after(/{\/literal}/)}}I.prototype=new g,I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){this.__set_templated_pattern()},I.prototype.disable=function(H){var L=this._create();return L._disabled[H]=!0,L._update(),L},I.prototype.read_options=function(H){var L=this._create();for(var w in m)L._disabled[w]=H.templating.indexOf(w)===-1;return L._update(),L},I.prototype.exclude=function(H){var L=this._create();return L._excluded[H]=!0,L._update(),L},I.prototype.read=function(){var H="";this._match_pattern?H=this._input.read(this._starting_pattern):H=this._input.read(this._starting_pattern,this.__template_pattern);for(var L=this._read_template();L;)this._match_pattern?L+=this._input.read(this._match_pattern):L+=this._input.readUntil(this.__template_pattern),H+=L,L=this._read_template();return this._until_after&&(H+=this._input.readUntilAfter(this._until_pattern)),H},I.prototype.__set_templated_pattern=function(){var H=[];this._disabled.php||H.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||H.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||H.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||H.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(H.push(this.__patterns.django._starting_pattern.source),H.push(this.__patterns.django_value._starting_pattern.source),H.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||H.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&H.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+H.join("|")+")")},I.prototype._read_template=function(){var H="",L=this._input.peek();if(L==="<"){var w=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&w==="?"&&(H=H||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&w==="%"&&(H=H||this.__patterns.erb.read())}else L==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(H=H||this.__patterns.handlebars_comment.read(),H=H||this.__patterns.handlebars_unescaped.read(),H=H||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(H=H||this.__patterns.django_value.read()),this._excluded.django||(H=H||this.__patterns.django_comment.read(),H=H||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(H=H||this.__patterns.smarty_comment.read(),H=H||this.__patterns.smarty_literal.read(),H=H||this.__patterns.smarty.read()));return H},D.exports.TemplatablePattern=I},,,,function(D,f,u){var g=u(19).Beautifier,m=u(20).Options;function I(H,L,w,O){var A=new g(H,L,w,O);return A.beautify()}D.exports=I,D.exports.defaultOptions=function(){return new m}},function(D,f,u){var g=u(20).Options,m=u(2).Output,I=u(21).Tokenizer,H=u(21).TOKEN,L=/\r\n|[\r\n]/,w=/\r\n|[\r\n]/g,O=function(V,T){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=V.max_preserve_newlines,this.preserve_newlines=V.preserve_newlines,this._output=new m(V,T)};O.prototype.current_line_has_match=function(V){return this._output.current_line.has_match(V)},O.prototype.set_space_before_token=function(V,T){this._output.space_before_token=V,this._output.non_breaking_space=T},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(V){this._output.add_raw_token(V)},O.prototype.print_preserved_newlines=function(V){var T=0;V.type!==H.TEXT&&V.previous.type!==H.TEXT&&(T=V.newlines?1:0),this.preserve_newlines&&(T=V.newlines<this.max_preserve_newlines+1?V.newlines:this.max_preserve_newlines+1);for(var C=0;C<T;C++)this.print_newline(C>0);return T!==0},O.prototype.traverse_whitespace=function(V){return V.whitespace_before||V.newlines?(this.print_preserved_newlines(V)||(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(V){this._output.add_new_line(V)},O.prototype.print_token=function(V){V.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(V.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(V){return V=this.indent_level+(V||0),V<1?"":this._output.get_indent_string(V)};var A=function(V){for(var T=null,C=V.next;C.type!==H.EOF&&V.closed!==C;){if(C.type===H.ATTRIBUTE&&C.text==="type"){C.next&&C.next.type===H.EQUALS&&C.next.next&&C.next.next.type===H.VALUE&&(T=C.next.next.text);break}C=C.next}return T},E=function(V,T){var C=null,R=null;return T.closed?(V==="script"?C="text/javascript":V==="style"&&(C="text/css"),C=A(T)||C,C.search("text/css")>-1?R="css":C.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?R="javascript":C.search(/(text|application|dojo)\/(x-)?(html)/)>-1?R="html":C.search(/test\/null/)>-1&&(R="null"),R):null};function Q(V,T){return T.indexOf(V)!==-1}function te(V,T,C){this.parent=V||null,this.tag=T?T.tag_name:"",this.indent_level=C||0,this.parser_token=T||null}function ie(V){this._printer=V,this._current_frame=null}ie.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},ie.prototype.record_tag=function(V){var T=new te(this._current_frame,V,this._printer.indent_level);this._current_frame=T},ie.prototype._try_pop_frame=function(V){var T=null;return V&&(T=V.parser_token,this._printer.indent_level=V.indent_level,this._current_frame=V.parent),T},ie.prototype._get_frame=function(V,T){for(var C=this._current_frame;C&&V.indexOf(C.tag)===-1;){if(T&&T.indexOf(C.tag)!==-1){C=null;break}C=C.parent}return C},ie.prototype.try_pop=function(V,T){var C=this._get_frame([V],T);return this._try_pop_frame(C)},ie.prototype.indent_to_tag=function(V){var T=this._get_frame(V);T&&(this._printer.indent_level=T.indent_level)};function Ee(V,T,C,R){this._source_text=V||"",T=T||{},this._js_beautify=C,this._css_beautify=R,this._tag_stack=null;var z=new g(T,"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"}Ee.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var V=this._source_text,T=this._options.eol;this._options.eol==="auto"&&(T=`
|
|
`,V&&L.test(V)&&(T=V.match(L)[0])),V=V.replace(w,`
|
|
`);var C=V.match(/^[\t ]*/)[0],R={text:"",type:""},z=new we(this._options),Y=new O(this._options,C),y=new I(V,this._options).tokenize();this._tag_stack=new ie(Y);for(var v=null,$=y.next();$.type!==H.EOF;)$.type===H.TAG_OPEN||$.type===H.COMMENT?(v=this._handle_tag_open(Y,$,z,R,y),z=v):$.type===H.ATTRIBUTE||$.type===H.EQUALS||$.type===H.VALUE||$.type===H.TEXT&&!z.tag_complete?v=this._handle_inside_tag(Y,$,z,R):$.type===H.TAG_CLOSE?v=this._handle_tag_close(Y,$,z):$.type===H.TEXT?v=this._handle_text(Y,$,z):$.type===H.CONTROL_FLOW_OPEN?v=this._handle_control_flow_open(Y,$):$.type===H.CONTROL_FLOW_CLOSE?v=this._handle_control_flow_close(Y,$):Y.add_raw_token($),R=v,$=y.next();var j=Y._output.get_code(T);return j},Ee.prototype._handle_control_flow_open=function(V,T){var C={text:T.text,type:T.type};return V.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),T.newlines?V.print_preserved_newlines(T):V.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),V.print_token(T),V.indent(),C},Ee.prototype._handle_control_flow_close=function(V,T){var C={text:T.text,type:T.type};return V.deindent(),T.newlines?V.print_preserved_newlines(T):V.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),V.print_token(T),C},Ee.prototype._handle_tag_close=function(V,T,C){var R={text:T.text,type:T.type};return V.alignment_size=0,C.tag_complete=!0,V.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),C.is_unformatted?V.add_raw_token(T):(C.tag_start_char==="<"&&(V.set_space_before_token(T.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&C.has_wrapped_attrs&&V.print_newline(!1)),V.print_token(T)),C.indent_content&&!(C.is_unformatted||C.is_content_unformatted)&&(V.indent(),C.indent_content=!1),!C.is_inline_element&&!(C.is_unformatted||C.is_content_unformatted)&&V.set_wrap_point(),R},Ee.prototype._handle_inside_tag=function(V,T,C,R){var z=C.has_wrapped_attrs,Y={text:T.text,type:T.type};return V.set_space_before_token(T.newlines||T.whitespace_before!=="",!0),C.is_unformatted?V.add_raw_token(T):C.tag_start_char==="{"&&T.type===H.TEXT?V.print_preserved_newlines(T)?(T.newlines=0,V.add_raw_token(T)):V.print_token(T):(T.type===H.ATTRIBUTE?V.set_space_before_token(!0):(T.type===H.EQUALS||T.type===H.VALUE&&T.previous.type===H.EQUALS)&&V.set_space_before_token(!1),T.type===H.ATTRIBUTE&&C.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(V.traverse_whitespace(T),z=z||T.newlines!==0),this._is_wrap_attributes_force&&C.attr_count>=this._options.wrap_attributes_min_attrs&&(R.type!==H.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(V.print_newline(!1),z=!0)),V.print_token(T),z=z||V.previous_token_wrapped(),C.has_wrapped_attrs=z),Y},Ee.prototype._handle_text=function(V,T,C){var R={text:T.text,type:"TK_CONTENT"};return C.custom_beautifier_name?this._print_custom_beatifier_text(V,T,C):C.is_unformatted||C.is_content_unformatted?V.add_raw_token(T):(V.traverse_whitespace(T),V.print_token(T)),R},Ee.prototype._print_custom_beatifier_text=function(V,T,C){var R=this;if(T.text!==""){var z=T.text,Y,y=1,v="",$="";C.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?Y=this._js_beautify:C.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?Y=this._css_beautify:C.custom_beautifier_name==="html"&&(Y=function(qe,lt){var We=new Ee(qe,lt,R._js_beautify,R._css_beautify);return We.beautify()}),this._options.indent_scripts==="keep"?y=0:this._options.indent_scripts==="separate"&&(y=-V.indent_level);var j=V.get_full_indent(y);if(z=z.replace(/\n[ \t]*$/,""),C.custom_beautifier_name!=="html"&&z[0]==="<"&&z.match(/^(<!--|<!\[CDATA\[)/)){var me=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(z);if(!me){V.add_raw_token(T);return}v=j+me[1]+`
|
|
`,z=me[4],me[5]&&($=j+me[5]),z=z.replace(/\n[ \t]*$/,""),(me[2]||me[3].indexOf(`
|
|
`)!==-1)&&(me=me[3].match(/[ \t]+$/),me&&(T.whitespace_before=me[0]))}if(z)if(Y){var Se=function(){this.eol=`
|
|
`};Se.prototype=this._options.raw_options;var Te=new Se;z=Y(j+z,Te)}else{var De=T.whitespace_before;De&&(z=z.replace(new RegExp(`
|
|
(`+De+")?","g"),`
|
|
`)),z=j+z.replace(/\n/g,`
|
|
`+j)}v&&(z?z=v+z+`
|
|
`+$:z=v+$),V.print_newline(!1),z&&(T.text=z,T.whitespace_before="",T.newlines=0,V.add_raw_token(T),V.print_newline(!0))}},Ee.prototype._handle_tag_open=function(V,T,C,R,z){var Y=this._get_tag_open_token(T);if((C.is_unformatted||C.is_content_unformatted)&&!C.is_empty_element&&T.type===H.TAG_OPEN&&!Y.is_start_tag?(V.add_raw_token(T),Y.start_tag_token=this._tag_stack.try_pop(Y.tag_name)):(V.traverse_whitespace(T),this._set_tag_position(V,T,Y,C,R),Y.is_inline_element||V.set_wrap_point(),V.print_token(T)),Y.is_start_tag&&this._is_wrap_attributes_force){var y=0,v;do v=z.peek(y),v.type===H.ATTRIBUTE&&(Y.attr_count+=1),y+=1;while(v.type!==H.EOF&&v.type!==H.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(Y.alignment_size=T.text.length+1),!Y.tag_complete&&!Y.is_unformatted&&(V.alignment_size=Y.alignment_size),Y};var we=function(V,T,C){if(this.parent=T||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="",!C)this.tag_complete=!0;else{var R;this.tag_start_char=C.text[0],this.text=C.text,this.tag_start_char==="<"?(R=C.text.match(/^<([^\s>]*)/),this.tag_check=R?R[1]:""):(R=C.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=R?R[1]:"",(C.text.startsWith("{{#>")||C.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&C.next!==null?this.tag_check=C.next.text.split(" ")[0]:this.tag_check=C.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),C.type===H.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||C.closed&&C.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==="{"&&(!V.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(z)))}};Ee.prototype._get_tag_open_token=function(V){var T=new we(this._options,this._tag_stack.get_parser_token(),V);return T.alignment_size=this._options.wrap_attributes_indent_size,T.is_end_tag=T.is_end_tag||Q(T.tag_check,this._options.void_elements),T.is_empty_element=T.tag_complete||T.is_start_tag&&T.is_end_tag,T.is_unformatted=!T.tag_complete&&Q(T.tag_check,this._options.unformatted),T.is_content_unformatted=!T.is_empty_element&&Q(T.tag_check,this._options.content_unformatted),T.is_inline_element=Q(T.tag_name,this._options.inline)||this._options.inline_custom_elements&&T.tag_name.includes("-")||T.tag_start_char==="{",T},Ee.prototype._set_tag_position=function(V,T,C,R,z){if(C.is_empty_element||(C.is_end_tag?C.start_tag_token=this._tag_stack.try_pop(C.tag_name):(this._do_optional_end_element(C)&&(C.is_inline_element||V.print_newline(!1)),this._tag_stack.record_tag(C),(C.tag_name==="script"||C.tag_name==="style")&&!(C.is_unformatted||C.is_content_unformatted)&&(C.custom_beautifier_name=E(C.tag_check,T)))),Q(C.tag_check,this._options.extra_liners)&&(V.print_newline(!1),V._output.just_added_blankline()||V.print_newline(!0)),C.is_empty_element){if(C.tag_start_char==="{"&&C.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),C.indent_content=!0;var Y=V.current_line_has_match(/{{#if/);Y||V.print_newline(!1)}C.tag_name==="!--"&&z.type===H.TAG_CLOSE&&R.is_end_tag&&C.text.indexOf(`
|
|
`)===-1||(C.is_inline_element||C.is_unformatted||V.print_newline(!1),this._calcluate_parent_multiline(V,C))}else if(C.is_end_tag){var y=!1;y=C.start_tag_token&&C.start_tag_token.multiline_content,y=y||!C.is_inline_element&&!(R.is_inline_element||R.is_unformatted)&&!(z.type===H.TAG_CLOSE&&C.start_tag_token===R)&&z.type!=="TK_CONTENT",(C.is_content_unformatted||C.is_unformatted)&&(y=!1),y&&V.print_newline(!1)}else C.indent_content=!C.custom_beautifier_name,C.tag_start_char==="<"&&(C.tag_name==="html"?C.indent_content=this._options.indent_inner_html:C.tag_name==="head"?C.indent_content=this._options.indent_head_inner_html:C.tag_name==="body"&&(C.indent_content=this._options.indent_body_inner_html)),!(C.is_inline_element||C.is_unformatted)&&(z.type!=="TK_CONTENT"||C.is_content_unformatted)&&V.print_newline(!1),this._calcluate_parent_multiline(V,C)},Ee.prototype._calcluate_parent_multiline=function(V,T){T.parent&&V._output.just_added_newline()&&!((T.is_inline_element||T.is_unformatted)&&T.parent.is_inline_element)&&(T.parent.multiline_content=!0)};var xe=["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"],he=["a","audio","del","ins","map","noscript","video"];Ee.prototype._do_optional_end_element=function(V){var T=null;if(!(V.is_empty_element||!V.is_start_tag||!V.parent)){if(V.tag_name==="body")T=T||this._tag_stack.try_pop("head");else if(V.tag_name==="li")T=T||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(V.tag_name==="dd"||V.tag_name==="dt")T=T||this._tag_stack.try_pop("dt",["dl"]),T=T||this._tag_stack.try_pop("dd",["dl"]);else if(V.parent.tag_name==="p"&&xe.indexOf(V.tag_name)!==-1){var C=V.parent.parent;(!C||he.indexOf(C.tag_name)===-1)&&(T=T||this._tag_stack.try_pop("p"))}else V.tag_name==="rp"||V.tag_name==="rt"?(T=T||this._tag_stack.try_pop("rt",["ruby","rtc"]),T=T||this._tag_stack.try_pop("rp",["ruby","rtc"])):V.tag_name==="optgroup"?T=T||this._tag_stack.try_pop("optgroup",["select"]):V.tag_name==="option"?T=T||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):V.tag_name==="colgroup"?T=T||this._tag_stack.try_pop("caption",["table"]):V.tag_name==="thead"?(T=T||this._tag_stack.try_pop("caption",["table"]),T=T||this._tag_stack.try_pop("colgroup",["table"])):V.tag_name==="tbody"||V.tag_name==="tfoot"?(T=T||this._tag_stack.try_pop("caption",["table"]),T=T||this._tag_stack.try_pop("colgroup",["table"]),T=T||this._tag_stack.try_pop("thead",["table"]),T=T||this._tag_stack.try_pop("tbody",["table"])):V.tag_name==="tr"?(T=T||this._tag_stack.try_pop("caption",["table"]),T=T||this._tag_stack.try_pop("colgroup",["table"]),T=T||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(V.tag_name==="th"||V.tag_name==="td")&&(T=T||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),T=T||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return V.parent=this._tag_stack.get_parser_token(),T}},D.exports.Beautifier=Ee},function(D,f,u){var g=u(6).Options;function m(I){g.call(this,I,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}m.prototype=new g,D.exports.Options=m},function(D,f,u){var g=u(9).Tokenizer,m=u(9).TOKEN,I=u(13).Directives,H=u(14).TemplatablePattern,L=u(12).Pattern,w={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:m.START,RAW:m.RAW,EOF:m.EOF},O=new I(/<\!--/,/-->/),A=function(E,Q){g.call(this,E,Q),this._current_tag_name="";var te=new H(this._input).read_options(this._options),ie=new L(this._input);if(this.__patterns={word:te.until(/[\n\r\t <]/),word_control_flow_close_excluded:te.until(/[\n\r\t <}]/),single_quote:te.until_after(/'/),double_quote:te.until_after(/"/),attribute:te.until(/[\n\r\t =>]|\/>/),element_name:te.until(/[\n\r\t >\/]/),angular_control_flow_start:ie.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:ie.starting_with(/{{!--/).until_after(/--}}/),handlebars:ie.starting_with(/{{/).until_after(/}}/),handlebars_open:ie.until(/[\n\r\t }]/),handlebars_raw_close:ie.until(/}}/),comment:ie.starting_with(/<!--/).until_after(/-->/),cdata:ie.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:ie.starting_with(/<!\[/).until_after(/]>/),processing:ie.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 Ee=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=ie.matching(Ee).until_after(Ee)}};A.prototype=new g,A.prototype._is_comment=function(E){return!1},A.prototype._is_opening=function(E){return E.type===w.TAG_OPEN||E.type===w.CONTROL_FLOW_OPEN},A.prototype._is_closing=function(E,Q){return E.type===w.TAG_CLOSE&&Q&&((E.text===">"||E.text==="/>")&&Q.text[0]==="<"||E.text==="}}"&&Q.text[0]==="{"&&Q.text[1]==="{")||E.type===w.CONTROL_FLOW_CLOSE&&E.text==="}"&&Q.text.endsWith("{")},A.prototype._reset=function(){this._current_tag_name=""},A.prototype._get_next_token=function(E,Q){var te=null;this._readWhitespace();var ie=this._input.peek();return ie===null?this._create_token(w.EOF,""):(te=te||this._read_open_handlebars(ie,Q),te=te||this._read_attribute(ie,E,Q),te=te||this._read_close(ie,Q),te=te||this._read_script_and_style(ie,E),te=te||this._read_control_flows(ie,Q),te=te||this._read_raw_content(ie,E,Q),te=te||this._read_content_word(ie,Q),te=te||this._read_comment_or_cdata(ie),te=te||this._read_processing(ie),te=te||this._read_open(ie,Q),te=te||this._create_token(w.UNKNOWN,this._input.next()),te)},A.prototype._read_comment_or_cdata=function(E){var Q=null,te=null,ie=null;if(E==="<"){var Ee=this._input.peek(1);Ee==="!"&&(te=this.__patterns.comment.read(),te?(ie=O.get_directives(te),ie&&ie.ignore==="start"&&(te+=O.readIgnored(this._input))):te=this.__patterns.cdata.read()),te&&(Q=this._create_token(w.COMMENT,te),Q.directives=ie)}return Q},A.prototype._read_processing=function(E){var Q=null,te=null,ie=null;if(E==="<"){var Ee=this._input.peek(1);(Ee==="!"||Ee==="?")&&(te=this.__patterns.conditional_comment.read(),te=te||this.__patterns.processing.read()),te&&(Q=this._create_token(w.COMMENT,te),Q.directives=ie)}return Q},A.prototype._read_open=function(E,Q){var te=null,ie=null;return(!Q||Q.type===w.CONTROL_FLOW_OPEN)&&E==="<"&&(te=this._input.next(),this._input.peek()==="/"&&(te+=this._input.next()),te+=this.__patterns.element_name.read(),ie=this._create_token(w.TAG_OPEN,te)),ie},A.prototype._read_open_handlebars=function(E,Q){var te=null,ie=null;return(!Q||Q.type===w.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&E==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(te=this.__patterns.handlebars_comment.read(),te=te||this.__patterns.handlebars.read(),ie=this._create_token(w.COMMENT,te)):(te=this.__patterns.handlebars_open.read(),ie=this._create_token(w.TAG_OPEN,te))),ie},A.prototype._read_control_flows=function(E,Q){var te="",ie=null;if(!this._options.templating.includes("angular"))return ie;if(E==="@"){if(te=this.__patterns.angular_control_flow_start.read(),te==="")return ie;for(var Ee=te.endsWith("(")?1:0,we=0;!(te.endsWith("{")&&Ee===we);){var xe=this._input.next();if(xe===null)break;xe==="("?Ee++:xe===")"&&we++,te+=xe}ie=this._create_token(w.CONTROL_FLOW_OPEN,te)}else E==="}"&&Q&&Q.type===w.CONTROL_FLOW_OPEN&&(te=this._input.next(),ie=this._create_token(w.CONTROL_FLOW_CLOSE,te));return ie},A.prototype._read_close=function(E,Q){var te=null,ie=null;return Q&&Q.type===w.TAG_OPEN&&(Q.text[0]==="<"&&(E===">"||E==="/"&&this._input.peek(1)===">")?(te=this._input.next(),E==="/"&&(te+=this._input.next()),ie=this._create_token(w.TAG_CLOSE,te)):Q.text[0]==="{"&&E==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),ie=this._create_token(w.TAG_CLOSE,"}}"))),ie},A.prototype._read_attribute=function(E,Q,te){var ie=null,Ee="";if(te&&te.text[0]==="<")if(E==="=")ie=this._create_token(w.EQUALS,this._input.next());else if(E==='"'||E==="'"){var we=this._input.next();E==='"'?we+=this.__patterns.double_quote.read():we+=this.__patterns.single_quote.read(),ie=this._create_token(w.VALUE,we)}else Ee=this.__patterns.attribute.read(),Ee&&(Q.type===w.EQUALS?ie=this._create_token(w.VALUE,Ee):ie=this._create_token(w.ATTRIBUTE,Ee));return ie},A.prototype._is_content_unformatted=function(E){return this._options.void_elements.indexOf(E)===-1&&(this._options.content_unformatted.indexOf(E)!==-1||this._options.unformatted.indexOf(E)!==-1)},A.prototype._read_raw_content=function(E,Q,te){var ie="";if(te&&te.text[0]==="{")ie=this.__patterns.handlebars_raw_close.read();else if(Q.type===w.TAG_CLOSE&&Q.opened.text[0]==="<"&&Q.text[0]!=="/"){var Ee=Q.opened.text.substr(1).toLowerCase();this._is_content_unformatted(Ee)&&(ie=this._input.readUntil(new RegExp("</"+Ee+"[\\n\\r\\t ]*?>","ig")))}return ie?this._create_token(w.TEXT,ie):null},A.prototype._read_script_and_style=function(E,Q){if(Q.type===w.TAG_CLOSE&&Q.opened.text[0]==="<"&&Q.text[0]!=="/"){var te=Q.opened.text.substr(1).toLowerCase();if(te==="script"||te==="style"){var ie=this._read_comment_or_cdata(E);if(ie)return ie.type=w.TEXT,ie;var Ee=this._input.readUntil(new RegExp("</"+te+"[\\n\\r\\t ]*?>","ig"));if(Ee)return this._create_token(w.TEXT,Ee)}}return null},A.prototype._read_content_word=function(E,Q){var te="";return this._options.unformatted_content_delimiter&&E===this._options.unformatted_content_delimiter[0]&&(te=this.__patterns.unformatted_content_delimiter.read()),te||(te=Q&&Q.type===w.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),te?this._create_token(w.TEXT,te):null},D.exports.Tokenizer=A,D.exports.TOKEN=w}],le={};function o(D){var f=le[D];if(f!==void 0)return f.exports;var u=le[D]={exports:{}};return _e[D](u,u.exports,o),u.exports}var K=o(18);ve=K})();var fe=ve;if(1)B=[b,b(58553),b(87804)],q=function(_e){var le=b(58553),o=b(87804);return{html_beautify:function(K,D){return fe(K,D,le.js_beautify,o.css_beautify)}}}.apply(ke,B),q!==void 0&&(bt.exports=q);else var oe,Z})()},58553:function(bt,ke){var b,B;(function(){var q;(function(){"use strict";var fe=[function(le,o,K){var D=K(1).Beautifier,f=K(5).Options;function u(g,m){var I=new D(g,m);return I.beautify()}le.exports=u,le.exports.defaultOptions=function(){return new f}},function(le,o,K){var D=K(2).Output,f=K(3).Token,u=K(4),g=K(5).Options,m=K(7).Tokenizer,I=K(7).line_starters,H=K(7).positionable_operators,L=K(7).TOKEN;function w(v,$){return $.indexOf(v)!==-1}function O(v){return v.replace(/^\s+/g,"")}function A(v){for(var $={},j=0;j<v.length;j++)$[v[j].replace(/-/g,"_")]=v[j];return $}function E(v,$){return v&&v.type===L.RESERVED&&v.text===$}function Q(v,$){return v&&v.type===L.RESERVED&&w(v.text,$)}var te=["case","return","do","if","throw","else","await","break","continue","async"],ie=["before-newline","after-newline","preserve-newline"],Ee=A(ie),we=[Ee.before_newline,Ee.preserve_newline],xe={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function he(v,$){$.multiline_frame||$.mode===xe.ForInitializer||$.mode===xe.Conditional||v.remove_indent($.start_line_index)}function V(v){v=v.replace(u.allLineBreaks,`
|
|
`);for(var $=[],j=v.indexOf(`
|
|
`);j!==-1;)$.push(v.substring(0,j)),v=v.substring(j+1),j=v.indexOf(`
|
|
`);return v.length&&$.push(v),$}function T(v){return v===xe.ArrayLiteral}function C(v){return w(v,[xe.Expression,xe.ForInitializer,xe.Conditional])}function R(v,$){for(var j=0;j<v.length;j++){var me=v[j].trim();if(me.charAt(0)!==$)return!1}return!0}function z(v,$){for(var j=0,me=v.length,Se;j<me;j++)if(Se=v[j],Se&&Se.indexOf($)!==0)return!1;return!0}function Y(v,$){$=$||{},this._source_text=v||"",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 g($)}Y.prototype.create_flags=function(v,$){var j=0;v&&(j=v.indentation_level,!this._output.just_added_newline()&&v.line_indent_level>j&&(j=v.line_indent_level));var me={mode:$,parent:v,last_token:v?v.last_token:new f(L.START_BLOCK,""),last_word:v?v.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:j,alignment:0,line_indent_level:v?v.line_indent_level:j,start_line_index:this._output.get_line_number(),ternary_depth:0};return me},Y.prototype._reset=function(v){var $=v.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new D(this._options,$),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(xe.BlockStatement);var j=new m(v,this._options);return this._tokens=j.tokenize(),v},Y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v,$=this._reset(this._source_text),j=this._options.eol;this._options.eol==="auto"&&(j=`
|
|
`,$&&u.lineBreak.test($||"")&&(j=$.match(u.lineBreak)[0]));for(var me=this._tokens.next();me;)this.handle_token(me),this._last_last_text=this._flags.last_token.text,this._flags.last_token=me,me=this._tokens.next();return v=this._output.get_code(j),v},Y.prototype.handle_token=function(v,$){v.type===L.START_EXPR?this.handle_start_expr(v):v.type===L.END_EXPR?this.handle_end_expr(v):v.type===L.START_BLOCK?this.handle_start_block(v):v.type===L.END_BLOCK?this.handle_end_block(v):v.type===L.WORD?this.handle_word(v):v.type===L.RESERVED?this.handle_word(v):v.type===L.SEMICOLON?this.handle_semicolon(v):v.type===L.STRING?this.handle_string(v):v.type===L.EQUALS?this.handle_equals(v):v.type===L.OPERATOR?this.handle_operator(v):v.type===L.COMMA?this.handle_comma(v):v.type===L.BLOCK_COMMENT?this.handle_block_comment(v,$):v.type===L.COMMENT?this.handle_comment(v,$):v.type===L.DOT?this.handle_dot(v):v.type===L.EOF?this.handle_eof(v):v.type===L.UNKNOWN?this.handle_unknown(v,$):this.handle_unknown(v,$)},Y.prototype.handle_whitespace_and_comments=function(v,$){var j=v.newlines,me=this._options.keep_array_indentation&&T(this._flags.mode);if(v.comments_before)for(var Se=v.comments_before.next();Se;)this.handle_whitespace_and_comments(Se,$),this.handle_token(Se,$),Se=v.comments_before.next();if(me)for(var Te=0;Te<j;Te+=1)this.print_newline(Te>0,$);else if(this._options.max_preserve_newlines&&j>this._options.max_preserve_newlines&&(j=this._options.max_preserve_newlines),this._options.preserve_newlines&&j>1){this.print_newline(!1,$);for(var De=1;De<j;De+=1)this.print_newline(!0,$)}};var y=["async","break","continue","return","throw","yield"];Y.prototype.allow_wrap_or_preserved_newline=function(v,$){if($=$===void 0?!1:$,!this._output.just_added_newline()){var j=this._options.preserve_newlines&&v.newlines||$,me=w(this._flags.last_token.text,H)||w(v.text,H);if(me){var Se=w(this._flags.last_token.text,H)&&w(this._options.operator_position,we)||w(v.text,H);j=j&&Se}if(j)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(Q(this._flags.last_token,y))return;this._output.set_wrap_point()}}},Y.prototype.print_newline=function(v,$){if(!$&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==L.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var j=this._tokens.peek();this._flags.mode===xe.Statement&&!(this._flags.if_block&&E(j,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(v)&&(this._flags.multiline_frame=!0)},Y.prototype.print_token_line_indentation=function(v){this._output.just_added_newline()&&(this._options.keep_array_indentation&&v.newlines&&(v.text==="["||T(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(v.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(v){if(this._output.raw){this._output.add_raw_token(v);return}if(this._options.comma_first&&v.previous&&v.previous.type===L.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var $=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push($),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(v),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(v),this._output.non_breaking_space=!0,this._output.add_token(v.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(v){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,v),this._flags=this.create_flags(this._previous_flags,v),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===xe.Statement&&he(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===xe.ObjectLiteral&&this._flags.mode===xe.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||Q(this._flags.last_token,["get","set"]))},Y.prototype.start_of_statement=function(v){var $=!1;return $=$||Q(this._flags.last_token,["var","let","const"])&&v.type===L.WORD,$=$||E(this._flags.last_token,"do"),$=$||!(this._flags.parent.mode===xe.ObjectLiteral&&this._flags.mode===xe.Statement)&&Q(this._flags.last_token,y)&&!v.newlines,$=$||E(this._flags.last_token,"else")&&!(E(v,"if")&&!v.comments_before),$=$||this._flags.last_token.type===L.END_EXPR&&(this._previous_flags.mode===xe.ForInitializer||this._previous_flags.mode===xe.Conditional),$=$||this._flags.last_token.type===L.WORD&&this._flags.mode===xe.BlockStatement&&!this._flags.in_case&&!(v.text==="--"||v.text==="++")&&this._last_last_text!=="function"&&v.type!==L.WORD&&v.type!==L.RESERVED,$=$||this._flags.mode===xe.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||Q(this._flags.last_token,["get","set"])),$?(this.set_mode(xe.Statement),this.indent(),this.handle_whitespace_and_comments(v,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v,Q(v,["do","for","if","while"])),!0):!1},Y.prototype.handle_start_expr=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v);var $=xe.Expression;if(v.text==="["){if(this._flags.last_token.type===L.WORD||this._flags.last_token.text===")"){Q(this._flags.last_token,I)&&(this._output.space_before_token=!0),this.print_token(v),this.set_mode($),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}$=xe.ArrayLiteral,T(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()),w(this._flags.last_token.type,[L.START_EXPR,L.END_EXPR,L.WORD,L.OPERATOR,L.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===L.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,$=xe.ForInitializer):w(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,$=xe.Conditional):w(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&v.whitespace_before===""?this._output.space_before_token=!1:(w(this._flags.last_token.text,I)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===L.EQUALS||this._flags.last_token.type===L.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v);else if(this._flags.last_token.type===L.WORD){this._output.space_before_token=!1;var j=this._tokens.peek(-3);if(this._options.space_after_named_function&&j){var me=this._tokens.peek(-4);Q(j,["async","function"])||j.text==="*"&&Q(me,["async","function"])?this._output.space_before_token=!0:this._flags.mode===xe.ObjectLiteral?(j.text==="{"||j.text===","||j.text==="*"&&(me.text==="{"||me.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(v);(this._flags.last_token.type===L.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(w(this._last_last_text,["function","yield"])||this._flags.mode===xe.ObjectLiteral&&w(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===L.START_BLOCK?this.print_newline():(this._flags.last_token.type===L.END_EXPR||this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===L.COMMA)&&this.allow_wrap_or_preserved_newline(v,v.newlines),this.print_token(v),this.set_mode($),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Y.prototype.handle_end_expr=function(v){for(;this._flags.mode===xe.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(v,v.text==="]"&&T(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===L.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(v),this.restore_mode(),he(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===xe.Conditional&&(this._previous_flags.mode=xe.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},Y.prototype.handle_start_block=function(v){this.handle_whitespace_and_comments(v);var $=this._tokens.peek(),j=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===L.END_EXPR?(this.set_mode(xe.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(xe.BlockStatement):j&&(w(j.text,[":",","])&&w($.type,[L.STRING,L.WORD,L.RESERVED])||w($.text,["get","set","..."])&&w(j.type,[L.WORD,L.RESERVED]))?w(this._last_last_text,["class","interface"])&&!w(j.text,[":",","])?this.set_mode(xe.BlockStatement):this.set_mode(xe.ObjectLiteral):this._flags.last_token.type===L.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(xe.BlockStatement):w(this._flags.last_token.type,[L.EQUALS,L.START_EXPR,L.COMMA,L.OPERATOR])||Q(this._flags.last_token,["return","throw","import","default"])?this.set_mode(xe.ObjectLiteral):this.set_mode(xe.BlockStatement),this._flags.last_token&&Q(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var me=!$.comments_before&&$.text==="}",Se=me&&this._flags.last_word==="function"&&this._flags.last_token.type===L.END_EXPR;if(this._options.brace_preserve_inline){var Te=0,De=null;this._flags.inline_frame=!0;do if(Te+=1,De=this._tokens.peek(Te-1),De.newlines){this._flags.inline_frame=!1;break}while(De.type!==L.EOF&&!(De.type===L.END_BLOCK&&De.opened===v))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==L.OPERATOR&&(Se||this._flags.last_token.type===L.EQUALS||Q(this._flags.last_token,te)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(T(this._previous_flags.mode)&&(this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.COMMA)&&((this._flags.last_token.type===L.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(v),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==L.OPERATOR&&this._flags.last_token.type!==L.START_EXPR&&(w(this._flags.last_token.type,[L.START_BLOCK,L.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(v),this.indent(),!me&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},Y.prototype.handle_end_block=function(v){for(this.handle_whitespace_and_comments(v);this._flags.mode===xe.Statement;)this.restore_mode();var $=this._flags.last_token.type===L.START_BLOCK;this._flags.inline_frame&&!$?this._output.space_before_token=!0:this._options.brace_style==="expand"?$||this.print_newline():$||(T(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(v)},Y.prototype.handle_word=function(v){if(v.type===L.RESERVED){if(w(v.text,["set","get"])&&this._flags.mode!==xe.ObjectLiteral)v.type=L.WORD;else if(v.text==="import"&&w(this._tokens.peek().text,["(","."]))v.type=L.WORD;else if(w(v.text,["as","from"])&&!this._flags.import_block)v.type=L.WORD;else if(this._flags.mode===xe.ObjectLiteral){var $=this._tokens.peek();$.text===":"&&(v.type=L.WORD)}}if(this.start_of_statement(v)?Q(this._flags.last_token,["var","let","const"])&&v.type===L.WORD&&(this._flags.declaration_statement=!0):v.newlines&&!C(this._flags.mode)&&(this._flags.last_token.type!==L.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==L.EQUALS&&(this._options.preserve_newlines||!Q(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(v),this.print_newline()):this.handle_whitespace_and_comments(v),this._flags.do_block&&!this._flags.do_while)if(E(v,"while")){this._output.space_before_token=!0,this.print_token(v),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&&E(v,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===xe.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&Q(v,["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(v),this._flags.in_case=!0;return}if((this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.EQUALS||this._flags.last_token.type===L.OPERATOR)&&!this.start_of_object_property()&&!(w(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===xe.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(v),E(v,"function")){(w(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(w(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===L.OPERATOR))&&!this._output.just_added_blankline()&&!v.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===L.RESERVED||this._flags.last_token.type===L.WORD?Q(this._flags.last_token,["get","set","new","export"])||Q(this._flags.last_token,y)?this._output.space_before_token=!0:E(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===L.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(C(this._flags.mode)||T(this._flags.mode))||this.print_newline(),this.print_token(v),this._flags.last_word=v.text;return}var j="NONE";if(this._flags.last_token.type===L.END_BLOCK?this._previous_flags.inline_frame?j="SPACE":Q(v,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines?j="NEWLINE":(j="SPACE",this._output.space_before_token=!0):j="NEWLINE":this._flags.last_token.type===L.SEMICOLON&&this._flags.mode===xe.BlockStatement?j="NEWLINE":this._flags.last_token.type===L.SEMICOLON&&C(this._flags.mode)?j="SPACE":this._flags.last_token.type===L.STRING?j="NEWLINE":this._flags.last_token.type===L.RESERVED||this._flags.last_token.type===L.WORD||this._flags.last_token.text==="*"&&(w(this._last_last_text,["function","yield"])||this._flags.mode===xe.ObjectLiteral&&w(this._last_last_text,["{",","]))?j="SPACE":this._flags.last_token.type===L.START_BLOCK?this._flags.inline_frame?j="SPACE":j="NEWLINE":this._flags.last_token.type===L.END_EXPR&&(this._output.space_before_token=!0,j="NEWLINE"),Q(v,I)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?j="SPACE":j="NEWLINE"),Q(v,["else","catch","finally"]))if((!(this._flags.last_token.type===L.END_BLOCK&&this._previous_flags.mode===xe.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var me=this._output.current_line;me.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else j==="NEWLINE"?Q(this._flags.last_token,te)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&Q(v,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==L.END_EXPR?(this._flags.last_token.type!==L.START_EXPR||!Q(v,["var","let","const"]))&&this._flags.last_token.text!==":"&&(E(v,"if")&&E(v.previous,"else")?this._output.space_before_token=!0:this.print_newline()):Q(v,I)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&T(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():j==="SPACE"&&(this._output.space_before_token=!0);v.previous&&(v.previous.type===L.WORD||v.previous.type===L.RESERVED)&&(this._output.space_before_token=!0),this.print_token(v),this._flags.last_word=v.text,v.type===L.RESERVED&&(v.text==="do"?this._flags.do_block=!0:v.text==="if"?this._flags.if_block=!0:v.text==="import"?this._flags.import_block=!0:this._flags.import_block&&E(v,"from")&&(this._flags.import_block=!1))},Y.prototype.handle_semicolon=function(v){this.start_of_statement(v)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(v);for(var $=this._tokens.peek();this._flags.mode===xe.Statement&&!(this._flags.if_block&&E($,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(v)},Y.prototype.handle_string=function(v){v.text.startsWith("`")&&v.newlines===0&&v.whitespace_before===""&&(v.previous.text===")"||this._flags.last_token.type===L.WORD)||(this.start_of_statement(v)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(v),this._flags.last_token.type===L.RESERVED||this._flags.last_token.type===L.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR||this._flags.last_token.type===L.EQUALS||this._flags.last_token.type===L.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v):v.text.startsWith("`")&&this._flags.last_token.type===L.END_EXPR&&(v.previous.text==="]"||v.previous.text===")")&&v.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(v)},Y.prototype.handle_equals=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0},Y.prototype.handle_comma=function(v){this.handle_whitespace_and_comments(v,!0),this.print_token(v),this._output.space_before_token=!0,this._flags.declaration_statement?(C(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(v)):this._flags.mode===xe.ObjectLiteral||this._flags.mode===xe.Statement&&this._flags.parent.mode===xe.ObjectLiteral?(this._flags.mode===xe.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(v)},Y.prototype.handle_operator=function(v){var $=v.text==="*"&&(Q(this._flags.last_token,["function","yield"])||w(this._flags.last_token.type,[L.START_BLOCK,L.COMMA,L.END_BLOCK,L.SEMICOLON])),j=w(v.text,["-","+"])&&(w(this._flags.last_token.type,[L.START_BLOCK,L.START_EXPR,L.EQUALS,L.OPERATOR])||w(this._flags.last_token.text,I)||this._flags.last_token.text===",");if(!this.start_of_statement(v)){var me=!$;this.handle_whitespace_and_comments(v,me)}if(v.text==="*"&&this._flags.last_token.type===L.DOT){this.print_token(v);return}if(v.text==="::"){this.print_token(v);return}if(w(v.text,["-","+"])&&this.start_of_object_property()){this.print_token(v);return}if(this._flags.last_token.type===L.OPERATOR&&w(this._options.operator_position,we)&&this.allow_wrap_or_preserved_newline(v),v.text===":"&&this._flags.in_case){this.print_token(v),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==L.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var Se=!0,Te=!0,De=!1;if(v.text===":"?this._flags.ternary_depth===0?Se=!1:(this._flags.ternary_depth-=1,De=!0):v.text==="?"&&(this._flags.ternary_depth+=1),!j&&!$&&this._options.preserve_newlines&&w(v.text,H)){var qe=v.text===":",lt=qe&&De,We=qe&&!De;switch(this._options.operator_position){case Ee.before_newline:this._output.space_before_token=!We,this.print_token(v),(!qe||lt)&&this.allow_wrap_or_preserved_newline(v),this._output.space_before_token=!0;return;case Ee.after_newline:this._output.space_before_token=!0,!qe||lt?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(v):this._output.space_before_token=!1,this.print_token(v),this._output.space_before_token=!0;return;case Ee.preserve_newline:We||this.allow_wrap_or_preserved_newline(v),Se=!(this._output.just_added_newline()||We),this._output.space_before_token=Se,this.print_token(v),this._output.space_before_token=!0;return}}if($){this.allow_wrap_or_preserved_newline(v),Se=!1;var Tt=this._tokens.peek();Te=Tt&&w(Tt.type,[L.WORD,L.RESERVED])}else if(v.text==="...")this.allow_wrap_or_preserved_newline(v),Se=this._flags.last_token.type===L.START_BLOCK,Te=!1;else if(w(v.text,["--","++","!","~"])||j){if((this._flags.last_token.type===L.COMMA||this._flags.last_token.type===L.START_EXPR)&&this.allow_wrap_or_preserved_newline(v),Se=!1,Te=!1,v.newlines&&(v.text==="--"||v.text==="++"||v.text==="~")){var dt=Q(this._flags.last_token,te)&&v.newlines;dt&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(dt,!0)}this._flags.last_token.text===";"&&C(this._flags.mode)&&(Se=!0),this._flags.last_token.type===L.RESERVED?Se=!0:this._flags.last_token.type===L.END_EXPR?Se=!(this._flags.last_token.text==="]"&&(v.text==="--"||v.text==="++")):this._flags.last_token.type===L.OPERATOR&&(Se=w(v.text,["--","-","++","+"])&&w(this._flags.last_token.text,["--","-","++","+"]),w(v.text,["+","-"])&&w(this._flags.last_token.text,["--","++"])&&(Te=!0)),(this._flags.mode===xe.BlockStatement&&!this._flags.inline_frame||this._flags.mode===xe.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Se,this.print_token(v),this._output.space_before_token=Te},Y.prototype.handle_block_comment=function(v,$){if(this._output.raw){this._output.add_raw_token(v),v.directives&&v.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(v.directives){this.print_newline(!1,$),this.print_token(v),v.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(v.text)&&!v.newlines){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0;return}else this.print_block_commment(v,$)},Y.prototype.print_block_commment=function(v,$){var j=V(v.text),me,Se=!1,Te=!1,De=v.whitespace_before,qe=De.length;if(this.print_newline(!1,$),this.print_token_line_indentation(v),this._output.add_token(j[0]),this.print_newline(!1,$),j.length>1){for(j=j.slice(1),Se=R(j,"*"),Te=z(j,De),Se&&(this._flags.alignment=1),me=0;me<j.length;me++)Se?(this.print_token_line_indentation(v),this._output.add_token(O(j[me]))):Te&&j[me]?(this.print_token_line_indentation(v),this._output.add_token(j[me].substring(qe))):(this._output.current_line.set_indent(-1),this._output.add_token(j[me])),this.print_newline(!1,$);this._flags.alignment=0}},Y.prototype.handle_comment=function(v,$){v.newlines?this.print_newline(!1,$):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(v),this.print_newline(!1,$)},Y.prototype.handle_dot=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),Q(this._flags.last_token,te)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(v,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(v)},Y.prototype.handle_unknown=function(v,$){this.print_token(v),v.text[v.text.length-1]===`
|
|
`&&this.print_newline(!1,$)},Y.prototype.handle_eof=function(v){for(;this._flags.mode===xe.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v)},le.exports.Beautifier=Y},function(le){function o(f){this.__parent=f,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}o.prototype.clone_empty=function(){var f=new o(this.__parent);return f.set_indent(this.__indent_count,this.__alignment_count),f},o.prototype.item=function(f){return f<0?this.__items[this.__items.length+f]:this.__items[f]},o.prototype.has_match=function(f){for(var u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(f))return!0;return!1},o.prototype.set_indent=function(f,u){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},o.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},o.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},o.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},o.prototype.is_empty=function(){return this.__items.length===0},o.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},o.prototype.push=function(f){this.__items.push(f);var u=f.lastIndexOf(`
|
|
`);u!==-1?this.__character_count=f.length-u:this.__character_count+=f.length},o.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},o.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},o.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},o.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},o.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function K(f,u){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),u=u||"",f.indent_level>0&&(u=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}K.prototype.get_indent_size=function(f,u){var g=this.__base_string_length;return u=u||0,f<0&&(g=0),g+=f*this.__indent_size,g+=u,g},K.prototype.get_indent_string=function(f,u){var g=this.__base_string;return u=u||0,f<0&&(f=0,g=""),u+=f*this.__indent_size,this.__ensure_cache(u),g+=this.__cache[u],g},K.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},K.prototype.__add_column=function(){var f=this.__cache.length,u=0,g="";this.__indent_size&&f>=this.__indent_size&&(u=Math.floor(f/this.__indent_size),f-=u*this.__indent_size,g=new Array(u+1).join(this.__indent_string)),f&&(g+=new Array(f+1).join(" ")),this.__cache.push(g)};function D(f,u){this.__indent_cache=new K(f,u),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new o(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}D.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},D.prototype.get_line_number=function(){return this.__lines.length},D.prototype.get_indent_string=function(f,u){return this.__indent_cache.get_indent_string(f,u)},D.prototype.get_indent_size=function(f,u){return this.__indent_cache.get_indent_size(f,u)},D.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},D.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},D.prototype.get_code=function(f){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
|
|
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var g=this.__lines.join(`
|
|
`);return f!==`
|
|
`&&(g=g.replace(/[\n]/g,f)),g},D.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},D.prototype.set_indent=function(f,u){return f=f||0,u=u||0,this.next_line.set_indent(f,u),this.__lines.length>1?(this.current_line.set_indent(f,u),!0):(this.current_line.set_indent(),!1)},D.prototype.add_raw_token=function(f){for(var u=0;u<f.newlines;u++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(f.whitespace_before),this.current_line.push(f.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},D.prototype.add_token=function(f){this.__add_space_before_token(),this.current_line.push(f),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},D.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},D.prototype.remove_indent=function(f){for(var u=this.__lines.length;f<u;)this.__lines[f]._remove_indent(),f++;this.current_line._remove_wrap_indent()},D.prototype.trim=function(f){for(f=f===void 0?!1:f,this.current_line.trim();f&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},D.prototype.just_added_newline=function(){return this.current_line.is_empty()},D.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},D.prototype.ensure_empty_line_above=function(f,u){for(var g=this.__lines.length-2;g>=0;){var m=this.__lines[g];if(m.is_empty())break;if(m.item(0).indexOf(f)!==0&&m.item(-1)!==u){this.__lines.splice(g+1,0,new o(this)),this.previous_line=this.__lines[this.__lines.length-2];break}g--}},le.exports.Output=D},function(le){function o(K,D,f,u){this.type=K,this.text=D,this.comments_before=null,this.newlines=f||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}le.exports.Token=o},function(le,o){var K="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",D="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\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",u="\\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",g="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",m="(?:"+g+"|["+K+f+"])",I="(?:"+g+"|["+D+f+u+"])*";o.identifier=new RegExp(m+I,"g"),o.identifierStart=new RegExp(m),o.identifierMatch=new RegExp("(?:"+g+"|["+D+f+u+"])+");var H=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;o.newline=/[\n\r\u2028\u2029]/,o.lineBreak=new RegExp(`\r
|
|
|`+o.newline.source),o.allLineBreaks=new RegExp(o.lineBreak.source,"g")},function(le,o,K){var D=K(6).Options,f=["before-newline","after-newline","preserve-newline"];function u(g){D.call(this,g,"js");var m=this.raw_options.brace_style||null;m==="expand-strict"?this.raw_options.brace_style="expand":m==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var I=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var H=0;H<I.length;H++)I[H]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=I[H];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",f),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}u.prototype=new D,le.exports.Options=u},function(le){function o(f,u){this.raw_options=K(f,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}o.prototype._get_array=function(f,u){var g=this.raw_options[f],m=u||[];return typeof g=="object"?g!==null&&typeof g.concat=="function"&&(m=g.concat()):typeof g=="string"&&(m=g.split(/[^a-zA-Z0-9_\/\-]+/)),m},o.prototype._get_boolean=function(f,u){var g=this.raw_options[f],m=g===void 0?!!u:!!g;return m},o.prototype._get_characters=function(f,u){var g=this.raw_options[f],m=u||"";return typeof g=="string"&&(m=g.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),m},o.prototype._get_number=function(f,u){var g=this.raw_options[f];u=parseInt(u,10),isNaN(u)&&(u=0);var m=parseInt(g,10);return isNaN(m)&&(m=u),m},o.prototype._get_selection=function(f,u,g){var m=this._get_selection_list(f,u,g);if(m.length!==1)throw new Error("Invalid Option Value: The option '"+f+`' can only be one of the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[f]+"'");return m[0]},o.prototype._get_selection_list=function(f,u,g){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(g=g||[u[0]],!this._is_valid_selection(g,u))throw new Error("Invalid Default Value!");var m=this._get_array(f,g);if(!this._is_valid_selection(m,u))throw new Error("Invalid Option Value: The option '"+f+`' can contain only the following values:
|
|
`+u+`
|
|
You passed in: '`+this.raw_options[f]+"'");return m},o.prototype._is_valid_selection=function(f,u){return f.length&&u.length&&!f.some(function(g){return u.indexOf(g)===-1})};function K(f,u){var g={};f=D(f);var m;for(m in f)m!==u&&(g[m]=f[m]);if(u&&f[u])for(m in f[u])g[m]=f[u][m];return g}function D(f){var u={},g;for(g in f){var m=g.replace(/-/g,"_");u[m]=f[g]}return u}le.exports.Options=o,le.exports.normalizeOpts=D,le.exports.mergeOpts=K},function(le,o,K){var D=K(8).InputScanner,f=K(9).Tokenizer,u=K(9).TOKEN,g=K(13).Directives,m=K(4),I=K(12).Pattern,H=K(14).TemplatablePattern;function L(R,z){return z.indexOf(R)!==-1}var w={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:u.START,RAW:u.RAW,EOF:u.EOF},O=new g(/\/\*/,/\*\//),A=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,E=/[0-9]/,Q=/[^\d\.]/,te=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),ie=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";ie=ie.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),ie="\\?\\.(?!\\d) "+ie,ie=ie.replace(/ /g,"|");var Ee=new RegExp(ie),we="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),xe=we.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),he=new RegExp("^(?:"+xe.join("|")+")$"),V,T=function(R,z){f.call(this,R,z),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var Y=new I(this._input),y=new H(this._input).read_options(this._options);this.__patterns={template:y,identifier:y.starting_with(m.identifier).matching(m.identifierMatch),number:Y.matching(A),punct:Y.matching(Ee),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(m.lineBreak),shebang:Y.starting_with(/#!/).until_after(m.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:y.until(/['\\\n\r\u2028\u2029]/),double_quote:y.until(/["\\\n\r\u2028\u2029]/),template_text:y.until(/[`\\$]/),template_expression:y.until(/[`}\\]/)}};T.prototype=new f,T.prototype._is_comment=function(R){return R.type===w.COMMENT||R.type===w.BLOCK_COMMENT||R.type===w.UNKNOWN},T.prototype._is_opening=function(R){return R.type===w.START_BLOCK||R.type===w.START_EXPR},T.prototype._is_closing=function(R,z){return(R.type===w.END_BLOCK||R.type===w.END_EXPR)&&z&&(R.text==="]"&&z.text==="["||R.text===")"&&z.text==="("||R.text==="}"&&z.text==="{")},T.prototype._reset=function(){V=!1},T.prototype._get_next_token=function(R,z){var Y=null;this._readWhitespace();var y=this._input.peek();return y===null?this._create_token(w.EOF,""):(Y=Y||this._read_non_javascript(y),Y=Y||this._read_string(y),Y=Y||this._read_pair(y,this._input.peek(1)),Y=Y||this._read_word(R),Y=Y||this._read_singles(y),Y=Y||this._read_comment(y),Y=Y||this._read_regexp(y,R),Y=Y||this._read_xml(y,R),Y=Y||this._read_punctuation(),Y=Y||this._create_token(w.UNKNOWN,this._input.next()),Y)},T.prototype._read_word=function(R){var z;if(z=this.__patterns.identifier.read(),z!=="")return z=z.replace(m.allLineBreaks,`
|
|
`),!(R.type===w.DOT||R.type===w.RESERVED&&(R.text==="set"||R.text==="get"))&&he.test(z)?(z==="in"||z==="of")&&(R.type===w.WORD||R.type===w.STRING)?this._create_token(w.OPERATOR,z):this._create_token(w.RESERVED,z):this._create_token(w.WORD,z);if(z=this.__patterns.number.read(),z!=="")return this._create_token(w.WORD,z)},T.prototype._read_singles=function(R){var z=null;return R==="("||R==="["?z=this._create_token(w.START_EXPR,R):R===")"||R==="]"?z=this._create_token(w.END_EXPR,R):R==="{"?z=this._create_token(w.START_BLOCK,R):R==="}"?z=this._create_token(w.END_BLOCK,R):R===";"?z=this._create_token(w.SEMICOLON,R):R==="."&&Q.test(this._input.peek(1))?z=this._create_token(w.DOT,R):R===","&&(z=this._create_token(w.COMMA,R)),z&&this._input.next(),z},T.prototype._read_pair=function(R,z){var Y=null;return R==="#"&&z==="{"&&(Y=this._create_token(w.START_BLOCK,R+z)),Y&&(this._input.next(),this._input.next()),Y},T.prototype._read_punctuation=function(){var R=this.__patterns.punct.read();if(R!=="")return R==="="?this._create_token(w.EQUALS,R):R==="?."?this._create_token(w.DOT,R):this._create_token(w.OPERATOR,R)},T.prototype._read_non_javascript=function(R){var z="";if(R==="#"){if(this._is_first_token()&&(z=this.__patterns.shebang.read(),z))return this._create_token(w.UNKNOWN,z.trim()+`
|
|
`);if(z=this.__patterns.include.read(),z)return this._create_token(w.UNKNOWN,z.trim()+`
|
|
`);R=this._input.next();var Y="#";if(this._input.hasNext()&&this._input.testChar(E)){do R=this._input.next(),Y+=R;while(this._input.hasNext()&&R!=="#"&&R!=="=");return R==="#"||(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(w.WORD,Y)}this._input.back()}else if(R==="<"&&this._is_first_token()){if(z=this.__patterns.html_comment_start.read(),z){for(;this._input.hasNext()&&!this._input.testChar(m.newline);)z+=this._input.next();return V=!0,this._create_token(w.COMMENT,z)}}else if(V&&R==="-"&&(z=this.__patterns.html_comment_end.read(),z))return V=!1,this._create_token(w.COMMENT,z);return null},T.prototype._read_comment=function(R){var z=null;if(R==="/"){var Y="";if(this._input.peek(1)==="*"){Y=this.__patterns.block_comment.read();var y=O.get_directives(Y);y&&y.ignore==="start"&&(Y+=O.readIgnored(this._input)),Y=Y.replace(m.allLineBreaks,`
|
|
`),z=this._create_token(w.BLOCK_COMMENT,Y),z.directives=y}else this._input.peek(1)==="/"&&(Y=this.__patterns.comment.read(),z=this._create_token(w.COMMENT,Y))}return z},T.prototype._read_string=function(R){if(R==="`"||R==="'"||R==='"'){var z=this._input.next();return this.has_char_escapes=!1,R==="`"?z+=this._read_string_recursive("`",!0,"${"):z+=this._read_string_recursive(R),this.has_char_escapes&&this._options.unescape_strings&&(z=C(z)),this._input.peek()===R&&(z+=this._input.next()),z=z.replace(m.allLineBreaks,`
|
|
`),this._create_token(w.STRING,z)}return null},T.prototype._allow_regexp_or_xml=function(R){return R.type===w.RESERVED&&L(R.text,["return","case","throw","else","do","typeof","yield"])||R.type===w.END_EXPR&&R.text===")"&&R.opened.previous.type===w.RESERVED&&L(R.opened.previous.text,["if","while","for"])||L(R.type,[w.COMMENT,w.START_EXPR,w.START_BLOCK,w.START,w.END_BLOCK,w.OPERATOR,w.EQUALS,w.EOF,w.SEMICOLON,w.COMMA])},T.prototype._read_regexp=function(R,z){if(R==="/"&&this._allow_regexp_or_xml(z)){for(var Y=this._input.next(),y=!1,v=!1;this._input.hasNext()&&(y||v||this._input.peek()!==R)&&!this._input.testChar(m.newline);)Y+=this._input.peek(),y?y=!1:(y=this._input.peek()==="\\",this._input.peek()==="["?v=!0:this._input.peek()==="]"&&(v=!1)),this._input.next();return this._input.peek()===R&&(Y+=this._input.next(),Y+=this._input.read(m.identifier)),this._create_token(w.STRING,Y)}return null},T.prototype._read_xml=function(R,z){if(this._options.e4x&&R==="<"&&this._allow_regexp_or_xml(z)){var Y="",y=this.__patterns.xml.read_match();if(y){for(var v=y[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),$=v.indexOf("{")===0,j=0;y;){var me=!!y[1],Se=y[2],Te=!!y[y.length-1]||Se.slice(0,8)==="![CDATA[";if(!Te&&(Se===v||$&&Se.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(me?--j:++j),Y+=y[0],j<=0)break;y=this.__patterns.xml.read_match()}return y||(Y+=this._input.match(/[\s\S]*/g)[0]),Y=Y.replace(m.allLineBreaks,`
|
|
`),this._create_token(w.STRING,Y)}}return null};function C(R){for(var z="",Y=0,y=new D(R),v=null;y.hasNext();)if(v=y.match(/([\s]|[^\\]|\\\\)+/g),v&&(z+=v[0]),y.peek()==="\\"){if(y.next(),y.peek()==="x")v=y.match(/x([0-9A-Fa-f]{2})/g);else if(y.peek()==="u")v=y.match(/u([0-9A-Fa-f]{4})/g),v||(v=y.match(/u\{([0-9A-Fa-f]+)\}/g));else{z+="\\",y.hasNext()&&(z+=y.next());continue}if(!v||(Y=parseInt(v[1],16),Y>126&&Y<=255&&v[0].indexOf("x")===0))return R;Y>=0&&Y<32||Y>1114111?z+="\\"+v[0]:Y===34||Y===39||Y===92?z+="\\"+String.fromCharCode(Y):z+=String.fromCharCode(Y)}return z}T.prototype._read_string_recursive=function(R,z,Y){var y,v;R==="'"?v=this.__patterns.single_quote:R==='"'?v=this.__patterns.double_quote:R==="`"?v=this.__patterns.template_text:R==="}"&&(v=this.__patterns.template_expression);for(var $=v.read(),j="";this._input.hasNext();){if(j=this._input.next(),j===R||!z&&m.newline.test(j)){this._input.back();break}else j==="\\"&&this._input.hasNext()?(y=this._input.peek(),y==="x"||y==="u"?this.has_char_escapes=!0:y==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),j+=this._input.next()):Y&&(Y==="${"&&j==="$"&&this._input.peek()==="{"&&(j+=this._input.next()),Y===j&&(R==="`"?j+=this._read_string_recursive("}",z,"`"):j+=this._read_string_recursive("`",z,"${"),this._input.hasNext()&&(j+=this._input.next())));j+=v.read(),$+=j}return $},le.exports.Tokenizer=T,le.exports.TOKEN=w,le.exports.positionable_operators=te.slice(),le.exports.line_starters=we.slice()},function(le){var o=RegExp.prototype.hasOwnProperty("sticky");function K(D){this.__input=D||"",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 D=null;return this.hasNext()&&(D=this.__input.charAt(this.__position),this.__position+=1),D},K.prototype.peek=function(D){var f=null;return D=D||0,D+=this.__position,D>=0&&D<this.__input_length&&(f=this.__input.charAt(D)),f},K.prototype.__match=function(D,f){D.lastIndex=f;var u=D.exec(this.__input);return u&&!(o&&D.sticky)&&u.index!==f&&(u=null),u},K.prototype.test=function(D,f){return f=f||0,f+=this.__position,f>=0&&f<this.__input_length?!!this.__match(D,f):!1},K.prototype.testChar=function(D,f){var u=this.peek(f);return D.lastIndex=0,u!==null&&D.test(u)},K.prototype.match=function(D){var f=this.__match(D,this.__position);return f?this.__position+=f[0].length:f=null,f},K.prototype.read=function(D,f,u){var g="",m;return D&&(m=this.match(D),m&&(g+=m[0])),f&&(m||!D)&&(g+=this.readUntil(f,u)),g},K.prototype.readUntil=function(D,f){var u="",g=this.__position;D.lastIndex=this.__position;var m=D.exec(this.__input);return m?(g=m.index,f&&(g+=m[0].length)):g=this.__input_length,u=this.__input.substring(this.__position,g),this.__position=g,u},K.prototype.readUntilAfter=function(D){return this.readUntil(D,!0)},K.prototype.get_regexp=function(D,f){var u=null,g="g";return f&&o&&(g="y"),typeof D=="string"&&D!==""?u=new RegExp(D,g):D&&(u=new RegExp(D.source,g)),u},K.prototype.get_literal_regexp=function(D){return RegExp(D.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},K.prototype.peekUntilAfter=function(D){var f=this.__position,u=this.readUntilAfter(D);return this.__position=f,u},K.prototype.lookBack=function(D){var f=this.__position-1;return f>=D.length&&this.__input.substring(f-D.length,f).toLowerCase()===D},le.exports.InputScanner=K},function(le,o,K){var D=K(8).InputScanner,f=K(3).Token,u=K(10).TokenStream,g=K(11).WhitespacePattern,m={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},I=function(H,L){this._input=new D(H),this._options=L||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new g(this._input)};I.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var H,L=new f(m.START,""),w=null,O=[],A=new u;L.type!==m.EOF;){for(H=this._get_next_token(L,w);this._is_comment(H);)A.add(H),H=this._get_next_token(L,w);A.isEmpty()||(H.comments_before=A,A=new u),H.parent=w,this._is_opening(H)?(O.push(w),w=H):w&&this._is_closing(H,w)&&(H.opened=w,w.closed=H,w=O.pop(),H.parent=w),H.previous=L,L.next=H,this.__tokens.add(H),L=H}return this.__tokens},I.prototype._is_first_token=function(){return this.__tokens.isEmpty()},I.prototype._reset=function(){},I.prototype._get_next_token=function(H,L){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(m.RAW,w):this._create_token(m.EOF,"")},I.prototype._is_comment=function(H){return!1},I.prototype._is_opening=function(H){return!1},I.prototype._is_closing=function(H,L){return!1},I.prototype._create_token=function(H,L){var w=new f(H,L,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},I.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},le.exports.Tokenizer=I,le.exports.TOKEN=m},function(le){function o(K){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=K}o.prototype.restart=function(){this.__position=0},o.prototype.isEmpty=function(){return this.__tokens_length===0},o.prototype.hasNext=function(){return this.__position<this.__tokens_length},o.prototype.next=function(){var K=null;return this.hasNext()&&(K=this.__tokens[this.__position],this.__position+=1),K},o.prototype.peek=function(K){var D=null;return K=K||0,K+=this.__position,K>=0&&K<this.__tokens_length&&(D=this.__tokens[K]),D},o.prototype.add=function(K){this.__parent_token&&(K.parent=this.__parent_token),this.__tokens.push(K),this.__tokens_length+=1},le.exports.TokenStream=o},function(le,o,K){var D=K(12).Pattern;function f(u,g){D.call(this,u,g),g?this._line_regexp=this._input.get_regexp(g._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}f.prototype=new D,f.prototype.__set_whitespace_patterns=function(u,g){u+="\\t ",g+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+g+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+g+"]")},f.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var g=this.__split(this._newline_regexp,u);this.newline_count=g.length-1,this.whitespace_before_token=g[this.newline_count]}return u},f.prototype.matching=function(u,g){var m=this._create();return m.__set_whitespace_patterns(u,g),m._update(),m},f.prototype._create=function(){return new f(this._input,this)},f.prototype.__split=function(u,g){u.lastIndex=0;for(var m=0,I=[],H=u.exec(g);H;)I.push(g.substring(m,H.index)),m=H.index+H[0].length,H=u.exec(g);return m<g.length?I.push(g.substring(m,g.length)):I.push(""),I},le.exports.WhitespacePattern=f},function(le){function o(K,D){this._input=K,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,D&&(this._starting_pattern=this._input.get_regexp(D._starting_pattern,!0),this._match_pattern=this._input.get_regexp(D._match_pattern,!0),this._until_pattern=this._input.get_regexp(D._until_pattern),this._until_after=D._until_after)}o.prototype.read=function(){var 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},o.prototype.read_match=function(){return this._input.match(this._match_pattern)},o.prototype.until_after=function(K){var D=this._create();return D._until_after=!0,D._until_pattern=this._input.get_regexp(K),D._update(),D},o.prototype.until=function(K){var D=this._create();return D._until_after=!1,D._until_pattern=this._input.get_regexp(K),D._update(),D},o.prototype.starting_with=function(K){var D=this._create();return D._starting_pattern=this._input.get_regexp(K,!0),D._update(),D},o.prototype.matching=function(K){var D=this._create();return D._match_pattern=this._input.get_regexp(K,!0),D._update(),D},o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){},le.exports.Pattern=o},function(le){function o(K,D){K=typeof K=="string"?K:K.source,D=typeof D=="string"?D:D.source,this.__directives_block_pattern=new RegExp(K+/ beautify( \w+[:]\w+)+ /.source+D,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(K+/\sbeautify\signore:end\s/.source+D,"g")}o.prototype.get_directives=function(K){if(!K.match(this.__directives_block_pattern))return null;var D={};this.__directive_pattern.lastIndex=0;for(var f=this.__directive_pattern.exec(K);f;)D[f[1]]=f[2],f=this.__directive_pattern.exec(K);return D},o.prototype.readIgnored=function(K){return K.readUntilAfter(this.__directives_end_ignore_pattern)},le.exports.Directives=o},function(le,o,K){var D=K(12).Pattern,f={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function u(g,m){D.call(this,g,m),this.__template_pattern=null,this._disabled=Object.assign({},f),this._excluded=Object.assign({},f),m&&(this.__template_pattern=this._input.get_regexp(m.__template_pattern),this._excluded=Object.assign(this._excluded,m._excluded),this._disabled=Object.assign(this._disabled,m._disabled));var I=new D(g);this.__patterns={handlebars_comment:I.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:I.starting_with(/{{{/).until_after(/}}}/),handlebars:I.starting_with(/{{/).until_after(/}}/),php:I.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:I.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:I.starting_with(/{%/).until_after(/%}/),django_value:I.starting_with(/{{/).until_after(/}}/),django_comment:I.starting_with(/{#/).until_after(/#}/),smarty:I.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:I.starting_with(/{\*/).until_after(/\*}/),smarty_literal:I.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new D,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(g){var m=this._create();return m._disabled[g]=!0,m._update(),m},u.prototype.read_options=function(g){var m=this._create();for(var I in f)m._disabled[I]=g.templating.indexOf(I)===-1;return m._update(),m},u.prototype.exclude=function(g){var m=this._create();return m._excluded[g]=!0,m._update(),m},u.prototype.read=function(){var g="";this._match_pattern?g=this._input.read(this._starting_pattern):g=this._input.read(this._starting_pattern,this.__template_pattern);for(var m=this._read_template();m;)this._match_pattern?m+=this._input.read(this._match_pattern):m+=this._input.readUntil(this.__template_pattern),g+=m,m=this._read_template();return this._until_after&&(g+=this._input.readUntilAfter(this._until_pattern)),g},u.prototype.__set_templated_pattern=function(){var g=[];this._disabled.php||g.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||g.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||g.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||g.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(g.push(this.__patterns.django._starting_pattern.source),g.push(this.__patterns.django_value._starting_pattern.source),g.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||g.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&g.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+g.join("|")+")")},u.prototype._read_template=function(){var g="",m=this._input.peek();if(m==="<"){var I=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&I==="?"&&(g=g||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&I==="%"&&(g=g||this.__patterns.erb.read())}else m==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(g=g||this.__patterns.handlebars_comment.read(),g=g||this.__patterns.handlebars_unescaped.read(),g=g||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(g=g||this.__patterns.django_value.read()),this._excluded.django||(g=g||this.__patterns.django_comment.read(),g=g||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(g=g||this.__patterns.smarty_comment.read(),g=g||this.__patterns.smarty_literal.read(),g=g||this.__patterns.smarty.read()));return g},le.exports.TemplatablePattern=u}],oe={};function Z(le){var o=oe[le];if(o!==void 0)return o.exports;var K=oe[le]={exports:{}};return fe[le](K,K.exports,Z),K.exports}var _e=Z(0);q=_e})();var ve=q;b=[],B=function(){return{js_beautify:ve}}.apply(ke,b),B!==void 0&&(bt.exports=B)})()},75918:function(bt,ke,b){"use strict";b.d(ke,{Wi:function(){return Z},Z0:function(){return _e},aU:function(){return oe},eZ:function(){return o},wY:function(){return le}});var B=b(4348),q=b(69323),ve=b(13268),fe=function(K,D,f,u){function g(m){return m instanceof f?m:new f(function(I){I(m)})}return new(f||(f=Promise))(function(m,I){function H(O){try{w(u.next(O))}catch(A){I(A)}}function L(O){try{w(u.throw(O))}catch(A){I(A)}}function w(O){O.done?m(O.value):g(O.value).then(H,L)}w((u=u.apply(K,D||[])).next())})};class oe extends q.JT{constructor(D,f="",u="",g=!0,m){super(),this._onDidChange=this._register(new B.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=f,this._cssClass=u,this._enabled=g,this._actionCallback=m}get id(){return this._id}get label(){return this._label}set label(D){this._setLabel(D)}_setLabel(D){this._label!==D&&(this._label=D,this._onDidChange.fire({label:D}))}get tooltip(){return this._tooltip||""}set tooltip(D){this._setTooltip(D)}_setTooltip(D){this._tooltip!==D&&(this._tooltip=D,this._onDidChange.fire({tooltip:D}))}get class(){return this._cssClass}set class(D){this._setClass(D)}_setClass(D){this._cssClass!==D&&(this._cssClass=D,this._onDidChange.fire({class:D}))}get enabled(){return this._enabled}set enabled(D){this._setEnabled(D)}_setEnabled(D){this._enabled!==D&&(this._enabled=D,this._onDidChange.fire({enabled:D}))}get checked(){return this._checked}set checked(D){this._setChecked(D)}_setChecked(D){this._checked!==D&&(this._checked=D,this._onDidChange.fire({checked:D}))}run(D,f){return fe(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class Z extends q.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new B.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new B.Q5),this.onDidRun=this._onDidRun.event}run(D,f){return fe(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let u;try{yield this.runAction(D,f)}catch(g){u=g}this._onDidRun.fire({action:D,error:u})})}runAction(D,f){return fe(this,void 0,void 0,function*(){yield D.run(f)})}}class _e extends oe{constructor(D){super(_e.ID,D,D?"separator text":"separator"),this.checked=!1,this.enabled=!1}}_e.ID="vs.actions.separator";class le{constructor(D,f,u,g){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=f,this.class=g,this._actions=u}get actions(){return this._actions}dispose(){}run(){return fe(this,void 0,void 0,function*(){})}}class o extends oe{constructor(){super(o.ID,ve.N("submenu.empty","(empty)"),void 0,!1)}}o.ID="vs.actions.empty"},76068:function(bt,ke,b){"use strict";b.d(ke,{ok:function(){return B}});function B(q,ve){if(!q)throw new Error(ve?`Assertion failed (${ve})`:"Assertion Failed")}},52615:function(bt,ke,b){"use strict";b.d(ke,{CM:function(){return oe},JL:function(){return Z},dT:function(){return le},fK:function(){return fe},lA:function(){return _e}});var B=b(4348);class q{constructor(){this._icons=new Map,this._onDidRegister=new B.Q5}add(K){const D=this._icons.get(K.id);D?K.description?D.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 ve=new q,fe=ve;function oe(o,K){return new _e(o,K)}function Z(o){return o?o.replace(/\$\((.*?)\)/g,(K,D)=>` ${D} `).trim():""}class _e{constructor(K,D,f){this.id=K,this.definition=D,this.description=f,ve.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var le;(function(o){o.iconNameSegment="[A-Za-z0-9]+",o.iconNameExpression="[A-Za-z0-9\\-]+",o.iconModifierExpression="~[A-Za-z]+";const K=new RegExp(`^(${o.iconNameExpression})(${o.iconModifierExpression})?$`);function D(g){if(g instanceof _e)return["codicon","codicon-"+g.id];const m=K.exec(g.id);if(!m)return D(_e.error);let[,I,H]=m;const L=["codicon","codicon-"+I];return H&&L.push("codicon-modifier-"+H.substr(1)),L}o.asClassNameArray=D;function f(g){return D(g).join(" ")}o.asClassName=f;function u(g){return"."+D(g).join(".")}o.asCSSSelector=u})(le||(le={})),function(o){o.add=new o("add",{fontCharacter:"\\ea60"}),o.plus=new o("plus",o.add.definition),o.gistNew=new o("gist-new",o.add.definition),o.repoCreate=new o("repo-create",o.add.definition),o.lightbulb=new o("lightbulb",{fontCharacter:"\\ea61"}),o.lightBulb=new o("light-bulb",{fontCharacter:"\\ea61"}),o.repo=new o("repo",{fontCharacter:"\\ea62"}),o.repoDelete=new o("repo-delete",{fontCharacter:"\\ea62"}),o.gistFork=new o("gist-fork",{fontCharacter:"\\ea63"}),o.repoForked=new o("repo-forked",{fontCharacter:"\\ea63"}),o.gitPullRequest=new o("git-pull-request",{fontCharacter:"\\ea64"}),o.gitPullRequestAbandoned=new o("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),o.recordKeys=new o("record-keys",{fontCharacter:"\\ea65"}),o.keyboard=new o("keyboard",{fontCharacter:"\\ea65"}),o.tag=new o("tag",{fontCharacter:"\\ea66"}),o.tagAdd=new o("tag-add",{fontCharacter:"\\ea66"}),o.tagRemove=new o("tag-remove",{fontCharacter:"\\ea66"}),o.person=new o("person",{fontCharacter:"\\ea67"}),o.personFollow=new o("person-follow",{fontCharacter:"\\ea67"}),o.personOutline=new o("person-outline",{fontCharacter:"\\ea67"}),o.personFilled=new o("person-filled",{fontCharacter:"\\ea67"}),o.gitBranch=new o("git-branch",{fontCharacter:"\\ea68"}),o.gitBranchCreate=new o("git-branch-create",{fontCharacter:"\\ea68"}),o.gitBranchDelete=new o("git-branch-delete",{fontCharacter:"\\ea68"}),o.sourceControl=new o("source-control",{fontCharacter:"\\ea68"}),o.mirror=new o("mirror",{fontCharacter:"\\ea69"}),o.mirrorPublic=new o("mirror-public",{fontCharacter:"\\ea69"}),o.star=new o("star",{fontCharacter:"\\ea6a"}),o.starAdd=new o("star-add",{fontCharacter:"\\ea6a"}),o.starDelete=new o("star-delete",{fontCharacter:"\\ea6a"}),o.starEmpty=new o("star-empty",{fontCharacter:"\\ea6a"}),o.comment=new o("comment",{fontCharacter:"\\ea6b"}),o.commentAdd=new o("comment-add",{fontCharacter:"\\ea6b"}),o.alert=new o("alert",{fontCharacter:"\\ea6c"}),o.warning=new o("warning",{fontCharacter:"\\ea6c"}),o.search=new o("search",{fontCharacter:"\\ea6d"}),o.searchSave=new o("search-save",{fontCharacter:"\\ea6d"}),o.logOut=new o("log-out",{fontCharacter:"\\ea6e"}),o.signOut=new o("sign-out",{fontCharacter:"\\ea6e"}),o.logIn=new o("log-in",{fontCharacter:"\\ea6f"}),o.signIn=new o("sign-in",{fontCharacter:"\\ea6f"}),o.eye=new o("eye",{fontCharacter:"\\ea70"}),o.eyeUnwatch=new o("eye-unwatch",{fontCharacter:"\\ea70"}),o.eyeWatch=new o("eye-watch",{fontCharacter:"\\ea70"}),o.circleFilled=new o("circle-filled",{fontCharacter:"\\ea71"}),o.primitiveDot=new o("primitive-dot",{fontCharacter:"\\ea71"}),o.closeDirty=new o("close-dirty",{fontCharacter:"\\ea71"}),o.debugBreakpoint=new o("debug-breakpoint",{fontCharacter:"\\ea71"}),o.debugBreakpointDisabled=new o("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),o.debugHint=new o("debug-hint",{fontCharacter:"\\ea71"}),o.primitiveSquare=new o("primitive-square",{fontCharacter:"\\ea72"}),o.edit=new o("edit",{fontCharacter:"\\ea73"}),o.pencil=new o("pencil",{fontCharacter:"\\ea73"}),o.info=new o("info",{fontCharacter:"\\ea74"}),o.issueOpened=new o("issue-opened",{fontCharacter:"\\ea74"}),o.gistPrivate=new o("gist-private",{fontCharacter:"\\ea75"}),o.gitForkPrivate=new o("git-fork-private",{fontCharacter:"\\ea75"}),o.lock=new o("lock",{fontCharacter:"\\ea75"}),o.mirrorPrivate=new o("mirror-private",{fontCharacter:"\\ea75"}),o.close=new o("close",{fontCharacter:"\\ea76"}),o.removeClose=new o("remove-close",{fontCharacter:"\\ea76"}),o.x=new o("x",{fontCharacter:"\\ea76"}),o.repoSync=new o("repo-sync",{fontCharacter:"\\ea77"}),o.sync=new o("sync",{fontCharacter:"\\ea77"}),o.clone=new o("clone",{fontCharacter:"\\ea78"}),o.desktopDownload=new o("desktop-download",{fontCharacter:"\\ea78"}),o.beaker=new o("beaker",{fontCharacter:"\\ea79"}),o.microscope=new o("microscope",{fontCharacter:"\\ea79"}),o.vm=new o("vm",{fontCharacter:"\\ea7a"}),o.deviceDesktop=new o("device-desktop",{fontCharacter:"\\ea7a"}),o.file=new o("file",{fontCharacter:"\\ea7b"}),o.fileText=new o("file-text",{fontCharacter:"\\ea7b"}),o.more=new o("more",{fontCharacter:"\\ea7c"}),o.ellipsis=new o("ellipsis",{fontCharacter:"\\ea7c"}),o.kebabHorizontal=new o("kebab-horizontal",{fontCharacter:"\\ea7c"}),o.mailReply=new o("mail-reply",{fontCharacter:"\\ea7d"}),o.reply=new o("reply",{fontCharacter:"\\ea7d"}),o.organization=new o("organization",{fontCharacter:"\\ea7e"}),o.organizationFilled=new o("organization-filled",{fontCharacter:"\\ea7e"}),o.organizationOutline=new o("organization-outline",{fontCharacter:"\\ea7e"}),o.newFile=new o("new-file",{fontCharacter:"\\ea7f"}),o.fileAdd=new o("file-add",{fontCharacter:"\\ea7f"}),o.newFolder=new o("new-folder",{fontCharacter:"\\ea80"}),o.fileDirectoryCreate=new o("file-directory-create",{fontCharacter:"\\ea80"}),o.trash=new o("trash",{fontCharacter:"\\ea81"}),o.trashcan=new o("trashcan",{fontCharacter:"\\ea81"}),o.history=new o("history",{fontCharacter:"\\ea82"}),o.clock=new o("clock",{fontCharacter:"\\ea82"}),o.folder=new o("folder",{fontCharacter:"\\ea83"}),o.fileDirectory=new o("file-directory",{fontCharacter:"\\ea83"}),o.symbolFolder=new o("symbol-folder",{fontCharacter:"\\ea83"}),o.logoGithub=new o("logo-github",{fontCharacter:"\\ea84"}),o.markGithub=new o("mark-github",{fontCharacter:"\\ea84"}),o.github=new o("github",{fontCharacter:"\\ea84"}),o.terminal=new o("terminal",{fontCharacter:"\\ea85"}),o.console=new o("console",{fontCharacter:"\\ea85"}),o.repl=new o("repl",{fontCharacter:"\\ea85"}),o.zap=new o("zap",{fontCharacter:"\\ea86"}),o.symbolEvent=new o("symbol-event",{fontCharacter:"\\ea86"}),o.error=new o("error",{fontCharacter:"\\ea87"}),o.stop=new o("stop",{fontCharacter:"\\ea87"}),o.variable=new o("variable",{fontCharacter:"\\ea88"}),o.symbolVariable=new o("symbol-variable",{fontCharacter:"\\ea88"}),o.array=new o("array",{fontCharacter:"\\ea8a"}),o.symbolArray=new o("symbol-array",{fontCharacter:"\\ea8a"}),o.symbolModule=new o("symbol-module",{fontCharacter:"\\ea8b"}),o.symbolPackage=new o("symbol-package",{fontCharacter:"\\ea8b"}),o.symbolNamespace=new o("symbol-namespace",{fontCharacter:"\\ea8b"}),o.symbolObject=new o("symbol-object",{fontCharacter:"\\ea8b"}),o.symbolMethod=new o("symbol-method",{fontCharacter:"\\ea8c"}),o.symbolFunction=new o("symbol-function",{fontCharacter:"\\ea8c"}),o.symbolConstructor=new o("symbol-constructor",{fontCharacter:"\\ea8c"}),o.symbolBoolean=new o("symbol-boolean",{fontCharacter:"\\ea8f"}),o.symbolNull=new o("symbol-null",{fontCharacter:"\\ea8f"}),o.symbolNumeric=new o("symbol-numeric",{fontCharacter:"\\ea90"}),o.symbolNumber=new o("symbol-number",{fontCharacter:"\\ea90"}),o.symbolStructure=new o("symbol-structure",{fontCharacter:"\\ea91"}),o.symbolStruct=new o("symbol-struct",{fontCharacter:"\\ea91"}),o.symbolParameter=new o("symbol-parameter",{fontCharacter:"\\ea92"}),o.symbolTypeParameter=new o("symbol-type-parameter",{fontCharacter:"\\ea92"}),o.symbolKey=new o("symbol-key",{fontCharacter:"\\ea93"}),o.symbolText=new o("symbol-text",{fontCharacter:"\\ea93"}),o.symbolReference=new o("symbol-reference",{fontCharacter:"\\ea94"}),o.goToFile=new o("go-to-file",{fontCharacter:"\\ea94"}),o.symbolEnum=new o("symbol-enum",{fontCharacter:"\\ea95"}),o.symbolValue=new o("symbol-value",{fontCharacter:"\\ea95"}),o.symbolRuler=new o("symbol-ruler",{fontCharacter:"\\ea96"}),o.symbolUnit=new o("symbol-unit",{fontCharacter:"\\ea96"}),o.activateBreakpoints=new o("activate-breakpoints",{fontCharacter:"\\ea97"}),o.archive=new o("archive",{fontCharacter:"\\ea98"}),o.arrowBoth=new o("arrow-both",{fontCharacter:"\\ea99"}),o.arrowDown=new o("arrow-down",{fontCharacter:"\\ea9a"}),o.arrowLeft=new o("arrow-left",{fontCharacter:"\\ea9b"}),o.arrowRight=new o("arrow-right",{fontCharacter:"\\ea9c"}),o.arrowSmallDown=new o("arrow-small-down",{fontCharacter:"\\ea9d"}),o.arrowSmallLeft=new o("arrow-small-left",{fontCharacter:"\\ea9e"}),o.arrowSmallRight=new o("arrow-small-right",{fontCharacter:"\\ea9f"}),o.arrowSmallUp=new o("arrow-small-up",{fontCharacter:"\\eaa0"}),o.arrowUp=new o("arrow-up",{fontCharacter:"\\eaa1"}),o.bell=new o("bell",{fontCharacter:"\\eaa2"}),o.bold=new o("bold",{fontCharacter:"\\eaa3"}),o.book=new o("book",{fontCharacter:"\\eaa4"}),o.bookmark=new o("bookmark",{fontCharacter:"\\eaa5"}),o.debugBreakpointConditionalUnverified=new o("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),o.debugBreakpointConditional=new o("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),o.debugBreakpointConditionalDisabled=new o("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),o.debugBreakpointDataUnverified=new o("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),o.debugBreakpointData=new o("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),o.debugBreakpointDataDisabled=new o("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),o.debugBreakpointLogUnverified=new o("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),o.debugBreakpointLog=new o("debug-breakpoint-log",{fontCharacter:"\\eaab"}),o.debugBreakpointLogDisabled=new o("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),o.briefcase=new o("briefcase",{fontCharacter:"\\eaac"}),o.broadcast=new o("broadcast",{fontCharacter:"\\eaad"}),o.browser=new o("browser",{fontCharacter:"\\eaae"}),o.bug=new o("bug",{fontCharacter:"\\eaaf"}),o.calendar=new o("calendar",{fontCharacter:"\\eab0"}),o.caseSensitive=new o("case-sensitive",{fontCharacter:"\\eab1"}),o.check=new o("check",{fontCharacter:"\\eab2"}),o.checklist=new o("checklist",{fontCharacter:"\\eab3"}),o.chevronDown=new o("chevron-down",{fontCharacter:"\\eab4"}),o.dropDownButton=new o("drop-down-button",o.chevronDown.definition),o.chevronLeft=new o("chevron-left",{fontCharacter:"\\eab5"}),o.chevronRight=new o("chevron-right",{fontCharacter:"\\eab6"}),o.chevronUp=new o("chevron-up",{fontCharacter:"\\eab7"}),o.chromeClose=new o("chrome-close",{fontCharacter:"\\eab8"}),o.chromeMaximize=new o("chrome-maximize",{fontCharacter:"\\eab9"}),o.chromeMinimize=new o("chrome-minimize",{fontCharacter:"\\eaba"}),o.chromeRestore=new o("chrome-restore",{fontCharacter:"\\eabb"}),o.circleOutline=new o("circle-outline",{fontCharacter:"\\eabc"}),o.debugBreakpointUnverified=new o("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),o.circleSlash=new o("circle-slash",{fontCharacter:"\\eabd"}),o.circuitBoard=new o("circuit-board",{fontCharacter:"\\eabe"}),o.clearAll=new o("clear-all",{fontCharacter:"\\eabf"}),o.clippy=new o("clippy",{fontCharacter:"\\eac0"}),o.closeAll=new o("close-all",{fontCharacter:"\\eac1"}),o.cloudDownload=new o("cloud-download",{fontCharacter:"\\eac2"}),o.cloudUpload=new o("cloud-upload",{fontCharacter:"\\eac3"}),o.code=new o("code",{fontCharacter:"\\eac4"}),o.collapseAll=new o("collapse-all",{fontCharacter:"\\eac5"}),o.colorMode=new o("color-mode",{fontCharacter:"\\eac6"}),o.commentDiscussion=new o("comment-discussion",{fontCharacter:"\\eac7"}),o.compareChanges=new o("compare-changes",{fontCharacter:"\\eafd"}),o.creditCard=new o("credit-card",{fontCharacter:"\\eac9"}),o.dash=new o("dash",{fontCharacter:"\\eacc"}),o.dashboard=new o("dashboard",{fontCharacter:"\\eacd"}),o.database=new o("database",{fontCharacter:"\\eace"}),o.debugContinue=new o("debug-continue",{fontCharacter:"\\eacf"}),o.debugDisconnect=new o("debug-disconnect",{fontCharacter:"\\ead0"}),o.debugPause=new o("debug-pause",{fontCharacter:"\\ead1"}),o.debugRestart=new o("debug-restart",{fontCharacter:"\\ead2"}),o.debugStart=new o("debug-start",{fontCharacter:"\\ead3"}),o.debugStepInto=new o("debug-step-into",{fontCharacter:"\\ead4"}),o.debugStepOut=new o("debug-step-out",{fontCharacter:"\\ead5"}),o.debugStepOver=new o("debug-step-over",{fontCharacter:"\\ead6"}),o.debugStop=new o("debug-stop",{fontCharacter:"\\ead7"}),o.debug=new o("debug",{fontCharacter:"\\ead8"}),o.deviceCameraVideo=new o("device-camera-video",{fontCharacter:"\\ead9"}),o.deviceCamera=new o("device-camera",{fontCharacter:"\\eada"}),o.deviceMobile=new o("device-mobile",{fontCharacter:"\\eadb"}),o.diffAdded=new o("diff-added",{fontCharacter:"\\eadc"}),o.diffIgnored=new o("diff-ignored",{fontCharacter:"\\eadd"}),o.diffModified=new o("diff-modified",{fontCharacter:"\\eade"}),o.diffRemoved=new o("diff-removed",{fontCharacter:"\\eadf"}),o.diffRenamed=new o("diff-renamed",{fontCharacter:"\\eae0"}),o.diff=new o("diff",{fontCharacter:"\\eae1"}),o.discard=new o("discard",{fontCharacter:"\\eae2"}),o.editorLayout=new o("editor-layout",{fontCharacter:"\\eae3"}),o.emptyWindow=new o("empty-window",{fontCharacter:"\\eae4"}),o.exclude=new o("exclude",{fontCharacter:"\\eae5"}),o.extensions=new o("extensions",{fontCharacter:"\\eae6"}),o.eyeClosed=new o("eye-closed",{fontCharacter:"\\eae7"}),o.fileBinary=new o("file-binary",{fontCharacter:"\\eae8"}),o.fileCode=new o("file-code",{fontCharacter:"\\eae9"}),o.fileMedia=new o("file-media",{fontCharacter:"\\eaea"}),o.filePdf=new o("file-pdf",{fontCharacter:"\\eaeb"}),o.fileSubmodule=new o("file-submodule",{fontCharacter:"\\eaec"}),o.fileSymlinkDirectory=new o("file-symlink-directory",{fontCharacter:"\\eaed"}),o.fileSymlinkFile=new o("file-symlink-file",{fontCharacter:"\\eaee"}),o.fileZip=new o("file-zip",{fontCharacter:"\\eaef"}),o.files=new o("files",{fontCharacter:"\\eaf0"}),o.filter=new o("filter",{fontCharacter:"\\eaf1"}),o.flame=new o("flame",{fontCharacter:"\\eaf2"}),o.foldDown=new o("fold-down",{fontCharacter:"\\eaf3"}),o.foldUp=new o("fold-up",{fontCharacter:"\\eaf4"}),o.fold=new o("fold",{fontCharacter:"\\eaf5"}),o.folderActive=new o("folder-active",{fontCharacter:"\\eaf6"}),o.folderOpened=new o("folder-opened",{fontCharacter:"\\eaf7"}),o.gear=new o("gear",{fontCharacter:"\\eaf8"}),o.gift=new o("gift",{fontCharacter:"\\eaf9"}),o.gistSecret=new o("gist-secret",{fontCharacter:"\\eafa"}),o.gist=new o("gist",{fontCharacter:"\\eafb"}),o.gitCommit=new o("git-commit",{fontCharacter:"\\eafc"}),o.gitCompare=new o("git-compare",{fontCharacter:"\\eafd"}),o.gitMerge=new o("git-merge",{fontCharacter:"\\eafe"}),o.githubAction=new o("github-action",{fontCharacter:"\\eaff"}),o.githubAlt=new o("github-alt",{fontCharacter:"\\eb00"}),o.globe=new o("globe",{fontCharacter:"\\eb01"}),o.grabber=new o("grabber",{fontCharacter:"\\eb02"}),o.graph=new o("graph",{fontCharacter:"\\eb03"}),o.gripper=new o("gripper",{fontCharacter:"\\eb04"}),o.heart=new o("heart",{fontCharacter:"\\eb05"}),o.home=new o("home",{fontCharacter:"\\eb06"}),o.horizontalRule=new o("horizontal-rule",{fontCharacter:"\\eb07"}),o.hubot=new o("hubot",{fontCharacter:"\\eb08"}),o.inbox=new o("inbox",{fontCharacter:"\\eb09"}),o.issueClosed=new o("issue-closed",{fontCharacter:"\\eba4"}),o.issueReopened=new o("issue-reopened",{fontCharacter:"\\eb0b"}),o.issues=new o("issues",{fontCharacter:"\\eb0c"}),o.italic=new o("italic",{fontCharacter:"\\eb0d"}),o.jersey=new o("jersey",{fontCharacter:"\\eb0e"}),o.json=new o("json",{fontCharacter:"\\eb0f"}),o.kebabVertical=new o("kebab-vertical",{fontCharacter:"\\eb10"}),o.key=new o("key",{fontCharacter:"\\eb11"}),o.law=new o("law",{fontCharacter:"\\eb12"}),o.lightbulbAutofix=new o("lightbulb-autofix",{fontCharacter:"\\eb13"}),o.linkExternal=new o("link-external",{fontCharacter:"\\eb14"}),o.link=new o("link",{fontCharacter:"\\eb15"}),o.listOrdered=new o("list-ordered",{fontCharacter:"\\eb16"}),o.listUnordered=new o("list-unordered",{fontCharacter:"\\eb17"}),o.liveShare=new o("live-share",{fontCharacter:"\\eb18"}),o.loading=new o("loading",{fontCharacter:"\\eb19"}),o.location=new o("location",{fontCharacter:"\\eb1a"}),o.mailRead=new o("mail-read",{fontCharacter:"\\eb1b"}),o.mail=new o("mail",{fontCharacter:"\\eb1c"}),o.markdown=new o("markdown",{fontCharacter:"\\eb1d"}),o.megaphone=new o("megaphone",{fontCharacter:"\\eb1e"}),o.mention=new o("mention",{fontCharacter:"\\eb1f"}),o.milestone=new o("milestone",{fontCharacter:"\\eb20"}),o.mortarBoard=new o("mortar-board",{fontCharacter:"\\eb21"}),o.move=new o("move",{fontCharacter:"\\eb22"}),o.multipleWindows=new o("multiple-windows",{fontCharacter:"\\eb23"}),o.mute=new o("mute",{fontCharacter:"\\eb24"}),o.noNewline=new o("no-newline",{fontCharacter:"\\eb25"}),o.note=new o("note",{fontCharacter:"\\eb26"}),o.octoface=new o("octoface",{fontCharacter:"\\eb27"}),o.openPreview=new o("open-preview",{fontCharacter:"\\eb28"}),o.package_=new o("package",{fontCharacter:"\\eb29"}),o.paintcan=new o("paintcan",{fontCharacter:"\\eb2a"}),o.pin=new o("pin",{fontCharacter:"\\eb2b"}),o.play=new o("play",{fontCharacter:"\\eb2c"}),o.run=new o("run",{fontCharacter:"\\eb2c"}),o.plug=new o("plug",{fontCharacter:"\\eb2d"}),o.preserveCase=new o("preserve-case",{fontCharacter:"\\eb2e"}),o.preview=new o("preview",{fontCharacter:"\\eb2f"}),o.project=new o("project",{fontCharacter:"\\eb30"}),o.pulse=new o("pulse",{fontCharacter:"\\eb31"}),o.question=new o("question",{fontCharacter:"\\eb32"}),o.quote=new o("quote",{fontCharacter:"\\eb33"}),o.radioTower=new o("radio-tower",{fontCharacter:"\\eb34"}),o.reactions=new o("reactions",{fontCharacter:"\\eb35"}),o.references=new o("references",{fontCharacter:"\\eb36"}),o.refresh=new o("refresh",{fontCharacter:"\\eb37"}),o.regex=new o("regex",{fontCharacter:"\\eb38"}),o.remoteExplorer=new o("remote-explorer",{fontCharacter:"\\eb39"}),o.remote=new o("remote",{fontCharacter:"\\eb3a"}),o.remove=new o("remove",{fontCharacter:"\\eb3b"}),o.replaceAll=new o("replace-all",{fontCharacter:"\\eb3c"}),o.replace=new o("replace",{fontCharacter:"\\eb3d"}),o.repoClone=new o("repo-clone",{fontCharacter:"\\eb3e"}),o.repoForcePush=new o("repo-force-push",{fontCharacter:"\\eb3f"}),o.repoPull=new o("repo-pull",{fontCharacter:"\\eb40"}),o.repoPush=new o("repo-push",{fontCharacter:"\\eb41"}),o.report=new o("report",{fontCharacter:"\\eb42"}),o.requestChanges=new o("request-changes",{fontCharacter:"\\eb43"}),o.rocket=new o("rocket",{fontCharacter:"\\eb44"}),o.rootFolderOpened=new o("root-folder-opened",{fontCharacter:"\\eb45"}),o.rootFolder=new o("root-folder",{fontCharacter:"\\eb46"}),o.rss=new o("rss",{fontCharacter:"\\eb47"}),o.ruby=new o("ruby",{fontCharacter:"\\eb48"}),o.saveAll=new o("save-all",{fontCharacter:"\\eb49"}),o.saveAs=new o("save-as",{fontCharacter:"\\eb4a"}),o.save=new o("save",{fontCharacter:"\\eb4b"}),o.screenFull=new o("screen-full",{fontCharacter:"\\eb4c"}),o.screenNormal=new o("screen-normal",{fontCharacter:"\\eb4d"}),o.searchStop=new o("search-stop",{fontCharacter:"\\eb4e"}),o.server=new o("server",{fontCharacter:"\\eb50"}),o.settingsGear=new o("settings-gear",{fontCharacter:"\\eb51"}),o.settings=new o("settings",{fontCharacter:"\\eb52"}),o.shield=new o("shield",{fontCharacter:"\\eb53"}),o.smiley=new o("smiley",{fontCharacter:"\\eb54"}),o.sortPrecedence=new o("sort-precedence",{fontCharacter:"\\eb55"}),o.splitHorizontal=new o("split-horizontal",{fontCharacter:"\\eb56"}),o.splitVertical=new o("split-vertical",{fontCharacter:"\\eb57"}),o.squirrel=new o("squirrel",{fontCharacter:"\\eb58"}),o.starFull=new o("star-full",{fontCharacter:"\\eb59"}),o.starHalf=new o("star-half",{fontCharacter:"\\eb5a"}),o.symbolClass=new o("symbol-class",{fontCharacter:"\\eb5b"}),o.symbolColor=new o("symbol-color",{fontCharacter:"\\eb5c"}),o.symbolConstant=new o("symbol-constant",{fontCharacter:"\\eb5d"}),o.symbolEnumMember=new o("symbol-enum-member",{fontCharacter:"\\eb5e"}),o.symbolField=new o("symbol-field",{fontCharacter:"\\eb5f"}),o.symbolFile=new o("symbol-file",{fontCharacter:"\\eb60"}),o.symbolInterface=new o("symbol-interface",{fontCharacter:"\\eb61"}),o.symbolKeyword=new o("symbol-keyword",{fontCharacter:"\\eb62"}),o.symbolMisc=new o("symbol-misc",{fontCharacter:"\\eb63"}),o.symbolOperator=new o("symbol-operator",{fontCharacter:"\\eb64"}),o.symbolProperty=new o("symbol-property",{fontCharacter:"\\eb65"}),o.wrench=new o("wrench",{fontCharacter:"\\eb65"}),o.wrenchSubaction=new o("wrench-subaction",{fontCharacter:"\\eb65"}),o.symbolSnippet=new o("symbol-snippet",{fontCharacter:"\\eb66"}),o.tasklist=new o("tasklist",{fontCharacter:"\\eb67"}),o.telescope=new o("telescope",{fontCharacter:"\\eb68"}),o.textSize=new o("text-size",{fontCharacter:"\\eb69"}),o.threeBars=new o("three-bars",{fontCharacter:"\\eb6a"}),o.thumbsdown=new o("thumbsdown",{fontCharacter:"\\eb6b"}),o.thumbsup=new o("thumbsup",{fontCharacter:"\\eb6c"}),o.tools=new o("tools",{fontCharacter:"\\eb6d"}),o.triangleDown=new o("triangle-down",{fontCharacter:"\\eb6e"}),o.triangleLeft=new o("triangle-left",{fontCharacter:"\\eb6f"}),o.triangleRight=new o("triangle-right",{fontCharacter:"\\eb70"}),o.triangleUp=new o("triangle-up",{fontCharacter:"\\eb71"}),o.twitter=new o("twitter",{fontCharacter:"\\eb72"}),o.unfold=new o("unfold",{fontCharacter:"\\eb73"}),o.unlock=new o("unlock",{fontCharacter:"\\eb74"}),o.unmute=new o("unmute",{fontCharacter:"\\eb75"}),o.unverified=new o("unverified",{fontCharacter:"\\eb76"}),o.verified=new o("verified",{fontCharacter:"\\eb77"}),o.versions=new o("versions",{fontCharacter:"\\eb78"}),o.vmActive=new o("vm-active",{fontCharacter:"\\eb79"}),o.vmOutline=new o("vm-outline",{fontCharacter:"\\eb7a"}),o.vmRunning=new o("vm-running",{fontCharacter:"\\eb7b"}),o.watch=new o("watch",{fontCharacter:"\\eb7c"}),o.whitespace=new o("whitespace",{fontCharacter:"\\eb7d"}),o.wholeWord=new o("whole-word",{fontCharacter:"\\eb7e"}),o.window=new o("window",{fontCharacter:"\\eb7f"}),o.wordWrap=new o("word-wrap",{fontCharacter:"\\eb80"}),o.zoomIn=new o("zoom-in",{fontCharacter:"\\eb81"}),o.zoomOut=new o("zoom-out",{fontCharacter:"\\eb82"}),o.listFilter=new o("list-filter",{fontCharacter:"\\eb83"}),o.listFlat=new o("list-flat",{fontCharacter:"\\eb84"}),o.listSelection=new o("list-selection",{fontCharacter:"\\eb85"}),o.selection=new o("selection",{fontCharacter:"\\eb85"}),o.listTree=new o("list-tree",{fontCharacter:"\\eb86"}),o.debugBreakpointFunctionUnverified=new o("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),o.debugBreakpointFunction=new o("debug-breakpoint-function",{fontCharacter:"\\eb88"}),o.debugBreakpointFunctionDisabled=new o("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),o.debugStackframeActive=new o("debug-stackframe-active",{fontCharacter:"\\eb89"}),o.debugStackframeDot=new o("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),o.debugStackframe=new o("debug-stackframe",{fontCharacter:"\\eb8b"}),o.debugStackframeFocused=new o("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),o.debugBreakpointUnsupported=new o("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),o.symbolString=new o("symbol-string",{fontCharacter:"\\eb8d"}),o.debugReverseContinue=new o("debug-reverse-continue",{fontCharacter:"\\eb8e"}),o.debugStepBack=new o("debug-step-back",{fontCharacter:"\\eb8f"}),o.debugRestartFrame=new o("debug-restart-frame",{fontCharacter:"\\eb90"}),o.callIncoming=new o("call-incoming",{fontCharacter:"\\eb92"}),o.callOutgoing=new o("call-outgoing",{fontCharacter:"\\eb93"}),o.menu=new o("menu",{fontCharacter:"\\eb94"}),o.expandAll=new o("expand-all",{fontCharacter:"\\eb95"}),o.feedback=new o("feedback",{fontCharacter:"\\eb96"}),o.groupByRefType=new o("group-by-ref-type",{fontCharacter:"\\eb97"}),o.ungroupByRefType=new o("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),o.account=new o("account",{fontCharacter:"\\eb99"}),o.bellDot=new o("bell-dot",{fontCharacter:"\\eb9a"}),o.debugConsole=new o("debug-console",{fontCharacter:"\\eb9b"}),o.library=new o("library",{fontCharacter:"\\eb9c"}),o.output=new o("output",{fontCharacter:"\\eb9d"}),o.runAll=new o("run-all",{fontCharacter:"\\eb9e"}),o.syncIgnored=new o("sync-ignored",{fontCharacter:"\\eb9f"}),o.pinned=new o("pinned",{fontCharacter:"\\eba0"}),o.githubInverted=new o("github-inverted",{fontCharacter:"\\eba1"}),o.debugAlt=new o("debug-alt",{fontCharacter:"\\eb91"}),o.serverProcess=new o("server-process",{fontCharacter:"\\eba2"}),o.serverEnvironment=new o("server-environment",{fontCharacter:"\\eba3"}),o.pass=new o("pass",{fontCharacter:"\\eba4"}),o.stopCircle=new o("stop-circle",{fontCharacter:"\\eba5"}),o.playCircle=new o("play-circle",{fontCharacter:"\\eba6"}),o.record=new o("record",{fontCharacter:"\\eba7"}),o.debugAltSmall=new o("debug-alt-small",{fontCharacter:"\\eba8"}),o.vmConnect=new o("vm-connect",{fontCharacter:"\\eba9"}),o.cloud=new o("cloud",{fontCharacter:"\\ebaa"}),o.merge=new o("merge",{fontCharacter:"\\ebab"}),o.exportIcon=new o("export",{fontCharacter:"\\ebac"}),o.graphLeft=new o("graph-left",{fontCharacter:"\\ebad"}),o.magnet=new o("magnet",{fontCharacter:"\\ebae"}),o.notebook=new o("notebook",{fontCharacter:"\\ebaf"}),o.redo=new o("redo",{fontCharacter:"\\ebb0"}),o.checkAll=new o("check-all",{fontCharacter:"\\ebb1"}),o.pinnedDirty=new o("pinned-dirty",{fontCharacter:"\\ebb2"}),o.passFilled=new o("pass-filled",{fontCharacter:"\\ebb3"}),o.circleLargeFilled=new o("circle-large-filled",{fontCharacter:"\\ebb4"}),o.circleLargeOutline=new o("circle-large-outline",{fontCharacter:"\\ebb5"}),o.combine=new o("combine",{fontCharacter:"\\ebb6"}),o.gather=new o("gather",{fontCharacter:"\\ebb6"}),o.table=new o("table",{fontCharacter:"\\ebb7"}),o.variableGroup=new o("variable-group",{fontCharacter:"\\ebb8"}),o.typeHierarchy=new o("type-hierarchy",{fontCharacter:"\\ebb9"}),o.typeHierarchySub=new o("type-hierarchy-sub",{fontCharacter:"\\ebba"}),o.typeHierarchySuper=new o("type-hierarchy-super",{fontCharacter:"\\ebbb"}),o.gitPullRequestCreate=new o("git-pull-request-create",{fontCharacter:"\\ebbc"}),o.runAbove=new o("run-above",{fontCharacter:"\\ebbd"}),o.runBelow=new o("run-below",{fontCharacter:"\\ebbe"}),o.notebookTemplate=new o("notebook-template",{fontCharacter:"\\ebbf"}),o.debugRerun=new o("debug-rerun",{fontCharacter:"\\ebc0"}),o.workspaceTrusted=new o("workspace-trusted",{fontCharacter:"\\ebc1"}),o.workspaceUntrusted=new o("workspace-untrusted",{fontCharacter:"\\ebc2"}),o.workspaceUnspecified=new o("workspace-unspecified",{fontCharacter:"\\ebc3"}),o.terminalCmd=new o("terminal-cmd",{fontCharacter:"\\ebc4"}),o.terminalDebian=new o("terminal-debian",{fontCharacter:"\\ebc5"}),o.terminalLinux=new o("terminal-linux",{fontCharacter:"\\ebc6"}),o.terminalPowershell=new o("terminal-powershell",{fontCharacter:"\\ebc7"}),o.terminalTmux=new o("terminal-tmux",{fontCharacter:"\\ebc8"}),o.terminalUbuntu=new o("terminal-ubuntu",{fontCharacter:"\\ebc9"}),o.terminalBash=new o("terminal-bash",{fontCharacter:"\\ebca"}),o.arrowSwap=new o("arrow-swap",{fontCharacter:"\\ebcb"}),o.copy=new o("copy",{fontCharacter:"\\ebcc"}),o.personAdd=new o("person-add",{fontCharacter:"\\ebcd"}),o.filterFilled=new o("filter-filled",{fontCharacter:"\\ebce"}),o.wand=new o("wand",{fontCharacter:"\\ebcf"}),o.debugLineByLine=new o("debug-line-by-line",{fontCharacter:"\\ebd0"}),o.inspect=new o("inspect",{fontCharacter:"\\ebd1"}),o.layers=new o("layers",{fontCharacter:"\\ebd2"}),o.layersDot=new o("layers-dot",{fontCharacter:"\\ebd3"}),o.layersActive=new o("layers-active",{fontCharacter:"\\ebd4"}),o.compass=new o("compass",{fontCharacter:"\\ebd5"}),o.compassDot=new o("compass-dot",{fontCharacter:"\\ebd6"}),o.compassActive=new o("compass-active",{fontCharacter:"\\ebd7"}),o.azure=new o("azure",{fontCharacter:"\\ebd8"}),o.issueDraft=new o("issue-draft",{fontCharacter:"\\ebd9"}),o.gitPullRequestClosed=new o("git-pull-request-closed",{fontCharacter:"\\ebda"}),o.gitPullRequestDraft=new o("git-pull-request-draft",{fontCharacter:"\\ebdb"}),o.debugAll=new o("debug-all",{fontCharacter:"\\ebdc"}),o.debugCoverage=new o("debug-coverage",{fontCharacter:"\\ebdd"}),o.runErrors=new o("run-errors",{fontCharacter:"\\ebde"}),o.folderLibrary=new o("folder-library",{fontCharacter:"\\ebdf"}),o.debugContinueSmall=new o("debug-continue-small",{fontCharacter:"\\ebe0"}),o.beakerStop=new o("beaker-stop",{fontCharacter:"\\ebe1"}),o.graphLine=new o("graph-line",{fontCharacter:"\\ebe2"}),o.graphScatter=new o("graph-scatter",{fontCharacter:"\\ebe3"}),o.pieChart=new o("pie-chart",{fontCharacter:"\\ebe4"}),o.bracket=new o("bracket",o.json.definition),o.bracketDot=new o("bracket-dot",{fontCharacter:"\\ebe5"}),o.bracketError=new o("bracket-error",{fontCharacter:"\\ebe6"}),o.lockSmall=new o("lock-small",{fontCharacter:"\\ebe7"}),o.azureDevops=new o("azure-devops",{fontCharacter:"\\ebe8"}),o.verifiedFilled=new o("verified-filled",{fontCharacter:"\\ebe9"})}(_e||(_e={}))},79881:function(bt,ke,b){"use strict";b.d(ke,{B8:function(){return D},Cp:function(){return fe},F0:function(){return le},L6:function(){return K},VV:function(){return _e},b1:function(){return o},dL:function(){return ve},ri:function(){return oe}});class B{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(u){setTimeout(()=>{throw u.stack?new Error(u.message+`
|
|
|
|
`+u.stack):u},0)}}emit(u){this.listeners.forEach(g=>{g(u)})}onUnexpectedError(u){this.unexpectedErrorHandler(u),this.emit(u)}onUnexpectedExternalError(u){this.unexpectedErrorHandler(u)}}const q=new B;function ve(f){_e(f)||q.onUnexpectedError(f)}function fe(f){_e(f)||q.onUnexpectedExternalError(f)}function oe(f){if(f instanceof Error){let{name:u,message:g}=f;const m=f.stacktrace||f.stack;return{$isError:!0,name:u,message:g,stack:m}}return f}const Z="Canceled";function _e(f){return f instanceof Error&&f.name===Z&&f.message===Z}function le(){const f=new Error(Z);return f.name=f.message,f}function o(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function K(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class D extends Error{constructor(u){super("NotSupported"),u&&(this.message=u)}}},4348:function(bt,ke,b){"use strict";b.d(ke,{D0:function(){return D},E7:function(){return f},K3:function(){return K},Q5:function(){return o},ZD:function(){return u},ju:function(){return oe}});var B=b(79881),q=b(69323),ve=b(34502),fe=b(95830),oe;(function(g){g.None=()=>q.JT.None;function m(C){return(R,z=null,Y)=>{let y=!1,v;return v=C($=>{if(!y)return v?v.dispose():y=!0,R.call(z,$)},null,Y),y&&v.dispose(),v}}g.once=m;function I(C,R){return E((z,Y=null,y)=>C(v=>z.call(Y,R(v)),null,y))}g.map=I;function H(C,R){return E((z,Y=null,y)=>C(v=>{R(v),z.call(Y,v)},null,y))}g.forEach=H;function L(C,R){return E((z,Y=null,y)=>C(v=>R(v)&&z.call(Y,v),null,y))}g.filter=L;function w(C){return C}g.signal=w;function O(...C){return(R,z=null,Y)=>(0,q.F8)(...C.map(y=>y(v=>R.call(z,v),null,Y)))}g.any=O;function A(C,R,z){let Y=z;return I(C,y=>(Y=R(Y,y),Y))}g.reduce=A;function E(C){let R;const z=new o({onFirstListenerAdd(){R=C(z.fire,z)},onLastListenerRemove(){R.dispose()}});return z.event}function Q(C,R,z=100,Y=!1,y){let v,$,j,me=0;const Se=new o({leakWarningThreshold:y,onFirstListenerAdd(){v=C(Te=>{me++,$=R($,Te),Y&&!j&&(Se.fire($),$=void 0),clearTimeout(j),j=setTimeout(()=>{const De=$;$=void 0,j=void 0,(!Y||me>1)&&Se.fire(De),me=0},z)})},onLastListenerRemove(){v.dispose()}});return Se.event}g.debounce=Q;function te(C,R=(z,Y)=>z===Y){let z=!0,Y;return L(C,y=>{const v=z||!R(y,Y);return z=!1,Y=y,v})}g.latch=te;function ie(C,R){return[g.filter(C,R),g.filter(C,z=>!R(z))]}g.split=ie;function Ee(C,R=!1,z=[]){let Y=z.slice(),y=C(j=>{Y?Y.push(j):$.fire(j)});const v=()=>{Y&&Y.forEach(j=>$.fire(j)),Y=null},$=new o({onFirstListenerAdd(){y||(y=C(j=>$.fire(j)))},onFirstListenerDidAdd(){Y&&(R?setTimeout(v):v())},onLastListenerRemove(){y&&y.dispose(),y=null}});return $.event}g.buffer=Ee;class we{constructor(R){this.event=R}map(R){return new we(I(this.event,R))}forEach(R){return new we(H(this.event,R))}filter(R){return new we(L(this.event,R))}reduce(R,z){return new we(A(this.event,R,z))}latch(){return new we(te(this.event))}debounce(R,z=100,Y=!1,y){return new we(Q(this.event,R,z,Y,y))}on(R,z,Y){return this.event(R,z,Y)}once(R,z,Y){return m(this.event)(R,z,Y)}}function xe(C){return new we(C)}g.chain=xe;function he(C,R,z=Y=>Y){const Y=(...j)=>$.fire(z(...j)),y=()=>C.on(R,Y),v=()=>C.removeListener(R,Y),$=new o({onFirstListenerAdd:y,onLastListenerRemove:v});return $.event}g.fromNodeEventEmitter=he;function V(C,R,z=Y=>Y){const Y=(...j)=>$.fire(z(...j)),y=()=>C.addEventListener(R,Y),v=()=>C.removeEventListener(R,Y),$=new o({onFirstListenerAdd:y,onLastListenerRemove:v});return $.event}g.fromDOMEventEmitter=V;function T(C){return new Promise(R=>m(C)(R))}g.toPromise=T})(oe||(oe={}));class Z{constructor(m){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${m}_${Z._idPool++}`}start(m){this._stopWatch=new fe.G(!0),this._listenerCount=m}stop(){if(this._stopWatch){const m=this._stopWatch.elapsed();this._elapsedOverall+=m,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${m.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}Z._idPool=0;let _e=-1;class le{constructor(m,I=Math.random().toString(18).slice(2,5)){this.customThreshold=m,this.name=I,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(m){let I=_e;if(typeof this.customThreshold=="number"&&(I=this.customThreshold),I<=0||m<I)return;this._stacks||(this._stacks=new Map);const H=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),L=this._stacks.get(H)||0;if(this._stacks.set(H,L+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=I*.5;let w,O=0;for(const[A,E]of this._stacks)(!w||O<E)&&(w=A,O=E);console.warn(`[${this.name}] potential listener LEAK detected, having ${m} listeners already. MOST frequent listener (${O}):`),console.warn(w)}return()=>{const w=this._stacks.get(H)||0;this._stacks.set(H,w-1)}}}class o{constructor(m){var I;this._disposed=!1,this._options=m,this._leakageMon=_e>0?new le(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((I=this._options)===null||I===void 0)&&I._profName?new Z(this._options._profName):void 0}get event(){return this._event||(this._event=(m,I,H)=>{var L;this._listeners||(this._listeners=new ve.S);const w=this._listeners.isEmpty();w&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const O=this._listeners.push(I?[m,I]:m);w&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,m,I);const A=(L=this._leakageMon)===null||L===void 0?void 0:L.check(this._listeners.size),E=(0,q.OF)(()=>{A&&A(),this._disposed||(O(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return H instanceof q.SL?H.add(E):Array.isArray(H)&&H.push(E),E}),this._event}fire(m){var I,H;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new ve.S);for(let L of this._listeners)this._deliveryQueue.push([L,m]);for((I=this._perfMon)===null||I===void 0||I.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[L,w]=this._deliveryQueue.shift();try{typeof L=="function"?L.call(void 0,w):L[0].call(L[1],w)}catch(O){(0,B.dL)(O)}}(H=this._perfMon)===null||H===void 0||H.stop()}}dispose(){var m,I,H,L,w;this._disposed||(this._disposed=!0,(m=this._listeners)===null||m===void 0||m.clear(),(I=this._deliveryQueue)===null||I===void 0||I.clear(),(L=(H=this._options)===null||H===void 0?void 0:H.onLastListenerRemove)===null||L===void 0||L.call(H),(w=this._leakageMon)===null||w===void 0||w.dispose())}}class K extends o{constructor(m){super(m),this._isPaused=0,this._eventQueue=new ve.S,this._mergeFn=m==null?void 0:m.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const m=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(m))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(m){this._listeners&&(this._isPaused!==0?this._eventQueue.push(m):super.fire(m))}}class D extends K{constructor(m){var I;super(m),this._delay=(I=m.delay)!==null&&I!==void 0?I:100}fire(m){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(m)}}class f{constructor(){this.buffers=[]}wrapEvent(m){return(I,H,L)=>m(w=>{const O=this.buffers[this.buffers.length-1];O?O.push(()=>I.call(H,w)):I.call(H,w)},void 0,L)}bufferEvents(m){const I=[];this.buffers.push(I);const H=m();return this.buffers.pop(),I.forEach(L=>L()),H}}class u{constructor(){this.listening=!1,this.inputEvent=oe.None,this.inputEventListener=q.JT.None,this.emitter=new o({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(m){this.inputEvent=m,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=m(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(bt,ke,b){"use strict";b.d(ke,{I:function(){return B}});function B(q){const ve=this;let fe=!1,oe;return function(){return fe||(fe=!0,oe=q.apply(ve,arguments)),oe}}},88226:function(bt,ke,b){"use strict";b.d(ke,{$:function(){return B}});var B;(function(q){function ve(O){return O&&typeof O=="object"&&typeof O[Symbol.iterator]=="function"}q.is=ve;const fe=Object.freeze([]);function oe(){return fe}q.empty=oe;function*Z(O){yield O}q.single=Z;function _e(O){return O||fe}q.from=_e;function le(O){return!O||O[Symbol.iterator]().next().done===!0}q.isEmpty=le;function o(O){return O[Symbol.iterator]().next().value}q.first=o;function K(O,A){for(const E of O)if(A(E))return!0;return!1}q.some=K;function D(O,A){for(const E of O)if(A(E))return E}q.find=D;function*f(O,A){for(const E of O)A(E)&&(yield E)}q.filter=f;function*u(O,A){let E=0;for(const Q of O)yield A(Q,E++)}q.map=u;function*g(...O){for(const A of O)for(const E of A)yield E}q.concat=g;function*m(O){for(const A of O)for(const E of A)yield E}q.concatNested=m;function I(O,A,E){let Q=E;for(const te of O)Q=A(Q,te);return Q}q.reduce=I;function*H(O,A,E=O.length){for(A<0&&(A+=O.length),E<0?E+=O.length:E>O.length&&(E=O.length);A<E;A++)yield O[A]}q.slice=H;function L(O,A=Number.POSITIVE_INFINITY){const E=[];if(A===0)return[E,O];const Q=O[Symbol.iterator]();for(let te=0;te<A;te++){const ie=Q.next();if(ie.done)return[E,q.empty()];E.push(ie.value)}return[E,{[Symbol.iterator](){return Q}}]}q.consume=L;function w(O,A,E=(Q,te)=>Q===te){const Q=O[Symbol.iterator](),te=A[Symbol.iterator]();for(;;){const ie=Q.next(),Ee=te.next();if(ie.done!==Ee.done)return!1;if(ie.done)return!0;if(!E(ie.value,Ee.value))return!1}}q.equals=w})(B||(B={}))},69323:function(bt,ke,b){"use strict";b.d(ke,{B9:function(){return u},F8:function(){return g},JT:function(){return H},Jz:function(){return w},OF:function(){return m},SL:function(){return I},Wf:function(){return f},XK:function(){return L},dk:function(){return K}});var B=b(17845),q=b(88226);const ve=!1;let fe=null;function oe(O){fe=O}if(ve){const O="__is_disposable_tracked__";oe(new class{trackDisposable(A){const E=new Error("Potentially leaked disposable").stack;setTimeout(()=>{A[O]||console.log(E)},3e3)}setParent(A,E){if(A&&A!==H.None)try{A[O]=!0}catch(Q){}}markAsDisposed(A){if(A&&A!==H.None)try{A[O]=!0}catch(E){}}markAsSingleton(A){}})}function Z(O){return fe==null||fe.trackDisposable(O),O}function _e(O){fe==null||fe.markAsDisposed(O)}function le(O,A){fe==null||fe.setParent(O,A)}function o(O,A){if(fe)for(const E of O)fe.setParent(E,A)}function K(O){return fe==null||fe.markAsSingleton(O),O}class D extends Error{constructor(A){super(`Encountered errors while disposing of store. Errors: [${A.join(", ")}]`),this.errors=A}}function f(O){return typeof O.dispose=="function"&&O.dispose.length===0}function u(O){if(q.$.is(O)){let A=[];for(const E of O)if(E)try{E.dispose()}catch(Q){A.push(Q)}if(A.length===1)throw A[0];if(A.length>1)throw new D(A);return Array.isArray(O)?[]:O}else if(O)return O.dispose(),O}function g(...O){const A=m(()=>u(O));return o(O,A),A}function m(O){const A=Z({dispose:(0,B.I)(()=>{_e(A),O()})});return A}class I{constructor(){this._toDispose=new Set,this._isDisposed=!1,Z(this)}dispose(){this._isDisposed||(_e(this),this._isDisposed=!0,this.clear())}clear(){try{u(this._toDispose.values())}finally{this._toDispose.clear()}}add(A){if(!A)return A;if(A===this)throw new Error("Cannot register a disposable on itself!");return le(A,this),this._isDisposed?I.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(A),A}}I.DISABLE_DISPOSED_WARNING=!1;class H{constructor(){this._store=new I,Z(this),le(this._store,this)}dispose(){_e(this),this._store.dispose()}_register(A){if(A===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(A)}}H.None=Object.freeze({dispose(){}});class L{constructor(){this._isDisposed=!1,Z(this)}get value(){return this._isDisposed?void 0:this._value}set value(A){var E;this._isDisposed||A===this._value||((E=this._value)===null||E===void 0||E.dispose(),A&&le(A,this),this._value=A)}clear(){this.value=void 0}dispose(){var A;this._isDisposed=!0,_e(this),(A=this._value)===null||A===void 0||A.dispose(),this._value=void 0}clearAndLeak(){const A=this._value;return this._value=void 0,A&&le(A,null),A}}class w{constructor(A){this.object=A}dispose(){}}},34502:function(bt,ke,b){"use strict";b.d(ke,{S:function(){return q}});class B{constructor(fe){this.element=fe,this.next=B.Undefined,this.prev=B.Undefined}}B.Undefined=new B(void 0);class q{constructor(){this._first=B.Undefined,this._last=B.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===B.Undefined}clear(){let fe=this._first;for(;fe!==B.Undefined;){const oe=fe.next;fe.prev=B.Undefined,fe.next=B.Undefined,fe=oe}this._first=B.Undefined,this._last=B.Undefined,this._size=0}unshift(fe){return this._insert(fe,!1)}push(fe){return this._insert(fe,!0)}_insert(fe,oe){const Z=new B(fe);if(this._first===B.Undefined)this._first=Z,this._last=Z;else if(oe){const le=this._last;this._last=Z,Z.prev=le,le.next=Z}else{const le=this._first;this._first=Z,Z.next=le,le.prev=Z}this._size+=1;let _e=!1;return()=>{_e||(_e=!0,this._remove(Z))}}shift(){if(this._first!==B.Undefined){const fe=this._first.element;return this._remove(this._first),fe}}pop(){if(this._last!==B.Undefined){const fe=this._last.element;return this._remove(this._last),fe}}_remove(fe){if(fe.prev!==B.Undefined&&fe.next!==B.Undefined){const oe=fe.prev;oe.next=fe.next,fe.next.prev=oe}else fe.prev===B.Undefined&&fe.next===B.Undefined?(this._first=B.Undefined,this._last=B.Undefined):fe.next===B.Undefined?(this._last=this._last.prev,this._last.next=B.Undefined):fe.prev===B.Undefined&&(this._first=this._first.next,this._first.prev=B.Undefined);this._size-=1}*[Symbol.iterator](){let fe=this._first;for(;fe!==B.Undefined;)yield fe.element,fe=fe.next}}},23345:function(bt,ke,b){"use strict";b.d(ke,{$L:function(){return Q},ED:function(){return w},IJ:function(){return A},OS:function(){return we},WE:function(){return ie},dz:function(){return O},gn:function(){return te},li:function(){return m},r:function(){return V},tY:function(){return E},xS:function(){return Ee}});var B=b(97671),q;const ve="en";let fe=!1,oe=!1,Z=!1,_e=!1,le=!1,o=!1,K=!1,D,f=null,u=null,g;const m=typeof self=="object"?self:typeof b.g=="object"?b.g:{};let I;typeof m.vscode!="undefined"&&typeof m.vscode.process!="undefined"?I=m.vscode.process:typeof B!="undefined"&&(I=B);const H=typeof((q=I==null?void 0:I.versions)===null||q===void 0?void 0:q.electron)=="string"&&I.type==="renderer";if(typeof navigator=="object"&&!H)g=navigator.userAgent,fe=g.indexOf("Windows")>=0,oe=g.indexOf("Macintosh")>=0,K=(g.indexOf("Macintosh")>=0||g.indexOf("iPad")>=0||g.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Z=g.indexOf("Linux")>=0,o=!0,D=navigator.language,f=D;else if(typeof I=="object"){fe=I.platform==="win32",oe=I.platform==="darwin",Z=I.platform==="linux",_e=Z&&!!I.env.SNAP&&!!I.env.SNAP_REVISION,D=ve,f=ve;const T=I.env.VSCODE_NLS_CONFIG;if(T)try{const C=JSON.parse(T),R=C.availableLanguages["*"];D=C.locale,f=R||ve,u=C._translationsConfigFile}catch(C){}le=!0}else console.error("Unable to resolve platform.");let L=0;oe?L=1:fe?L=3:Z&&(L=2);const w=fe,O=oe,A=Z,E=le,Q=o,te=K,ie=g,Ee=function(){if(m.setImmediate)return m.setImmediate.bind(m);if(typeof m.postMessage=="function"&&!m.importScripts){let R=[];m.addEventListener("message",Y=>{if(Y.data&&Y.data.vscodeSetImmediateId)for(let y=0,v=R.length;y<v;y++){const $=R[y];if($.id===Y.data.vscodeSetImmediateId){R.splice(y,1),$.callback();return}}});let z=0;return Y=>{const y=++z;R.push({id:y,callback:Y}),m.postMessage({vscodeSetImmediateId:y},"*")}}if(typeof(I==null?void 0:I.nextTick)=="function")return I.nextTick.bind(I);const C=Promise.resolve();return R=>C.then(R)}(),we=oe||K?2:fe?1:3;let xe=!0,he=!1;function V(){if(!he){he=!0;const T=new Uint8Array(2);T[0]=1,T[1]=2,xe=new Uint16Array(T.buffer)[0]===513}return xe}},95830:function(bt,ke,b){"use strict";b.d(ke,{G:function(){return ve}});var B=b(23345);const q=B.li.performance&&typeof B.li.performance.now=="function";class ve{constructor(oe){this._highResolution=q&&oe,this._startTime=this._now(),this._stopTime=-1}static create(oe=!0){return new ve(oe)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?B.li.performance.now():Date.now()}}},82983:function(bt,ke,b){"use strict";b.d(ke,{$i:function(){return me},C8:function(){return lt},GF:function(){return D},HO:function(){return z},IO:function(){return f},K7:function(){return qe},Kw:function(){return dt},LC:function(){return m},Mh:function(){return Ee},P1:function(){return we},PJ:function(){return wt},Qe:function(){return Se},R1:function(){return K},RP:function(){return $},S6:function(){return Rt},TT:function(){return w},Ut:function(){return y},V8:function(){return I},WU:function(){return ve},YK:function(){return he},YU:function(){return fe},ZG:function(){return xe},ZH:function(){return T},ab:function(){return Te},c1:function(){return We},df:function(){return Q},ec:function(){return oe},fi:function(){return _t},fy:function(){return Z},j3:function(){return _e},j_:function(){return A},m5:function(){return B},mK:function(){return E},mr:function(){return u},oH:function(){return ue},oL:function(){return le},ok:function(){return ie},ow:function(){return H},qq:function(){return te},qu:function(){return L},rL:function(){return V},uS:function(){return Tt},un:function(){return o},uq:function(){return g},vH:function(){return R},xe:function(){return De},zY:function(){return O}});function B(k){return!k||typeof k!="string"?!0:k.trim().length===0}const q=/{(\d+)}/g;function ve(k,...N){return N.length===0?k:k.replace(q,function(P,ne){const F=parseInt(ne,10);return isNaN(F)||F<0||F>=N.length?P:N[F]})}function fe(k){return k.replace(/[<>&]/g,function(N){switch(N){case"<":return"<";case">":return">";case"&":return"&";default:return N}})}function oe(k){return k.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function Z(k,N=" "){const P=_e(k,N);return le(P,N)}function _e(k,N){if(!k||!N)return k;const P=N.length;if(P===0||k.length===0)return k;let ne=0;for(;k.indexOf(N,ne)===ne;)ne=ne+P;return k.substring(ne)}function le(k,N){if(!k||!N)return k;const P=N.length,ne=k.length;if(P===0||ne===0)return k;let F=ne,se=-1;for(;se=k.lastIndexOf(N,F-1),!(se===-1||se+P!==F);){if(se===0)return"";F=se}return k.substring(0,F)}function o(k){return k.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function K(k){return k.replace(/\*/g,"")}function D(k,N,P={}){if(!k)throw new Error("Cannot create regex from empty string");N||(k=oe(k)),P.wholeWord&&(/\B/.test(k.charAt(0))||(k="\\b"+k),/\B/.test(k.charAt(k.length-1))||(k=k+"\\b"));let ne="";return P.global&&(ne+="g"),P.matchCase||(ne+="i"),P.multiline&&(ne+="m"),P.unicode&&(ne+="u"),new RegExp(k,ne)}function f(k){return k.source==="^"||k.source==="^$"||k.source==="$"||k.source==="^\\s*$"?!1:!!(k.exec("")&&k.lastIndex===0)}function u(k){return(k.global?"g":"")+(k.ignoreCase?"i":"")+(k.multiline?"m":"")+(k.unicode?"u":"")}function g(k){return k.split(/\r\n|\r|\n/)}function m(k){for(let N=0,P=k.length;N<P;N++){const ne=k.charCodeAt(N);if(ne!==32&&ne!==9)return N}return-1}function I(k,N=0,P=k.length){for(let ne=N;ne<P;ne++){const F=k.charCodeAt(ne);if(F!==32&&F!==9)return k.substring(N,ne)}return k.substring(N,P)}function H(k,N=k.length-1){for(let P=N;P>=0;P--){const ne=k.charCodeAt(P);if(ne!==32&&ne!==9)return P}return-1}function L(k,N){return k<N?-1:k>N?1:0}function w(k,N,P=0,ne=k.length,F=0,se=N.length){for(;P<ne&&F<se;P++,F++){let be=k.charCodeAt(P),Le=N.charCodeAt(F);if(be<Le)return-1;if(be>Le)return 1}const de=ne-P,ge=se-F;return de<ge?-1:de>ge?1:0}function O(k,N){return A(k,N,0,k.length,0,N.length)}function A(k,N,P=0,ne=k.length,F=0,se=N.length){for(;P<ne&&F<se;P++,F++){let be=k.charCodeAt(P),Le=N.charCodeAt(F);if(be===Le)continue;if(be>=128||Le>=128)return w(k.toLowerCase(),N.toLowerCase(),P,ne,F,se);E(be)&&(be-=32),E(Le)&&(Le-=32);const Ne=be-Le;if(Ne!==0)return Ne}const de=ne-P,ge=se-F;return de<ge?-1:de>ge?1:0}function E(k){return k>=97&&k<=122}function Q(k){return k>=65&&k<=90}function te(k,N){return k.length===N.length&&A(k,N)===0}function ie(k,N){const P=N.length;return N.length>k.length?!1:A(k,N,0,P)===0}function Ee(k,N){let P,ne=Math.min(k.length,N.length);for(P=0;P<ne;P++)if(k.charCodeAt(P)!==N.charCodeAt(P))return P;return ne}function we(k,N){let P,ne=Math.min(k.length,N.length);const F=k.length-1,se=N.length-1;for(P=0;P<ne;P++)if(k.charCodeAt(F-P)!==N.charCodeAt(se-P))return P;return ne}function xe(k){return 55296<=k&&k<=56319}function he(k){return 56320<=k&&k<=57343}function V(k,N){return(k-55296<<10)+(N-56320)+65536}function T(k,N,P){const ne=k.charCodeAt(P);if(xe(ne)&&P+1<N){const F=k.charCodeAt(P+1);if(he(F))return V(ne,F)}return ne}function C(k,N){const P=k.charCodeAt(N-1);if(he(P)&&N>1){const ne=k.charCodeAt(N-2);if(xe(ne))return V(ne,P)}return P}function R(k,N){const P=Pe.getInstance(),ne=N,F=k.length,se=T(k,F,N);N+=se>=65536?2:1;let de=P.getGraphemeBreakType(se);for(;N<F;){const ge=T(k,F,N),be=P.getGraphemeBreakType(ge);if(_t(de,be))break;N+=ge>=65536?2:1,de=be}return N-ne}function z(k,N){const P=Pe.getInstance(),ne=N,F=C(k,N);N-=F>=65536?2:1;let se=P.getGraphemeBreakType(F);for(;N>0;){const de=C(k,N),ge=P.getGraphemeBreakType(de);if(_t(ge,se))break;N-=de>=65536?2:1,se=ge}return ne-N}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 y(k){return Y.test(k)}const v=/(?:[\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 $(k){return v.test(k)}const j=/^[\t\n\r\x20-\x7E]*$/;function me(k){return j.test(k)}const Se=/[\u2028\u2029]/;function Te(k){return Se.test(k)}function De(k){for(let N=0,P=k.length;N<P;N++)if(qe(k.charCodeAt(N)))return!0;return!1}function qe(k){return k=+k,k>=11904&&k<=55215||k>=63744&&k<=64255||k>=65281&&k<=65374}function lt(k){return k>=127462&&k<=127487||k===8986||k===8987||k===9200||k===9203||k>=9728&&k<=10175||k===11088||k===11093||k>=127744&&k<=128591||k>=128640&&k<=128764||k>=128992&&k<=129003||k>=129280&&k<=129535||k>=129648&&k<=129750}const We="\uFEFF";function Tt(k){return!!(k&&k.length>0&&k.charCodeAt(0)===65279)}function dt(k,N=!1){return k?(N&&(k=k.replace(/\\./g,"")),k.toLowerCase()!==k):!1}function wt(k){return k=k%(2*26),k<26?String.fromCharCode(97+k):String.fromCharCode(65+k-26)}function Rt(k){return Pe.getInstance().getGraphemeBreakType(k)}function _t(k,N){return k===0?N!==5&&N!==7:k===2&&N===3?!1:k===4||k===2||k===3||N===4||N===2||N===3?!0:!(k===8&&(N===8||N===9||N===11||N===12)||(k===11||k===9)&&(N===9||N===10)||(k===12||k===10)&&N===10||N===5||N===13||N===7||k===1||k===13&&N===14||k===6&&N===6)}class Pe{constructor(){this._data=J()}static getInstance(){return Pe._INSTANCE||(Pe._INSTANCE=new Pe),Pe._INSTANCE}getGraphemeBreakType(N){if(N<32)return N===10?3:N===13?2:4;if(N<127)return 0;const P=this._data,ne=P.length/3;let F=1;for(;F<=ne;)if(N<P[3*F])F=2*F;else if(N>P[3*F+1])F=2*F+1;else return P[3*F+2];return 0}}Pe._INSTANCE=null;function J(){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 ue(k,N){if(k===0)return 0;const P=W(k,N);if(P!==void 0)return P;const ne=C(N,k);return k-=M(ne),k}function W(k,N){let P=C(N,k);for(k-=M(P);pe(P)||P===65039||P===8419;){if(k===0)return;P=C(N,k),k-=M(P)}if(lt(P)){if(k>=0){const ne=C(N,k);ne===8205&&(k-=M(ne))}return k}}function M(k){return k>=65536?2:1}function pe(k){return 127995<=k&&k<=127999}},72999:function(bt,ke,b){"use strict";b.d(ke,{$E:function(){return m},$K:function(){return _e},D8:function(){return f},HD:function(){return q},IU:function(){return I},Jp:function(){return le},Kn:function(){return ve},cW:function(){return K},f6:function(){return H},hj:function(){return fe},jn:function(){return oe},kJ:function(){return B},mf:function(){return D},o8:function(){return Z},p_:function(){return o},vE:function(){return L}});function B(w){return Array.isArray(w)}function q(w){return typeof w=="string"}function ve(w){return typeof w=="object"&&w!==null&&!Array.isArray(w)&&!(w instanceof RegExp)&&!(w instanceof Date)}function fe(w){return typeof w=="number"&&!isNaN(w)}function oe(w){return w===!0||w===!1}function Z(w){return typeof w=="undefined"}function _e(w){return!le(w)}function le(w){return Z(w)||w===null}function o(w,O){if(!w)throw new Error(O?`Unexpected type, expected '${O}'`:"Unexpected type")}function K(w){if(le(w))throw new Error("Assertion Failed: argument is undefined or null");return w}function D(w){return typeof w=="function"}function f(w,O){const A=Math.min(w.length,O.length);for(let E=0;E<A;E++)u(w[E],O[E])}function u(w,O){if(q(O)){if(typeof w!==O)throw new Error(`argument does not match constraint: typeof ${O}`)}else if(D(O)){try{if(w instanceof O)return}catch(A){}if(!le(w)&&w.constructor===O||O.length===1&&O.call(void 0,w)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function g(w){let O=[],A=Object.getPrototypeOf(w);for(;Object.prototype!==A;)O=O.concat(Object.getOwnPropertyNames(A)),A=Object.getPrototypeOf(A);return O}function m(w){const O=[];for(const A of g(w))typeof w[A]=="function"&&O.push(A);return O}function I(w,O){const A=Q=>function(){const te=Array.prototype.slice.call(arguments,0);return O(Q,te)};let E={};for(const Q of w)E[Q]=A(Q);return E}function H(w){return w===null?void 0:w}function L(w,O="Unreachable"){throw new Error(O)}},13268:function(bt,ke,b){"use strict";b.d(ke,{N:function(){return q}});function B(ve,fe){let oe;return fe.length===0?oe=ve:oe=ve.replace(/\{(\d+)\}/g,function(Z,_e){const le=_e[0];return typeof fe[le]!="undefined"?fe[le]:Z}),oe}function q(ve,fe,...oe){return B(fe,oe)}},96236:function(bt,ke,b){"use strict";b.d(ke,{BH:function(){return I},NZ:function(){return H},U8:function(){return L},co:function(){return m},eH:function(){return g},vr:function(){return u}});var B=b(75918),q=b(52615),ve=b(4348),fe=b(88226),oe=b(69323),Z=b(34502),_e=b(35884),le=b(90689),o=b(16925),K=b(49055),D=function(w,O,A,E){var Q=arguments.length,te=Q<3?O:E===null?E=Object.getOwnPropertyDescriptor(O,A):E,ie;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")te=Reflect.decorate(w,O,A,E);else for(var Ee=w.length-1;Ee>=0;Ee--)(ie=w[Ee])&&(te=(Q<3?ie(te):Q>3?ie(O,A,te):ie(O,A))||te);return Q>3&&te&&Object.defineProperty(O,A,te),te},f=function(w,O){return function(A,E){O(A,E,w)}};function u(w){return w.command!==void 0}class g{constructor(O){this.id=g._idPool++,this._debugName=O}}g._idPool=0,g.CommandPalette=new g("CommandPalette"),g.EditorContext=new g("EditorContext"),g.SimpleEditorContext=new g("SimpleEditorContext"),g.EditorContextCopy=new g("EditorContextCopy"),g.EditorContextPeek=new g("EditorContextPeek"),g.MenubarEditMenu=new g("MenubarEditMenu"),g.MenubarCopy=new g("MenubarCopy"),g.MenubarGoMenu=new g("MenubarGoMenu"),g.MenubarSelectionMenu=new g("MenubarSelectionMenu"),g.InlineCompletionsActions=new g("InlineCompletionsActions");const m=(0,o.yh)("menuService"),I=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new ve.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:w=>w===g.CommandPalette}}addCommand(w){return this.addCommands(fe.$.single(w))}addCommands(w){for(const O of w)this._commands.set(O.id,O);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,oe.OF)(()=>{let O=!1;for(const A of w)O=this._commands.delete(A.id)||O;O&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(w){return this._commands.get(w)}getCommands(){const w=new Map;return this._commands.forEach((O,A)=>w.set(A,O)),w}appendMenuItem(w,O){return this.appendMenuItems(fe.$.single({id:w,item:O}))}appendMenuItems(w){const O=new Set,A=new Z.S;for(const{id:E,item:Q}of w){let te=this._menuItems.get(E);te||(te=new Z.S,this._menuItems.set(E,te)),A.push(te.push(Q)),O.add(E)}return this._onDidChangeMenu.fire(O),(0,oe.OF)(()=>{if(A.size>0){for(let E of A)E();this._onDidChangeMenu.fire(O),A.clear()}})}getMenuItems(w){let O;return this._menuItems.has(w)?O=[...this._menuItems.get(w)]:O=[],w===g.CommandPalette&&this._appendImplicitItems(O),O}_appendImplicitItems(w){const O=new Set;for(const A of w)u(A)&&(O.add(A.command.id),A.alt&&O.add(A.alt.id));this._commands.forEach((A,E)=>{O.has(E)||w.push({command:A})})}};class H extends B.wY{constructor(O,A,E,Q){super(`submenuitem.${O.submenu.id}`,typeof O.title=="string"?O.title:O.title.value,[],"submenu"),this.item=O,this._menuService=A,this._contextKeyService=E,this._options=Q}get actions(){const O=[],A=this._menuService.createMenu(this.item.submenu,this._contextKeyService),E=A.getActions(this._options);A.dispose();for(const[,Q]of E)Q.length>0&&(O.push(...Q),O.push(new B.Z0));return O.length&&O.pop(),O}}let L=class Xa{constructor(O,A,E,Q,te){var ie,Ee;if(this._commandService=te,this.id=O.id,this.label=E!=null&&E.renderShortTitle&&O.shortTitle?typeof O.shortTitle=="string"?O.shortTitle:O.shortTitle.value:typeof O.title=="string"?O.title:O.title.value,this.tooltip=(Ee=typeof O.tooltip=="string"?O.tooltip:(ie=O.tooltip)===null||ie===void 0?void 0:ie.value)!==null&&Ee!==void 0?Ee:"",this.enabled=!O.precondition||Q.contextMatchesRules(O.precondition),this.checked=void 0,O.toggled){const we=O.toggled.condition?O.toggled:{condition:O.toggled};this.checked=Q.contextMatchesRules(we.condition),this.checked&&we.tooltip&&(this.tooltip=typeof we.tooltip=="string"?we.tooltip:we.tooltip.value),we.title&&(this.label=typeof we.title=="string"?we.title:we.title.value)}this.item=O,this.alt=A?new Xa(A,void 0,E,Q,te):void 0,this._options=E,K.kS.isThemeIcon(O.icon)&&(this.class=q.dT.asClassName(O.icon))}dispose(){}run(...O){var A,E;let Q=[];return!((A=this._options)===null||A===void 0)&&A.arg&&(Q=[...Q,this._options.arg]),!((E=this._options)===null||E===void 0)&&E.shouldForwardArgs&&(Q=[...Q,...O]),this._commandService.executeCommand(this.id,...Q)}};L=D([f(3,le.i6),f(4,_e.H)],L)},35884:function(bt,ke,b){"use strict";b.d(ke,{H:function(){return _e},P:function(){return le}});var B=b(4348),q=b(88226),ve=b(69323),fe=b(34502),oe=b(72999),Z=b(16925);const _e=(0,Z.yh)("commandService"),le=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new B.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(o,K){if(!o)throw new Error("invalid command");if(typeof o=="string"){if(!K)throw new Error("invalid command");return this.registerCommand({id:o,handler:K})}if(o.description){const m=[];for(let H of o.description.args)m.push(H.constraint);const I=o.handler;o.handler=function(H,...L){return(0,oe.D8)(L,m),I(H,...L)}}const{id:D}=o;let f=this._commands.get(D);f||(f=new fe.S,this._commands.set(D,f));let u=f.unshift(o),g=(0,ve.OF)(()=>{u();const m=this._commands.get(D);m!=null&&m.isEmpty()&&this._commands.delete(D)});return this._onDidRegisterCommand.fire(D),g}registerCommandAlias(o,K){return le.registerCommand(o,(D,...f)=>D.get(_e).executeCommand(K,...f))}getCommand(o){const K=this._commands.get(o);if(!(!K||K.isEmpty()))return q.$.first(K)}getCommands(){const o=new Map;for(const K of this._commands.keys()){const D=this.getCommand(K);D&&o.set(K,D)}return o}};le.registerCommand("noop",()=>{})},90689:function(bt,ke,b){"use strict";b.d(ke,{Ao:function(){return _e},Eq:function(){return V},Fb:function(){return le},K8:function(){return R},i6:function(){return he},uy:function(){return xe}});var B=b(23345),q=b(82983),ve=b(16925);let fe=B.WE||"";const oe=new Map;oe.set("false",!1),oe.set("true",!0),oe.set("isMac",B.dz),oe.set("isLinux",B.IJ),oe.set("isWindows",B.ED),oe.set("isWeb",B.$L),oe.set("isMacNative",B.dz&&!B.$L),oe.set("isEdge",fe.indexOf("Edg/")>=0),oe.set("isFirefox",fe.indexOf("Firefox")>=0),oe.set("isChrome",fe.indexOf("Chrome")>=0),oe.set("isSafari",fe.indexOf("Safari")>=0);const Z=Object.prototype.hasOwnProperty;class _e{static has(y){return f.create(y)}static equals(y,v){return u.create(y,v)}static regex(y,v){return Q.create(y,v)}static not(y){return H.create(y)}static and(...y){return Ee.create(y,null)}static or(...y){return we.create(y,null,!0)}static deserialize(y,v=!1){if(y)return this._deserializeOrExpression(y,v)}static _deserializeOrExpression(y,v){let $=y.split("||");return we.create($.map(j=>this._deserializeAndExpression(j,v)),null,!0)}static _deserializeAndExpression(y,v){let $=y.split("&&");return Ee.create($.map(j=>this._deserializeOne(j,v)),null)}static _deserializeOne(y,v){if(y=y.trim(),y.indexOf("!=")>=0){let $=y.split("!=");return I.create($[0].trim(),this._deserializeValue($[1],v))}if(y.indexOf("==")>=0){let $=y.split("==");return u.create($[0].trim(),this._deserializeValue($[1],v))}if(y.indexOf("=~")>=0){let $=y.split("=~");return Q.create($[0].trim(),this._deserializeRegexValue($[1],v))}if(y.indexOf(" in ")>=0){let $=y.split(" in ");return g.create($[0].trim(),$[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(y)){const $=y.split(">=");return O.create($[0].trim(),$[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(y)){const $=y.split(">");return w.create($[0].trim(),$[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(y)){const $=y.split("<=");return E.create($[0].trim(),$[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(y)){const $=y.split("<");return A.create($[0].trim(),$[1].trim())}return/^\!\s*/.test(y)?H.create(y.substr(1).trim()):f.create(y)}static _deserializeValue(y,v){if(y=y.trim(),y==="true")return!0;if(y==="false")return!1;let $=/^'([^']*)'$/.exec(y);return $?$[1].trim():y}static _deserializeRegexValue(y,v){if((0,q.m5)(y)){if(v)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let $=y.indexOf("/"),j=y.lastIndexOf("/");if($===j||$<0){if(v)throw new Error(`bad regexp-value '${y}', missing /-enclosure`);return console.warn(`bad regexp-value '${y}', missing /-enclosure`),null}let me=y.slice($+1,j),Se=y[j+1]==="i"?"i":"";try{return new RegExp(me,Se)}catch(Te){if(v)throw new Error(`bad regexp-value '${y}', parse error: ${Te}`);return console.warn(`bad regexp-value '${y}', parse error: ${Te}`),null}}}function le(Y,y){const v=Y?Y.substituteConstants():void 0,$=y?y.substituteConstants():void 0;return!v&&!$?!0:!v||!$?!1:v.equals($)}function o(Y,y){return Y.cmp(y)}class K{constructor(){this.type=0}cmp(y){return this.type-y.type}equals(y){return y.type===this.type}substituteConstants(){return this}evaluate(y){return!1}serialize(){return"false"}keys(){return[]}negate(){return D.INSTANCE}}K.INSTANCE=new K;class D{constructor(){this.type=1}cmp(y){return this.type-y.type}equals(y){return y.type===this.type}substituteConstants(){return this}evaluate(y){return!0}serialize(){return"true"}keys(){return[]}negate(){return K.INSTANCE}}D.INSTANCE=new D;class f{constructor(y,v){this.key=y,this.negated=v,this.type=2}static create(y,v=null){const $=oe.get(y);return typeof $=="boolean"?$?D.INSTANCE:K.INSTANCE:new f(y,v)}cmp(y){return y.type!==this.type?this.type-y.type:T(this.key,y.key)}equals(y){return y.type===this.type?this.key===y.key:!1}substituteConstants(){const y=oe.get(this.key);return typeof y=="boolean"?y?D.INSTANCE:K.INSTANCE:this}evaluate(y){return!!y.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=H.create(this.key,this)),this.negated}}class u{constructor(y,v,$){this.key=y,this.value=v,this.negated=$,this.type=4}static create(y,v,$=null){if(typeof v=="boolean")return v?f.create(y,$):H.create(y,$);const j=oe.get(y);return typeof j=="boolean"?v===(j?"true":"false")?D.INSTANCE:K.INSTANCE:new u(y,v,$)}cmp(y){return y.type!==this.type?this.type-y.type:C(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){const y=oe.get(this.key);if(typeof y=="boolean"){const v=y?"true":"false";return this.value===v?D.INSTANCE:K.INSTANCE}return this}evaluate(y){return y.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=I.create(this.key,this.value,this)),this.negated}}class g{constructor(y,v){this.key=y,this.valueKey=v,this.type=10,this.negated=null}static create(y,v){return new g(y,v)}cmp(y){return y.type!==this.type?this.type-y.type:C(this.key,this.valueKey,y.key,y.valueKey)}equals(y){return y.type===this.type?this.key===y.key&&this.valueKey===y.valueKey:!1}substituteConstants(){return this}evaluate(y){const v=y.getValue(this.valueKey),$=y.getValue(this.key);return Array.isArray(v)?v.indexOf($)>=0:typeof $=="string"&&typeof v=="object"&&v!==null?Z.call(v,$):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=m.create(this)),this.negated}}class m{constructor(y){this._actual=y,this.type=11}static create(y){return new m(y)}cmp(y){return y.type!==this.type?this.type-y.type:this._actual.cmp(y._actual)}equals(y){return y.type===this.type?this._actual.equals(y._actual):!1}substituteConstants(){return this}evaluate(y){return!this._actual.evaluate(y)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class I{constructor(y,v,$){this.key=y,this.value=v,this.negated=$,this.type=5}static create(y,v,$=null){if(typeof v=="boolean")return v?H.create(y,$):f.create(y,$);const j=oe.get(y);return typeof j=="boolean"?v===(j?"true":"false")?K.INSTANCE:D.INSTANCE:new I(y,v,$)}cmp(y){return y.type!==this.type?this.type-y.type:C(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){const y=oe.get(this.key);if(typeof y=="boolean"){const v=y?"true":"false";return this.value===v?K.INSTANCE:D.INSTANCE}return this}evaluate(y){return y.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this.value,this)),this.negated}}class H{constructor(y,v){this.key=y,this.negated=v,this.type=3}static create(y,v=null){const $=oe.get(y);return typeof $=="boolean"?$?K.INSTANCE:D.INSTANCE:new H(y,v)}cmp(y){return y.type!==this.type?this.type-y.type:T(this.key,y.key)}equals(y){return y.type===this.type?this.key===y.key:!1}substituteConstants(){const y=oe.get(this.key);return typeof y=="boolean"?y?K.INSTANCE:D.INSTANCE:this}evaluate(y){return!y.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function L(Y,y){if(typeof Y=="string"){const v=parseFloat(Y);isNaN(v)||(Y=v)}return typeof Y=="string"||typeof Y=="number"?y(Y):K.INSTANCE}class w{constructor(y,v,$){this.key=y,this.value=v,this.negated=$,this.type=12}static create(y,v,$=null){return L(v,j=>new w(y,j,$))}cmp(y){return y.type!==this.type?this.type-y.type:C(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){return this}evaluate(y){return typeof this.value=="string"?!1:parseFloat(y.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class O{constructor(y,v,$){this.key=y,this.value=v,this.negated=$,this.type=13}static create(y,v,$=null){return L(v,j=>new O(y,j,$))}cmp(y){return y.type!==this.type?this.type-y.type:C(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){return this}evaluate(y){return typeof this.value=="string"?!1:parseFloat(y.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this.key,this.value,this)),this.negated}}class A{constructor(y,v,$){this.key=y,this.value=v,this.negated=$,this.type=14}static create(y,v,$=null){return L(v,j=>new A(y,j,$))}cmp(y){return y.type!==this.type?this.type-y.type:C(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){return this}evaluate(y){return typeof this.value=="string"?!1:parseFloat(y.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 E{constructor(y,v,$){this.key=y,this.value=v,this.negated=$,this.type=15}static create(y,v,$=null){return L(v,j=>new E(y,j,$))}cmp(y){return y.type!==this.type?this.type-y.type:C(this.key,this.value,y.key,y.value)}equals(y){return y.type===this.type?this.key===y.key&&this.value===y.value:!1}substituteConstants(){return this}evaluate(y){return typeof this.value=="string"?!1:parseFloat(y.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this.value,this)),this.negated}}class Q{constructor(y,v){this.key=y,this.regexp=v,this.type=7,this.negated=null}static create(y,v){return new Q(y,v)}cmp(y){if(y.type!==this.type)return this.type-y.type;if(this.key<y.key)return-1;if(this.key>y.key)return 1;const v=this.regexp?this.regexp.source:"",$=y.regexp?y.regexp.source:"";return v<$?-1:v>$?1:0}equals(y){if(y.type===this.type){const v=this.regexp?this.regexp.source:"",$=y.regexp?y.regexp.source:"";return this.key===y.key&&v===$}return!1}substituteConstants(){return this}evaluate(y){let v=y.getValue(this.key);return this.regexp?this.regexp.test(v):!1}serialize(){const y=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${y}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=te.create(this)),this.negated}}class te{constructor(y){this._actual=y,this.type=8}static create(y){return new te(y)}cmp(y){return y.type!==this.type?this.type-y.type:this._actual.cmp(y._actual)}equals(y){return y.type===this.type?this._actual.equals(y._actual):!1}substituteConstants(){return this}evaluate(y){return!this._actual.evaluate(y)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function ie(Y){let y=null;for(let v=0,$=Y.length;v<$;v++){const j=Y[v].substituteConstants();if(Y[v]!==j&&y===null){y=[];for(let me=0;me<v;me++)y[me]=Y[me]}y!==null&&(y[v]=j)}return y===null?Y:y}class Ee{constructor(y,v){this.expr=y,this.negated=v,this.type=6}static create(y,v){return Ee._normalizeArr(y,v)}cmp(y){if(y.type!==this.type)return this.type-y.type;if(this.expr.length<y.expr.length)return-1;if(this.expr.length>y.expr.length)return 1;for(let v=0,$=this.expr.length;v<$;v++){const j=o(this.expr[v],y.expr[v]);if(j!==0)return j}return 0}equals(y){if(y.type===this.type){if(this.expr.length!==y.expr.length)return!1;for(let v=0,$=this.expr.length;v<$;v++)if(!this.expr[v].equals(y.expr[v]))return!1;return!0}return!1}substituteConstants(){const y=ie(this.expr);return y===this.expr?this:Ee.create(y,this.negated)}evaluate(y){for(let v=0,$=this.expr.length;v<$;v++)if(!this.expr[v].evaluate(y))return!1;return!0}static _normalizeArr(y,v){const $=[];let j=!1;for(const me of y)if(me){if(me.type===1){j=!0;continue}if(me.type===0)return K.INSTANCE;if(me.type===6){$.push(...me.expr);continue}$.push(me)}if($.length===0&&j)return D.INSTANCE;if($.length!==0){if($.length===1)return $[0];$.sort(o);for(let me=1;me<$.length;me++)$[me-1].equals($[me])&&($.splice(me,1),me--);if($.length===1)return $[0];for(;$.length>1;){const me=$[$.length-1];if(me.type!==9)break;$.pop();const Se=$.pop(),Te=$.length===0,De=we.create(me.expr.map(qe=>Ee.create([qe,Se],null)),null,Te);De&&($.push(De),$.sort(o))}return $.length===1?$[0]:new Ee($,v)}}serialize(){return this.expr.map(y=>y.serialize()).join(" && ")}keys(){const y=[];for(let v of this.expr)y.push(...v.keys());return y}negate(){if(!this.negated){const y=[];for(let v of this.expr)y.push(v.negate());this.negated=we.create(y,this,!0)}return this.negated}}class we{constructor(y,v){this.expr=y,this.negated=v,this.type=9}static create(y,v,$){return we._normalizeArr(y,v,$)}cmp(y){if(y.type!==this.type)return this.type-y.type;if(this.expr.length<y.expr.length)return-1;if(this.expr.length>y.expr.length)return 1;for(let v=0,$=this.expr.length;v<$;v++){const j=o(this.expr[v],y.expr[v]);if(j!==0)return j}return 0}equals(y){if(y.type===this.type){if(this.expr.length!==y.expr.length)return!1;for(let v=0,$=this.expr.length;v<$;v++)if(!this.expr[v].equals(y.expr[v]))return!1;return!0}return!1}substituteConstants(){const y=ie(this.expr);return y===this.expr?this:we.create(y,this.negated,!1)}evaluate(y){for(let v=0,$=this.expr.length;v<$;v++)if(this.expr[v].evaluate(y))return!0;return!1}static _normalizeArr(y,v,$){let j=[],me=!1;if(y){for(let Se=0,Te=y.length;Se<Te;Se++){const De=y[Se];if(De){if(De.type===0){me=!0;continue}if(De.type===1)return D.INSTANCE;if(De.type===9){j=j.concat(De.expr);continue}j.push(De)}}if(j.length===0&&me)return K.INSTANCE;j.sort(o)}if(j.length!==0){if(j.length===1)return j[0];for(let Se=1;Se<j.length;Se++)j[Se-1].equals(j[Se])&&(j.splice(Se,1),Se--);if(j.length===1)return j[0];if($){for(let Se=0;Se<j.length;Se++)for(let Te=Se+1;Te<j.length;Te++)R(j[Se],j[Te])&&(j.splice(Te,1),Te--);if(j.length===1)return j[0]}return new we(j,v)}}serialize(){return this.expr.map(y=>y.serialize()).join(" || ")}keys(){const y=[];for(let v of this.expr)y.push(...v.keys());return y}negate(){if(!this.negated){let y=[];for(let v of this.expr)y.push(v.negate());for(;y.length>1;){const v=y.shift(),$=y.shift(),j=[];for(const Se of z(v))for(const Te of z($))j.push(Ee.create([Se,Te],null));const me=y.length===0;y.unshift(we.create(j,null,me))}this.negated=y[0]}return this.negated}}class xe extends f{constructor(y,v,$){super(y,null),this._defaultValue=v,typeof $=="object"?xe._info.push(Object.assign(Object.assign({},$),{key:y})):$!==!0&&xe._info.push({key:y,description:$,type:v!=null?typeof v:void 0})}static all(){return xe._info.values()}bindTo(y){return y.createKey(this.key,this._defaultValue)}getValue(y){return y.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(y){return u.create(this.key,y)}}xe._info=[];const he=(0,ve.yh)("contextKeyService"),V="setContext";function T(Y,y){return Y<y?-1:Y>y?1:0}function C(Y,y,v,$){return Y<v?-1:Y>v?1:y<$?-1:y>$?1:0}function R(Y,y){if(y.type===6&&Y.type!==9&&Y.type!==6){for(const j of y.expr)if(Y.equals(j))return!0}const v=Y.negate(),$=z(v).concat(z(y));$.sort(o);for(let j=0;j<$.length;j++){const Se=$[j].negate();for(let Te=j+1;Te<$.length;Te++){const De=$[Te];if(Se.equals(De))return!0}}return!1}function z(Y){return Y.type===9?Y.expr:[Y]}},16925:function(bt,ke,b){"use strict";b.d(ke,{I8:function(){return B},TG:function(){return q},jt:function(){return oe},yh:function(){return fe}});var B;(function(Z){Z.serviceIds=new Map,Z.DI_TARGET="$di$target",Z.DI_DEPENDENCIES="$di$dependencies";function _e(le){return le[Z.DI_DEPENDENCIES]||[]}Z.getServiceDependencies=_e})(B||(B={}));const q=fe("instantiationService");function ve(Z,_e,le,o){_e[B.DI_TARGET]===_e?_e[B.DI_DEPENDENCIES].push({id:Z,index:le,optional:o}):(_e[B.DI_DEPENDENCIES]=[{id:Z,index:le,optional:o}],_e[B.DI_TARGET]=_e)}function fe(Z){if(B.serviceIds.has(Z))return B.serviceIds.get(Z);const _e=function(le,o,K){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ve(_e,le,K,!1)};return _e.toString=()=>Z,B.serviceIds.set(Z,_e),_e}function oe(Z){return function(_e,le,o){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");ve(Z,_e,o,!0)}}},44650:function(bt,ke,b){"use strict";b.d(ke,{B:function(){return fe}});var B=b(76068),q=b(72999);class ve{constructor(){this.data=new Map}add(Z,_e){B.ok(q.HD(Z)),B.ok(q.Kn(_e)),B.ok(!this.data.has(Z),"There is already an extension with this id"),this.data.set(Z,_e)}as(Z){return this.data.get(Z)||null}}const fe=new ve},66213:function(bt,ke,b){"use strict";b.d(ke,{e:function(){return B}});var B;(function(q){q.DARK="dark",q.LIGHT="light",q.HIGH_CONTRAST="hc"})(B||(B={}))},49055:function(bt,ke,b){"use strict";b.d(ke,{EN:function(){return o},IP:function(){return f},Ic:function(){return m},XE:function(){return _e},bB:function(){return I},kS:function(){return K},m6:function(){return D}});var B=b(52615),q=b(4348),ve=b(69323),fe=b(16925),oe=b(44650),Z=b(66213);const _e=(0,fe.yh)("themeService");var le;(function(H){function L(w){return w&&typeof w=="object"&&typeof w.id=="string"}H.isThemeColor=L})(le||(le={}));function o(H){return{id:H}}var K;(function(H){function L(te){return te&&typeof te=="object"&&typeof te.id=="string"&&(typeof te.color=="undefined"||le.isThemeColor(te.color))}H.isThemeIcon=L;const w=new RegExp(`^\\$\\((${B.dT.iconNameExpression}(?:${B.dT.iconModifierExpression})?)\\)$`);function O(te){const ie=w.exec(te);if(!ie)return;let[,Ee]=ie;return{id:Ee}}H.fromString=O;function A(te,ie){let Ee=te.id;const we=Ee.lastIndexOf("~");return we!==-1&&(Ee=Ee.substring(0,we)),ie&&(Ee=`${Ee}~${ie}`),{id:Ee}}H.modify=A;function E(te,ie){var Ee,we;return te.id===ie.id&&((Ee=te.color)===null||Ee===void 0?void 0:Ee.id)===((we=ie.color)===null||we===void 0?void 0:we.id)}H.isEqual=E;function Q(te,ie){return{id:te.id,color:ie?o(ie):void 0}}H.asThemeIcon=Q,H.asClassNameArray=B.dT.asClassNameArray,H.asClassName=B.dT.asClassName,H.asCSSSelector=B.dT.asCSSSelector})(K||(K={}));function D(H){switch(H){case Z.e.DARK:return"vs-dark";case Z.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const f={ThemingContribution:"base.contributions.theming"};class u{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new q.Q5}onColorThemeChange(L){return this.themingParticipants.push(L),this.onThemingParticipantAddedEmitter.fire(L),(0,ve.OF)(()=>{const w=this.themingParticipants.indexOf(L);this.themingParticipants.splice(w,1)})}getThemingParticipants(){return this.themingParticipants}}let g=new u;oe.B.add(f.ThemingContribution,g);function m(H){return g.onColorThemeChange(H)}class I extends ve.JT{constructor(L){super(),this.themeService=L,this.theme=L.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(w=>this.onThemeChange(w)))}onThemeChange(L){this.theme=L,this.updateStyles()}updateStyles(){}}},31561:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return te}});var B=b(92413),q=b(400),ve=b(33606),fe=b(37061),oe=b(35593),Z=b(92310),_e=b.n(Z),le=b(8654),o=b(59301),K=b(10228),D=b(16089),f=K.Z.ESC,u=K.Z.TAB;function g(ie){var Ee=ie.visible,we=ie.triggerRef,xe=ie.onVisibleChange,he=ie.autoFocus,V=ie.overlayRef,T=o.useRef(!1),C=function(){if(Ee){var y,v;(y=we.current)===null||y===void 0||(v=y.focus)===null||v===void 0||v.call(y),xe==null||xe(!1)}},R=function(){var y;return(y=V.current)!==null&&y!==void 0&&y.focus?(V.current.focus(),T.current=!0,!0):!1},z=function(y){switch(y.keyCode){case f:C();break;case u:{var v=!1;T.current||(v=R()),v?y.preventDefault():C();break}}};o.useEffect(function(){return Ee?(window.addEventListener("keydown",z),he&&(0,D.Z)(R,3),function(){window.removeEventListener("keydown",z),T.current=!1}):function(){T.current=!1}},[Ee])}var m=(0,o.forwardRef)(function(ie,Ee){var we=ie.overlay,xe=ie.arrow,he=ie.prefixCls,V=(0,o.useMemo)(function(){var C;return typeof we=="function"?C=we():C=we,C},[we]),T=(0,le.sQ)(Ee,V==null?void 0:V.ref);return o.createElement(o.Fragment,null,xe&&o.createElement("div",{className:"".concat(he,"-arrow")}),o.cloneElement(V,{ref:(0,le.Yr)(V)?T:void 0}))}),I=m,H={adjustX:1,adjustY:1},L=[0,0],w={topLeft:{points:["bl","tl"],overflow:H,offset:[0,-4],targetOffset:L},top:{points:["bc","tc"],overflow:H,offset:[0,-4],targetOffset:L},topRight:{points:["br","tr"],overflow:H,offset:[0,-4],targetOffset:L},bottomLeft:{points:["tl","bl"],overflow:H,offset:[0,4],targetOffset:L},bottom:{points:["tc","bc"],overflow:H,offset:[0,4],targetOffset:L},bottomRight:{points:["tr","br"],overflow:H,offset:[0,4],targetOffset:L}},O=w,A=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function E(ie,Ee){var we,xe=ie.arrow,he=xe===void 0?!1:xe,V=ie.prefixCls,T=V===void 0?"rc-dropdown":V,C=ie.transitionName,R=ie.animation,z=ie.align,Y=ie.placement,y=Y===void 0?"bottomLeft":Y,v=ie.placements,$=v===void 0?O:v,j=ie.getPopupContainer,me=ie.showAction,Se=ie.hideAction,Te=ie.overlayClassName,De=ie.overlayStyle,qe=ie.visible,lt=ie.trigger,We=lt===void 0?["hover"]:lt,Tt=ie.autoFocus,dt=ie.overlay,wt=ie.children,Rt=ie.onVisibleChange,_t=(0,fe.Z)(ie,A),Pe=o.useState(),J=(0,ve.Z)(Pe,2),ue=J[0],W=J[1],M="visible"in ie?qe:ue,pe=o.useRef(null),k=o.useRef(null),N=o.useRef(null);o.useImperativeHandle(Ee,function(){return pe.current});var P=function(ze){W(ze),Rt==null||Rt(ze)};g({visible:M,triggerRef:N,onVisibleChange:P,autoFocus:Tt,overlayRef:k});var ne=function(ze){var Ie=ie.onOverlayClick;W(!1),Ie&&Ie(ze)},F=function(){return o.createElement(I,{ref:k,overlay:dt,prefixCls:T,arrow:he})},se=function(){return typeof dt=="function"?F:F()},de=function(){var ze=ie.minOverlayWidthMatchTrigger,Ie=ie.alignPoint;return"minOverlayWidthMatchTrigger"in ie?ze:!Ie},ge=function(){var ze=ie.openClassName;return ze!==void 0?ze:"".concat(T,"-open")},be=o.cloneElement(wt,{className:_e()((we=wt.props)===null||we===void 0?void 0:we.className,M&&ge()),ref:(0,le.Yr)(wt)?(0,le.sQ)(N,wt.ref):void 0}),Le=Se;return!Le&&We.indexOf("contextMenu")!==-1&&(Le=["click"]),o.createElement(oe.Z,(0,B.Z)({builtinPlacements:$},_t,{prefixCls:T,ref:pe,popupClassName:_e()(Te,(0,q.Z)({},"".concat(T,"-show-arrow"),he)),popupStyle:De,action:We,showAction:me,hideAction:Le,popupPlacement:y,popupAlign:z,popupTransitionName:C,popupAnimation:R,popupVisible:M,stretch:de()?"minWidth":"",popup:se(),onPopupVisibleChange:P,onPopupClick:ne,getPopupContainer:j}),be)}var Q=o.forwardRef(E),te=Q},15285:function(bt,ke,b){"use strict";b.d(ke,{iz:function(){return At},ck:function(){return ut},BW:function(){return qt},sN:function(){return ut},Wd:function(){return Qe},ZP:function(){return Et},Xl:function(){return we}});var B=b(92413),q=b(400),ve=b(33708),fe=b(26407),oe=b(33606),Z=b(37061),_e=b(92310),le=b.n(_e),o=b(11780),K=b(18929),D=b(13697),f=b(48736),u=b(59301),g=b(4676),m=u.createContext(null);function I(Oe,Me){return Oe===void 0?null:"".concat(Oe,"-").concat(Me)}function H(Oe){var Me=u.useContext(m);return I(Me,Oe)}var L=b(80547),w=["children","locked"],O=u.createContext(null);function A(Oe,Me){var He=(0,ve.Z)({},Oe);return Object.keys(Me).forEach(function(nt){var Ye=Me[nt];Ye!==void 0&&(He[nt]=Ye)}),He}function E(Oe){var Me=Oe.children,He=Oe.locked,nt=(0,Z.Z)(Oe,w),Ye=u.useContext(O),et=(0,L.Z)(function(){return A(Ye,nt)},[Ye,nt],function(Je,Dt){return!He&&(Je[0]!==Dt[0]||!(0,D.Z)(Je[1],Dt[1],!0))});return u.createElement(O.Provider,{value:et},Me)}var Q=[],te=u.createContext(null);function ie(){return u.useContext(te)}var Ee=u.createContext(Q);function we(Oe){var Me=u.useContext(Ee);return u.useMemo(function(){return Oe!==void 0?[].concat((0,fe.Z)(Me),[Oe]):Me},[Me,Oe])}var xe=u.createContext(null),he=u.createContext({}),V=he,T=b(29194);function C(Oe){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,T.Z)(Oe)){var He=Oe.nodeName.toLowerCase(),nt=["input","select","textarea","button"].includes(He)||Oe.isContentEditable||He==="a"&&!!Oe.getAttribute("href"),Ye=Oe.getAttribute("tabindex"),et=Number(Ye),Je=null;return Ye&&!Number.isNaN(et)?Je=et:nt&&Je===null&&(Je=0),nt&&Oe.disabled&&(Je=null),Je!==null&&(Je>=0||Me&&Je<0)}return!1}function R(Oe){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,He=(0,fe.Z)(Oe.querySelectorAll("*")).filter(function(nt){return C(nt,Me)});return C(Oe,Me)&&He.unshift(Oe),He}var z=null;function Y(){z=document.activeElement}function y(){z=null}function v(){if(z)try{z.focus()}catch(Oe){}}function $(Oe,Me){if(Me.keyCode===9){var He=R(Oe),nt=He[Me.shiftKey?0:He.length-1],Ye=nt===document.activeElement||Oe===document.activeElement;if(Ye){var et=He[Me.shiftKey?He.length-1:0];et.focus(),Me.preventDefault()}}}var j=b(10228),me=b(16089),Se=j.Z.LEFT,Te=j.Z.RIGHT,De=j.Z.UP,qe=j.Z.DOWN,lt=j.Z.ENTER,We=j.Z.ESC,Tt=j.Z.HOME,dt=j.Z.END,wt=[De,qe,Se,Te];function Rt(Oe,Me,He,nt){var Ye,et,Je,Dt,Zt="prev",Ut="next",rn="children",on="parent";if(Oe==="inline"&&nt===lt)return{inlineTrigger:!0};var _n=(Ye={},(0,q.Z)(Ye,De,Zt),(0,q.Z)(Ye,qe,Ut),Ye),cn=(et={},(0,q.Z)(et,Se,He?Ut:Zt),(0,q.Z)(et,Te,He?Zt:Ut),(0,q.Z)(et,qe,rn),(0,q.Z)(et,lt,rn),et),Xt=(Je={},(0,q.Z)(Je,De,Zt),(0,q.Z)(Je,qe,Ut),(0,q.Z)(Je,lt,rn),(0,q.Z)(Je,We,on),(0,q.Z)(Je,Se,He?rn:on),(0,q.Z)(Je,Te,He?on:rn),Je),An={inline:_n,horizontal:cn,vertical:Xt,inlineSub:_n,horizontalSub:Xt,verticalSub:Xt},gn=(Dt=An["".concat(Oe).concat(Me?"":"Sub")])===null||Dt===void 0?void 0:Dt[nt];switch(gn){case Zt:return{offset:-1,sibling:!0};case Ut:return{offset:1,sibling:!0};case on:return{offset:-1,sibling:!1};case rn:return{offset:1,sibling:!1};default:return null}}function _t(Oe){for(var Me=Oe;Me;){if(Me.getAttribute("data-menu-list"))return Me;Me=Me.parentElement}return null}function Pe(Oe,Me){for(var He=Oe||document.activeElement;He;){if(Me.has(He))return He;He=He.parentElement}return null}function J(Oe,Me){var He=R(Oe,!0);return He.filter(function(nt){return Me.has(nt)})}function ue(Oe,Me,He){var nt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Oe)return null;var Ye=J(Oe,Me),et=Ye.length,Je=Ye.findIndex(function(Dt){return He===Dt});return nt<0?Je===-1?Je=et-1:Je-=1:nt>0&&(Je+=1),Je=(Je+et)%et,Ye[Je]}var W=function(Me,He){var nt=new Set,Ye=new Map,et=new Map;return Me.forEach(function(Je){var Dt=document.querySelector("[data-menu-id='".concat(I(He,Je),"']"));Dt&&(nt.add(Dt),et.set(Dt,Je),Ye.set(Je,Dt))}),{elements:nt,key2element:Ye,element2key:et}};function M(Oe,Me,He,nt,Ye,et,Je,Dt,Zt,Ut){var rn=u.useRef(),on=u.useRef();on.current=Me;var _n=function(){me.Z.cancel(rn.current)};return u.useEffect(function(){return function(){_n()}},[]),function(cn){var Xt=cn.which;if([].concat(wt,[lt,We,Tt,dt]).includes(Xt)){var An=et(),gn=W(An,nt),On=gn,wn=On.elements,xn=On.key2element,vn=On.element2key,En=xn.get(Me),Cn=Pe(En,wn),Un=vn.get(Cn),Ln=Rt(Oe,Je(Un,!0).length===1,He,Xt);if(!Ln&&Xt!==Tt&&Xt!==dt)return;(wt.includes(Xt)||[Tt,dt].includes(Xt))&&cn.preventDefault();var hn=function(jn){if(jn){var Vn=jn,li=jn.querySelector("a");li!=null&&li.getAttribute("href")&&(Vn=li);var Bt=vn.get(jn);Dt(Bt),_n(),rn.current=(0,me.Z)(function(){on.current===Bt&&Vn.focus()})}};if([Tt,dt].includes(Xt)||Ln.sibling||!Cn){var $t;!Cn||Oe==="inline"?$t=Ye.current:$t=_t(Cn);var $n,Pn=J($t,wn);Xt===Tt?$n=Pn[0]:Xt===dt?$n=Pn[Pn.length-1]:$n=ue($t,wn,Cn,Ln.offset),hn($n)}else if(Ln.inlineTrigger)Zt(Un);else if(Ln.offset>0)Zt(Un,!0),_n(),rn.current=(0,me.Z)(function(){gn=W(An,nt);var Jn=Cn.getAttribute("aria-controls"),jn=document.getElementById(Jn),Vn=ue(jn,gn.elements);hn(Vn)},5);else if(Ln.offset<0){var Kn=Je(Un,!0),Yn=Kn[Kn.length-2],ti=xn.get(Yn);Zt(Yn,!1),hn(ti)}}Ut==null||Ut(cn)}}function pe(Oe){Promise.resolve().then(Oe)}var k="__RC_UTIL_PATH_SPLIT__",N=function(Me){return Me.join(k)},P=function(Me){return Me.split(k)},ne="rc-menu-more";function F(){var Oe=u.useState({}),Me=(0,oe.Z)(Oe,2),He=Me[1],nt=(0,u.useRef)(new Map),Ye=(0,u.useRef)(new Map),et=u.useState([]),Je=(0,oe.Z)(et,2),Dt=Je[0],Zt=Je[1],Ut=(0,u.useRef)(0),rn=(0,u.useRef)(!1),on=function(){rn.current||He({})},_n=(0,u.useCallback)(function(xn,vn){var En=N(vn);Ye.current.set(En,xn),nt.current.set(xn,En),Ut.current+=1;var Cn=Ut.current;pe(function(){Cn===Ut.current&&on()})},[]),cn=(0,u.useCallback)(function(xn,vn){var En=N(vn);Ye.current.delete(En),nt.current.delete(xn)},[]),Xt=(0,u.useCallback)(function(xn){Zt(xn)},[]),An=(0,u.useCallback)(function(xn,vn){var En=nt.current.get(xn)||"",Cn=P(En);return vn&&Dt.includes(Cn[0])&&Cn.unshift(ne),Cn},[Dt]),gn=(0,u.useCallback)(function(xn,vn){return xn.some(function(En){var Cn=An(En,!0);return Cn.includes(vn)})},[An]),On=function(){var vn=(0,fe.Z)(nt.current.keys());return Dt.length&&vn.push(ne),vn},wn=(0,u.useCallback)(function(xn){var vn="".concat(nt.current.get(xn)).concat(k),En=new Set;return(0,fe.Z)(Ye.current.keys()).forEach(function(Cn){Cn.startsWith(vn)&&En.add(Ye.current.get(Cn))}),En},[]);return u.useEffect(function(){return function(){rn.current=!0}},[]),{registerPath:_n,unregisterPath:cn,refreshOverflowKeys:Xt,isSubPathKey:gn,getKeyPath:An,getKeys:On,getSubPathKeys:wn}}function se(Oe){var Me=u.useRef(Oe);Me.current=Oe;var He=u.useCallback(function(){for(var nt,Ye=arguments.length,et=new Array(Ye),Je=0;Je<Ye;Je++)et[Je]=arguments[Je];return(nt=Me.current)===null||nt===void 0?void 0:nt.call.apply(nt,[Me].concat(et))},[]);return Oe?He:void 0}var de=Math.random().toFixed(5).toString().slice(2),ge=0;function be(Oe){var Me=(0,K.Z)(Oe,{value:Oe}),He=(0,oe.Z)(Me,2),nt=He[0],Ye=He[1];return u.useEffect(function(){ge+=1;var et="".concat(de,"-").concat(ge);Ye("rc-menu-uuid-".concat(et))},[]),nt}var Le=b(6909),Ne=b(4771),ze=b(9427),Ie=b(25440),Ke=b(2738),je=b(8654);function Ce(Oe,Me,He,nt){var Ye=u.useContext(O),et=Ye.activeKey,Je=Ye.onActive,Dt=Ye.onInactive,Zt={active:et===Oe};return Me||(Zt.onMouseEnter=function(Ut){He==null||He({key:Oe,domEvent:Ut}),Je(Oe)},Zt.onMouseLeave=function(Ut){nt==null||nt({key:Oe,domEvent:Ut}),Dt(Oe)}),Zt}function vt(Oe){var Me=u.useContext(O),He=Me.mode,nt=Me.rtl,Ye=Me.inlineIndent;if(He!=="inline")return null;var et=Oe;return nt?{paddingRight:et*Ye}:{paddingLeft:et*Ye}}function st(Oe){var Me=Oe.icon,He=Oe.props,nt=Oe.children,Ye;return Me===null||Me===!1?null:(typeof Me=="function"?Ye=u.createElement(Me,(0,ve.Z)({},He)):typeof Me!="boolean"&&(Ye=Me),Ye||nt||null)}var St=["item"];function Ze(Oe){var Me=Oe.item,He=(0,Z.Z)(Oe,St);return Object.defineProperty(He,"item",{get:function(){return(0,f.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),Me}}),He}var Ht=["title","attribute","elementRef"],Kt=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],zt=["active"],Ot=function(Oe){(0,ze.Z)(He,Oe);var Me=(0,Ie.Z)(He);function He(){return(0,Le.Z)(this,He),Me.apply(this,arguments)}return(0,Ne.Z)(He,[{key:"render",value:function(){var Ye=this.props,et=Ye.title,Je=Ye.attribute,Dt=Ye.elementRef,Zt=(0,Z.Z)(Ye,Ht),Ut=(0,Ke.Z)(Zt,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,f.ZP)(!Je,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),u.createElement(o.Z.Item,(0,B.Z)({},Je,{title:typeof et=="string"?et:void 0},Ut,{ref:Dt}))}}]),He}(u.Component),ht=u.forwardRef(function(Oe,Me){var He,nt=Oe.style,Ye=Oe.className,et=Oe.eventKey,Je=Oe.warnKey,Dt=Oe.disabled,Zt=Oe.itemIcon,Ut=Oe.children,rn=Oe.role,on=Oe.onMouseEnter,_n=Oe.onMouseLeave,cn=Oe.onClick,Xt=Oe.onKeyDown,An=Oe.onFocus,gn=(0,Z.Z)(Oe,Kt),On=H(et),wn=u.useContext(O),xn=wn.prefixCls,vn=wn.onItemClick,En=wn.disabled,Cn=wn.overflowDisabled,Un=wn.itemIcon,Ln=wn.selectedKeys,hn=wn.onActive,$t=u.useContext(V),$n=$t._internalRenderMenuItem,Pn="".concat(xn,"-item"),Kn=u.useRef(),Yn=u.useRef(),ti=En||Dt,Jn=(0,je.x1)(Me,Yn),jn=we(et),Vn=function(Wn){return{key:et,keyPath:(0,fe.Z)(jn).reverse(),item:Kn.current,domEvent:Wn}},li=Zt||Un,Bt=Ce(et,ti,on,_n),Gt=Bt.active,pn=(0,Z.Z)(Bt,zt),Tn=Ln.includes(et),kn=vt(jn.length),Xn=function(Wn){if(!ti){var ni=Vn(Wn);cn==null||cn(Ze(ni)),vn(ni)}},Mn=function(Wn){if(Xt==null||Xt(Wn),Wn.which===j.Z.ENTER){var ni=Vn(Wn);cn==null||cn(Ze(ni)),vn(ni)}},ui=function(Wn){hn(et),An==null||An(Wn)},fi={};Oe.role==="option"&&(fi["aria-selected"]=Tn);var vi=u.createElement(Ot,(0,B.Z)({ref:Kn,elementRef:Jn,role:rn===null?"none":rn||"menuitem",tabIndex:Dt?null:-1,"data-menu-id":Cn&&On?null:On},gn,pn,fi,{component:"li","aria-disabled":Dt,style:(0,ve.Z)((0,ve.Z)({},kn),nt),className:le()(Pn,(He={},(0,q.Z)(He,"".concat(Pn,"-active"),Gt),(0,q.Z)(He,"".concat(Pn,"-selected"),Tn),(0,q.Z)(He,"".concat(Pn,"-disabled"),ti),He),Ye),onClick:Xn,onKeyDown:Mn,onFocus:ui}),Ut,u.createElement(st,{props:(0,ve.Z)((0,ve.Z)({},Oe),{},{isSelected:Tn}),icon:li}));return $n&&(vi=$n(vi,Oe,{selected:Tn})),vi});function yt(Oe,Me){var He=Oe.eventKey,nt=ie(),Ye=we(He);return u.useEffect(function(){if(nt)return nt.registerPath(He,Ye),function(){nt.unregisterPath(He,Ye)}},[Ye]),nt?null:u.createElement(ht,(0,B.Z)({},Oe,{ref:Me}))}var ut=u.forwardRef(yt),Ct=["className","children"],ft=function(Me,He){var nt=Me.className,Ye=Me.children,et=(0,Z.Z)(Me,Ct),Je=u.useContext(O),Dt=Je.prefixCls,Zt=Je.mode,Ut=Je.rtl;return u.createElement("ul",(0,B.Z)({className:le()(Dt,Ut&&"".concat(Dt,"-rtl"),"".concat(Dt,"-sub"),"".concat(Dt,"-").concat(Zt==="inline"?"inline":"vertical"),nt),role:"menu"},et,{"data-menu-list":!0,ref:He}),Ye)},Mt=u.forwardRef(ft);Mt.displayName="SubMenuList";var Qt=Mt,Jt=b(11592);function ln(Oe,Me){return(0,Jt.Z)(Oe).map(function(He,nt){if(u.isValidElement(He)){var Ye,et,Je=He.key,Dt=(Ye=(et=He.props)===null||et===void 0?void 0:et.eventKey)!==null&&Ye!==void 0?Ye:Je,Zt=Dt==null;Zt&&(Dt="tmp_key-".concat([].concat((0,fe.Z)(Me),[nt]).join("-")));var Ut={key:Dt,eventKey:Dt};return u.cloneElement(He,Ut)}return He})}var an=b(35593),jt={adjustX:1,adjustY:1},Wt={topLeft:{points:["bl","tl"],overflow:jt},topRight:{points:["br","tr"],overflow:jt},bottomLeft:{points:["tl","bl"],overflow:jt},bottomRight:{points:["tr","br"],overflow:jt},leftTop:{points:["tr","tl"],overflow:jt},leftBottom:{points:["br","bl"],overflow:jt},rightTop:{points:["tl","tr"],overflow:jt},rightBottom:{points:["bl","br"],overflow:jt}},pt={topLeft:{points:["bl","tl"],overflow:jt},topRight:{points:["br","tr"],overflow:jt},bottomLeft:{points:["tl","bl"],overflow:jt},bottomRight:{points:["tr","br"],overflow:jt},rightTop:{points:["tr","tl"],overflow:jt},rightBottom:{points:["br","bl"],overflow:jt},leftTop:{points:["tl","tr"],overflow:jt},leftBottom:{points:["bl","br"],overflow:jt}},Xe=null;function c(Oe,Me,He){if(Me)return Me;if(He)return He[Oe]||He.other}var p={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function x(Oe){var Me=Oe.prefixCls,He=Oe.visible,nt=Oe.children,Ye=Oe.popup,et=Oe.popupStyle,Je=Oe.popupClassName,Dt=Oe.popupOffset,Zt=Oe.disabled,Ut=Oe.mode,rn=Oe.onVisibleChange,on=u.useContext(O),_n=on.getPopupContainer,cn=on.rtl,Xt=on.subMenuOpenDelay,An=on.subMenuCloseDelay,gn=on.builtinPlacements,On=on.triggerSubMenuAction,wn=on.forceSubMenuRender,xn=on.rootClassName,vn=on.motion,En=on.defaultMotions,Cn=u.useState(!1),Un=(0,oe.Z)(Cn,2),Ln=Un[0],hn=Un[1],$t=cn?(0,ve.Z)((0,ve.Z)({},pt),gn):(0,ve.Z)((0,ve.Z)({},Wt),gn),$n=p[Ut],Pn=c(Ut,vn,En),Kn=u.useRef(Pn);Ut!=="inline"&&(Kn.current=Pn);var Yn=(0,ve.Z)((0,ve.Z)({},Kn.current),{},{leavedClassName:"".concat(Me,"-hidden"),removeOnLeave:!1,motionAppear:!0}),ti=u.useRef();return u.useEffect(function(){return ti.current=(0,me.Z)(function(){hn(He)}),function(){me.Z.cancel(ti.current)}},[He]),u.createElement(an.Z,{prefixCls:Me,popupClassName:le()("".concat(Me,"-popup"),(0,q.Z)({},"".concat(Me,"-rtl"),cn),Je,xn),stretch:Ut==="horizontal"?"minWidth":null,getPopupContainer:_n,builtinPlacements:$t,popupPlacement:$n,popupVisible:Ln,popup:Ye,popupStyle:et,popupAlign:Dt&&{offset:Dt},action:Zt?[]:[On],mouseEnterDelay:Xt,mouseLeaveDelay:An,onPopupVisibleChange:rn,forceRender:wn,popupMotion:Yn,fresh:!0},nt)}var G=b(77900);function re(Oe){var Me=Oe.id,He=Oe.open,nt=Oe.keyPath,Ye=Oe.children,et="inline",Je=u.useContext(O),Dt=Je.prefixCls,Zt=Je.forceSubMenuRender,Ut=Je.motion,rn=Je.defaultMotions,on=Je.mode,_n=u.useRef(!1);_n.current=on===et;var cn=u.useState(!_n.current),Xt=(0,oe.Z)(cn,2),An=Xt[0],gn=Xt[1],On=_n.current?He:!1;u.useEffect(function(){_n.current&&gn(!1)},[on]);var wn=(0,ve.Z)({},c(et,Ut,rn));nt.length>1&&(wn.motionAppear=!1);var xn=wn.onVisibleChanged;return wn.onVisibleChanged=function(vn){return!_n.current&&!vn&&gn(!0),xn==null?void 0:xn(vn)},An?null:u.createElement(E,{mode:et,locked:!_n.current},u.createElement(G.default,(0,B.Z)({visible:On},wn,{forceRender:Zt,removeOnLeave:!1,leavedClassName:"".concat(Dt,"-hidden")}),function(vn){var En=vn.className,Cn=vn.style;return u.createElement(Qt,{id:Me,className:En,style:Cn},Ye)}))}var ye=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Ae=["active"],tt=function(Me){var He,nt=Me.style,Ye=Me.className,et=Me.title,Je=Me.eventKey,Dt=Me.warnKey,Zt=Me.disabled,Ut=Me.internalPopupClose,rn=Me.children,on=Me.itemIcon,_n=Me.expandIcon,cn=Me.popupClassName,Xt=Me.popupOffset,An=Me.popupStyle,gn=Me.onClick,On=Me.onMouseEnter,wn=Me.onMouseLeave,xn=Me.onTitleClick,vn=Me.onTitleMouseEnter,En=Me.onTitleMouseLeave,Cn=(0,Z.Z)(Me,ye),Un=H(Je),Ln=u.useContext(O),hn=Ln.prefixCls,$t=Ln.mode,$n=Ln.openKeys,Pn=Ln.disabled,Kn=Ln.overflowDisabled,Yn=Ln.activeKey,ti=Ln.selectedKeys,Jn=Ln.itemIcon,jn=Ln.expandIcon,Vn=Ln.onItemClick,li=Ln.onOpenChange,Bt=Ln.onActive,Gt=u.useContext(V),pn=Gt._internalRenderSubMenuItem,Tn=u.useContext(xe),kn=Tn.isSubPathKey,Xn=we(),Mn="".concat(hn,"-submenu"),ui=Pn||Zt,fi=u.useRef(),vi=u.useRef(),ri=on!=null?on:Jn,Wn=_n!=null?_n:jn,ni=$n.includes(Je),yi=!Kn&&ni,Si=kn(ti,Je),hi=Ce(Je,ui,vn,En),Ai=hi.active,pi=(0,Z.Z)(hi,Ae),Ci=u.useState(!1),ki=(0,oe.Z)(Ci,2),Pi=ki[0],zi=ki[1],ji=function(ci){ui||zi(ci)},wi=function(ci){ji(!0),On==null||On({key:Je,domEvent:ci})},qi=function(ci){ji(!1),wn==null||wn({key:Je,domEvent:ci})},Ni=u.useMemo(function(){return Ai||($t!=="inline"?Pi||kn([Yn],Je):!1)},[$t,Ai,Yn,Pi,Je,kn]),Ii=vt(Xn.length),er=function(ci){ui||(xn==null||xn({key:Je,domEvent:ci}),$t==="inline"&&li(Je,!ni))},Mi=se(function(si){gn==null||gn(Ze(si)),Vn(si)}),Di=function(ci){$t!=="inline"&&li(Je,ci)},Fi=function(){Bt(Je)},ai=Un&&"".concat(Un,"-popup"),Ti=u.createElement("div",(0,B.Z)({role:"menuitem",style:Ii,className:"".concat(Mn,"-title"),tabIndex:ui?null:-1,ref:fi,title:typeof et=="string"?et:null,"data-menu-id":Kn&&Un?null:Un,"aria-expanded":yi,"aria-haspopup":!0,"aria-controls":ai,"aria-disabled":ui,onClick:er,onFocus:Fi},pi),et,u.createElement(st,{icon:$t!=="horizontal"?Wn:void 0,props:(0,ve.Z)((0,ve.Z)({},Me),{},{isOpen:yi,isSubMenu:!0})},u.createElement("i",{className:"".concat(Mn,"-arrow")}))),Qn=u.useRef($t);if($t!=="inline"&&Xn.length>1?Qn.current="vertical":Qn.current=$t,!Kn){var mi=Qn.current;Ti=u.createElement(x,{mode:mi,prefixCls:Mn,visible:!Ut&&yi&&$t!=="inline",popupClassName:cn,popupOffset:Xt,popupStyle:An,popup:u.createElement(E,{mode:mi==="horizontal"?"vertical":mi},u.createElement(Qt,{id:ai,ref:vi},rn)),disabled:ui,onVisibleChange:Di},Ti)}var Ei=u.createElement(o.Z.Item,(0,B.Z)({role:"none"},Cn,{component:"li",style:nt,className:le()(Mn,"".concat(Mn,"-").concat($t),Ye,(He={},(0,q.Z)(He,"".concat(Mn,"-open"),yi),(0,q.Z)(He,"".concat(Mn,"-active"),Ni),(0,q.Z)(He,"".concat(Mn,"-selected"),Si),(0,q.Z)(He,"".concat(Mn,"-disabled"),ui),He)),onMouseEnter:wi,onMouseLeave:qi}),Ti,!Kn&&u.createElement(re,{id:ai,open:yi,keyPath:Xn},rn));return pn&&(Ei=pn(Ei,Me,{selected:Si,active:Ni,open:yi,disabled:ui})),u.createElement(E,{onItemClick:Mi,mode:$t==="horizontal"?"vertical":$t,itemIcon:ri,expandIcon:Wn},Ei)};function Qe(Oe){var Me=Oe.eventKey,He=Oe.children,nt=we(Me),Ye=ln(He,nt),et=ie();u.useEffect(function(){if(et)return et.registerPath(Me,nt),function(){et.unregisterPath(Me,nt)}},[nt]);var Je;return et?Je=Ye:Je=u.createElement(tt,Oe,Ye),u.createElement(Ee.Provider,{value:nt},Je)}var at=b(39559),Ft=["className","title","eventKey","children"],Vt=["children"],ot=function(Me){var He=Me.className,nt=Me.title,Ye=Me.eventKey,et=Me.children,Je=(0,Z.Z)(Me,Ft),Dt=u.useContext(O),Zt=Dt.prefixCls,Ut="".concat(Zt,"-item-group");return u.createElement("li",(0,B.Z)({role:"presentation"},Je,{onClick:function(on){return on.stopPropagation()},className:le()(Ut,He)}),u.createElement("div",{role:"presentation",className:"".concat(Ut,"-title"),title:typeof nt=="string"?nt:void 0},nt),u.createElement("ul",{role:"group",className:"".concat(Ut,"-list")},et))};function qt(Oe){var Me=Oe.children,He=(0,Z.Z)(Oe,Vt),nt=we(He.eventKey),Ye=ln(Me,nt),et=ie();return et?Ye:u.createElement(ot,(0,Ke.Z)(He,["warnKey"]),Ye)}function At(Oe){var Me=Oe.className,He=Oe.style,nt=u.useContext(O),Ye=nt.prefixCls,et=ie();return et?null:u.createElement("li",{role:"separator",className:le()("".concat(Ye,"-item-divider"),Me),style:He})}var Fe=["label","children","key","type"];function Be(Oe){return(Oe||[]).map(function(Me,He){if(Me&&(0,at.Z)(Me)==="object"){var nt=Me,Ye=nt.label,et=nt.children,Je=nt.key,Dt=nt.type,Zt=(0,Z.Z)(nt,Fe),Ut=Je!=null?Je:"tmp-".concat(He);return et||Dt==="group"?Dt==="group"?u.createElement(qt,(0,B.Z)({key:Ut},Zt,{title:Ye}),Be(et)):u.createElement(Qe,(0,B.Z)({key:Ut},Zt,{title:Ye}),Be(et)):Dt==="divider"?u.createElement(At,(0,B.Z)({key:Ut},Zt)):u.createElement(ut,(0,B.Z)({key:Ut},Zt),Ye)}return null}).filter(function(Me){return Me})}function ct(Oe,Me,He){var nt=Oe;return Me&&(nt=Be(Me)),ln(nt,He)}var It=["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"],Pt=[],dn=u.forwardRef(function(Oe,Me){var He,nt,Ye=Oe,et=Ye.prefixCls,Je=et===void 0?"rc-menu":et,Dt=Ye.rootClassName,Zt=Ye.style,Ut=Ye.className,rn=Ye.tabIndex,on=rn===void 0?0:rn,_n=Ye.items,cn=Ye.children,Xt=Ye.direction,An=Ye.id,gn=Ye.mode,On=gn===void 0?"vertical":gn,wn=Ye.inlineCollapsed,xn=Ye.disabled,vn=Ye.disabledOverflow,En=Ye.subMenuOpenDelay,Cn=En===void 0?.1:En,Un=Ye.subMenuCloseDelay,Ln=Un===void 0?.1:Un,hn=Ye.forceSubMenuRender,$t=Ye.defaultOpenKeys,$n=Ye.openKeys,Pn=Ye.activeKey,Kn=Ye.defaultActiveFirst,Yn=Ye.selectable,ti=Yn===void 0?!0:Yn,Jn=Ye.multiple,jn=Jn===void 0?!1:Jn,Vn=Ye.defaultSelectedKeys,li=Ye.selectedKeys,Bt=Ye.onSelect,Gt=Ye.onDeselect,pn=Ye.inlineIndent,Tn=pn===void 0?24:pn,kn=Ye.motion,Xn=Ye.defaultMotions,Mn=Ye.triggerSubMenuAction,ui=Mn===void 0?"hover":Mn,fi=Ye.builtinPlacements,vi=Ye.itemIcon,ri=Ye.expandIcon,Wn=Ye.overflowedIndicator,ni=Wn===void 0?"...":Wn,yi=Ye.overflowedIndicatorPopupClassName,Si=Ye.getPopupContainer,hi=Ye.onClick,Ai=Ye.onOpenChange,pi=Ye.onKeyDown,Ci=Ye.openAnimation,ki=Ye.openTransitionName,Pi=Ye._internalRenderMenuItem,zi=Ye._internalRenderSubMenuItem,ji=(0,Z.Z)(Ye,It),wi=u.useMemo(function(){return ct(cn,_n,Pt)},[cn,_n]),qi=u.useState(!1),Ni=(0,oe.Z)(qi,2),Ii=Ni[0],er=Ni[1],Mi=u.useRef(),Di=be(An),Fi=Xt==="rtl",ai=(0,K.Z)($t,{value:$n,postState:function(Fn){return Fn||Pt}}),Ti=(0,oe.Z)(ai,2),Qn=Ti[0],mi=Ti[1],Ei=function(Fn){var Zn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function ii(){mi(Fn),Ai==null||Ai(Fn)}Zn?(0,g.flushSync)(ii):ii()},si=u.useState(Qn),ci=(0,oe.Z)(si,2),Vi=ci[0],sr=ci[1],Bi=u.useRef(!1),dr=u.useMemo(function(){return(On==="inline"||On==="vertical")&&wn?["vertical",wn]:[On,!1]},[On,wn]),Wi=(0,oe.Z)(dr,2),Zi=Wi[0],sn=Wi[1],en=Zi==="inline",In=u.useState(Zi),qn=(0,oe.Z)(In,2),Dn=qn[0],Oi=qn[1],hr=u.useState(sn),ar=(0,oe.Z)(hr,2),tr=ar[0],ts=ar[1];u.useEffect(function(){Oi(Zi),ts(sn),Bi.current&&(en?mi(Vi):Ei(Pt))},[Zi,sn]);var ns=u.useState(0),Nr=(0,oe.Z)(ns,2),vr=Nr[0],is=Nr[1],Lr=vr>=wi.length-1||Dn!=="horizontal"||vn;u.useEffect(function(){en&&sr(Qn)},[Qn]),u.useEffect(function(){return Bi.current=!0,function(){Bi.current=!1}},[]);var bi=F(),Mr=bi.registerPath,Fr=bi.unregisterPath,Ui=bi.refreshOverflowKeys,Yi=bi.isSubPathKey,rs=bi.getKeyPath,Xi=bi.getKeys,ss=bi.getSubPathKeys,Br=u.useMemo(function(){return{registerPath:Mr,unregisterPath:Fr}},[Mr,Fr]),as=u.useMemo(function(){return{isSubPathKey:Yi}},[Yi]);u.useEffect(function(){Ui(Lr?Pt:wi.slice(vr+1).map(function(ei){return ei.key}))},[vr,Lr]);var os=(0,K.Z)(Pn||Kn&&((He=wi[0])===null||He===void 0?void 0:He.key),{value:Pn}),oi=(0,oe.Z)(os,2),fr=oi[0],or=oi[1],lr=se(function(ei){or(ei)}),ls=se(function(){or(void 0)});(0,u.useImperativeHandle)(Me,function(){return{list:Mi.current,focus:function(Fn){var Zn,ii=Xi(),Li=W(ii,Di),xr=Li.elements,Ir=Li.key2element,fs=Li.element2key,Kr=J(Mi.current,xr),Sr=fr!=null?fr:Kr[0]?fs.get(Kr[0]):(Zn=wi.find(function(Dr){return!Dr.props.disabled}))===null||Zn===void 0?void 0:Zn.key,pr=Ir.get(Sr);if(Sr&&pr){var gt;pr==null||(gt=pr.focus)===null||gt===void 0||gt.call(pr,Fn)}}}});var Hn=(0,K.Z)(Vn||[],{value:li,postState:function(Fn){return Array.isArray(Fn)?Fn:Fn==null?Pt:[Fn]}}),yr=(0,oe.Z)(Hn,2),nr=yr[0],Er=yr[1],us=function(Fn){if(ti){var Zn=Fn.key,ii=nr.includes(Zn),Li;jn?ii?Li=nr.filter(function(Ir){return Ir!==Zn}):Li=[].concat((0,fe.Z)(nr),[Zn]):Li=[Zn],Er(Li);var xr=(0,ve.Z)((0,ve.Z)({},Fn),{},{selectedKeys:Li});ii?Gt==null||Gt(xr):Bt==null||Bt(xr)}!jn&&Qn.length&&Dn!=="inline"&&Ei(Pt)},cs=se(function(ei){hi==null||hi(Ze(ei)),us(ei)}),Cr=se(function(ei,Fn){var Zn=Qn.filter(function(Li){return Li!==ei});if(Fn)Zn.push(ei);else if(Dn!=="inline"){var ii=ss(ei);Zn=Zn.filter(function(Li){return!ii.has(Li)})}(0,D.Z)(Qn,Zn,!0)||Ei(Zn,!0)}),Ur=function(Fn,Zn){var ii=Zn!=null?Zn:!Qn.includes(Fn);Cr(Fn,ii)},ds=M(Dn,fr,Fi,Di,Mi,Xi,rs,or,Ur,pi);u.useEffect(function(){er(!0)},[]);var hs=u.useMemo(function(){return{_internalRenderMenuItem:Pi,_internalRenderSubMenuItem:zi}},[Pi,zi]),br=Dn!=="horizontal"||vn?wi:wi.map(function(ei,Fn){return u.createElement(E,{key:ei.key,overflowDisabled:Fn>vr},ei)}),$r=u.createElement(o.Z,(0,B.Z)({id:An,ref:Mi,prefixCls:"".concat(Je,"-overflow"),component:"ul",itemComponent:ut,className:le()(Je,"".concat(Je,"-root"),"".concat(Je,"-").concat(Dn),Ut,(nt={},(0,q.Z)(nt,"".concat(Je,"-inline-collapsed"),tr),(0,q.Z)(nt,"".concat(Je,"-rtl"),Fi),nt),Dt),dir:Xt,style:Zt,role:"menu",tabIndex:on,data:br,renderRawItem:function(Fn){return Fn},renderRawRest:function(Fn){var Zn=Fn.length,ii=Zn?wi.slice(-Zn):null;return u.createElement(Qe,{eventKey:ne,title:ni,disabled:Lr,internalPopupClose:Zn===0,popupClassName:yi},ii)},maxCount:Dn!=="horizontal"||vn?o.Z.INVALIDATE:o.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Fn){is(Fn)},onKeyDown:ds},ji));return u.createElement(V.Provider,{value:hs},u.createElement(m.Provider,{value:Di},u.createElement(E,{prefixCls:Je,rootClassName:Dt,mode:Dn,openKeys:Qn,rtl:Fi,disabled:xn,motion:Ii?kn:null,defaultMotions:Ii?Xn:null,activeKey:fr,onActive:lr,onInactive:ls,selectedKeys:nr,inlineIndent:Tn,subMenuOpenDelay:Cn,subMenuCloseDelay:Ln,forceSubMenuRender:hn,builtinPlacements:fi,triggerSubMenuAction:ui,getPopupContainer:Si,itemIcon:vi,expandIcon:ri,onItemClick:cs,onOpenChange:Cr},u.createElement(xe.Provider,{value:as},$r),u.createElement("div",{style:{display:"none"},"aria-hidden":!0},u.createElement(te.Provider,{value:Br},wi)))))}),fn=dn,Lt=fn;Lt.Item=ut,Lt.SubMenu=Qe,Lt.ItemGroup=qt,Lt.Divider=At;var Et=Lt},11780:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return Y}});var B=b(92413),q=b(33708),ve=b(33606),fe=b(37061),oe=b(59301),Z=b(92310),_e=b.n(Z),le=b(29301),o=b(34280),K=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],D=void 0;function f(y,v){var $=y.prefixCls,j=y.invalidate,me=y.item,Se=y.renderItem,Te=y.responsive,De=y.responsiveDisabled,qe=y.registerSize,lt=y.itemKey,We=y.className,Tt=y.style,dt=y.children,wt=y.display,Rt=y.order,_t=y.component,Pe=_t===void 0?"div":_t,J=(0,fe.Z)(y,K),ue=Te&&!wt;function W(P){qe(lt,P)}oe.useEffect(function(){return function(){W(null)}},[]);var M=Se&&me!==D?Se(me,{index:Rt}):dt,pe;j||(pe={opacity:ue?0:1,height:ue?0:D,overflowY:ue?"hidden":D,order:Te?Rt:D,pointerEvents:ue?"none":D,position:ue?"absolute":D});var k={};ue&&(k["aria-hidden"]=!0);var N=oe.createElement(Pe,(0,B.Z)({className:_e()(!j&&$,We),style:(0,q.Z)((0,q.Z)({},pe),Tt)},k,J,{ref:v}),M);return Te&&(N=oe.createElement(le.Z,{onResize:function(ne){var F=ne.offsetWidth;W(F)},disabled:De},N)),N}var u=oe.forwardRef(f);u.displayName="Item";var g=u,m=b(6089),I=b(4676),H=b(16089);function L(y){if(typeof MessageChannel=="undefined")(0,H.Z)(y);else{var v=new MessageChannel;v.port1.onmessage=function(){return y()},v.port2.postMessage(void 0)}}function w(){var y=oe.useRef(null),v=function(j){y.current||(y.current=[],L(function(){(0,I.unstable_batchedUpdates)(function(){y.current.forEach(function(me){me()}),y.current=null})})),y.current.push(j)};return v}function O(y,v){var $=oe.useState(v),j=(0,ve.Z)($,2),me=j[0],Se=j[1],Te=(0,m.Z)(function(De){y(function(){Se(De)})});return[me,Te]}var A=oe.createContext(null),E=["component"],Q=["className"],te=["className"],ie=function(v,$){var j=oe.useContext(A);if(!j){var me=v.component,Se=me===void 0?"div":me,Te=(0,fe.Z)(v,E);return oe.createElement(Se,(0,B.Z)({},Te,{ref:$}))}var De=j.className,qe=(0,fe.Z)(j,Q),lt=v.className,We=(0,fe.Z)(v,te);return oe.createElement(A.Provider,{value:null},oe.createElement(g,(0,B.Z)({ref:$,className:_e()(De,lt)},qe,We)))},Ee=oe.forwardRef(ie);Ee.displayName="RawItem";var we=Ee,xe=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],he="responsive",V="invalidate";function T(y){return"+ ".concat(y.length," ...")}function C(y,v){var $=y.prefixCls,j=$===void 0?"rc-overflow":$,me=y.data,Se=me===void 0?[]:me,Te=y.renderItem,De=y.renderRawItem,qe=y.itemKey,lt=y.itemWidth,We=lt===void 0?10:lt,Tt=y.ssr,dt=y.style,wt=y.className,Rt=y.maxCount,_t=y.renderRest,Pe=y.renderRawRest,J=y.suffix,ue=y.component,W=ue===void 0?"div":ue,M=y.itemComponent,pe=y.onVisibleChange,k=(0,fe.Z)(y,xe),N=Tt==="full",P=w(),ne=O(P,null),F=(0,ve.Z)(ne,2),se=F[0],de=F[1],ge=se||0,be=O(P,new Map),Le=(0,ve.Z)(be,2),Ne=Le[0],ze=Le[1],Ie=O(P,0),Ke=(0,ve.Z)(Ie,2),je=Ke[0],Ce=Ke[1],vt=O(P,0),st=(0,ve.Z)(vt,2),St=st[0],Ze=st[1],Ht=O(P,0),Kt=(0,ve.Z)(Ht,2),zt=Kt[0],Ot=Kt[1],ht=(0,oe.useState)(null),yt=(0,ve.Z)(ht,2),ut=yt[0],Ct=yt[1],ft=(0,oe.useState)(null),Mt=(0,ve.Z)(ft,2),Qt=Mt[0],Jt=Mt[1],ln=oe.useMemo(function(){return Qt===null&&N?Number.MAX_SAFE_INTEGER:Qt||0},[Qt,se]),an=(0,oe.useState)(!1),jt=(0,ve.Z)(an,2),Wt=jt[0],pt=jt[1],Xe="".concat(j,"-item"),c=Math.max(je,St),p=Rt===he,x=Se.length&&p,G=Rt===V,re=x||typeof Rt=="number"&&Se.length>Rt,ye=(0,oe.useMemo)(function(){var Et=Se;return x?se===null&&N?Et=Se:Et=Se.slice(0,Math.min(Se.length,ge/We)):typeof Rt=="number"&&(Et=Se.slice(0,Rt)),Et},[Se,We,se,Rt,x]),Ae=(0,oe.useMemo)(function(){return x?Se.slice(ln+1):Se.slice(ye.length)},[Se,ye,x,ln]),tt=(0,oe.useCallback)(function(Et,Oe){var Me;return typeof qe=="function"?qe(Et):(Me=qe&&(Et==null?void 0:Et[qe]))!==null&&Me!==void 0?Me:Oe},[qe]),Qe=(0,oe.useCallback)(Te||function(Et){return Et},[Te]);function at(Et,Oe,Me){Qt===Et&&(Oe===void 0||Oe===ut)||(Jt(Et),Me||(pt(Et<Se.length-1),pe==null||pe(Et)),Oe!==void 0&&Ct(Oe))}function Ft(Et,Oe){de(Oe.clientWidth)}function Vt(Et,Oe){ze(function(Me){var He=new Map(Me);return Oe===null?He.delete(Et):He.set(Et,Oe),He})}function ot(Et,Oe){Ze(Oe),Ce(St)}function qt(Et,Oe){Ot(Oe)}function At(Et){return Ne.get(tt(ye[Et],Et))}(0,o.Z)(function(){if(ge&&typeof c=="number"&&ye){var Et=zt,Oe=ye.length,Me=Oe-1;if(!Oe){at(0,null);return}for(var He=0;He<Oe;He+=1){var nt=At(He);if(N&&(nt=nt||0),nt===void 0){at(He-1,void 0,!0);break}if(Et+=nt,Me===0&&Et<=ge||He===Me-1&&Et+At(Me)<=ge){at(Me,null);break}else if(Et+c>ge){at(He-1,Et-nt-zt+St);break}}J&&At(0)+zt>ge&&Ct(null)}},[ge,Ne,St,zt,tt,ye]);var Fe=Wt&&!!Ae.length,Be={};ut!==null&&x&&(Be={position:"absolute",left:ut,top:0});var ct={prefixCls:Xe,responsive:x,component:M,invalidate:G},It=De?function(Et,Oe){var Me=tt(Et,Oe);return oe.createElement(A.Provider,{key:Me,value:(0,q.Z)((0,q.Z)({},ct),{},{order:Oe,item:Et,itemKey:Me,registerSize:Vt,display:Oe<=ln})},De(Et,Oe))}:function(Et,Oe){var Me=tt(Et,Oe);return oe.createElement(g,(0,B.Z)({},ct,{order:Oe,key:Me,item:Et,renderItem:Qe,itemKey:Me,registerSize:Vt,display:Oe<=ln}))},Pt={order:Fe?ln:Number.MAX_SAFE_INTEGER,className:"".concat(Xe,"-rest"),registerSize:ot,display:Fe},dn=_t||T,fn=Pe?oe.createElement(A.Provider,{value:(0,q.Z)((0,q.Z)({},ct),Pt)},Pe(Ae)):oe.createElement(g,(0,B.Z)({},ct,Pt),typeof dn=="function"?dn(Ae):dn),Lt=oe.createElement(W,(0,B.Z)({className:_e()(!G&&j,wt),style:dt,ref:v},k),ye.map(It),re?fn:null,J&&oe.createElement(g,(0,B.Z)({},ct,{responsive:p,responsiveDisabled:!x,order:ln,className:"".concat(Xe,"-suffix"),registerSize:qt,display:!0,style:Be}),J));return p?oe.createElement(le.Z,{onResize:Ft,disabled:!x},Lt):Lt}var R=oe.forwardRef(C);R.displayName="Overflow",R.Item=we,R.RESPONSIVE=he,R.INVALIDATE=V;var z=R,Y=z},29301:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return V}});var B=b(92413),q=b(59301),ve=b(11592),fe=b(48736),oe=b(33708),Z=b(39559),_e=b(76846),le=b(8654),o=q.createContext(null);function K(T){var C=T.children,R=T.onBatchResize,z=q.useRef(0),Y=q.useRef([]),y=q.useContext(o),v=q.useCallback(function($,j,me){z.current+=1;var Se=z.current;Y.current.push({size:$,element:j,data:me}),Promise.resolve().then(function(){Se===z.current&&(R==null||R(Y.current),Y.current=[])}),y==null||y($,j,me)},[R,y]);return q.createElement(o.Provider,{value:v},C)}var D=b(76374),f=new Map;function u(T){T.forEach(function(C){var R,z=C.target;(R=f.get(z))===null||R===void 0||R.forEach(function(Y){return Y(z)})})}var g=new D.Z(u),m=null,I=null;function H(T,C){f.has(T)||(f.set(T,new Set),g.observe(T)),f.get(T).add(C)}function L(T,C){f.has(T)&&(f.get(T).delete(C),f.get(T).size||(g.unobserve(T),f.delete(T)))}var w=b(6909),O=b(4771),A=b(9427),E=b(25440),Q=function(T){(0,A.Z)(R,T);var C=(0,E.Z)(R);function R(){return(0,w.Z)(this,R),C.apply(this,arguments)}return(0,O.Z)(R,[{key:"render",value:function(){return this.props.children}}]),R}(q.Component);function te(T,C){var R=T.children,z=T.disabled,Y=q.useRef(null),y=q.useRef(null),v=q.useContext(o),$=typeof R=="function",j=$?R(Y):R,me=q.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Se=!$&&q.isValidElement(j)&&(0,le.Yr)(j),Te=Se?(0,le.C4)(j):null,De=(0,le.x1)(Te,Y),qe=function(){var dt;return(0,_e.ZP)(Y.current)||(Y.current&&(0,Z.Z)(Y.current)==="object"?(0,_e.ZP)((dt=Y.current)===null||dt===void 0?void 0:dt.nativeElement):null)||(0,_e.ZP)(y.current)};q.useImperativeHandle(C,function(){return qe()});var lt=q.useRef(T);lt.current=T;var We=q.useCallback(function(Tt){var dt=lt.current,wt=dt.onResize,Rt=dt.data,_t=Tt.getBoundingClientRect(),Pe=_t.width,J=_t.height,ue=Tt.offsetWidth,W=Tt.offsetHeight,M=Math.floor(Pe),pe=Math.floor(J);if(me.current.width!==M||me.current.height!==pe||me.current.offsetWidth!==ue||me.current.offsetHeight!==W){var k={width:M,height:pe,offsetWidth:ue,offsetHeight:W};me.current=k;var N=ue===Math.round(Pe)?Pe:ue,P=W===Math.round(J)?J:W,ne=(0,oe.Z)((0,oe.Z)({},k),{},{offsetWidth:N,offsetHeight:P});v==null||v(ne,Tt,Rt),wt&&Promise.resolve().then(function(){wt(ne,Tt)})}},[]);return q.useEffect(function(){var Tt=qe();return Tt&&!z&&H(Tt,We),function(){return L(Tt,We)}},[Y.current,z]),q.createElement(Q,{ref:y},Se?q.cloneElement(j,{ref:De}):j)}var ie=q.forwardRef(te),Ee=ie,we="rc-observer-key";function xe(T,C){var R=T.children,z=typeof R=="function"?[R]:(0,ve.Z)(R);return z.map(function(Y,y){var v=(Y==null?void 0:Y.key)||"".concat(we,"-").concat(y);return q.createElement(Ee,(0,B.Z)({},T,{key:v,ref:y===0?C:void 0}),Y)})}var he=q.forwardRef(xe);he.Collection=K;var V=he},55477:function(bt,ke,b){"use strict";b.d(ke,{G:function(){return u},Z:function(){return H}});var B=b(92413),q=b(33708),ve=b(37061),fe=b(35593),oe=b(59301),Z={shiftX:64,adjustY:1},_e={adjustX:1,shiftY:!0},le=[0,0],o={left:{points:["cr","cl"],overflow:_e,offset:[-4,0],targetOffset:le},right:{points:["cl","cr"],overflow:_e,offset:[4,0],targetOffset:le},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:le},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:le},topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:le},leftTop:{points:["tr","tl"],overflow:_e,offset:[-4,0],targetOffset:le},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:le},rightTop:{points:["tl","tr"],overflow:_e,offset:[4,0],targetOffset:le},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:le},rightBottom:{points:["bl","br"],overflow:_e,offset:[4,0],targetOffset:le},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:le},leftBottom:{points:["br","bl"],overflow:_e,offset:[-4,0],targetOffset:le}},K=null,D=b(92310),f=b.n(D);function u(L){var w=L.children,O=L.prefixCls,A=L.id,E=L.overlayInnerStyle,Q=L.className,te=L.style;return oe.createElement("div",{className:f()("".concat(O,"-content"),Q),style:te},oe.createElement("div",{className:"".concat(O,"-inner"),id:A,role:"tooltip",style:E},typeof w=="function"?w():w))}var g=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],m=function(w,O){var A=w.overlayClassName,E=w.trigger,Q=E===void 0?["hover"]:E,te=w.mouseEnterDelay,ie=te===void 0?0:te,Ee=w.mouseLeaveDelay,we=Ee===void 0?.1:Ee,xe=w.overlayStyle,he=w.prefixCls,V=he===void 0?"rc-tooltip":he,T=w.children,C=w.onVisibleChange,R=w.afterVisibleChange,z=w.transitionName,Y=w.animation,y=w.motion,v=w.placement,$=v===void 0?"right":v,j=w.align,me=j===void 0?{}:j,Se=w.destroyTooltipOnHide,Te=Se===void 0?!1:Se,De=w.defaultVisible,qe=w.getTooltipContainer,lt=w.overlayInnerStyle,We=w.arrowContent,Tt=w.overlay,dt=w.id,wt=w.showArrow,Rt=wt===void 0?!0:wt,_t=(0,ve.Z)(w,g),Pe=(0,oe.useRef)(null);(0,oe.useImperativeHandle)(O,function(){return Pe.current});var J=(0,q.Z)({},_t);"visible"in w&&(J.popupVisible=w.visible);var ue=function(){return oe.createElement(u,{key:"content",prefixCls:V,id:dt,overlayInnerStyle:lt},Tt)};return oe.createElement(fe.Z,(0,B.Z)({popupClassName:A,prefixCls:V,popup:ue,action:Q,builtinPlacements:o,popupPlacement:$,ref:Pe,popupAlign:me,getPopupContainer:qe,onPopupVisibleChange:C,afterPopupVisibleChange:R,popupTransitionName:z,popupAnimation:Y,popupMotion:y,defaultPopupVisible:De,autoDestroy:Te,mouseLeaveDelay:we,popupStyle:xe,mouseEnterDelay:ie,arrow:Rt},J),T)},I=(0,oe.forwardRef)(m),H=I},39417:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return ie}});var B=b(92413),q=b(400),ve=b(37061),fe=b(33708),oe=b(6909),Z=b(4771),_e=b(25314),le=b(9427),o=b(25440),K=b(92310),D=b.n(K),f=b(26112),u=b(59301),g=b(39378),m=function(we){for(var xe=we.prefixCls,he=we.level,V=we.isStart,T=we.isEnd,C="".concat(xe,"-indent-unit"),R=[],z=0;z<he;z+=1){var Y;R.push(u.createElement("span",{key:z,className:D()(C,(Y={},(0,q.Z)(Y,"".concat(C,"-start"),V[z]),(0,q.Z)(Y,"".concat(C,"-end"),T[z]),Y))}))}return u.createElement("span",{"aria-hidden":"true",className:"".concat(xe,"-indent")},R)},I=u.memo(m),H=b(67841),L=b(71430),w=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],O="open",A="close",E="---",Q=function(Ee){(0,le.Z)(xe,Ee);var we=(0,o.Z)(xe);function xe(){var he;(0,oe.Z)(this,xe);for(var V=arguments.length,T=new Array(V),C=0;C<V;C++)T[C]=arguments[C];return he=we.call.apply(we,[this].concat(T)),he.state={dragNodeHighlight:!1},he.selectHandle=void 0,he.cacheIndent=void 0,he.onSelectorClick=function(R){var z=he.props.context.onNodeClick;z(R,(0,L.F)(he.props)),he.isSelectable()?he.onSelect(R):he.onCheck(R)},he.onSelectorDoubleClick=function(R){var z=he.props.context.onNodeDoubleClick;z(R,(0,L.F)(he.props))},he.onSelect=function(R){if(!he.isDisabled()){var z=he.props.context.onNodeSelect;z(R,(0,L.F)(he.props))}},he.onCheck=function(R){if(!he.isDisabled()){var z=he.props,Y=z.disableCheckbox,y=z.checked,v=he.props.context.onNodeCheck;if(!(!he.isCheckable()||Y)){var $=!y;v(R,(0,L.F)(he.props),$)}}},he.onMouseEnter=function(R){var z=he.props.context.onNodeMouseEnter;z(R,(0,L.F)(he.props))},he.onMouseLeave=function(R){var z=he.props.context.onNodeMouseLeave;z(R,(0,L.F)(he.props))},he.onContextMenu=function(R){var z=he.props.context.onNodeContextMenu;z(R,(0,L.F)(he.props))},he.onDragStart=function(R){var z=he.props.context.onNodeDragStart;R.stopPropagation(),he.setState({dragNodeHighlight:!0}),z(R,(0,_e.Z)(he));try{R.dataTransfer.setData("text/plain","")}catch(Y){}},he.onDragEnter=function(R){var z=he.props.context.onNodeDragEnter;R.preventDefault(),R.stopPropagation(),z(R,(0,_e.Z)(he))},he.onDragOver=function(R){var z=he.props.context.onNodeDragOver;R.preventDefault(),R.stopPropagation(),z(R,(0,_e.Z)(he))},he.onDragLeave=function(R){var z=he.props.context.onNodeDragLeave;R.stopPropagation(),z(R,(0,_e.Z)(he))},he.onDragEnd=function(R){var z=he.props.context.onNodeDragEnd;R.stopPropagation(),he.setState({dragNodeHighlight:!1}),z(R,(0,_e.Z)(he))},he.onDrop=function(R){var z=he.props.context.onNodeDrop;R.preventDefault(),R.stopPropagation(),he.setState({dragNodeHighlight:!1}),z(R,(0,_e.Z)(he))},he.onExpand=function(R){var z=he.props,Y=z.loading,y=z.context.onNodeExpand;Y||y(R,(0,L.F)(he.props))},he.setSelectHandle=function(R){he.selectHandle=R},he.getNodeState=function(){var R=he.props.expanded;return he.isLeaf()?null:R?O:A},he.hasChildren=function(){var R=he.props.eventKey,z=he.props.context.keyEntities,Y=(0,H.Z)(z,R)||{},y=Y.children;return!!(y||[]).length},he.isLeaf=function(){var R=he.props,z=R.isLeaf,Y=R.loaded,y=he.props.context.loadData,v=he.hasChildren();return z===!1?!1:z||!y&&!v||y&&Y&&!v},he.isDisabled=function(){var R=he.props.disabled,z=he.props.context.disabled;return!!(z||R)},he.isCheckable=function(){var R=he.props.checkable,z=he.props.context.checkable;return!z||R===!1?!1:z},he.syncLoadData=function(R){var z=R.expanded,Y=R.loading,y=R.loaded,v=he.props.context,$=v.loadData,j=v.onNodeLoad;Y||$&&z&&!he.isLeaf()&&!he.hasChildren()&&!y&&j((0,L.F)(he.props))},he.isDraggable=function(){var R=he.props,z=R.data,Y=R.context.draggable;return!!(Y&&(!Y.nodeDraggable||Y.nodeDraggable(z)))},he.renderDragHandler=function(){var R=he.props.context,z=R.draggable,Y=R.prefixCls;return z!=null&&z.icon?u.createElement("span",{className:"".concat(Y,"-draggable-icon")},z.icon):null},he.renderSwitcherIconDom=function(R){var z=he.props.switcherIcon,Y=he.props.context.switcherIcon,y=z||Y;return typeof y=="function"?y((0,fe.Z)((0,fe.Z)({},he.props),{},{isLeaf:R})):y},he.renderSwitcher=function(){var R=he.props.expanded,z=he.props.context.prefixCls;if(he.isLeaf()){var Y=he.renderSwitcherIconDom(!0);return Y!==!1?u.createElement("span",{className:D()("".concat(z,"-switcher"),"".concat(z,"-switcher-noop"))},Y):null}var y=D()("".concat(z,"-switcher"),"".concat(z,"-switcher_").concat(R?O:A)),v=he.renderSwitcherIconDom(!1);return v!==!1?u.createElement("span",{onClick:he.onExpand,className:y},v):null},he.renderCheckbox=function(){var R=he.props,z=R.checked,Y=R.halfChecked,y=R.disableCheckbox,v=he.props.context.prefixCls,$=he.isDisabled(),j=he.isCheckable();if(!j)return null;var me=typeof j!="boolean"?j:null;return u.createElement("span",{className:D()("".concat(v,"-checkbox"),z&&"".concat(v,"-checkbox-checked"),!z&&Y&&"".concat(v,"-checkbox-indeterminate"),($||y)&&"".concat(v,"-checkbox-disabled")),onClick:he.onCheck},me)},he.renderIcon=function(){var R=he.props.loading,z=he.props.context.prefixCls;return u.createElement("span",{className:D()("".concat(z,"-iconEle"),"".concat(z,"-icon__").concat(he.getNodeState()||"docu"),R&&"".concat(z,"-icon_loading"))})},he.renderSelector=function(){var R=he.state.dragNodeHighlight,z=he.props,Y=z.title,y=Y===void 0?E:Y,v=z.selected,$=z.icon,j=z.loading,me=z.data,Se=he.props.context,Te=Se.prefixCls,De=Se.showIcon,qe=Se.icon,lt=Se.loadData,We=Se.titleRender,Tt=he.isDisabled(),dt="".concat(Te,"-node-content-wrapper"),wt;if(De){var Rt=$||qe;wt=Rt?u.createElement("span",{className:D()("".concat(Te,"-iconEle"),"".concat(Te,"-icon__customize"))},typeof Rt=="function"?Rt(he.props):Rt):he.renderIcon()}else lt&&j&&(wt=he.renderIcon());var _t;typeof y=="function"?_t=y(me):We?_t=We(me):_t=y;var Pe=u.createElement("span",{className:"".concat(Te,"-title")},_t);return u.createElement("span",{ref:he.setSelectHandle,title:typeof y=="string"?y:"",className:D()("".concat(dt),"".concat(dt,"-").concat(he.getNodeState()||"normal"),!Tt&&(v||R)&&"".concat(Te,"-node-selected")),onMouseEnter:he.onMouseEnter,onMouseLeave:he.onMouseLeave,onContextMenu:he.onContextMenu,onClick:he.onSelectorClick,onDoubleClick:he.onSelectorDoubleClick},wt,Pe,he.renderDropIndicator())},he.renderDropIndicator=function(){var R=he.props,z=R.disabled,Y=R.eventKey,y=he.props.context,v=y.draggable,$=y.dropLevelOffset,j=y.dropPosition,me=y.prefixCls,Se=y.indent,Te=y.dropIndicatorRender,De=y.dragOverNodeKey,qe=y.direction,lt=!!v,We=!z&<&&De===Y,Tt=Se!=null?Se:he.cacheIndent;return he.cacheIndent=Se,We?Te({dropPosition:j,dropLevelOffset:$,indent:Tt,prefixCls:me,direction:qe}):null},he}return(0,Z.Z)(xe,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var V=this.props.selectable,T=this.props.context.selectable;return typeof V=="boolean"?V:T}},{key:"render",value:function(){var V,T=this.props,C=T.eventKey,R=T.className,z=T.style,Y=T.dragOver,y=T.dragOverGapTop,v=T.dragOverGapBottom,$=T.isLeaf,j=T.isStart,me=T.isEnd,Se=T.expanded,Te=T.selected,De=T.checked,qe=T.halfChecked,lt=T.loading,We=T.domRef,Tt=T.active,dt=T.data,wt=T.onMouseMove,Rt=T.selectable,_t=(0,ve.Z)(T,w),Pe=this.props.context,J=Pe.prefixCls,ue=Pe.filterTreeNode,W=Pe.keyEntities,M=Pe.dropContainerKey,pe=Pe.dropTargetKey,k=Pe.draggingNodeKey,N=this.isDisabled(),P=(0,f.Z)(_t,{aria:!0,data:!0}),ne=(0,H.Z)(W,C)||{},F=ne.level,se=me[me.length-1],de=this.isDraggable(),ge=!N&&de,be=k===C,Le=Rt!==void 0?{"aria-selected":!!Rt}:void 0;return u.createElement("div",(0,B.Z)({ref:We,className:D()(R,"".concat(J,"-treenode"),(V={},(0,q.Z)(V,"".concat(J,"-treenode-disabled"),N),(0,q.Z)(V,"".concat(J,"-treenode-switcher-").concat(Se?"open":"close"),!$),(0,q.Z)(V,"".concat(J,"-treenode-checkbox-checked"),De),(0,q.Z)(V,"".concat(J,"-treenode-checkbox-indeterminate"),qe),(0,q.Z)(V,"".concat(J,"-treenode-selected"),Te),(0,q.Z)(V,"".concat(J,"-treenode-loading"),lt),(0,q.Z)(V,"".concat(J,"-treenode-active"),Tt),(0,q.Z)(V,"".concat(J,"-treenode-leaf-last"),se),(0,q.Z)(V,"".concat(J,"-treenode-draggable"),de),(0,q.Z)(V,"dragging",be),(0,q.Z)(V,"drop-target",pe===C),(0,q.Z)(V,"drop-container",M===C),(0,q.Z)(V,"drag-over",!N&&Y),(0,q.Z)(V,"drag-over-gap-top",!N&&y),(0,q.Z)(V,"drag-over-gap-bottom",!N&&v),(0,q.Z)(V,"filter-node",ue&&ue((0,L.F)(this.props))),V)),style:z,draggable:ge,"aria-grabbed":be,onDragStart:ge?this.onDragStart:void 0,onDragEnter:de?this.onDragEnter:void 0,onDragOver:de?this.onDragOver:void 0,onDragLeave:de?this.onDragLeave:void 0,onDrop:de?this.onDrop:void 0,onDragEnd:de?this.onDragEnd:void 0,onMouseMove:wt},Le,P),u.createElement(I,{prefixCls:J,level:F,isStart:j,isEnd:me}),this.renderDragHandler(),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),xe}(u.Component),te=function(we){return u.createElement(g.k.Consumer,null,function(xe){return u.createElement(Q,(0,B.Z)({},we,{context:xe}))})};te.displayName="TreeNode",te.isTreeNode=1;var ie=te},39378:function(bt,ke,b){"use strict";b.d(ke,{k:function(){return q}});var B=b(59301),q=B.createContext(null)},23130:function(bt,ke,b){"use strict";b.d(ke,{O:function(){return ie.Z},Z:function(){return Pe}});var B=b(92413),q=b(400),ve=b(39559),fe=b(33708),oe=b(26407),Z=b(6909),_e=b(4771),le=b(25314),o=b(9427),K=b(25440),D=b(92310),f=b.n(D),u=b(10228),g=b(26112),m=b(48736),I=b(59301),H=b(39378);function L(J){var ue=J.dropPosition,W=J.dropLevelOffset,M=J.indent,pe={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(ue){case-1:pe.top=0,pe.left=-W*M;break;case 1:pe.bottom=0,pe.left=-W*M;break;case 0:pe.bottom=0,pe.left=M;break}return I.createElement("div",{style:pe})}function w(J){if(J==null)throw new TypeError("Cannot destructure "+J)}var O=b(33606),A=b(37061),E=b(34280),Q=b(57149),te=b(77900),ie=b(39417);function Ee(J,ue){var W=I.useState(!1),M=(0,O.Z)(W,2),pe=M[0],k=M[1];I.useLayoutEffect(function(){if(pe)return J(),function(){ue()}},[pe]),I.useLayoutEffect(function(){return k(!0),function(){k(!1)}},[])}var we=b(71430),xe=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],he=function(ue,W){var M=ue.className,pe=ue.style,k=ue.motion,N=ue.motionNodes,P=ue.motionType,ne=ue.onMotionStart,F=ue.onMotionEnd,se=ue.active,de=ue.treeNodeRequiredProps,ge=(0,A.Z)(ue,xe),be=I.useState(!0),Le=(0,O.Z)(be,2),Ne=Le[0],ze=Le[1],Ie=I.useContext(H.k),Ke=Ie.prefixCls,je=N&&P!=="hide";(0,E.Z)(function(){N&&je!==Ne&&ze(je)},[N]);var Ce=function(){N&&ne()},vt=I.useRef(!1),st=function(){N&&!vt.current&&(vt.current=!0,F())};Ee(Ce,st);var St=function(Ht){je===Ht&&st()};return N?I.createElement(te.default,(0,B.Z)({ref:W,visible:Ne},k,{motionAppear:P==="show",onVisibleChanged:St}),function(Ze,Ht){var Kt=Ze.className,zt=Ze.style;return I.createElement("div",{ref:Ht,className:f()("".concat(Ke,"-treenode-motion"),Kt),style:zt},N.map(function(Ot){var ht=(0,B.Z)({},(w(Ot.data),Ot.data)),yt=Ot.title,ut=Ot.key,Ct=Ot.isStart,ft=Ot.isEnd;delete ht.children;var Mt=(0,we.H8)(ut,de);return I.createElement(ie.Z,(0,B.Z)({},ht,Mt,{title:yt,active:se,data:Ot.data,key:ut,isStart:Ct,isEnd:ft}))}))}):I.createElement(ie.Z,(0,B.Z)({domRef:W,className:M,style:pe},ge,{active:se}))};he.displayName="MotionTreeNode";var V=I.forwardRef(he),T=V;function C(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],W=J.length,M=ue.length;if(Math.abs(W-M)!==1)return{add:!1,key:null};function pe(k,N){var P=new Map;k.forEach(function(F){P.set(F,!0)});var ne=N.filter(function(F){return!P.has(F)});return ne.length===1?ne[0]:null}return W<M?{add:!0,key:pe(J,ue)}:{add:!1,key:pe(ue,J)}}function R(J,ue,W){var M=J.findIndex(function(P){return P.key===W}),pe=J[M+1],k=ue.findIndex(function(P){return P.key===W});if(pe){var N=ue.findIndex(function(P){return P.key===pe.key});return ue.slice(k+1,N)}return ue.slice(k+1)}var z=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],Y={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()),$={key:v},j={key:v,level:0,index:0,pos:"0",node:$,nodes:[$]},me={parent:null,children:[],pos:j.pos,data:$,title:null,key:v,isStart:[],isEnd:[]};function Se(J,ue,W,M){return ue===!1||!W?J:J.slice(0,Math.ceil(W/M)+1)}function Te(J){var ue=J.key,W=J.pos;return(0,we.km)(ue,W)}function De(J){for(var ue=String(J.data.key),W=J;W.parent;)W=W.parent,ue="".concat(W.data.key," > ").concat(ue);return ue}var qe=I.forwardRef(function(J,ue){var W=J.prefixCls,M=J.data,pe=J.selectable,k=J.checkable,N=J.expandedKeys,P=J.selectedKeys,ne=J.checkedKeys,F=J.loadedKeys,se=J.loadingKeys,de=J.halfCheckedKeys,ge=J.keyEntities,be=J.disabled,Le=J.dragging,Ne=J.dragOverNodeKey,ze=J.dropPosition,Ie=J.motion,Ke=J.height,je=J.itemHeight,Ce=J.virtual,vt=J.focusable,st=J.activeItem,St=J.focused,Ze=J.tabIndex,Ht=J.onKeyDown,Kt=J.onFocus,zt=J.onBlur,Ot=J.onActiveChange,ht=J.onListChangeStart,yt=J.onListChangeEnd,ut=(0,A.Z)(J,z),Ct=I.useRef(null),ft=I.useRef(null);I.useImperativeHandle(ue,function(){return{scrollTo:function(Be){Ct.current.scrollTo(Be)},getIndentWidth:function(){return ft.current.offsetWidth}}});var Mt=I.useState(N),Qt=(0,O.Z)(Mt,2),Jt=Qt[0],ln=Qt[1],an=I.useState(M),jt=(0,O.Z)(an,2),Wt=jt[0],pt=jt[1],Xe=I.useState(M),c=(0,O.Z)(Xe,2),p=c[0],x=c[1],G=I.useState([]),re=(0,O.Z)(G,2),ye=re[0],Ae=re[1],tt=I.useState(null),Qe=(0,O.Z)(tt,2),at=Qe[0],Ft=Qe[1],Vt=I.useRef(M);Vt.current=M;function ot(){var Fe=Vt.current;pt(Fe),x(Fe),Ae([]),Ft(null),yt()}(0,E.Z)(function(){ln(N);var Fe=C(Jt,N);if(Fe.key!==null)if(Fe.add){var Be=Wt.findIndex(function(Lt){var Et=Lt.key;return Et===Fe.key}),ct=Se(R(Wt,M,Fe.key),Ce,Ke,je),It=Wt.slice();It.splice(Be+1,0,me),x(It),Ae(ct),Ft("show")}else{var Pt=M.findIndex(function(Lt){var Et=Lt.key;return Et===Fe.key}),dn=Se(R(M,Wt,Fe.key),Ce,Ke,je),fn=M.slice();fn.splice(Pt+1,0,me),x(fn),Ae(dn),Ft("hide")}else Wt!==M&&(pt(M),x(M))},[N,M]),I.useEffect(function(){Le||ot()},[Le]);var qt=Ie?p:M,At={expandedKeys:N,selectedKeys:P,loadedKeys:F,loadingKeys:se,checkedKeys:ne,halfCheckedKeys:de,dragOverNodeKey:Ne,dropPosition:ze,keyEntities:ge};return I.createElement(I.Fragment,null,St&&st&&I.createElement("span",{style:Y,"aria-live":"assertive"},De(st)),I.createElement("div",null,I.createElement("input",{style:Y,disabled:vt===!1||be,tabIndex:vt!==!1?Ze:null,onKeyDown:Ht,onFocus:Kt,onBlur:zt,value:"",onChange:y,"aria-label":"for screen reader"})),I.createElement("div",{className:"".concat(W,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},I.createElement("div",{className:"".concat(W,"-indent")},I.createElement("div",{ref:ft,className:"".concat(W,"-indent-unit")}))),I.createElement(Q.Z,(0,B.Z)({},ut,{data:qt,itemKey:Te,height:Ke,fullHeight:!1,virtual:Ce,itemHeight:je,prefixCls:"".concat(W,"-list"),ref:Ct,onVisibleChange:function(Be,ct){var It=new Set(Be),Pt=ct.filter(function(dn){return!It.has(dn)});Pt.some(function(dn){return Te(dn)===v})&&ot()}}),function(Fe){var Be=Fe.pos,ct=(0,B.Z)({},(w(Fe.data),Fe.data)),It=Fe.title,Pt=Fe.key,dn=Fe.isStart,fn=Fe.isEnd,Lt=(0,we.km)(Pt,Be);delete ct.key,delete ct.children;var Et=(0,we.H8)(Lt,At);return I.createElement(T,(0,B.Z)({},ct,Et,{title:It,active:!!st&&Pt===st.key,pos:Be,data:Fe.data,isStart:dn,isEnd:fn,motion:Ie,motionNodes:Pt===v?ye:null,motionType:at,onMotionStart:ht,onMotionEnd:ot,treeNodeRequiredProps:At,onMouseMove:function(){Ot(null)}}))}))});qe.displayName="NodeList";var lt=qe,We=b(35654),Tt=b(90782),dt=b(67841),wt=10,Rt=function(J){(0,o.Z)(W,J);var ue=(0,K.Z)(W);function W(){var M;(0,Z.Z)(this,W);for(var pe=arguments.length,k=new Array(pe),N=0;N<pe;N++)k[N]=arguments[N];return M=ue.call.apply(ue,[this].concat(k)),M.destroyed=!1,M.delayedDragEnterLogic=void 0,M.loadingRetryTimes={},M.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,we.w$)()},M.dragStartMousePosition=null,M.dragNode=void 0,M.currentMouseOverDroppableNodeKey=null,M.listRef=I.createRef(),M.onNodeDragStart=function(P,ne){var F=M.state,se=F.expandedKeys,de=F.keyEntities,ge=M.props.onDragStart,be=ne.props.eventKey;M.dragNode=ne,M.dragStartMousePosition={x:P.clientX,y:P.clientY};var Le=(0,We._5)(se,be);M.setState({draggingNodeKey:be,dragChildrenKeys:(0,We.wA)(be,de),indent:M.listRef.current.getIndentWidth()}),M.setExpandedKeys(Le),window.addEventListener("dragend",M.onWindowDragEnd),ge==null||ge({event:P,node:(0,we.F)(ne.props)})},M.onNodeDragEnter=function(P,ne){var F=M.state,se=F.expandedKeys,de=F.keyEntities,ge=F.dragChildrenKeys,be=F.flattenNodes,Le=F.indent,Ne=M.props,ze=Ne.onDragEnter,Ie=Ne.onExpand,Ke=Ne.allowDrop,je=Ne.direction,Ce=ne.props,vt=Ce.pos,st=Ce.eventKey,St=(0,le.Z)(M),Ze=St.dragNode;if(M.currentMouseOverDroppableNodeKey!==st&&(M.currentMouseOverDroppableNodeKey=st),!Ze){M.resetDragState();return}var Ht=(0,We.OM)(P,Ze,ne,Le,M.dragStartMousePosition,Ke,be,de,se,je),Kt=Ht.dropPosition,zt=Ht.dropLevelOffset,Ot=Ht.dropTargetKey,ht=Ht.dropContainerKey,yt=Ht.dropTargetPos,ut=Ht.dropAllowed,Ct=Ht.dragOverNodeKey;if(ge.indexOf(Ot)!==-1||!ut){M.resetDragState();return}if(M.delayedDragEnterLogic||(M.delayedDragEnterLogic={}),Object.keys(M.delayedDragEnterLogic).forEach(function(ft){clearTimeout(M.delayedDragEnterLogic[ft])}),Ze.props.eventKey!==ne.props.eventKey&&(P.persist(),M.delayedDragEnterLogic[vt]=window.setTimeout(function(){if(M.state.draggingNodeKey!==null){var ft=(0,oe.Z)(se),Mt=(0,dt.Z)(de,ne.props.eventKey);Mt&&(Mt.children||[]).length&&(ft=(0,We.L0)(se,ne.props.eventKey)),"expandedKeys"in M.props||M.setExpandedKeys(ft),Ie==null||Ie(ft,{node:(0,we.F)(ne.props),expanded:!0,nativeEvent:P.nativeEvent})}},800)),Ze.props.eventKey===Ot&&zt===0){M.resetDragState();return}M.setState({dragOverNodeKey:Ct,dropPosition:Kt,dropLevelOffset:zt,dropTargetKey:Ot,dropContainerKey:ht,dropTargetPos:yt,dropAllowed:ut}),ze==null||ze({event:P,node:(0,we.F)(ne.props),expandedKeys:se})},M.onNodeDragOver=function(P,ne){var F=M.state,se=F.dragChildrenKeys,de=F.flattenNodes,ge=F.keyEntities,be=F.expandedKeys,Le=F.indent,Ne=M.props,ze=Ne.onDragOver,Ie=Ne.allowDrop,Ke=Ne.direction,je=(0,le.Z)(M),Ce=je.dragNode;if(Ce){var vt=(0,We.OM)(P,Ce,ne,Le,M.dragStartMousePosition,Ie,de,ge,be,Ke),st=vt.dropPosition,St=vt.dropLevelOffset,Ze=vt.dropTargetKey,Ht=vt.dropContainerKey,Kt=vt.dropAllowed,zt=vt.dropTargetPos,Ot=vt.dragOverNodeKey;se.indexOf(Ze)!==-1||!Kt||(Ce.props.eventKey===Ze&&St===0?M.state.dropPosition===null&&M.state.dropLevelOffset===null&&M.state.dropTargetKey===null&&M.state.dropContainerKey===null&&M.state.dropTargetPos===null&&M.state.dropAllowed===!1&&M.state.dragOverNodeKey===null||M.resetDragState():st===M.state.dropPosition&&St===M.state.dropLevelOffset&&Ze===M.state.dropTargetKey&&Ht===M.state.dropContainerKey&&zt===M.state.dropTargetPos&&Kt===M.state.dropAllowed&&Ot===M.state.dragOverNodeKey||M.setState({dropPosition:st,dropLevelOffset:St,dropTargetKey:Ze,dropContainerKey:Ht,dropTargetPos:zt,dropAllowed:Kt,dragOverNodeKey:Ot}),ze==null||ze({event:P,node:(0,we.F)(ne.props)}))}},M.onNodeDragLeave=function(P,ne){M.currentMouseOverDroppableNodeKey===ne.props.eventKey&&!P.currentTarget.contains(P.relatedTarget)&&(M.resetDragState(),M.currentMouseOverDroppableNodeKey=null);var F=M.props.onDragLeave;F==null||F({event:P,node:(0,we.F)(ne.props)})},M.onWindowDragEnd=function(P){M.onNodeDragEnd(P,null,!0),window.removeEventListener("dragend",M.onWindowDragEnd)},M.onNodeDragEnd=function(P,ne){var F=M.props.onDragEnd;M.setState({dragOverNodeKey:null}),M.cleanDragState(),F==null||F({event:P,node:(0,we.F)(ne.props)}),M.dragNode=null,window.removeEventListener("dragend",M.onWindowDragEnd)},M.onNodeDrop=function(P,ne){var F,se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,de=M.state,ge=de.dragChildrenKeys,be=de.dropPosition,Le=de.dropTargetKey,Ne=de.dropTargetPos,ze=de.dropAllowed;if(ze){var Ie=M.props.onDrop;if(M.setState({dragOverNodeKey:null}),M.cleanDragState(),Le!==null){var Ke=(0,fe.Z)((0,fe.Z)({},(0,we.H8)(Le,M.getTreeNodeRequiredProps())),{},{active:((F=M.getActiveItem())===null||F===void 0?void 0:F.key)===Le,data:(0,dt.Z)(M.state.keyEntities,Le).node}),je=ge.indexOf(Le)!==-1;(0,m.ZP)(!je,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var Ce=(0,We.yx)(Ne),vt={event:P,node:(0,we.F)(Ke),dragNode:M.dragNode?(0,we.F)(M.dragNode.props):null,dragNodesKeys:[M.dragNode.props.eventKey].concat(ge),dropToGap:be!==0,dropPosition:be+Number(Ce[Ce.length-1])};se||Ie==null||Ie(vt),M.dragNode=null}}},M.cleanDragState=function(){var P=M.state.draggingNodeKey;P!==null&&M.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),M.dragStartMousePosition=null,M.currentMouseOverDroppableNodeKey=null},M.triggerExpandActionExpand=function(P,ne){var F=M.state,se=F.expandedKeys,de=F.flattenNodes,ge=ne.expanded,be=ne.key,Le=ne.isLeaf;if(!(Le||P.shiftKey||P.metaKey||P.ctrlKey)){var Ne=de.filter(function(Ie){return Ie.key===be})[0],ze=(0,we.F)((0,fe.Z)((0,fe.Z)({},(0,we.H8)(be,M.getTreeNodeRequiredProps())),{},{data:Ne.data}));M.setExpandedKeys(ge?(0,We._5)(se,be):(0,We.L0)(se,be)),M.onNodeExpand(P,ze)}},M.onNodeClick=function(P,ne){var F=M.props,se=F.onClick,de=F.expandAction;de==="click"&&M.triggerExpandActionExpand(P,ne),se==null||se(P,ne)},M.onNodeDoubleClick=function(P,ne){var F=M.props,se=F.onDoubleClick,de=F.expandAction;de==="doubleClick"&&M.triggerExpandActionExpand(P,ne),se==null||se(P,ne)},M.onNodeSelect=function(P,ne){var F=M.state.selectedKeys,se=M.state,de=se.keyEntities,ge=se.fieldNames,be=M.props,Le=be.onSelect,Ne=be.multiple,ze=ne.selected,Ie=ne[ge.key],Ke=!ze;Ke?Ne?F=(0,We.L0)(F,Ie):F=[Ie]:F=(0,We._5)(F,Ie);var je=F.map(function(Ce){var vt=(0,dt.Z)(de,Ce);return vt?vt.node:null}).filter(function(Ce){return Ce});M.setUncontrolledState({selectedKeys:F}),Le==null||Le(F,{event:"select",selected:Ke,node:ne,selectedNodes:je,nativeEvent:P.nativeEvent})},M.onNodeCheck=function(P,ne,F){var se=M.state,de=se.keyEntities,ge=se.checkedKeys,be=se.halfCheckedKeys,Le=M.props,Ne=Le.checkStrictly,ze=Le.onCheck,Ie=ne.key,Ke,je={event:"check",node:ne,checked:F,nativeEvent:P.nativeEvent};if(Ne){var Ce=F?(0,We.L0)(ge,Ie):(0,We._5)(ge,Ie),vt=(0,We._5)(be,Ie);Ke={checked:Ce,halfChecked:vt},je.checkedNodes=Ce.map(function(zt){return(0,dt.Z)(de,zt)}).filter(function(zt){return zt}).map(function(zt){return zt.node}),M.setUncontrolledState({checkedKeys:Ce})}else{var st=(0,Tt.S)([].concat((0,oe.Z)(ge),[Ie]),!0,de),St=st.checkedKeys,Ze=st.halfCheckedKeys;if(!F){var Ht=new Set(St);Ht.delete(Ie);var Kt=(0,Tt.S)(Array.from(Ht),{checked:!1,halfCheckedKeys:Ze},de);St=Kt.checkedKeys,Ze=Kt.halfCheckedKeys}Ke=St,je.checkedNodes=[],je.checkedNodesPositions=[],je.halfCheckedKeys=Ze,St.forEach(function(zt){var Ot=(0,dt.Z)(de,zt);if(Ot){var ht=Ot.node,yt=Ot.pos;je.checkedNodes.push(ht),je.checkedNodesPositions.push({node:ht,pos:yt})}}),M.setUncontrolledState({checkedKeys:St},!1,{halfCheckedKeys:Ze})}ze==null||ze(Ke,je)},M.onNodeLoad=function(P){var ne=P.key,F=new Promise(function(se,de){M.setState(function(ge){var be=ge.loadedKeys,Le=be===void 0?[]:be,Ne=ge.loadingKeys,ze=Ne===void 0?[]:Ne,Ie=M.props,Ke=Ie.loadData,je=Ie.onLoad;if(!Ke||Le.indexOf(ne)!==-1||ze.indexOf(ne)!==-1)return null;var Ce=Ke(P);return Ce.then(function(){var vt=M.state.loadedKeys,st=(0,We.L0)(vt,ne);je==null||je(st,{event:"load",node:P}),M.setUncontrolledState({loadedKeys:st}),M.setState(function(St){return{loadingKeys:(0,We._5)(St.loadingKeys,ne)}}),se()}).catch(function(vt){if(M.setState(function(St){return{loadingKeys:(0,We._5)(St.loadingKeys,ne)}}),M.loadingRetryTimes[ne]=(M.loadingRetryTimes[ne]||0)+1,M.loadingRetryTimes[ne]>=wt){var st=M.state.loadedKeys;(0,m.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),M.setUncontrolledState({loadedKeys:(0,We.L0)(st,ne)}),se()}de(vt)}),{loadingKeys:(0,We.L0)(ze,ne)}})});return F.catch(function(){}),F},M.onNodeMouseEnter=function(P,ne){var F=M.props.onMouseEnter;F==null||F({event:P,node:ne})},M.onNodeMouseLeave=function(P,ne){var F=M.props.onMouseLeave;F==null||F({event:P,node:ne})},M.onNodeContextMenu=function(P,ne){var F=M.props.onRightClick;F&&(P.preventDefault(),F({event:P,node:ne}))},M.onFocus=function(){var P=M.props.onFocus;M.setState({focused:!0});for(var ne=arguments.length,F=new Array(ne),se=0;se<ne;se++)F[se]=arguments[se];P==null||P.apply(void 0,F)},M.onBlur=function(){var P=M.props.onBlur;M.setState({focused:!1}),M.onActiveChange(null);for(var ne=arguments.length,F=new Array(ne),se=0;se<ne;se++)F[se]=arguments[se];P==null||P.apply(void 0,F)},M.getTreeNodeRequiredProps=function(){var P=M.state,ne=P.expandedKeys,F=P.selectedKeys,se=P.loadedKeys,de=P.loadingKeys,ge=P.checkedKeys,be=P.halfCheckedKeys,Le=P.dragOverNodeKey,Ne=P.dropPosition,ze=P.keyEntities;return{expandedKeys:ne||[],selectedKeys:F||[],loadedKeys:se||[],loadingKeys:de||[],checkedKeys:ge||[],halfCheckedKeys:be||[],dragOverNodeKey:Le,dropPosition:Ne,keyEntities:ze}},M.setExpandedKeys=function(P){var ne=M.state,F=ne.treeData,se=ne.fieldNames,de=(0,we.oH)(F,P,se);M.setUncontrolledState({expandedKeys:P,flattenNodes:de},!0)},M.onNodeExpand=function(P,ne){var F=M.state.expandedKeys,se=M.state,de=se.listChanging,ge=se.fieldNames,be=M.props,Le=be.onExpand,Ne=be.loadData,ze=ne.expanded,Ie=ne[ge.key];if(!de){var Ke=F.indexOf(Ie),je=!ze;if((0,m.ZP)(ze&&Ke!==-1||!ze&&Ke===-1,"Expand state not sync with index check"),je?F=(0,We.L0)(F,Ie):F=(0,We._5)(F,Ie),M.setExpandedKeys(F),Le==null||Le(F,{node:ne,expanded:je,nativeEvent:P.nativeEvent}),je&&Ne){var Ce=M.onNodeLoad(ne);Ce&&Ce.then(function(){var vt=(0,we.oH)(M.state.treeData,F,ge);M.setUncontrolledState({flattenNodes:vt})}).catch(function(){var vt=M.state.expandedKeys,st=(0,We._5)(vt,Ie);M.setExpandedKeys(st)})}}},M.onListChangeStart=function(){M.setUncontrolledState({listChanging:!0})},M.onListChangeEnd=function(){setTimeout(function(){M.setUncontrolledState({listChanging:!1})})},M.onActiveChange=function(P){var ne=M.state.activeKey,F=M.props.onActiveChange;ne!==P&&(M.setState({activeKey:P}),P!==null&&M.scrollTo({key:P}),F==null||F(P))},M.getActiveItem=function(){var P=M.state,ne=P.activeKey,F=P.flattenNodes;return ne===null?null:F.find(function(se){var de=se.key;return de===ne})||null},M.offsetActiveKey=function(P){var ne=M.state,F=ne.flattenNodes,se=ne.activeKey,de=F.findIndex(function(Le){var Ne=Le.key;return Ne===se});de===-1&&P<0&&(de=F.length),de=(de+P+F.length)%F.length;var ge=F[de];if(ge){var be=ge.key;M.onActiveChange(be)}else M.onActiveChange(null)},M.onKeyDown=function(P){var ne=M.state,F=ne.activeKey,se=ne.expandedKeys,de=ne.checkedKeys,ge=ne.fieldNames,be=M.props,Le=be.onKeyDown,Ne=be.checkable,ze=be.selectable;switch(P.which){case u.Z.UP:{M.offsetActiveKey(-1),P.preventDefault();break}case u.Z.DOWN:{M.offsetActiveKey(1),P.preventDefault();break}}var Ie=M.getActiveItem();if(Ie&&Ie.data){var Ke=M.getTreeNodeRequiredProps(),je=Ie.data.isLeaf===!1||!!(Ie.data[ge.children]||[]).length,Ce=(0,we.F)((0,fe.Z)((0,fe.Z)({},(0,we.H8)(F,Ke)),{},{data:Ie.data,active:!0}));switch(P.which){case u.Z.LEFT:{je&&se.includes(F)?M.onNodeExpand({},Ce):Ie.parent&&M.onActiveChange(Ie.parent.key),P.preventDefault();break}case u.Z.RIGHT:{je&&!se.includes(F)?M.onNodeExpand({},Ce):Ie.children&&Ie.children.length&&M.onActiveChange(Ie.children[0].key),P.preventDefault();break}case u.Z.ENTER:case u.Z.SPACE:{Ne&&!Ce.disabled&&Ce.checkable!==!1&&!Ce.disableCheckbox?M.onNodeCheck({},Ce,!de.includes(F)):!Ne&&ze&&!Ce.disabled&&Ce.selectable!==!1&&M.onNodeSelect({},Ce);break}}}Le==null||Le(P)},M.setUncontrolledState=function(P){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!M.destroyed){var se=!1,de=!0,ge={};Object.keys(P).forEach(function(be){if(be in M.props){de=!1;return}se=!0,ge[be]=P[be]}),se&&(!ne||de)&&M.setState((0,fe.Z)((0,fe.Z)({},ge),F))}},M.scrollTo=function(P){M.listRef.current.scrollTo(P)},M}return(0,_e.Z)(W,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var pe=this.props.activeKey;pe!==void 0&&pe!==this.state.activeKey&&(this.setState({activeKey:pe}),pe!==null&&this.scrollTo({key:pe}))}},{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 pe,k=this.state,N=k.focused,P=k.flattenNodes,ne=k.keyEntities,F=k.draggingNodeKey,se=k.activeKey,de=k.dropLevelOffset,ge=k.dropContainerKey,be=k.dropTargetKey,Le=k.dropPosition,Ne=k.dragOverNodeKey,ze=k.indent,Ie=this.props,Ke=Ie.prefixCls,je=Ie.className,Ce=Ie.style,vt=Ie.showLine,st=Ie.focusable,St=Ie.tabIndex,Ze=St===void 0?0:St,Ht=Ie.selectable,Kt=Ie.showIcon,zt=Ie.icon,Ot=Ie.switcherIcon,ht=Ie.draggable,yt=Ie.checkable,ut=Ie.checkStrictly,Ct=Ie.disabled,ft=Ie.motion,Mt=Ie.loadData,Qt=Ie.filterTreeNode,Jt=Ie.height,ln=Ie.itemHeight,an=Ie.virtual,jt=Ie.titleRender,Wt=Ie.dropIndicatorRender,pt=Ie.onContextMenu,Xe=Ie.onScroll,c=Ie.direction,p=Ie.rootClassName,x=Ie.rootStyle,G=(0,g.Z)(this.props,{aria:!0,data:!0}),re;return ht&&((0,ve.Z)(ht)==="object"?re=ht:typeof ht=="function"?re={nodeDraggable:ht}:re={}),I.createElement(H.k.Provider,{value:{prefixCls:Ke,selectable:Ht,showIcon:Kt,icon:zt,switcherIcon:Ot,draggable:re,draggingNodeKey:F,checkable:yt,checkStrictly:ut,disabled:Ct,keyEntities:ne,dropLevelOffset:de,dropContainerKey:ge,dropTargetKey:be,dropPosition:Le,dragOverNodeKey:Ne,indent:ze,direction:c,dropIndicatorRender:Wt,loadData:Mt,filterTreeNode:Qt,titleRender:jt,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}},I.createElement("div",{role:"tree",className:f()(Ke,je,p,(pe={},(0,q.Z)(pe,"".concat(Ke,"-show-line"),vt),(0,q.Z)(pe,"".concat(Ke,"-focused"),N),(0,q.Z)(pe,"".concat(Ke,"-active-focused"),se!==null),pe)),style:x},I.createElement(lt,(0,B.Z)({ref:this.listRef,prefixCls:Ke,style:Ce,data:P,disabled:Ct,selectable:Ht,checkable:!!yt,motion:ft,dragging:F!==null,height:Jt,itemHeight:ln,virtual:an,focusable:st,focused:N,tabIndex:Ze,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:pt,onScroll:Xe},this.getTreeNodeRequiredProps(),G))))}}],[{key:"getDerivedStateFromProps",value:function(pe,k){var N=k.prevProps,P={prevProps:pe};function ne(st){return!N&&st in pe||N&&N[st]!==pe[st]}var F,se=k.fieldNames;if(ne("fieldNames")&&(se=(0,we.w$)(pe.fieldNames),P.fieldNames=se),ne("treeData")?F=pe.treeData:ne("children")&&((0,m.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),F=(0,we.zn)(pe.children)),F){P.treeData=F;var de=(0,we.I8)(F,{fieldNames:se});P.keyEntities=(0,fe.Z)((0,q.Z)({},v,j),de.keyEntities)}var ge=P.keyEntities||k.keyEntities;if(ne("expandedKeys")||N&&ne("autoExpandParent"))P.expandedKeys=pe.autoExpandParent||!N&&pe.defaultExpandParent?(0,We.r7)(pe.expandedKeys,ge):pe.expandedKeys;else if(!N&&pe.defaultExpandAll){var be=(0,fe.Z)({},ge);delete be[v],P.expandedKeys=Object.keys(be).map(function(st){return be[st].key})}else!N&&pe.defaultExpandedKeys&&(P.expandedKeys=pe.autoExpandParent||pe.defaultExpandParent?(0,We.r7)(pe.defaultExpandedKeys,ge):pe.defaultExpandedKeys);if(P.expandedKeys||delete P.expandedKeys,F||P.expandedKeys){var Le=(0,we.oH)(F||k.treeData,P.expandedKeys||k.expandedKeys,se);P.flattenNodes=Le}if(pe.selectable&&(ne("selectedKeys")?P.selectedKeys=(0,We.BT)(pe.selectedKeys,pe):!N&&pe.defaultSelectedKeys&&(P.selectedKeys=(0,We.BT)(pe.defaultSelectedKeys,pe))),pe.checkable){var Ne;if(ne("checkedKeys")?Ne=(0,We.E6)(pe.checkedKeys)||{}:!N&&pe.defaultCheckedKeys?Ne=(0,We.E6)(pe.defaultCheckedKeys)||{}:F&&(Ne=(0,We.E6)(pe.checkedKeys)||{checkedKeys:k.checkedKeys,halfCheckedKeys:k.halfCheckedKeys}),Ne){var ze=Ne,Ie=ze.checkedKeys,Ke=Ie===void 0?[]:Ie,je=ze.halfCheckedKeys,Ce=je===void 0?[]:je;if(!pe.checkStrictly){var vt=(0,Tt.S)(Ke,!0,ge);Ke=vt.checkedKeys,Ce=vt.halfCheckedKeys}P.checkedKeys=Ke,P.halfCheckedKeys=Ce}}return ne("loadedKeys")&&(P.loadedKeys=pe.loadedKeys),P}}]),W}(I.Component);Rt.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},Rt.TreeNode=ie.Z;var _t=Rt,Pe=_t},35654:function(bt,ke,b){"use strict";b.d(ke,{BT:function(){return I},E6:function(){return w},L0:function(){return K},OM:function(){return m},_5:function(){return o},r7:function(){return O},wA:function(){return f},yx:function(){return D}});var B=b(26407),q=b(39559),ve=b(48736),fe=b(59301),oe=b(39417),Z=b(67841),_e=b(71430),le=null;function o(A,E){if(!A)return[];var Q=A.slice(),te=Q.indexOf(E);return te>=0&&Q.splice(te,1),Q}function K(A,E){var Q=(A||[]).slice();return Q.indexOf(E)===-1&&Q.push(E),Q}function D(A){return A.split("-")}function f(A,E){var Q=[],te=(0,Z.Z)(E,A);function ie(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Ee.forEach(function(we){var xe=we.key,he=we.children;Q.push(xe),ie(he)})}return ie(te.children),Q}function u(A){if(A.parent){var E=D(A.pos);return Number(E[E.length-1])===A.parent.children.length-1}return!1}function g(A){var E=D(A.pos);return Number(E[E.length-1])===0}function m(A,E,Q,te,ie,Ee,we,xe,he,V){var T,C=A.clientX,R=A.clientY,z=A.target.getBoundingClientRect(),Y=z.top,y=z.height,v=(V==="rtl"?-1:1)*(((ie==null?void 0:ie.x)||0)-C),$=(v-12)/te,j=(0,Z.Z)(xe,Q.props.eventKey);if(R<Y+y/2){var me=we.findIndex(function(Pe){return Pe.key===j.key}),Se=me<=0?0:me-1,Te=we[Se].key;j=(0,Z.Z)(xe,Te)}var De=j.key,qe=j,lt=j.key,We=0,Tt=0;if(!he.includes(De))for(var dt=0;dt<$&&u(j);dt+=1)j=j.parent,Tt+=1;var wt=E.props.data,Rt=j.node,_t=!0;return g(j)&&j.level===0&&R<Y+y/2&&Ee({dragNode:wt,dropNode:Rt,dropPosition:-1})&&j.key===Q.props.eventKey?We=-1:(qe.children||[]).length&&he.includes(lt)?Ee({dragNode:wt,dropNode:Rt,dropPosition:0})?We=0:_t=!1:Tt===0?$>-1.5?Ee({dragNode:wt,dropNode:Rt,dropPosition:1})?We=1:_t=!1:Ee({dragNode:wt,dropNode:Rt,dropPosition:0})?We=0:Ee({dragNode:wt,dropNode:Rt,dropPosition:1})?We=1:_t=!1:Ee({dragNode:wt,dropNode:Rt,dropPosition:1})?We=1:_t=!1,{dropPosition:We,dropLevelOffset:Tt,dropTargetKey:j.key,dropTargetPos:j.pos,dragOverNodeKey:lt,dropContainerKey:We===0?null:((T=j.parent)===null||T===void 0?void 0:T.key)||null,dropAllowed:_t}}function I(A,E){if(A){var Q=E.multiple;return Q?A.slice():A.length?[A[0]]:A}}var H=function(E){return E};function L(A,E){if(!A)return[];var Q=E||{},te=Q.processProps,ie=te===void 0?H:te,Ee=Array.isArray(A)?A:[A];return Ee.map(function(we){var xe=we.children,he=_objectWithoutProperties(we,le),V=L(xe,E);return React.createElement(TreeNode,_extends({key:he.key},ie(he)),V)})}function w(A){if(!A)return null;var E;if(Array.isArray(A))E={checkedKeys:A,halfCheckedKeys:void 0};else if((0,q.Z)(A)==="object")E={checkedKeys:A.checked||void 0,halfCheckedKeys:A.halfChecked||void 0};else return(0,ve.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return E}function O(A,E){var Q=new Set;function te(ie){if(!Q.has(ie)){var Ee=(0,Z.Z)(E,ie);if(Ee){Q.add(ie);var we=Ee.parent,xe=Ee.node;xe.disabled||we&&te(we.key)}}}return(A||[]).forEach(function(ie){te(ie)}),(0,B.Z)(Q)}},90782:function(bt,ke,b){"use strict";b.d(ke,{S:function(){return _e}});var B=b(48736),q=b(67841);function ve(le,o){var K=new Set;return le.forEach(function(D){o.has(D)||K.add(D)}),K}function fe(le){var o=le||{},K=o.disabled,D=o.disableCheckbox,f=o.checkable;return!!(K||D)||f===!1}function oe(le,o,K,D){for(var f=new Set(le),u=new Set,g=0;g<=K;g+=1){var m=o.get(g)||new Set;m.forEach(function(w){var O=w.key,A=w.node,E=w.children,Q=E===void 0?[]:E;f.has(O)&&!D(A)&&Q.filter(function(te){return!D(te.node)}).forEach(function(te){f.add(te.key)})})}for(var I=new Set,H=K;H>=0;H-=1){var L=o.get(H)||new Set;L.forEach(function(w){var O=w.parent,A=w.node;if(!(D(A)||!w.parent||I.has(w.parent.key))){if(D(w.parent.node)){I.add(O.key);return}var E=!0,Q=!1;(O.children||[]).filter(function(te){return!D(te.node)}).forEach(function(te){var ie=te.key,Ee=f.has(ie);E&&!Ee&&(E=!1),!Q&&(Ee||u.has(ie))&&(Q=!0)}),E&&f.add(O.key),Q&&u.add(O.key),I.add(O.key)}})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(ve(u,f))}}function Z(le,o,K,D,f){for(var u=new Set(le),g=new Set(o),m=0;m<=D;m+=1){var I=K.get(m)||new Set;I.forEach(function(O){var A=O.key,E=O.node,Q=O.children,te=Q===void 0?[]:Q;!u.has(A)&&!g.has(A)&&!f(E)&&te.filter(function(ie){return!f(ie.node)}).forEach(function(ie){u.delete(ie.key)})})}g=new Set;for(var H=new Set,L=D;L>=0;L-=1){var w=K.get(L)||new Set;w.forEach(function(O){var A=O.parent,E=O.node;if(!(f(E)||!O.parent||H.has(O.parent.key))){if(f(O.parent.node)){H.add(A.key);return}var Q=!0,te=!1;(A.children||[]).filter(function(ie){return!f(ie.node)}).forEach(function(ie){var Ee=ie.key,we=u.has(Ee);Q&&!we&&(Q=!1),!te&&(we||g.has(Ee))&&(te=!0)}),Q||u.delete(A.key),te&&g.add(A.key),H.add(A.key)}})}return{checkedKeys:Array.from(u),halfCheckedKeys:Array.from(ve(g,u))}}function _e(le,o,K,D){var f=[],u;D?u=D:u=fe;var g=new Set(le.filter(function(L){var w=!!(0,q.Z)(K,L);return w||f.push(L),w})),m=new Map,I=0;Object.keys(K).forEach(function(L){var w=K[L],O=w.level,A=m.get(O);A||(A=new Set,m.set(O,A)),A.add(w),I=Math.max(I,O)}),(0,B.ZP)(!f.length,"Tree missing follow keys: ".concat(f.slice(0,100).map(function(L){return"'".concat(L,"'")}).join(", ")));var H;return o===!0?H=oe(g,m,I,u):H=Z(g,o.halfCheckedKeys,m,I,u),H}},67841:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return B}});function B(q,ve){return q[ve]}},71430:function(bt,ke,b){"use strict";b.d(ke,{F:function(){return O},H8:function(){return w},I8:function(){return L},km:function(){return f},oH:function(){return I},w$:function(){return u},zn:function(){return m}});var B=b(39559),q=b(26407),ve=b(33708),fe=b(37061),oe=b(11592),Z=b(2738),_e=b(48736),le=b(67841),o=["children"];function K(A,E){return"".concat(A,"-").concat(E)}function D(A){return A&&A.type&&A.type.isTreeNode}function f(A,E){return A!=null?A:E}function u(A){var E=A||{},Q=E.title,te=E._title,ie=E.key,Ee=E.children,we=Q||"title";return{title:we,_title:te||[we],key:ie||"key",children:Ee||"children"}}function g(A,E){var Q=new Map;function te(ie){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(ie||[]).forEach(function(we){var xe=we[E.key],he=we[E.children];warning(xe!=null,"Tree node must have a certain key: [".concat(Ee).concat(xe,"]"));var V=String(xe);warning(!Q.has(V)||xe===null||xe===void 0,"Same 'key' exist in the Tree: ".concat(V)),Q.set(V,!0),te(he,"".concat(Ee).concat(V," > "))})}te(A)}function m(A){function E(Q){var te=(0,oe.Z)(Q);return te.map(function(ie){if(!D(ie))return(0,_e.ZP)(!ie,"Tree/TreeNode can only accept TreeNode as children."),null;var Ee=ie.key,we=ie.props,xe=we.children,he=(0,fe.Z)(we,o),V=(0,ve.Z)({key:Ee},he),T=E(xe);return T.length&&(V.children=T),V}).filter(function(ie){return ie})}return E(A)}function I(A,E,Q){var te=u(Q),ie=te._title,Ee=te.key,we=te.children,xe=new Set(E===!0?[]:E),he=[];function V(T){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return T.map(function(R,z){for(var Y=K(C?C.pos:"0",z),y=f(R[Ee],Y),v,$=0;$<ie.length;$+=1){var j=ie[$];if(R[j]!==void 0){v=R[j];break}}var me=(0,ve.Z)((0,ve.Z)({},(0,Z.Z)(R,[].concat((0,q.Z)(ie),[Ee,we]))),{},{title:v,key:y,parent:C,pos:Y,children:null,data:R,isStart:[].concat((0,q.Z)(C?C.isStart:[]),[z===0]),isEnd:[].concat((0,q.Z)(C?C.isEnd:[]),[z===T.length-1])});return he.push(me),E===!0||xe.has(y)?me.children=V(R[we]||[],me):me.children=[],me})}return V(A),he}function H(A,E,Q){var te={};(0,B.Z)(Q)==="object"?te=Q:te={externalGetKey:Q},te=te||{};var ie=te,Ee=ie.childrenPropName,we=ie.externalGetKey,xe=ie.fieldNames,he=u(xe),V=he.key,T=he.children,C=Ee||T,R;we?typeof we=="string"?R=function(y){return y[we]}:typeof we=="function"&&(R=function(y){return we(y)}):R=function(y,v){return f(y[V],v)};function z(Y,y,v,$){var j=Y?Y[C]:A,me=Y?K(v.pos,y):"0",Se=Y?[].concat((0,q.Z)($),[Y]):[];if(Y){var Te=R(Y,me),De={node:Y,index:y,pos:me,key:Te,parentPos:v.node?v.pos:null,level:v.level+1,nodes:Se};E(De)}j&&j.forEach(function(qe,lt){z(qe,lt,{node:Y,pos:me,level:v?v.level+1:-1},Se)})}z(null)}function L(A){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Q=E.initWrapper,te=E.processEntity,ie=E.onProcessFinished,Ee=E.externalGetKey,we=E.childrenPropName,xe=E.fieldNames,he=arguments.length>2?arguments[2]:void 0,V=Ee||he,T={},C={},R={posEntities:T,keyEntities:C};return Q&&(R=Q(R)||R),H(A,function(z){var Y=z.node,y=z.index,v=z.pos,$=z.key,j=z.parentPos,me=z.level,Se=z.nodes,Te={node:Y,nodes:Se,index:y,key:$,pos:v,level:me},De=f($,v);T[v]=Te,C[De]=Te,Te.parent=T[j],Te.parent&&(Te.parent.children=Te.parent.children||[],Te.parent.children.push(Te)),te&&te(Te,R)},{externalGetKey:V,childrenPropName:we,fieldNames:xe}),ie&&ie(R),R}function w(A,E){var Q=E.expandedKeys,te=E.selectedKeys,ie=E.loadedKeys,Ee=E.loadingKeys,we=E.checkedKeys,xe=E.halfCheckedKeys,he=E.dragOverNodeKey,V=E.dropPosition,T=E.keyEntities,C=(0,le.Z)(T,A),R={eventKey:A,expanded:Q.indexOf(A)!==-1,selected:te.indexOf(A)!==-1,loaded:ie.indexOf(A)!==-1,loading:Ee.indexOf(A)!==-1,checked:we.indexOf(A)!==-1,halfChecked:xe.indexOf(A)!==-1,pos:String(C?C.pos:""),dragOver:he===A&&V===0,dragOverGapTop:he===A&&V===-1,dragOverGapBottom:he===A&&V===1};return R}function O(A){var E=A.data,Q=A.expanded,te=A.selected,ie=A.checked,Ee=A.loaded,we=A.loading,xe=A.halfChecked,he=A.dragOver,V=A.dragOverGapTop,T=A.dragOverGapBottom,C=A.pos,R=A.active,z=A.eventKey,Y=(0,ve.Z)((0,ve.Z)({},E),{},{expanded:Q,selected:te,checked:ie,loaded:Ee,loading:we,halfChecked:xe,dragOver:he,dragOverGapTop:V,dragOverGapBottom:T,pos:C,active:R,key:z});return"props"in Y||Object.defineProperty(Y,"props",{get:function(){return(0,_e.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),A}}),Y}},49658:function(bt,ke){"use strict";ke.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var b=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(b)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(b==null?void 0:b.substr(0,4))}},57149:function(bt,ke,b){"use strict";b.d(ke,{Z:function(){return _t}});var B=b(92413),q=b(39559),ve=b(33708),fe=b(400),oe=b(33606),Z=b(37061),_e=b(92310),le=b.n(_e),o=b(29301),K=b(70425),D=b(34280),f=b(59301),u=b(4676),g=f.forwardRef(function(Pe,J){var ue=Pe.height,W=Pe.offsetY,M=Pe.offsetX,pe=Pe.children,k=Pe.prefixCls,N=Pe.onInnerResize,P=Pe.innerProps,ne=Pe.rtl,F=Pe.extra,se={},de={display:"flex",flexDirection:"column"};return W!==void 0&&(se={height:ue,position:"relative",overflow:"hidden"},de=(0,ve.Z)((0,ve.Z)({},de),{},(0,fe.Z)((0,fe.Z)((0,fe.Z)((0,fe.Z)((0,fe.Z)({transform:"translateY(".concat(W,"px)")},ne?"marginRight":"marginLeft",-M),"position","absolute"),"left",0),"right",0),"top",0))),f.createElement("div",{style:se},f.createElement(o.Z,{onResize:function(be){var Le=be.offsetHeight;Le&&N&&N()}},f.createElement("div",(0,B.Z)({style:de,className:le()((0,fe.Z)({},"".concat(k,"-holder-inner"),k)),ref:J},P),pe,F)))});g.displayName="Filler";var m=g;function I(Pe){var J=Pe.children,ue=Pe.setRef,W=f.useCallback(function(M){ue(M)},[]);return f.cloneElement(J,{ref:W})}function H(Pe,J,ue,W,M,pe,k,N){var P=N.getKey;return Pe.slice(J,ue+1).map(function(ne,F){var se=J+F,de=k(ne,se,{style:{width:W},offsetX:M}),ge=P(ne);return f.createElement(I,{key:ge,setRef:function(Le){return pe(ne,Le)}},de)})}function L(Pe,J,ue,W){var M=ue-Pe,pe=J-ue,k=Math.min(M,pe)*2;if(W<=k){var N=Math.floor(W/2);return W%2?ue+N+1:ue-N}return M>pe?ue-(W-pe):ue+(W-M)}function w(Pe,J,ue){var W=Pe.length,M=J.length,pe,k;if(W===0&&M===0)return null;W<M?(pe=Pe,k=J):(pe=J,k=Pe);var N={__EMPTY_ITEM__:!0};function P(be){return be!==void 0?ue(be):N}for(var ne=null,F=Math.abs(W-M)!==1,se=0;se<k.length;se+=1){var de=P(pe[se]),ge=P(k[se]);if(de!==ge){ne=se,F=F||de!==P(k[se+1]);break}}return ne===null?null:{index:ne,multiple:F}}function O(Pe,J,ue){var W=f.useState(Pe),M=(0,oe.Z)(W,2),pe=M[0],k=M[1],N=f.useState(null),P=(0,oe.Z)(N,2),ne=P[0],F=P[1];return f.useEffect(function(){var se=w(pe||[],Pe||[],J);(se==null?void 0:se.index)!==void 0&&(ue==null||ue(se.index),F(Pe[se.index])),k(Pe)},[Pe]),[ne]}var A=b(16089),E=(typeof navigator=="undefined"?"undefined":(0,q.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Q=E,te=function(Pe,J,ue,W){var M=(0,f.useRef)(!1),pe=(0,f.useRef)(null);function k(){clearTimeout(pe.current),M.current=!0,pe.current=setTimeout(function(){M.current=!1},50)}var N=(0,f.useRef)({top:Pe,bottom:J,left:ue,right:W});return N.current.top=Pe,N.current.bottom=J,N.current.left=ue,N.current.right=W,function(P,ne){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,se=P?ne<0&&N.current.left||ne>0&&N.current.right:ne<0&&N.current.top||ne>0&&N.current.bottom;return F&&se?(clearTimeout(pe.current),M.current=!1):(!se||M.current)&&k(),!M.current&&se}};function ie(Pe,J,ue,W,M,pe,k){var N=(0,f.useRef)(0),P=(0,f.useRef)(null),ne=(0,f.useRef)(null),F=(0,f.useRef)(!1),se=te(J,ue,W,M);function de(Ie,Ke){if(A.Z.cancel(P.current),!se(!1,Ke)){var je=Ie;if(!je._virtualHandled)je._virtualHandled=!0;else return;N.current+=Ke,ne.current=Ke,Q||je.preventDefault(),P.current=(0,A.Z)(function(){var Ce=F.current?10:1;k(N.current*Ce,!1),N.current=0})}}function ge(Ie,Ke){k(Ke,!0),Q||Ie.preventDefault()}var be=(0,f.useRef)(null),Le=(0,f.useRef)(null);function Ne(Ie){if(Pe){A.Z.cancel(Le.current),Le.current=(0,A.Z)(function(){be.current=null},2);var Ke=Ie.deltaX,je=Ie.deltaY,Ce=Ie.shiftKey,vt=Ke,st=je;(be.current==="sx"||!be.current&&Ce&&je&&!Ke)&&(vt=je,st=0,be.current="sx");var St=Math.abs(vt),Ze=Math.abs(st);be.current===null&&(be.current=pe&&St>Ze?"x":"y"),be.current==="y"?de(Ie,st):ge(Ie,vt)}}function ze(Ie){Pe&&(F.current=Ie.detail===ne.current)}return[Ne,ze]}function Ee(Pe,J,ue,W){var M=f.useMemo(function(){return[new Map,[]]},[Pe,ue.id,W]),pe=(0,oe.Z)(M,2),k=pe[0],N=pe[1],P=function(F){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:F,de=k.get(F),ge=k.get(se);if(de===void 0||ge===void 0)for(var be=Pe.length,Le=N.length;Le<be;Le+=1){var Ne,ze=Pe[Le],Ie=J(ze);k.set(Ie,Le);var Ke=(Ne=ue.get(Ie))!==null&&Ne!==void 0?Ne:W;if(N[Le]=(N[Le-1]||0)+Ke,Ie===F&&(de=Le),Ie===se&&(ge=Le),de!==void 0&&ge!==void 0)break}return{top:N[de-1]||0,bottom:N[ge]}};return P}var we=b(76846),xe=b(6909),he=b(4771),V=function(){function Pe(){(0,xe.Z)(this,Pe),(0,fe.Z)(this,"maps",void 0),(0,fe.Z)(this,"id",0),(0,fe.Z)(this,"diffKeys",new Set),this.maps=Object.create(null)}return(0,he.Z)(Pe,[{key:"set",value:function(ue,W){this.maps[ue]=W,this.id+=1,this.diffKeys.add(ue)}},{key:"get",value:function(ue){return this.maps[ue]}},{key:"resetRecord",value:function(){this.diffKeys.clear()}},{key:"getRecord",value:function(){return this.diffKeys}}]),Pe}(),T=V;function C(Pe){var J=parseFloat(Pe);return isNaN(J)?0:J}function R(Pe,J,ue){var W=f.useState(0),M=(0,oe.Z)(W,2),pe=M[0],k=M[1],N=(0,f.useRef)(new Map),P=(0,f.useRef)(new T),ne=(0,f.useRef)(0);function F(){ne.current+=1}function se(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;F();var be=function(){var ze=!1;N.current.forEach(function(Ie,Ke){if(Ie&&Ie.offsetParent){var je=(0,we.ZP)(Ie),Ce=je.offsetHeight,vt=getComputedStyle(je),st=vt.marginTop,St=vt.marginBottom,Ze=C(st),Ht=C(St),Kt=Ce+Ze+Ht;P.current.get(Ke)!==Kt&&(P.current.set(Ke,Kt),ze=!0)}}),ze&&k(function(Ie){return Ie+1})};if(ge)be();else{ne.current+=1;var Le=ne.current;Promise.resolve().then(function(){Le===ne.current&&be()})}}function de(ge,be){var Le=Pe(ge),Ne=N.current.get(Le);be?(N.current.set(Le,be),se()):N.current.delete(Le),!Ne!=!be&&(be?J==null||J(ge):ue==null||ue(ge))}return(0,f.useEffect)(function(){return F},[]),[de,se,P.current,pe]}var z=14/15;function Y(Pe,J,ue){var W=(0,f.useRef)(!1),M=(0,f.useRef)(0),pe=(0,f.useRef)(0),k=(0,f.useRef)(null),N=(0,f.useRef)(null),P,ne=function(ge){if(W.current){var be=Math.ceil(ge.touches[0].pageX),Le=Math.ceil(ge.touches[0].pageY),Ne=M.current-be,ze=pe.current-Le,Ie=Math.abs(Ne)>Math.abs(ze);Ie?M.current=be:pe.current=Le;var Ke=ue(Ie,Ie?Ne:ze,!1,ge);Ke&&ge.preventDefault(),clearInterval(N.current),Ke&&(N.current=setInterval(function(){Ie?Ne*=z:ze*=z;var je=Math.floor(Ie?Ne:ze);(!ue(Ie,je,!0)||Math.abs(je)<=.1)&&clearInterval(N.current)},16))}},F=function(){W.current=!1,P()},se=function(ge){P(),ge.touches.length===1&&!W.current&&(W.current=!0,M.current=Math.ceil(ge.touches[0].pageX),pe.current=Math.ceil(ge.touches[0].pageY),k.current=ge.target,k.current.addEventListener("touchmove",ne,{passive:!1}),k.current.addEventListener("touchend",F,{passive:!0}))};P=function(){k.current&&(k.current.removeEventListener("touchmove",ne),k.current.removeEventListener("touchend",F))},(0,D.Z)(function(){return Pe&&J.current.addEventListener("touchstart",se,{passive:!0}),function(){var de;(de=J.current)===null||de===void 0||de.removeEventListener("touchstart",se),P(),clearInterval(N.current)}},[Pe])}function y(Pe){return Math.floor(Math.pow(Pe,.5))}function v(Pe,J){var ue="touches"in Pe?Pe.touches[0]:Pe;return ue[J?"pageX":"pageY"]-window[J?"scrollX":"scrollY"]}function $(Pe,J,ue){f.useEffect(function(){var W=J.current;if(Pe&&W){var M=!1,pe,k,N=function(){A.Z.cancel(pe)},P=function de(){N(),pe=(0,A.Z)(function(){ue(k),de()})},ne=function(ge){if(!ge.target.draggable){var be=ge;be._virtualHandled||(be._virtualHandled=!0,M=!0)}},F=function(){M=!1,N()},se=function(ge){if(M){var be=v(ge,!1),Le=W.getBoundingClientRect(),Ne=Le.top,ze=Le.bottom;if(be<=Ne){var Ie=Ne-be;k=-y(Ie),P()}else if(be>=ze){var Ke=be-ze;k=y(Ke),P()}else N()}};return W.addEventListener("mousedown",ne),W.ownerDocument.addEventListener("mouseup",F),W.ownerDocument.addEventListener("mousemove",se),function(){W.removeEventListener("mousedown",ne),W.ownerDocument.removeEventListener("mouseup",F),W.ownerDocument.removeEventListener("mousemove",se),N()}}},[Pe])}var j=10;function me(Pe,J,ue,W,M,pe,k,N){var P=f.useRef(),ne=f.useState(null),F=(0,oe.Z)(ne,2),se=F[0],de=F[1];return(0,D.Z)(function(){if(se&&se.times<j){if(!Pe.current){de(function(Mt){return(0,ve.Z)({},Mt)});return}pe();var ge=se.targetAlign,be=se.originAlign,Le=se.index,Ne=se.offset,ze=Pe.current.clientHeight,Ie=!1,Ke=ge,je=null;if(ze){for(var Ce=ge||be,vt=0,st=0,St=0,Ze=Math.min(J.length-1,Le),Ht=0;Ht<=Ze;Ht+=1){var Kt=M(J[Ht]);st=vt;var zt=ue.get(Kt);St=st+(zt===void 0?W:zt),vt=St}for(var Ot=Ce==="top"?Ne:ze-Ne,ht=Ze;ht>=0;ht-=1){var yt=M(J[ht]),ut=ue.get(yt);if(ut===void 0){Ie=!0;break}if(Ot-=ut,Ot<=0)break}switch(Ce){case"top":je=st-Ne;break;case"bottom":je=St-ze+Ne;break;default:{var Ct=Pe.current.scrollTop,ft=Ct+ze;st<Ct?Ke="top":St>ft&&(Ke="bottom")}}je!==null&&k(je),je!==se.lastTop&&(Ie=!0)}Ie&&de((0,ve.Z)((0,ve.Z)({},se),{},{times:se.times+1,targetAlign:Ke,lastTop:je}))}},[se,Pe.current]),function(ge){if(ge==null){N();return}if(A.Z.cancel(P.current),typeof ge=="number")k(ge);else if(ge&&(0,q.Z)(ge)==="object"){var be,Le=ge.align;"index"in ge?be=ge.index:be=J.findIndex(function(Ie){return M(Ie)===ge.key});var Ne=ge.offset,ze=Ne===void 0?0:Ne;de({times:0,index:be,offset:ze,originAlign:Le})}}}var Se=f.forwardRef(function(Pe,J){var ue=Pe.prefixCls,W=Pe.rtl,M=Pe.scrollOffset,pe=Pe.scrollRange,k=Pe.onStartMove,N=Pe.onStopMove,P=Pe.onScroll,ne=Pe.horizontal,F=Pe.spinSize,se=Pe.containerSize,de=Pe.style,ge=Pe.thumbStyle,be=Pe.showScrollBar,Le=f.useState(!1),Ne=(0,oe.Z)(Le,2),ze=Ne[0],Ie=Ne[1],Ke=f.useState(null),je=(0,oe.Z)(Ke,2),Ce=je[0],vt=je[1],st=f.useState(null),St=(0,oe.Z)(st,2),Ze=St[0],Ht=St[1],Kt=!W,zt=f.useRef(),Ot=f.useRef(),ht=f.useState(be),yt=(0,oe.Z)(ht,2),ut=yt[0],Ct=yt[1],ft=f.useRef(),Mt=function(){be===!0||be===!1||(clearTimeout(ft.current),Ct(!0),ft.current=setTimeout(function(){Ct(!1)},3e3))},Qt=pe-se||0,Jt=se-F||0,ln=f.useMemo(function(){if(M===0||Qt===0)return 0;var G=M/Qt;return G*Jt},[M,Qt,Jt]),an=function(re){re.stopPropagation(),re.preventDefault()},jt=f.useRef({top:ln,dragging:ze,pageY:Ce,startTop:Ze});jt.current={top:ln,dragging:ze,pageY:Ce,startTop:Ze};var Wt=function(re){Ie(!0),vt(v(re,ne)),Ht(jt.current.top),k(),re.stopPropagation(),re.preventDefault()};f.useEffect(function(){var G=function(tt){tt.preventDefault()},re=zt.current,ye=Ot.current;return re.addEventListener("touchstart",G,{passive:!1}),ye.addEventListener("touchstart",Wt,{passive:!1}),function(){re.removeEventListener("touchstart",G),ye.removeEventListener("touchstart",Wt)}},[]);var pt=f.useRef();pt.current=Qt;var Xe=f.useRef();Xe.current=Jt,f.useEffect(function(){if(ze){var G,re=function(tt){var Qe=jt.current,at=Qe.dragging,Ft=Qe.pageY,Vt=Qe.startTop;A.Z.cancel(G);var ot=zt.current.getBoundingClientRect(),qt=se/(ne?ot.width:ot.height);if(at){var At=(v(tt,ne)-Ft)*qt,Fe=Vt;!Kt&&ne?Fe-=At:Fe+=At;var Be=pt.current,ct=Xe.current,It=ct?Fe/ct:0,Pt=Math.ceil(It*Be);Pt=Math.max(Pt,0),Pt=Math.min(Pt,Be),G=(0,A.Z)(function(){P(Pt,ne)})}},ye=function(){Ie(!1),N()};return window.addEventListener("mousemove",re,{passive:!0}),window.addEventListener("touchmove",re,{passive:!0}),window.addEventListener("mouseup",ye,{passive:!0}),window.addEventListener("touchend",ye,{passive:!0}),function(){window.removeEventListener("mousemove",re),window.removeEventListener("touchmove",re),window.removeEventListener("mouseup",ye),window.removeEventListener("touchend",ye),A.Z.cancel(G)}}},[ze]),f.useEffect(function(){return Mt(),function(){clearTimeout(ft.current)}},[M]),f.useImperativeHandle(J,function(){return{delayHidden:Mt}});var c="".concat(ue,"-scrollbar"),p={position:"absolute",visibility:ut?null:"hidden"},x={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return ne?(p.height=8,p.left=0,p.right=0,p.bottom=0,x.height="100%",x.width=F,Kt?x.left=ln:x.right=ln):(p.width=8,p.top=0,p.bottom=0,Kt?p.right=0:p.left=0,x.width="100%",x.height=F,x.top=ln),f.createElement("div",{ref:zt,className:le()(c,(0,fe.Z)((0,fe.Z)((0,fe.Z)({},"".concat(c,"-horizontal"),ne),"".concat(c,"-vertical"),!ne),"".concat(c,"-visible"),ut)),style:(0,ve.Z)((0,ve.Z)({},p),de),onMouseDown:an,onMouseMove:Mt},f.createElement("div",{ref:Ot,className:le()("".concat(c,"-thumb"),(0,fe.Z)({},"".concat(c,"-thumb-moving"),ze)),style:(0,ve.Z)((0,ve.Z)({},x),ge),onMouseDown:Wt}))}),Te=Se,De=20;function qe(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,ue=Pe/J*Pe;return isNaN(ue)&&(ue=0),ue=Math.max(ue,De),Math.floor(ue)}var lt=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],We=[],Tt={overflowY:"auto",overflowAnchor:"none"};function dt(Pe,J){var ue=Pe.prefixCls,W=ue===void 0?"rc-virtual-list":ue,M=Pe.className,pe=Pe.height,k=Pe.itemHeight,N=Pe.fullHeight,P=N===void 0?!0:N,ne=Pe.style,F=Pe.data,se=Pe.children,de=Pe.itemKey,ge=Pe.virtual,be=Pe.direction,Le=Pe.scrollWidth,Ne=Pe.component,ze=Ne===void 0?"div":Ne,Ie=Pe.onScroll,Ke=Pe.onVirtualScroll,je=Pe.onVisibleChange,Ce=Pe.innerProps,vt=Pe.extraRender,st=Pe.styles,St=Pe.showScrollBar,Ze=St===void 0?"optional":St,Ht=(0,Z.Z)(Pe,lt),Kt=f.useCallback(function(Bt){return typeof de=="function"?de(Bt):Bt==null?void 0:Bt[de]},[de]),zt=R(Kt,null,null),Ot=(0,oe.Z)(zt,4),ht=Ot[0],yt=Ot[1],ut=Ot[2],Ct=Ot[3],ft=!!(ge!==!1&&pe&&k),Mt=f.useMemo(function(){return Object.values(ut.maps).reduce(function(Bt,Gt){return Bt+Gt},0)},[ut.id,ut.maps]),Qt=ft&&F&&(Math.max(k*F.length,Mt)>pe||!!Le),Jt=be==="rtl",ln=le()(W,(0,fe.Z)({},"".concat(W,"-rtl"),Jt),M),an=F||We,jt=(0,f.useRef)(),Wt=(0,f.useRef)(),pt=(0,f.useRef)(),Xe=(0,f.useState)(0),c=(0,oe.Z)(Xe,2),p=c[0],x=c[1],G=(0,f.useState)(0),re=(0,oe.Z)(G,2),ye=re[0],Ae=re[1],tt=(0,f.useState)(!1),Qe=(0,oe.Z)(tt,2),at=Qe[0],Ft=Qe[1],Vt=function(){Ft(!0)},ot=function(){Ft(!1)},qt={getKey:Kt};function At(Bt){x(function(Gt){var pn;typeof Bt=="function"?pn=Bt(Gt):pn=Bt;var Tn=_n(pn);return jt.current.scrollTop=Tn,Tn})}var Fe=(0,f.useRef)({start:0,end:an.length}),Be=(0,f.useRef)(),ct=O(an,Kt),It=(0,oe.Z)(ct,1),Pt=It[0];Be.current=Pt;var dn=f.useMemo(function(){if(!ft)return{scrollHeight:void 0,start:0,end:an.length-1,offset:void 0};if(!Qt){var Bt;return{scrollHeight:((Bt=Wt.current)===null||Bt===void 0?void 0:Bt.offsetHeight)||0,start:0,end:an.length-1,offset:void 0}}for(var Gt=0,pn,Tn,kn,Xn=an.length,Mn=0;Mn<Xn;Mn+=1){var ui=an[Mn],fi=Kt(ui),vi=ut.get(fi),ri=Gt+(vi===void 0?k:vi);ri>=p&&pn===void 0&&(pn=Mn,Tn=Gt),ri>p+pe&&kn===void 0&&(kn=Mn),Gt=ri}return pn===void 0&&(pn=0,Tn=0,kn=Math.ceil(pe/k)),kn===void 0&&(kn=an.length-1),kn=Math.min(kn+1,an.length-1),{scrollHeight:Gt,start:pn,end:kn,offset:Tn}},[Qt,ft,p,an,Ct,pe]),fn=dn.scrollHeight,Lt=dn.start,Et=dn.end,Oe=dn.offset;Fe.current.start=Lt,Fe.current.end=Et,f.useLayoutEffect(function(){var Bt=ut.getRecord();if(Bt.size===1){var Gt=Array.from(Bt)[0],pn=an[Lt];if(pn){var Tn=Kt(pn);if(Tn===Gt){var kn=ut.get(Gt),Xn=kn-k;At(function(Mn){return Mn+Xn})}}}ut.resetRecord()},[fn]);var Me=f.useState({width:0,height:pe}),He=(0,oe.Z)(Me,2),nt=He[0],Ye=He[1],et=function(Gt){Ye({width:Gt.offsetWidth,height:Gt.offsetHeight})},Je=(0,f.useRef)(),Dt=(0,f.useRef)(),Zt=f.useMemo(function(){return qe(nt.width,Le)},[nt.width,Le]),Ut=f.useMemo(function(){return qe(nt.height,fn)},[nt.height,fn]),rn=fn-pe,on=(0,f.useRef)(rn);on.current=rn;function _n(Bt){var Gt=Bt;return Number.isNaN(on.current)||(Gt=Math.min(Gt,on.current)),Gt=Math.max(Gt,0),Gt}var cn=p<=0,Xt=p>=rn,An=ye<=0,gn=ye>=Le,On=te(cn,Xt,An,gn),wn=function(){return{x:Jt?-ye:ye,y:p}},xn=(0,f.useRef)(wn()),vn=(0,K.useEvent)(function(Bt){if(Ke){var Gt=(0,ve.Z)((0,ve.Z)({},wn()),Bt);(xn.current.x!==Gt.x||xn.current.y!==Gt.y)&&(Ke(Gt),xn.current=Gt)}});function En(Bt,Gt){var pn=Bt;Gt?((0,u.flushSync)(function(){Ae(pn)}),vn()):At(pn)}function Cn(Bt){var Gt=Bt.currentTarget.scrollTop;Gt!==p&&At(Gt),Ie==null||Ie(Bt),vn()}var Un=function(Gt){var pn=Gt,Tn=Le?Le-nt.width:0;return pn=Math.max(pn,0),pn=Math.min(pn,Tn),pn},Ln=(0,K.useEvent)(function(Bt,Gt){Gt?((0,u.flushSync)(function(){Ae(function(pn){var Tn=pn+(Jt?-Bt:Bt);return Un(Tn)})}),vn()):At(function(pn){var Tn=pn+Bt;return Tn})}),hn=ie(ft,cn,Xt,An,gn,!!Le,Ln),$t=(0,oe.Z)(hn,2),$n=$t[0],Pn=$t[1];Y(ft,jt,function(Bt,Gt,pn,Tn){var kn=Tn;return On(Bt,Gt,pn)?!1:!kn||!kn._virtualHandled?(kn&&(kn._virtualHandled=!0),$n({preventDefault:function(){},deltaX:Bt?Gt:0,deltaY:Bt?0:Gt}),!0):!1}),$(Qt,jt,function(Bt){At(function(Gt){return Gt+Bt})}),(0,D.Z)(function(){function Bt(pn){var Tn=cn&&pn.detail<0,kn=Xt&&pn.detail>0;ft&&!Tn&&!kn&&pn.preventDefault()}var Gt=jt.current;return Gt.addEventListener("wheel",$n,{passive:!1}),Gt.addEventListener("DOMMouseScroll",Pn,{passive:!0}),Gt.addEventListener("MozMousePixelScroll",Bt,{passive:!1}),function(){Gt.removeEventListener("wheel",$n),Gt.removeEventListener("DOMMouseScroll",Pn),Gt.removeEventListener("MozMousePixelScroll",Bt)}},[ft,cn,Xt]),(0,D.Z)(function(){if(Le){var Bt=Un(ye);Ae(Bt),vn({x:Bt})}},[nt.width,Le]);var Kn=function(){var Gt,pn;(Gt=Je.current)===null||Gt===void 0||Gt.delayHidden(),(pn=Dt.current)===null||pn===void 0||pn.delayHidden()},Yn=me(jt,an,ut,k,Kt,function(){return yt(!0)},At,Kn);f.useImperativeHandle(J,function(){return{nativeElement:pt.current,getScrollInfo:wn,scrollTo:function(Gt){function pn(Tn){return Tn&&(0,q.Z)(Tn)==="object"&&("left"in Tn||"top"in Tn)}pn(Gt)?(Gt.left!==void 0&&Ae(Un(Gt.left)),Yn(Gt.top)):Yn(Gt)}}}),(0,D.Z)(function(){if(je){var Bt=an.slice(Lt,Et+1);je(Bt,an)}},[Lt,Et,an]);var ti=Ee(an,Kt,ut,k),Jn=vt==null?void 0:vt({start:Lt,end:Et,virtual:Qt,offsetX:ye,offsetY:Oe,rtl:Jt,getSize:ti}),jn=H(an,Lt,Et,Le,ye,ht,se,qt),Vn=null;pe&&(Vn=(0,ve.Z)((0,fe.Z)({},P?"height":"maxHeight",pe),Tt),ft&&(Vn.overflowY="hidden",Le&&(Vn.overflowX="hidden"),at&&(Vn.pointerEvents="none")));var li={};return Jt&&(li.dir="rtl"),f.createElement("div",(0,B.Z)({ref:pt,style:(0,ve.Z)((0,ve.Z)({},ne),{},{position:"relative"}),className:ln},li,Ht),f.createElement(o.Z,{onResize:et},f.createElement(ze,{className:"".concat(W,"-holder"),style:Vn,ref:jt,onScroll:Cn,onMouseEnter:Kn},f.createElement(m,{prefixCls:W,height:fn,offsetX:ye,offsetY:Oe,scrollWidth:Le,onInnerResize:yt,ref:Wt,innerProps:Ce,rtl:Jt,extra:Jn},jn))),Qt&&fn>pe&&f.createElement(Te,{ref:Je,prefixCls:W,scrollOffset:p,scrollRange:fn,rtl:Jt,onScroll:En,onStartMove:Vt,onStopMove:ot,spinSize:Ut,containerSize:nt.height,style:st==null?void 0:st.verticalScrollBar,thumbStyle:st==null?void 0:st.verticalScrollBarThumb,showScrollBar:Ze}),Qt&&Le>nt.width&&f.createElement(Te,{ref:Dt,prefixCls:W,scrollOffset:ye,scrollRange:Le,rtl:Jt,onScroll:En,onStartMove:Vt,onStopMove:ot,spinSize:Zt,containerSize:nt.width,horizontal:!0,style:st==null?void 0:st.horizontalScrollBar,thumbStyle:st==null?void 0:st.horizontalScrollBarThumb,showScrollBar:Ze}))}var wt=f.forwardRef(dt);wt.displayName="List";var Rt=wt,_t=Rt},83145:function(bt,ke,b){"use strict";Object.defineProperty(ke,"__esModule",{value:!0}),ke.CopyToClipboard=void 0;var B=ve(b(59301)),q=ve(b(25769));function ve(w){return w&&w.__esModule?w:{default:w}}function fe(w){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(A){return typeof A}:fe=function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},fe(w)}function oe(w,O){var A=Object.keys(w);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(w);O&&(E=E.filter(function(Q){return Object.getOwnPropertyDescriptor(w,Q).enumerable})),A.push.apply(A,E)}return A}function Z(w){for(var O=1;O<arguments.length;O++){var A=arguments[O]!=null?arguments[O]:{};O%2?oe(A,!0).forEach(function(E){H(w,E,A[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(A)):oe(A).forEach(function(E){Object.defineProperty(w,E,Object.getOwnPropertyDescriptor(A,E))})}return w}function _e(w,O){if(w==null)return{};var A=le(w,O),E,Q;if(Object.getOwnPropertySymbols){var te=Object.getOwnPropertySymbols(w);for(Q=0;Q<te.length;Q++)E=te[Q],!(O.indexOf(E)>=0)&&Object.prototype.propertyIsEnumerable.call(w,E)&&(A[E]=w[E])}return A}function le(w,O){if(w==null)return{};var A={},E=Object.keys(w),Q,te;for(te=0;te<E.length;te++)Q=E[te],!(O.indexOf(Q)>=0)&&(A[Q]=w[Q]);return A}function o(w,O){if(!(w instanceof O))throw new TypeError("Cannot call a class as a function")}function K(w,O){for(var A=0;A<O.length;A++){var E=O[A];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(w,E.key,E)}}function D(w,O,A){return O&&K(w.prototype,O),A&&K(w,A),w}function f(w,O){return O&&(fe(O)==="object"||typeof O=="function")?O:g(w)}function u(w){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},u(w)}function g(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function m(w,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");w.prototype=Object.create(O&&O.prototype,{constructor:{value:w,writable:!0,configurable:!0}}),O&&I(w,O)}function I(w,O){return I=Object.setPrototypeOf||function(E,Q){return E.__proto__=Q,E},I(w,O)}function H(w,O,A){return O in w?Object.defineProperty(w,O,{value:A,enumerable:!0,configurable:!0,writable:!0}):w[O]=A,w}var L=function(w){m(O,w);function O(){var A,E;o(this,O);for(var Q=arguments.length,te=new Array(Q),ie=0;ie<Q;ie++)te[ie]=arguments[ie];return E=f(this,(A=u(O)).call.apply(A,[this].concat(te))),H(g(E),"onClick",function(Ee){var we=E.props,xe=we.text,he=we.onCopy,V=we.children,T=we.options,C=B.default.Children.only(V),R=(0,q.default)(xe,T);he&&he(xe,R),C&&C.props&&typeof C.props.onClick=="function"&&C.props.onClick(Ee)}),E}return D(O,[{key:"render",value:function(){var E=this.props,Q=E.text,te=E.onCopy,ie=E.options,Ee=E.children,we=_e(E,["text","onCopy","options","children"]),xe=B.default.Children.only(Ee);return B.default.cloneElement(xe,Z({},we,{onClick:this.onClick}))}}]),O}(B.default.PureComponent);ke.CopyToClipboard=L,H(L,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(bt,ke,b){"use strict";var B=b(83145),q=B.CopyToClipboard;q.CopyToClipboard=q,bt.exports=q},76374:function(bt,ke,b){"use strict";var B=function(){if(typeof Map!="undefined")return Map;function V(T,C){var R=-1;return T.some(function(z,Y){return z[0]===C?(R=Y,!0):!1}),R}return function(){function T(){this.__entries__=[]}return Object.defineProperty(T.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),T.prototype.get=function(C){var R=V(this.__entries__,C),z=this.__entries__[R];return z&&z[1]},T.prototype.set=function(C,R){var z=V(this.__entries__,C);~z?this.__entries__[z][1]=R:this.__entries__.push([C,R])},T.prototype.delete=function(C){var R=this.__entries__,z=V(R,C);~z&&R.splice(z,1)},T.prototype.has=function(C){return!!~V(this.__entries__,C)},T.prototype.clear=function(){this.__entries__.splice(0)},T.prototype.forEach=function(C,R){R===void 0&&(R=null);for(var z=0,Y=this.__entries__;z<Y.length;z++){var y=Y[z];C.call(R,y[1],y[0])}},T}()}(),q=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,ve=function(){return typeof b.g!="undefined"&&b.g.Math===Math?b.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),fe=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ve):function(V){return setTimeout(function(){return V(Date.now())},1e3/60)}}(),oe=2;function Z(V,T){var C=!1,R=!1,z=0;function Y(){C&&(C=!1,V()),R&&v()}function y(){fe(Y)}function v(){var $=Date.now();if(C){if($-z<oe)return;R=!0}else C=!0,R=!1,setTimeout(y,T);z=$}return v}var _e=20,le=["top","right","bottom","left","width","height","size","weight"],o=typeof MutationObserver!="undefined",K=function(){function V(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Z(this.refresh.bind(this),_e)}return V.prototype.addObserver=function(T){~this.observers_.indexOf(T)||this.observers_.push(T),this.connected_||this.connect_()},V.prototype.removeObserver=function(T){var C=this.observers_,R=C.indexOf(T);~R&&C.splice(R,1),!C.length&&this.connected_&&this.disconnect_()},V.prototype.refresh=function(){var T=this.updateObservers_();T&&this.refresh()},V.prototype.updateObservers_=function(){var T=this.observers_.filter(function(C){return C.gatherActive(),C.hasActive()});return T.forEach(function(C){return C.broadcastActive()}),T.length>0},V.prototype.connect_=function(){!q||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),o?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},V.prototype.disconnect_=function(){!q||!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)},V.prototype.onTransitionEnd_=function(T){var C=T.propertyName,R=C===void 0?"":C,z=le.some(function(Y){return!!~R.indexOf(Y)});z&&this.refresh()},V.getInstance=function(){return this.instance_||(this.instance_=new V),this.instance_},V.instance_=null,V}(),D=function(V,T){for(var C=0,R=Object.keys(T);C<R.length;C++){var z=R[C];Object.defineProperty(V,z,{value:T[z],enumerable:!1,writable:!1,configurable:!0})}return V},f=function(V){var T=V&&V.ownerDocument&&V.ownerDocument.defaultView;return T||ve},u=Q(0,0,0,0);function g(V){return parseFloat(V)||0}function m(V){for(var T=[],C=1;C<arguments.length;C++)T[C-1]=arguments[C];return T.reduce(function(R,z){var Y=V["border-"+z+"-width"];return R+g(Y)},0)}function I(V){for(var T=["top","right","bottom","left"],C={},R=0,z=T;R<z.length;R++){var Y=z[R],y=V["padding-"+Y];C[Y]=g(y)}return C}function H(V){var T=V.getBBox();return Q(0,0,T.width,T.height)}function L(V){var T=V.clientWidth,C=V.clientHeight;if(!T&&!C)return u;var R=f(V).getComputedStyle(V),z=I(R),Y=z.left+z.right,y=z.top+z.bottom,v=g(R.width),$=g(R.height);if(R.boxSizing==="border-box"&&(Math.round(v+Y)!==T&&(v-=m(R,"left","right")+Y),Math.round($+y)!==C&&($-=m(R,"top","bottom")+y)),!O(V)){var j=Math.round(v+Y)-T,me=Math.round($+y)-C;Math.abs(j)!==1&&(v-=j),Math.abs(me)!==1&&($-=me)}return Q(z.left,z.top,v,$)}var w=function(){return typeof SVGGraphicsElement!="undefined"?function(V){return V instanceof f(V).SVGGraphicsElement}:function(V){return V instanceof f(V).SVGElement&&typeof V.getBBox=="function"}}();function O(V){return V===f(V).document.documentElement}function A(V){return q?w(V)?H(V):L(V):u}function E(V){var T=V.x,C=V.y,R=V.width,z=V.height,Y=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,y=Object.create(Y.prototype);return D(y,{x:T,y:C,width:R,height:z,top:C,right:T+R,bottom:z+C,left:T}),y}function Q(V,T,C,R){return{x:V,y:T,width:C,height:R}}var te=function(){function V(T){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Q(0,0,0,0),this.target=T}return V.prototype.isActive=function(){var T=A(this.target);return this.contentRect_=T,T.width!==this.broadcastWidth||T.height!==this.broadcastHeight},V.prototype.broadcastRect=function(){var T=this.contentRect_;return this.broadcastWidth=T.width,this.broadcastHeight=T.height,T},V}(),ie=function(){function V(T,C){var R=E(C);D(this,{target:T,contentRect:R})}return V}(),Ee=function(){function V(T,C,R){if(this.activeObservations_=[],this.observations_=new B,typeof T!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=T,this.controller_=C,this.callbackCtx_=R}return V.prototype.observe=function(T){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(T instanceof f(T).Element))throw new TypeError('parameter 1 is not of type "Element".');var C=this.observations_;C.has(T)||(C.set(T,new te(T)),this.controller_.addObserver(this),this.controller_.refresh())}},V.prototype.unobserve=function(T){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(T instanceof f(T).Element))throw new TypeError('parameter 1 is not of type "Element".');var C=this.observations_;C.has(T)&&(C.delete(T),C.size||this.controller_.removeObserver(this))}},V.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},V.prototype.gatherActive=function(){var T=this;this.clearActive(),this.observations_.forEach(function(C){C.isActive()&&T.activeObservations_.push(C)})},V.prototype.broadcastActive=function(){if(this.hasActive()){var T=this.callbackCtx_,C=this.activeObservations_.map(function(R){return new ie(R.target,R.broadcastRect())});this.callback_.call(T,C,T),this.clearActive()}},V.prototype.clearActive=function(){this.activeObservations_.splice(0)},V.prototype.hasActive=function(){return this.activeObservations_.length>0},V}(),we=typeof WeakMap!="undefined"?new WeakMap:new B,xe=function(){function V(T){if(!(this instanceof V))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var C=K.getInstance(),R=new Ee(T,C,this);we.set(this,R)}return V}();["observe","unobserve","disconnect"].forEach(function(V){xe.prototype[V]=function(){var T;return(T=we.get(this))[V].apply(T,arguments)}});var he=function(){return typeof ve.ResizeObserver!="undefined"?ve.ResizeObserver:xe}();ke.Z=he},98040:function(bt){bt.exports=function(){var ke=document.getSelection();if(!ke.rangeCount)return function(){};for(var b=document.activeElement,B=[],q=0;q<ke.rangeCount;q++)B.push(ke.getRangeAt(q));switch(b.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":b.blur();break;default:b=null;break}return ke.removeAllRanges(),function(){ke.type==="Caret"&&ke.removeAllRanges(),ke.rangeCount||B.forEach(function(ve){ke.addRange(ve)}),b&&b.focus()}}},82059:function(bt){var ke=arguments[3],b=arguments[4],B=arguments[5],q=JSON.stringify;bt.exports=function(ve,fe){for(var oe,Z=Object.keys(B),_e=0,le=Z.length;_e<le;_e++){var o=Z[_e],K=B[o].exports;if(K===ve||K&&K.default===ve){oe=o;break}}if(!oe){oe=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var D={},_e=0,le=Z.length;_e<le;_e++){var o=Z[_e];D[o]=o}b[oe]=["function(require,module,exports){"+ve+"(self); }",D]}var f=Math.floor(Math.pow(16,8)*Math.random()).toString(16),u={};u[oe]=oe,b[f]=["function(require,module,exports){var f = require("+q(oe)+");(f.default ? f.default : f)(self);}",u];var g={};m(f);function m(A){g[A]=!0;for(var E in b[A][1]){var Q=b[A][1][E];g[Q]||m(Q)}}var I="("+ke+")({"+Object.keys(g).map(function(A){return q(A)+":["+b[A][0]+","+q(b[A][1])+"]"}).join(",")+"},{},["+q(f)+"])",H=window.URL||window.webkitURL||window.mozURL||window.msURL,L=new Blob([I],{type:"text/javascript"});if(fe&&fe.bare)return L;var w=H.createObjectURL(L),O=new Worker(w);return O.objectURL=w,O}},93314:function(bt){"use strict";bt.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=="},40846:function(bt,ke,b){"use strict";b.d(ke,{ZP:function(){return _r}});function B(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var q={exports:{}};(function(a,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,l={buildAbsoluteURL:function(d,h,_){if(_=_||{},d=d.trim(),h=h.trim(),!h){if(!_.alwaysNormalize)return d;var S=l.parseURL(d);if(!S)throw new Error("Error trying to parse base URL.");return S.path=l.normalizePath(S.path),l.buildURLFromParts(S)}var U=l.parseURL(h);if(!U)throw new Error("Error trying to parse relative URL.");if(U.scheme)return _.alwaysNormalize?(U.path=l.normalizePath(U.path),l.buildURLFromParts(U)):h;var ee=l.parseURL(d);if(!ee)throw new Error("Error trying to parse base URL.");if(!ee.netLoc&&ee.path&&ee.path[0]!=="/"){var X=i.exec(ee.path);ee.netLoc=X[1],ee.path=X[2]}ee.netLoc&&!ee.path&&(ee.path="/");var ae={scheme:ee.scheme,netLoc:U.netLoc,path:null,params:U.params,query:U.query,fragment:U.fragment};if(!U.netLoc&&(ae.netLoc=ee.netLoc,U.path[0]!=="/"))if(!U.path)ae.path=ee.path,U.params||(ae.params=ee.params,U.query||(ae.query=ee.query));else{var ce=ee.path,Re=ce.substring(0,ce.lastIndexOf("/")+1)+U.path;ae.path=l.normalizePath(Re)}return ae.path===null&&(ae.path=_.alwaysNormalize?l.normalizePath(U.path):U.path),l.buildURLFromParts(ae)},parseURL:function(d){var h=n.exec(d);return h?{scheme:h[1]||"",netLoc:h[2]||"",path:h[3]||"",params:h[4]||"",query:h[5]||"",fragment:h[6]||""}:null},normalizePath:function(d){for(d=d.split("").reverse().join("").replace(r,"");d.length!==(d=d.replace(s,"")).length;);return d.split("").reverse().join("")},buildURLFromParts:function(d){return d.scheme+d.netLoc+d.path+d.params+d.query+d.fragment}};a.exports=l})()})(q);var ve=q.exports;function fe(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 oe(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fe(Object(t),!0).forEach(function(n){le(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):fe(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function Z(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function _e(a){var e=Z(a,"string");return typeof e=="symbol"?e:String(e)}function le(a,e,t){return e=_e(e),e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function o(){return o=Object.assign?Object.assign.bind():function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},o.apply(this,arguments)}const K=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},D=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=f},f=Number.MAX_SAFE_INTEGER||9007199254740991;let u=function(a){return a.MEDIA_ATTACHING="hlsMediaAttaching",a.MEDIA_ATTACHED="hlsMediaAttached",a.MEDIA_DETACHING="hlsMediaDetaching",a.MEDIA_DETACHED="hlsMediaDetached",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.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.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_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}({}),g=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}({}),m=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.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.INTERNAL_EXCEPTION="internalException",a.INTERNAL_ABORTED="aborted",a.UNKNOWN="unknown",a}({});const I=function(){},H={trace:I,debug:I,log:I,warn:I,info:I,error:I};let L=H;function w(a){const e=self.console[a];return e?e.bind(self.console,`[${a}] >`):I}function O(a,...e){e.forEach(function(t){L[t]=a[t]?a[t].bind(a):w(t)})}function A(a,e){if(typeof console=="object"&&a===!0||typeof a=="object"){O(a,"debug","log","info","warn","error");try{L.log(`Debug logs enabled for "${e}" in hls.js version 1.5.20`)}catch(t){L=H}}else L=H}const E=L,Q=/^(\d+)x(\d+)$/,te=/(.+?)=(".*?"|.*?)(?:,|$)/g;class ie{constructor(e){typeof e=="string"&&(e=ie.parseAttrList(e)),o(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}else 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]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Q.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const n={},i='"';for(te.lastIndex=0;(t=te.exec(e))!==null;){let r=t[2];r.indexOf(i)===0&&r.lastIndexOf(i)===r.length-1&&(r=r.slice(1,-1));const s=t[1].trim();n[s]=r}return n}}function Ee(a){return a!=="ID"&&a!=="CLASS"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function we(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"}class xe{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const n=t.attr;for(const i in n)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==n[i]){E.warn(`DATERANGE tag attribute: "${i}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=i;break}e=o(new ie({}),n,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const n=new Date(this.attr["END-DATE"]);K(n.getTime())&&(this._endDate=n)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(K(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&K(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class he{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 T{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[V.AUDIO]:null,[V.VIDEO]:null,[V.AUDIOVIDEO]:null},this.baseurl=e}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 byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=ve.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class C extends T{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=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.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new he,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 decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const n=Object.keys(this.levelkeys);if(n.length===1)return this._decryptdata=this.levelkeys[n[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!K(this.programDateTime))return null;const e=K(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),n=t.length;if(n>1||n===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,i,r,s=!1){const{elementaryStreams:l}=this,d=l[e];if(!d){l[e]={startPTS:t,endPTS:n,startDTS:i,endDTS:r,partial:s};return}d.startPTS=Math.min(d.startPTS,t),d.endPTS=Math.max(d.endPTS,n),d.startDTS=Math.min(d.startDTS,i),d.endDTS=Math.max(d.endDTS,r)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[V.AUDIO]=null,e[V.VIDEO]=null,e[V.AUDIOVIDEO]=null}}class R extends T{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.stats=new he,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)}}const z=10;class Y{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.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 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.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,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?K(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||z}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get 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 lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function y(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function v(a){const e=me(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function $(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 j(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=y(s)):t=v(s)}}return t}function me(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}const Se=typeof self!="undefined"?self:void 0;var Te={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},De={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function qe(a){switch(a){case De.FAIRPLAY:return Te.FAIRPLAY;case De.PLAYREADY:return Te.PLAYREADY;case De.WIDEVINE:return Te.WIDEVINE;case De.CLEARKEY:return Te.CLEARKEY}}var lt={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",FAIRPLAY:"94ce86fb07ff4f43adb893d2fa968ca2",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function We(a){if(a===lt.WIDEVINE)return Te.WIDEVINE;if(a===lt.PLAYREADY)return Te.PLAYREADY;if(a===lt.CENC||a===lt.CLEARKEY)return Te.CLEARKEY}function Tt(a){switch(a){case Te.FAIRPLAY:return De.FAIRPLAY;case Te.PLAYREADY:return De.PLAYREADY;case Te.WIDEVINE:return De.WIDEVINE;case Te.CLEARKEY:return De.CLEARKEY}}function dt(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[Te.FAIRPLAY,Te.WIDEVINE,Te.PLAYREADY,Te.CLEARKEY].filter(i=>!!e[i]):[];return!n[Te.WIDEVINE]&&t&&n.push(Te.WIDEVINE),n}const wt=function(a){return Se!=null&&(a=Se.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function Rt(a,e,t,n){let i;switch(a){case Te.FAIRPLAY:i=["cenc","sinf"];break;case Te.WIDEVINE:case Te.PLAYREADY:i=["cenc"];break;case Te.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return _t(i,e,t,n)}function _t(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 Pe(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),n=t.substring(t.indexOf("<"),t.length),s=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(s){const l=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(l){const d=y(l).subarray(0,16);return $(d),d}}return null}function J(a,e,t){return Uint8Array.prototype.slice?a.slice(e,t):new Uint8Array(Array.prototype.slice.call(a,e,t))}const ue=(a,e)=>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,W=(a,e)=>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,M=(a,e)=>{const t=e;let n=0;for(;ue(a,e);){n+=10;const i=pe(a,e+6);n+=i,W(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)},pe=(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},k=(a,e)=>ue(a,e)&&pe(a,e+6)+10<=a.length-e,N=a=>{const e=F(a);for(let t=0;t<e.length;t++){const n=e[t];if(P(n))return Le(n)}},P=a=>a&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp",ne=a=>{const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=pe(a,4),n=10;return{type:e,size:t,data:a.subarray(n,n+t)}},F=a=>{let e=0;const t=[];for(;ue(a,e);){const n=pe(a,e+6);e+=10;const i=e+n;for(;e+8<i;){const r=ne(a.subarray(e)),s=se(r);s&&t.push(s),e+=r.size+10}W(a,e)&&(e+=10)}return t},se=a=>a.type==="PRIV"?de(a):a.type[0]==="W"?be(a):ge(a),de=a=>{if(a.size<2)return;const e=Ne(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}},ge=a=>{if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=Ne(a.data.subarray(t),!0);t+=n.length+1;const i=Ne(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=Ne(a.data.subarray(1));return{key:a.type,data:e}},be=a=>{if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=Ne(a.data.subarray(t),!0);t+=n.length+1;const i=Ne(a.data.subarray(t));return{key:a.type,info:n,data:i}}const e=Ne(a.data);return{key:a.type,data:e}},Le=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)}},Ne=(a,e=!1)=>{const t=Ie();if(t){const h=t.decode(a);if(e){const _=h.indexOf("\0");return _!==-1?h.substring(0,_):h}return h.replace(/\0/g,"")}const n=a.length;let i,r,s,l="",d=0;for(;d<n;){if(i=a[d++],i===0&&e)return l;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:l+=String.fromCharCode(i);break;case 12:case 13:r=a[d++],l+=String.fromCharCode((i&31)<<6|r&63);break;case 14:r=a[d++],s=a[d++],l+=String.fromCharCode((i&15)<<12|(r&63)<<6|(s&63)<<0);break}}return l};let ze;function Ie(){if(!navigator.userAgent.includes("PlayStation 4"))return!ze&&typeof self.TextDecoder!="undefined"&&(ze=new self.TextDecoder("utf-8")),ze}const Ke={hexDump:function(a){let e="";for(let t=0;t<a.length;t++){let n=a[t].toString(16);n.length<2&&(n="0"+n),e+=n}return e}},je=Math.pow(2,32)-1,Ce=[].push,vt={video:1,audio:2,id3:3,text:4};function st(a){return String.fromCharCode.apply(null,a)}function St(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function Ze(a,e){const t=Kt(a,e);return t<0?4294967296+t:t}function Ht(a,e){let t=Ze(a,e);return t*=Math.pow(2,32),t+=Ze(a,e+4),t}function Kt(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function zt(a,e,t){a[e]=t>>24,a[e+1]=t>>16&255,a[e+2]=t>>8&255,a[e+3]=t&255}function Ot(a){const e=a.byteLength;for(let t=0;t<e;){const n=Ze(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 ht(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let i=0;i<n;){const r=Ze(a,i),s=st(a.subarray(i+4,i+8)),l=r>1?i+r:n;if(s===e[0])if(e.length===1)t.push(a.subarray(i+8,l));else{const d=ht(a.subarray(i+8,l),e.slice(1));d.length&&Ce.apply(t,d)}i=l}return t}function yt(a){const e=[],t=a[0];let n=8;const i=Ze(a,n);n+=4;let r=0,s=0;t===0?(r=Ze(a,n),s=Ze(a,n+4),n+=8):(r=Ht(a,n),s=Ht(a,n+8),n+=16),n+=2;let l=a.length+s;const d=St(a,n);n+=2;for(let h=0;h<d;h++){let _=n;const S=Ze(a,_);_+=4;const U=S&2147483647;if((S&2147483648)>>>31===1)return E.warn("SIDX has hierarchical references (not supported)"),null;const X=Ze(a,_);_+=4,e.push({referenceSize:U,subsegmentDuration:X,info:{duration:X/i,start:l,end:l+U-1}}),l+=U,_+=4,n=_}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:d,references:e}}function ut(a){const e=[],t=ht(a,["moov","trak"]);for(let i=0;i<t.length;i++){const r=t[i],s=ht(r,["tkhd"])[0];if(s){let l=s[0];const d=Ze(s,l===0?12:20),h=ht(r,["mdia","mdhd"])[0];if(h){l=h[0];const _=Ze(h,l===0?12:20),S=ht(r,["mdia","hdlr"])[0];if(S){const U=st(S.subarray(8,12)),ee={soun:V.AUDIO,vide:V.VIDEO}[U];if(ee){const X=ht(r,["mdia","minf","stbl","stsd"])[0],ae=Ct(X);e[d]={timescale:_,type:ee},e[ee]=oe({timescale:_,id:d},ae)}}}}}return ht(a,["moov","mvex","trex"]).forEach(i=>{const r=Ze(i,4),s=e[r];s&&(s.default={duration:Ze(i,12),flags:Ze(i,20)})}),e}function Ct(a){const e=a.subarray(8),t=e.subarray(86),n=st(e.subarray(4,8));let i=n;const r=n==="enca"||n==="encv";if(r){const l=ht(e,[n])[0].subarray(n==="enca"?28:78);ht(l,["sinf"]).forEach(h=>{const _=ht(h,["schm"])[0];if(_){const S=st(_.subarray(4,8));if(S==="cbcs"||S==="cenc"){const U=ht(h,["frma"])[0];U&&(i=st(U))}}})}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const s=ht(t,["avcC"])[0];i+="."+Mt(s[1])+Mt(s[2])+Mt(s[3]);break}case"mp4a":{const s=ht(e,[n])[0],l=ht(s.subarray(28),["esds"])[0];if(l&&l.length>12){let d=4;if(l[d++]!==3)break;d=ft(l,d),d+=2;const h=l[d++];if(h&128&&(d+=2),h&64&&(d+=l[d++]),l[d++]!==4)break;d=ft(l,d);const _=l[d++];if(_===64)i+="."+Mt(_);else break;if(d+=12,l[d++]!==5)break;d=ft(l,d);const S=l[d++];let U=(S&248)>>3;U===31&&(U+=1+((S&7)<<3)+((l[d]&224)>>5)),i+="."+U}break}case"hvc1":case"hev1":{const s=ht(t,["hvcC"])[0],l=s[1],d=["","A","B","C"][l>>6],h=l&31,_=Ze(s,2),S=(l&32)>>5?"H":"L",U=s[12],ee=s.subarray(6,12);i+="."+d+h,i+="."+_.toString(16).toUpperCase(),i+="."+S+U;let X="";for(let ae=ee.length;ae--;){const ce=ee[ae];(ce||X)&&(X="."+ce.toString(16).toUpperCase()+X)}i+=X;break}case"dvh1":case"dvhe":{const s=ht(t,["dvcC"])[0],l=s[2]>>1&127,d=s[2]<<5&32|s[3]>>3&31;i+="."+Qt(l)+"."+Qt(d);break}case"vp09":{const s=ht(t,["vpcC"])[0],l=s[4],d=s[5],h=s[6]>>4&15;i+="."+Qt(l)+"."+Qt(d)+"."+Qt(h);break}case"av01":{const s=ht(t,["av1C"])[0],l=s[1]>>>5,d=s[1]&31,h=s[2]>>>7?"H":"M",_=(s[2]&64)>>6,S=(s[2]&32)>>5,U=l===2&&_?S?12:10:_?10:8,ee=(s[2]&16)>>4,X=(s[2]&8)>>3,ae=(s[2]&4)>>2,ce=s[2]&3;i+="."+l+"."+Qt(d)+h+"."+Qt(U)+"."+ee+"."+X+ae+ce+"."+Qt(1)+"."+Qt(1)+"."+Qt(1)+"."+0;break}}return{codec:i,encrypted:r}}function ft(a,e){const t=e+5;for(;a[e++]&128&&e<t;);return e}function Mt(a){return("0"+a.toString(16).toUpperCase()).slice(-2)}function Qt(a){return(a<10?"0":"")+a}function Jt(a,e){if(!a||!e)return a;const t=e.keyId;return t&&e.isCommonEncryption&&ht(a,["moov","trak"]).forEach(i=>{const s=ht(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let l=ht(s,["enca"]);const d=l.length>0;d||(l=ht(s,["encv"])),l.forEach(h=>{const _=d?h.subarray(28):h.subarray(78);ht(_,["sinf"]).forEach(U=>{const ee=ln(U);if(ee){const X=ee.subarray(8,24);X.some(ae=>ae!==0)||(E.log(`[eme] Patching keyId in 'enc${d?"a":"v"}>sinf>>tenc' box: ${Ke.hexDump(X)} -> ${Ke.hexDump(t)}`),ee.set(t,8))}})})}),a}function ln(a){const e=ht(a,["schm"])[0];if(e){const t=st(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return ht(a,["schi","tenc"])[0]}return null}function an(a,e){return ht(e,["moof","traf"]).reduce((t,n)=>{const i=ht(n,["tfdt"])[0],r=i[0],s=ht(n,["tfhd"]).reduce((l,d)=>{const h=Ze(d,4),_=a[h];if(_){let S=Ze(i,4);if(r===1){if(S===je)return E.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),l;S*=je+1,S+=Ze(i,8)}const U=_.timescale||9e4,ee=S/U;if(K(ee)&&(l===null||ee<l))return ee}return l},null);return s!==null&&K(s)&&(t===null||s<t)?s:t},null)}function jt(a,e){let t=0,n=0,i=0;const r=ht(a,["moof","traf"]);for(let s=0;s<r.length;s++){const l=r[s],d=ht(l,["tfhd"])[0],h=Ze(d,4),_=e[h];if(!_)continue;const S=_.default,U=Ze(d,0)|(S==null?void 0:S.flags);let ee=S==null?void 0:S.duration;U&8&&(U&2?ee=Ze(d,12):ee=Ze(d,8));const X=_.timescale||9e4,ae=ht(l,["trun"]);for(let ce=0;ce<ae.length;ce++){if(t=Wt(ae[ce]),!t&&ee){const Re=Ze(ae[ce],4);t=ee*Re}_.type===V.VIDEO?n+=t/X:_.type===V.AUDIO&&(i+=t/X)}}if(n===0&&i===0){let s=1/0,l=0,d=0;const h=ht(a,["sidx"]);for(let _=0;_<h.length;_++){const S=yt(h[_]);if(S!=null&&S.references){s=Math.min(s,S.earliestPresentationTime/S.timescale);const U=S.references.reduce((ee,X)=>ee+X.info.duration||0,0);l=Math.max(l,U+S.earliestPresentationTime/S.timescale),d=l-s}}if(d&&K(d))return d}return n||i}function Wt(a){const e=Ze(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let n=0;const i=Ze(a,4);for(let r=0;r<i;r++){if(e&256){const s=Ze(a,t);n+=s,t+=4}e&512&&(t+=4),e&1024&&(t+=4),e&2048&&(t+=4)}return n}function pt(a,e,t){ht(e,["moof","traf"]).forEach(n=>{ht(n,["tfhd"]).forEach(i=>{const r=Ze(i,4),s=a[r];if(!s)return;const l=s.timescale||9e4;ht(n,["tfdt"]).forEach(d=>{const h=d[0],_=t*l;if(_){let S=Ze(d,4);if(h===0)S-=_,S=Math.max(S,0),zt(d,4,S);else{S*=Math.pow(2,32),S+=Ze(d,8),S-=_,S=Math.max(S,0);const U=Math.floor(S/(je+1)),ee=Math.floor(S%(je+1));zt(d,4,U),zt(d,8,ee)}}})})})}function Xe(a){const e={valid:null,remainder:null},t=ht(a,["moof"]);if(t.length<2)return e.remainder=a,e;const n=t[t.length-1];return e.valid=J(a,0,n.byteOffset-8),e.remainder=J(a,n.byteOffset-8),e}function c(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function p(a,e){const t=[],n=e.samples,i=e.timescale,r=e.id;let s=!1;return ht(n,["moof"]).map(d=>{const h=d.byteOffset-8;ht(d,["traf"]).map(S=>{const U=ht(S,["tfdt"]).map(ee=>{const X=ee[0];let ae=Ze(ee,4);return X===1&&(ae*=Math.pow(2,32),ae+=Ze(ee,8)),ae/i})[0];return U!==void 0&&(a=U),ht(S,["tfhd"]).map(ee=>{const X=Ze(ee,4),ae=Ze(ee,0)&16777215,ce=(ae&1)!==0,Re=(ae&2)!==0,$e=(ae&8)!==0;let Ue=0;const rt=(ae&16)!==0;let Ge=0;const xt=(ae&32)!==0;let it=8;X===r&&(ce&&(it+=8),Re&&(it+=4),$e&&(Ue=Ze(ee,it),it+=4),rt&&(Ge=Ze(ee,it),it+=4),xt&&(it+=4),e.type==="video"&&(s=x(e.codec)),ht(S,["trun"]).map(kt=>{const Yt=kt[0],mt=Ze(kt,0)&16777215,Nt=(mt&1)!==0;let Sn=0;const tn=(mt&4)!==0,bn=(mt&256)!==0;let yn=0;const mn=(mt&512)!==0;let Nn=0;const zn=(mt&1024)!==0,un=(mt&2048)!==0;let nn=0;const Bn=Ze(kt,4);let Rn=8;Nt&&(Sn=Ze(kt,Rn),Rn+=4),tn&&(Rn+=4);let Gn=Sn+h;for(let di=0;di<Bn;di++){if(bn?(yn=Ze(kt,Rn),Rn+=4):yn=Ue,mn?(Nn=Ze(kt,Rn),Rn+=4):Nn=Ge,zn&&(Rn+=4),un&&(Yt===0?nn=Ze(kt,Rn):nn=Kt(kt,Rn),Rn+=4),e.type===V.VIDEO){let _i=0;for(;_i<Nn;){const xi=Ze(n,Gn);if(Gn+=4,G(s,n[Gn])){const Gi=n.subarray(Gn,Gn+xi);re(Gi,s?2:1,a+nn/i,t)}Gn+=xi,_i+=xi+4}}a+=yn/i}}))})})}),t}function x(a){if(!a)return!1;const e=a.indexOf("."),t=e<0?a:a.substring(0,e);return t==="hvc1"||t==="hev1"||t==="dvh1"||t==="dvhe"}function G(a,e){if(a){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function re(a,e,t,n){const i=ye(a);let r=0;r+=e;let s=0,l=0,d=0;for(;r<i.length;){s=0;do{if(r>=i.length)break;d=i[r++],s+=d}while(d===255);l=0;do{if(r>=i.length)break;d=i[r++],l+=d}while(d===255);const h=i.length-r;let _=r;if(l<h)r+=l;else if(l>h){E.error(`Malformed SEI payload. ${l} is too small, only ${h} bytes left to parse.`);break}if(s===4){if(i[_++]===181){const U=St(i,_);if(_+=2,U===49){const ee=Ze(i,_);if(_+=4,ee===1195456820){const X=i[_++];if(X===3){const ae=i[_++],ce=31&ae,Re=64&ae,$e=Re?2+ce*3:0,Ue=new Uint8Array($e);if(Re){Ue[0]=ae;for(let rt=1;rt<$e;rt++)Ue[rt]=i[_++]}n.push({type:X,payloadType:s,pts:t,bytes:Ue})}}}}}else if(s===5&&l>16){const S=[];for(let X=0;X<16;X++){const ae=i[_++].toString(16);S.push(ae.length==1?"0"+ae:ae),(X===3||X===5||X===7||X===9)&&S.push("-")}const U=l-16,ee=new Uint8Array(U);for(let X=0;X<U;X++)ee[X]=i[_++];n.push({payloadType:s,pts:t,uuid:S.join(""),userData:Ne(ee),userDataBytes:ee})}}}function ye(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 Ae(a){const e=a[0];let t="",n="",i=0,r=0,s=0,l=0,d=0,h=0;if(e===0){for(;st(a.subarray(h,h+1))!=="\0";)t+=st(a.subarray(h,h+1)),h+=1;for(t+=st(a.subarray(h,h+1)),h+=1;st(a.subarray(h,h+1))!=="\0";)n+=st(a.subarray(h,h+1)),h+=1;n+=st(a.subarray(h,h+1)),h+=1,i=Ze(a,12),r=Ze(a,16),l=Ze(a,20),d=Ze(a,24),h=28}else if(e===1){h+=4,i=Ze(a,h),h+=4;const S=Ze(a,h);h+=4;const U=Ze(a,h);for(h+=4,s=Za(2,32)*S+U,D(s)||(s=Number.MAX_SAFE_INTEGER,E.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=Ze(a,h),h+=4,d=Ze(a,h),h+=4;st(a.subarray(h,h+1))!=="\0";)t+=st(a.subarray(h,h+1)),h+=1;for(t+=st(a.subarray(h,h+1)),h+=1;st(a.subarray(h,h+1))!=="\0";)n+=st(a.subarray(h,h+1)),h+=1;n+=st(a.subarray(h,h+1)),h+=1}const _=a.subarray(h,a.byteLength);return{schemeIdUri:t,value:n,timeScale:i,presentationTime:s,presentationTimeDelta:r,eventDuration:l,id:d,payload:_}}function tt(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 Qe(a,e,t){if(a.byteLength!==16)throw new RangeError("Invalid system id");let n,i;if(e){n=1,i=new Uint8Array(e.length*16);for(let l=0;l<e.length;l++){const d=e[l];if(d.byteLength!==16)throw new RangeError("Invalid key");i.set(d,l*16)}}else 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&&t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),tt([112,115,115,104],new Uint8Array([n,0,0,0]),a,r,i,s,t||new Uint8Array)}function at(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=Ft(i);e.push(r),n+=r.size}}return e}function Ft(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,l=Ke.hexDump(new Uint8Array(s,t+12,16)),d=a.getUint32(28);let h=null,_=null;if(r===0){if(e-32<d||d<22)return{offset:t,size:e};_=new Uint8Array(s,t+32,d)}else if(r===1){if(!d||n<t+32+d*16+16)return{offset:t,size:e};h=[];for(let S=0;S<d;S++)h.push(new Uint8Array(s,t+32+S*16,16))}return{version:r,systemId:l,kids:h,data:_,offset:t,size:e}}let Vt={};class ot{static clearKeyUriToKeyIdMap(){Vt={}}constructor(e,t,n,i=[1],r=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=i,this.iv=r,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&e!=="AES-128"}isSupported(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case De.FAIRPLAY:case De.WIDEVINE:case De.PLAYREADY:case De.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof e!="number"&&(this.method==="AES-128"&&!this.iv&&E.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=qt(e);return new ot(this.method,this.uri,"identity",this.keyFormatVersions,n)}const t=j(this.uri);if(t)switch(this.keyFormat){case De.WIDEVINE:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case De.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Qe(n,null,t),this.keyId=Pe(t);break}default:{let n=t.subarray(0,16);if(n.length!==16){const i=new Uint8Array(16);i.set(n,16-n.length),n=i}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n=Vt[this.uri];if(!n){const i=Object.keys(Vt).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,i),Vt[this.uri]=n}this.keyId=n}return this}}function qt(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const At=/\{\$([a-zA-Z0-9-_]+)\}/g;function Fe(a){return At.test(a)}function Be(a,e,t){if(a.variableList!==null||a.hasVariableRefs)for(let n=t.length;n--;){const i=t[n],r=e[i];r&&(e[i]=ct(a,r))}}function ct(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(At,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 It(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 Pt(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}"`))}function dn(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function fn(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}const Lt={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,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 Et(a,e){const t=Lt[e];return!!t&&!!t[a.slice(0,4)]}function Oe(a,e,t=!0){return!a.split(",").some(n=>!Me(n,e,t))}function Me(a,e,t=!0){var n;const i=dn(t);return(n=i==null?void 0:i.isTypeSupported(He(a,e)))!=null?n:!1}function He(a,e){return`${e}/mp4;codecs="${a}"`}function nt(a){if(a){const e=a.substring(0,4);return Lt.video[e]}return 2}function Ye(a){return a.split(",").reduce((e,t)=>{const n=Lt.video[t];return n?(n*2+e)/(e?3:2):(Lt.audio[t]+e)/(e?2:1)},0)}const et={};function Je(a,e=!0){if(et[a])return et[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[a];for(let n=0;n<t.length;n++)if(Me(t[n],"audio",e))return et[a]=t[n],t[n];return a}const Dt=/flac|opus/i;function Zt(a,e=!0){return a.replace(Dt,t=>Je(t.toLowerCase(),e))}function Ut(a,e){return a&&a!=="mp4a"?a:e&&e.split(",")[0]}function rn(a){const e=a.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");if(n.length>2){let i=n.shift()+".";i+=parseInt(n.shift()).toString(16),i+=("000"+parseInt(n.shift()).toString(16)).slice(-4),e[t]=i}}return e.join(",")}const on=/#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,_n=/#EXT-X-MEDIA:(.*)/g,cn=/^#EXT(?:INF|-X-TARGETDURATION):/m,Xt=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),An=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(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 gn{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 ve.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return cn.test(e)}static parseMasterPlaylist(e,t){const n=Fe(e),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},r=[];on.lastIndex=0;let s;for(;(s=on.exec(e))!=null;)if(s[1]){var l;const h=new ie(s[1]);Be(i,h,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const _=ct(i,s[2]),S={attrs:h,bitrate:h.decimalInteger("BANDWIDTH")||h.decimalInteger("AVERAGE-BANDWIDTH"),name:h.NAME,url:gn.resolve(_,t)},U=h.decimalResolution("RESOLUTION");U&&(S.width=U.width,S.height=U.height),xn(h.CODECS,S),(l=S.unknownCodecs)!=null&&l.length||r.push(S),i.levels.push(S)}else if(s[3]){const h=s[3],_=s[4];switch(h){case"SESSION-DATA":{const S=new ie(_);Be(i,S,["DATA-ID","LANGUAGE","VALUE","URI"]);const U=S["DATA-ID"];U&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[U]=S);break}case"SESSION-KEY":{const S=On(_,t,i);S.encrypted&&S.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(S)):E.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${_}"`);break}case"DEFINE":{{const S=new ie(_);Be(i,S,["NAME","VALUE","QUERYPARAM"]),It(i,S,t)}break}case"CONTENT-STEERING":{const S=new ie(_);Be(i,S,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:gn.resolve(S["SERVER-URI"],t),pathwayId:S["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=wn(_);break}}}const d=r.length>0&&r.length<i.levels.length;return i.levels=d?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,l={AUDIO:s.map(h=>({id:h.attrs.AUDIO,audioCodec:h.audioCodec})),SUBTITLES:s.map(h=>({id:h.attrs.SUBTITLES,textCodec:h.textCodec})),"CLOSED-CAPTIONS":[]};let d=0;for(_n.lastIndex=0;(i=_n.exec(e))!==null;){const h=new ie(i[1]),_=h.TYPE;if(_){const S=l[_],U=r[_]||[];r[_]=U,Be(n,h,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const ee=h.LANGUAGE,X=h["ASSOC-LANGUAGE"],ae=h.CHANNELS,ce=h.CHARACTERISTICS,Re=h["INSTREAM-ID"],$e={attrs:h,bitrate:0,id:d++,groupId:h["GROUP-ID"]||"",name:h.NAME||ee||"",type:_,default:h.bool("DEFAULT"),autoselect:h.bool("AUTOSELECT"),forced:h.bool("FORCED"),lang:ee,url:h.URI?gn.resolve(h.URI,t):""};if(X&&($e.assocLang=X),ae&&($e.channels=ae),ce&&($e.characteristics=ce),Re&&($e.instreamId=Re),S!=null&&S.length){const Ue=gn.findGroup(S,$e.groupId)||S[0];vn($e,Ue,"audioCodec"),vn($e,Ue,"textCodec")}U.push($e)}}return r}static parseLevelPlaylist(e,t,n,i,r,s){const l=new Y(t),d=l.fragments;let h=null,_=0,S=0,U=0,ee=0,X=null,ae=new C(i,t),ce,Re,$e,Ue=-1,rt=!1,Ge=null;for(Xt.lastIndex=0,l.m3u8=e,l.hasVariableRefs=Fe(e);(ce=Xt.exec(e))!==null;){rt&&(rt=!1,ae=new C(i,t),ae.start=U,ae.sn=_,ae.cc=ee,ae.level=n,h&&(ae.initSegment=h,ae.rawProgramDateTime=h.rawProgramDateTime,h.rawProgramDateTime=null,Ge&&(ae.setByteRange(Ge),Ge=null)));const Yt=ce[1];if(Yt){ae.duration=parseFloat(Yt);const mt=(" "+ce[2]).slice(1);ae.title=mt||null,ae.tagList.push(mt?["INF",Yt,mt]:["INF",Yt])}else if(ce[3]){if(K(ae.duration)){ae.start=U,$e&&Ln(ae,$e,l),ae.sn=_,ae.level=n,ae.cc=ee,d.push(ae);const mt=(" "+ce[3]).slice(1);ae.relurl=ct(l,mt),Cn(ae,X),X=ae,U+=ae.duration,_++,S=0,rt=!0}}else if(ce[4]){const mt=(" "+ce[4]).slice(1);X?ae.setByteRange(mt,X):ae.setByteRange(mt)}else if(ce[5])ae.rawProgramDateTime=(" "+ce[5]).slice(1),ae.tagList.push(["PROGRAM-DATE-TIME",ae.rawProgramDateTime]),Ue===-1&&(Ue=d.length);else{if(ce=ce[0].match(An),!ce){E.warn("No matches on slow regex match for level playlist!");continue}for(Re=1;Re<ce.length&&typeof ce[Re]=="undefined";Re++);const mt=(" "+ce[Re]).slice(1),Nt=(" "+ce[Re+1]).slice(1),Sn=ce[Re+2]?(" "+ce[Re+2]).slice(1):"";switch(mt){case"PLAYLIST-TYPE":l.type=Nt.toUpperCase();break;case"MEDIA-SEQUENCE":_=l.startSN=parseInt(Nt);break;case"SKIP":{const tn=new ie(Nt);Be(l,tn,["RECENTLY-REMOVED-DATERANGES"]);const bn=tn.decimalInteger("SKIPPED-SEGMENTS");if(K(bn)){l.skippedSegments=bn;for(let mn=bn;mn--;)d.unshift(null);_+=bn}const yn=tn.enumeratedString("RECENTLY-REMOVED-DATERANGES");yn&&(l.recentlyRemovedDateranges=yn.split(" "));break}case"TARGETDURATION":l.targetduration=Math.max(parseInt(Nt),1);break;case"VERSION":l.version=parseInt(Nt);break;case"INDEPENDENT-SEGMENTS":case"EXTM3U":break;case"ENDLIST":l.live=!1;break;case"#":(Nt||Sn)&&ae.tagList.push(Sn?[Nt,Sn]:[Nt]);break;case"DISCONTINUITY":ee++,ae.tagList.push(["DIS"]);break;case"GAP":ae.gap=!0,ae.tagList.push([mt]);break;case"BITRATE":ae.tagList.push([mt,Nt]);break;case"DATERANGE":{const tn=new ie(Nt);Be(l,tn,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),Be(l,tn,tn.clientAttrs);const bn=new xe(tn,l.dateRanges[tn.ID]);bn.isValid||l.skippedSegments?l.dateRanges[bn.id]=bn:E.warn(`Ignoring invalid DATERANGE tag: "${Nt}"`),ae.tagList.push(["EXT-X-DATERANGE",Nt]);break}case"DEFINE":{{const tn=new ie(Nt);Be(l,tn,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in tn?Pt(l,tn,s):It(l,tn,t)}break}case"DISCONTINUITY-SEQUENCE":ee=parseInt(Nt);break;case"KEY":{const tn=On(Nt,t,l);if(tn.isSupported()){if(tn.method==="NONE"){$e=void 0;break}$e||($e={}),$e[tn.keyFormat]&&($e=o({},$e)),$e[tn.keyFormat]=tn}else E.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${Nt}"`);break}case"START":l.startTimeOffset=wn(Nt);break;case"MAP":{const tn=new ie(Nt);if(Be(l,tn,["BYTERANGE","URI"]),ae.duration){const bn=new C(i,t);Un(bn,tn,n,$e),h=bn,ae.initSegment=h,h.rawProgramDateTime&&!ae.rawProgramDateTime&&(ae.rawProgramDateTime=h.rawProgramDateTime)}else{const bn=ae.byteRangeEndOffset;if(bn){const yn=ae.byteRangeStartOffset;Ge=`${bn-yn}@${yn}`}else Ge=null;Un(ae,tn,n,$e),h=ae,rt=!0}break}case"SERVER-CONTROL":{const tn=new ie(Nt);l.canBlockReload=tn.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=tn.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&tn.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=tn.optionalFloat("PART-HOLD-BACK",0),l.holdBack=tn.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const tn=new ie(Nt);l.partTarget=tn.decimalFloatingPoint("PART-TARGET");break}case"PART":{let tn=l.partList;tn||(tn=l.partList=[]);const bn=S>0?tn[tn.length-1]:void 0,yn=S++,mn=new ie(Nt);Be(l,mn,["BYTERANGE","URI"]);const Nn=new R(mn,ae,t,yn,bn);tn.push(Nn),ae.duration+=Nn.duration;break}case"PRELOAD-HINT":{const tn=new ie(Nt);Be(l,tn,["URI"]),l.preloadHint=tn;break}case"RENDITION-REPORT":{const tn=new ie(Nt);Be(l,tn,["URI"]),l.renditionReports=l.renditionReports||[],l.renditionReports.push(tn);break}default:E.warn(`line parsed but not handled: ${ce}`);break}}}X&&!X.relurl?(d.pop(),U-=X.duration,l.partList&&(l.fragmentHint=X)):l.partList&&(Cn(ae,X),ae.cc=ee,l.fragmentHint=ae,$e&&Ln(ae,$e,l));const xt=d.length,it=d[0],kt=d[xt-1];if(U+=l.skippedSegments*l.targetduration,U>0&&xt&&kt){l.averagetargetduration=U/xt;const Yt=kt.sn;l.endSN=Yt!=="initSegment"?Yt:0,l.live||(kt.endList=!0),it&&(l.startCC=it.cc)}else l.endSN=0,l.startCC=0;return l.fragmentHint&&(U+=l.fragmentHint.duration),l.totalduration=U,l.endCC=ee,Ue>0&&En(d,Ue),l}}function On(a,e,t){var n,i;const r=new ie(a);Be(t,r,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const s=(n=r.METHOD)!=null?n:"",l=r.URI,d=r.hexadecimalInteger("IV"),h=r.KEYFORMATVERSIONS,_=(i=r.KEYFORMAT)!=null?i:"identity";l&&r.IV&&!d&&E.error(`Invalid IV: ${r.IV}`);const S=l?gn.resolve(l,e):"",U=(h||"1").split("/").map(Number).filter(Number.isFinite);return new ot(s,S,_,U,d)}function wn(a){const t=new ie(a).decimalFloatingPoint("TIME-OFFSET");return K(t)?t:null}function xn(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=t.filter(r=>Et(r,n));i.length&&(e[`${n}Codec`]=i.join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function vn(a,e,t){const n=e[t];n&&(a[t]=n)}function En(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 Cn(a,e){a.rawProgramDateTime?a.programDateTime=Date.parse(a.rawProgramDateTime):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime),K(a.programDateTime)||(a.programDateTime=null,a.rawProgramDateTime=null)}function Un(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 Ln(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)}var hn={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},$t={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function $n(a){const{type:e}=a;switch(e){case hn.AUDIO_TRACK:return $t.AUDIO;case hn.SUBTITLE_TRACK:return $t.SUBTITLE;default:return $t.MAIN}}function Pn(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Kn{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.LEVEL_LOADING,this.onLevelLoading,this),e.on(u.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(u.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.LEVEL_LOADING,this.onLevelLoading,this),e.off(u.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(u.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,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:hn.MANIFEST,url:n,deliveryDirectives:null})}onLevelLoading(e,t){const{id:n,level:i,pathwayId:r,url:s,deliveryDirectives:l}=t;this.load({id:n,level:i,pathwayId:r,responseType:"text",type:hn.LEVEL,url:s,deliveryDirectives:l})}onAudioTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:hn.AUDIO_TRACK,url:r,deliveryDirectives:s})}onSubtitleTrackLoading(e,t){const{id:n,groupId:i,url:r,deliveryDirectives:s}=t;this.load({id:n,groupId:i,level:null,responseType:"text",type:hn.SUBTITLE_TRACK,url:r,deliveryDirectives:s})}load(e){var t;const n=this.hls.config;let i=this.getInternalLoader(e);if(i){const h=i.context;if(h&&h.url===e.url&&h.level===e.level){E.trace("[playlist-loader]: playlist request ongoing");return}E.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===hn.MANIFEST?r=n.manifestLoadPolicy.default:r=o({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),K((t=e.deliveryDirectives)==null?void 0:t.part)){let h;if(e.type===hn.LEVEL&&e.level!==null?h=this.hls.levels[e.level].details:e.type===hn.AUDIO_TRACK&&e.id!==null?h=this.hls.audioTracks[e.id].details:e.type===hn.SUBTITLE_TRACK&&e.id!==null&&(h=this.hls.subtitleTracks[e.id].details),h){const _=h.partTarget,S=h.targetduration;if(_&&S){const U=Math.max(_*3,S*.8)*1e3;r=o({},r,{maxTimeToFirstByteMs:Math.min(U,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(U,r.maxTimeToFirstByteMs)})}}}const s=r.errorRetry||r.timeoutRetry||{},l={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},d={onSuccess:(h,_,S,U)=>{const ee=this.getInternalLoader(S);this.resetInternalLoader(S.type);const X=h.data;if(X.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(h,S,new Error("no EXTM3U delimiter"),U||null,_);return}_.parsing.start=performance.now(),gn.isMediaPlaylist(X)?this.handleTrackOrLevelPlaylist(h,_,S,U||null,ee):this.handleMasterPlaylist(h,_,S,U)},onError:(h,_,S,U)=>{this.handleNetworkError(_,S,!1,h,U)},onTimeout:(h,_,S)=>{this.handleNetworkError(_,S,!0,void 0,h)}};i.load(e,l,d)}handleMasterPlaylist(e,t,n,i){const r=this.hls,s=e.data,l=Pn(e,n),d=gn.parseMasterPlaylist(s,l);if(d.playlistParsingError){this.handleManifestParsingError(e,n,d.playlistParsingError,i,t);return}const{contentSteering:h,levels:_,sessionData:S,sessionKeys:U,startTimeOffset:ee,variableList:X}=d;this.variableList=X;const{AUDIO:ae=[],SUBTITLES:ce,"CLOSED-CAPTIONS":Re}=gn.parseMasterPlaylistMedia(s,l,d);ae.length&&!ae.some(Ue=>!Ue.url)&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(E.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),ae.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new ie({}),bitrate:0,url:""})),r.trigger(u.MANIFEST_LOADED,{levels:_,audioTracks:ae,subtitles:ce,captions:Re,contentSteering:h,url:l,stats:t,networkDetails:i,sessionData:S,sessionKeys:U,startTimeOffset:ee,variableList:X})}handleTrackOrLevelPlaylist(e,t,n,i,r){const s=this.hls,{id:l,level:d,type:h}=n,_=Pn(e,n),S=0,U=K(d)?d:K(l)?l:0,ee=$n(n),X=gn.parseLevelPlaylist(e.data,_,U,ee,S,this.variableList);if(h===hn.MANIFEST){const ae={attrs:new ie({}),bitrate:0,details:X,name:"",url:_};s.trigger(u.MANIFEST_LOADED,{levels:[ae],audioTracks:[],url:_,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=X,this.handlePlaylistLoaded(X,e,t,n,i,r)}handleManifestParsingError(e,t,n,i,r){this.hls.trigger(u.ERROR,{type:g.NETWORK_ERROR,details:m.MANIFEST_PARSING_ERROR,fatal:t.type===hn.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===hn.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===hn.AUDIO_TRACK||e.type===hn.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const l=new Error(s);E.warn(`[playlist-loader]: ${s}`);let d=m.UNKNOWN,h=!1;const _=this.getInternalLoader(e);switch(e.type){case hn.MANIFEST:d=n?m.MANIFEST_LOAD_TIMEOUT:m.MANIFEST_LOAD_ERROR,h=!0;break;case hn.LEVEL:d=n?m.LEVEL_LOAD_TIMEOUT:m.LEVEL_LOAD_ERROR,h=!1;break;case hn.AUDIO_TRACK:d=n?m.AUDIO_TRACK_LOAD_TIMEOUT:m.AUDIO_TRACK_LOAD_ERROR,h=!1;break;case hn.SUBTITLE_TRACK:d=n?m.SUBTITLE_TRACK_LOAD_TIMEOUT:m.SUBTITLE_LOAD_ERROR,h=!1;break}_&&this.resetInternalLoader(e.type);const S={type:g.NETWORK_ERROR,details:d,fatal:h,url:e.url,loader:_,context:e,error:l,networkDetails:t,stats:r};if(i){const U=(t==null?void 0:t.url)||e.url;S.response=oe({url:U,data:void 0},i)}this.hls.trigger(u.ERROR,S)}handlePlaylistLoaded(e,t,n,i,r,s){const l=this.hls,{type:d,level:h,id:_,groupId:S,deliveryDirectives:U}=i,ee=Pn(t,i),X=$n(i),ae=typeof i.level=="number"&&X===$t.MAIN?h:void 0;if(!e.fragments.length){const Re=new Error("No Segments found in Playlist");l.trigger(u.ERROR,{type:g.NETWORK_ERROR,details:m.LEVEL_EMPTY_ERROR,fatal:!1,url:ee,error:Re,reason:Re.message,response:t,context:i,level:ae,parent:X,networkDetails:r,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const ce=e.playlistParsingError;if(ce){l.trigger(u.ERROR,{type:g.NETWORK_ERROR,details:m.LEVEL_PARSING_ERROR,fatal:!1,url:ee,error:ce,reason:ce.message,response:t,context:i,level:ae,parent:X,networkDetails:r,stats:n});return}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),d){case hn.MANIFEST:case hn.LEVEL:l.trigger(u.LEVEL_LOADED,{details:e,level:ae||0,id:_||0,stats:n,networkDetails:r,deliveryDirectives:U});break;case hn.AUDIO_TRACK:l.trigger(u.AUDIO_TRACK_LOADED,{details:e,id:_||0,groupId:S||"",stats:n,networkDetails:r,deliveryDirectives:U});break;case hn.SUBTITLE_TRACK:l.trigger(u.SUBTITLE_TRACK_LOADED,{details:e,id:_||0,groupId:S||"",stats:n,networkDetails:r,deliveryDirectives:U});break}}}function Yn(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 ti(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){E.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){E.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function Jn(a){const e=a.mode;if(e==="disabled"&&(a.mode="hidden"),a.cues)for(let t=a.cues.length;t--;)a.removeCue(a.cues[t]);e==="disabled"&&(a.mode=e)}function jn(a,e,t,n){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=li(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 Vn(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;for(;n<=i;){const r=Math.floor((i+n)/2);if(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 li(a,e,t){const n=[],i=Vn(a,e);if(i>-1)for(let r=i,s=a.length;r<s;r++){const l=a[r];if(l.startTime>=e&&l.endTime<=t)n.push(l);else if(l.startTime>t)return n}return n}function Bt(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}var Gt={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const pn=.25;function Tn(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function kn(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,JSON.stringify(i?oe({type:i},n):n))}return r}const Xn=(()=>{const a=Tn();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Mn(a,e){return a.getTime()/1e3-e}function ui(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class fi{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(u.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(u.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(Jn(this.id3Track),this.id3Track=null,this.media=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 Yn(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:i}}}=this;if(!n&&!i)return;const{samples:r}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=Tn();if(s)for(let l=0;l<r.length;l++){const d=r[l].type;if(d===Gt.emsg&&!n||!i)continue;const h=F(r[l].data);if(h){const _=r[l].pts;let S=_+r[l].duration;S>Xn&&(S=Xn),S-_<=0&&(S=_+pn);for(let ee=0;ee<h.length;ee++){const X=h[ee];if(!P(X)){this.updateId3CueEnds(_,d);const ae=kn(s,_,S,X,d);ae&&this.id3Track.addCue(ae)}}}}}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===Xn&&(s.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:i}){const{id3Track:r,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:l,enableID3MetadataCues:d}}=s;if(r&&(l||d)){let h;i==="audio"?h=_=>_.type===Gt.audioId3&&d:i==="video"?h=_=>_.type===Gt.emsg&&l:h=_=>_.type===Gt.audioId3&&d||_.type===Gt.emsg&&l,jn(r,t,n,h)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:n,id3Track:i}=this,{dateRanges:r}=t,s=Object.keys(r);if(i){const _=Object.keys(n).filter(S=>!s.includes(S));for(let S=_.length;S--;){const U=_[S];Object.keys(n[U].cues).forEach(ee=>{i.removeCue(n[U].cues[ee])}),delete n[U]}}const l=t.fragments[t.fragments.length-1];if(s.length===0||!K(l==null?void 0:l.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const d=l.programDateTime/1e3-l.start,h=Tn();for(let _=0;_<s.length;_++){const S=s[_],U=r[S],ee=Mn(U.startDate,d),X=n[S],ae=(X==null?void 0:X.cues)||{};let ce=(X==null?void 0:X.durationKnown)||!1,Re=Xn;const $e=U.endDate;if($e)Re=Mn($e,d),ce=!0;else if(U.endOnNext&&!ce){const rt=s.reduce((Ge,xt)=>{if(xt!==U.id){const it=r[xt];if(it.class===U.class&&it.startDate>U.startDate&&(!Ge||U.startDate<Ge.startDate))return it}return Ge},null);rt&&(Re=Mn(rt.startDate,d),ce=!0)}const Ue=Object.keys(U.attr);for(let rt=0;rt<Ue.length;rt++){const Ge=Ue[rt];if(!Ee(Ge))continue;const xt=ae[Ge];if(xt)ce&&!X.durationKnown&&(xt.endTime=Re);else if(h){let it=U.attr[Ge];we(Ge)&&(it=ui(it));const kt=kn(h,ee,Re,{key:Ge,data:it},Gt.dateRange);kt&&(kt.id=S,this.id3Track.addCue(kt),ae[Ge]=kt)}}n[S]={cues:ae,dateRange:U,durationKnown:ce}}}}class vi{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=()=>this.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:n,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:s,lowLatencyMode:l}=this.config,d=this.hls.userConfig;let h=l&&n||t;(d.liveSyncDuration||d.liveSyncDurationCount||h===0)&&(h=r!==void 0?r:s*i);const _=i;return h+Math.min(this.stallCount*1,_)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,n=this.levelDetails;if(e===null||t===null||n===null)return null;const i=n.edge,r=e-t-this.edgeStalled,s=i-n.totalduration,l=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,r),l)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;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,levelDetails:t}=this;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.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(u.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(u.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(u.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(u.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(u.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(u.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var n;t.details===m.BUFFER_STALLED_ERROR&&(this.stallCount++,(n=this.levelDetails)!=null&&n.live&&E.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const n=this.computeLatency();if(n===null)return;this._latency=n;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:r}=this.config;if(!i||r===1||!t.live)return;const s=this.targetLatency;if(s===null)return;const l=n-s,d=Math.min(this.maxLatency,s+t.targetduration);if(l<d&&l>.05&&this.forwardBufferLength>1){const _=Math.min(2,Math.max(1,r)),S=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;e.playbackRate=Math.min(_,Math.max(1,S))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const ri=["NONE","TYPE-0","TYPE-1",null];function Wn(a){return ri.indexOf(a)>-1}const ni=["SDR","PQ","HLG"];function yi(a){return!!a&&ni.indexOf(a)>-1}var Si={No:"",Yes:"YES",v2:"v2"};function hi(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,i=n<e/2;return e&&i?t?Si.v2:Si.Yes:Si.No}class Ai{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 pi{constructor(e){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.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(t=>!!t).map(t=>t.substring(0,4)).join(","),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 Ci(this._audioGroups,e)}hasSubtitleGroup(e){return Ci(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 Ci(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function ki(a,e){const t=e.startPTS;if(K(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.duration=n)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.start=a.start+(a.minEndPTS-a.start):e.start=a.start+a.duration:e.start=Math.max(a.start-e.duration,0)}function Pi(a,e,t,n,i,r){n-t<=0&&(E.warn("Fragment should have a positive duration",e),n=t+e.duration,r=i+e.duration);let l=t,d=n;const h=e.startPTS,_=e.endPTS;if(K(h)){const ce=Math.abs(h-t);K(e.deltaPTS)?e.deltaPTS=Math.max(ce,e.deltaPTS):e.deltaPTS=ce,l=Math.max(t,h),t=Math.min(t,h),i=Math.min(i,e.startDTS),d=Math.min(n,_),n=Math.max(n,_),r=Math.max(r,e.endDTS)}const S=t-e.start;e.start!==0&&(e.start=t),e.duration=n-e.start,e.startPTS=t,e.maxStartPTS=l,e.startDTS=i,e.endPTS=n,e.minEndPTS=d,e.endDTS=r;const U=e.sn;if(!a||U<a.startSN||U>a.endSN)return 0;let ee;const X=U-a.startSN,ae=a.fragments;for(ae[X]=e,ee=X;ee>0;ee--)ki(ae[ee],ae[ee-1]);for(ee=X;ee<ae.length-1;ee++)ki(ae[ee],ae[ee+1]);return a.fragmentHint&&ki(ae[ae.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,S}function zi(a,e){let t=null;const n=a.fragments;for(let l=n.length-1;l>=0;l--){const d=n[l].initSegment;if(d){t=d;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i;qi(a,e,(l,d,h,_)=>{if(e.skippedSegments&&d.cc!==l.cc){const S=l.cc-d.cc;for(let U=h;U<_.length;U++)_[U].cc+=S}K(l.startPTS)&&K(l.endPTS)&&(d.start=d.startPTS=l.startPTS,d.startDTS=l.startDTS,d.maxStartPTS=l.maxStartPTS,d.endPTS=l.endPTS,d.endDTS=l.endDTS,d.minEndPTS=l.minEndPTS,d.duration=l.endPTS-l.startPTS,d.duration&&(i=d),e.PTSKnown=e.alignedSliding=!0),d.elementaryStreams=l.elementaryStreams,d.loader=l.loader,d.stats=l.stats,l.initSegment&&(d.initSegment=l.initSegment,t=l.initSegment)});const r=e.fragments;if(t&&(e.fragmentHint?r.concat(e.fragmentHint):r).forEach(d=>{var h;d&&(!d.initSegment||d.initSegment.relurl===((h=t)==null?void 0:h.relurl))&&(d.initSegment=t)}),e.skippedSegments){if(e.deltaUpdateFailed=r.some(l=>!l),e.deltaUpdateFailed){E.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let l=e.skippedSegments;l--;)r.shift();e.startSN=r[0].sn}else e.canSkipDateRanges&&(e.dateRanges=ji(a.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));e.startCC=e.fragments[0].cc,e.endCC=r[r.length-1].cc}wi(a.partList,e.partList,(l,d)=>{d.elementaryStreams=l.elementaryStreams,d.stats=l.stats}),i?Pi(e,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):Ni(a,e),r.length&&(e.totalduration=e.edge-r[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const s=e.advancedDateTime;if(e.advanced&&s){const l=e.edge;e.driftStart||(e.driftStartTime=s,e.driftStart=l),e.driftEndTime=s,e.driftEnd=l}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime}function ji(a,e,t){const n=o({},a);return t&&t.forEach(i=>{delete n[i]}),Object.keys(e).forEach(i=>{const r=new xe(e[i].attr,n[i]);r.isValid?n[i]=r:E.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[i].attr)}"`)}),n}function wi(a,e,t){if(a&&e){let n=0;for(let i=0,r=a.length;i<=r;i++){const s=a[i],l=e[i+n];s&&l&&s.index===l.index&&s.fragment.sn===l.fragment.sn?t(s,l):n--}}}function qi(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,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,d=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let h=i;h<=r;h++){const _=d[s+h];let S=l[h];n&&!S&&h<n&&(S=e.fragments[h]=_),_&&S&&t(_,S,h,l)}}function Ni(a,e){const t=e.startSN+e.skippedSegments-a.startSN,n=a.fragments;t<0||t>=n.length||Ii(e,n[t].start)}function Ii(a,e){if(e){const t=a.fragments;for(let n=a.skippedSegments;n<t.length;n++)t[n].start+=e;a.fragmentHint&&(a.fragmentHint.start+=e)}}function er(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 Mi(a,e,t){if(!(a!=null&&a.details))return null;const n=a.details;let i=n.fragments[e-n.startSN];return i||(i=n.fragmentHint,i&&i.sn===e)?i:e<n.startSN&&t&&t.sn===e?t:null}function Di(a,e,t){var n;return a!=null&&a.details?Fi((n=a.details)==null?void 0:n.partList,e,t):null}function Fi(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 ai(a){a.forEach((e,t)=>{const{details:n}=e;n!=null&&n.fragments&&n.fragments.forEach(i=>{i.level=t})})}function Ti(a){switch(a.details){case m.FRAG_LOAD_TIMEOUT:case m.KEY_LOAD_TIMEOUT:case m.LEVEL_LOAD_TIMEOUT:case m.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Qn(a,e){const t=Ti(e);return a.default[`${t?"timeout":"error"}Retry`]}function mi(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function Ei(a){return oe(oe({},a),{errorRetry:null,timeoutRetry:null})}function si(a,e,t,n){if(!a)return!1;const i=n==null?void 0:n.code,r=e<a.maxNumRetry&&(ci(i)||!!t);return a.shouldRetry?a.shouldRetry(a,e,t,n,r):r}function ci(a){return a===0&&navigator.onLine===!1||!!a&&(a<400||a>499)}const Vi={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 sr(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!K(e))return null;const n=a[0].programDateTime;if(e<(n||0))return null;const i=a[a.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let r=0;r<a.length;++r){const s=a[r];if(Zi(e,t,s))return s}return null}function Bi(a,e,t=0,n=0,i=.005){let r=null;if(a){r=e[a.sn-e[0].sn+1]||null;const l=a.endDTS-t;l>0&&l<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&Wi(t,n,r)===0||dr(r,a,Math.min(i,n))))return r;const s=Vi.search(e,Wi.bind(null,t,n));return s&&(s!==a||!r)?s:r}function dr(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 Wi(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 Zi(a,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>a}function sn(a,e){return Vi.search(a,t=>t.cc<e?1:t.cc>e?-1:0)}var en={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},In={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class qn{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=E.log.bind(E,"[info]:"),this.warn=E.warn.bind(E,"[warning]:"),this.error=E.error.bind(E,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(u.ERROR,this.onError,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(u.ERROR,this.onError,this),e.off(u.ERROR,this.onErrorOut,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===$t.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n,i;if(t.fatal)return;const r=this.hls,s=t.context;switch(t.details){case m.FRAG_LOAD_ERROR:case m.FRAG_LOAD_TIMEOUT:case m.KEY_LOAD_ERROR:case m.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case m.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction={action:en.DoNothing,flags:In.None};return}case m.FRAG_GAP:case m.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=en.SendAlternateToPenaltyBox;return}case m.LEVEL_EMPTY_ERROR:case m.LEVEL_PARSING_ERROR:{var l,d;const h=t.parent===$t.MAIN?t.level:r.loadLevel;t.details===m.LEVEL_EMPTY_ERROR&&((l=t.context)!=null&&(d=l.levelDetails)!=null&&d.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,h):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,h))}return;case m.LEVEL_LOAD_ERROR:case m.LEVEL_LOAD_TIMEOUT:typeof(s==null?void 0:s.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.level));return;case m.AUDIO_TRACK_LOAD_ERROR:case m.AUDIO_TRACK_LOAD_TIMEOUT:case m.SUBTITLE_LOAD_ERROR:case m.SUBTITLE_TRACK_LOAD_TIMEOUT:if(s){const h=r.levels[r.loadLevel];if(h&&(s.type===hn.AUDIO_TRACK&&h.hasAudioGroup(s.groupId)||s.type===hn.SUBTITLE_TRACK&&h.hasSubtitleGroup(s.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=en.SendAlternateToPenaltyBox,t.errorAction.flags=In.MoveAllAlternatesMatchingHost;return}}return;case m.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const h=r.levels[r.loadLevel],_=h==null?void 0:h.attrs["HDCP-LEVEL"];_?t.errorAction={action:en.SendAlternateToPenaltyBox,flags:In.MoveAllAlternatesMatchingHDCP,hdcpLevel:_}:this.keySystemError(t)}return;case m.BUFFER_ADD_CODEC_ERROR:case m.REMUX_ALLOC_ERROR:case m.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(i=t.level)!=null?i:r.loadLevel);return;case m.INTERNAL_EXCEPTION:case m.BUFFER_APPENDING_ERROR:case m.BUFFER_FULL_ERROR:case m.LEVEL_SWITCH_ERROR:case m.BUFFER_STALLED_ERROR:case m.BUFFER_SEEK_OVER_HOLE:case m.BUFFER_NUDGE_ON_STALL:t.errorAction={action:en.DoNothing,flags:In.None};return}t.type===g.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,i=Qn(n.config.playlistLoadPolicy,e),r=this.playlistError++;if(si(i,r,Ti(e),e.response))return{action:en.RetryRequest,flags:In.None,retryConfig:i,retryCount:r};const l=this.getLevelSwitchAction(e,t);return i&&(l.retryConfig=i,l.retryCount=r),l}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),i=t.levels[n],{fragLoadPolicy:r,keyLoadPolicy:s}=t.config,l=Qn(e.details.startsWith("key")?s:r,e),d=t.levels.reduce((_,S)=>_+S.fragmentError,0);if(i&&(e.details!==m.FRAG_GAP&&i.fragmentError++,si(l,d,Ti(e),e.response)))return{action:en.RetryRequest,flags:In.None,retryConfig:l,retryCount:d};const h=this.getLevelSwitchAction(e,n);return l&&(h.retryConfig=l,h.retryCount=d),h}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const i=this.hls.levels[t];if(i){var r,s;const h=e.details;i.loadError++,h===m.BUFFER_APPEND_ERROR&&i.fragmentError++;let _=-1;const{levels:S,loadLevel:U,minAutoLevel:ee,maxAutoLevel:X}=n;n.autoLevelEnabled||(n.loadLevel=-1);const ae=(r=e.frag)==null?void 0:r.type,Re=(ae===$t.AUDIO&&h===m.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(h===m.BUFFER_ADD_CODEC_ERROR||h===m.BUFFER_APPEND_ERROR))&&S.some(({audioCodec:xt})=>i.audioCodec!==xt),Ue=e.sourceBufferName==="video"&&(h===m.BUFFER_ADD_CODEC_ERROR||h===m.BUFFER_APPEND_ERROR)&&S.some(({codecSet:xt,audioCodec:it})=>i.codecSet!==xt&&i.audioCodec===it),{type:rt,groupId:Ge}=(s=e.context)!=null?s:{};for(let xt=S.length;xt--;){const it=(xt+U)%S.length;if(it!==U&&it>=ee&&it<=X&&S[it].loadError===0){var l,d;const kt=S[it];if(h===m.FRAG_GAP&&ae===$t.MAIN&&e.frag){const Yt=S[it].details;if(Yt){const mt=Bi(e.frag,Yt.fragments,e.frag.start);if(mt!=null&&mt.gap)continue}}else{if(rt===hn.AUDIO_TRACK&&kt.hasAudioGroup(Ge)||rt===hn.SUBTITLE_TRACK&&kt.hasSubtitleGroup(Ge))continue;if(ae===$t.AUDIO&&(l=i.audioGroups)!=null&&l.some(Yt=>kt.hasAudioGroup(Yt))||ae===$t.SUBTITLE&&(d=i.subtitleGroups)!=null&&d.some(Yt=>kt.hasSubtitleGroup(Yt))||Re&&i.audioCodec===kt.audioCodec||!Re&&i.audioCodec!==kt.audioCodec||Ue&&i.codecSet===kt.codecSet)continue}_=it;break}}if(_>-1&&n.loadLevel!==_)return e.levelRetry=!0,this.playlistError=0,{action:en.SendAlternateToPenaltyBox,flags:In.None,nextAutoLevel:_}}return{action:en.SendAlternateToPenaltyBox,flags:In.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case en.DoNothing:break;case en.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==m.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 en.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:i,hdcpLevel:r,nextAutoLevel:s}=n;switch(i){case In.None:this.switchLevel(e,s);break;case In.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=ri[ri.indexOf(r)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}n.resolved||this.switchLevel(e,s)}switchLevel(e,t){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)}}class Dn{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=E.log.bind(E,`${t}:`),this.warn=E.warn.bind(E,`${t}:`),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.requestScheduled=-1,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 l=i[s];let d;try{d=new self.URL(l.URI,t.url).href}catch(h){E.warn(`Could not construct new URL for Rendition Report: ${h}`),d=l.URI||""}if(d===e){r=s;break}else d===e.substring(0,d.length)&&(r=s)}if(r!==-1){const s=i[r],l=parseInt(s["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let d=parseInt(s["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const _=Math.min(t.age-t.partTarget,t.targetduration);d>=0&&_>t.partTarget&&(d+=1)}const h=n&&hi(n);return new Ai(l,d>=0?d:void 0,h)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,n){const{details:i,stats:r}=t,s=self.performance.now(),l=r.loading.first?Math.max(0,s-r.loading.first):0;if(i.advancedDateTime=Date.now()-l,i.live||n!=null&&n.live){if(i.reloaded(n),n&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),n&&i.fragments.length>0&&zi(n,i),!this.canLoad||!i.live)return;let d,h,_;if(i.canBlockReload&&i.endSN&&i.advanced){const ce=this.hls.config.lowLatencyMode,Re=i.lastPartSn,$e=i.endSN,Ue=i.lastPartIndex,rt=Ue!==-1,Ge=Re===$e,xt=ce?0:Ue;rt?(h=Ge?$e+1:Re,_=Ge?xt:Ue+1):h=$e+1;const it=i.age,kt=it+i.ageHeader;let Yt=Math.min(kt-i.partTarget,i.targetduration*1.5);if(Yt>0){if(n&&Yt>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${Yt} with playlist age: ${i.age}`),Yt=0;else{const mt=Math.floor(Yt/i.targetduration);if(h+=mt,_!==void 0){const Nt=Math.round(Yt%i.targetduration/i.partTarget);_+=Nt}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${it.toFixed(2)}s goal: ${Yt} skip sn ${mt} to part ${_}`)}i.tuneInGoal=Yt}if(d=this.getDeliveryDirectives(i,t.deliveryDirectives,h,_),ce||!Ge){this.loadPlaylist(d);return}}else(i.canBlockReload||i.canSkipUntil)&&(d=this.getDeliveryDirectives(i,t.deliveryDirectives,h,_));const S=this.hls.mainForwardBufferInfo,U=S?S.end-S.len:0,ee=(i.edge-U)*1e3,X=er(i,ee);i.updated&&s>this.requestScheduled+X&&(this.requestScheduled=r.loading.start),h!==void 0&&i.canBlockReload?this.requestScheduled=r.loading.first+X-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+X<s?this.requestScheduled=s:this.requestScheduled-s<=0&&(this.requestScheduled+=X);let ae=this.requestScheduled-s;ae=Math.max(0,ae),this.log(`reload live playlist ${e} in ${Math.round(ae)} ms`),this.timer=self.setTimeout(()=>this.loadPlaylist(d),ae)}else this.clearTimer()}getDeliveryDirectives(e,t,n,i){let r=hi(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,i=t.part,r=Si.No),new Ai(n,i,r)}checkRetry(e){const t=e.details,n=Ti(e),i=e.errorAction,{action:r,retryCount:s=0,retryConfig:l}=i||{},d=!!i&&!!l&&(r===en.RetryRequest||!i.resolved&&r===en.SendAlternateToPenaltyBox);if(d){var h;if(this.requestScheduled=-1,s>=l.maxNumRetry)return!1;if(n&&(h=e.context)!=null&&h.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const _=mi(l,s);this.timer=self.setTimeout(()=>this.loadPlaylist(),_),this.warn(`Retrying playlist loading ${s+1}/${l.maxNumRetry} after "${t}" in ${_}ms`)}e.levelRetry=!0,i.resolved=!0}return d}}class Oi{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 hr{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 Oi(e),this.fast_=new Oi(t),this.defaultTTFB_=i,this.ttfb_=new Oi(e)}update(e,t){const{slow_:n,fast_:i,ttfb_:r}=this;n.halfLife!==e&&(this.slow_=new Oi(e,n.getEstimate(),n.getTotalWeight())),i.halfLife!==t&&(this.fast_=new Oi(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new Oi(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_}destroy(){}}const ar={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},tr={};function ts(a,e,t,n,i,r){const s=a.audioCodec?a.audioGroups:null,l=r==null?void 0:r.audioCodec,d=r==null?void 0:r.channels,h=d?parseInt(d):l?1/0:2;let _=null;if(s!=null&&s.length)try{s.length===1&&s[0]?_=e.groups[s[0]].channels:_=s.reduce((S,U)=>{if(U){const ee=e.groups[U];if(!ee)throw new Error(`Audio track group ${U} not found`);Object.keys(ee.channels).forEach(X=>{S[X]=(S[X]||0)+ee.channels[X]})}return S},{2:0})}catch(S){return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(n,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(i,8e6))||!!_&&K(h)&&Object.keys(_).some(S=>parseInt(S)>h)}function ns(a,e,t){const n=a.videoCodec,i=a.audioCodec;if(!n||!i||!t)return Promise.resolve(ar);const r={width:a.width,height:a.height,bitrate:Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)),framerate:a.frameRate||30},s=a.videoRange;s!=="SDR"&&(r.transferFunction=s.toLowerCase());const l=n.split(",").map(d=>({type:"media-source",video:oe(oe({},r),{},{contentType:He(d,"video")})}));return i&&a.audioGroups&&a.audioGroups.forEach(d=>{var h;d&&((h=e.groups[d])==null||h.tracks.forEach(_=>{if(_.groupId===d){const S=_.channels||"",U=parseFloat(S);K(U)&&U>2&&l.push.apply(l,i.split(",").map(ee=>({type:"media-source",audio:{contentType:He(ee,"audio"),channels:""+U}})))}}))}),Promise.all(l.map(d=>{const h=Nr(d);return tr[h]||(tr[h]=t.decodingInfo(d))})).then(d=>({supported:!d.some(h=>!h.supported),configurations:l,decodingInfoResults:d})).catch(d=>({supported:!1,configurations:l,decodingInfoResults:[],error:d}))}function Nr(a){const{audio:e,video:t}=a,n=t||e;if(n){const i=n.contentType.split('"')[1];if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}function vr(){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 is(a,e){let t=!1,n=[];return a&&(t=a!=="SDR",n=[a]),e&&(n=e.allowedVideoRanges||ni.slice(0),t=e.preferHDR!==void 0?e.preferHDR:vr(),t?n=n.filter(i=>i!=="SDR"):n=["SDR"]),{preferHDR:t,allowedVideoRanges:n}}function Lr(a,e,t,n,i){const r=Object.keys(a),s=n==null?void 0:n.channels,l=n==null?void 0:n.audioCodec,d=s&&parseInt(s)===2;let h=!0,_=!1,S=1/0,U=1/0,ee=1/0,X=0,ae=[];const{preferHDR:ce,allowedVideoRanges:Re}=is(e,i);for(let Ge=r.length;Ge--;){const xt=a[r[Ge]];h=xt.channels[2]>0,S=Math.min(S,xt.minHeight),U=Math.min(U,xt.minFramerate),ee=Math.min(ee,xt.minBitrate);const it=Re.filter(kt=>xt.videoRanges[kt]>0);it.length>0&&(_=!0,ae=it)}S=K(S)?S:0,U=K(U)?U:0;const $e=Math.max(1080,S),Ue=Math.max(30,U);return ee=K(ee)?ee:t,t=Math.max(ee,t),_||(e=void 0,ae=[]),{codecSet:r.reduce((Ge,xt)=>{const it=a[xt];if(xt===Ge)return Ge;if(it.minBitrate>t)return bi(xt,`min bitrate of ${it.minBitrate} > current estimate of ${t}`),Ge;if(!it.hasDefaultAudio)return bi(xt,"no renditions with default or auto-select sound found"),Ge;if(l&&xt.indexOf(l.substring(0,4))%5!==0)return bi(xt,`audio codec preference "${l}" not found`),Ge;if(s&&!d){if(!it.channels[s])return bi(xt,`no renditions with ${s} channel sound found (channels options: ${Object.keys(it.channels)})`),Ge}else if((!l||d)&&h&&it.channels[2]===0)return bi(xt,"no renditions with stereo sound found"),Ge;return it.minHeight>$e?(bi(xt,`min resolution of ${it.minHeight} > maximum of ${$e}`),Ge):it.minFramerate>Ue?(bi(xt,`min framerate of ${it.minFramerate} > maximum of ${Ue}`),Ge):ae.some(kt=>it.videoRanges[kt]>0)?it.maxScore<X?(bi(xt,`max score of ${it.maxScore} < selected max of ${X}`),Ge):Ge&&(Ye(xt)>=Ye(Ge)||it.fragmentError>a[Ge].fragmentError)?Ge:(X=it.maxScore,xt):(bi(xt,`no variants with VIDEO-RANGE of ${JSON.stringify(ae)} found`),Ge)},void 0),videoRanges:ae,preferHDR:ce,minFramerate:U,minBitrate:ee}}function bi(a,e){E.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function Mr(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 Fr(a,e,t,n){return a.slice(t,n+1).reduce((i,r)=>{if(!r.codecSet)return i;const s=r.audioGroups;let l=i[r.codecSet];l||(i[r.codecSet]=l={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!s,fragmentError:0}),l.minBitrate=Math.min(l.minBitrate,r.bitrate);const d=Math.min(r.height,r.width);return l.minHeight=Math.min(l.minHeight,d),l.minFramerate=Math.min(l.minFramerate,r.frameRate),l.maxScore=Math.max(l.maxScore,r.score),l.fragmentError+=r.fragmentError,l.videoRanges[r.videoRange]=(l.videoRanges[r.videoRange]||0)+1,s&&s.forEach(h=>{if(!h)return;const _=e.groups[h];_&&(l.hasDefaultAudio=l.hasDefaultAudio||e.hasDefaultAudio?_.hasDefault:_.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(_.channels).forEach(S=>{l.channels[S]=(l.channels[S]||0)+_.channels[S]}))}),i},{})}function Ui(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(Yi(a,i,t))return n}return-1}function Yi(a,e,t){const{groupId:n,name:i,lang:r,assocLang:s,default:l}=a,d=a.forced;return(n===void 0||e.groupId===n)&&(i===void 0||e.name===i)&&(r===void 0||e.lang===r)&&(r===void 0||e.assocLang===s)&&(l===void 0||e.default===l)&&(d===void 0||e.forced===d)&&(!("characteristics"in a)||rs(a.characteristics||"",e.characteristics))&&(t===void 0||t(a,e))}function rs(a,e=""){const t=a.split(","),n=e.split(",");return t.length===n.length&&!t.some(i=>n.indexOf(i)===-1)}function Xi(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 ss(a,e,t,n,i){const r=e[n],l=e.reduce((U,ee,X)=>{const ae=ee.uri;return(U[ae]||(U[ae]=[])).push(X),U},{})[r.uri];l.length>1&&(n=Math.max.apply(Math,l));const d=r.videoRange,h=r.frameRate,_=r.codecSet.substring(0,4),S=Br(e,n,U=>{if(U.videoRange!==d||U.frameRate!==h||U.codecSet.substring(0,4)!==_)return!1;const ee=U.audioGroups,X=t.filter(ae=>!ee||ee.indexOf(ae.groupId)!==-1);return Ui(a,X,i)>-1});return S>-1?S:Br(e,n,U=>{const ee=U.audioGroups,X=t.filter(ae=>!ee||ee.indexOf(ae.groupId)!==-1);return Ui(a,X,i)>-1})}function Br(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}class as{constructor(e){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.bwEstimator=void 0,this._abandonRulesCheck=()=>{const{fragCurrent:t,partCurrent:n,hls:i}=this,{autoLevelEnabled:r,media:s}=i;if(!t||!s)return;const l=performance.now(),d=n?n.stats:t.stats,h=n?n.duration:t.duration,_=l-d.loading.start,S=i.minAutoLevel;if(d.aborted||d.loaded&&d.loaded===d.total||t.level<=S){this.clearTimer(),this._nextAutoLevel=-1;return}if(!r||s.paused||!s.playbackRate||!s.readyState)return;const U=i.mainForwardBufferInfo;if(U===null)return;const ee=this.bwEstimator.getEstimateTTFB(),X=Math.abs(s.playbackRate);if(_<=Math.max(ee,1e3*(h/(X*2))))return;const ae=U.len/X,ce=d.loading.first?d.loading.first-d.loading.start:-1,Re=d.loaded&&ce>-1,$e=this.getBwEstimate(),Ue=i.levels,rt=Ue[t.level],Ge=d.total||Math.max(d.loaded,Math.round(h*rt.averageBitrate/8));let xt=Re?_-ce:_;xt<1&&Re&&(xt=Math.min(_,d.loaded*8/$e));const it=Re?d.loaded*1e3/xt:0,kt=it?(Ge-d.loaded)/it:Ge*8/$e+ee/1e3;if(kt<=ae)return;const Yt=it?it*8:$e;let mt=Number.POSITIVE_INFINITY,Nt;for(Nt=t.level-1;Nt>S;Nt--){const tn=Ue[Nt].maxBitrate;if(mt=this.getTimeToLoadFrag(ee/1e3,Yt,h*tn,!Ue[Nt].details),mt<ae)break}if(mt>=kt||mt>h*10)return;i.nextLoadLevel=i.nextAutoLevel=Nt,Re?this.bwEstimator.sample(_-Math.min(ee,ce),d.loaded):this.bwEstimator.sampleTTFB(_);const Sn=Ue[Nt].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>Sn&&this.resetEstimator(Sn),this.clearTimer(),E.warn(`[abr] Fragment ${t.sn}${n?" part "+n.index:""} of level ${t.level} is loading too slowly;
|
|
Time to underbuffer: ${ae.toFixed(3)} s
|
|
Estimated load time for current fragment: ${kt.toFixed(3)} s
|
|
Estimated load time for down switch fragment: ${mt.toFixed(3)} s
|
|
TTFB estimate: ${ce|0} ms
|
|
Current BW estimate: ${K($e)?$e|0:"Unknown"} bps
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
Switching to level ${Nt} @ ${Sn|0} bps`),i.trigger(u.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:n,stats:d})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(E.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 hr(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.FRAG_LOADING,this.onFragLoading,this),e.on(u.FRAG_LOADED,this.onFragLoaded,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this),e.on(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(u.LEVEL_LOADED,this.onLevelLoaded,this),e.on(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(u.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(u.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.FRAG_LOADING,this.onFragLoading,this),e.off(u.FRAG_LOADED,this.onFragLoaded,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this),e.off(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(u.LEVEL_LOADED,this.onLevelLoaded,this),e.off(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(u.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(u.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var 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 m.BUFFER_ADD_CODEC_ERROR:case m.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case m.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(),l=r?r.stats:n.stats,d=s-l.loading.start,h=l.loading.first?l.loading.first-l.loading.start:-1;if(l.loaded&&h>-1){const S=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(d-Math.min(S,h),l.loaded)}else this.bwEstimator.sampleTTFB(d)}break}}}getTimeToLoadFrag(e,t,n,i){const r=e+n/t,s=i?this.lastLevelLoadSec:0;return r+s}onLevelLoaded(e,t){const n=this.hls.config,{loading:i}=t.stats,r=i.end-i.start;K(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)}onFragLoaded(e,{frag:t,part:n}){const i=n?n.stats:t.stats;if(t.type===$t.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],l=(s.loaded?s.loaded.bytes:0)+i.loaded,d=(s.loaded?s.loaded.duration:0)+r;s.loaded={bytes:l,duration:d},s.realBitrate=Math.round(8*l/d)}if(t.bitrateTest){const r={stats:i,frag:t,part:n,id:t.type};this.onFragBuffered(u.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!==$t.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,l=Math.min(Math.max(s,t),e);return E.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${l}`),l}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),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,{maxAutoLevel:i,config:r,minAutoLevel:s}=n,l=t?t.duration:e?e.duration:0,d=this.getBwEstimate(),h=this.getStarvationDelay();let _=r.abrBandWidthFactor,S=r.abrBandWidthUpFactor;if(h){const ce=this.findBestLevel(d,s,i,h,0,_,S);if(ce>=0)return ce}let U=l?Math.min(l,r.maxStarvationDelay):r.maxStarvationDelay;if(!h){const ce=this.bitrateTestDelay;ce&&(U=(l?Math.min(l,r.maxLoadingDelay):r.maxLoadingDelay)-ce,E.info(`[abr] bitrate test took ${Math.round(1e3*ce)}ms, set first fragment max fetchDuration to ${Math.round(1e3*U)} ms`),_=S=1)}const ee=this.findBestLevel(d,s,i,h,U,_,S);if(E.info(`[abr] ${h?"rebuffering expected":"buffer is empty"}, optimal quality level ${ee}`),ee>-1)return ee;const X=n.levels[s],ae=n.levels[n.loadLevel];return(X==null?void 0:X.bitrate)<(ae==null?void 0:ae.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,l){var d;const h=i+r,_=this.lastLoadedFragLevel,S=_===-1?this.hls.firstLevel:_,{fragCurrent:U,partCurrent:ee}=this,{levels:X,allAudioTracks:ae,loadLevel:ce,config:Re}=this.hls;if(X.length===1)return 0;const $e=X[S],Ue=!!($e!=null&&(d=$e.details)!=null&&d.live),rt=ce===-1||_===-1;let Ge,xt="SDR",it=($e==null?void 0:$e.frameRate)||0;const{audioPreference:kt,videoPreference:Yt}=Re,mt=this.audioTracksByGroup||(this.audioTracksByGroup=Mr(ae));if(rt){if(this.firstSelection!==-1)return this.firstSelection;const yn=this.codecTiers||(this.codecTiers=Fr(X,mt,t,n)),mn=Lr(yn,xt,e,kt,Yt),{codecSet:Nn,videoRanges:zn,minFramerate:un,minBitrate:nn,preferHDR:Bn}=mn;Ge=Nn,xt=Bn?zn[zn.length-1]:zn[0],it=un,e=Math.max(e,nn),E.log(`[abr] picked start tier ${JSON.stringify(mn)}`)}else Ge=$e==null?void 0:$e.codecSet,xt=$e==null?void 0:$e.videoRange;const Nt=ee?ee.duration:U?U.duration:0,Sn=this.bwEstimator.getEstimateTTFB()/1e3,tn=[];for(let yn=n;yn>=t;yn--){var bn;const mn=X[yn],Nn=yn>S;if(!mn)continue;if(Re.useMediaCapabilities&&!mn.supportedResult&&!mn.supportedPromise){const di=navigator.mediaCapabilities;typeof(di==null?void 0:di.decodingInfo)=="function"&&ts(mn,mt,xt,it,e,kt)?(mn.supportedPromise=ns(mn,mt,di),mn.supportedPromise.then(_i=>{if(!this.hls)return;mn.supportedResult=_i;const xi=this.hls.levels,Gi=xi.indexOf(mn);_i.error?E.warn(`[abr] MediaCapabilities decodingInfo error: "${_i.error}" for level ${Gi} ${JSON.stringify(_i)}`):_i.supported||(E.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${Gi} ${JSON.stringify(_i)}`),Gi>-1&&xi.length>1&&(E.log(`[abr] Removing unsupported level ${Gi}`),this.hls.removeLevel(Gi)))})):mn.supportedResult=ar}if(Ge&&mn.codecSet!==Ge||xt&&mn.videoRange!==xt||Nn&&it>mn.frameRate||!Nn&&it>0&&it<mn.frameRate||mn.supportedResult&&!((bn=mn.supportedResult.decodingInfoResults)!=null&&bn[0].smooth)){tn.push(yn);continue}const zn=mn.details,un=(ee?zn==null?void 0:zn.partTarget:zn==null?void 0:zn.averagetargetduration)||Nt;let nn;Nn?nn=l*e:nn=s*e;const Bn=Nt&&i>=Nt*2&&r===0?X[yn].averageBitrate:X[yn].maxBitrate,Rn=this.getTimeToLoadFrag(Sn,nn,Bn*un,zn===void 0);if(nn>=Bn&&(yn===_||mn.loadError===0&&mn.fragmentError===0)&&(Rn<=Sn||!K(Rn)||Ue&&!this.bitrateTestDelay||Rn<h)){const di=this.forcedAutoLevel;return yn!==ce&&(di===-1||di!==ce)&&(tn.length&&E.trace(`[abr] Skipped level(s) ${tn.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${X[tn[0]].codecs}" ${X[tn[0]].videoRange}; not compatible with "${$e.codecs}" ${xt}`),E.info(`[abr] switch candidate:${S}->${yn} adjustedbw(${Math.round(nn)})-bitrate=${Math.round(nn-Bn)} ttfb:${Sn.toFixed(1)} avgDuration:${un.toFixed(1)} maxFetchDuration:${h.toFixed(1)} fetchDuration:${Rn.toFixed(1)} firstSelection:${rt} codecSet:${Ge} videoRange:${xt} hls.loadLevel:${ce}`)),rt&&(this.firstSelection=yn),yn}}return-1}set nextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls,i=Math.min(Math.max(e,n),t);this._nextAutoLevel!==i&&(this.nextAutoLevelKey="",this._nextAutoLevel=i)}}class os{constructor(){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(){}}var oi={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class fr{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(u.BUFFER_APPENDED,this.onBufferAppended,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this),e.on(u.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.BUFFER_APPENDED,this.onBufferAppended,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this),e.off(u.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let i=n.length;i--;){const r=n[i];if(!r)break;const s=r.end;if(r.start<=e&&s!==null&&e<=s)return r}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:n}=this,i=Object.keys(n);for(let r=i.length;r--;){const s=n[i[r]];if((s==null?void 0:s.body.type)===t&&s.buffered){const l=s.body;if(l.start<=e&&e<=l.end)return l}}return null}detectEvictedFragments(e,t,n,i){this.timeRanges&&(this.timeRanges[e]=t);const r=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(s=>{const l=this.fragments[s];if(!l||r>=l.body.sn)return;if(!l.buffered&&!l.loaded){l.body.type===n&&this.removeFragment(l.body);return}const d=l.range[e];d&&d.time.some(h=>{const _=!this.isTimeBuffered(h.startPTS,h.endPTS,t);return _&&this.removeFragment(l.body),_})})}detectPartialFragments(e){const t=this.timeRanges,{frag:n,part:i}=e;if(!t||n.sn==="initSegment")return;const r=lr(n),s=this.fragments[r];if(!s||s.buffered&&n.gap)return;const l=!n.relurl;Object.keys(t).forEach(d=>{const h=n.elementaryStreams[d];if(!h)return;const _=t[d],S=l||h.partial===!0;s.range[d]=this.getBufferedTimes(n,i,S,_)}),s.loaded=null,Object.keys(s.range).length?(s.buffered=!0,(s.body.endList=n.endList||s.body.endList)&&(this.endListFragments[s.body.type]=s),or(s)||this.removeParts(n.sn-1,n.type)):this.removeFragment(s.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=n.filter(i=>i.fragment.sn>=e))}fragBuffered(e,t){const n=lr(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,i.buffered=!0)}getBufferedTimes(e,t,n,i){const r={time:[],partial:n},s=e.start,l=e.end,d=e.minEndPTS||l,h=e.maxStartPTS||s;for(let _=0;_<i.length;_++){const S=i.start(_)-this.bufferPadding,U=i.end(_)+this.bufferPadding;if(h>=S&&d<=U){r.time.push({startPTS:Math.max(s,i.start(_)),endPTS:Math.min(l,i.end(_))});break}else if(s<U&&l>S){const ee=Math.max(s,i.start(_)),X=Math.min(l,i.end(_));X>ee&&(r.partial=!0,r.time.push({startPTS:ee,endPTS:X}))}else if(l<=S)break}return r}getPartialFragment(e){let t=null,n,i,r,s=0;const{bufferPadding:l,fragments:d}=this;return Object.keys(d).forEach(h=>{const _=d[h];_&&or(_)&&(i=_.body.start-l,r=_.body.end+l,e>=i&&e<=r&&(n=Math.min(e-i,r-e),s<=n&&(t=_.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||or(t))}getState(e){const t=lr(e),n=this.fragments[t];return n?n.buffered?or(n)?oi.PARTIAL:oi.OK:oi.APPENDING:oi.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}onFragLoaded(e,t){const{frag:n,part:i}=t;if(n.sn==="initSegment"||n.bitrateTest)return;const r=i?null:t,s=lr(n);this.fragments[s]={body:n,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:i,timeRanges:r}=t;if(n.sn==="initSegment")return;const s=n.type;if(i){let l=this.activePartLists[s];l||(this.activePartLists[s]=l=[]),l.push(i)}this.timeRanges=r,Object.keys(r).forEach(l=>{const d=r[l];this.detectEvictedFragments(l,d,s,i)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=lr(e);return!!this.fragments[t]}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 l=this.fragments[s];if(!l)return;const d=l.body;d.type!==n||i&&!d.gap||d.start<t&&d.end>e&&(l.buffered||r)&&this.removeFragment(d)})}removeFragment(e){const t=lr(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const i=e.sn;this.activePartLists[e.type]=n.filter(r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function or(a){var e,t,n;return a.buffered&&(a.body.gap||((e=a.range.video)==null?void 0:e.partial)||((t=a.range.audio)==null?void 0:t.partial)||((n=a.range.audiovideo)==null?void 0:n.partial))}function lr(a){return`${a.type}_${a.level}_${a.sn}`}const ls={length:0,start:()=>0,end:()=>0};class Hn{static isBuffered(e,t){try{if(e){const n=Hn.getBuffered(e);for(let i=0;i<n.length;i++)if(t>=n.start(i)&&t<=n.end(i))return!0}}catch(n){}return!1}static bufferInfo(e,t,n){try{if(e){const i=Hn.getBuffered(e),r=[];let s;for(s=0;s<i.length;s++)r.push({start:i.start(s),end:i.end(s)});return this.bufferedInfo(r,t,n)}}catch(i){}return{len:0,start:t,end:t,nextStart:void 0}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.sort(function(h,_){const S=h.start-_.start;return S||_.end-h.end});let i=[];if(n)for(let h=0;h<e.length;h++){const _=i.length;if(_){const S=i[_-1].end;e[h].start-S<n?e[h].end>S&&(i[_-1].end=e[h].end):i.push(e[h])}else i.push(e[h])}else i=e;let r=0,s,l=t,d=t;for(let h=0;h<i.length;h++){const _=i[h].start,S=i[h].end;if(t+n>=_&&t<S)l=_,d=S,r=d-t;else if(t+n<_){s=_;break}}return{len:r,start:l||0,end:d||0,nextStart:s}}static getBuffered(e){try{return e.buffered}catch(t){return E.log("failed to get media.buffered",t),ls}}}class yr{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=nr(),this.buffering={audio:nr(),video:nr(),audiovideo:nr()},this.level=e,this.sn=t,this.id=n,this.size=i,this.part=r,this.partial=s}}function nr(){return{start:0,executeStart:0,executeEnd:0,end:0}}function Er(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 us(a,e,t){return!!(e&&(t.endCC>t.startCC||a&&a.cc<t.startCC))}function cs(a,e){const t=a.fragments,n=e.fragments;if(!n.length||!t.length){E.log("No fragments to align");return}const i=Er(t,n[0].cc);if(!i||i&&!i.startPTS){E.log("No frag in previous level to align on");return}return i}function Cr(a,e){if(a){const t=a.start+e;a.start=a.startPTS=t,a.endPTS=t+a.duration}}function Ur(a,e){const t=e.fragments;for(let n=0,i=t.length;n<i;n++)Cr(t[n],a);e.fragmentHint&&Cr(e.fragmentHint,a),e.alignedSliding=!0}function ds(a,e,t){e&&(hs(a,t,e),!t.alignedSliding&&e&&br(t,e),!t.alignedSliding&&e&&!t.skippedSegments&&Ni(e,t))}function hs(a,e,t){if(us(a,t,e)){const n=cs(t,e);n&&K(n.start)&&(E.log(`Adjusting PTS using last level due to CC increase within current level ${e.url}`),Ur(n.start,e))}}function br(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=Er(n,s),r=Er(t,s)),(!i||!r)&&(i=n[Math.floor(n.length/2)],r=Er(t,i.cc)||t[Math.floor(t.length/2)]);const l=i.programDateTime,d=r.programDateTime;if(!l||!d)return;const h=(d-l)/1e3-(r.start-i.start);Ur(h,a)}const $r=Math.pow(2,17);class ei{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 ii({type:g.NETWORK_ERROR,details:m.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((l,d)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(ee=>ee[0]==="GAP")){d(Zn(e));return}else e.gap=!1;const h=this.loader=e.loader=r?new r(i):new s(i),_=Fn(e),S=Ei(i.fragLoadPolicy.default),U={loadPolicy:S,timeout:S.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:$r};e.stats=h.stats,h.load(_,U,{onSuccess:(ee,X,ae,ce)=>{this.resetLoader(e,h);let Re=ee.data;ae.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(Re.slice(0,16)),Re=Re.slice(16)),l({frag:e,part:null,payload:Re,networkDetails:ce})},onError:(ee,X,ae,ce)=>{this.resetLoader(e,h),d(new ii({type:g.NETWORK_ERROR,details:m.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:oe({url:n,data:void 0},ee),error:new Error(`HTTP Error ${ee.code} ${ee.text}`),networkDetails:ae,stats:ce}))},onAbort:(ee,X,ae)=>{this.resetLoader(e,h),d(new ii({type:g.NETWORK_ERROR,details:m.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:ae,stats:ee}))},onTimeout:(ee,X,ae)=>{this.resetLoader(e,h),d(new ii({type:g.NETWORK_ERROR,details:m.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${U.timeout}ms`),networkDetails:ae,stats:ee}))},onProgress:(ee,X,ae,ce)=>{t&&t({frag:e,part:null,payload:ae,networkDetails:ce})}})})}loadPart(e,t,n){this.abort();const i=this.config,r=i.fLoader,s=i.loader;return new Promise((l,d)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){d(Zn(e,t));return}const h=this.loader=e.loader=r?new r(i):new s(i),_=Fn(e,t),S=Ei(i.fragLoadPolicy.default),U={loadPolicy:S,timeout:S.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:$r};t.stats=h.stats,h.load(_,U,{onSuccess:(ee,X,ae,ce)=>{this.resetLoader(e,h),this.updateStatsFromPart(e,t);const Re={frag:e,part:t,payload:ee.data,networkDetails:ce};n(Re),l(Re)},onError:(ee,X,ae,ce)=>{this.resetLoader(e,h),d(new ii({type:g.NETWORK_ERROR,details:m.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:oe({url:_.url,data:void 0},ee),error:new Error(`HTTP Error ${ee.code} ${ee.text}`),networkDetails:ae,stats:ce}))},onAbort:(ee,X,ae)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,h),d(new ii({type:g.NETWORK_ERROR,details:m.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:ae,stats:ee}))},onTimeout:(ee,X,ae)=>{this.resetLoader(e,h),d(new ii({type:g.NETWORK_ERROR,details:m.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${U.timeout}ms`),networkDetails:ae,stats:ee}))}})})}updateStatsFromPart(e,t){const n=e.stats,i=t.stats,r=i.total;if(n.loaded+=i.loaded,r){const d=Math.round(e.duration/t.duration),h=Math.min(Math.round(n.loaded/r),d),S=(d-h)*Math.round(n.loaded/h);n.total=n.loaded+S}else n.total=Math.max(n.loaded,n.total);const s=n.loading,l=i.loading;s.start?s.first+=l.first-l.start:(s.start=l.start,s.first=l.first),s.end=l.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Fn(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(K(i)&&K(r)){var s;let l=i,d=r;if(a.sn==="initSegment"&&((s=a.decryptdata)==null?void 0:s.method)==="AES-128"){const h=r-i;h%16&&(d=r+(16-h%16)),i!==0&&(n.resetIV=!0,l=i-16)}n.rangeStart=l,n.rangeEnd=d}return n}function Zn(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:g.MEDIA_ERROR,details:m.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new ii(n)}class ii extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Li{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class xr{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function Ir(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?J(a,0,e-t):a}class fs{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],l=n[3],d=this.invSubMix,h=d[0],_=d[1],S=d[2],U=d[3],ee=new Uint32Array(256);let X=0,ae=0,ce=0;for(ce=0;ce<256;ce++)ce<128?ee[ce]=ce<<1:ee[ce]=ce<<1^283;for(ce=0;ce<256;ce++){let Re=ae^ae<<1^ae<<2^ae<<3^ae<<4;Re=Re>>>8^Re&255^99,e[X]=Re,t[Re]=X;const $e=ee[X],Ue=ee[$e],rt=ee[Ue];let Ge=ee[Re]*257^Re*16843008;i[X]=Ge<<24|Ge>>>8,r[X]=Ge<<16|Ge>>>16,s[X]=Ge<<8|Ge>>>24,l[X]=Ge,Ge=rt*16843009^Ue*65537^$e*257^X*16843008,h[Re]=Ge<<24|Ge>>>8,_[Re]=Ge<<16|Ge>>>16,S[Re]=Ge<<8|Ge>>>24,U[Re]=Ge,X?(X=$e^ee[ee[ee[rt^$e]]],ae^=ee[ee[ae]]):X=ae=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 l,d;const h=this.keySchedule=new Uint32Array(s),_=this.invKeySchedule=new Uint32Array(s),S=this.sBox,U=this.rcon,ee=this.invSubMix,X=ee[0],ae=ee[1],ce=ee[2],Re=ee[3];let $e,Ue;for(l=0;l<s;l++){if(l<r){$e=h[l]=t[l];continue}Ue=$e,l%r===0?(Ue=Ue<<8|Ue>>>24,Ue=S[Ue>>>24]<<24|S[Ue>>>16&255]<<16|S[Ue>>>8&255]<<8|S[Ue&255],Ue^=U[l/r|0]<<24):r>6&&l%r===4&&(Ue=S[Ue>>>24]<<24|S[Ue>>>16&255]<<16|S[Ue>>>8&255]<<8|S[Ue&255]),h[l]=$e=(h[l-r]^Ue)>>>0}for(d=0;d<s;d++)l=s-d,d&3?Ue=h[l]:Ue=h[l-4],d<4||l<=4?_[d]=Ue:_[d]=X[S[Ue>>>24]]^ae[S[Ue>>>16&255]]^ce[S[Ue>>>8&255]]^Re[S[Ue&255]],_[d]=_[d]>>>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,l=this.invSubMix,d=l[0],h=l[1],_=l[2],S=l[3],U=this.uint8ArrayToUint32Array_(n);let ee=U[0],X=U[1],ae=U[2],ce=U[3];const Re=new Int32Array(e),$e=new Int32Array(Re.length);let Ue,rt,Ge,xt,it,kt,Yt,mt,Nt,Sn,tn,bn,yn,mn;const Nn=this.networkToHostOrderSwap;for(;t<Re.length;){for(Nt=Nn(Re[t]),Sn=Nn(Re[t+1]),tn=Nn(Re[t+2]),bn=Nn(Re[t+3]),it=Nt^r[0],kt=bn^r[1],Yt=tn^r[2],mt=Sn^r[3],yn=4,mn=1;mn<i;mn++)Ue=d[it>>>24]^h[kt>>16&255]^_[Yt>>8&255]^S[mt&255]^r[yn],rt=d[kt>>>24]^h[Yt>>16&255]^_[mt>>8&255]^S[it&255]^r[yn+1],Ge=d[Yt>>>24]^h[mt>>16&255]^_[it>>8&255]^S[kt&255]^r[yn+2],xt=d[mt>>>24]^h[it>>16&255]^_[kt>>8&255]^S[Yt&255]^r[yn+3],it=Ue,kt=rt,Yt=Ge,mt=xt,yn=yn+4;Ue=s[it>>>24]<<24^s[kt>>16&255]<<16^s[Yt>>8&255]<<8^s[mt&255]^r[yn],rt=s[kt>>>24]<<24^s[Yt>>16&255]<<16^s[mt>>8&255]<<8^s[it&255]^r[yn+1],Ge=s[Yt>>>24]<<24^s[mt>>16&255]<<16^s[it>>8&255]<<8^s[kt&255]^r[yn+2],xt=s[mt>>>24]<<24^s[it>>16&255]<<16^s[kt>>8&255]<<8^s[Yt&255]^r[yn+3],$e[t]=Nn(Ue^ee),$e[t+1]=Nn(xt^X),$e[t+2]=Nn(Ge^ae),$e[t+3]=Nn(rt^ce),ee=Nt,X=Sn,ae=tn,ce=bn,t=t+4}return $e.buffer}}const Kr=16;class Sr{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.useSoftware=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?Ir(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n){return this.useSoftware?new Promise((i,r)=>{this.softwareDecrypt(new Uint8Array(e),t,n);const s=this.flush();s?i(s.buffer):r(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n)}softwareDecrypt(e,t,n){const{currentIV:i,currentResult:r,remainderData:s}=this;this.logOnce("JS AES decrypt"),s&&(e=c(s,e),this.remainderData=null);const l=this.getValidChunk(e);if(!l.length)return null;i&&(n=i);let d=this.softwareDecrypter;d||(d=this.softwareDecrypter=new fs),d.expandKey(t);const h=r;return this.currentResult=d.decrypt(l.buffer,0,n),this.currentIV=J(l,-16).buffer,h||null}webCryptoDecrypt(e,t,n){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n));this.key=t,this.fastAesKey=new xr(this.subtle,t)}return this.fastAesKey.expandKey().then(i=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new Li(this.subtle,new Uint8Array(n)).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(E.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,n)))}onWebCryptoError(e,t,n){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%Kr;return n!==e.length&&(t=J(e,0,n),this.remainderData=J(e,n)),t}logOnce(e){this.logEnabled&&(E.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const pr={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}},gt={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class Dr extends os{constructor(e,t,n,i,r){super(),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=gt.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.loadedmetadata=!1,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.onvseeking=null,this.onvended=null,this.logPrefix="",this.log=void 0,this.warn=void 0,this.playlistType=r,this.logPrefix=i,this.log=E.log.bind(E,`${i}:`),this.warn=E.warn.bind(E,`${i}:`),this.hls=e,this.fragmentLoader=new ei(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Sr(e.config),e.on(u.MANIFEST_LOADED,this.onManifestLoaded,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){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=gt.STOPPED}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}_streamEnded(e,t){if(t.live||e.nextStart||!e.end||!this.media)return!1;const n=t.partList;if(n!=null&&n.length){const r=n[n.length-1];return Hn.isBuffered(this.media,r.start+r.duration/2)}const i=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(i)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levelLastLoaded)==null?void 0:e.details}}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),n.addEventListener("seeking",this.onvseeking),n.addEventListener("ended",this.onvended);const i=this.config;this.levels&&i.autoStartLoad&&this.state===gt.STOPPED&&this.startLoad(i.startPosition)}onMediaDetaching(){const e=this.media;e!=null&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}onMediaSeeking(){const{config:e,fragCurrent:t,media:n,mediaBuffer:i,state:r}=this,s=n?n.currentTime:0,l=Hn.bufferInfo(i||n,s,e.maxBufferHole);if(this.log(`media seeking to ${K(s)?s.toFixed(3):s}, state: ${r}`),this.state===gt.ENDED)this.resetLoadingState();else if(t){const d=e.maxFragLookUpTolerance,h=t.start-d,_=t.start+t.duration+d;if(!l.len||_<l.start||h>l.end){const S=s>_;(s<h||S)&&(S&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}n&&(this.fragmentTracker.removeFragmentsInRange(s,1/0,this.playlistType,!0),this.lastCurrentTime=s),!this.loadedmetadata&&!l.len&&(this.nextLoadPosition=this.startPosition=s),this.tickImmediate()}onMediaEnded(){this.startPosition=this.lastCurrentTime=0}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset,this.initPTS=[]}onHandlerDestroying(){this.hls.off(u.MANIFEST_LOADED,this.onManifestLoaded,this),this.stopLoad(),super.onHandlerDestroying(),this.hls=null}onHandlerDestroyed(){this.state=gt.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._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const i=r=>{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${r.part?" p: "+r.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(e,t,n,i).then(r=>{if(!r)return;const s=this.state;if(this.fragContextChanged(e)){(s===gt.FRAG_LOADING||!this.fragCurrent&&s===gt.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=gt.IDLE);return}"payload"in r&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(u.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===gt.STOPPED||this.state===gt.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)===oi.APPENDING){const r=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,r),l=Math.max(e.duration,s?s.len:this.config.maxBufferLength),d=this.backtrackFragment;((d?e.sn-d.sn:0)===1||this.reduceMaxBufferLength(l,e.duration))&&n.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===oi.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)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:n};this.hls.trigger(u.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{if(!n||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:i}=this,{payload:r}=n,s=e.decryptdata;if(r&&r.byteLength>0&&s!=null&&s.key&&s.iv&&s.method==="AES-128"){const l=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),s.key.buffer,s.iv.buffer).catch(d=>{throw i.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:m.FRAG_DECRYPT_ERROR,fatal:!1,error:d,reason:d.message,frag:e}),d}).then(d=>{const h=self.performance.now();return i.trigger(u.FRAG_DECRYPTED,{frag:e,payload:d,stats:{tstart:l,tdecrypt:h}}),n.payload=d,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===gt.STOPPED||this.state===gt.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=gt.IDLE,e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){var n,i,r,s;const l=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===$t.MAIN?"level":"track"} ${e.level} (frag:[${((n=e.startPTS)!=null?n:NaN).toFixed(3)}-${((i=e.endPTS)!=null?i:NaN).toFixed(3)}] > buffer:${l?pr.toString(Hn.getBuffered(l)):"(detached)"})`),e.sn!=="initSegment"){var d;if(e.type!==$t.SUBTITLE){const _=e.elementaryStreams;if(!Object.keys(_).some(S=>!!_[S])){this.state=gt.IDLE;return}}const h=(d=this.levels)==null?void 0:d[e.level];h!=null&&h.fragmentError&&(this.log(`Resetting level fragment error count of ${h.fragmentError} on frag buffered`),h.fragmentError=0)}this.state=gt.IDLE,l&&(!this.loadedmetadata&&e.type==$t.MAIN&&l.buffered.length&&((r=this.fragCurrent)==null?void 0:r.sn)===((s=this.fragPrevious)==null?void 0:s.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:i,partsLoaded:r}=e,s=!r||r.length===0||r.some(d=>!d),l=new yr(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!s);t.flush(l)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,i){var r;const s=t==null?void 0:t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let l=null;if(e.encrypted&&!((r=e.decryptdata)!=null&&r.key)?(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=gt.KEY_LOADING,this.fragCurrent=e,l=this.keyLoader.load(e).then(_=>{if(!this.fragContextChanged(_.frag))return this.hls.trigger(u.KEY_LOADED,_),this.state===gt.KEY_LOADING&&(this.state=gt.IDLE),_}),this.hls.trigger(u.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(l=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&s.encryptedFragments.length&&this.keyLoader.loadClear(e,s.encryptedFragments),n=Math.max(e.start,n||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const _=s.partList;if(_&&i){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const S=this.getNextPart(_,e,n);if(S>-1){const U=_[S];this.log(`Loading part sn: ${e.sn} p: ${U.index} cc: ${e.cc} of playlist [${s.startSN}-${s.endSN}] parts [0-${S}-${_.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=U.start+U.duration,this.state=gt.FRAG_LOADING;let ee;return l?ee=l.then(X=>!X||this.fragContextChanged(X.frag)?null:this.doFragPartsLoad(e,U,t,i)).catch(X=>this.handleFragLoadError(X)):ee=this.doFragPartsLoad(e,U,t,i).catch(X=>this.handleFragLoadError(X)),this.hls.trigger(u.FRAG_LOADING,{frag:e,part:U,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):ee}else if(!e.url||this.loadedEndOfParts(_,n))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${s?"of ["+s.startSN+"-"+s.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),K(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=gt.FRAG_LOADING;const d=this.config.progressive;let h;return d&&l?h=l.then(_=>!_||this.fragContextChanged(_==null?void 0:_.frag)?null:this.fragmentLoader.load(e,i)).catch(_=>this.handleFragLoadError(_)):h=Promise.all([this.fragmentLoader.load(e,d?i:void 0),l]).then(([_])=>(!d&&_&&i&&i(_),_)).catch(_=>this.handleFragLoadError(_)),this.hls.trigger(u.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):h}doFragPartsLoad(e,t,n,i){return new Promise((r,s)=>{var l;const d=[],h=(l=n.details)==null?void 0:l.partList,_=S=>{this.fragmentLoader.loadPart(e,S,i).then(U=>{d[S.index]=U;const ee=U.part;this.hls.trigger(u.FRAG_LOADED,U);const X=Di(n,e.sn,S.index+1)||Fi(h,e.sn,S.index+1);if(X)_(X);else return r({frag:e,part:ee,partsLoaded:d})}).catch(s)};_(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===m.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(u.ERROR,t)}else this.hls.trigger(u.ERROR,{type:g.OTHER_ERROR,details:m.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==gt.PARSING){!this.fragCurrent&&this.state!==gt.STOPPED&&this.state!==gt.ERROR&&(this.state=gt.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),this.updateLevelTiming(n,i,r,e.partial)}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 level ${i}. The current chunk will not be buffered.`),null;const l=t[i],d=s>-1?Di(l,r,s):null,h=d?d.fragment:Mi(l,r,n);return h?(n&&n!==h&&(h.stats=n.stats),{frag:h,part:d,level:l}):null}bufferFragmentData(e,t,n,i,r){var s;if(!e||this.state!==gt.PARSING)return;const{data1:l,data2:d}=e;let h=l;if(l&&d&&(h=c(l,d)),!((s=h)!=null&&s.length))return;const _={type:e.type,frag:t,part:n,chunkMeta:i,parent:t.type,data:h};if(this.hls.trigger(u.BUFFER_APPENDING,_),e.dropped&&e.independent&&!n){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!Hn.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,i=Hn.bufferInfo(t,n,0),r=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),l=Math.max(Math.min(e.start-s,i.end-s),n+s);e.start-l>s&&this.flushMainBuffer(l,e.start)}getFwdBufferInfo(e,t){const n=this.getLoadPosition();return K(n)?this.getFwdBufferInfoAtPos(e,n,t):null}getFwdBufferInfoAtPos(e,t,n){const{config:{maxBufferHole:i}}=this,r=Hn.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)return Hn.bufferInfo(e,t,Math.max(r.nextStart,i))}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=$t.MAIN){const n=this.fragmentTracker.getAppendedFrag(e,$t.MAIN);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;let l;if(t.live){const d=r.initialLiveManifestSize;if(i<d)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${d})`),null;(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<s)&&(l=this.getInitialLiveFragment(t,n),this.startPosition=this.nextLoadPosition=l?this.hls.liveSyncPosition||l.start:e)}else e<=s&&(l=n[0]);if(!l){const d=r.lowLatencyMode?t.partEnd:t.fragmentEnd;l=this.getFragmentAtPosition(e,d,t)}return this.mapToInitFragWhenRequired(l)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===oi.OK||n===oi.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,i,r){const s=e.gap,l=this.getNextFragment(this.nextLoadPosition,t);if(l===null)return l;if(e=l,s&&e&&!e.gap&&n.nextStart){const d=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i);if(d!==null&&n.len+d.len>=r)return this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,n){let i=-1,r=!1,s=!0;for(let l=0,d=e.length;l<d;l++){const h=e[l];if(s=s&&!h.independent,i>-1&&n<h.start)break;const _=h.loaded;_?i=-1:(r||h.independent||s)&&h.fragment===t&&(i=l),r=_}return i}loadedEndOfParts(e,t){const n=e[e.length-1];return n&&t>n.start&&n.loaded}getInitialLiveFragment(e,t){const 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=sr(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=sn(t,n.cc),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:l}=n;const{fragmentHint:d}=n,{maxFragLookUpTolerance:h}=i,_=n.partList,S=!!(i.lowLatencyMode&&_!=null&&_.length&&d);S&&d&&!this.bitrateTest&&(s=s.concat(d),l=d.sn);let U;if(e<t){const ee=e>t-h?0:h;U=Bi(r,s,e,ee)}else U=s[s.length-1];if(U){const ee=U.sn-n.startSN,X=this.fragmentTracker.getState(U);if((X===oi.OK||X===oi.PARTIAL&&U.gap)&&(r=U),r&&U.sn===r.sn&&(!S||_[0].fragment.sn>U.sn)&&r&&U.level===r.level){const ce=s[ee+1];U.sn<l&&this.fragmentTracker.getState(ce)!==oi.OK?U=ce:U=null}}return U}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const i=this.hls.liveSyncPosition,r=n.currentTime,s=e.fragments[0].start,l=e.edge,d=r>=s-t.maxFragLookUpTolerance&&r<=l;if(i!==null&&n.duration>i&&(r<i||!d)){const h=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!d&&n.readyState<4||r<l-h)&&(this.loadedmetadata||(this.nextLoadPosition=i),n.readyState&&(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${l}, reset currentTime to : ${i.toFixed(3)}`),n.currentTime=i))}}alignPlaylists(e,t,n){const i=e.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const r=e.fragments[0].start,s=!t,l=e.alignedSliding&&K(r);if(s||!l&&!r){const{fragPrevious:d}=this;ds(d,n,e);const h=e.fragments[0].start;return this.log(`Live playlist sliding: ${h.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} prev-sn: ${d?d.sn:"na"} fragments: ${i}`),h}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;if(n<t&&(n=-1),n===-1||this.lastCurrentTime===-1){const i=this.startTimeOffset!==null,r=i?this.startTimeOffset:e.startTimeOffset;r!==null&&K(r)?(n=t+r,r<0&&(n+=e.totalduration),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Start time offset ${r} found in ${i?"multivariant":"media"} playlist, adjust startPosition to ${n}`),this.startPosition=n):e.live?n=this.hls.liveSyncPosition||t:this.startPosition=n=0,this.lastCurrentTime=n}this.nextLoadPosition=n}getLoadPosition(){const{media:e}=this;let t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t}handleFragLoadAborted(e,t){this.transmuxer&&e.sn!=="initSegment"&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==gt.FRAG_LOADING_WAITING_RETRY)&&(this.state=gt.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const _=this.getCurrentContext(t.chunkMeta);_&&(t.frag=_.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){var i;this.warn(`Frag load error must match current frag to retry ${n.url} > ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const r=t.details===m.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(n,!0);const s=t.errorAction,{action:l,retryCount:d=0,retryConfig:h}=s||{};if(s&&l===en.RetryRequest&&h){this.resetStartWhenNotLoaded(this.levelLastLoaded);const _=mi(h,d);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${d+1}/${h.maxNumRetry} in ${_}ms`),s.resolved=!0,this.retryDate=self.performance.now()+_,this.state=gt.FRAG_LOADING_WAITING_RETRY}else if(h&&s)if(this.resetFragmentErrors(e),d<h.maxNumRetry)!r&&l!==en.RemoveAlternatePermanently&&(s.resolved=!0);else{E.warn(`${t.details} reached or exceeded max retry (${d})`);return}else(s==null?void 0:s.action)===en.SendAlternateToPenaltyBox?this.state=gt.WAITING_LEVEL:this.state=gt.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===gt.PARSING||this.state===gt.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 is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===$t.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==gt.STOPPED&&(this.state=gt.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const i=Hn.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,n),this.state===gt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=gt.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,i){var r;const s=n.details;if(!s){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((d,h)=>{const _=e.elementaryStreams[h];if(_){const S=_.endPTS-_.startPTS;if(S<=0)return this.warn(`Could not parse fragment ${e.sn} ${h} duration reliably (${S})`),d||!1;const U=i?0:Pi(s,e,_.startPTS,_.endPTS,_.startDTS,_.endDTS);return this.hls.trigger(u.LEVEL_PTS_UPDATED,{details:s,level:n,drift:U,type:h,frag:e,start:_.startPTS,end:_.endPTS}),!0}return d},!1)&&((r=this.transmuxer)==null?void 0:r.error)===null){const d=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(n.fragmentError===0&&(n.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(d.message),this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!1,error:d,frag:e,reason:`Found no media in msn ${e.sn} of level "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=gt.PARSED,this.hls.trigger(u.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}class Gs{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=Qa(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function Qa(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}function Ja(){return typeof __HLS_WORKER_BUNDLE__=="function"}function qa(){const a=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),e=self.URL.createObjectURL(a);return{worker:new self.Worker(e),objectURL:e}}function eo(a){const e=new self.URL(a,self.location.href).href;return{worker:new self.Worker(e),scriptURL:e}}function Qi(a="",e=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class ps{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=c(this.cachedData,e),this.cachedData=null);let n=M(e,0),i=n?n.length:0,r;const s=this._audioTrack,l=this._id3Track,d=n?N(n):void 0,h=e.length;for((this.basePTS===null||this.frameIndex===0&&K(d))&&(this.basePTS=to(d,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Gt.audioId3,duration:Number.POSITIVE_INFINITY});i<h;){if(this.canParse(e,i)){const _=this.appendFrame(s,e,i);_?(this.frameIndex++,this.lastPTS=_.sample.pts,i+=_.length,r=i):i=h}else k(e,i)?(n=M(e,i),l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Gt.audioId3,duration:Number.POSITIVE_INFINITY}),i+=n.length,r=i):i++;if(i===h&&r!==h){const _=J(e,r);this.cachedData?this.cachedData=c(this.cachedData,_):this.cachedData=_}}return{audioTrack:s,videoTrack:Qi(),id3Track:l,textTrack:Qi()}}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:Qi(),id3Track:this._id3Track,textTrack:Qi()}}destroy(){}}const to=(a,e,t)=>{if(K(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};function no(a,e,t,n){let i,r,s,l;const d=navigator.userAgent.toLowerCase(),h=n,_=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((e[t+2]&192)>>>6)+1;const S=(e[t+2]&60)>>>2;if(S>_.length-1){const U=new Error(`invalid ADTS sampling index:${S}`);a.emit(u.ERROR,u.ERROR,{type:g.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!0,error:U,reason:U.message});return}return s=(e[t+2]&1)<<2,s|=(e[t+3]&192)>>>6,E.log(`manifest codec:${n}, ADTS type:${i}, samplingIndex:${S}`),/firefox/i.test(d)?S>=6?(i=5,l=new Array(4),r=S-3):(i=2,l=new Array(2),r=S):d.indexOf("android")!==-1?(i=2,l=new Array(2),r=S):(i=5,l=new Array(4),n&&(n.indexOf("mp4a.40.29")!==-1||n.indexOf("mp4a.40.5")!==-1)||!n&&S>=6?r=S-3:((n&&n.indexOf("mp4a.40.2")!==-1&&(S>=6&&s===1||/vivaldi/i.test(d))||!n&&s===1)&&(i=2,l=new Array(2)),r=S)),l[0]=i<<3,l[0]|=(S&14)>>1,l[1]|=(S&1)<<7,l[1]|=s<<3,i===5&&(l[1]|=(r&14)>>1,l[2]=(r&1)<<7,l[2]|=8,l[3]=0),{config:l,samplerate:_[S],channelCount:s,codec:"mp4a.40."+i,manifestCodec:h}}function js(a,e){return a[e]===255&&(a[e+1]&246)===240}function Hs(a,e){return a[e+1]&1?7:9}function ms(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function io(a,e){return e+5<a.length}function Gr(a,e){return e+1<a.length&&js(a,e)}function ro(a,e){return io(a,e)&&js(a,e)&&ms(a,e)<=a.length-e}function so(a,e){if(Gr(a,e)){const t=Hs(a,e);if(e+t>=a.length)return!1;const n=ms(a,e);if(n<=t)return!1;const i=e+n;return i===a.length||Gr(a,i)}return!1}function zs(a,e,t,n,i){if(!a.samplerate){const r=no(e,t,n,i);if(!r)return;a.config=r.config,a.samplerate=r.samplerate,a.channelCount=r.channelCount,a.codec=r.codec,a.manifestCodec=r.manifestCodec,E.log(`parsed codec:${a.codec}, rate:${r.samplerate}, channels:${r.channelCount}`)}}function Vs(a){return 1024*9e4/a}function ao(a,e){const t=Hs(a,e);if(e+t<=a.length){const n=ms(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function Ws(a,e,t,n,i){const r=Vs(a.samplerate),s=n+i*r,l=ao(e,t);let d;if(l){const{frameLength:S,headerLength:U}=l,ee=U+S,X=Math.max(0,t+ee-e.length);X?(d=new Uint8Array(ee-U),d.set(e.subarray(t+U,e.length),0)):d=e.subarray(t+U,t+ee);const ae={unit:d,pts:s};return X||a.samples.push(ae),{sample:ae,length:ee,missing:X}}const h=e.length-t;return d=new Uint8Array(h),d.set(e.subarray(t,e.length),0),{sample:{unit:d,pts:s},length:h,missing:-1}}let jr=null;const oo=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],lo=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],uo=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],co=[0,1,1,4];function Zs(a,e,t,n,i){if(t+24>e.length)return;const r=Ys(e,t);if(r&&t+r.frameLength<=e.length){const s=r.samplesPerFrame*9e4/r.sampleRate,l=n+i*s,d={unit:e.subarray(t,t+r.frameLength),pts:l,dts:l};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(d),{sample:d,length:r.frameLength,missing:0}}}function Ys(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,l=a[e+3]>>6,d=t===3?3-n:n===3?3:4,h=oo[d*14+i-1]*1e3,S=lo[(t===3?0:t===2?1:2)*3+r],U=l===3?1:2,ee=uo[t][n],X=co[n],ae=ee*8*X,ce=Math.floor(ee*h/S+s)*X;if(jr===null){const Ue=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);jr=Ue?parseInt(Ue[1]):0}return!!jr&&jr<=87&&n===2&&h>=224e3&&l===0&&(a[e+3]=a[e+3]|128),{sampleRate:S,channelCount:U,frameLength:ce,samplesPerFrame:ae}}}function gs(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function Xs(a,e){return e+1<a.length&&gs(a,e)}function ho(a,e){return gs(a,e)&&4<=a.length-e}function Qs(a,e){if(e+1<a.length&&gs(a,e)){const n=Ys(a,e);let i=4;n!=null&&n.frameLength&&(i=n.frameLength);const r=e+i;return r===a.length||Xs(a,r)}return!1}class fo extends ps{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){if(!e)return!1;const t=M(e,0);let n=(t==null?void 0:t.length)||0;if(Qs(e,n))return!1;for(let i=e.length;n<i;n++)if(so(e,n))return E.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return ro(e,t)}appendFrame(e,t,n){zs(e,this.observer,t,n,e.manifestCodec);const i=Ws(e,t,n,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const po=/\/emsg[-/]ID3/i;class mo{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=Qi("video",1),s=this.audioTrack=Qi("audio",1),l=this.txtTrack=Qi("text",1);if(this.id3Track=Qi("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const d=ut(e);if(d.video){const{id:h,timescale:_,codec:S}=d.video;r.id=h,r.timescale=l.timescale=_,r.codec=S}if(d.audio){const{id:h,timescale:_,codec:S}=d.audio;s.id=h,s.timescale=_,s.codec=S}l.id=vt.text,r.sampleDuration=0,r.duration=s.duration=i}resetContiguity(){this.remainderData=null}static probe(e){return Ot(e)}demux(e,t){this.timeOffset=t;let n=e;const i=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=c(this.remainderData,e));const l=Xe(n);this.remainderData=l.remainder,i.samples=l.valid||new Uint8Array}else i.samples=n;const s=this.extractID3Track(i,t);return r.samples=p(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=p(e,t),{videoTrack:t,audioTrack:Qi(),id3Track:i,textTrack:Qi()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const i=ht(e.samples,["emsg"]);i&&i.forEach(r=>{const s=Ae(r);if(po.test(s.schemeIdUri)){const l=K(s.presentationTime)?s.presentationTime/s.timeScale:t+s.presentationTimeDelta/s.timeScale;let d=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;d<=.001&&(d=Number.POSITIVE_INFINITY);const h=s.payload;n.samples.push({data:h,len:h.byteLength,dts:l,pts:l,type:Gt.emsg,duration:d})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const Js=(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 l=Math.min(n,8),d=8-l;r[0]=4278190080>>>24+d<<d,i[0]=(s[0]&r[0])>>d,t=t?t<<l|i[0]:i[0],e+=1,n-=l}return t};class go extends ps{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=qs(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=M(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&N(t)!==void 0&&Js(e,n)<16}}function qs(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 l=[48e3,44100,32e3][r],d=e[t+4]&63,_=[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][d*3+r]*2;if(t+_>e.length)return-1;const S=e[t+6]>>5;let U=0;S===2?U+=2:(S&1&&S!==1&&(U+=2),S&4&&(U+=2));const ee=(e[t+6]<<8|e[t+7])>>12-U&1,ae=[2,1,2,3,3,4,4,5][S]+ee,ce=e[t+5]>>3,Re=e[t+5]&7,$e=new Uint8Array([r<<6|ce<<1|Re>>2,(Re&3)<<6|S<<3|ee<<2|d>>4,d<<4&224]),Ue=1536/l*9e4,rt=n+i*Ue,Ge=e.subarray(t,t+_);return a.config=$e,a.channelCount=ae,a.samplerate=l,a.samples.push({unit:Ge,pts:rt}),_}class _o{constructor(){this.VideoSample=null}createVideoSample(e,t,n,i){return{key:e,frame:!1,pts:t,dts:n,units:[],debug:i,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)}e.debug.length&&E.log(e.pts+"/"+e.dts+":"+e.debug)}}class ea{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&&E.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)}skipScalingList(e){let t=8,n=8,i;for(let r=0;r<e;r++)n!==0&&(i=this.readEG(),n=(t+i+256)%256),t=n===0?t:n}readSPS(){let e=0,t=0,n=0,i=0,r,s,l;const d=this.readUByte.bind(this),h=this.readBits.bind(this),_=this.readUEG.bind(this),S=this.readBoolean.bind(this),U=this.skipBits.bind(this),ee=this.skipEG.bind(this),X=this.skipUEG.bind(this),ae=this.skipScalingList.bind(this);d();const ce=d();if(h(5),U(3),d(),X(),ce===100||ce===110||ce===122||ce===244||ce===44||ce===83||ce===86||ce===118||ce===128){const xt=_();if(xt===3&&U(1),X(),X(),U(1),S())for(s=xt!==3?8:12,l=0;l<s;l++)S()&&(l<6?ae(16):ae(64))}X();const Re=_();if(Re===0)_();else if(Re===1)for(U(1),ee(),ee(),r=_(),l=0;l<r;l++)ee();X(),U(1);const $e=_(),Ue=_(),rt=h(1);rt===0&&U(1),U(1),S()&&(e=_(),t=_(),n=_(),i=_());let Ge=[1,1];if(S()&&S())switch(d()){case 1:Ge=[1,1];break;case 2:Ge=[12,11];break;case 3:Ge=[10,11];break;case 4:Ge=[16,11];break;case 5:Ge=[40,33];break;case 6:Ge=[24,11];break;case 7:Ge=[20,11];break;case 8:Ge=[32,11];break;case 9:Ge=[80,33];break;case 10:Ge=[18,11];break;case 11:Ge=[15,11];break;case 12:Ge=[64,33];break;case 13:Ge=[160,99];break;case 14:Ge=[4,3];break;case 15:Ge=[3,2];break;case 16:Ge=[2,1];break;case 255:{Ge=[d()<<8|d(),d()<<8|d()];break}}return{width:Math.ceil(($e+1)*16-e*2-t*2),height:(2-rt)*(Ue+1)*16-(rt?2:4)*(n+i),pixelRatio:Ge}}readSliceType(){return this.readUByte(),this.readUEG(),this.readUEG()}}class vo extends _o{parseAVCPES(e,t,n,i,r){const s=this.parseAVCNALu(e,n.data);let l=this.VideoSample,d,h=!1;n.data=null,l&&s.length&&!e.audFound&&(this.pushAccessUnit(l,e),l=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"")),s.forEach(_=>{var S;switch(_.type){case 1:{let ae=!1;d=!0;const ce=_.data;if(h&&ce.length>4){const Re=new ea(ce).readSliceType();(Re===2||Re===4||Re===7||Re===9)&&(ae=!0)}if(ae){var U;(U=l)!=null&&U.frame&&!l.key&&(this.pushAccessUnit(l,e),l=this.VideoSample=null)}l||(l=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),l.frame=!0,l.key=ae;break}case 5:d=!0,(S=l)!=null&&S.frame&&!l.key&&(this.pushAccessUnit(l,e),l=this.VideoSample=null),l||(l=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),l.key=!0,l.frame=!0;break;case 6:{d=!0,re(_.data,1,n.pts,t.samples);break}case 7:{var ee,X;d=!0,h=!0;const ae=_.data,Re=new ea(ae).readSPS();if(!e.sps||e.width!==Re.width||e.height!==Re.height||((ee=e.pixelRatio)==null?void 0:ee[0])!==Re.pixelRatio[0]||((X=e.pixelRatio)==null?void 0:X[1])!==Re.pixelRatio[1]){e.width=Re.width,e.height=Re.height,e.pixelRatio=Re.pixelRatio,e.sps=[ae],e.duration=r;const $e=ae.subarray(1,4);let Ue="avc1.";for(let rt=0;rt<3;rt++){let Ge=$e[rt].toString(16);Ge.length<2&&(Ge="0"+Ge),Ue+=Ge}e.codec=Ue}break}case 8:d=!0,e.pps=[_.data];break;case 9:d=!0,e.audFound=!0,l&&this.pushAccessUnit(l,e),l=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"");break;case 12:d=!0;break;default:d=!1,l&&(l.debug+="unknown NAL "+_.type+" ");break}l&&d&&l.units.push(_)}),i&&l&&(this.pushAccessUnit(l,e),this.VideoSample=null)}parseAVCNALu(e,t){const n=t.byteLength;let i=e.naluState||0;const r=i,s=[];let l=0,d,h,_,S=-1,U=0;for(i===-1&&(S=0,U=t[0]&31,i=0,l=1);l<n;){if(d=t[l++],!i){i=d?0:1;continue}if(i===1){i=d?0:2;continue}if(!d)i=3;else if(d===1){if(h=l-i-1,S>=0){const ee={data:t.subarray(S,h),type:U};s.push(ee)}else{const ee=this.getLastNalUnit(e.samples);ee&&(r&&l<=4-r&&ee.state&&(ee.data=ee.data.subarray(0,ee.data.byteLength-r)),h>0&&(ee.data=c(ee.data,t.subarray(0,h)),ee.state=0))}l<n?(_=t[l]&31,S=l,U=_,i=0):i=-1}else i=0}if(S>=0&&i>=0){const ee={data:t.subarray(S,n),type:U,state:i};s.push(ee)}if(s.length===0){const ee=this.getLastNalUnit(e.samples);ee&&(ee.data=c(ee.data,t))}return e.naluState=i,s}}class yo{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new Sr(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}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(l=>{const d=new Uint8Array(l);i.set(d,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let 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=ye(r.data),l=this.getAvcEncryptedData(s);this.decryptBuffer(l.buffer).then(d=>{r.data=this.getAvcDecryptedUnit(s,d),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,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}}}}const gi=188;class ur{constructor(e,t,n){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._duration=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.videoParser=new vo}static probe(e){const t=ur.syncOffset(e);return t>0&&E.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let n=Math.min(gi*5,t-gi)+1,i=0;for(;i<n;){let r=!1,s=-1,l=0;for(let d=i;d<t;d+=gi)if(e[d]===71&&(t-d===gi||e[d+gi]===71)){if(l++,s===-1&&(s=d,s!==0&&(n=Math.min(s+gi*99,e.length-gi)+1)),r||(r=_s(e,d)===0),r&&l>1&&(s===0&&l>2||d+gi>n))return s}else{if(l)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:vt[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=ur.createTrack("video"),this._audioTrack=ur.createTrack("audio",i),this._id3Track=ur.createTrack("id3"),this._txtTrack=ur.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n,this._duration=i}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,l=this._audioTrack,d=this._id3Track,h=this._txtTrack;let _=s.pid,S=s.pesData,U=l.pid,ee=d.pid,X=l.pesData,ae=d.pesData,ce=null,Re=this.pmtParsed,$e=this._pmtId,Ue=e.length;if(this.remainderData&&(e=c(this.remainderData,e),Ue=e.length,this.remainderData=null),Ue<gi&&!i)return this.remainderData=e,{audioTrack:l,videoTrack:s,id3Track:d,textTrack:h};const rt=Math.max(0,ur.syncOffset(e));Ue-=(Ue-rt)%gi,Ue<e.byteLength&&!i&&(this.remainderData=new Uint8Array(e.buffer,Ue,e.buffer.byteLength-Ue));let Ge=0;for(let it=rt;it<Ue;it+=gi)if(e[it]===71){const kt=!!(e[it+1]&64),Yt=_s(e,it),mt=(e[it+3]&48)>>4;let Nt;if(mt>1){if(Nt=it+5+e[it+4],Nt===it+gi)continue}else Nt=it+4;switch(Yt){case _:kt&&(S&&(r=wr(S))&&this.videoParser.parseAVCPES(s,h,r,!1,this._duration),S={data:[],size:0}),S&&(S.data.push(e.subarray(Nt,it+gi)),S.size+=it+gi-Nt);break;case U:if(kt){if(X&&(r=wr(X)))switch(l.segmentCodec){case"aac":this.parseAACPES(l,r);break;case"mp3":this.parseMPEGPES(l,r);break;case"ac3":this.parseAC3PES(l,r);break}X={data:[],size:0}}X&&(X.data.push(e.subarray(Nt,it+gi)),X.size+=it+gi-Nt);break;case ee:kt&&(ae&&(r=wr(ae))&&this.parseID3PES(d,r),ae={data:[],size:0}),ae&&(ae.data.push(e.subarray(Nt,it+gi)),ae.size+=it+gi-Nt);break;case 0:kt&&(Nt+=e[Nt]+1),$e=this._pmtId=Eo(e,Nt);break;case $e:{kt&&(Nt+=e[Nt]+1);const Sn=bo(e,Nt,this.typeSupported,n,this.observer);_=Sn.videoPid,_>0&&(s.pid=_,s.segmentCodec=Sn.segmentVideoCodec),U=Sn.audioPid,U>0&&(l.pid=U,l.segmentCodec=Sn.segmentAudioCodec),ee=Sn.id3Pid,ee>0&&(d.pid=ee),ce!==null&&!Re&&(E.warn(`MPEG-TS PMT found at ${it} after unknown PID '${ce}'. Backtracking to sync byte @${rt} to parse all TS packets.`),ce=null,it=rt-188),Re=this.pmtParsed=!0;break}case 17:case 8191:break;default:ce=Yt;break}}else Ge++;Ge>0&&Hr(this.observer,new Error(`Found ${Ge} TS packet/s that do not start with 0x47`)),s.pesData=S,l.pesData=X,d.pesData=ae;const xt={audioTrack:l,videoTrack:s,id3Track:d,textTrack:h};return i&&this.extractRemainingSamples(xt),xt}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,l=t.pesData,d=i.pesData;let h;if(s&&(h=wr(s))?(this.videoParser.parseAVCPES(n,r,h,!0,this._duration),n.pesData=null):n.pesData=s,l&&(h=wr(l))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,h);break;case"mp3":this.parseMPEGPES(t,h);break;case"ac3":this.parseAC3PES(t,h);break}t.pesData=null}else l!=null&&l.size&&E.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=l;d&&(h=wr(d))?(this.parseID3PES(i,h),i.pesData=null):i.pesData=d}demuxSampleAes(e,t,n){const i=this.demux(e,n,!0,!this.config.progressive),r=this.sampleAes=new yo(this.observer,this.config,t);return this.decrypt(i,r)}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._duration=0}parseAACPES(e,t){let n=0;const i=this.aacOverFlow;let r=t.data;if(i){this.aacOverFlow=null;const S=i.missing,U=i.sample.unit.byteLength;if(S===-1)r=c(i.sample.unit,r);else{const ee=U-S;i.sample.unit.set(r.subarray(0,S),ee),e.samples.push(i.sample),n=i.missing}}let s,l;for(s=n,l=r.length;s<l-1&&!Gr(r,s);s++);if(s!==n){let S;const U=s<l-1;if(U?S=`AAC PES did not start with ADTS header,offset:${s}`:S="No ADTS header found in AAC PES",Hr(this.observer,new Error(S),U),!U)return}zs(e,this.observer,r,s,this.audioCodec);let d;if(t.pts!==void 0)d=t.pts;else if(i){const S=Vs(e.samplerate);d=i.sample.pts+S}else{E.warn("[tsdemuxer]: AAC PES unknown PTS");return}let h=0,_;for(;s<l;)if(_=Ws(e,r,s,d,h),s+=_.length,_.missing){this.aacOverFlow=_;break}else for(h++;s<l-1&&!Gr(r,s);s++);}parseMPEGPES(e,t){const n=t.data,i=n.length;let r=0,s=0;const l=t.pts;if(l===void 0){E.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;s<i;)if(Xs(n,s)){const d=Zs(e,n,s,l,r);if(d)s+=d.length,r++;else break}else s++}parseAC3PES(e,t){{const n=t.data,i=t.pts;if(i===void 0){E.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const r=n.length;let s=0,l=0,d;for(;l<r&&(d=qs(e,n,l,i,s++))>0;)l+=d}}parseID3PES(e,t){if(t.pts===void 0){E.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=o({},t,{type:this._videoTrack?Gt.emsg:Gt.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function _s(a,e){return((a[e+1]&31)<<8)+a[e+2]}function Eo(a,e){return(a[e+10]&31)<<8|a[e+11]}function bo(a,e,t,n,i){const r={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},s=(a[e+1]&15)<<8|a[e+2],l=e+3+s-4,d=(a[e+10]&15)<<8|a[e+11];for(e+=12+d;e<l;){const h=_s(a,e),_=(a[e+3]&15)<<8|a[e+4];switch(a[e]){case 207:if(!n){vs("ADTS AAC");break}case 15:r.audioPid===-1&&(r.audioPid=h);break;case 21:r.id3Pid===-1&&(r.id3Pid=h);break;case 219:if(!n){vs("H.264");break}case 27:r.videoPid===-1&&(r.videoPid=h,r.segmentVideoCodec="avc");break;case 3:case 4:!t.mpeg&&!t.mp3?E.log("MPEG audio found, not supported in this browser"):r.audioPid===-1&&(r.audioPid=h,r.segmentAudioCodec="mp3");break;case 193:if(!n){vs("AC-3");break}case 129:t.ac3?r.audioPid===-1&&(r.audioPid=h,r.segmentAudioCodec="ac3"):E.log("AC-3 audio found, not supported in this browser");break;case 6:if(r.audioPid===-1&&_>0){let S=e+5,U=_;for(;U>2;){switch(a[S]){case 106:t.ac3!==!0?E.log("AC-3 audio found, not supported in this browser for now"):(r.audioPid=h,r.segmentAudioCodec="ac3");break}const X=a[S+1]+2;S+=X,U-=X}}break;case 194:case 135:return Hr(i,new Error("Unsupported EC-3 in M2TS found")),r;case 36:return Hr(i,new Error("Unsupported HEVC in M2TS found")),r}e+=_+5}return r}function Hr(a,e,t){E.warn(`parsing error: ${e.message}`),a.emit(u.ERROR,u.ERROR,{type:g.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function vs(a){E.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function wr(a){let e=0,t,n,i,r,s;const l=a.data;if(!a||a.size===0)return null;for(;l[0].length<19&&l.length>1;)l[0]=c(l[0],l[1]),l.splice(1,1);if(t=l[0],(t[0]<<16)+(t[1]<<8)+t[2]===1){if(n=(t[4]<<8)+t[5],n&&n>a.size-6)return null;const h=t[7];h&192&&(r=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2,h&64?(s=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,r-s>60*9e4&&(E.warn(`${Math.round((r-s)/9e4)}s delta between PTS and DTS, align them`),r=s)):s=r),i=t[8];let _=i+9;if(a.size<=_)return null;a.size-=_;const S=new Uint8Array(a.size);for(let U=0,ee=l.length;U<ee;U++){t=l[U];let X=t.byteLength;if(_)if(_>X){_-=X;continue}else t=t.subarray(_),X-=_,_=0;S.set(t,e),e+=X}return n&&(n-=i+3),{data:S,pts:r,dts:s,len:n}}return null}class xo extends ps{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=M(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&N(t)!==void 0&&Js(e,n)<=16)return!1;for(let i=e.length;n<i;n++)if(Qs(e,n))return E.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return ho(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Zs(e,t,n,this.basePTS,this.frameIndex)}}class ta{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 cr=Math.pow(2,32)-1;class Ve{static init(){Ve.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let e;for(e in Ve.types)Ve.types.hasOwnProperty(e)&&(Ve.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),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]);Ve.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]);Ve.STTS=Ve.STSC=Ve.STCO=r,Ve.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ve.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Ve.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Ve.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),d=new Uint8Array([0,0,0,1]);Ve.FTYP=Ve.box(Ve.types.ftyp,s,d,s,l),Ve.DINF=Ve.box(Ve.types.dinf,Ve.box(Ve.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 Ve.box(Ve.types.hdlr,Ve.HDLR_TYPES[e])}static mdat(e){return Ve.box(Ve.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(cr+1)),i=Math.floor(t%(cr+1));return Ve.box(Ve.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,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 Ve.box(Ve.types.mdia,Ve.mdhd(e.timescale,e.duration),Ve.hdlr(e.type),Ve.minf(e))}static mfhd(e){return Ve.box(Ve.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?Ve.box(Ve.types.minf,Ve.box(Ve.types.smhd,Ve.SMHD),Ve.DINF,Ve.stbl(e)):Ve.box(Ve.types.minf,Ve.box(Ve.types.vmhd,Ve.VMHD),Ve.DINF,Ve.stbl(e))}static moof(e,t,n){return Ve.box(Ve.types.moof,Ve.mfhd(e),Ve.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=Ve.trak(e[t]);return Ve.box.apply(null,[Ve.types.moov,Ve.mvhd(e[0].timescale,e[0].duration)].concat(n).concat(Ve.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=Ve.trex(e[t]);return Ve.box.apply(null,[Ve.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(cr+1)),i=Math.floor(t%(cr+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 Ve.box(Ve.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 Ve.box(Ve.types.sdtp,n)}static stbl(e){return Ve.box(Ve.types.stbl,Ve.stsd(e),Ve.box(Ve.types.stts,Ve.STTS),Ve.box(Ve.types.stsc,Ve.STSC),Ve.box(Ve.types.stsz,Ve.STSZ),Ve.box(Ve.types.stco,Ve.STCO))}static avc1(e){let t=[],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 l=Ve.box(Ve.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),d=e.width,h=e.height,_=e.pixelRatio[0],S=e.pixelRatio[1];return Ve.box(Ve.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,d>>8&255,d&255,h>>8&255,h&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l,Ve.box(Ve.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Ve.box(Ve.types.pasp,new Uint8Array([_>>24,_>>16&255,_>>8&255,_&255,S>>24,S>>16&255,S>>8&255,S&255])))}static esds(e){const t=e.config.length;return 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(e.config).concat([6,1,2]))}static audioStsd(e){const t=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return Ve.box(Ve.types.mp4a,Ve.audioStsd(e),Ve.box(Ve.types.esds,Ve.esds(e)))}static mp3(e){return Ve.box(Ve.types[".mp3"],Ve.audioStsd(e))}static ac3(e){return Ve.box(Ve.types["ac-3"],Ve.audioStsd(e),Ve.box(Ve.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?Ve.box(Ve.types.stsd,Ve.STSD,Ve.mp3(e)):e.segmentCodec==="ac3"?Ve.box(Ve.types.stsd,Ve.STSD,Ve.ac3(e)):Ve.box(Ve.types.stsd,Ve.STSD,Ve.mp4a(e)):Ve.box(Ve.types.stsd,Ve.STSD,Ve.avc1(e))}static tkhd(e){const t=e.id,n=e.duration*e.timescale,i=e.width,r=e.height,s=Math.floor(n/(cr+1)),l=Math.floor(n%(cr+1));return Ve.box(Ve.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,l>>24,l>>16&255,l>>8&255,l&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(e,t){const n=Ve.sdtp(e),i=e.id,r=Math.floor(t/(cr+1)),s=Math.floor(t%(cr+1));return Ve.box(Ve.types.traf,Ve.box(Ve.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),Ve.box(Ve.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,s>>24,s>>16&255,s>>8&255,s&255])),Ve.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,Ve.box(Ve.types.trak,Ve.tkhd(e),Ve.mdia(e))}static trex(e){const t=e.id;return Ve.box(Ve.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],i=n.length,r=12+16*i,s=new Uint8Array(r);let l,d,h,_,S,U;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),l=0;l<i;l++)d=n[l],h=d.duration,_=d.size,S=d.flags,U=d.cts,s.set([h>>>24&255,h>>>16&255,h>>>8&255,h&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255,S.isLeading<<2|S.dependsOn,S.isDependedOn<<6|S.hasRedundancy<<4|S.paddingValue<<1|S.isNonSync,S.degradPrio&61440,S.degradPrio&15,U>>>24&255,U>>>16&255,U>>>8&255,U&255],12+16*l);return Ve.box(Ve.types.trun,s)}static initSegment(e){Ve.types||Ve.init();const t=Ve.moov(e);return c(Ve.FTYP,t)}}Ve.types=void 0,Ve.HDLR_TYPES=void 0,Ve.STTS=void 0,Ve.STSC=void 0,Ve.STCO=void 0,Ve.STSZ=void 0,Ve.VMHD=void 0,Ve.SMHD=void 0,Ve.STSD=void 0,Ve.FTYP=void 0,Ve.DINF=void 0;const na=9e4;function ys(a,e,t=1,n=!1){const i=a*e*t;return n?Math.round(i):i}function So(a,e,t=1,n=!1){return ys(a,e,1/t,n)}function Or(a,e=!1){return ys(a,1e3,1/na,e)}function wo(a,e=1){return ys(a,na,1/e)}const To=10*1e3,ia=1024,Ro=1152,Ao=1536;let Tr=null,Es=null;class zr{constructor(e,t,n,i=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,Tr===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Tr=s?parseInt(s[1]):0}if(Es===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);Es=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){E.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){E.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){E.log("[mp4-remuxer]: 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 l=s.pts,d=l-r;return d<-4294967296&&(t=!0,l=$i(l,n),d=l-r),d>0?r:l},n);return t&&E.debug("PTS rollover detected"),i}remux(e,t,n,i,r,s,l,d){let h,_,S,U,ee,X,ae=r,ce=r;const Re=e.pid>-1,$e=t.pid>-1,Ue=t.samples.length,rt=e.samples.length>0,Ge=l&&Ue>0||Ue>1;if((!Re||rt)&&(!$e||Ge)||this.ISGenerated||l){if(this.ISGenerated){var it,kt,Yt,mt;const bn=this.videoTrackConfig;bn&&(t.width!==bn.width||t.height!==bn.height||((it=t.pixelRatio)==null?void 0:it[0])!==((kt=bn.pixelRatio)==null?void 0:kt[0])||((Yt=t.pixelRatio)==null?void 0:Yt[1])!==((mt=bn.pixelRatio)==null?void 0:mt[1]))&&this.resetInitSegment()}else S=this.generateIS(e,t,r,s);const Nt=this.isVideoContiguous;let Sn=-1,tn;if(Ge&&(Sn=Lo(t.samples),!Nt&&this.config.forceKeyFrameOnDiscontinuity))if(X=!0,Sn>0){E.warn(`[mp4-remuxer]: Dropped ${Sn} out of ${Ue} video samples due to a missing keyframe`);const bn=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(Sn),t.dropped+=Sn,ce+=(t.samples[0].pts-bn)/t.inputTimeScale,tn=ce}else Sn===-1&&(E.warn(`[mp4-remuxer]: No keyframe found out of ${Ue} video samples`),X=!1);if(this.ISGenerated){if(rt&&Ge){const bn=this.getVideoStartPts(t.samples),mn=($i(e.samples[0].pts,bn)-bn)/t.inputTimeScale;ae+=Math.max(0,mn),ce+=Math.max(0,-mn)}if(rt){if(e.samplerate||(E.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),S=this.generateIS(e,t,r,s)),_=this.remuxAudio(e,ae,this.isAudioContiguous,s,$e||Ge||d===$t.AUDIO?ce:void 0),Ge){const bn=_?_.endPTS-_.startPTS:0;t.inputTimeScale||(E.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),S=this.generateIS(e,t,r,s)),h=this.remuxVideo(t,ce,Nt,bn)}}else Ge&&(h=this.remuxVideo(t,ce,Nt,0));h&&(h.firstKeyFrame=Sn,h.independent=Sn!==-1,h.firstKeyFramePTS=tn)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(ee=ra(n,r,this._initPTS,this._initDTS)),i.samples.length&&(U=sa(i,r,this._initPTS))),{audio:_,video:h,initSegment:S,independent:X,text:U,id3:ee}}generateIS(e,t,n,i){const r=e.samples,s=t.samples,l=this.typeSupported,d={},h=this._initPTS;let _=!h||i,S="audio/mp4",U,ee,X;if(_&&(U=ee=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":l.mpeg?(S="audio/mpeg",e.codec=""):l.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}d.audio={id:"audio",container:S,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&l.mpeg?new Uint8Array(0):Ve.initSegment([e]),metadata:{channelCount:e.channelCount}},_&&(X=e.inputTimeScale,!h||X!==h.timescale?U=ee=r[0].pts-Math.round(X*n):_=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,d.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Ve.initSegment([t]),metadata:{width:t.width,height:t.height}},_)if(X=t.inputTimeScale,!h||X!==h.timescale){const ae=this.getVideoStartPts(s),ce=Math.round(X*n);ee=Math.min(ee,$i(s[0].dts,ae)-ce),U=Math.min(U,ae-ce)}else _=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(d).length)return this.ISGenerated=!0,_?(this._initPTS={baseTime:U,timescale:X},this._initDTS={baseTime:ee,timescale:X}):U=X=void 0,{tracks:d,initPTS:U,timescale:X}}remuxVideo(e,t,n,i){const r=e.inputTimeScale,s=e.samples,l=[],d=s.length,h=this._initPTS;let _=this.nextAvcDts,S=8,U=this.videoSampleDuration,ee,X,ae=Number.POSITIVE_INFINITY,ce=Number.NEGATIVE_INFINITY,Re=!1;if(!n||_===null){const un=t*r,nn=s[0].pts-$i(s[0].dts,s[0].pts);Tr&&_!==null&&Math.abs(un-nn-_)<15e3?n=!0:_=un-nn}const $e=h.baseTime*r/h.timescale;for(let un=0;un<d;un++){const nn=s[un];nn.pts=$i(nn.pts-$e,_),nn.dts=$i(nn.dts-$e,_),nn.dts<s[un>0?un-1:un].dts&&(Re=!0)}Re&&s.sort(function(un,nn){const Bn=un.dts-nn.dts,Rn=un.pts-nn.pts;return Bn||Rn}),ee=s[0].dts,X=s[s.length-1].dts;const Ue=X-ee,rt=Ue?Math.round(Ue/(d-1)):U||e.inputTimeScale/30;if(n){const un=ee-_,nn=un>rt,Bn=un<-1;if((nn||Bn)&&(nn?E.warn(`AVC: ${Or(un,!0)} ms (${un}dts) hole between fragments detected at ${t.toFixed(3)}`):E.warn(`AVC: ${Or(-un,!0)} ms (${un}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!Bn||_>=s[0].pts||Tr)){ee=_;const Rn=s[0].pts-un;if(nn)s[0].dts=ee,s[0].pts=Rn;else for(let Gn=0;Gn<s.length&&!(s[Gn].dts>Rn);Gn++)s[Gn].dts-=un,s[Gn].pts-=un;E.log(`Video: Initial PTS/DTS adjusted: ${Or(Rn,!0)}/${Or(ee,!0)}, delta: ${Or(un,!0)} ms`)}}ee=Math.max(0,ee);let Ge=0,xt=0,it=ee;for(let un=0;un<d;un++){const nn=s[un],Bn=nn.units,Rn=Bn.length;let Gn=0;for(let di=0;di<Rn;di++)Gn+=Bn[di].data.length;xt+=Gn,Ge+=Rn,nn.length=Gn,nn.dts<it?(nn.dts=it,it+=rt/4|0||1):it=nn.dts,ae=Math.min(nn.pts,ae),ce=Math.max(nn.pts,ce)}X=s[d-1].dts;const kt=xt+4*Ge+8;let Yt;try{Yt=new Uint8Array(kt)}catch(un){this.observer.emit(u.ERROR,u.ERROR,{type:g.MUX_ERROR,details:m.REMUX_ALLOC_ERROR,fatal:!1,error:un,bytes:kt,reason:`fail allocating video mdat ${kt}`});return}const mt=new DataView(Yt.buffer);mt.setUint32(0,kt),Yt.set(Ve.types.mdat,4);let Nt=!1,Sn=Number.POSITIVE_INFINITY,tn=Number.POSITIVE_INFINITY,bn=Number.NEGATIVE_INFINITY,yn=Number.NEGATIVE_INFINITY;for(let un=0;un<d;un++){const nn=s[un],Bn=nn.units;let Rn=0;for(let _i=0,xi=Bn.length;_i<xi;_i++){const Gi=Bn[_i],Pr=Gi.data,Ks=Gi.data.byteLength;mt.setUint32(S,Ks),S+=4,Yt.set(Pr,S),S+=Ks,Rn+=4+Ks}let Gn;if(un<d-1)U=s[un+1].dts-nn.dts,Gn=s[un+1].pts-nn.pts;else{const _i=this.config,xi=un>0?nn.dts-s[un-1].dts:rt;if(Gn=un>0?nn.pts-s[un-1].pts:rt,_i.stretchShortVideoTrack&&this.nextAudioPts!==null){const Gi=Math.floor(_i.maxBufferHole*r),Pr=(i?ae+i*r:this.nextAudioPts)-nn.pts;Pr>Gi?(U=Pr-xi,U<0?U=xi:Nt=!0,E.log(`[mp4-remuxer]: It is approximately ${Pr/90} ms to the next segment; using duration ${U/90} ms for the last video frame.`)):U=xi}else U=xi}const di=Math.round(nn.pts-nn.dts);Sn=Math.min(Sn,U),bn=Math.max(bn,U),tn=Math.min(tn,Gn),yn=Math.max(yn,Gn),l.push(new aa(nn.key,U,Rn,di))}if(l.length){if(Tr){if(Tr<70){const un=l[0].flags;un.dependsOn=2,un.isNonSync=0}}else if(Es&&yn-tn<bn-Sn&&rt/bn<.025&&l[0].cts===0){E.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let un=ee;for(let nn=0,Bn=l.length;nn<Bn;nn++){const Rn=un+l[nn].duration,Gn=un+l[nn].cts;if(nn<Bn-1){const di=Rn+l[nn+1].cts;l[nn].duration=di-Gn}else l[nn].duration=nn?l[nn-1].duration:rt;l[nn].cts=0,un=Rn}}}U=Nt||!U?rt:U,this.nextAvcDts=_=X+U,this.videoSampleDuration=U,this.isVideoContiguous=!0;const zn={data1:Ve.moof(e.sequenceNumber++,ee,o({},e,{samples:l})),data2:Yt,startPTS:ae/r,endPTS:(ce+U)/r,startDTS:ee/r,endDTS:_/r,type:"video",hasAudio:!1,hasVideo:!0,nb:l.length,dropped:e.dropped};return e.samples=[],e.dropped=0,zn}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return Ro;case"ac3":return Ao;default:return ia}}remuxAudio(e,t,n,i,r){const s=e.inputTimeScale,l=e.samplerate?e.samplerate:s,d=s/l,h=this.getSamplesPerFrame(e),_=h*d,S=this._initPTS,U=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,ee=[],X=r!==void 0;let ae=e.samples,ce=U?0:8,Re=this.nextAudioPts||-1;const $e=t*s,Ue=S.baseTime*s/S.timescale;if(this.isAudioContiguous=n=n||ae.length&&Re>0&&(i&&Math.abs($e-Re)<9e3||Math.abs($i(ae[0].pts-Ue,$e)-Re)<20*_),ae.forEach(function(mn){mn.pts=$i(mn.pts-Ue,$e)}),!n||Re<0){if(ae=ae.filter(mn=>mn.pts>=0),!ae.length)return;r===0?Re=0:i&&!X?Re=Math.max(0,$e):Re=ae[0].pts}if(e.segmentCodec==="aac"){const mn=this.config.maxAudioFramesDrift;for(let Nn=0,zn=Re;Nn<ae.length;Nn++){const un=ae[Nn],nn=un.pts,Bn=nn-zn,Rn=Math.abs(1e3*Bn/s);if(Bn<=-mn*_&&X)Nn===0&&(E.warn(`Audio frame @ ${(nn/s).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*Bn/s)} ms.`),this.nextAudioPts=Re=zn=nn);else if(Bn>=mn*_&&Rn<To&&X){let Gn=Math.round(Bn/_);zn=nn-Gn*_,zn<0&&(Gn--,zn+=_),Nn===0&&(this.nextAudioPts=Re=zn),E.warn(`[mp4-remuxer]: Injecting ${Gn} audio frame @ ${(zn/s).toFixed(3)}s due to ${Math.round(1e3*Bn/s)} ms gap.`);for(let di=0;di<Gn;di++){const _i=Math.max(zn,0);let xi=ta.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);xi||(E.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),xi=un.unit.subarray()),ae.splice(Nn,0,{unit:xi,pts:_i}),zn+=_,Nn++}}un.pts=zn,zn+=_}}let rt=null,Ge=null,xt,it=0,kt=ae.length;for(;kt--;)it+=ae[kt].unit.byteLength;for(let mn=0,Nn=ae.length;mn<Nn;mn++){const zn=ae[mn],un=zn.unit;let nn=zn.pts;if(Ge!==null){const Rn=ee[mn-1];Rn.duration=Math.round((nn-Ge)/d)}else if(n&&e.segmentCodec==="aac"&&(nn=Re),rt=nn,it>0){it+=ce;try{xt=new Uint8Array(it)}catch(Rn){this.observer.emit(u.ERROR,u.ERROR,{type:g.MUX_ERROR,details:m.REMUX_ALLOC_ERROR,fatal:!1,error:Rn,bytes:it,reason:`fail allocating audio mdat ${it}`});return}U||(new DataView(xt.buffer).setUint32(0,it),xt.set(Ve.types.mdat,4))}else return;xt.set(un,ce);const Bn=un.byteLength;ce+=Bn,ee.push(new aa(!0,h,Bn,0)),Ge=nn}const Yt=ee.length;if(!Yt)return;const mt=ee[ee.length-1];this.nextAudioPts=Re=Ge+d*mt.duration;const Nt=U?new Uint8Array(0):Ve.moof(e.sequenceNumber++,rt/d,o({},e,{samples:ee}));e.samples=[];const Sn=rt/s,tn=Re/s,yn={data1:Nt,data2:xt,startPTS:Sn,endPTS:tn,startDTS:Sn,endDTS:tn,type:"audio",hasAudio:!0,hasVideo:!1,nb:Yt};return this.isAudioContiguous=!0,yn}remuxEmptyAudio(e,t,n,i){const r=e.inputTimeScale,s=e.samplerate?e.samplerate:r,l=r/s,d=this.nextAudioPts,h=this._initDTS,_=h.baseTime*9e4/h.timescale,S=(d!==null?d:i.startDTS*r)+_,U=i.endDTS*r+_,ee=l*ia,X=Math.ceil((U-S)/ee),ae=ta.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(E.warn("[mp4-remuxer]: remux empty Audio"),!ae){E.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const ce=[];for(let Re=0;Re<X;Re++){const $e=S+Re*ee;ce.push({unit:ae,pts:$e,dts:$e})}return e.samples=ce,this.remuxAudio(e,t,n,!1)}}function $i(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 Lo(a){for(let e=0;e<a.length;e++)if(a[e].key)return e;return-1}function ra(a,e,t,n){const i=a.samples.length;if(!i)return;const r=a.inputTimeScale;for(let l=0;l<i;l++){const d=a.samples[l];d.pts=$i(d.pts-t.baseTime*r/t.timescale,e*r)/r,d.dts=$i(d.dts-n.baseTime*r/n.timescale,e*r)/r}const s=a.samples;return a.samples=[],{samples:s}}function sa(a,e,t){const n=a.samples.length;if(!n)return;const i=a.inputTimeScale;for(let s=0;s<n;s++){const l=a.samples[s];l.pts=$i(l.pts-t.baseTime*i/t.timescale,e*i)/i}a.samples.sort((s,l)=>s.pts-l.pts);const r=a.samples;return a.samples=[],{samples:r}}class aa{constructor(e,t,n,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=n,this.cts=i,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class Co{constructor(){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}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,n,i){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(Jt(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=ut(e);i.audio&&(t=oa(i.audio,V.AUDIO)),i.video&&(n=oa(i.video,V.VIDEO));const r={};i.audio&&i.video?r.audiovideo={container:"video/mp4",codec:t+","+n,initSegment:e,id:"main"}:i.audio?r.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?r.video={container:"video/mp4",codec:n,initSegment:e,id:"main"}:E.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,n,i,r,s){var l,d;let{initPTS:h,lastEndTime:_}=this;const S={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};K(_)||(_=this.lastEndTime=r||0);const U=t.samples;if(!(U!=null&&U.length))return S;const ee={initPTS:void 0,timescale:1};let X=this.initData;if((l=X)!=null&&l.length||(this.generateInitSegment(U),X=this.initData),!((d=X)!=null&&d.length))return E.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(ee.tracks=this.initTracks,this.emitInitSegment=!1);const ae=jt(U,X),ce=an(X,U),Re=ce===null?r:ce;(Io(h,Re,r,ae)||ee.timescale!==h.timescale&&s)&&(ee.initPTS=Re-r,h&&h.timescale===1&&E.warn(`Adjusting initPTS by ${ee.initPTS-h.baseTime}`),this.initPTS=h={baseTime:ee.initPTS,timescale:1});const $e=e?Re-h.baseTime/h.timescale:_,Ue=$e+ae;pt(X,U,h.baseTime/h.timescale),ae>0?this.lastEndTime=Ue:(E.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const rt=!!X.audio,Ge=!!X.video;let xt="";rt&&(xt+="audio"),Ge&&(xt+="video");const it={data1:U,startPTS:$e,startDTS:$e,endPTS:Ue,endDTS:Ue,type:xt,hasAudio:rt,hasVideo:Ge,nb:1,dropped:0};return S.audio=it.type==="audio"?it:void 0,S.video=it.type!=="audio"?it:void 0,S.initSegment=ee,S.id3=ra(n,r,h,h),i.samples.length&&(S.text=sa(i,r,h)),S}}function Io(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 oa(a,e){const t=a==null?void 0:a.codec;if(t&&t.length>4)return t;if(e===V.AUDIO){if(t==="ec-3"||t==="ac-3"||t==="alac")return t;if(t==="fLaC"||t==="Opus")return Zt(t,!1);const n="mp4a.40.5";return E.info(`Parsed audio codec "${t}" or audio object type not handled. Using "${n}"`),n}return E.warn(`Unhandled video codec "${t}"`),t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":"avc1.42e01e"}let ir;try{ir=self.performance.now.bind(self.performance)}catch(a){E.debug("Unable to use Performance API on this environment"),ir=Se==null?void 0:Se.Date.now}const Vr=[{demux:mo,remux:Co},{demux:ur,remux:zr},{demux:fo,remux:zr},{demux:xo,remux:zr}];Vr.splice(2,0,{demux:go,remux:zr});class la{constructor(e,t,n,i,r){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=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.vendor=i,this.id=r}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,i){const r=n.transmuxing;r.executeStart=ir();let s=new Uint8Array(e);const{currentTransmuxState:l,transmuxConfig:d}=this;i&&(this.currentTransmuxState=i);const{contiguous:h,discontinuity:_,trackSwitch:S,accurateTimeOffset:U,timeOffset:ee,initSegmentChange:X}=i||l,{audioCodec:ae,videoCodec:ce,defaultInitPts:Re,duration:$e,initSegmentData:Ue}=d,rt=Do(s,t);if(rt&&rt.method==="AES-128"){const kt=this.getDecrypter();if(kt.isSync()){let Yt=kt.softwareDecrypt(s,rt.key.buffer,rt.iv.buffer);if(n.part>-1&&(Yt=kt.flush()),!Yt)return r.executeEnd=ir(),bs(n);s=new Uint8Array(Yt)}else return this.decryptionPromise=kt.webCryptoDecrypt(s,rt.key.buffer,rt.iv.buffer).then(Yt=>{const mt=this.push(Yt,null,n);return this.decryptionPromise=null,mt}),this.decryptionPromise}const Ge=this.needsProbing(_,S);if(Ge){const kt=this.configureTransmuxer(s);if(kt)return E.warn(`[transmuxer] ${kt.message}`),this.observer.emit(u.ERROR,u.ERROR,{type:g.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,fatal:!1,error:kt,reason:kt.message}),r.executeEnd=ir(),bs(n)}(_||S||X||Ge)&&this.resetInitSegment(Ue,ae,ce,$e,t),(_||X||Ge)&&this.resetInitialTimestamp(Re),h||this.resetContiguity();const xt=this.transmux(s,rt,ee,U,n),it=this.currentTransmuxState;return it.contiguous=!0,it.discontinuity=!1,it.trackSwitch=!1,r.executeEnd=ir(),xt}flush(e){const t=e.transmuxing;t.executeStart=ir();const{decrypter:n,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return r.then(()=>this.flush(e));const s=[],{timeOffset:l}=i;if(n){const S=n.flush();S&&s.push(this.push(S,null,e))}const{demuxer:d,remuxer:h}=this;if(!d||!h)return t.executeEnd=ir(),[bs(e)];const _=d.flush(l);return Wr(_)?_.then(S=>(this.flushRemux(s,S,e),s)):(this.flushRemux(s,_,e),s)}flushRemux(e,t,n){const{audioTrack:i,videoTrack:r,id3Track:s,textTrack:l}=t,{accurateTimeOffset:d,timeOffset:h}=this.currentTransmuxState;E.log(`[transmuxer.ts]: Flushed fragment ${n.sn}${n.part>-1?" p: "+n.part:""} of level ${n.level}`);const _=this.remuxer.remux(i,r,s,l,h,d,!0,this.id);e.push({remuxResult:_,chunkMeta:n}),n.transmuxing.executeEnd=ir()}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:l}=this;!s||!l||(s.resetInitSegment(e,t,n,i),l.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:l,textTrack:d}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,s,l,d,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,vendor:r}=this;let s;for(let U=0,ee=Vr.length;U<ee;U++){var l;if((l=Vr[U].demux)!=null&&l.probe(e)){s=Vr[U];break}}if(!s)return new Error("Failed to find demuxer by probing fragment data");const d=this.demuxer,h=this.remuxer,_=s.remux,S=s.demux;(!h||!(h instanceof _))&&(this.remuxer=new _(n,t,i,r)),(!d||!(d instanceof S))&&(this.demuxer=new S(n,t,i),this.probe=S.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Sr(this.config)),e}}function Do(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 bs=a=>({remuxResult:{},chunkMeta:a});function Wr(a){return"then"in a&&a.then instanceof Function}class Oo{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 ko{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}}var ua={exports:{}};(function(a){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(d,h,_){this.fn=d,this.context=h,this.once=_||!1}function r(d,h,_,S,U){if(typeof _!="function")throw new TypeError("The listener must be a function");var ee=new i(_,S||d,U),X=t?t+h:h;return d._events[X]?d._events[X].fn?d._events[X]=[d._events[X],ee]:d._events[X].push(ee):(d._events[X]=ee,d._eventsCount++),d}function s(d,h){--d._eventsCount===0?d._events=new n:delete d._events[h]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var h=[],_,S;if(this._eventsCount===0)return h;for(S in _=this._events)e.call(_,S)&&h.push(t?S.slice(1):S);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(_)):h},l.prototype.listeners=function(h){var _=t?t+h:h,S=this._events[_];if(!S)return[];if(S.fn)return[S.fn];for(var U=0,ee=S.length,X=new Array(ee);U<ee;U++)X[U]=S[U].fn;return X},l.prototype.listenerCount=function(h){var _=t?t+h:h,S=this._events[_];return S?S.fn?1:S.length:0},l.prototype.emit=function(h,_,S,U,ee,X){var ae=t?t+h:h;if(!this._events[ae])return!1;var ce=this._events[ae],Re=arguments.length,$e,Ue;if(ce.fn){switch(ce.once&&this.removeListener(h,ce.fn,void 0,!0),Re){case 1:return ce.fn.call(ce.context),!0;case 2:return ce.fn.call(ce.context,_),!0;case 3:return ce.fn.call(ce.context,_,S),!0;case 4:return ce.fn.call(ce.context,_,S,U),!0;case 5:return ce.fn.call(ce.context,_,S,U,ee),!0;case 6:return ce.fn.call(ce.context,_,S,U,ee,X),!0}for(Ue=1,$e=new Array(Re-1);Ue<Re;Ue++)$e[Ue-1]=arguments[Ue];ce.fn.apply(ce.context,$e)}else{var rt=ce.length,Ge;for(Ue=0;Ue<rt;Ue++)switch(ce[Ue].once&&this.removeListener(h,ce[Ue].fn,void 0,!0),Re){case 1:ce[Ue].fn.call(ce[Ue].context);break;case 2:ce[Ue].fn.call(ce[Ue].context,_);break;case 3:ce[Ue].fn.call(ce[Ue].context,_,S);break;case 4:ce[Ue].fn.call(ce[Ue].context,_,S,U);break;default:if(!$e)for(Ge=1,$e=new Array(Re-1);Ge<Re;Ge++)$e[Ge-1]=arguments[Ge];ce[Ue].fn.apply(ce[Ue].context,$e)}}return!0},l.prototype.on=function(h,_,S){return r(this,h,_,S,!1)},l.prototype.once=function(h,_,S){return r(this,h,_,S,!0)},l.prototype.removeListener=function(h,_,S,U){var ee=t?t+h:h;if(!this._events[ee])return this;if(!_)return s(this,ee),this;var X=this._events[ee];if(X.fn)X.fn===_&&(!U||X.once)&&(!S||X.context===S)&&s(this,ee);else{for(var ae=0,ce=[],Re=X.length;ae<Re;ae++)(X[ae].fn!==_||U&&!X[ae].once||S&&X[ae].context!==S)&&ce.push(X[ae]);ce.length?this._events[ee]=ce.length===1?ce[0]:ce:s(this,ee)}return this},l.prototype.removeAllListeners=function(h){var _;return h?(_=t?t+h:h,this._events[_]&&s(this,_)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,a.exports=l})(ua);var Po=ua.exports,xs=B(Po);class ca{constructor(e,t,n,i){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const s=(h,_)=>{_=_||{},_.frag=this.frag,_.id=this.id,h===u.ERROR&&(this.error=_.error),this.hls.trigger(h,_)};this.observer=new xs,this.observer.on(u.FRAG_DECRYPTED,s),this.observer.on(u.ERROR,s);const l=dn(r.preferManagedMediaSource)||{isTypeSupported:()=>!1},d={mpeg:l.isTypeSupported("audio/mpeg"),mp3:l.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:l.isTypeSupported('audio/mp4; codecs="ac-3"')};if(this.useWorker&&typeof Worker!="undefined"&&(r.workerPath||Ja())){try{r.workerPath?(E.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=eo(r.workerPath)):(E.log(`injecting Web Worker for "${t}"`),this.workerContext=qa()),this.onwmsg=S=>this.onWorkerMessage(S);const{worker:_}=this.workerContext;_.addEventListener("message",this.onwmsg),_.onerror=S=>{const U=new Error(`${S.message} (${S.filename}:${S.lineno})`);r.enableWorker=!1,E.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(u.ERROR,{type:g.OTHER_ERROR,details:m.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:U})},_.postMessage({cmd:"init",typeSupported:d,vendor:"",id:t,config:JSON.stringify(r)})}catch(_){E.warn(`Error setting up "${t}" Web Worker, fallback to inline`,_),this.resetWorker(),this.error=null,this.transmuxer=new la(this.observer,d,r,"",t)}return}this.transmuxer=new la(this.observer,d,r,"",t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,n,i,r,s,l,d,h,_){var S,U;h.transmuxing.start=self.performance.now();const{transmuxer:ee}=this,X=s?s.start:r.start,ae=r.decryptdata,ce=this.frag,Re=!(ce&&r.cc===ce.cc),$e=!(ce&&h.level===ce.level),Ue=ce?h.sn-ce.sn:-1,rt=this.part?h.part-this.part.index:-1,Ge=Ue===0&&h.id>1&&h.id===(ce==null?void 0:ce.stats.chunkCount),xt=!$e&&(Ue===1||Ue===0&&(rt===1||Ge&&rt<=0)),it=self.performance.now();($e||Ue||r.stats.parsing.start===0)&&(r.stats.parsing.start=it),s&&(rt||!xt)&&(s.stats.parsing.start=it);const kt=!(ce&&((S=r.initSegment)==null?void 0:S.url)===((U=ce.initSegment)==null?void 0:U.url)),Yt=new ko(Re,xt,d,$e,X,kt);if(!xt||Re||kt){E.log(`[transmuxer-interface, ${r.type}]: Starting new transmux session for sn: ${h.sn} p: ${h.part} level: ${h.level} id: ${h.id}
|
|
discontinuity: ${Re}
|
|
trackSwitch: ${$e}
|
|
contiguous: ${xt}
|
|
accurateTimeOffset: ${d}
|
|
timeOffset: ${X}
|
|
initSegmentChange: ${kt}`);const mt=new Oo(n,i,t,l,_);this.configureTransmuxer(mt)}if(this.frag=r,this.part=s,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:ae,chunkMeta:h,state:Yt},e instanceof ArrayBuffer?[e]:[]);else if(ee){const mt=ee.push(e,ae,h,Yt);Wr(mt)?(ee.async=!0,mt.then(Nt=>{this.handleTransmuxComplete(Nt)}).catch(Nt=>{this.transmuxerError(Nt,h,"transmuxer-interface push error")})):(ee.async=!1,this.handleTransmuxComplete(mt))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let n=t.flush(e);Wr(n)||t.async?(Wr(n)||(n=Promise.resolve(n)),n.then(r=>{this.handleFlushResult(r,e)}).catch(r=>{this.transmuxerError(r,e,"transmuxer-interface flush error")})):this.handleFlushResult(n,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:m.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data;if(!(t!=null&&t.event)){E.warn(`worker message received with no ${t?"event name":"data"}`);return}const n=this.hls;if(this.hls)switch(t.event){case"init":{var i;const r=(i=this.workerContext)==null?void 0:i.objectURL;r&&self.URL.revokeObjectURL(r);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}case"workerLog":E[t.data.logType]&&E[t.data.logType](t.data.message);break;default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,n.trigger(t.event,t.data);break}}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const da=100;class No extends Dr{constructor(e,t,n){super(e,t,n,"[audio-stream-controller]",$t.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-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.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.LEVEL_LOADED,this.onLevelLoaded,this),e.on(u.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(u.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(u.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(u.ERROR,this.onError,this),e.on(u.BUFFER_RESET,this.onBufferReset,this),e.on(u.BUFFER_CREATED,this.onBufferCreated,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(u.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(u.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.LEVEL_LOADED,this.onLevelLoaded,this),e.off(u.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(u.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(u.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(u.ERROR,this.onError,this),e.off(u.BUFFER_RESET,this.onBufferReset,this),e.off(u.BUFFER_CREATED,this.onBufferCreated,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(u.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(u.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){if(n==="main"){const s=t.cc;this.initPTS[t.cc]={baseTime:i,timescale:r},this.log(`InitPTS for cc: ${s} found from main: ${i}`),this.videoTrackCC=s,this.state===gt.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=gt.STOPPED;return}const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(da),t>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=gt.IDLE):(this.loadedmetadata=!1,this.state=gt.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case gt.IDLE:this.doTickIdle();break;case gt.WAITING_TRACK:{var e;const{levels:n,trackId:i}=this,r=n==null||(e=n[i])==null?void 0:e.details;if(r){if(this.waitForCdnTuneIn(r))break;this.state=gt.WAITING_INIT_PTS}break}case gt.FRAG_LOADING_WAITING_RETRY:{var t;const n=performance.now(),i=this.retryDate;if(!i||n>=i||(t=this.media)!=null&&t.seeking){const{levels:r,trackId:s}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((r==null?void 0:r[s])||null),this.state=gt.IDLE}break}case gt.WAITING_INIT_PTS:{const n=this.waitingData;if(n){const{frag:i,part:r,cache:s,complete:l}=n;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=gt.FRAG_LOADING;const d=s.flush(),h={frag:i,part:r,payload:d,networkDetails:null};this._handleFragmentLoadProgress(h),l&&super._handleFragmentLoadComplete(h)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${i.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const d=this.getLoadPosition(),h=Hn.bufferInfo(this.mediaBuffer,d,this.config.maxBufferHole);Wi(h.end,this.config.maxFragLookUpTolerance,i)<0&&(this.log(`Waiting fragment cc (${i.cc}) @ ${i.start} cancelled because another fragment at ${h.end} is needed`),this.clearWaitingFragment())}}else this.state=gt.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=gt.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:n,trackId:i}=this,r=e.config;if(!this.buffering||!n&&(this.startFragRequested||!r.startFragPrefetch)||!(t!=null&&t[i]))return;const s=t[i],l=s.details;if(!l||l.live&&this.levelLastLoaded!==s||this.waitForCdnTuneIn(l)){this.state=gt.WAITING_TRACK;return}const d=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&d&&(this.bufferFlushed=!1,this.afterBufferFlushed(d,V.AUDIO,$t.AUDIO));const h=this.getFwdBufferInfo(d,$t.AUDIO);if(h===null)return;if(!this.switchingTrack&&this._streamEnded(h,l)){e.trigger(u.BUFFER_EOS,{type:"audio"}),this.state=gt.ENDED;return}const _=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,$t.MAIN),S=h.len,U=this.getMaxBufferLength(_==null?void 0:_.len),ee=l.fragments,X=ee[0].start,ae=this.getLoadPosition(),ce=this.flushing?ae:h.end;if(this.switchingTrack&&n){const rt=ae;l.PTSKnown&&rt<X&&(h.end>X||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=X+.05)}if(S>=U&&!this.switchingTrack&&ce<ee[ee.length-1].start)return;let Re=this.getNextFragment(ce,l),$e=!1;if(Re&&this.isLoopLoading(Re,ce)&&($e=!!Re.gap,Re=this.getNextFragmentLoopLoading(Re,l,h,$t.MAIN,U)),!Re){this.bufferFlushed=!0;return}const Ue=_&&Re.start>_.end+l.targetduration;if(Ue||!(_!=null&&_.len)&&h.len){const rt=this.getAppendedFrag(Re.start,$t.MAIN);if(rt===null||($e||($e=!!rt.gap||!!Ue&&_.len===0),Ue&&!$e||$e&&h.nextStart&&h.nextStart<rt.end))return}this.loadFragment(Re,s,ce)}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.min(Math.max(t,e),this.config.maxMaxBufferLength):t}onMediaDetaching(){this.videoBuffer=null,this.bufferFlushed=this.flushing=!1,super.onMediaDetaching()}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new pi(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.setInterval(da):this.resetTransmuxer(),n?(this.switchingTrack=t,this.state=gt.IDLE,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=gt.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(u.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var n;if(this.mainDetails==null){this.cachedTrackLoadedData=t;return}const{levels:i}=this,{details:r,id:s}=t;if(!i){this.warn(`Audio tracks were reset while loading level ${s}`);return}this.log(`Audio track ${s} loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const l=i[s];let d=0;if(r.live||(n=l.details)!=null&&n.live){this.checkLiveUpdate(r);const _=this.mainDetails;if(r.deltaUpdateFailed||!_)return;if(!l.details&&r.hasProgramDateTime&&_.hasProgramDateTime)br(r,_),d=r.fragments[0].start;else{var h;d=this.alignPlaylists(r,l.details,(h=this.levelLastLoaded)==null?void 0:h.details)}}l.details=r,this.levelLastLoaded=l,!this.startFragRequested&&(this.mainDetails||!r.live)&&this.setStartPosition(this.mainDetails||r,d),this.state===gt.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=gt.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:i,payload:r}=e,{config:s,trackId:l,levels:d}=this;if(!d){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 h=d[l];if(!h){this.warn("Audio track is undefined on fragment load progress");return}const _=h.details;if(!_){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const S=s.defaultAudioCodec||h.audioCodec||"mp4a.40.2";let U=this.transmuxer;U||(U=this.transmuxer=new ca(this.hls,$t.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const ee=this.initPTS[n.cc],X=(t=n.initSegment)==null?void 0:t.data;if(ee!==void 0){const ce=i?i.index:-1,Re=ce!==-1,$e=new yr(n.level,n.sn,n.stats.chunkCount,r.byteLength,ce,Re);U.push(r,X,S,"",n,i,_.totalduration,!1,$e,ee)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${_.startSN} ,${_.endSN}],track ${l}`);const{cache:ae}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new Gs,complete:!1};ae.push(new Uint8Array(r)),this.waitingVideoCC=this.videoTrackCC,this.state=gt.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:n,part:i}=t;if(n.type!==$t.AUDIO){if(!this.loadedmetadata&&n.type===$t.MAIN){const r=this.videoBuffer||this.media;r&&Hn.getBuffered(r).length&&(this.loadedmetadata=!0)}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(n.sn!=="initSegment"){this.fragPrevious=n;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(u.AUDIO_TRACK_SWITCHED,oe({},r)))}this.fragBufferedComplete(n,i)}onError(e,t){var n;if(t.fatal){this.state=gt.ERROR;return}switch(t.details){case m.FRAG_GAP:case m.FRAG_PARSING_ERROR:case m.FRAG_DECRYPT_ERROR:case m.FRAG_LOAD_ERROR:case m.FRAG_LOAD_TIMEOUT:case m.KEY_LOAD_ERROR:case m.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError($t.AUDIO,t);break;case m.AUDIO_TRACK_LOAD_ERROR:case m.AUDIO_TRACK_LOAD_TIMEOUT:case m.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===gt.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===hn.AUDIO_TRACK&&(this.state=gt.IDLE);break;case m.BUFFER_APPEND_ERROR:case m.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;if(t.details===m.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case m.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===gt.ENDED&&(this.state=gt.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,$t.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,l=this.getCurrentContext(s);if(!l){this.resetWhenMissingContext(s);return}const{frag:d,part:h,level:_}=l,{details:S}=_,{audio:U,text:ee,id3:X,initSegment:ae}=r;if(this.fragContextChanged(d)||!S){this.fragmentTracker.removeFragment(d);return}if(this.state=gt.PARSING,this.switchingTrack&&U&&this.completeAudioSwitch(this.switchingTrack),ae!=null&&ae.tracks){const ce=d.initSegment||d;this._bufferInitSegment(_,ae.tracks,ce,s),i.trigger(u.FRAG_PARSING_INIT_SEGMENT,{frag:ce,id:n,tracks:ae.tracks})}if(U){const{startPTS:ce,endPTS:Re,startDTS:$e,endDTS:Ue}=U;h&&(h.elementaryStreams[V.AUDIO]={startPTS:ce,endPTS:Re,startDTS:$e,endDTS:Ue}),d.setElementaryStreamInfo(V.AUDIO,ce,Re,$e,Ue),this.bufferFragmentData(U,d,h,s)}if(X!=null&&(t=X.samples)!=null&&t.length){const ce=o({id:n,frag:d,details:S},X);i.trigger(u.FRAG_PARSING_METADATA,ce)}if(ee){const ce=o({id:n,frag:d,details:S},ee);i.trigger(u.FRAG_PARSING_USERDATA,ce)}}_bufferInitSegment(e,t,n,i){if(this.state!==gt.PARSING)return;t.video&&delete t.video;const r=t.audio;if(!r)return;r.id="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(u.BUFFER_CODECS,t);const l=r.initSegment;if(l!=null&&l.byteLength){const d={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:l};this.hls.trigger(u.BUFFER_APPENDING,d)}this.tickImmediate()}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||i===oi.NOT_LOADED||i===oi.PARTIAL){var r;if(e.sn==="initSegment")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=gt.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragments[0].start!==t.details.fragments[0].start&&br(t.details,s)}else this.startFragRequested=!0,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:l}=this.bufferedTrack;Yi({name:t,lang:n,assocLang:i,characteristics:r,audioCodec:s,channels:l},e,Xi)||(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(u.AUDIO_TRACK_SWITCHED,oe({},e))}}function ha(a,e){if(a.length!==e.length)return!1;for(let t=0;t<a.length;t++)if(!kr(a[t].attrs,e[t].attrs))return!1;return!0}function kr(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 Ss(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class Mo extends Dn{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(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.LEVEL_LOADING,this.onLevelLoading,this),e.on(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(u.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(u.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.LEVEL_LOADING,this.onLevelLoading,this),e.off(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(u.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(u.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 l=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,l)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,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(l=>(i==null?void 0:i.indexOf(l))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const l=this.tracks.filter(U=>!n||n.indexOf(U.groupId)!==-1);if(l.length)this.selectDefaultTrack&&!l.some(U=>U.default)&&(this.selectDefaultTrack=!1),l.forEach((U,ee)=>{U.id=ee});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=l;const d=this.hls.config.audioPreference;if(!r&&d){const U=Ui(d,l,Xi);if(U>-1)r=l[U];else{const ee=Ui(d,this.tracks);r=this.tracks[ee]}}let h=this.findTrackId(r);h===-1&&r&&(h=this.findTrackId(null));const _={audioTracks:l};this.log(`Updating audio tracks, ${l.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(u.AUDIO_TRACKS_UPDATED,_);const S=this.trackId;if(h!==-1&&S===-1)this.setAudioTrack(h);else if(l.length&&S===-1){var s;const U=new Error(`No audio track selected for current audio group-ID(s): ${(s=this.groupIds)==null?void 0:s.join(",")} track count: ${l.length}`);this.warn(U.message),this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:m.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:U})}}else this.shouldReloadPlaylist(r)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===hn.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&(this.requestScheduled=-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&&Yi(e,i,Xi))return i;const r=Ui(e,this.tracksInGroup,Xi);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 l=ss(e,t.levels,n,s,Xi);if(l===-1)return null;t.nextLoadLevel=l}if(e.channels||e.audioCodec){const s=Ui(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.clearTimer(),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(u.AUDIO_TRACK_SWITCHING,oe({},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||Yi(e,i,Xi)))return n}if(e){const{name:n,lang:i,assocLang:r,characteristics:s,audioCodec:l,channels:d}=e;for(let h=0;h<t.length;h++){const _=t[h];if(Yi({name:n,lang:i,assocLang:r,characteristics:s,audioCodec:l,channels:d},_,Xi))return h}for(let h=0;h<t.length;h++){const _=t[h];if(kr(e.attrs,_.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return h}for(let h=0;h<t.length;h++){const _=t[h];if(kr(e.attrs,_.attrs,["LANGUAGE"]))return h}}return-1}loadPlaylist(e){const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){super.loadPlaylist();const n=t.id,i=t.groupId;let r=t.url;if(e)try{r=e.addDirectives(r)}catch(s){this.warn(`Could not construct new URL with HLS Delivery Directives: ${s}`)}this.log(`loading audio-track playlist ${n} "${t.name}" lang:${t.lang} group:${i}`),this.clearTimer(),this.hls.trigger(u.AUDIO_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:e||null})}}}const fa=500;class Fo extends Dr{constructor(e,t,n){super(e,t,n,"[subtitle-stream-controller]",$t.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.LEVEL_LOADED,this.onLevelLoaded,this),e.on(u.ERROR,this.onError,this),e.on(u.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(u.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(u.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(u.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.LEVEL_LOADED,this.onLevelLoaded,this),e.off(u.ERROR,this.onError,this),e.off(u.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(u.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(u.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(u.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=gt.IDLE,this.setInterval(fa),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:i}=t;if(this.fragPrevious=n,this.state=gt.IDLE,!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let s;const l=n.start;for(let h=0;h<r.length;h++)if(l>=r[h].start&&l<=r[h].end){s=r[h];break}const d=n.start+n.duration;s?s.end=d:(s={start:l,end:d},r.push(s)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null)}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 l=0;l<s.length;){if(s[l].end<=r){s.shift();continue}else if(s[l].start<r)s[l].start=r;else break;l++}}),this.fragmentTracker.removeFragmentsInRange(n,r,$t.SUBTITLE)}}onFragBuffered(e,t){if(!this.loadedmetadata&&t.frag.type===$t.MAIN){var n;(n=this.media)!=null&&n.buffered.length&&(this.loadedmetadata=!0)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===$t.SUBTITLE&&(t.details===m.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==gt.STOPPED&&(this.state=gt.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&ha(this.levels,t)){this.levels=t.map(n=>new pi(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const i=new pi(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,$t.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.setInterval(fa)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:i,levels:r}=this,{details:s,id:l}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${l}`);return}const d=r[l];if(l>=r.length||!d)return;this.log(`Subtitle track ${l} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let h=0;if(s.live||(n=d.details)!=null&&n.live){const S=this.mainDetails;if(s.deltaUpdateFailed||!S)return;const U=S.fragments[0];if(!d.details)s.hasProgramDateTime&&S.hasProgramDateTime?(br(s,S),h=s.fragments[0].start):U&&(h=U.start,Ii(s,h));else{var _;h=this.alignPlaylists(s,d.details,(_=this.levelLastLoaded)==null?void 0:_.details),h===0&&U&&(h=U.start,Ii(s,h))}}d.details=s,this.levelLastLoaded=d,l===i&&(!this.startFragRequested&&(this.mainDetails||!s.live)&&this.setStartPosition(this.mainDetails||s,h),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===gt.IDLE&&(Bi(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),d.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&&i.method==="AES-128"){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer).catch(l=>{throw r.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:m.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:t}),l}).then(l=>{const d=performance.now();r.trigger(u.FRAG_DECRYPTED,{frag:t,payload:l,stats:{tstart:s,tdecrypt:d}})}).catch(l=>{this.warn(`${l.name}: ${l.message}`),this.state=gt.IDLE})}}doTick(){if(!this.media){this.state=gt.IDLE;return}if(this.state===gt.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details)return;const{config:i}=this,r=this.getLoadPosition(),s=Hn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:l,len:d}=s,h=this.getFwdBufferInfo(this.media,$t.MAIN),_=n.details,S=this.getMaxBufferLength(h==null?void 0:h.len)+_.levelTargetDuration;if(d>S)return;const U=_.fragments,ee=U.length,X=_.edge;let ae=null;const ce=this.fragPrevious;if(l<X){const Re=i.maxFragLookUpTolerance,$e=l>X-Re?0:Re;ae=Bi(ce,U,Math.max(U[0].start,l),$e),!ae&&ce&&ce.start<U[0].start&&(ae=U[0])}else ae=U[ee-1];if(!ae)return;if(ae=this.mapToInitFragWhenRequired(ae),ae.sn!=="initSegment"){const Re=ae.sn-_.startSN,$e=U[Re-1];$e&&$e.cc===ae.cc&&this.fragmentTracker.getState($e)===oi.NOT_LOADED&&(ae=$e)}this.fragmentTracker.getState(ae)===oi.NOT_LOADED&&this.loadFragment(ae,n,l)}}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.max(t,e):t}loadFragment(e,t,n){this.fragCurrent=e,e.sn==="initSegment"?this._loadInitSegment(e,t):(this.startFragRequested=!0,super.loadFragment(e,t,n))}get mediaBufferTimeRanges(){return new Bo(this.tracksBuffered[this.currentTrackId]||[])}}class Bo{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)}}}}class Uo extends Dn{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.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const n=Bt(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(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.LEVEL_LOADING,this.onLevelLoading,this),e.on(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(u.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(u.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.LEVEL_LOADING,this.onLevelLoading,this),e.off(u.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(u.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(u.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(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),Bt(this.media.textTracks).forEach(t=>{Jn(t)}),this.subtitleTrack=-1,this.media=null}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 l=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,l)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,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(_=>!n||n.indexOf(_.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(_=>_.default)&&(this.selectDefaultTrack=!1),s.forEach((_,S)=>{_.id=S});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const l=this.hls.config.subtitlePreference;if(!r&&l){this.selectDefaultTrack=!1;const _=Ui(l,s);if(_>-1)r=s[_];else{const S=Ui(l,this.tracks);r=this.tracks[S]}}let d=this.findTrackId(r);d===-1&&r&&(d=this.findTrackId(null));const h={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(u.SUBTITLE_TRACKS_UPDATED,h),d!==-1&&this.trackId===-1&&this.setSubtitleTrack(d)}else this.shouldReloadPlaylist(r)&&this.setSubtitleTrack(this.trackId)}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||Yi(r,e)))return i}if(e){for(let i=0;i<t.length;i++){const r=t[i];if(kr(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<t.length;i++){const r=t[i];if(kr(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(Ss(i,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===hn.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){const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&Yi(e,n))return n;const i=Ui(e,this.tracksInGroup);if(i>-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(n)return null;{const r=Ui(e,t);if(r>-1)return t[r]}}}}return null}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){const n=t.id,i=t.groupId;let r=t.url;if(e)try{r=e.addDirectives(r)}catch(s){this.warn(`Could not construct new URL with HLS Delivery Directives: ${s}`)}this.log(`Loading subtitle playlist for id ${n}`),this.hls.trigger(u.SUBTITLE_TRACK_LOADING,{url:r,id:n,groupId:i,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Bt(e.textTracks),n=this.currentTrack;let i;if(n&&(i=t.filter(r=>Ss(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||!K(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(u.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:l="",name:d,type:h,url:_}=i;this.hls.trigger(u.SUBTITLE_TRACK_SWITCH,{id:s,groupId:l,name:d,type:h,url:_});const S=this.switchParams(i.url,n==null?void 0:n.details,i.details);this.loadPlaylist(S)}}class $o{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t,n){const i=this.queues[t];i.push(e),i.length===1&&!n&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const n=new Promise(r=>{t=r}),i={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,e),n}executeNext(e){const t=this.queues[e];if(t.length){const n=t[0];try{n.execute()}catch(i){E.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${i}`),n.onError(i);const r=this.buffers[e];r!=null&&r.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const pa=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class Ko{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=n=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:n,mediaSource:i}=this;this.log("Media source opened"),n&&(n.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(u.MEDIA_ATTACHED,{media:n,mediaSource:i})),i&&i.removeEventListener("sourceopen",this._onMediaSourceOpen),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&&E.error(`Media element src was set while attaching MediaSource (${i} > ${n})`)},this.hls=e;const t="[buffer-controller]";this.appendSource=fn(dn(e.config.preferManagedMediaSource)),this.log=E.log.bind(E,t),this.warn=E.warn.bind(E,t),this.error=E.error.bind(E,t),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.BUFFER_RESET,this.onBufferReset,this),e.on(u.BUFFER_APPENDING,this.onBufferAppending,this),e.on(u.BUFFER_CODECS,this.onBufferCodecs,this),e.on(u.BUFFER_EOS,this.onBufferEos,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(u.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(u.FRAG_PARSED,this.onFragParsed,this),e.on(u.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.BUFFER_RESET,this.onBufferReset,this),e.off(u.BUFFER_APPENDING,this.onBufferAppending,this),e.off(u.BUFFER_CODECS,this.onBufferCodecs,this),e.off(u.BUFFER_EOS,this.onBufferEos,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(u.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(u.FRAG_PARSED,this.onFragParsed,this),e.off(u.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new $o(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let n=2;(t.audio&&!t.video||!t.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const n=this.media=t.media,i=dn(this.appendSource);if(n&&i){var r;const s=this.mediaSource=new i;this.log(`created media source: ${(r=s.constructor)==null?void 0:r.name}`),s.addEventListener("sourceopen",this._onMediaSourceOpen),s.addEventListener("sourceended",this._onMediaSourceEnded),s.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(s.addEventListener("startstreaming",this._onStartStreaming),s.addEventListener("endstreaming",this._onEndStreaming));const l=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{n.removeAttribute("src");const d=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||d&&s instanceof d,ma(n),Go(n,l),n.load()}catch(d){n.src=l}else n.src=l;n.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:n}=this;if(t){if(this.log("media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(i){this.warn(`onMediaDetaching: ${i.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),e&&(e.removeEventListener("emptied",this._onMediaEmptied),n&&self.URL.revokeObjectURL(n),this.mediaSrc===n?(e.removeAttribute("src"),this.appendSource&&ma(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(u.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{this.resetBuffer(e)}),this._initSourceBuffer(),this.hls.resumeBuffering()}resetBuffer(e){const t=this.sourceBuffer[e];try{if(t){var n;this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,(n=this.mediaSource)!=null&&n.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t)}}catch(i){this.warn(`onBufferReset ${e}`,i)}}onBufferCodecs(e,t){const n=this.getSourceBufferTypes().length,i=Object.keys(t);if(i.forEach(s=>{if(n){const d=this.tracks[s];if(d&&typeof d.buffer.changeType=="function"){var l;const{id:h,codec:_,levelCodec:S,container:U,metadata:ee}=t[s],X=Ut(d.codec,d.levelCodec),ae=X==null?void 0:X.replace(pa,"$1");let ce=Ut(_,S);const Re=(l=ce)==null?void 0:l.replace(pa,"$1");if(ce&&ae!==Re){s.slice(0,5)==="audio"&&(ce=Zt(ce,this.appendSource));const $e=`${U};codecs=${ce}`;this.appendChangeType(s,$e),this.log(`switching codec ${X} to ${ce}`),this.tracks[s]={buffer:d.buffer,codec:_,container:U,levelCodec:S,metadata:ee,id:h}}}}else this.pendingTracks[s]=t[s]}),n)return;const r=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==r&&(this.log(`${r} bufferCodec event(s) expected ${i.join(",")}`),this.bufferCodecEventsExpected=r),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(e,t){const{operationQueue:n}=this,i={execute:()=>{const r=this.sourceBuffer[e];r&&(this.log(`changing ${e} sourceBuffer type to ${t}`),r.changeType(t)),n.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:r=>{this.warn(`Failed to change ${e} SourceBuffer type`,r)}};n.append(i,e,!!this.pendingTracks[e])}onBufferAppending(e,t){const{hls:n,operationQueue:i,tracks:r}=this,{data:s,type:l,frag:d,part:h,chunkMeta:_}=t,S=_.buffering[l],U=self.performance.now();S.start=U;const ee=d.stats.buffering,X=h?h.stats.buffering:null;ee.start===0&&(ee.start=U),X&&X.start===0&&(X.start=U);const ae=r.audio;let ce=!1;l==="audio"&&(ae==null?void 0:ae.container)==="audio/mpeg"&&(ce=!this.lastMpegAudioChunk||_.id===1||this.lastMpegAudioChunk.sn!==_.sn,this.lastMpegAudioChunk=_);const Re=d.start,$e={execute:()=>{if(S.executeStart=self.performance.now(),ce){const Ue=this.sourceBuffer[l];if(Ue){const rt=Re-Ue.timestampOffset;Math.abs(rt)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${Re} (delta: ${rt}) sn: ${d.sn})`),Ue.timestampOffset=Re)}}this.appendExecutor(s,l)},onStart:()=>{},onComplete:()=>{const Ue=self.performance.now();S.executeEnd=S.end=Ue,ee.first===0&&(ee.first=Ue),X&&X.first===0&&(X.first=Ue);const{sourceBuffer:rt}=this,Ge={};for(const xt in rt)Ge[xt]=Hn.getBuffered(rt[xt]);this.appendErrors[l]=0,l==="audio"||l==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(u.BUFFER_APPENDED,{type:l,frag:d,part:h,chunkMeta:_,parent:d.type,timeRanges:Ge})},onError:Ue=>{const rt={type:g.MEDIA_ERROR,parent:d.type,details:m.BUFFER_APPEND_ERROR,sourceBufferName:l,frag:d,part:h,chunkMeta:_,error:Ue,err:Ue,fatal:!1};if(Ue.code===DOMException.QUOTA_EXCEEDED_ERR)rt.details=m.BUFFER_FULL_ERROR;else{const Ge=++this.appendErrors[l];rt.details=m.BUFFER_APPEND_ERROR,this.warn(`Failed ${Ge}/${n.config.appendErrorMaxRetry} times to append segment in "${l}" sourceBuffer`),Ge>=n.config.appendErrorMaxRetry&&(rt.fatal=!0)}n.trigger(u.ERROR,rt)}};i.append($e,l,!!this.pendingTracks[l])}onBufferFlushing(e,t){const{operationQueue:n}=this,i=r=>({execute:this.removeExecutor.bind(this,r,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(u.BUFFER_FLUSHED,{type:r})},onError:s=>{this.warn(`Failed to remove from ${r} SourceBuffer`,s)}});t.type?n.append(i(t.type),t.type):this.getSourceBufferTypes().forEach(r=>{n.append(i(r),r)})}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 l=()=>{const d=self.performance.now();n.stats.buffering.end=d,i&&(i.stats.buffering.end=d);const h=i?i.stats:n.stats;this.hls.trigger(u.FRAG_BUFFERED,{frag:n,part:i,stats:h,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(l,r)}onFragChanged(e,t){this.trimBuffers()}onBufferEos(e,t){this.getSourceBufferTypes().reduce((i,r)=>{const s=this.sourceBuffer[r];return s&&(!t.type||t.type===r)&&(s.ending=!0,s.ended||(s.ended=!0,this.log(`${r} sourceBuffer now EOS`))),i&&!!(!s||s.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(r=>{const s=this.sourceBuffer[r];s&&(s.ending=!1)});const{mediaSource:i}=this;if(!i||i.readyState!=="open"){i&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${i.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),i.endOfStream()}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.getSourceBufferTypes().length)return;const r=e.config,s=n.currentTime,l=t.levelTargetDuration,d=t.live&&r.liveBackBufferLength!==null?r.liveBackBufferLength:r.backBufferLength;if(K(d)&&d>0){const h=Math.max(d,l),_=Math.floor(s/l)*l-h;this.flushBackBuffer(s,l,_)}if(K(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const h=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),_=Math.max(h,l),S=Math.floor(s/l)*l+_;this.flushFrontBuffer(s,l,S)}}flushBackBuffer(e,t,n){const{details:i,sourceBuffer:r}=this;this.getSourceBufferTypes().forEach(l=>{const d=r[l];if(d){const h=Hn.getBuffered(d);if(h.length>0&&n>h.start(0)){if(this.hls.trigger(u.BACK_BUFFER_REACHED,{bufferEnd:n}),i!=null&&i.live)this.hls.trigger(u.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(d.ended&&h.end(h.length-1)-e<t*2){this.log(`Cannot flush ${l} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(u.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:l})}}})}flushFrontBuffer(e,t,n){const{sourceBuffer:i}=this;this.getSourceBufferTypes().forEach(s=>{const l=i[s];if(l){const d=Hn.getBuffered(l),h=d.length;if(h<2)return;const _=d.start(h-1),S=d.end(h-1);if(n>_||e>=_&&e<=S)return;if(l.ended&&e-S<2*t){this.log(`Cannot flush ${s} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(u.BUFFER_FLUSHING,{startOffset:_,endOffset:1/0,type:s})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:t,media:n,mediaSource:i}=this,r=e.fragments[0].start+e.totalduration,s=n.duration,l=K(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(i.duration=1/0,this.updateSeekableRange(e)):(r>l&&r>s||!K(s))&&(this.log(`Updating Media Source duration to ${r.toFixed(3)}`),i.duration=r)}updateSeekableRange(e){const t=this.mediaSource,n=e.fragments;if(n.length&&e.live&&t!=null&&t.setLiveSeekableRange){const r=Math.max(0,n[0].start),s=Math.max(r,r+e.totalduration);this.log(`Media Source duration is set to ${t.duration}. Setting seekable range to ${r}-${s}.`),t.setLiveSeekableRange(r,s)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:n}=this,i=Object.keys(n).length;if(i&&(!e||i===2||"audiovideo"in n)){this.createSourceBuffers(n),this.pendingTracks={};const r=this.getSourceBufferTypes();if(r.length)this.hls.trigger(u.BUFFER_CREATED,{tracks:this.tracks}),r.forEach(s=>{t.executeNext(s)});else{const s=new Error("could not create source buffer for media codec(s)");this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:m.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:s,reason:s.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:n}=this;if(!n)throw Error("createSourceBuffers called when mediaSource was null");for(const r in e)if(!t[r]){var i;const s=e[r];if(!s)throw Error(`source buffer exists for track ${r}, however track does not`);let l=((i=s.levelCodec)==null?void 0:i.indexOf(","))===-1?s.levelCodec:s.codec;l&&r.slice(0,5)==="audio"&&(l=Zt(l,this.appendSource));const d=`${s.container};codecs=${l}`;this.log(`creating sourceBuffer(${d})`);try{const h=t[r]=n.addSourceBuffer(d),_=r;this.addBufferListener(_,"updatestart",this._onSBUpdateStart),this.addBufferListener(_,"updateend",this._onSBUpdateEnd),this.addBufferListener(_,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(_,"bufferedchange",(S,U)=>{const ee=U.removedRanges;ee!=null&&ee.length&&this.hls.trigger(u.BUFFER_FLUSHED,{type:r})}),this.tracks[r]={buffer:h,codec:l,container:s.container,levelCodec:s.levelCodec,metadata:s.metadata,id:s.id}}catch(h){this.error(`error while trying to add sourceBuffer: ${h.message}`),this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:m.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,sourceBufferName:r,mimeType:d})}}}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{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const{operationQueue:n}=this;n.current(e).onComplete(),n.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(u.ERROR,{type:g.MEDIA_ERROR,details:m.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.operationQueue.current(e);r&&r.onError(i)}removeExecutor(e,t,n){const{media:i,mediaSource:r,operationQueue:s,sourceBuffer:l}=this,d=l[e];if(!i||!r||!d){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),s.shiftAndExecuteNext(e);return}const h=K(i.duration)?i.duration:1/0,_=K(r.duration)?r.duration:1/0,S=Math.max(0,t),U=Math.min(n,h,_);U>S&&(!d.ending||d.ended)?(d.ended=!1,this.log(`Removing [${S},${U}] from the ${e} SourceBuffer`),d.remove(S,U)):s.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.sourceBuffer[t];if(!n){if(!this.pendingTracks[t])throw new Error(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);return}n.ended=!1,n.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:n}=this,i=t.map(r=>n.appendBlocker(r));Promise.all(i).then(()=>{e(),t.forEach(r=>{const s=this.sourceBuffer[r];s!=null&&s.updating||n.shiftAndExecuteNext(r)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,n){const i=this.sourceBuffer[e];if(!i)return;const r=n.bind(this,e);this.listeners[e].push({event:t,listener:r}),i.addEventListener(t,r)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(n=>{t.removeEventListener(n.event,n.listener)})}}function ma(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function Go(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}const jo={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},ga=a=>String.fromCharCode(jo[a]||a),Hi=15,rr=100,Ho={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},zo={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Vo={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Wo={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Zo=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Yo{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;E.log(`${this.time} [${e}] ${n}`)}}}const mr=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class _a{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 Xo{constructor(){this.uchar=" ",this.penState=new _a}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 Qo{constructor(e){this.chars=[],this.pos=0,this.currPenState=new _a,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<rr;t++)this.chars.push(new Xo);this.logger=e}equals(e){for(let t=0;t<rr;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<rr;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<rr;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>rr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=rr)}moveCursor(e){const t=this.pos+e;if(e>1)for(let 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=ga(e);if(this.pos>=rr){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t<rr;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let n=0;n<rr;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 ws{constructor(e){this.rows=[],this.currRow=Hi-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<Hi;t++)this.rows.push(new Qo(e));this.logger=e}reset(){for(let e=0;e<Hi;e++)this.rows[e].clear();this.currRow=Hi-1}equals(e){let t=!0;for(let n=0;n<Hi;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<Hi;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<Hi;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 = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let l=0;l<Hi;l++)this.rows[l].clear();const r=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){const l=s.rows[r].cueStartTime,d=this.logger.time;if(l!==null&&d!==null&&l<d)for(let h=0;h<this.nrRollUpRows;h++)this.rows[t-this.nrRollUpRows+h+1].copy(s.rows[r+h])}}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 = "+JSON.stringify(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<Hi;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 va{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 ws(n),this.nonDisplayedMemory=new ws(n),this.lastOutputScreen=new ws(n),this.currRollUpRow=this.displayedMemory.rows[Hi-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[Hi-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: "+JSON.stringify(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 ya{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=qo(),this.logger=void 0;const i=this.logger=new Yo;this.channels=[null,new va(e,t,i),new va(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,l=null;if(i===0&&r===0)continue;this.logger.log(3,()=>"["+mr([t[n],t[n+1]])+"] -> ("+mr([i,r])+")");const d=this.cmdHistory;if(i>=16&&i<=31){if(Jo(i,r,d)){Zr(null,null,d),this.logger.log(3,()=>"Repeated command ("+mr([i,r])+") is dropped");continue}Zr(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 Zr(null,null,d);if(!s&&(l=this.parseChars(i,r),l)){const _=this.currentChannel;_&&_>0?this.channels[_].insertChars(l):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!l&&this.logger.log(2,()=>"Couldn't parse cleaned data "+mr([i,r])+" orig: "+mr([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 ("+mr([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?Ho[e]:Vo[e]:n=s===1?zo[e]:Wo[e];const l=this.channels[s];return l?(l.setPAC(this.interpretPAC(n,t)),this.currentChannel=s,!0):!1}interpretPAC(e,t){let n;const 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 '"+ga(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 = "+mr(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=Zo[r],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const l=e<=23?1:2;return this.channels[l].setBkgData(s),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}Zr(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 Zr(a,e,t){t.a=a,t.b=e}function Jo(a,e,t){return t.a===a&&t.b===e}function qo(){return{a:null,b:null}}class Yr{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}}var Ts=function(){if(Se!=null&&Se.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(l,d){if(typeof d!="string"||!Array.isArray(l))return!1;const h=d.toLowerCase();return~l.indexOf(h)?h:!1}function n(l){return t(a,l)}function i(l){return t(e,l)}function r(l,...d){let h=1;for(;h<arguments.length;h++){const _=arguments[h];for(const S in _)l[S]=_[S]}return l}function s(l,d,h){const _=this,S={enumerable:!0};_.hasBeenReset=!1;let U="",ee=!1,X=l,ae=d,ce=h,Re=null,$e="",Ue=!0,rt="auto",Ge="start",xt=50,it="middle",kt=50,Yt="middle";Object.defineProperty(_,"id",r({},S,{get:function(){return U},set:function(mt){U=""+mt}})),Object.defineProperty(_,"pauseOnExit",r({},S,{get:function(){return ee},set:function(mt){ee=!!mt}})),Object.defineProperty(_,"startTime",r({},S,{get:function(){return X},set:function(mt){if(typeof mt!="number")throw new TypeError("Start time must be set to a number.");X=mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"endTime",r({},S,{get:function(){return ae},set:function(mt){if(typeof mt!="number")throw new TypeError("End time must be set to a number.");ae=mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"text",r({},S,{get:function(){return ce},set:function(mt){ce=""+mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"region",r({},S,{get:function(){return Re},set:function(mt){Re=mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"vertical",r({},S,{get:function(){return $e},set:function(mt){const Nt=n(mt);if(Nt===!1)throw new SyntaxError("An invalid or illegal string was specified.");$e=Nt,this.hasBeenReset=!0}})),Object.defineProperty(_,"snapToLines",r({},S,{get:function(){return Ue},set:function(mt){Ue=!!mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"line",r({},S,{get:function(){return rt},set:function(mt){if(typeof mt!="number"&&mt!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");rt=mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"lineAlign",r({},S,{get:function(){return Ge},set:function(mt){const Nt=i(mt);if(!Nt)throw new SyntaxError("An invalid or illegal string was specified.");Ge=Nt,this.hasBeenReset=!0}})),Object.defineProperty(_,"position",r({},S,{get:function(){return xt},set:function(mt){if(mt<0||mt>100)throw new Error("Position must be between 0 and 100.");xt=mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"positionAlign",r({},S,{get:function(){return it},set:function(mt){const Nt=i(mt);if(!Nt)throw new SyntaxError("An invalid or illegal string was specified.");it=Nt,this.hasBeenReset=!0}})),Object.defineProperty(_,"size",r({},S,{get:function(){return kt},set:function(mt){if(mt<0||mt>100)throw new Error("Size must be between 0 and 100.");kt=mt,this.hasBeenReset=!0}})),Object.defineProperty(_,"align",r({},S,{get:function(){return Yt},set:function(mt){const Nt=i(mt);if(!Nt)throw new SyntaxError("An invalid or illegal string was specified.");Yt=Nt,this.hasBeenReset=!0}})),_.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class el{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Ea(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 tl{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 ba(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 l=s[0],d=s[1];e(l,d)}}const Rs=new Ts(0,0,""),Xr=Rs.align==="middle"?"middle":"center";function nl(a,e,t){const n=a;function i(){const l=Ea(a);if(l===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),l}function r(l,d){const h=new tl;ba(l,function(U,ee){let X;switch(U){case"region":for(let ae=t.length-1;ae>=0;ae--)if(t[ae].id===ee){h.set(U,t[ae].region);break}break;case"vertical":h.alt(U,ee,["rl","lr"]);break;case"line":X=ee.split(","),h.integer(U,X[0]),h.percent(U,X[0])&&h.set("snapToLines",!1),h.alt(U,X[0],["auto"]),X.length===2&&h.alt("lineAlign",X[1],["start",Xr,"end"]);break;case"position":X=ee.split(","),h.percent(U,X[0]),X.length===2&&h.alt("positionAlign",X[1],["start",Xr,"end","line-left","line-right","auto"]);break;case"size":h.percent(U,ee);break;case"align":h.alt(U,ee,["start",Xr,"end","left","right"]);break}},/:/,/\s/),d.region=h.get("region",null),d.vertical=h.get("vertical","");let _=h.get("line","auto");_==="auto"&&Rs.line===-1&&(_=-1),d.line=_,d.lineAlign=h.get("lineAlign","start"),d.snapToLines=h.get("snapToLines",!0),d.size=h.get("size",100),d.align=h.get("align",Xr);let S=h.get("position","auto");S==="auto"&&Rs.position===50&&(S=d.align==="start"||d.align==="left"?0:d.align==="end"||d.align==="right"?100:50),d.position=S}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 xa(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}class il{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new el,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=xa(r);s<r.length&&r[s]!=="\r"&&r[s]!==`
|
|
`;)++s;const l=r.slice(0,s);return r[s]==="\r"&&++s,r[s]===`
|
|
`&&++s,t.buffer=r.slice(s),l}function i(r){ba(r,function(s,l){},/:/)}try{let r="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;r=n();const l=r.match(/^()?WEBVTT([ \t].*)?$/);if(!(l!=null&&l[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let s=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(s?s=!1: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 Ts(0,0,""),t.state="CUE",r.indexOf("-->")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{nl(r,t.cue,t.regionList)}catch(l){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const l=r.indexOf("-->")!==-1;if(!r||l&&(s=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
|
`),t.cue.text+=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 rl=/\r\n|\n\r|\n|\r/g,As=function(e,t,n=0){return e.slice(n,n+t.length)===t},sl=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(!K(t)||!K(n)||!K(i)||!K(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*i,t+=60*60*1e3*r,t},Ls=function(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0).toString()};function Cs(a,e,t){return Ls(a.toString())+Ls(e.toString())+Ls(t)}const al=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 ol(a,e,t,n,i,r,s){const l=new il,d=Ne(new Uint8Array(a)).trim().replace(rl,`
|
|
`).split(`
|
|
`),h=[],_=e?wo(e.baseTime,e.timescale):0;let S="00:00.000",U=0,ee=0,X,ae=!0;l.oncue=function(ce){const Re=t[n];let $e=t.ccOffset;const Ue=(U-_)/9e4;if(Re!=null&&Re.new&&(ee!==void 0?$e=t.ccOffset=Re.start:al(t,n,Ue)),Ue){if(!e){X=new Error("Missing initPTS for VTT MPEGTS");return}$e=Ue-t.presentationOffset}const rt=ce.endTime-ce.startTime,Ge=$i((ce.startTime+$e-ee)*9e4,i*9e4)/9e4;ce.startTime=Math.max(Ge,0),ce.endTime=Math.max(Ge+rt,0);const xt=ce.text.trim();ce.text=decodeURIComponent(encodeURIComponent(xt)),ce.id||(ce.id=Cs(ce.startTime,ce.endTime,xt)),ce.endTime>0&&h.push(ce)},l.onparsingerror=function(ce){X=ce},l.onflush=function(){if(X){s(X);return}r(h)},d.forEach(ce=>{if(ae)if(As(ce,"X-TIMESTAMP-MAP=")){ae=!1,ce.slice(16).split(",").forEach(Re=>{As(Re,"LOCAL:")?S=Re.slice(6):As(Re,"MPEGTS:")&&(U=parseInt(Re.slice(7)))});try{ee=sl(S)/1e3}catch(Re){X=Re}return}else ce===""&&(ae=!1);l.parse(ce+`
|
|
`)}),l.flush()}const Is="stpp.ttml.im1t",Sa=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,wa=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,ll={left:"start",center:"center",right:"end",start:"start",end:"end"};function Ta(a,e,t,n){const i=ht(new Uint8Array(a),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(l=>Ne(l)),s=So(e.baseTime,1,e.timescale);try{r.forEach(l=>t(ul(l,s)))}catch(l){n(l)}}function ul(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((S,U)=>(S[U]=i.getAttribute(`ttp:${U}`)||r[U],S),{}),l=i.getAttribute("xml:space")!=="preserve",d=Ra(Ds(i,"styling","style")),h=Ra(Ds(i,"layout","region")),_=Ds(i,"body","[begin]");return[].map.call(_,S=>{const U=Aa(S,l);if(!U||!S.hasAttribute("begin"))return null;const ee=ks(S.getAttribute("begin"),s),X=ks(S.getAttribute("dur"),s);let ae=ks(S.getAttribute("end"),s);if(ee===null)throw La(S);if(ae===null){if(X===null)throw La(S);ae=ee+X}const ce=new Ts(ee-e,ae-e,U);ce.id=Cs(ce.startTime,ce.endTime,ce.text);const Re=h[S.getAttribute("region")],$e=d[S.getAttribute("style")],Ue=cl(Re,$e,d),{textAlign:rt}=Ue;if(rt){const Ge=ll[rt];Ge&&(ce.lineAlign=Ge),ce.align=rt}return o(ce,Ue),ce}).filter(S=>S!==null)}function Ds(a,e,t){const n=a.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Ra(a){return a.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function Aa(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?Aa(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function cl(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((l,d)=>{const h=Os(e,n,d)||Os(a,n,d)||Os(i,n,d);return h&&(l[d]=h),l},{})}function Os(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function La(a){return new Error(`Could not parse ttml timestamp ${a}`)}function ks(a,e){if(!a)return null;let t=Ea(a);return t===null&&(Sa.test(a)?t=dl(a,e):wa.test(a)&&(t=hl(a,e))),t}function dl(a,e){const t=Sa.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 hl(a,e){const t=wa.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 fl{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=Da(),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(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(u.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(u.FRAG_LOADING,this.onFragLoading,this),e.on(u.FRAG_LOADED,this.onFragLoaded,this),e.on(u.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(u.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(u.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(u.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(u.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(u.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(u.FRAG_LOADING,this.onFragLoading,this),e.off(u.FRAG_LOADED,this.onFragLoaded,this),e.off(u.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(u.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(u.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(u.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(u.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new Yr(this,"textTrack1"),t=new Yr(this,"textTrack2"),n=new Yr(this,"textTrack3"),i=new Yr(this,"textTrack4");this.cea608Parser1=new ya(1,e,t),this.cea608Parser2=new ya(3,n,i)}}addCues(e,t,n,i,r){let s=!1;for(let l=r.length;l--;){const d=r[l],h=pl(d[0],d[1],t,n);if(h>=0&&(d[0]=Math.min(d[0],t),d[1]=Math.max(d[1],n),s=!0,h/(n-t)>.5))return}if(s||r.push([t,n]),this.config.renderTextTracksNatively){const l=this.captionsTracks[e];this.Cues.newCue(l,t,n,i)}else{const l=this.Cues.newCue(null,t,n,i);this.hls.trigger(u.CUES_PARSED,{type:"captions",cues:l,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:i,timescale:r}){const{unparsedVttFrags:s}=this;n==="main"&&(this.initPTS[t.cc]={baseTime:i,timescale:r}),s.length&&(this.unparsedVttFrags=[],s.forEach(l=>{this.onFragLoaded(u.FRAG_LOADED,l)}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let i=0;i<n.textTracks.length;i++){const r=n.textTracks[i];if(Ia(r,{name:e,lang:t,attrs:{}}))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],l=this.getExistingTrack(r,s);if(l)n[e]=l,Jn(n[e]),Yn(n[e],i);else{const d=this.createTextTrack("captions",r,s);d&&(d[e]=!0,n[e]=d)}}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(u.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,this._cleanTracks()}onMediaDetaching(){const{captionsTracks:e}=this;Object.keys(e).forEach(t=>{Jn(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Da(),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++)Jn(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],i=n.some(r=>r.textCodec===Is);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(ha(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,l=s?Bt(s.textTracks):null;if(this.tracks.forEach((d,h)=>{let _;if(l){let S=null;for(let U=0;U<l.length;U++)if(l[U]&&Ia(l[U],d)){S=l[U],l[U]=null;break}S&&(_=S)}if(_)Jn(_);else{const S=Ca(d);_=this.createTextTrack(S,d.name,d.lang),_&&(_.mode="disabled")}_&&this.textTracks.push(_)}),l!=null&&l.length){const d=l.filter(h=>h!==null).map(h=>h.label);d.length&&E.warn(`Media element contains unused subtitle tracks: ${d.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const s=this.tracks.map(l=>({label:l.name,kind:l.type.toLowerCase(),default:l.default,subtitleTrack:l}));this.hls.trigger(u.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===$t.MAIN){var n,i;const{cea608Parser1:r,cea608Parser2:s,lastSn:l}=this,{cc:d,sn:h}=t.frag,_=(n=(i=t.part)==null?void 0:i.index)!=null?n:-1;r&&s&&(h!==l+1||h===l&&_!==this.lastPartIndex+1||d!==this.lastCc)&&(r.reset(),s.reset()),this.lastCc=d,this.lastSn=h,this.lastPartIndex=_}}onFragLoaded(e,t){const{frag:n,payload:i}=t;if(n.type===$t.SUBTITLE)if(i.byteLength){const r=n.decryptdata,s="stats"in t;if(r==null||!r.encrypted||s){const l=this.tracks[n.level],d=this.vttCCs;d[n.cc]||(d[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),l&&l.textCodec===Is?this._parseIMSC1(n,i):this._parseVTTs(t)}}else this.hls.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;Ta(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),n.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{E.log(`Failed to parse IMSC1: ${i}`),n.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:n,payload:i}=e,{initPTS:r,unparsedVttFrags:s}=this,l=r.length-1;if(!r[n.cc]&&l===-1){s.push(e);return}const d=this.hls,h=(t=n.initSegment)!=null&&t.data?c(n.initSegment.data,new Uint8Array(i)):i;ol(h,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,_=>{this._appendCues(_,n.level),d.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},_=>{const S=_.message==="Missing initPTS for VTT MPEGTS";S?s.push(e):this._fallbackToIMSC1(n,i),E.log(`Failed to parse VTT cue: ${_}`),!(S&&l>n.cc)&&d.trigger(u.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:_})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||Ta(t,this.initPTS[e.cc],()=>{n.textCodec=Is,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=>ti(i,r))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;n.trigger(u.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===$t.SUBTITLE&&this.onFragLoaded(u.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:n,cea608Parser2:i}=this;if(!this.enabled||!n||!i)return;const{frag:r,samples:s}=t;if(!(r.type===$t.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let l=0;l<s.length;l++){const d=s[l].bytes;if(d){const h=this.extractCea608Data(d);n.addData(s[l].pts,h[0]),i.addData(s[l].pts,h[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:l}=this;Object.keys(l).forEach(d=>jn(l[d],t,n))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:l}=this;Object.keys(l).forEach(d=>jn(l[d],t,i))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let i=2;for(let r=0;r<n;r++){const s=e[i++],l=127&e[i++],d=127&e[i++];if(l===0&&d===0)continue;if((4&s)!==0){const _=3&s;(_===0||_===1)&&(t[_].push(l),t[_].push(d))}}return t}}function Ca(a){return a.characteristics&&/transcribes-spoken-dialog/gi.test(a.characteristics)&&/describes-music-and-sound/gi.test(a.characteristics)?"captions":"subtitles"}function Ia(a,e){return!!a&&a.kind===Ca(e)&&Ss(e,a)}function pl(a,e,t,n){return Math.min(e,n)-Math.max(a,t)}function Da(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}class Ps{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(u.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(u.BUFFER_CODECS,this.onBufferCodecs,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(u.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(u.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(u.BUFFER_CODECS,this.onBufferCodecs,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&K(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}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&&E.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,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,Ps.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 e}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=(l,d)=>d?l.width!==d.width||l.height!==d.height:!0;let r=e.length-1;const s=Math.max(t,n);for(let l=0;l<e.length;l+=1){const d=e[l];if((d.width>=s||d.height>=s)&&i(d,e[l+1])){r=l;break}}return r}}class ml{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(u.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(u.MEDIA_ATTACHING,this.onMediaAttaching,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)}}checkFPS(e,t,n){const i=performance.now();if(t){if(this.lastTime){const r=i-this.lastTime,s=n-this.lastDroppedFrames,l=t-this.lastDecodedFrames,d=1e3*s/r,h=this.hls;if(h.trigger(u.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:n}),d>0&&s>h.config.fpsDroppedMonitoringThreshold*l){let _=h.currentLevel;E.warn("drop FPS ratio greater than max allowed value for currentLevel: "+_),_>0&&(h.autoLevelCapping===-1||h.autoLevelCapping>=_)&&(_=_-1,h.trigger(u.FPS_DROP_LEVEL_CAPPING,{level:_,droppedLevel:h.currentLevel}),h.autoLevelCapping=_,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)}}const Qr="[eme]";class Rr{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=Rr.CDMCleanupPromise?[Rr.CDMCleanupPromise]:[],this.debug=E.debug.bind(E,Qr),this.log=E.log.bind(E,Qr),this.warn=E.warn.bind(E,Qr),this.error=E.error.bind(E,Qr),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=dt(this.config));const l=s.map(Tt).filter(d=>!!d);this.keyFormatPromise=this.getKeyFormatPromise(l)}this.keyFormatPromise.then(s=>{const l=qe(s);let d,h;if(n==="sinf"){if(l!==Te.FAIRPLAY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const X=st(new Uint8Array(i));try{const ae=y(JSON.parse(X).sinf),ce=ln(ae);if(!ce)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");d=ce.subarray(8,24),h=Te.FAIRPLAY}catch(ae){this.warn(`${r} Failed to parse sinf: ${ae}`);return}}else{if(l!==Te.WIDEVINE&&l!==Te.PLAYREADY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${l}`);return}const X=at(i),ae=X.filter(Re=>!!Re.systemId&&We(Re.systemId)===l);ae.length>1&&this.warn(`${r} Using first of ${ae.length} pssh found for selected key-system ${l}`);const ce=ae[0];if(!ce){X.length===0||X.some(Re=>!Re.systemId)?this.warn(`${r} contains incomplete or invalid pssh data`):this.log(`ignoring ${r} for ${X.map(Re=>We(Re.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(h=We(ce.systemId),ce.version===0&&ce.data)if(h===Te.WIDEVINE){const Re=ce.data.length-22;d=ce.data.subarray(Re,Re+16)}else h===Te.PLAYREADY&&(d=Pe(ce.data))}if(!h||!d){this.log(`Unable to handle ${r} with key-system ${l}`);return}const _=Ke.hexDump(d),{keyIdToKeySessionPromise:S,mediaKeySessions:U}=this;let ee=S[_];for(let X=0;X<U.length;X++){const ae=U[X],ce=ae.decryptdata;if(!ce.keyId)continue;const Re=Ke.hexDump(ce.keyId);if(_===Re||ce.uri.replace(/-/g,"").indexOf(_)!==-1){if(ee=S[Re],ce.pssh)break;delete S[Re],ce.pssh=new Uint8Array(i),ce.keyId=d,ee=S[_]=ee.then(()=>this.generateRequestWithPreferredKeySession(ae,n,i,"encrypted-event-key-match")),ee.catch($e=>this.handleError($e));break}}if(!ee){if(h!==l){this.log(`Ignoring "${r}" with ${h} init data for selected key-system ${l}`);return}ee=S[_]=this.getKeySystemSelectionPromise([h]).then(({keySystem:X,mediaKeys:ae})=>{var ce;this.throwIfDestroyed();const Re=new ot("ISO-23001-7",_,(ce=Tt(X))!=null?ce:"");return Re.pssh=new Uint8Array(i),Re.keyId=d,this.attemptSetMediaKeys(X,ae).then(()=>{this.throwIfDestroyed();const $e=this.createMediaKeySessionContext({decryptdata:Re,keySystem:X,mediaKeys:ae});return this.generateRequestWithPreferredKeySession($e,n,i,"encrypted-event-no-match")})}),ee.catch(X=>this.handleError(X))}})}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),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(u.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(u.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(u.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(u.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(u.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(u.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(u.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===Te.WIDEVINE&&n)return n}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(t===void 0)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(s,l,d)=>!!s&&d.indexOf(s)===l,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,l)=>{const d=h=>{const _=h.shift();this.getMediaKeysPromise(_,i,r).then(S=>s({keySystem:_,mediaKeys:S})).catch(S=>{h.length?d(h):S instanceof Ki?l(S):l(new Ki({type:g.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_ACCESS,error:S,fatal:!0},S.message))})};d(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return wt===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){const i=Rt(e,t,n,this.config.drmSystemOptions),r=this.keySystemAccessPromises[e];let s=r==null?void 0:r.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(i)}`),s=this.requestMediaKeySystemAccess(e,i);const l=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch(d=>{this.log(`Failed to obtain access to key-system "${e}": ${d}`)}),s.then(d=>{this.log(`Access for key-system "${d.keySystem}" obtained`);const h=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),l.mediaKeys=d.createMediaKeys().then(_=>(this.log(`Media-keys created for "${e}"`),h.then(S=>S?this.setMediaKeysServerCertificate(_,e,S):_))),l.mediaKeys.catch(_=>{this.error(`Failed to create media-keys for "${e}"}: ${_}`)}),l.mediaKeys})}return s.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${Ke.hexDump(e.keyId||[])}`);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=this.getKeyIdString(t),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(n,r,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Ke.hexDump(e.keyId)}updateKeySession(e,t){var n;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${Ke.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])}
|
|
} (data length: ${t&&t.byteLength})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,n)=>{const i=dt(this.config),r=e.map(qe).filter(s=>!!s&&i.indexOf(s)!==-1);return this.getKeySystemSelectionPromise(r).then(({keySystem:s})=>{const l=Tt(s);l?t(l):n(new Error(`Unable to find format for key-system "${s}"`))}).catch(n)})}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),i=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let r=this.keyIdToKeySessionPromise[n];return r||(r=this.keyIdToKeySessionPromise[n]=this.getKeySystemForKeyPromise(t).then(({keySystem:s,mediaKeys:l})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(s,l).then(()=>{this.throwIfDestroyed();const d=this.createMediaKeySessionContext({keySystem:s,mediaKeys:l,decryptdata:t});return this.generateRequestWithPreferredKeySession(d,"cenc",t.pssh,"playlist-key")}))),r.catch(s=>this.handleError(s))),r}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof Ki?this.hls.trigger(u.ERROR,e.data):this.hls.trigger(u.ERROR,{type:g.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const i=qe(e.keyFormat),r=i?[i]:dt(this.config);return this.attemptKeySystemAccess(r)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=dt(this.config)),e.length===0)throw new Ki({type:g.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(n).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>n.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(e,t,n,i){var r,s;const l=(r=this.config.drmSystems)==null||(s=r[e.keySystem])==null?void 0:s.generateRequest;if(l)try{const X=l.call(this.hls,t,n,e);if(!X)throw new Error("Invalid response from configured generateRequest filter");t=X.initDataType,n=e.decryptdata.pssh=X.initData?new Uint8Array(X.initData):null}catch(X){var d;if(this.warn(X.message),(d=this.hls)!=null&&d.config.debug)throw X}if(n===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const h=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${h} (init data type: ${t} length: ${n?n.byteLength:null})`);const _=new xs,S=e._onmessage=X=>{const ae=e.mediaKeysSession;if(!ae){_.emit("error",new Error("invalid state"));return}const{messageType:ce,message:Re}=X;this.log(`"${ce}" message event for session "${ae.sessionId}" message size: ${Re.byteLength}`),ce==="license-request"||ce==="license-renewal"?this.renewLicense(e,Re).catch($e=>{this.handleError($e),_.emit("error",$e)}):ce==="license-release"?e.keySystem===Te.FAIRPLAY&&(this.updateKeySession(e,me("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${ce}"`)},U=e._onkeystatuseschange=X=>{if(!e.mediaKeysSession){_.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const ce=e.keyStatus;_.emit("keyStatus",ce),ce==="expired"&&(this.warn(`${e.keySystem} expired for key ${h}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",S),e.mediaKeysSession.addEventListener("keystatuseschange",U);const ee=new Promise((X,ae)=>{_.on("error",ae),_.on("keyStatus",ce=>{ce.startsWith("usable")?X():ce==="output-restricted"?ae(new Ki({type:g.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):ce==="internal-error"?ae(new Ki({type:g.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${ce}"`)):ce==="expired"?ae(new Error("key expired while generating request")):this.warn(`unhandled key status change "${ce}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var X;this.log(`Request generated for key-session "${(X=e.mediaKeysSession)==null?void 0:X.sessionId}" keyId: ${h}`)}).catch(X=>{throw new Ki({type:g.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_NO_SESSION,error:X,fatal:!1},`Error generating key-session request: ${X}`)}).then(()=>ee).catch(X=>{throw _.removeAllListeners(),this.removeSession(e),X}).then(()=>(_.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${Ke.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${Ke.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=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,l)=>{const d={responseType:"arraybuffer",url:r},h=t.certLoadPolicy.default,_={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},S={onSuccess:(U,ee,X,ae)=>{s(U.data)},onError:(U,ee,X,ae)=>{l(new Ki({type:g.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:X,response:oe({url:d.url,data:void 0},U)},`"${e}" certificate request failed (${r}). Status: ${U.code} (${U.text})`))},onTimeout:(U,ee,X)=>{l(new Ki({type:g.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:X,response:{url:d.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(U,ee,X)=>{l(new Error("aborted"))}};i.load(d,_,S)})):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==null?void 0:n.byteLength}) on "${t}"`),i(e)}).catch(s=>{r(new Ki({type:g.KEY_SYSTEM_ERROR,details:m.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 Ki({type:g.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},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 _;for(let S=0,U=r.length;S<U;S++){var s,l;_=r[S];const ee=(s=_.querySelector("name"))==null?void 0:s.textContent,X=(l=_.querySelector("value"))==null?void 0:l.textContent;ee&&X&&e.setRequestHeader(ee,X)}}const d=i.querySelector("Challenge"),h=d==null?void 0:d.textContent;if(!h)throw new Error("Cannot find <Challenge> in key message");return me(atob(h))}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 l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(l.readyState===4)if(l.status===200){this._requestLicenseFailureCount=0;let d=l.response;this.log(`License received ${d instanceof ArrayBuffer?d.byteLength:d}`);const h=this.config.licenseResponseCallback;if(h)try{d=h.call(this.hls,l,s,e)}catch(_){this.error(_)}i(d)}else{const d=n.errorRetry,h=d?d.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>h||l.status>=400&&l.status<500)r(new Ki({type:g.KEY_SYSTEM_ERROR,details:m.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:l,response:{url:s,data:void 0,code:l.status,text:l.statusText}},`License Request XHR failed (${s}). Status: ${l.status} (${l.statusText})`));else{const _=h-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${_} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,s,e,t).then(({xhr:d,licenseChallenge:h})=>{e.keySystem==Te.PLAYREADY&&(h=this.unpackPlayReadyKeyMessage(d,h)),d.send(h)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,n.removeEventListener("encrypted",this.onMediaEncrypted),n.removeEventListener("waitingforkey",this.onWaitingForKey),n.addEventListener("encrypted",this.onMediaEncrypted),n.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},ot.clearKeyUriToKeyIdMap();const n=t.length;Rr.CDMCleanupPromise=Promise.all(t.map(i=>this.removeSession(i)).concat(e==null?void 0:e.setMediaKeys(null).catch(i=>{this.log(`Could not clear media keys: ${i}`)}))).then(()=>{n&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(i=>{this.log(`Could not close sessions and clear media keys: ${i}`)})}onManifestLoading(){this.keyFormatPromise=null}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}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),t.remove().catch(r=>{this.log(`Could not remove session: ${r}`)}).then(()=>t.close()).catch(r=>{this.log(`Could not close session: ${r}`)})}}}Rr.CDMCleanupPromise=void 0;class Ki 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}}var Ri;(function(a){a.MANIFEST="m",a.AUDIO="a",a.VIDEO="v",a.MUXED="av",a.INIT="i",a.CAPTION="c",a.TIMED_TEXT="tt",a.KEY="k",a.OTHER="o"})(Ri||(Ri={}));var Ns;(function(a){a.DASH="d",a.HLS="h",a.SMOOTH="s",a.OTHER="o"})(Ns||(Ns={}));var gr;(function(a){a.OBJECT="CMCD-Object",a.REQUEST="CMCD-Request",a.SESSION="CMCD-Session",a.STATUS="CMCD-Status"})(gr||(gr={}));const gl={[gr.OBJECT]:["br","d","ot","tb"],[gr.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[gr.SESSION]:["cid","pr","sf","sid","st","v"],[gr.STATUS]:["bs","rtp"]};class Ar{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(n=>n instanceof Ar?n:new Ar(n))),this.value=e,this.params=t}}class Oa{constructor(e){this.description=void 0,this.description=e}}const _l="Dict";function vl(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 yl(a,e,t,n){return new Error(`failed to ${a} "${vl(e)}" as ${t}`,{cause:n})}const ka="Bare Item",El="Boolean",bl="Byte Sequence",xl="Decimal",Sl="Integer";function wl(a){return a<-999999999999999||999999999999999<a}const Tl=/[\x00-\x1f\x7f]+/,Rl="Token",Al="Key";function Ji(a,e,t){return yl("serialize",a,e,t)}function Ll(a){if(typeof a!="boolean")throw Ji(a,El);return a?"?1":"?0"}function Cl(a){return btoa(String.fromCharCode(...a))}function Il(a){if(ArrayBuffer.isView(a)===!1)throw Ji(a,bl);return`:${Cl(a)}:`}function Pa(a){if(wl(a))throw Ji(a,Sl);return a.toString()}function Dl(a){return`@${Pa(a.getTime()/1e3)}`}function Na(a,e){if(a<0)return-Na(-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}function Ol(a){const e=Na(a,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Ji(a,xl);const t=e.toString();return t.includes(".")?t:`${t}.0`}const kl="String";function Pl(a){if(Tl.test(a))throw Ji(a,kl);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Nl(a){return a.description||a.toString().slice(7,-1)}function Ma(a){const e=Nl(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Ji(e,Rl);return e}function Ms(a){switch(typeof a){case"number":if(!K(a))throw Ji(a,ka);return Number.isInteger(a)?Pa(a):Ol(a);case"string":return Pl(a);case"symbol":return Ma(a);case"boolean":return Ll(a);case"object":if(a instanceof Date)return Dl(a);if(a instanceof Uint8Array)return Il(a);if(a instanceof Oa)return Ma(a);default:throw Ji(a,ka)}}function Fs(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Ji(a,Al);return a}function Bs(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${Fs(e)}`:`;${Fs(e)}=${Ms(t)}`).join("")}function Fa(a){return a instanceof Ar?`${Ms(a.value)}${Bs(a.params)}`:Ms(a)}function Ml(a){return`(${a.value.map(Fa).join(" ")})${Bs(a.params)}`}function Fl(a,e={whitespace:!0}){if(typeof a!="object")throw Ji(a,_l);const t=a instanceof Map?a.entries():Object.entries(a),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof Ar||(r=new Ar(r));let s=Fs(i);return r.value===!0?s+=Bs(r.params):(s+="=",Array.isArray(r.value)?s+=Ml(r):s+=Fa(r)),s}).join(`,${n}`)}function Bl(a,e){return Fl(a,e)}const Ul=a=>a==="ot"||a==="sf"||a==="st",$l=a=>typeof a=="number"?K(a):a!=null&&a!==""&&a!==!1;function Kl(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("/")}function Gl(){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)})}}}const Jr=a=>Math.round(a),jl=(a,e)=>(e!=null&&e.baseUrl&&(a=Kl(a,e.baseUrl)),encodeURIComponent(a)),qr=a=>Jr(a/100)*100,Hl={br:Jr,d:Jr,bl:qr,dl:qr,mtp:qr,nor:jl,rtp:qr,tb:Jr};function zl(a,e){const t={};if(a==null||typeof a!="object")return t;const n=Object.keys(a).sort(),i=o({},Hl,e==null?void 0:e.formatters),r=e==null?void 0:e.filter;return n.forEach(s=>{if(r!=null&&r(s))return;let l=a[s];const d=i[s];d&&(l=d(l,e)),!(s==="v"&&l===1)&&(s=="pr"&&l===1||$l(l)&&(Ul(s)&&typeof l=="string"&&(l=new Oa(l)),t[s]=l))}),t}function Ba(a,e={}){return a?Bl(zl(a,e),o({whitespace:!1},e)):""}function Vl(a,e={}){if(!a)return{};const t=Object.entries(a),n=Object.entries(gl).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=t.reduce((r,s)=>{var l,d;const[h,_]=s,S=((l=n.find(U=>U[1].includes(h)))==null?void 0:l[0])||gr.REQUEST;return(d=r[S])!=null||(r[S]={}),r[S][h]=_,r},{});return Object.entries(i).reduce((r,[s,l])=>(r[s]=Ba(l,e),r),{})}function Wl(a,e,t){return o(a,Vl(e,t))}const Zl="CMCD";function Yl(a,e={}){if(!a)return"";const t=Ba(a,e);return`${Zl}=${encodeURIComponent(t)}`}const Ua=/CMCD=[^&#]+/;function Xl(a,e,t){const n=Yl(e,t);if(!n)return a;if(Ua.test(a))return a.replace(Ua,n);const i=a.includes("?")?"&":"?";return`${a}${i}${n}`}class Ql{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:Ri.MANIFEST,su:!this.initialized})}catch(r){E.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const r=i.frag,s=this.hls.levels[r.level],l=this.getObjectType(r),d={d:r.duration*1e3,ot:l};(l===Ri.VIDEO||l===Ri.AUDIO||l==Ri.MUXED)&&(d.br=s.bitrate/1e3,d.tb=this.getTopBandwidth(l)/1e3,d.bl=this.getBufferLength(l)),this.apply(i,d)}catch(r){E.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||Gl(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHED,this.onMediaDetached,this),e.on(u.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHED,this.onMediaDetached,this),e.off(u.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=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:Ns.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){o(t,this.createData());const n=t.ot===Ri.INIT||t.ot===Ri.VIDEO||t.ot===Ri.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((r,s)=>(i.includes(s)&&(r[s]=t[s]),r),{})),this.useHeaders?(e.headers||(e.headers={}),Wl(e.headers,t)):e.url=Xl(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Ri.TIMED_TEXT;if(e.sn==="initSegment")return Ri.INIT;if(t==="audio")return Ri.AUDIO;if(t==="main")return this.hls.audioTracks.length?Ri.VIDEO:Ri.MUXED}getTopBandwidth(e){let t=0,n;const i=this.hls;if(e===Ri.AUDIO)n=i.audioTracks;else{const r=i.maxAutoLevel,s=r>-1?r+1:i.levels.length;n=i.levels.slice(0,s)}for(const r of n)r.bitrate>t&&(t=r.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,n=e===Ri.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:Hn.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,l){t(r),this.loader.load(r,s,l)}}}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,l){t(r),this.loader.load(r,s,l)}}}}const Jl=3e5;class ql{constructor(e){this.hls=void 0,this.log=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.log=E.log.bind(E,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.ERROR,this.onError,this))}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)===en.SendAlternateToPenaltyBox&&n.flags===In.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this.pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:l,pathwayId:d,type:h}=t.context;l&&i?s=this.getPathwayForGroupId(l,h,s):d&&(s=d)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!r&&i&&(r=i.reduce((l,d)=>(l.indexOf(d.pathwayId)===-1&&l.push(d.pathwayId),l),[])),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==s),n.resolved||E.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${i&&i.length} priorities: ${JSON.stringify(r)} penalized: ${JSON.stringify(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]>Jl&&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 l=this.hls.nextLoadLevel,d=this.hls.levels[l];if(t=this.getLevelsForPathway(s),t.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,ai(t),this.hls.trigger(u.LEVELS_UPDATED,{levels:t});const h=this.hls.levels[l];d&&h&&this.levels&&(h.attrs["STABLE-VARIANT-ID"]!==d.attrs["STABLE-VARIANT-ID"]&&h.bitrate!==d.bitrate&&this.log(`Unstable Pathways change from bitrate ${d.bitrate} to ${h.bitrate}`),this.hls.nextLoadLevel=l);break}}}getPathwayForGroupId(e,t,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let r=0;r<i.length;r++)if(t===hn.AUDIO_TRACK&&i[r].hasAudioGroup(e)||t===hn.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":l,"URI-REPLACEMENT":d}=r;if(t.some(_=>_.pathwayId===s))return;const h=this.getLevelsForPathway(l).map(_=>{const S=new ie(_.attrs);S["PATHWAY-ID"]=s;const U=S.AUDIO&&`${S.AUDIO}_clone_${s}`,ee=S.SUBTITLES&&`${S.SUBTITLES}_clone_${s}`;U&&(n[S.AUDIO]=U,S.AUDIO=U),ee&&(i[S.SUBTITLES]=ee,S.SUBTITLES=ee);const X=Ka(_.uri,S["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",d),ae=new pi({attrs:S,audioCodec:_.audioCodec,bitrate:_.bitrate,height:_.height,name:_.name,url:X,videoCodec:_.videoCodec,width:_.width});if(_.audioGroups)for(let ce=1;ce<_.audioGroups.length;ce++)ae.addGroupId("audio",`${_.audioGroups[ce]}_clone_${s}`);if(_.subtitleGroups)for(let ce=1;ce<_.subtitleGroups.length;ce++)ae.addGroupId("text",`${_.subtitleGroups[ce]}_clone_${s}`);return ae});t.push(...h),$a(this.audioTracks,n,d,s),$a(this.subtitleTracks,i,d,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(_){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(i.protocol!=="data:"){const _=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+_)}const r={responseType:"json",url:i.href},s=t.steeringManifestLoadPolicy.default,l=s.errorRetry||s.timeoutRetry||{},d={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},h={onSuccess:(_,S,U,ee)=>{this.log(`Loaded steering manifest: "${i}"`);const X=_.data;if(X.VERSION!==1){this.log(`Steering VERSION ${X.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=X.TTL;const{"RELOAD-URI":ae,"PATHWAY-CLONES":ce,"PATHWAY-PRIORITY":Re}=X;if(ae)try{this.uri=new self.URL(ae,i).href}catch(Ue){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${ae}`);return}this.scheduleRefresh(this.uri||U.url),ce&&this.clonePathways(ce);const $e={steeringManifest:X,url:i.toString()};this.hls.trigger(u.STEERING_MANIFEST_LOADED,$e),Re&&this.updatePathwayPriority(Re)},onError:(_,S,U,ee)=>{if(this.log(`Error loading steering manifest: ${_.code} ${_.text} (${S.url})`),this.stopLoad(),_.code===410){this.enabled=!1,this.log(`Steering manifest ${S.url} no longer available`);return}let X=this.timeToLoad*1e3;if(_.code===429){const ae=this.loader;if(typeof(ae==null?void 0:ae.getResponseHeader)=="function"){const ce=ae.getResponseHeader("Retry-After");ce&&(X=parseFloat(ce)*1e3)}this.log(`Steering manifest ${S.url} rate limited`);return}this.scheduleRefresh(this.uri||S.url,X)},onTimeout:(_,S,U)=>{this.log(`Timeout loading steering manifest (${S.url})`),this.scheduleRefresh(this.uri||S.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,d,h)}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 $a(a,e,t,n){a&&Object.keys(e).forEach(i=>{const r=a.filter(s=>s.groupId===i).map(s=>{const l=o({},s);return l.details=void 0,l.attrs=new ie(l.attrs),l.url=l.attrs.URI=Ka(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),l.groupId=l.attrs["GROUP-ID"]=e[i],l.attrs["PATHWAY-ID"]=n,l});a.push(...r)})}function Ka(a,e,t,n){const{HOST:i,PARAMS:r,[t]:s}=n;let l;e&&(l=s==null?void 0:s[e],l&&(a=l));const d=new self.URL(a);return i&&!l&&(d.host=i),r&&Object.keys(r).sort().forEach(h=>{h&&d.searchParams.set(h,r[h])}),d.href}const eu=/^age:\s*[\d.]+\s*$/im;class Ga{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 he,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=>{this.callbacks.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 l in i)e.setRequestHeader(l,i[l]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=r&&K(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 s=t.status,l=t.responseType==="text"?t.responseText:null;if(s>=200&&s<300){const S=l!=null?l:t.response;if(S!=null){n.loading.end=Math.max(self.performance.now(),n.loading.first);const U=t.responseType==="arraybuffer"?S.byteLength:S.length;if(n.loaded=n.total=U,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first),!this.callbacks)return;const ee=this.callbacks.onProgress;if(ee&&ee(n,e,S,t),!this.callbacks)return;const X={url:t.responseURL,data:S,code:s};this.callbacks.onSuccess(X,n,e,t);return}}const d=r.loadPolicy.errorRetry,h=n.retry,_={url:e.url,data:void 0,code:s};si(d,h,!1,_)?this.retry(d):(E.error(`${s} while loading ${e.url}`),this.callbacks.onError({code:s,text:t.statusText},e,t,n))}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(si(e,t,!0))this.retry(e);else{var n;E.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=mi(e,n.retry),n.retry++,E.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&&eu.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}}function tu(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const nu=/(\d+)-(\d+)\/(\d+)/;class ja{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||au,this.controller=new self.AbortController,this.stats=new he}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=iu(e,this.controller.signal),s=n.onProgress,l=e.responseType==="arraybuffer",d=l?"byteLength":"length",{maxTimeToFirstByteMs:h,maxLoadTimeMs:_}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=h&&K(h)?h:_,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(S=>{this.response=this.loader=S;const U=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=_,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(i,e,this.response)},_-(U-i.loading.start)),!S.ok){const{status:ee,statusText:X}=S;throw new ou(X||"fetch, bad network response",ee,S)}return i.loading.first=U,i.total=su(S.headers)||i.total,s&&K(t.highWaterMark)?this.loadProgressively(S,i,e,t.highWaterMark,s):l?S.arrayBuffer():e.responseType==="json"?S.json():S.text()}).then(S=>{const U=this.response;if(!U)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const ee=S[d];ee&&(i.loaded=i.total=ee);const X={url:U.url,data:S,code:U.status};s&&!K(t.highWaterMark)&&s(i,e,S,U),n.onSuccess(X,i,e,U)}).catch(S=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const U=S&&S.code||0,ee=S?S.message:null;n.onError({code:U,text:ee},e,S?S.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 Gs,l=e.body.getReader(),d=()=>l.read().then(h=>{if(h.done)return s.dataLength&&r(t,n,s.flush(),e),Promise.resolve(new ArrayBuffer(0));const _=h.value,S=_.length;return t.loaded+=S,S<i||s.dataLength?(s.push(_),s.dataLength>=i&&r(t,n,s.flush(),e)):r(t,n,_,e),d()}).catch(()=>Promise.reject());return d()}}function iu(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(o({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function ru(a){const e=nu.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function su(a){const e=a.get("Content-Range");if(e){const n=ru(e);if(K(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function au(a,e){return new self.Request(a.url,e)}class ou extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const lu=/\s/,uu={newCue(a,e,t,n){const i=[];let r,s,l,d,h;const _=self.VTTCue||self.TextTrackCue;for(let U=0;U<n.rows.length;U++)if(r=n.rows[U],l=!0,d=0,h="",!r.isEmpty()){var S;for(let ae=0;ae<r.chars.length;ae++)lu.test(r.chars[ae].uchar)&&l?d++:(h+=r.chars[ae].uchar,l=!1);r.cueStartTime=e,e===t&&(t+=1e-4),d>=16?d--:d++;const ee=xa(h.trim()),X=Cs(e,t,ee);a!=null&&(S=a.cues)!=null&&S.getCueById(X)||(s=new _(e,t,ee),s.id=X,s.line=U+1,s.align="left",s.position=10+Math.min(80,Math.floor(d*8/32)*10),i.push(s))}return a&&i.length&&(i.sort((U,ee)=>U.line==="auto"||ee.line==="auto"?0:U.line>8&&ee.line>8?ee.line-U.line:U.line-ee.line),i.forEach(U=>ti(a,U))),i}},cu={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Ha=oe(oe({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,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,loader:Ga,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:as,bufferController:Ko,capLevelController:Ps,errorController:qn,fpsController:ml,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:wt,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:cu},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}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},du()),{},{subtitleStreamController:Fo,subtitleTrackController:Uo,timelineController:fl,audioStreamController:No,audioTrackController:Mo,emeController:Rr,cmcdController:Ql,contentSteeringController:ql});function du(){return{cueHandler:uu,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 hu(a,e){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 t=Us(a),n=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return n.forEach(r=>{const s=`${r==="level"?"playlist":r}LoadPolicy`,l=e[s]===void 0,d=[];i.forEach(h=>{const _=`${r}Loading${h}`,S=e[_];if(S!==void 0&&l){d.push(_);const U=t[s].default;switch(e[s]={default:U},h){case"TimeOut":U.maxLoadTimeMs=S,U.maxTimeToFirstByteMs=S;break;case"MaxRetry":U.errorRetry.maxNumRetry=S,U.timeoutRetry.maxNumRetry=S;break;case"RetryDelay":U.errorRetry.retryDelayMs=S,U.timeoutRetry.retryDelayMs=S;break;case"MaxRetryTimeout":U.errorRetry.maxRetryDelayMs=S,U.timeoutRetry.maxRetryDelayMs=S;break}}}),d.length&&E.warn(`hls.js config: "${d.join('", "')}" setting(s) are deprecated, use "${s}": ${JSON.stringify(e[s])}`)}),oe(oe({},t),e)}function Us(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(Us):Object.keys(a).reduce((e,t)=>(e[t]=Us(a[t]),e),{}):a}function fu(a){const e=a.loader;e!==ja&&e!==Ga?(E.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):tu()&&(a.loader=ja,a.progressive=!0,a.enableSoftwareAES=!0,E.log("[config]: Progressive streaming enabled, using FetchLoader"))}let $s;class pu extends Dn{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(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(u.LEVEL_LOADED,this.onLevelLoaded,this),e.on(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this),e.on(u.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(u.LEVEL_LOADED,this.onLevelLoaded,this),e.off(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this),e.off(u.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 l=!1,d=!1,h=!1;t.levels.forEach(_=>{var S,U;const ee=_.attrs;let{audioCodec:X,videoCodec:ae}=_;((S=X)==null?void 0:S.indexOf("mp4a.40.34"))!==-1&&($s||($s=/chrome|firefox/i.test(navigator.userAgent)),$s&&(_.audioCodec=X=void 0)),X&&(_.audioCodec=X=Zt(X,n)),((U=ae)==null?void 0:U.indexOf("avc1"))===0&&(ae=_.videoCodec=rn(ae));const{width:ce,height:Re,unknownCodecs:$e}=_;if(l||(l=!!(ce&&Re)),d||(d=!!ae),h||(h=!!X),$e!=null&&$e.length||X&&!Oe(X,"audio",n)||ae&&!Oe(ae,"video",n))return;const{CODECS:Ue,"FRAME-RATE":rt,"HDCP-LEVEL":Ge,"PATHWAY-ID":xt,RESOLUTION:it,"VIDEO-RANGE":kt}=ee,mt=`${`${xt||"."}-`}${_.bitrate}-${it}-${rt}-${Ue}-${kt}-${Ge}`;if(r[mt])if(r[mt].uri!==_.url&&!_.attrs["PATHWAY-ID"]){const Nt=s[mt]+=1;_.attrs["PATHWAY-ID"]=new Array(Nt+1).join(".");const Sn=new pi(_);r[mt]=Sn,i.push(Sn)}else r[mt].addGroupId("audio",ee.AUDIO),r[mt].addGroupId("text",ee.SUBTITLES);else{const Nt=new pi(_);r[mt]=Nt,s[mt]=1,i.push(Nt)}}),this.filterAndSortMediaOptions(i,t,l,d,h)}filterAndSortMediaOptions(e,t,n,i,r){let s=[],l=[],d=e;if((n||i)&&r&&(d=d.filter(({videoCodec:X,videoRange:ae,width:ce,height:Re})=>(!!X||!!(ce&&Re))&&yi(ae))),d.length===0){Promise.resolve().then(()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const X=new Error("no level with compatible codecs found in manifest");this.hls.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:m.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:X,reason:X.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:X}=this.hls.config;s=t.audioTracks.filter(ae=>!ae.audioCodec||Oe(ae.audioCodec,"audio",X)),za(s)}t.subtitles&&(l=t.subtitles,za(l));const h=d.slice(0);d.sort((X,ae)=>{if(X.attrs["HDCP-LEVEL"]!==ae.attrs["HDCP-LEVEL"])return(X.attrs["HDCP-LEVEL"]||"")>(ae.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&X.height!==ae.height)return X.height-ae.height;if(X.frameRate!==ae.frameRate)return X.frameRate-ae.frameRate;if(X.videoRange!==ae.videoRange)return ni.indexOf(X.videoRange)-ni.indexOf(ae.videoRange);if(X.videoCodec!==ae.videoCodec){const ce=nt(X.videoCodec),Re=nt(ae.videoCodec);if(ce!==Re)return Re-ce}if(X.uri===ae.uri&&X.codecSet!==ae.codecSet){const ce=Ye(X.codecSet),Re=Ye(ae.codecSet);if(ce!==Re)return Re-ce}return X.averageBitrate!==ae.averageBitrate?X.averageBitrate-ae.averageBitrate:0});let _=h[0];if(this.steering&&(d=this.steering.filterParsedLevels(d),d.length!==h.length)){for(let X=0;X<h.length;X++)if(h[X].pathwayId===d[0].pathwayId){_=h[X];break}}this._levels=d;for(let X=0;X<d.length;X++)if(d[X]===_){var S;this._firstLevel=X;const ae=_.bitrate,ce=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${d.length} level(s) found, first bitrate: ${ae}`),((S=this.hls.userConfig)==null?void 0:S.abrEwmaDefaultEstimate)===void 0){const Re=Math.min(ae,this.hls.config.abrEwmaDefaultEstimateMax);Re>ce&&ce===Ha.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=Re)}break}const U=r&&!i,ee={levels:d,audioTracks:s,subtitleTracks:l,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:!U&&s.some(X=>!!X.url)};this.hls.trigger(u.MANIFEST_PARSED,ee),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const _=new Error("invalid level idx"),S=e<0;if(this.hls.trigger(u.ERROR,{type:g.OTHER_ERROR,details:m.LEVEL_SWITCH_ERROR,level:e,fatal:S,error:_,reason:_.message}),S)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],l=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,n===e&&s.details&&i&&r===l)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${l?" with Pathway "+l:""} from level ${n}${r?" with Pathway "+r:""}`);const d={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(u.LEVEL_SWITCHING,d);const h=s.details;if(!h||h.live){const _=this.switchParams(s.uri,i==null?void 0:i.details,h);this.loadPlaylist(_)}}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}onError(e,t){t.fatal||!t.context||t.context.type===hn.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===$t.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=this._levels[i];if(!s){var l;this.warn(`Invalid level index ${i}`),(l=t.deliveryDirectives)!=null&&l.skip&&(r.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(s.fragmentError===0&&(s.loadError=0),this.playlistLoaded(i,t,s.details)):(n=t.deliveryDirectives)!=null&&n.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,n=this.currentLevel;if(n&&this.shouldLoadPlaylist(n)){let i=n.uri;if(e)try{i=e.addDirectives(i)}catch(s){this.warn(`Could not construct new URL with HLS Delivery Directives: ${s}`)}const r=n.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${r?" Pathway "+r:""} ${i}`),this.clearTimer(),this.hls.trigger(u.LEVEL_LOADING,{url:i,level:t,pathwayId:n.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||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;const n=this._levels.filter((i,r)=>r!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(s=>s.level=-1)),!1));ai(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(u.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(u.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function za(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}class mu{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[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.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=m.KEY_LOAD_ERROR,n,i,r){return new ii({type:g.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:n,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:i}=e;for(let r=0;r<t.length;r++){const s=t[r];if(i<=s.cc&&(n==="initSegment"||s.sn==="initSegment"||n<s.sn)){this.emeController.selectKeySystemFormat(s).then(l=>{s.setKeyFormat(l)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const h=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,m.KEY_LOAD_ERROR,h))}const s=r.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,m.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let l=this.keyUriToKeyInfo[s];if((n=l)!=null&&n.decryptdata.key)return r.key=l.decryptdata.key,Promise.resolve({frag:e,keyInfo:l});if((i=l)!=null&&i.keyLoadPromise){var d;switch((d=l.mediaKeySessionContext)==null?void 0:d.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return l.keyLoadPromise.then(h=>(r.key=h.keyInfo.decryptdata.key,{frag:e,keyInfo:l}))}}switch(l=this.keyUriToKeyInfo[s]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(l,e):this.loadKeyEME(l,e);case"AES-128":return this.loadKeyHTTP(l,e);default:return Promise.reject(this.createKeyLoadError(e,m.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){const i=this.emeController.loadKey(n);if(i)return(e.keyLoadPromise=i.then(r=>(e.mediaKeySessionContext=r,n))).catch(r=>{throw e.keyLoadPromise=null,r})}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,l)=>{const d={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},h=n.keyLoadPolicy.default,_={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},S={onSuccess:(U,ee,X,ae)=>{const{frag:ce,keyInfo:Re,url:$e}=X;if(!ce.decryptdata||Re!==this.keyUriToKeyInfo[$e])return l(this.createKeyLoadError(ce,m.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),ae));Re.decryptdata.key=ce.decryptdata.key=new Uint8Array(U.data),ce.keyLoader=null,Re.loader=null,s({frag:ce,keyInfo:Re})},onError:(U,ee,X,ae)=>{this.resetLoader(ee),l(this.createKeyLoadError(t,m.KEY_LOAD_ERROR,new Error(`HTTP Error ${U.code} loading key ${U.text}`),X,oe({url:d.url,data:void 0},U)))},onTimeout:(U,ee,X)=>{this.resetLoader(ee),l(this.createKeyLoadError(t,m.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),X))},onAbort:(U,ee,X)=>{this.resetLoader(ee),l(this.createKeyLoadError(t,m.INTERNAL_ABORTED,new Error("key loading aborted"),X))}};r.load(d,_,S)})}resetLoader(e){const{frag:t,keyInfo:n,url:i}=e,r=n.loader;t.keyLoader===r&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[i],r&&r.destroy()}}function Va(){return self.SourceBuffer||self.WebKitSourceBuffer}function Wa(){if(!dn())return!1;const e=Va();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function gu(){if(!Wa())return!1;const a=dn();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(He(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(He(e,"audio"))))}function _u(){var a;const e=Va();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const vu=250,es=2,yu=.1,Eu=.05;class bu{constructor(e,t,n,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=n,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:n,media:i,stalled:r}=this;if(i===null)return;const{currentTime:s,seeking:l}=i,d=this.seeking&&!l,h=!this.seeking&&l;if(this.seeking=l,s!==e){if(this.moved=!0,l||(this.nudgeRetry=0),r!==null){if(this.stallReported){const ce=self.performance.now()-r;E.warn(`playback not stuck anymore @${s}, after ${Math.round(ce)}ms`),this.stallReported=!1}this.stalled=null}return}if(h||d){this.stalled=null;return}if(i.paused&&!l||i.ended||i.playbackRate===0||!Hn.getBuffered(i).length){this.nudgeRetry=0;return}const _=Hn.bufferInfo(i,s,0),S=_.nextStart||0;if(l){const ce=_.len>es,Re=!S||t&&t.start<=s||S-s>es&&!this.fragmentTracker.getPartialFragment(s);if(ce||Re)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var U;if(!(_.len>0)&&!S)return;const Re=Math.max(S,_.start||0)-s,$e=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,rt=($e==null||(U=$e.details)==null?void 0:U.live)?$e.details.targetduration*2:es,Ge=this.fragmentTracker.getPartialFragment(s);if(Re>0&&(Re<=rt||Ge)){i.paused||this._trySkipBufferHole(Ge);return}}const ee=self.performance.now();if(r===null){this.stalled=ee;return}const X=ee-r;if(!l&&X>=vu&&(this._reportStall(_),!this.media))return;const ae=Hn.bufferInfo(i,s,n.maxBufferHole);this._tryFixBufferStall(ae,X)}_tryFixBufferStall(e,t){const{config:n,fragmentTracker:i,media:r}=this;if(r===null)return;const s=r.currentTime,l=i.getPartialFragment(s);l&&(this._trySkipBufferHole(l)||!this.media)||(e.len>n.maxBufferHole||e.nextStart&&e.nextStart-s<n.maxBufferHole)&&t>n.highBufferWatchdogPeriod*1e3&&(E.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:n,stallReported:i}=this;if(!i&&n){this.stallReported=!0;const r=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${JSON.stringify(e)})`);E.warn(r.message),t.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:m.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:n,media:i}=this;if(i===null)return 0;const r=i.currentTime,s=Hn.bufferInfo(i,r,0),l=r<s.start?s.start:s.nextStart;if(l){const d=s.len<=t.maxBufferHole,h=s.len>0&&s.len<1&&i.readyState<3,_=l-r;if(_>0&&(d||h)){if(_>t.maxBufferHole){const{fragmentTracker:U}=this;let ee=!1;if(r===0){const X=U.getAppendedFrag(0,$t.MAIN);X&&l<X.end&&(ee=!0)}if(!ee){const X=e||U.getAppendedFrag(r,$t.MAIN);if(X){let ae=!1,ce=X.end;for(;ce<l;){const Re=U.getPartialFragment(ce);if(Re)ce+=Re.duration;else{ae=!0;break}}if(ae)return 0}}}const S=Math.max(l+Eu,r+yu);if(E.warn(`skipping hole, adjusting currentTime from ${r} to ${S}`),this.moved=!0,this.stalled=null,i.currentTime=S,e&&!e.gap){const U=new Error(`fragment loaded with buffer holes, seeking from ${r} to ${S}`);n.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:m.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:U,reason:U.message,frag:e})}return S}}return 0}_tryNudgeBuffer(){const{config:e,hls:t,media:n,nudgeRetry:i}=this;if(n===null)return;const r=n.currentTime;if(this.nudgeRetry++,i<e.nudgeMaxRetry){const s=r+(i+1)*e.nudgeOffset,l=new Error(`Nudging 'currentTime' from ${r} to ${s}`);E.warn(l.message),n.currentTime=s,t.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:m.BUFFER_NUDGE_ON_STALL,error:l,fatal:!1})}else{const s=new Error(`Playhead still not moving while enough data buffered @${r} after ${e.nudgeMaxRetry} nudges`);E.error(s.message),t.trigger(u.ERROR,{type:g.MEDIA_ERROR,details:m.BUFFER_STALLED_ERROR,error:s,fatal:!0})}}}const xu=100;class Su extends Dr{constructor(e,t,n){super(e,t,n,"[stream-controller]",$t.MAIN),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(u.MANIFEST_LOADING,this.onManifestLoading,this),e.on(u.MANIFEST_PARSED,this.onManifestParsed,this),e.on(u.LEVEL_LOADING,this.onLevelLoading,this),e.on(u.LEVEL_LOADED,this.onLevelLoaded,this),e.on(u.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(u.ERROR,this.onError,this),e.on(u.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(u.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(u.BUFFER_CREATED,this.onBufferCreated,this),e.on(u.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(u.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(u.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(u.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(u.MANIFEST_LOADING,this.onManifestLoading,this),e.off(u.MANIFEST_PARSED,this.onManifestParsed,this),e.off(u.LEVEL_LOADED,this.onLevelLoaded,this),e.off(u.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(u.ERROR,this.onError,this),e.off(u.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(u.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(u.BUFFER_CREATED,this.onBufferCreated,this),e.off(u.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(u.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(u.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying()}startLoad(e){if(this.levels){const{lastCurrentTime:t,hls:n}=this;if(this.stopLoad(),this.setInterval(xu),this.level=-1,!this.startFragRequested){let i=n.startLevel;i===-1&&(n.config.testBandwidth&&this.levels.length>1?(i=0,this.bitrateTest=!0):i=n.firstAutoLevel),n.nextLoadLevel=i,this.level=n.loadLevel,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=gt.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=gt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case gt.WAITING_LEVEL:{const{levels:t,level:n}=this,i=t==null?void 0:t[n],r=i==null?void 0:i.details;if(r&&(!r.live||this.levelLastLoaded===i)){if(this.waitForCdnTuneIn(r))break;this.state=gt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=gt.IDLE;break}break}case gt.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:i,level:r}=this,s=i==null?void 0:i[r];this.resetStartWhenNotLoaded(s||null),this.state=gt.IDLE}}break}this.state===gt.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:i}=this;if(t===null||!i&&(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],l=this.getMainFwdBufferInfo();if(l===null)return;const d=this.getLevelDetails();if(d&&this._streamEnded(l,d)){const ae={};this.altAudio&&(ae.type="video"),this.hls.trigger(u.BUFFER_EOS,ae),this.state=gt.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 h=s.details;if(!h||this.state===gt.WAITING_LEVEL||h.live&&this.levelLastLoaded!==s){this.level=r,this.state=gt.WAITING_LEVEL;return}const _=l.len,S=this.getMaxBufferLength(s.maxBitrate);if(_>=S)return;this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);const U=this.backtrackFragment?this.backtrackFragment.start:l.end;let ee=this.getNextFragment(U,h);if(this.couldBacktrack&&!this.fragPrevious&&ee&&ee.sn!=="initSegment"&&this.fragmentTracker.getState(ee)!==oi.OK){var X;const ce=((X=this.backtrackFragment)!=null?X:ee).sn-h.startSN,Re=h.fragments[ce-1];Re&&ee.cc===Re.cc&&(ee=Re,this.fragmentTracker.removeFragment(Re))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(ee&&this.isLoopLoading(ee,U)){if(!ee.gap){const ce=this.audioOnly&&!this.altAudio?V.AUDIO:V.VIDEO,Re=(ce===V.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;Re&&this.afterBufferFlushed(Re,ce,$t.MAIN)}ee=this.getNextFragmentLoopLoading(ee,h,l,$t.MAIN,S)}ee&&(ee.initSegment&&!ee.initSegment.data&&!this.bitrateTest&&(ee=ee.initSegment),this.loadFragment(ee,s,U))}loadFragment(e,t,n){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===oi.NOT_LOADED||i===oi.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):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)):(this.startFragRequested=!0,super.loadFragment(e,t,n)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,$t.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 l=this.getMainFwdBufferInfo();if(!l||l.len<r.targetduration*2)return}if(!t.paused&&e){const l=this.hls.nextLoadLevel,d=e[l],h=this.fragLastKbps;h&&this.fragCurrent?n=this.fragCurrent.duration*d.maxBitrate/(1e3*h)+1:n=0}else n=0;const s=this.getBufferedFrag(t.currentTime+n);if(s){const l=this.followingBufferedFrag(s);if(l){this.abortCurrentFrag();const d=l.maxStartPTS?l.maxStartPTS:l.start,h=l.duration,_=Math.max(s.end,d+Math.min(Math.max(h-this.config.maxFragLookUpTolerance,h*(this.couldBacktrack?.5:.125)),h*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(_,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 gt.KEY_LOADING:case gt.FRAG_LOADING:case gt.FRAG_LOADING_WAITING_RETRY:case gt.PARSING:case gt.PARSED:this.state=gt.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),n.addEventListener("playing",this.onvplaying),n.addEventListener("seeked",this.onvseeked),this.gapController=new bu(this.config,n,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;K(t)&&this.log(`Media seeked to ${t.toFixed(3)}`);const n=this.getMainFwdBufferInfo();if(n===null||n.len===0){this.warn(`Main forward buffer length on "seeked" event ${n?n.len:"empty"})`);return}this.tick()}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(u.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=this.fragLastKbps=0,this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null,this.altAudio=this.audioOnly=this.startFragRequested=!1}onManifestParsed(e,t){let n=!1,i=!1;t.levels.forEach(r=>{const s=r.audioCodec;s&&(n=n||s.indexOf("mp4a.40.2")!==-1,i=i||s.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=n&&i&&!_u(),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!==gt.IDLE)return;const i=n[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(i.details))&&(this.state=gt.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:i}=this,r=t.level,s=t.details,l=s.totalduration;if(!i){this.warn(`Levels were reset while loading level ${r}`);return}this.log(`Level ${r} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""}, cc [${s.startCC}, ${s.endCC}] duration:${l}`);const d=i[r],h=this.fragCurrent;h&&(this.state===gt.FRAG_LOADING||this.state===gt.FRAG_LOADING_WAITING_RETRY)&&h.level!==t.level&&h.loader&&this.abortCurrentFrag();let _=0;if(s.live||(n=d.details)!=null&&n.live){var S;if(this.checkLiveUpdate(s),s.deltaUpdateFailed)return;_=this.alignPlaylists(s,d.details,(S=this.levelLastLoaded)==null?void 0:S.details)}if(d.details=s,this.levelLastLoaded=d,this.hls.trigger(u.LEVEL_UPDATED,{details:s,level:r}),this.state===gt.WAITING_LEVEL){if(this.waitForCdnTuneIn(s))return;this.state=gt.IDLE}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,_),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,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 l=s[n.level],d=l.details;if(!d){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const h=l.videoCodec,_=d.PTSKnown||!d.live,S=(t=n.initSegment)==null?void 0:t.data,U=this._getAudioCodec(l),ee=this.transmuxer=this.transmuxer||new ca(this.hls,$t.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),X=i?i.index:-1,ae=X!==-1,ce=new yr(n.level,n.sn,n.stats.chunkCount,r.byteLength,X,ae),Re=this.initPTS[n.cc];ee.push(r,S,U,h,n,i,d.totalduration,_,ce,Re)}onAudioTrackSwitching(e,t){const n=this.altAudio;if(!!!t.url){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();const r=this.hls;n&&(r.trigger(u.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),r.trigger(u.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=t.id,i=!!this.hls.audioTracks[n].url;if(i){const r=this.videoBuffer;r&&this.mediaBuffer!==r&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=i,this.tick()}onBufferCreated(e,t){const n=t.tracks;let i,r,s=!1;for(const l in n){const d=n[l];if(d.id==="main"){if(r=l,i=d,l==="video"){const h=n[l];h&&(this.videoBuffer=h.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;if(n&&n.type!==$t.MAIN)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}`),this.state===gt.PARSED&&(this.state=gt.IDLE);return}const r=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*r.total/(r.buffering.end-r.loading.first)),n.sn!=="initSegment"&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}onError(e,t){var n;if(t.fatal){this.state=gt.ERROR;return}switch(t.details){case m.FRAG_GAP:case m.FRAG_PARSING_ERROR:case m.FRAG_DECRYPT_ERROR:case m.FRAG_LOAD_ERROR:case m.FRAG_LOAD_TIMEOUT:case m.KEY_LOAD_ERROR:case m.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError($t.MAIN,t);break;case m.LEVEL_LOAD_ERROR:case m.LEVEL_LOAD_TIMEOUT:case m.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===gt.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===hn.LEVEL&&(this.state=gt.IDLE);break;case m.BUFFER_APPEND_ERROR:case m.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===m.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case m.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!Hn.getBuffered(e).length){const n=this.state!==gt.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,n)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=gt.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==V.AUDIO||this.audioOnly&&!this.altAudio){const n=(t===V.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(n,t,$t.MAIN),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),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=Hn.getBuffered(e),s=(i.length?i.start(0):0)-n;s>0&&(s<this.config.maxBufferHole||s<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${s} to match buffer start`),n+=s,this.startPosition=n),this.log(`seek to target start position ${n} from current time ${t}`),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;if(!n||this.fragContextChanged(e))return;t.fragmentError=0,this.state=gt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const r=e.stats;r.parsing.start=r.parsing.end=r.buffering.start=r.buffering.end=self.performance.now(),i.trigger(u.FRAG_LOADED,n),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const n="main",{hls:i}=this,{remuxResult:r,chunkMeta:s}=e,l=this.getCurrentContext(s);if(!l){this.resetWhenMissingContext(s);return}const{frag:d,part:h,level:_}=l,{video:S,text:U,id3:ee,initSegment:X}=r,{details:ae}=_,ce=this.altAudio?void 0:r.audio;if(this.fragContextChanged(d)){this.fragmentTracker.removeFragment(d);return}if(this.state=gt.PARSING,X){if(X!=null&&X.tracks){const Ue=d.initSegment||d;this._bufferInitSegment(_,X.tracks,Ue,s),i.trigger(u.FRAG_PARSING_INIT_SEGMENT,{frag:Ue,id:n,tracks:X.tracks})}const Re=X.initPTS,$e=X.timescale;K(Re)&&(this.initPTS[d.cc]={baseTime:Re,timescale:$e},i.trigger(u.INIT_PTS_FOUND,{frag:d,id:n,initPTS:Re,timescale:$e}))}if(S&&ae&&d.sn!=="initSegment"){const Re=ae.fragments[d.sn-1-ae.startSN],$e=d.sn===ae.startSN,Ue=!Re||d.cc>Re.cc;if(r.independent!==!1){const{startPTS:rt,endPTS:Ge,startDTS:xt,endDTS:it}=S;if(h)h.elementaryStreams[S.type]={startPTS:rt,endPTS:Ge,startDTS:xt,endDTS:it};else if(S.firstKeyFrame&&S.independent&&s.id===1&&!Ue&&(this.couldBacktrack=!0),S.dropped&&S.independent){const kt=this.getMainFwdBufferInfo(),Yt=(kt?kt.end:this.getLoadPosition())+this.config.maxBufferHole,mt=S.firstKeyFramePTS?S.firstKeyFramePTS:rt;if(!$e&&Yt<mt-this.config.maxBufferHole&&!Ue){this.backtrack(d);return}else Ue&&(d.gap=!0);d.setElementaryStreamInfo(S.type,d.start,Ge,d.start,it,!0)}else $e&&rt>es&&(d.gap=!0);d.setElementaryStreamInfo(S.type,rt,Ge,xt,it),this.backtrackFragment&&(this.backtrackFragment=d),this.bufferFragmentData(S,d,h,s,$e||Ue)}else if($e||Ue)d.gap=!0;else{this.backtrack(d);return}}if(ce){const{startPTS:Re,endPTS:$e,startDTS:Ue,endDTS:rt}=ce;h&&(h.elementaryStreams[V.AUDIO]={startPTS:Re,endPTS:$e,startDTS:Ue,endDTS:rt}),d.setElementaryStreamInfo(V.AUDIO,Re,$e,Ue,rt),this.bufferFragmentData(ce,d,h,s)}if(ae&&ee!=null&&(t=ee.samples)!=null&&t.length){const Re={id:n,frag:d,details:ae,samples:ee.samples};i.trigger(u.FRAG_PARSING_METADATA,Re)}if(ae&&U){const Re={id:n,frag:d,details:ae,samples:U.samples};i.trigger(u.FRAG_PARSING_USERDATA,Re)}}_bufferInitSegment(e,t,n,i){if(this.state!==gt.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:r,video:s,audiovideo:l}=t;if(r){let d=e.audioCodec;const h=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){d&&(d.indexOf("mp4a.40.5")!==-1?d="mp4a.40.2":d="mp4a.40.5");const _=r.metadata;_&&"channelCount"in _&&(_.channelCount||1)!==1&&h.indexOf("firefox")===-1&&(d="mp4a.40.5")}d&&d.indexOf("mp4a.40.5")!==-1&&h.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(d="mp4a.40.2",this.log(`Android: force audio codec to ${d}`)),e.audioCodec&&e.audioCodec!==d&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${d}"`),r.levelCodec=d,r.id="main",this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${d||""}/${e.audioCodec||""}/${r.codec}]`)}s&&(s.levelCodec=e.videoCodec,s.id="main",this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${s.codec}]`)),l&&this.log(`Init audiovideo buffer, container:${l.container}, codecs[level/parsed]=[${e.codecs}/${l.codec}]`),this.hls.trigger(u.BUFFER_CODECS,t),Object.keys(t).forEach(d=>{const _=t[d].initSegment;_!=null&&_.byteLength&&this.hls.trigger(u.BUFFER_APPENDING,{type:d,data:_,frag:n,part:null,chunkMeta:i,parent:n.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,$t.MAIN)}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=gt.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(Hn.isBuffered(e,n)?t=this.getAppendedFrag(n):Hn.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(u.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(u.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,n=this.currentFrag;if(n&&K(t)&&K(n.programDateTime)){const i=n.programDateTime+(t-n.start)*1e3;return new Date(i)}}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 _r{static get version(){return"1.5.20"}static isMSESupported(){return Wa()}static isSupported(){return gu()}static getMediaSource(){return dn()}static get Events(){return u}static get ErrorTypes(){return g}static get ErrorDetails(){return m}static get DefaultConfig(){return _r.defaultConfig?_r.defaultConfig:Ha}static set DefaultConfig(e){_r.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new xs,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.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,A(e.debug||!1,"Hls instance");const t=this.config=hu(_r.DefaultConfig,e);this.userConfig=e,t.progressive&&fu(t);const{abrController:n,bufferController:i,capLevelController:r,errorController:s,fpsController:l}=t,d=new s(this),h=this.abrController=new n(this),_=this.bufferController=new i(this),S=this.capLevelController=new r(this),U=new l(this),ee=new Kn(this),X=new fi(this),ae=t.contentSteeringController,ce=ae?new ae(this):null,Re=this.levelController=new pu(this,ce),$e=new fr(this),Ue=new mu(this.config),rt=this.streamController=new Su(this,$e,Ue);S.setStreamController(rt),U.setStreamController(rt);const Ge=[ee,Re,rt];ce&&Ge.splice(1,0,ce),this.networkControllers=Ge;const xt=[h,_,S,U,X,$e];this.audioTrackController=this.createController(t.audioTrackController,Ge);const it=t.audioStreamController;it&&Ge.push(new it(this,$e,Ue)),this.subtitleTrackController=this.createController(t.subtitleTrackController,Ge);const kt=t.subtitleStreamController;kt&&Ge.push(new kt(this,$e,Ue)),this.createController(t.timelineController,xt),Ue.emeController=this.emeController=this.createController(t.emeController,xt),this.cmcdController=this.createController(t.cmcdController,xt),this.latencyController=this.createController(vi,xt),this.coreComponents=xt,Ge.push(d);const Yt=d.onErrorOut;typeof Yt=="function"&&this.on(u.ERROR,Yt,d)}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(E.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===u.ERROR;this.trigger(u.ERROR,{type:g.OTHER_ERROR,details:m.INTERNAL_EXCEPTION,fatal:i,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){E.log("destroy"),this.trigger(u.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){E.log("attachMedia"),this._media=e,this.trigger(u.MEDIA_ATTACHING,{media:e})}detachMedia(){E.log("detachMedia"),this.trigger(u.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,n=this.url,i=this.url=ve.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,E.log(`loadSource:${i}`),t&&n&&(n!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(u.MANIFEST_LOADING,{url:e})}startLoad(e=-1){E.log(`startLoad(${e})`),this.started=!0,this.resumeBuffering();for(let t=0;t<this.networkControllers.length&&(this.networkControllers[t].startLoad(e),!(!this.started||!this.networkControllers));t++);}stopLoad(){E.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}resumeBuffering(){E.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()})}pauseBuffering(){E.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()})}swapAudioCodec(){E.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){E.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){E.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){E.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){E.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){E.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){E.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 ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(E.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Wn(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()}setAudioOption(e){var t;return(t=this.audioTrackController)==null?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return(t=this.subtitleTrackController)==null||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}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}_r.defaultConfig=void 0}}]);
|
|
}()); |