!(function(){var $a=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[1257],{40001:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return ue}});var R=y(96663),P=y(59301),W={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},ee=W,H=y(7657),K=function(B,je){return P.createElement(H.Z,(0,R.Z)({},B,{ref:je,icon:ee}))},pe=P.forwardRef(K),ue=pe},49198:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return ue}});var R=y(96663),P=y(59301),W={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},ee=W,H=y(7657),K=function(B,je){return P.createElement(H.Z,(0,R.Z)({},B,{ref:je,icon:ee}))},pe=P.forwardRef(K),ue=pe},84105:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return ue}});var R=y(96663),P=y(59301),W={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},ee=W,H=y(7657),K=function(B,je){return P.createElement(H.Z,(0,R.Z)({},B,{ref:je,icon:ee}))},pe=P.forwardRef(K),ue=pe},18785:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return ue}});var R=y(96663),P=y(59301),W={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"},ee=W,H=y(7657),K=function(B,je){return P.createElement(H.Z,(0,R.Z)({},B,{ref:je,icon:ee}))},pe=P.forwardRef(K),ue=pe},33853:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return ue}});var R=y(96663),P=y(59301),W={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"},ee=W,H=y(7657),K=function(B,je){return P.createElement(H.Z,(0,R.Z)({},B,{ref:je,icon:ee}))},pe=P.forwardRef(K),ue=pe},62772:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return ue}});var R=y(96663),P=y(59301),W={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},ee=W,H=y(7657),K=function(B,je){return P.createElement(H.Z,(0,R.Z)({},B,{ref:je,icon:ee}))},pe=P.forwardRef(K),ue=pe},38819:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return ue}});var R=y(96663),P=y(59301),W={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"},ee=W,H=y(7657),K=function(B,je){return P.createElement(H.Z,(0,R.Z)({},B,{ref:je,icon:ee}))},pe=P.forwardRef(K),ue=pe},47472:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return ue}});var R=y(96663),P=y(59301),W={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},ee=W,H=y(7657),K=function(B,je){return P.createElement(H.Z,(0,R.Z)({},B,{ref:je,icon:ee}))},pe=P.forwardRef(K),ue=pe},35593:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return yt}});var R=y(44127),P=y(72071),W=y(6620),ee=y(43403),H=y(92310),K=y.n(H),pe=y(29301),ue=y(76846),de=y(96452),B=y(6089),je=y(80402),k=y(34280),m=y(49658),J=y(59301),$=y(96663),ze=y(77900),st=y(8654);function me(F){var j=F.prefixCls,A=F.align,N=F.arrow,V=F.arrowPos,ae=N||{},S=ae.className,I=ae.content,q=V.x,D=q===void 0?0:q,_=V.y,ne=_===void 0?0:_,De=J.useRef();if(!A||!A.points)return null;var Se={position:"absolute"};if(A.autoArrow!==!1){var Qe=A.points[0],Re=A.points[1],we=Qe[0],He=Qe[1],ft=Re[0],Xe=Re[1];we===ft||!["t","b"].includes(we)?Se.top=ne:we==="t"?Se.top=0:Se.bottom=0,He===Xe||!["l","r"].includes(He)?Se.left=D:He==="l"?Se.left=0:Se.right=0}return J.createElement("div",{ref:De,className:K()("".concat(j,"-arrow"),S),style:Se},I)}function Q(F){var j=F.prefixCls,A=F.open,N=F.zIndex,V=F.mask,ae=F.motion;return V?J.createElement(ze.default,(0,$.Z)({},ae,{motionAppear:!0,visible:A,removeOnLeave:!0}),function(S){var I=S.className;return J.createElement("div",{style:{zIndex:N},className:K()("".concat(j,"-mask"),I)})}):null}var se=J.memo(function(F){var j=F.children;return j},function(F,j){return j.cache}),te=se,b=J.forwardRef(function(F,j){var A=F.popup,N=F.className,V=F.prefixCls,ae=F.style,S=F.target,I=F.onVisibleChanged,q=F.open,D=F.keepDom,_=F.fresh,ne=F.onClick,De=F.mask,Se=F.arrow,Qe=F.arrowPos,Re=F.align,we=F.motion,He=F.maskMotion,ft=F.forceRender,Xe=F.getPopupContainer,he=F.autoDestroy,Dt=F.portal,Tt=F.zIndex,Kt=F.onMouseEnter,ot=F.onMouseLeave,on=F.onPointerEnter,ln=F.ready,yn=F.offsetX,Cn=F.offsetY,Mt=F.offsetR,qt=F.offsetB,ht=F.onAlign,kt=F.onPrepare,mn=F.stretch,It=F.targetWidth,en=F.targetHeight,An=typeof A=="function"?A():A,gn=q||D,Pn=(Xe==null?void 0:Xe.length)>0,On=J.useState(!Xe||!Pn),Mn=(0,P.Z)(On,2),nr=Mn[0],ut=Mn[1];if((0,k.Z)(function(){!nr&&Pn&&S&&ut(!0)},[nr,Pn,S]),!nr)return null;var l="auto",f={left:"-1000vw",top:"-1000vh",right:l,bottom:l};if(ln||!q){var p,d=Re.points,g=Re.dynamicInset||((p=Re._experimental)===null||p===void 0?void 0:p.dynamicInset),x=g&&d[0][1]==="r",E=g&&d[0][0]==="b";x?(f.right=Mt,f.left=l):(f.left=yn,f.right=l),E?(f.bottom=qt,f.top=l):(f.top=Cn,f.bottom=l)}var X={};return mn&&(mn.includes("height")&&en?X.height=en:mn.includes("minHeight")&&en&&(X.minHeight=en),mn.includes("width")&&It?X.width=It:mn.includes("minWidth")&&It&&(X.minWidth=It)),q||(X.pointerEvents="none"),J.createElement(Dt,{open:ft||gn,getContainer:Xe&&function(){return Xe(S)},autoDestroy:he},J.createElement(Q,{prefixCls:V,open:q,zIndex:Tt,mask:De,motion:He}),J.createElement(pe.Z,{onResize:ht,disabled:!q},function(Z){return J.createElement(ze.default,(0,$.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:ft,leavedClassName:"".concat(V,"-hidden")},we,{onAppearPrepare:kt,onEnterPrepare:kt,visible:q,onVisibleChanged:function(xe){var Fe;we==null||(Fe=we.onVisibleChanged)===null||Fe===void 0||Fe.call(we,xe),I(xe)}}),function(le,xe){var Fe=le.className,ve=le.style,qe=K()(V,Fe,N);return J.createElement("div",{ref:(0,st.sQ)(Z,j,xe),className:qe,style:(0,R.Z)((0,R.Z)((0,R.Z)((0,R.Z)({"--arrow-x":"".concat(Qe.x||0,"px"),"--arrow-y":"".concat(Qe.y||0,"px")},f),X),ve),{},{boxSizing:"border-box",zIndex:Tt},ae),onMouseEnter:Kt,onMouseLeave:ot,onPointerEnter:on,onClick:ne},Se&&J.createElement(me,{prefixCls:V,arrow:Se,arrowPos:Qe,align:Re}),J.createElement(te,{cache:!q&&!_},An))})}))}),C=b,z=J.forwardRef(function(F,j){var A=F.children,N=F.getTriggerDOMNode,V=(0,st.Yr)(A),ae=J.useCallback(function(I){(0,st.mH)(j,N?N(I):I)},[N]),S=(0,st.x1)(ae,A.ref);return V?J.cloneElement(A,{ref:S}):A}),G=z,Me=J.createContext(null),Ue=Me;function Je(F){return F?Array.isArray(F)?F:[F]:[]}function We(F,j,A,N){return J.useMemo(function(){var V=Je(A!=null?A:j),ae=Je(N!=null?N:j),S=new Set(V),I=new Set(ae);return F&&(S.has("hover")&&(S.delete("hover"),S.add("click")),I.has("hover")&&(I.delete("hover"),I.add("click"))),[S,I]},[F,j,A,N])}var ie=y(29194);function Y(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],A=arguments.length>2?arguments[2]:void 0;return A?F[0]===j[0]:F[0]===j[0]&&F[1]===j[1]}function fe(F,j,A,N){for(var V=A.points,ae=Object.keys(F),S=0;S1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(F)?j:F}function Be(F){return ge(parseFloat(F),0)}function it(F,j){var A=(0,R.Z)({},F);return(j||[]).forEach(function(N){if(!(N instanceof HTMLBodyElement||N instanceof HTMLHtmlElement)){var V=Ae(N).getComputedStyle(N),ae=V.overflow,S=V.overflowClipMargin,I=V.borderTopWidth,q=V.borderBottomWidth,D=V.borderLeftWidth,_=V.borderRightWidth,ne=N.getBoundingClientRect(),De=N.offsetHeight,Se=N.clientHeight,Qe=N.offsetWidth,Re=N.clientWidth,we=Be(I),He=Be(q),ft=Be(D),Xe=Be(_),he=ge(Math.round(ne.width/Qe*1e3)/1e3),Dt=ge(Math.round(ne.height/De*1e3)/1e3),Tt=(Qe-Re-ft-Xe)*he,Kt=(De-Se-we-He)*Dt,ot=we*Dt,on=He*Dt,ln=ft*he,yn=Xe*he,Cn=0,Mt=0;if(ae==="clip"){var qt=Be(S);Cn=qt*he,Mt=qt*Dt}var ht=ne.x+ln-Cn,kt=ne.y+ot-Mt,mn=ht+ne.width+2*Cn-ln-yn-Tt,It=kt+ne.height+2*Mt-ot-on-Kt;A.left=Math.max(A.left,ht),A.top=Math.max(A.top,kt),A.right=Math.min(A.right,mn),A.bottom=Math.min(A.bottom,It)}}),A}function ye(F){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A="".concat(j),N=A.match(/^(.*)\%$/);return N?F*(parseFloat(N[1])/100):parseFloat(A)}function Te(F,j){var A=j||[],N=(0,P.Z)(A,2),V=N[0],ae=N[1];return[ye(F.width,V),ye(F.height,ae)]}function Pe(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[F[0],F[1]]}function Ce(F,j){var A=j[0],N=j[1],V,ae;return A==="t"?ae=F.y:A==="b"?ae=F.y+F.height:ae=F.y+F.height/2,N==="l"?V=F.x:N==="r"?V=F.x+F.width:V=F.x+F.width/2,{x:V,y:ae}}function at(F,j){var A={t:"b",b:"t",l:"r",r:"l"};return F.map(function(N,V){return V===j?A[N]||"c":N}).join("")}function Ot(F,j,A,N,V,ae,S){var I=J.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:V[N]||{}}),q=(0,P.Z)(I,2),D=q[0],_=q[1],ne=J.useRef(0),De=J.useMemo(function(){return j?Oe(j):[]},[j]),Se=J.useRef({}),Qe=function(){Se.current={}};F||Qe();var Re=(0,B.Z)(function(){if(j&&A&&F){let un=function(Nn,Un){var fr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:qe,rr=An.x+Nn,ur=An.y+Un,hr=rr+p,Qn=ur+f,zn=Math.max(rr,fr.left),yr=Math.max(ur,fr.top),Sr=Math.min(hr,fr.right),Rr=Math.min(Qn,fr.bottom);return Math.max(0,(Sr-zn)*(Rr-yr))},Tn=function(){Dn=An.y+pt,bn=Dn+f,In=An.x+Bt,En=In+p};var ft,Xe,he=j,Dt=he.ownerDocument,Tt=Ae(he),Kt=Tt.getComputedStyle(he),ot=Kt.width,on=Kt.height,ln=Kt.position,yn=he.style.left,Cn=he.style.top,Mt=he.style.right,qt=he.style.bottom,ht=he.style.overflow,kt=(0,R.Z)((0,R.Z)({},V[N]),ae),mn=Dt.createElement("div");(ft=he.parentElement)===null||ft===void 0||ft.appendChild(mn),mn.style.left="".concat(he.offsetLeft,"px"),mn.style.top="".concat(he.offsetTop,"px"),mn.style.position=ln,mn.style.height="".concat(he.offsetHeight,"px"),mn.style.width="".concat(he.offsetWidth,"px"),he.style.left="0",he.style.top="0",he.style.right="auto",he.style.bottom="auto",he.style.overflow="hidden";var It;if(Array.isArray(A))It={x:A[0],y:A[1],width:0,height:0};else{var en=A.getBoundingClientRect();It={x:en.x,y:en.y,width:en.width,height:en.height}}var An=he.getBoundingClientRect(),gn=Dt.documentElement,Pn=gn.clientWidth,On=gn.clientHeight,Mn=gn.scrollWidth,nr=gn.scrollHeight,ut=gn.scrollTop,l=gn.scrollLeft,f=An.height,p=An.width,d=It.height,g=It.width,x={left:0,top:0,right:Pn,bottom:On},E={left:-l,top:-ut,right:Mn-l,bottom:nr-ut},X=kt.htmlRegion,Z="visible",le="visibleFirst";X!=="scroll"&&X!==le&&(X=Z);var xe=X===le,Fe=it(E,De),ve=it(x,De),qe=X===Z?ve:Fe,ke=xe?ve:qe;he.style.left="auto",he.style.top="auto",he.style.right="0",he.style.bottom="0";var _e=he.getBoundingClientRect();he.style.left=yn,he.style.top=Cn,he.style.right=Mt,he.style.bottom=qt,he.style.overflow=ht,(Xe=he.parentElement)===null||Xe===void 0||Xe.removeChild(mn);var Ie=ge(Math.round(p/parseFloat(ot)*1e3)/1e3),tt=ge(Math.round(f/parseFloat(on)*1e3)/1e3);if(Ie===0||tt===0||(0,ue.Sh)(A)&&!(0,ie.Z)(A))return;var Ye=kt.offset,mt=kt.targetOffset,Ft=Te(An,Ye),Ut=(0,P.Z)(Ft,2),rt=Ut[0],ct=Ut[1],oe=Te(It,mt),ce=(0,P.Z)(oe,2),be=ce[0],Ne=ce[1];It.x-=be,It.y-=Ne;var Le=kt.points||[],Ke=(0,P.Z)(Le,2),Ve=Ke[0],lt=Ke[1],Et=Pe(lt),St=Pe(Ve),_t=Ce(It,Et),Nt=Ce(An,St),tn=(0,R.Z)({},kt),Bt=_t.x-Nt.x+rt,pt=_t.y-Nt.y+ct,nn=un(Bt,pt),Vt=un(Bt,pt,ve),an=Ce(It,["t","l"]),rn=Ce(An,["t","l"]),cn=Ce(It,["b","r"]),Sn=Ce(An,["b","r"]),$t=kt.overflow||{},Rn=$t.adjustX,Zn=$t.adjustY,Yt=$t.shiftX,xt=$t.shiftY,vt=function(Un){return typeof Un=="boolean"?Un:Un>=0},Dn,bn,In,En;Tn();var fn=vt(Zn),kn=St[0]===Et[0];if(fn&&St[0]==="t"&&(bn>ke.bottom||Se.current.bt)){var _n=pt;kn?_n-=f-d:_n=an.y-Sn.y-ct;var Yn=un(Bt,_n),jt=un(Bt,_n,ve);Yn>nn||Yn===nn&&(!xe||jt>=Vt)?(Se.current.bt=!0,pt=_n,ct=-ct,tn.points=[at(St,0),at(Et,0)]):Se.current.bt=!1}if(fn&&St[0]==="b"&&(Dnnn||Qt===nn&&(!xe||xn>=Vt)?(Se.current.tb=!0,pt=Ct,ct=-ct,tn.points=[at(St,0),at(Et,0)]):Se.current.tb=!1}var Hn=vt(Rn),vr=St[1]===Et[1];if(Hn&&St[1]==="l"&&(En>ke.right||Se.current.rl)){var Jn=Bt;vr?Jn-=p-g:Jn=an.x-Sn.x-rt;var Fn=un(Jn,pt),ar=un(Jn,pt,ve);Fn>nn||Fn===nn&&(!xe||ar>=Vt)?(Se.current.rl=!0,Bt=Jn,rt=-rt,tn.points=[at(St,1),at(Et,1)]):Se.current.rl=!1}if(Hn&&St[1]==="r"&&(Innn||er===nn&&(!xe||or>=Vt)?(Se.current.lr=!0,Bt=Xn,rt=-rt,tn.points=[at(St,1),at(Et,1)]):Se.current.lr=!1}Tn();var jn=Yt===!0?0:Yt;typeof jn=="number"&&(Inve.right&&(Bt-=En-ve.right-rt,It.x>ve.right-jn&&(Bt+=It.x-ve.right+jn)));var sr=xt===!0?0:xt;typeof sr=="number"&&(Dnve.bottom&&(pt-=bn-ve.bottom-ct,It.y>ve.bottom-sr&&(pt+=It.y-ve.bottom+sr)));var Er=An.x+Bt,xr=Er+p,Tr=An.y+pt,Lr=Tr+f,lr=It.x,Nr=lr+g,wr=It.y,Zr=wr+d,Wr=Math.max(Er,lr),Br=Math.min(xr,Nr),Cr=(Wr+Br)/2,Kr=Cr-Er,zr=Math.max(Tr,wr),Mr=Math.min(Lr,Zr),Jr=(zr+Mr)/2,kr=Jr-Tr;S==null||S(j,tn);var sn=_e.right-An.x-(Bt+An.width),Ln=_e.bottom-An.y-(pt+An.height);_({ready:!0,offsetX:Bt/Ie,offsetY:pt/tt,offsetR:sn/Ie,offsetB:Ln/tt,arrowX:Kr/Ie,arrowY:kr/tt,scaleX:Ie,scaleY:tt,align:tn})}}),we=function(){ne.current+=1;var Xe=ne.current;Promise.resolve().then(function(){ne.current===Xe&&Re()})},He=function(){_(function(Xe){return(0,R.Z)((0,R.Z)({},Xe),{},{ready:!1})})};return(0,k.Z)(He,[N]),(0,k.Z)(function(){F||He()},[F]),[D.ready,D.offsetX,D.offsetY,D.offsetR,D.offsetB,D.arrowX,D.arrowY,D.scaleX,D.scaleY,D.align,we]}var Pt=y(19127);function Xt(F,j,A,N,V){(0,k.Z)(function(){if(F&&j&&A){let ne=function(){N(),V()};var ae=j,S=A,I=Oe(ae),q=Oe(S),D=Ae(S),_=new Set([D].concat((0,Pt.Z)(I),(0,Pt.Z)(q)));return _.forEach(function(De){De.addEventListener("scroll",ne,{passive:!0})}),D.addEventListener("resize",ne,{passive:!0}),N(),function(){_.forEach(function(De){De.removeEventListener("scroll",ne),D.removeEventListener("resize",ne)})}}},[F,j,A])}var wt=y(48736),bt=y(16089);function Ht(F,j,A,N,V,ae,S,I){var q=J.useRef(F),D=J.useRef(!1);q.current!==F&&(D.current=!0,q.current=F),J.useEffect(function(){var _=(0,bt.Z)(function(){D.current=!1});return function(){bt.Z.cancel(_)}},[F]),J.useEffect(function(){if(j&&N&&(!V||ae)){var _=function(){var ln=!1,yn=function(qt){var ht=qt.target;ln=S(ht)},Cn=function(qt){var ht=qt.target;!D.current&&q.current&&!ln&&!S(ht)&&I(!1)};return[yn,Cn]},ne=_(),De=(0,P.Z)(ne,2),Se=De[0],Qe=De[1],Re=_(),we=(0,P.Z)(Re,2),He=we[0],ft=we[1],Xe=Ae(N);Xe.addEventListener("mousedown",Se,!0),Xe.addEventListener("click",Qe,!0),Xe.addEventListener("contextmenu",Qe,!0);var he=(0,de.A)(A);if(he&&(he.addEventListener("mousedown",He,!0),he.addEventListener("click",ft,!0),he.addEventListener("contextmenu",ft,!0)),0)var Dt,Tt,Kt,ot;return function(){Xe.removeEventListener("mousedown",Se,!0),Xe.removeEventListener("click",Qe,!0),Xe.removeEventListener("contextmenu",Qe,!0),he&&(he.removeEventListener("mousedown",He,!0),he.removeEventListener("click",ft,!0),he.removeEventListener("contextmenu",ft,!0))}}},[j,A,N,V,ae])}var Jt=["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 Ee(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ee.Z,j=J.forwardRef(function(A,N){var V=A.prefixCls,ae=V===void 0?"rc-trigger-popup":V,S=A.children,I=A.action,q=I===void 0?"hover":I,D=A.showAction,_=A.hideAction,ne=A.popupVisible,De=A.defaultPopupVisible,Se=A.onPopupVisibleChange,Qe=A.afterPopupVisibleChange,Re=A.mouseEnterDelay,we=A.mouseLeaveDelay,He=we===void 0?.1:we,ft=A.focusDelay,Xe=A.blurDelay,he=A.mask,Dt=A.maskClosable,Tt=Dt===void 0?!0:Dt,Kt=A.getPopupContainer,ot=A.forceRender,on=A.autoDestroy,ln=A.destroyPopupOnHide,yn=A.popup,Cn=A.popupClassName,Mt=A.popupStyle,qt=A.popupPlacement,ht=A.builtinPlacements,kt=ht===void 0?{}:ht,mn=A.popupAlign,It=A.zIndex,en=A.stretch,An=A.getPopupClassNameFromAlign,gn=A.fresh,Pn=A.alignPoint,On=A.onPopupClick,Mn=A.onPopupAlign,nr=A.arrow,ut=A.popupMotion,l=A.maskMotion,f=A.popupTransitionName,p=A.popupAnimation,d=A.maskTransitionName,g=A.maskAnimation,x=A.className,E=A.getTriggerDOMNode,X=(0,W.Z)(A,Jt),Z=on||ln||!1,le=J.useState(!1),xe=(0,P.Z)(le,2),Fe=xe[0],ve=xe[1];(0,k.Z)(function(){ve((0,m.Z)())},[]);var qe=J.useRef({}),ke=J.useContext(Ue),_e=J.useMemo(function(){return{registerSubPopup:function(hn,Kn){qe.current[hn]=Kn,ke==null||ke.registerSubPopup(hn,Kn)}}},[ke]),Ie=(0,je.Z)(),tt=J.useState(null),Ye=(0,P.Z)(tt,2),mt=Ye[0],Ft=Ye[1],Ut=(0,B.Z)(function(Zt){(0,ue.Sh)(Zt)&&mt!==Zt&&Ft(Zt),ke==null||ke.registerSubPopup(Ie,Zt)}),rt=J.useState(null),ct=(0,P.Z)(rt,2),oe=ct[0],ce=ct[1],be=J.useRef(null),Ne=(0,B.Z)(function(Zt){(0,ue.Sh)(Zt)&&oe!==Zt&&(ce(Zt),be.current=Zt)}),Le=J.Children.only(S),Ke=(Le==null?void 0:Le.props)||{},Ve={},lt=(0,B.Z)(function(Zt){var hn,Kn,Dr=oe;return(Dr==null?void 0:Dr.contains(Zt))||((hn=(0,de.A)(Dr))===null||hn===void 0?void 0:hn.host)===Zt||Zt===Dr||(mt==null?void 0:mt.contains(Zt))||((Kn=(0,de.A)(mt))===null||Kn===void 0?void 0:Kn.host)===Zt||Zt===mt||Object.values(qe.current).some(function(ir){return(ir==null?void 0:ir.contains(Zt))||Zt===ir})}),Et=O(ae,ut,p,f),St=O(ae,l,g,d),_t=J.useState(De||!1),Nt=(0,P.Z)(_t,2),tn=Nt[0],Bt=Nt[1],pt=ne!=null?ne:tn,nn=(0,B.Z)(function(Zt){ne===void 0&&Bt(Zt)});(0,k.Z)(function(){Bt(ne||!1)},[ne]);var Vt=J.useRef(pt);Vt.current=pt;var an=J.useRef([]);an.current=[];var rn=(0,B.Z)(function(Zt){var hn;nn(Zt),((hn=an.current[an.current.length-1])!==null&&hn!==void 0?hn:pt)!==Zt&&(an.current.push(Zt),Se==null||Se(Zt))}),cn=J.useRef(),Sn=function(){clearTimeout(cn.current)},$t=function(hn){var Kn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Sn(),Kn===0?rn(hn):cn.current=setTimeout(function(){rn(hn)},Kn*1e3)};J.useEffect(function(){return Sn},[]);var Rn=J.useState(!1),Zn=(0,P.Z)(Rn,2),Yt=Zn[0],xt=Zn[1];(0,k.Z)(function(Zt){(!Zt||pt)&&xt(!0)},[pt]);var vt=J.useState(null),Dn=(0,P.Z)(vt,2),bn=Dn[0],In=Dn[1],En=J.useState([0,0]),fn=(0,P.Z)(En,2),kn=fn[0],_n=fn[1],Yn=function(hn){_n([hn.clientX,hn.clientY])},jt=Ot(pt,mt,Pn?kn:oe,qt,kt,mn,Mn),Ct=(0,P.Z)(jt,11),Qt=Ct[0],xn=Ct[1],Hn=Ct[2],vr=Ct[3],Jn=Ct[4],Fn=Ct[5],ar=Ct[6],Xn=Ct[7],er=Ct[8],or=Ct[9],jn=Ct[10],sr=We(Fe,q,D,_),Er=(0,P.Z)(sr,2),xr=Er[0],Tr=Er[1],Lr=xr.has("click"),lr=Tr.has("click")||Tr.has("contextMenu"),Nr=(0,B.Z)(function(){Yt||jn()}),wr=function(){Vt.current&&Pn&&lr&&$t(!1)};Xt(pt,oe,mt,Nr,wr),(0,k.Z)(function(){Nr()},[kn,qt]),(0,k.Z)(function(){pt&&!(kt!=null&&kt[qt])&&Nr()},[JSON.stringify(mn)]);var Zr=J.useMemo(function(){var Zt=fe(kt,ae,or,Pn);return K()(Zt,An==null?void 0:An(or))},[or,An,kt,ae,Pn]);J.useImperativeHandle(N,function(){return{nativeElement:be.current,forceAlign:Nr}});var Wr=J.useState(0),Br=(0,P.Z)(Wr,2),Cr=Br[0],Kr=Br[1],zr=J.useState(0),Mr=(0,P.Z)(zr,2),Jr=Mr[0],kr=Mr[1],sn=function(){if(en&&oe){var hn=oe.getBoundingClientRect();Kr(hn.width),kr(hn.height)}},Ln=function(){sn(),Nr()},un=function(hn){xt(!1),jn(),Qe==null||Qe(hn)},Tn=function(){return new Promise(function(hn){sn(),In(function(){return hn})})};(0,k.Z)(function(){bn&&(jn(),bn(),In(null))},[bn]);function Nn(Zt,hn,Kn,Dr){Ve[Zt]=function(ir){var qr;Dr==null||Dr(ir),$t(hn,Kn);for(var mi=arguments.length,di=new Array(mi>1?mi-1:0),si=1;si1?Kn-1:0),ir=1;ir1?Kn-1:0),ir=1;ir$ in J?ee(J,$,{enumerable:!0,configurable:!0,writable:!0,value:ze}):J[$]=ze,je=(J,$)=>{for(var ze in $||($={}))ue.call($,ze)&&B(J,ze,$[ze]);if(pe)for(var ze of pe($))de.call($,ze)&&B(J,ze,$[ze]);return J},k=(J,$)=>H(J,K($));const m=({img:J,buttonProps:$={},styles:ze={},customText:st,ButtonText:me,ButtonClick:Q,Buttonclass:se,ButtonTwo:te,imgStyles:b,loading:C=!1})=>R.createElement("section",{className:"tc animated fadeIn",style:je(je({},{color:"#999",margin:"100px auto",visibility:C?"hidden":"visible"}),ze)},R.createElement("img",{src:J||P,style:k(je({},b),{pointerEvents:"none",userSelect:"none"})}),R.createElement("p",{className:"mt20 font14"},st||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),me&&R.createElement(W.ZP,je({className:se,onClick:Q},$),me),te&&te);nt.Z=m},46134:function(Wt,nt,y){"use strict";y.d(nt,{K:function(){return K}});var R=y(59301),P=y(43418),W=y(71839),ee={modal:"modal___LGwws",closeIcon:"closeIcon___vsUXI",wrap:"wrap___tDzbl",input:"input___aikQk"},H=y(24334);const K=({visible:pe,width:ue,videoId:de,file_url:B,course_id:je,copyUrl:k,toLog:m=!0,logWatchHistory:J=()=>{},allow_skip:$,onClose:ze=()=>{},autoPlay:st=!1,onPlayEnded:me=()=>{}})=>R.createElement(P.default,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,open:pe,title:null,footer:null,width:ue,className:ee.modal},R.createElement("i",{className:`${ee.closeIcon} iconfont icon-guanbi10`,onClick:ze}),pe&&R.createElement(W.Z,{onPlayEnded:me,autoPlay:st,allow_skip:$,courseId:je,src:B!=null&&B.startsWith("http")?B:H.Base64.decode(B),videoId:de,toLog:m,logWatchHistory:J}))},71839:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return $}});var R=y(59301),P=y(8591),W=y(38854),ee=y(29382),H=y(40846),K=y(24065),pe=y(56102),ue=y(4901),de={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"},B=(ze,st,me)=>new Promise((Q,se)=>{var te=z=>{try{C(me.next(z))}catch(G){se(G)}},b=z=>{try{C(me.throw(z))}catch(G){se(G)}},C=z=>z.done?Q(z.value):Promise.resolve(z.value).then(te,b);C((me=me.apply(ze,st)).next())});function je(ze){if(isNaN(ze))return{minutes:"00",seconds:"00"};const st=new Date(ze*1e3).toISOString().substr(11,8);return{hour:st.substr(0,2),minutes:st.substr(3,2),seconds:st.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function k(ze,st){return ze-st}function m(ze){ze.sort(k);let st=0;for(let me=0;me{},handlePlay:z=()=>{},handlePlayEnded:G=()=>{},autoPlay:Me=!1,onPlayEnded:Ue=()=>{},isShowWaterMark:Je=!0},We)=>{var ie;st=st==null?void 0:st.replace("http://","https://");const fe=((ie=st==null?void 0:st.split("."))==null?void 0:ie.pop())==="flv",O=(0,R.useRef)(),Ae=(0,R.useRef)(),Oe=(0,R.useRef)(),ge=(0,R.useRef)(),Be=(0,R.useRef)(),it=(0,R.useRef)(),ye=(0,R.useRef)(),Te=(0,R.useRef)(),Pe=(0,R.useRef)(),Ce=(0,R.useRef)(),at=(0,R.useRef)(),Ot=(0,R.useRef)(),Pt=(0,R.useRef)(),Xt=(0,R.useRef)(),wt=navigator.userAgent.toLowerCase().match(J),bt=wt?wt[0]:"pc",Ht=(0,R.useRef)(!1),Jt=(0,K.eY)();let Ee=0,yt=0,F=0,j=null,A=!1,N=20,V=1,ae=!1,S=!1,I=[];(0,R.useImperativeHandle)(We,()=>({getLastUpdatedTime:()=>O.current.currentTime,getDuration:()=>O.current.duration})),P.ZP.config({maxCount:1,getContainer:()=>Oe.current});const q=(0,R.useCallback)((Re,we=!1)=>{let He={point:O.current.currentTime};j?(He.log_id=j,He.watch_duration=m(I),He.total_duration=yt):(te?(He.video_id=parseInt(Q,10),He.course_id=te):He.video_id=Q,He.duration=Ee,He.device=bt),we&&(He.ed="1");function ft(){return B(this,null,function*(){ae=!0,j=yield se==null?void 0:se(He),ae=!1,Re&&Re()})}ft()},[Q,te]);(0,R.useEffect)(()=>{O.current&&(ge.current.style.display="none",Be.current.style.display="block"),P.ZP.destroy();let Re=null;return ee.Z.isSupported&&fe&&st&&(st==null?void 0:st.indexOf(".m3u8"))<0?(Re=ee.Z.createPlayer({type:"flv",volume:.8,cors:!0,url:st,muted:!1}),O.current&&(Re.attachMediaElement(O.current),Re.load())):O.current.setAttribute("src",st),_(),()=>{Re&&(Re.unload(),Re.pause(),Re.destroy(),Re=null)}},[O,fe,st]);function D(){O.current.paused?(ge.current.style.display="none",Be.current.style.display="block"):(ge.current.style.display="block",Be.current.style.display="none")}function _(){at.current.style.display="none",Pt.current.style.display="none",Ot.current.style.display="none",O.current.muted||O.current.volume===0?at.current.style.display="block":O.current.volume>0&&O.current.volume<=.5?Pt.current.style.display="block":Ot.current.style.display="block"}(0,R.useEffect)(()=>{const Re=document.getElementById("play"),we=document.querySelectorAll(".playback-icons use");function He(){z(),b&&!Ht.current&&(O.current.currentTime=b),Ht.current=!0,I.push(O.current.currentTime),A||(A=!0,me&&q())}function ft(){return B(this,null,function*(){D(),I.push(O.current.currentTime),me&&q(()=>{j=null,F=0,A=!1,ae=!1,S=!1,I=[],yt=0,V=1},!0),Ue()})}function Xe(){it.current.value=Math.round(O.current.currentTime),ye.current.value=Math.round(O.current.currentTime)}function he(){const ht=je(Math.round(O.current.currentTime));Pe.current.innerText=`${ht.hour>0?ht.hour+":":""}${ht.minutes}:${ht.seconds}`,Pe.current.setAttribute("datetime",`${ht.hour>0?" "+ht.hour+" ":""}${ht.minutes}m ${ht.seconds}s`)}function Dt(){var ht,kt,mn,It,en,An,gn;const Pn=Math.round((ht=O.current)==null?void 0:ht.duration);(mn=(kt=it.current)==null?void 0:kt.setAttribute)==null||mn.call(kt,"max",Pn),(en=(It=ye.current)==null?void 0:It.setAttribute)==null||en.call(It,"max",Pn);const On=je(Pn);Te.current&&(Te.current.innerText=`${On.hour>0?On.hour+":":""}${On.minutes}:${On.seconds}`,(gn=(An=Te.current).setAttribute)==null||gn.call(An,"datetime",`${On.hour>0?" "+On.hour+" ":""}${On.minutes}m ${On.seconds}s`))}function Tt(){try{const ht=Math.round(O.current.duration);it.current.setAttribute("max",ht),ye.current.setAttribute("max",ht);const kt=je(ht);Te.current.innerText=`${kt.hour>0?kt.hour+":":""}${kt.minutes}:${kt.seconds}`,Te.current.setAttribute("datetime",`${kt.hour>0?" "+kt.hour+" ":""}${kt.minutes}m ${kt.seconds}s`),Xe(),he();const{width:mn,height:It,x:en,y:An}=Ae.current.getBoundingClientRect();if(en<0||An<0||!mn)return;if(!S){let gn=O.current.currentTime,Pn=gn-F;Math.abs(Pn)<10?(yt+=Math.abs(Pn),F=gn,ae||yt-V*N>=0&&(V++,I.push(F),me&&q())):(F=gn,me&&q())}}catch(ht){console.log(ht)}}function Kt(){S=!0}function ot(){O.current.playing&&I.push(O.current.currentTime,F),F=O.current.currentTime,S=!1}function on(){Ee=O.current.duration,Ee<=20&&(N=Ee/3),O.current.addEventListener("play",He)}function ln(ht){ht.preventDefault(),(0,ue.vp)()?(O.current.style.width="100%",O.current.style.height="100%"):O.current.style.cssText=""}function yn(){C()}function Cn(ht){if(!ze){P.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");return}const kt=ht.target.dataset.seek?ht.target.dataset.seek:ht.target.value;O.current.currentTime=kt,ye.current.value=kt,it.current.value=kt}function Mt(ht){const kt=Math.round(ht.offsetX/ht.target.clientWidth*parseInt(ht.target.getAttribute("max"),10));it.current.setAttribute("data-seek",kt);const mn=je(kt);Ce.current.textContent=`${mn.hour>0?mn.hour+":":""}${mn.minutes}:${mn.seconds}`;const It=O.current.getBoundingClientRect();Ce.current.style.left=`${ht.pageX-It.left}px`}function qt(ht){switch(ht.code){case"Space":ht.preventDefault(),Se();break;case"ArrowRight":if(ht.preventDefault(),!ze){P.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(O.current.currentTime>=O.current.duration)break;O.current.currentTime=parseInt(O.current.currentTime)+5,Xe();break;case"ArrowLeft":if(ht.preventDefault(),!ze){P.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(O.current.currentTime===0)break;O.current.currentTime=parseInt(O.current.currentTime)-5,Xe();break;case"ArrowUp":ht.preventDefault(),O.current.volume<1&&(O.current.volume=(parseInt(O.current.volume*10)+1)/10);break;case"ArrowDown":ht.preventDefault(),O.current.volume>0&&(O.current.volume=(parseInt(O.current.volume*10)-1)/10);break}}return Oe.current.addEventListener((0,ue.gH)(),ln),O.current.addEventListener("canplay",on),O.current.addEventListener("ended",ft),O.current.addEventListener("seeking",Kt),O.current.addEventListener("seeked",ot),O.current.addEventListener("loadedmetadata",Dt),it.current.addEventListener("mousemove",Mt),it.current.addEventListener("input",Cn),O.current.addEventListener("timeupdate",Tt),O.current.addEventListener("pause",yn),O.current.addEventListener("volumechange",_),document.addEventListener("keydown",qt),()=>{var ht,kt,mn,It,en,An,gn,Pn,On,Mn,nr,ut;(ht=O.current)==null||ht.removeEventListener("canplay",on),(kt=O.current)==null||kt.removeEventListener("play",He),(mn=O.current)==null||mn.removeEventListener("ended",ft),(It=O.current)==null||It.removeEventListener("seeking",Kt),(en=O.current)==null||en.removeEventListener("seeked",ot),(An=it.current)==null||An.removeEventListener("mousemove",Mt),(gn=it.current)==null||gn.removeEventListener("input",Cn),(Pn=O.current)==null||Pn.removeEventListener("timeupdate",Tt),(On=O.current)==null||On.removeEventListener("pause",yn),(Mn=O.current)==null||Mn.removeEventListener("loadedmetadata",Dt),(nr=O.current)==null||nr.removeEventListener("volumechange",_),document.removeEventListener("keydown",qt),(ut=O.current)!=null&&ut.playing&&(I.push(F,O.current.currentTime),me&&q())}},[O,st]),(0,R.useEffect)(()=>{if(O.current.onended=()=>{G(O)},O.current.oncontextmenu=()=>!1,(st==null?void 0:st.indexOf(".m3u8"))>-1){if(O.current.canPlayType("application/vnd.apple.mpegurl"))O.current.src=st;else if(H.ZP.isSupported()){var Re=new H.ZP;Re.loadSource(st),Re.attachMedia(O.current)}}},[st]);const[ne,De]=(0,R.useState)(1),Se=()=>{O.current.paused||O.current.ended?O.current.play():O.current.pause(),D()};function Qe(){O.current.muted=!O.current.muted,O.current.muted?(Xt.current.setAttribute("data-volume",volume.value),Xt.current.value=0):Xt.current.value=Xt.current.dataset.volume}return R.createElement("div",{style:{position:"relative"},ref:Oe},R.createElement("div",{ref:Ae,className:`${de.watermark} animated_alternate animate__animated_10s animate__infinite animate__stepstart ${de.animate__loop}`},Je&&Jt?Jt.login:" "),R.createElement("div",{className:de.container},R.createElement("div",{className:de["video-container"],id:"video-container"},R.createElement("div",{className:de["playback-animation"],id:"playback-animation"},R.createElement("svg",{className:de["playback-icons"]},R.createElement("use",{className:"hidden",href:"#play-icon"}),R.createElement("use",{href:"#pause"}))),R.createElement("video",{className:de.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:O,autoPlay:Me}),R.createElement("div",{className:`${de["video-controls"]} `,id:"video-controls"},R.createElement("div",{className:de["bottom-controls"]},R.createElement("div",{className:de["left-controls"]},R.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:Se},R.createElement("svg",{className:de["playback-icons"]},R.createElement("use",{ref:Be,href:"#play-icon"}),R.createElement("use",{ref:ge,style:{display:"none"},href:"#pause"}))),R.createElement("div",{className:de.time},R.createElement("time",{id:"time-elapsed",ref:Pe},"00:00"),R.createElement("span",null," / "),R.createElement("time",{id:"duration",ref:Te},"00:00"))),R.createElement("div",{className:de["right-controls"]},ze&&R.createElement(W.Z,{placement:"top",overlayClassName:de.rateOverlay,getPopupContainer:Re=>Re.parentNode,menu:{items:[{key:"1",label:R.createElement("span",{onClick:()=>{De(1),O.current.playbackRate=1}},"1.0x")},{key:"2",label:R.createElement("span",{onClick:()=>{De(1.5),O.current.playbackRate=1.5}},"1.5x")},{key:"3",label:R.createElement("span",{onClick:()=>{De(2),O.current.playbackRate=2}},"2.0x")}]}},R.createElement("div",{className:`${de.controlText} mr5`},"\u500D\u901F")),R.createElement(pe.CopyToClipboard,{text:st,onCopy:()=>P.ZP.success("\u590D\u5236\u6210\u529F")},R.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},R.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),R.createElement("div",{className:de["volume-controls"]},R.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:de["volume-button"],id:"volume-button",onClick:Qe},R.createElement("i",{ref:at,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),R.createElement("i",{ref:Pt,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),R.createElement("i",{ref:Ot,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),R.createElement("input",{className:de.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Xt,style:{display:"none"},onClick:_})),R.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:de["fullscreen-button"],onClick:()=>{(0,ue.vp)()?(0,ue.BU)():(0,ue.Dj)(Oe.current)}},R.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),R.createElement("div",{className:de["video-progress"]},R.createElement("progress",{ref:ye,value:"0",min:"0"}),R.createElement("input",{className:de.seek,ref:it,value:"0",min:"0",type:"range",step:"1"}),R.createElement("div",{className:de["seek-tooltip"],ref:Ce,id:"seek-tooltip"},"00:00"))))),R.createElement("svg",{style:{display:"none"}},R.createElement("defs",null,R.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},R.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),R.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},R.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),R.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},R.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"})),R.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},R.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"})),R.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},R.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"})),R.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},R.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"})),R.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},R.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"})),R.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},R.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"})))))})},81357:function(Wt,nt,y){"use strict";y.r(nt),y.d(nt,{default:function(){return ye}});var R=y(59301),P=y(89070),W=y(8591),ee=y(13570),H=y(71418),K=y(58421),pe=y(99064),ue=y(24065),de=y(8797),B=y(18889),je=y(55988),k=y(36193),m={flex_box_center:"flex_box_center___riBIL",flex_space_between:"flex_space_between___QnIxq",flex_box_vertical_center:"flex_box_vertical_center___lDoLU",flex_box_center_end:"flex_box_center_end___cJ2F_",flex_box_column:"flex_box_column___PSzC7",wrap:"wrap___Mlk1H",mask:"mask___MVQfB",playIconWrap:"playIconWrap___QcDy0",playIcon:"playIcon___MXK2W",linkWrap:"linkWrap___rXjTB",link:"link___uEr60",imgWrap:"imgWrap___nCe4C",cardBottom:"cardBottom___CqJQC",bottomTitle:"bottomTitle___oTGoY",timeWrap:"timeWrap___ioirP",time:"time___hl75k",bottomActionWrap:"bottomActionWrap___RhhZY",peopleWrap:"peopleWrap___TwLjM",actionIcon:"actionIcon___BfAaN"},J=y(46134),$=y(3294),ze=y(24334),st=Object.defineProperty,me=Object.defineProperties,Q=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,C=(Te,Pe,Ce)=>Pe in Te?st(Te,Pe,{enumerable:!0,configurable:!0,writable:!0,value:Ce}):Te[Pe]=Ce,z=(Te,Pe)=>{for(var Ce in Pe||(Pe={}))te.call(Pe,Ce)&&C(Te,Ce,Pe[Ce]);if(se)for(var Ce of se(Pe))b.call(Pe,Ce)&&C(Te,Ce,Pe[Ce]);return Te},G=(Te,Pe)=>me(Te,Q(Pe));const Me=({data:Te,params:Pe,onSend:Ce})=>{const[at,Ot]=(0,R.useState)(),[Pt,Xt]=(0,R.useState)({}),wt="90%",bt="55%",Ht=Ee=>{Ee.link||(Ot(!0),Xt({videoId:Ee.id,course_id:Pe.coursesId,file_url:Ee.play_url||Ee.file_url,copyUrl:Jt(Ee.play_url||Ee.file_url,Ee.cover_url),logWatchHistory:()=>{}}))},Jt=(Ee,yt)=>{let F=ze.Base64.decode(Ee);if(Ee)return``};return R.createElement(R.Fragment,null,Te==null?void 0:Te.map((Ee,yt)=>{var F;const j=Ee!=null&&Ee.cover_url?(F=Ee==null?void 0:Ee.cover_url)!=null&&F.includes("https")?Ee.cover_url:$.Z.API_SERVER+Ee.cover_url:je;return R.createElement("a",{className:m.wrap,key:Ee.id},R.createElement(B.Z,{className:`animated fadeIn ${m.cardWrap}`},R.createElement(H.Z,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!Ee.transcoded&&!Ee.link},R.createElement("span",{className:m.imgWrap,onClick:()=>{Ht(Ee)}},R.createElement("img",{src:j}),Ee.link&&R.createElement("a",{className:m.linkWrap,href:Ee.link,target:"_blank",title:Ee.title},R.createElement("span",{className:m.link},"\u5916\u94FE")),R.createElement(R.Fragment,null,R.createElement("div",{className:m.mask}),R.createElement("div",{className:m.playIconWrap},!Ee.link&&R.createElement("img",{className:m.playIcon,src:k}))))),R.createElement("div",{className:m.cardBottom},R.createElement("div",{title:Ee.title,className:m.bottomTitle},Ee.title),R.createElement("div",{className:m.bottomActionWrap},R.createElement("div",null,"\u8BFE\u7A0B\uFF1A",R.createElement("span",{title:Ee.subject},Ee.subject)),R.createElement("b",{onClick:()=>Ce(Ee)},"\u4F7F\u7528\u89C6\u9891")))))}),R.createElement(J.K,G(z({},Pt),{visible:at,width:800,onClose:()=>{Ot(!1),Xt({})}})))};var Ue=(0,P.connect)(({classroomList:Te})=>({classroomList:Te}))(Me),Je={flex_box_center:"flex_box_center___p5F4p",flex_space_between:"flex_space_between___XpX93",flex_box_vertical_center:"flex_box_vertical_center___CZqxk",flex_box_center_end:"flex_box_center_end___CinPQ",flex_box_column:"flex_box_column___RMknq",wrap:"wrap___fNq3s",listWrap:"listWrap____pT8s",list:"list___xQ3gD",top:"top___KkWz1",bottom:"bottom___MTHH1",tag:"tag___Sj7ii",rate:"rate___RKAhp",videoWrap:"videoWrap___Kv7Tg"},We=y(62202),ie=Object.defineProperty,Y=Object.getOwnPropertySymbols,fe=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,Ae=(Te,Pe,Ce)=>Pe in Te?ie(Te,Pe,{enumerable:!0,configurable:!0,writable:!0,value:Ce}):Te[Pe]=Ce,Oe=(Te,Pe)=>{for(var Ce in Pe||(Pe={}))fe.call(Pe,Ce)&&Ae(Te,Ce,Pe[Ce]);if(Y)for(var Ce of Y(Pe))O.call(Pe,Ce)&&Ae(Te,Ce,Pe[Ce]);return Te},ge=(Te,Pe)=>{var Ce={};for(var at in Te)fe.call(Te,at)&&Pe.indexOf(at)<0&&(Ce[at]=Te[at]);if(Te!=null&&Y)for(var at of Y(Te))Pe.indexOf(at)<0&&O.call(Te,at)&&(Ce[at]=Te[at]);return Ce},Be=(Te,Pe,Ce)=>new Promise((at,Ot)=>{var Pt=bt=>{try{wt(Ce.next(bt))}catch(Ht){Ot(Ht)}},Xt=bt=>{try{wt(Ce.throw(bt))}catch(Ht){Ot(Ht)}},wt=bt=>bt.done?at(bt.value):Promise.resolve(bt.value).then(Pt,Xt);wt((Ce=Ce.apply(Te,Pe)).next())});const it=Te=>{var Pe=Te,{classroomList:Ce,globalSetting:at,user:Ot,dispatch:Pt}=Pe,Xt=ge(Pe,["classroomList","globalSetting","user","dispatch"]);const wt=(0,P.useParams)(),{detailTopBanner:bt,detailLeftMenus:Ht,shareStatus:Jt}=Ce,[Ee,yt]=(0,R.useState)("1"),[F,j]=(0,R.useState)(0),[A,N]=(0,R.useState)(!0),[V,ae]=(0,R.useState)([]),[S,I]=(0,R.useState)({page:1,limit:9,order:"random"});(0,R.useEffect)(()=>{S.page=1,_(S)},[Ee]);const q=Xe=>Be(void 0,null,function*(){N(!0);let he=yield(0,pe.ZP)(`/api/courses/${wt==null?void 0:wt.coursesId}/ilearning_resource.json`,{method:"get",params:Oe({type:1},Xe)});he!=null&&he.shixuns&&(ae((he==null?void 0:he.shixuns)||[]),j(he==null?void 0:he.total_count)),N(!1)}),D=Xe=>Be(void 0,null,function*(){N(!0);let he=yield(0,pe.ZP)(`/api/courses/${wt==null?void 0:wt.coursesId}/ilearning_resource.json`,{method:"get",params:Oe({type:2},Xe)});he!=null&&he.videos&&(ae((he==null?void 0:he.videos)||[]),j(he==null?void 0:he.total_count)),N(!1)}),_=Xe=>{Ee==="1"?q(Xe):D(Xe)},ne=Xe=>{yt(Xe.key)},De=[{name:"\u5B9E\u8BAD\u8D44\u6E90\u63A8\u8350",id:"1"},{name:"\u89C6\u9891\u8D44\u6E90\u63A8\u8350",id:"2"}],Se=Xe=>{S.page=Xe,I(Oe({},S)),Ee==="1"?q(S):D(S)},Qe=Xe=>Be(void 0,null,function*(){const he=yield(0,pe.ZP)(`/api/shixuns/${Xe.identifier}/send_to_course.json`,{method:"post",body:{id:Xe.identifier,identifier:Xe.identifier,courses:[{course_id:wt==null?void 0:wt.coursesId,id:Xe.identifier,identifier:Xe.identifier,type:"normal",is_use:1,is_copy:0}]}});(he==null?void 0:he.status)===1&&(Pt({type:"classroomList/getClassroomLeftMenus",payload:{id:wt.coursesId}}),W.ZP.success("\u4F7F\u7528\u6210\u529F"))}),Re=Xe=>Be(void 0,null,function*(){const he="jpl5vs26";console.log(Xe);const Dt=yield(0,pe.ZP)(`/api/paths/${Xe==null?void 0:Xe.subject_identifier}/send_to_course.json`,{method:"post",body:{course_id:bt==null?void 0:bt.course_id,id:Xe==null?void 0:Xe.subject_identifier,stage_shixuns:[{stage_shixun_id:Xe.stage_shixun_id,is_copy:0,is_use:1}],type:"video",sync_catelog:0}});(Dt==null?void 0:Dt.status)===1&&(Pt({type:"classroomList/getClassroomLeftMenus",payload:{id:wt==null?void 0:wt.coursesId}}),W.ZP.success("\u4F7F\u7528\u6210\u529F"))}),we=()=>R.createElement("div",{className:Je.listWrap},V==null?void 0:V.map((Xe,he)=>R.createElement("div",{key:Xe.id,className:Je.list},R.createElement("div",{className:Je.top},R.createElement("aside",{title:Xe.name},Xe.name),R.createElement("div",{onClick:()=>Qe(Xe)},"\u4F7F\u7528\u5B9E\u8BAD")),R.createElement("div",{className:Je.bottom},R.createElement("div",{className:Je.tag},Xe==null?void 0:Xe.author_name),R.createElement("div",{className:Je.tag},Xe==null?void 0:Xe.author_school_name),R.createElement("div",{className:Je.tag},R.createElement("span",null,"\u5173\u5361"),Xe==null?void 0:Xe.challenges_count),R.createElement("div",{className:Je.tag},R.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),Xe==null?void 0:Xe.myshixuns_count),R.createElement("div",{className:Je.rate},R.createElement(ee.Z,{allowHalf:!0,disabled:!0,defaultValue:Xe.score_info}),R.createElement("span",{className:"font14"},"\xA0",Xe.score_info?`${Xe.score_info}\u5206`:"5\u5206")))))),He=()=>R.createElement("div",{className:Je.videoWrap},R.createElement(Ue,{params:wt,dispatch:Pt,data:V,onSend:Re})),ft=!!(bt!=null&&bt.sub_discipline_id);return console.log("detailTopBanner"),console.log(!!(bt!=null&&bt.sub_discipline_id)),R.createElement("section",{className:Je.wrap},R.createElement(We.Z,{isLoading:!1,tabDataSource:De,isAdmin:(0,ue.GJ)(),onTabMenuClick:ne,defaultSelectedKeys:[Ee],extraNode:(0,ue.GJ)()&&ft&&R.createElement("span",{className:"c-blue font14 ml20 current",onClick:Xe=>{Xe.preventDefault(),_(S)}},R.createElement("i",{className:"iconfont icon-huanyipi font14 mr5"}),"\u6362\u4E00\u6279")}),R.createElement(H.Z,{spinning:A},F===0?R.createElement(de.Z,null):Ee==="1"?we():He()),R.createElement(K.Z,{hideOnSinglePage:!0,onChange:Xe=>Se(Xe),current:S.page,pageSize:S.limit,total:F,showQuickJumper:!0,showSizeChanger:!1,showTotal:Xe=>R.createElement("span",{className:"mr10"},"\u5171",R.createElement("span",{className:"c-orange"},Xe),"\u6761\u6570\u636E"),className:"tr pb20"}))};var ye=(0,P.connect)(({classroomList:Te,user:Pe,globalSetting:Ce})=>({user:Pe,classroomList:Te,globalSetting:Ce}))(it)},62202:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return k}});var R=y(59301),P=y(95237),W=y(43604),ee=y(20834),H=y(38854),K=y(8591),pe=y(6848),ue={tabMenuContainer:"tabMenuContainer___uf5IP",control:"control___GheLs",iconH:"iconH___Wzw_r",selectBtn:"selectBtn___mfEnI",selectBtn1:"selectBtn1___rJF8S"},de=y(89070),B=y(24065),k=({isLoading:m,addText:J,tabDataSource:$,isAdmin:ze,dispatch:st,classroomList:me,type:Q,isExercise:se,defaultSelectedKeys:te,onTabMenuClick:b,getDropdownMenu:C,showControlButton:z,buttonText:G,buttonIcon:Me="icon-tianjiadaohang",extraNode:Ue,user:Je,onButtonClick:We,isModelUser:ie,menuItemWidth:Y=125})=>{var fe,O,Ae,Oe,ge;const Be=(0,de.useParams)();return R.createElement("div",{className:ue.tabMenuContainer},R.createElement(P.Z,null,R.createElement(W.Z,{flex:"1"},R.createElement(ee.default,{onSelect:it=>m?{}:b(it),mode:"horizontal",selectedKeys:te},$.map(it=>R.createElement(ee.default.Item,{style:{width:Y},key:typeof it.index=="number"?it.index:it.id},R.createElement("span",{className:"c-grey-666"},it.name),it.total!==void 0&&ze&&R.createElement("span",{className:"c-grey-999 ml20"},it.total||0))))),ze&&se&&R.createElement("i",{className:"iconfont icon-shezhi8",style:{display:"flex",alignItems:"center",cursor:"pointer"},onClick:()=>{st({type:"classroomList/setActionTabs",payload:{key:"\u5728\u7EBF\u8003\u8BD5\u8BBE\u7F6E"}})}}),ze&&R.createElement(W.Z,{className:"mr20 gutter-row",style:{display:"flex",alignItems:"center",color:"#0152d9",paddingBottom:3}},se&&R.createElement(H.Z,{className:"mr15",placement:"bottom",arrow:!0,dropdownRender:()=>R.createElement(ee.default,null,R.createElement(ee.default.Item,{key:1,onClick:()=>{var it;if((0,B.Rm)()&&!((it=me.AssistantObject.exercise)!=null&&it.can_download)){K.ZP.warning("\u60A8\u672A\u83B7\u53D6\u6B64\u6743\u9650\uFF0C\u9700\u5411\u8BFE\u5802\u7BA1\u7406\u5458\u7533\u8BF7\u6743\u9650\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD");return}st({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u6210\u7EE9",type:Q,exportType:"exercise",category_id:Be.categoryId}})}},"\u5B66\u751F\u6210\u7EE9"),R.createElement(ee.default.Item,{key:3,onClick:()=>{var it;if((0,B.Rm)()&&!((it=me.AssistantObject.exercise)!=null&&it.can_download)){K.ZP.warning("\u60A8\u672A\u83B7\u53D6\u6B64\u6743\u9650\uFF0C\u9700\u5411\u8BFE\u5802\u7BA1\u7406\u5458\u7533\u8BF7\u6743\u9650\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD");return}de.history.push(`/classrooms/${Be==null?void 0:Be.coursesId}/exportlist/exercise_score,export_exercise_users`)}},"\u5386\u53F2\u5BFC\u51FA"))},R.createElement("div",{className:"c-blue font16 ml20 current",style:{marginTop:2}},R.createElement("span",{style:{color:"#666666",cursor:"pointer"}},R.createElement("i",{className:"iconfont icon-xiazai6"})))),R.createElement("div",{className:ue.control},R.createElement("div",{className:ue.extra},Ue),z&&(G=="\u6DFB\u52A0\u76F4\u64AD"?R.createElement(H.Z,{menu:{items:(O=(fe=[{label:R.createElement("div",{onClick:()=>{We("\u5916\u94FE")}},"\u5916\u94FE\u76F4\u64AD"),key:"1",show:!0},ie&&{label:R.createElement("div",{onClick:()=>{We("\u5934\u6B4C")}},"\u5934\u6B4C\u76F4\u64AD"),key:"2",show:!0}])==null?void 0:fe.filter(it=>it==null?void 0:it.show))==null?void 0:O.map(it=>({label:it==null?void 0:it.label,key:it==null?void 0:it.key}))}},R.createElement("span",{className:ue.selectBtn},R.createElement("span",null,R.createElement("i",{className:`iconfont ${Me}`})),R.createElement("span",null,G))):R.createElement("span",{onClick:We,style:{cursor:"pointer"},className:ue.selectBtn},R.createElement("span",null,R.createElement("i",{className:`iconfont ${Me}`})),R.createElement("span",null,G))),!!C&&R.createElement(H.Z,{disabled:((Ae=Je==null?void 0:Je.userInfo)==null?void 0:Ae.user_status)===2,className:"ml10",dropdownRender:C},R.createElement("span",{className:((Oe=Je==null?void 0:Je.userInfo)==null?void 0:Oe.user_status)===2?ue.selectBtn1:ue.selectBtn},R.createElement("span",null,R.createElement("i",{className:"iconfont icon-tianjiadaohang"})),R.createElement(pe.Z,{title:((ge=Je==null?void 0:Je.userInfo)==null?void 0:ge.user_status)===2&&"\u6559\u5B66\u8BFE\u5802\u8BD5\u7528\u671F\u5DF2\u7ED3\u675F\uFF0C\u5E73\u53F0\u5DF2\u6682\u505C\u63D0\u4F9B\u5728\u7EBF\u8003\u8BD5\u521B\u5EFA\u529F\u80FD"},R.createElement("span",null,J||"\u521B\u5EFA\u8BD5\u5377"))))))))}},4901:function(Wt,nt,y){"use strict";y.d(nt,{BU:function(){return P},Dj:function(){return R},gH:function(){return W},vp:function(){return ee}});function R(H){try{H.mozRequestFullScreen?H.mozRequestFullScreen():H.webkitRequestFullScreen&&H.webkitRequestFullScreen()}catch(K){console.log(K,":e")}}function P(){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 W=()=>{if(document.webkitExitFullscreen)return"webkitfullscreenchange";if(document.exitFullscreen)return"fullscreenchange";if(document.msExitFullscreen)return"msfullscreenchange";if(document.mozCancelFullScreen)return"mozfullscreenchange"};function ee(){var H=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement,K=document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",H),window.isFullScreen?window.isFullScreen:H!=null}},29382:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return nr}});class R{static install(){Object.setPrototypeOf=Object.setPrototypeOf||function(l,f){return l.__proto__=f,l},Object.assign=Object.assign||function(l){if(l==null)throw new TypeError("Cannot convert undefined or null to object");let f=Object(l);for(let p=1;p ${f}`;H.ENABLE_CALLBACK&&H.emitter.emit("log","error",p),H.ENABLE_ERROR&&(console.error?console.error(p):console.warn?console.warn(p):console.log(p))}static i(l,f){(!l||H.FORCE_GLOBAL_TAG)&&(l=H.GLOBAL_TAG);let p=`[${l}] > ${f}`;H.ENABLE_CALLBACK&&H.emitter.emit("log","info",p),H.ENABLE_INFO&&(console.info?console.info(p):console.log(p))}static w(l,f){(!l||H.FORCE_GLOBAL_TAG)&&(l=H.GLOBAL_TAG);let p=`[${l}] > ${f}`;H.ENABLE_CALLBACK&&H.emitter.emit("log","warn",p),H.ENABLE_WARN&&(console.warn?console.warn(p):console.log(p))}static d(l,f){(!l||H.FORCE_GLOBAL_TAG)&&(l=H.GLOBAL_TAG);let p=`[${l}] > ${f}`;H.ENABLE_CALLBACK&&H.emitter.emit("log","debug",p),H.ENABLE_DEBUG&&(console.debug?console.debug(p):console.log(p))}static v(l,f){(!l||H.FORCE_GLOBAL_TAG)&&(l=H.GLOBAL_TAG);let p=`[${l}] > ${f}`;H.ENABLE_CALLBACK&&H.emitter.emit("log","verbose",p),H.ENABLE_VERBOSE&&console.log(p)}}H.GLOBAL_TAG="flv.js",H.FORCE_GLOBAL_TAG=!1,H.ENABLE_ERROR=!0,H.ENABLE_INFO=!0,H.ENABLE_WARN=!0,H.ENABLE_DEBUG=!0,H.ENABLE_VERBOSE=!0,H.ENABLE_CALLBACK=!1,H.emitter=new(ee());var K=H;class pe{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(l){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=l,this._totalBytes+=l):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=l,this._totalBytes+=l):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=l,this._totalBytes+=l,this._lastCheckpoint=this._now())}get currentKBps(){this.addBytes(0);let l=(this._now()-this._lastCheckpoint)/1e3;return l==0&&(l=1),this._intervalBytes/l/1024}get lastSecondKBps(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}get averageKBps(){let l=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/l/1024}}var ue=pe;class de{constructor(l){this._message=l}get name(){return"RuntimeException"}get message(){return this._message}toString(){return this.name+": "+this.message}}class B extends de{constructor(l){super(l)}get name(){return"IllegalStateException"}}class je extends de{constructor(l){super(l)}get name(){return"InvalidArgumentException"}}class k extends de{constructor(l){super(l)}get name(){return"NotImplementedException"}}const m={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},J={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"};class ${constructor(l){this._type=l||"undefined",this._status=m.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}destroy(){this._status=m.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}isWorking(){return this._status===m.kConnecting||this._status===m.kBuffering}get type(){return this._type}get status(){return this._status}get needStashBuffer(){return this._needStash}get onContentLengthKnown(){return this._onContentLengthKnown}set onContentLengthKnown(l){this._onContentLengthKnown=l}get onURLRedirect(){return this._onURLRedirect}set onURLRedirect(l){this._onURLRedirect=l}get onDataArrival(){return this._onDataArrival}set onDataArrival(l){this._onDataArrival=l}get onError(){return this._onError}set onError(l){this._onError=l}get onComplete(){return this._onComplete}set onComplete(l){this._onComplete=l}open(l,f){throw new k("Unimplemented abstract function!")}abort(){throw new k("Unimplemented abstract function!")}}let ze={};function st(){let ut=self.navigator.userAgent.toLowerCase(),l=/(edge)\/([\w.]+)/.exec(ut)||/(opr)[\/]([\w.]+)/.exec(ut)||/(chrome)[ \/]([\w.]+)/.exec(ut)||/(iemobile)[\/]([\w.]+)/.exec(ut)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ut)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ut)||/(webkit)[ \/]([\w.]+)/.exec(ut)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ut)||/(msie) ([\w.]+)/.exec(ut)||ut.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(ut)||ut.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(ut)||[],f=/(ipad)/.exec(ut)||/(ipod)/.exec(ut)||/(windows phone)/.exec(ut)||/(iphone)/.exec(ut)||/(kindle)/.exec(ut)||/(android)/.exec(ut)||/(windows)/.exec(ut)||/(mac)/.exec(ut)||/(linux)/.exec(ut)||/(cros)/.exec(ut)||[],p={browser:l[5]||l[3]||l[1]||"",version:l[2]||l[4]||"0",majorVersion:l[4]||l[2]||"0",platform:f[0]||""},d={};if(p.browser){d[p.browser]=!0;let g=p.majorVersion.split(".");d.version={major:parseInt(p.majorVersion,10),string:p.version},g.length>1&&(d.version.minor=parseInt(g[1],10)),g.length>2&&(d.version.build=parseInt(g[2],10))}if(p.platform&&(d[p.platform]=!0),(d.chrome||d.opr||d.safari)&&(d.webkit=!0),d.rv||d.iemobile){d.rv&&delete d.rv;let g="msie";p.browser=g,d[g]=!0}if(d.edge){delete d.edge;let g="msedge";p.browser=g,d[g]=!0}if(d.opr){let g="opera";p.browser=g,d[g]=!0}if(d.safari&&d.android){let g="android";p.browser=g,d[g]=!0}d.name=p.browser,d.platform=p.platform;for(let g in ze)ze.hasOwnProperty(g)&&delete ze[g];Object.assign(ze,d)}st();var me=ze;class Q extends ${static isSupported(){try{let l=me.msedge&&me.version.minor>=15048,f=me.msedge?l:!0;return self.fetch&&self.ReadableStream&&f}catch(l){return!1}}constructor(l,f){super("fetch-stream-loader"),this.TAG="FetchStreamLoader",this._seekHandler=l,this._config=f,this._needStash=!0,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),super.destroy()}open(l,f){this._dataSource=l,this._range=f;let p=l.url;this._config.reuseRedirectedURL&&l.redirectedURL!=null&&(p=l.redirectedURL);let d=this._seekHandler.getConfig(p,f),g=new self.Headers;if(typeof d.headers=="object"){let E=d.headers;for(let X in E)E.hasOwnProperty(X)&&g.append(X,E[X])}let x={method:"GET",headers:g,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(let E in this._config.headers)g.append(E,this._config.headers[E]);l.cors===!1&&(x.mode="same-origin"),l.withCredentials&&(x.credentials="include"),l.referrerPolicy&&(x.referrerPolicy=l.referrerPolicy),this._status=m.kConnecting,self.fetch(d.url,x).then(E=>{if(this._requestAbort){this._requestAbort=!1,this._status=m.kIdle;return}if(E.ok&&E.status>=200&&E.status<=299){if(E.url!==d.url&&this._onURLRedirect){let Z=this._seekHandler.removeURLParameters(E.url);this._onURLRedirect(Z)}let X=E.headers.get("Content-Length");return X!=null&&(this._contentLength=parseInt(X),this._contentLength!==0&&this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)),this._pump.call(this,E.body.getReader())}else if(this._status=m.kError,this._onError)this._onError(J.HTTP_STATUS_CODE_INVALID,{code:E.status,msg:E.statusText});else throw new de("FetchStreamLoader: Http code invalid, "+E.status+" "+E.statusText)}).catch(E=>{if(this._status=m.kError,this._onError)this._onError(J.EXCEPTION,{code:-1,msg:E.message});else throw E})}abort(){this._requestAbort=!0}_pump(l){return l.read().then(f=>{if(f.done)if(this._contentLength!==null&&this._receivedLength{if(f.code===11&&me.msedge)return;this._status=m.kError;let p=0,d=null;if((f.code===19||f.message==="network error")&&(this._contentLength===null||this._contentLength!==null&&this._receivedLength299))if(this._status=m.kError,this._onError)this._onError(J.HTTP_STATUS_CODE_INVALID,{code:f.status,msg:f.statusText});else throw new de("MozChunkedLoader: Http code invalid, "+f.status+" "+f.statusText);else this._status=m.kBuffering}}_onProgress(l){if(this._status===m.kError)return;this._contentLength===null&&l.total!==null&&l.total!==0&&(this._contentLength=l.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));let f=l.target.response,p=this._range.from+this._receivedLength;this._receivedLength+=f.byteLength,this._onDataArrival&&this._onDataArrival(f,p,this._receivedLength)}_onLoadEnd(l){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===m.kError)return;this._status=m.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}_onXhrError(l){this._status=m.kError;let f=0,p=null;if(this._contentLength&&l.loaded=200&&f.status<=299){if(this._status=LoaderStatus.kBuffering,f.responseURL!=null){let d=this._seekHandler.removeURLParameters(f.responseURL);f.responseURL!==this._currentRequestURL&&d!==this._currentRedirectedURL&&(this._currentRedirectedURL=d,this._onURLRedirect&&this._onURLRedirect(d))}let p=f.getResponseHeader("Content-Length");if(p!=null&&this._contentLength==null){let d=parseInt(p);d>0&&(this._contentLength=d,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=LoaderStatus.kError,this._onError)this._onError(LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:f.status,msg:f.statusText});else throw new RuntimeException("MSStreamLoader: Http code invalid, "+f.status+" "+f.statusText);else if(f.readyState===3&&f.status>=200&&f.status<=299){this._status=LoaderStatus.kBuffering;let p=f.response;this._reader.readAsArrayBuffer(p)}}_xhrOnError(l){this._status=LoaderStatus.kError;let f=LoaderErrors.EXCEPTION,p={code:-1,msg:l.constructor.name+" "+l.type};if(this._onError)this._onError(f,p);else throw new RuntimeException(p.msg)}_msrOnProgress(l){let p=l.target.result;if(p==null){this._doReconnectIfNeeded();return}let d=p.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=p.byteLength;let g=this._totalRange.from+this._receivedLength;this._receivedLength+=d.byteLength,this._onDataArrival&&this._onDataArrival(d,g,this._receivedLength),p.byteLength>=this._bufferLimit&&(Log.v(this.TAG,`MSStream buffer exceeded max size near ${g+d.byteLength}, reconnecting...`),this._doReconnectIfNeeded())}_doReconnectIfNeeded(){if(this._contentLength==null||this._receivedLength=this._contentLength&&(p=this._range.from+this._contentLength-1),this._currentRequestRange={from:f,to:p},this._internalOpen(this._dataSource,this._currentRequestRange)}_internalOpen(l,f){this._lastTimeLoaded=0;let p=l.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?p=this._currentRedirectedURL:l.redirectedURL!=null&&(p=l.redirectedURL));let d=this._seekHandler.getConfig(p,f);this._currentRequestURL=d.url;let g=this._xhr=new XMLHttpRequest;if(g.open("GET",d.url,!0),g.responseType="arraybuffer",g.onreadystatechange=this._onReadyStateChange.bind(this),g.onprogress=this._onProgress.bind(this),g.onload=this._onLoad.bind(this),g.onerror=this._onXhrError.bind(this),l.withCredentials&&(g.withCredentials=!0),typeof d.headers=="object"){let x=d.headers;for(let E in x)x.hasOwnProperty(E)&&g.setRequestHeader(E,x[E])}if(typeof this._config.headers=="object"){let x=this._config.headers;for(let E in x)x.hasOwnProperty(E)&&g.setRequestHeader(E,x[E])}g.send()}abort(){this._requestAbort=!0,this._internalAbort(),this._status=m.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(l){let f=l.target;if(f.readyState===2){if(f.responseURL!=null){let p=this._seekHandler.removeURLParameters(f.responseURL);f.responseURL!==this._currentRequestURL&&p!==this._currentRedirectedURL&&(this._currentRedirectedURL=p,this._onURLRedirect&&this._onURLRedirect(p))}if(f.status>=200&&f.status<=299){if(this._waitForTotalLength)return;this._status=m.kBuffering}else if(this._status=m.kError,this._onError)this._onError(J.HTTP_STATUS_CODE_INVALID,{code:f.status,msg:f.statusText});else throw new de("RangeLoader: Http code invalid, "+f.status+" "+f.statusText)}}_onProgress(l){if(this._status===m.kError)return;if(this._contentLength===null){let p=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,p=!0;let d=l.total;this._internalAbort(),d!=null&d!==0&&(this._totalLength=d)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,p){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}let f=l.loaded-this._lastTimeLoaded;this._lastTimeLoaded=l.loaded,this._speedSampler.addBytes(f)}_normalizeSpeed(l){let f=this._chunkSizeKBList,p=f.length-1,d=0,g=0,x=p;if(l=f[d]&&l=3&&(f=this._speedSampler.currentKBps)),f!==0){let x=this._normalizeSpeed(f);this._currentSpeedNormalized!==x&&(this._currentSpeedNormalized=x,this._currentChunkSizeKB=x)}let p=l.target.response,d=this._range.from+this._receivedLength;this._receivedLength+=p.byteLength;let g=!1;this._contentLength!=null&&this._receivedLength0&&this._receivedLength{this._dispatchArrayBuffer(f.result)},f.readAsArrayBuffer(l.data)}else{this._status=m.kError;let f={code:-1,msg:"Unsupported WebSocket message type: "+l.data.constructor.name};if(this._onError)this._onError(J.EXCEPTION,f);else throw new de(f.msg)}}_dispatchArrayBuffer(l){let f=l,p=this._receivedLength;this._receivedLength+=f.byteLength,this._onDataArrival&&this._onDataArrival(f,p,this._receivedLength)}_onWebSocketError(l){this._status=m.kError;let f={code:l.code,msg:l.message};if(this._onError)this._onError(J.EXCEPTION,f);else throw new de(f.msg)}}var Je=Ue;class We{constructor(l){this._zeroStart=l||!1}getConfig(l,f){let p={};if(f.from!==0||f.to!==-1){let d;f.to!==-1?d=`bytes=${f.from.toString()}-${f.to.toString()}`:d=`bytes=${f.from.toString()}-`,p.Range=d}else this._zeroStart&&(p.Range="bytes=0-");return{url:l,headers:p}}removeURLParameters(l){return l}}var ie=We;class Y{constructor(l,f){this._startName=l,this._endName=f}getConfig(l,f){let p=l;if(f.from!==0||f.to!==-1){let d=!0;p.indexOf("?")===-1&&(p+="?",d=!1),d&&(p+="&"),p+=`${this._startName}=${f.from.toString()}`,f.to!==-1&&(p+=`&${this._endName}=${f.to.toString()}`)}return{url:p,headers:{}}}removeURLParameters(l){let f=l.split("?")[0],p,d=l.indexOf("?");d!==-1&&(p=l.substring(d+1));let g="";if(p!=null&&p.length>0){let x=p.split("&");for(let E=0;E0;X[0]!==this._startName&&X[0]!==this._endName&&(Z&&(g+="&"),g+=x[E])}}return g.length===0?f:f+"?"+g}}var fe=Y;class O{constructor(l,f,p){this.TAG="IOController",this._config=f,this._extraData=p,this._stashInitialSize=1024*384,f.stashInitialSize!=null&&f.stashInitialSize>0&&(this._stashInitialSize=f.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,f.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=l,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(l.url),this._refTotalLength=l.filesize?l.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new ue,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(l){this._extraData=l}get onDataArrival(){return this._onDataArrival}set onDataArrival(l){this._onDataArrival=l}get onSeeked(){return this._onSeeked}set onSeeked(l){this._onSeeked=l}get onError(){return this._onError}set onError(l){this._onError=l}get onComplete(){return this._onComplete}set onComplete(l){this._onComplete=l}get onRedirect(){return this._onRedirect}set onRedirect(l){this._onRedirect=l}get onRecoveredEarlyEof(){return this._onRecoveredEarlyEof}set onRecoveredEarlyEof(l){this._onRecoveredEarlyEof=l}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===Me?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}get loaderType(){return this._loader.type}_selectSeekHandler(){let l=this._config;if(l.seekType==="range")this._seekHandler=new ie(this._config.rangeLoadZeroStart);else if(l.seekType==="param"){let f=l.seekParamStart||"bstart",p=l.seekParamEnd||"bend";this._seekHandler=new fe(f,p)}else if(l.seekType==="custom"){if(typeof l.customSeekHandler!="function")throw new je("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new l.customSeekHandler}else throw new je(`Invalid seekType in config: ${l.seekType}`)}_selectLoader(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=Je;else if(se.isSupported())this._loaderClass=se;else if(b.isSupported())this._loaderClass=b;else if(Me.isSupported())this._loaderClass=Me;else throw new de("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(l){this._currentRange={from:0,to:-1},l&&(this._currentRange.from=l),this._speedSampler.reset(),l||(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 l=this._resumeFrom;this._resumeFrom=0,this._internalSeek(l,!0)}}seek(l){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(l,!0)}_internalSeek(l,f){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(f),this._loader.destroy(),this._loader=null;let p={from:l,to:-1};this._currentRange={from:p.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,p),this._onSeeked&&this._onSeeked()}updateUrl(l){if(!l||typeof l!="string"||l.length===0)throw new je("Url must be a non-empty string!");this._dataSource.url=l}_expandBuffer(l){let f=this._stashSize;for(;f+1024*1024*10){let d=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(p,0,f).set(d,0)}this._stashBuffer=p,this._bufferSize=f}_normalizeSpeed(l){let f=this._speedNormalizeList,p=f.length-1,d=0,g=0,x=p;if(l=f[d]&&l=512&&l<=1024?f=Math.floor(l*1.5):f=l*2,f>8192&&(f=8192);let p=f*1024+1024*1024*1;this._bufferSize0){let x=this._stashBuffer.slice(0,this._stashUsed),E=this._dispatchChunks(x,this._stashByteStart);if(E0){let X=new Uint8Array(x,E);g.set(X,0),this._stashUsed=X.byteLength,this._stashByteStart+=E}}else this._stashUsed=0,this._stashByteStart+=E;this._stashUsed+l.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+l.byteLength),g=new Uint8Array(this._stashBuffer,0,this._bufferSize)),g.set(new Uint8Array(l),this._stashUsed),this._stashUsed+=l.byteLength}else{let x=this._dispatchChunks(l,f);if(xthis._bufferSize&&(this._expandBuffer(E),g=new Uint8Array(this._stashBuffer,0,this._bufferSize)),g.set(new Uint8Array(l,x),0),this._stashUsed+=E,this._stashByteStart=f+x}}}else if(this._stashUsed===0){let g=this._dispatchChunks(l,f);if(gthis._bufferSize&&this._expandBuffer(x),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(l,g),0),this._stashUsed+=x,this._stashByteStart=f+g}}else{this._stashUsed+l.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+l.byteLength);let g=new Uint8Array(this._stashBuffer,0,this._bufferSize);g.set(new Uint8Array(l),this._stashUsed),this._stashUsed+=l.byteLength;let x=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(x0){let E=new Uint8Array(this._stashBuffer,x);g.set(E,0)}this._stashUsed-=x,this._stashByteStart+=x}}_flushStashBuffer(l){if(this._stashUsed>0){let f=this._stashBuffer.slice(0,this._stashUsed),p=this._dispatchChunks(f,this._stashByteStart),d=f.byteLength-p;if(p0){let g=new Uint8Array(this._stashBuffer,0,this._bufferSize),x=new Uint8Array(f,p);g.set(x,0),this._stashUsed=x.byteLength,this._stashByteStart+=p}return 0}return this._stashUsed=0,this._stashByteStart=0,d}return 0}_onLoaderComplete(l,f){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}_onLoaderError(l,f){switch(K.e(this.TAG,`Loader error, code = ${f.code}, msg = ${f.msg}`),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,l=J.UNRECOVERABLE_EARLY_EOF),l){case J.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){let p=this._currentRange.to+1;p0){let f=Pe.getConfig();l.emit("change",f)}}static registerListener(l){Pe.emitter.addListener("change",l)}static removeListener(l){Pe.emitter.removeListener("change",l)}static addLogListener(l){K.emitter.addListener("log",l),K.emitter.listenerCount("log")>0&&(K.ENABLE_CALLBACK=!0,Pe._notifyChange())}static removeLogListener(l){K.emitter.removeListener("log",l),K.emitter.listenerCount("log")===0&&(K.ENABLE_CALLBACK=!1,Pe._notifyChange())}}Pe.emitter=new(ee());var Ce=Pe;class at{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 l=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,f=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&&l&&f}isSeekable(){return this.hasKeyframesIndex===!0}getNearestKeyframe(l){if(this.keyframesIndex==null)return null;let f=this.keyframesIndex,p=this._search(f.times,l);return{index:p,milliseconds:f.times[p],fileposition:f.filepositions[p]}}_search(l,f){let p=0,d=l.length-1,g=0,x=0,E=d;for(f=l[g]&&f=128){l.push(String.fromCharCode(g&65535)),p+=2;continue}}}else if(f[p]<240){if(Pt(f,p,2)){let g=(f[p]&15)<<12|(f[p+1]&63)<<6|f[p+2]&63;if(g>=2048&&(g&63488)!==55296){l.push(String.fromCharCode(g&65535)),p+=3;continue}}}else if(f[p]<248&&Pt(f,p,3)){let g=(f[p]&7)<<18|(f[p+1]&63)<<12|(f[p+2]&63)<<6|f[p+3]&63;if(g>65536&&g<1114112){g-=65536,l.push(String.fromCharCode(g>>>10|55296)),l.push(String.fromCharCode(g&1023|56320)),p+=4;continue}}}l.push("\uFFFD"),++p}return l.join("")}var wt=Xt;let bt=function(){let ut=new ArrayBuffer(2);return new DataView(ut).setInt16(0,256,!0),new Int16Array(ut)[0]===256}();class Ht{static parseScriptData(l,f,p){let d={};try{let g=Ht.parseValue(l,f,p),x=Ht.parseValue(l,f+g.size,p-g.size);d[g.data]=x.data}catch(g){K.e("AMF",g.toString())}return d}static parseObject(l,f,p){if(p<3)throw new B("Data not enough when parse ScriptDataObject");let d=Ht.parseString(l,f,p),g=Ht.parseValue(l,f+d.size,p-d.size),x=g.objectEnd;return{data:{name:d.data,value:g.data},size:d.size+g.size,objectEnd:x}}static parseVariable(l,f,p){return Ht.parseObject(l,f,p)}static parseString(l,f,p){if(p<2)throw new B("Data not enough when parse String");let g=new DataView(l,f,p).getUint16(0,!bt),x;return g>0?x=wt(new Uint8Array(l,f+2,g)):x="",{data:x,size:2+g}}static parseLongString(l,f,p){if(p<4)throw new B("Data not enough when parse LongString");let g=new DataView(l,f,p).getUint32(0,!bt),x;return g>0?x=wt(new Uint8Array(l,f+4,g)):x="",{data:x,size:4+g}}static parseDate(l,f,p){if(p<10)throw new B("Data size invalid when parse Date");let d=new DataView(l,f,p),g=d.getFloat64(0,!bt),x=d.getInt16(8,!bt);return g+=x*60*1e3,{data:new Date(g),size:10}}static parseValue(l,f,p){if(p<1)throw new B("Data not enough when parse Value");let d=new DataView(l,f,p),g=1,x=d.getUint8(0),E,X=!1;try{switch(x){case 0:E=d.getFloat64(1,!bt),g+=8;break;case 1:{E=!!d.getUint8(1),g+=1;break}case 2:{let Z=Ht.parseString(l,f+1,p-1);E=Z.data,g+=Z.size;break}case 3:{E={};let Z=0;for((d.getUint32(p-4,!bt)&16777215)===9&&(Z=3);g32)throw new je("ExpGolomb: readBits() bits exceeded max 32bits!");if(l<=this._current_word_bits_left){let x=this._current_word>>>32-l;return this._current_word<<=l,this._current_word_bits_left-=l,x}let f=this._current_word_bits_left?this._current_word:0;f=f>>>32-this._current_word_bits_left;let p=l-this._current_word_bits_left;this._fillCurrentWord();let d=Math.min(p,this._current_word_bits_left),g=this._current_word>>>32-d;return this._current_word<<=d,this._current_word_bits_left-=d,f=f<>>l)return this._current_word<<=l,this._current_word_bits_left-=l,l;return this._fillCurrentWord(),l+this._skipLeadingZero()}readUEG(){let l=this._skipLeadingZero();return this.readBits(l+1)-1}readSEG(){let l=this.readUEG();return l&1?l+1>>>1:-1*(l>>>1)}}var yt=Ee;class F{static _ebsp2rbsp(l){let f=l,p=f.byteLength,d=new Uint8Array(p),g=0;for(let x=0;x=2&&f[x]===3&&f[x-1]===0&&f[x-2]===0||(d[g]=f[x],g++);return new Uint8Array(d.buffer,0,g)}static parseSPS(l){let f=F._ebsp2rbsp(l),p=new yt(f);p.readByte();let d=p.readByte();p.readByte();let g=p.readByte();p.readUEG();let x=F.getProfileString(d),E=F.getLevelString(g),X=1,Z=420,le=[0,420,422,444],xe=8;if((d===100||d===110||d===122||d===244||d===44||d===83||d===86||d===118||d===128||d===138||d===144)&&(X=p.readUEG(),X===3&&p.readBits(1),X<=3&&(Z=le[X]),xe=p.readUEG()+8,p.readUEG(),p.readBits(1),p.readBool())){let _t=X!==3?8:12;for(let Nt=0;Nt<_t;Nt++)p.readBool()&&(Nt<6?F._skipScalingList(p,16):F._skipScalingList(p,64))}p.readUEG();let Fe=p.readUEG();if(Fe===0)p.readUEG();else if(Fe===1){p.readBits(1),p.readSEG(),p.readSEG();let _t=p.readUEG();for(let Nt=0;Nt<_t;Nt++)p.readSEG()}let ve=p.readUEG();p.readBits(1);let qe=p.readUEG(),ke=p.readUEG(),_e=p.readBits(1);_e===0&&p.readBits(1),p.readBits(1);let Ie=0,tt=0,Ye=0,mt=0;p.readBool()&&(Ie=p.readUEG(),tt=p.readUEG(),Ye=p.readUEG(),mt=p.readUEG());let Ut=1,rt=1,ct=0,oe=!0,ce=0,be=0;if(p.readBool()){if(p.readBool()){let _t=p.readByte(),Nt=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],tn=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];_t>0&&_t<16?(Ut=Nt[_t-1],rt=tn[_t-1]):_t===255&&(Ut=p.readByte()<<8|p.readByte(),rt=p.readByte()<<8|p.readByte())}if(p.readBool()&&p.readBool(),p.readBool()&&(p.readBits(4),p.readBool()&&p.readBits(24)),p.readBool()&&(p.readUEG(),p.readUEG()),p.readBool()){let _t=p.readBits(32),Nt=p.readBits(32);oe=p.readBool(),ce=Nt,be=_t*2,ct=ce/be}}let Le=1;(Ut!==1||rt!==1)&&(Le=Ut/rt);let Ke=0,Ve=0;if(X===0)Ke=1,Ve=2-_e;else{let _t=X===3?1:2,Nt=X===1?2:1;Ke=_t,Ve=Nt*(2-_e)}let lt=(qe+1)*16,Et=(2-_e)*((ke+1)*16);lt-=(Ie+tt)*Ke,Et-=(Ye+mt)*Ve;let St=Math.ceil(lt*Le);return p.destroy(),p=null,{profile_string:x,level_string:E,bit_depth:xe,ref_frames:ve,chroma_format:Z,chroma_format_string:F.getChromaFormatString(Z),frame_rate:{fixed:oe,fps:ct,fps_den:be,fps_num:ce},sar_ratio:{width:Ut,height:rt},codec_size:{width:lt,height:Et},present_size:{width:St,height:Et}}}static _skipScalingList(l,f){let p=8,d=8,g=0;for(let x=0;x>>8&255|(ut&255)<<8}function ae(ut){return(ut&4278190080)>>>24|(ut&16711680)>>>8|(ut&65280)<<8|(ut&255)<<24}function S(ut,l){return ut[l]<<24|ut[l+1]<<16|ut[l+2]<<8|ut[l+3]}class I{constructor(l,f){this.TAG="FLVDemuxer",this._config=f,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=l.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=l.hasAudioTrack,this._hasVideo=l.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new Ot,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 p=new ArrayBuffer(2);return new DataView(p).setInt16(0,256,!0),new Int16Array(p)[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(l){let f=new Uint8Array(l),p={match:!1};if(f[0]!==70||f[1]!==76||f[2]!==86||f[3]!==1)return p;let d=(f[4]&4)>>>2!==0,g=(f[4]&1)!==0,x=S(f,5);return x<9?p:{match:!0,consumed:x,dataOffset:x,hasAudioTrack:d,hasVideoTrack:g}}bindDataSource(l){return l.onDataArrival=this.parseChunks.bind(this),this}get onTrackMetadata(){return this._onTrackMetadata}set onTrackMetadata(l){this._onTrackMetadata=l}get onMediaInfo(){return this._onMediaInfo}set onMediaInfo(l){this._onMediaInfo=l}get onMetaDataArrived(){return this._onMetaDataArrived}set onMetaDataArrived(l){this._onMetaDataArrived=l}get onScriptDataArrived(){return this._onScriptDataArrived}set onScriptDataArrived(l){this._onScriptDataArrived=l}get onError(){return this._onError}set onError(l){this._onError=l}get onDataAvailable(){return this._onDataAvailable}set onDataAvailable(l){this._onDataAvailable=l}get timestampBase(){return this._timestampBase}set timestampBase(l){this._timestampBase=l}get overridedDuration(){return this._duration}set overridedDuration(l){this._durationOverrided=!0,this._duration=l,this._mediaInfo.duration=l}set overridedHasAudio(l){this._hasAudioFlagOverrided=!0,this._hasAudio=l,this._mediaInfo.hasAudio=l}set overridedHasVideo(l){this._hasVideoFlagOverrided=!0,this._hasVideo=l,this._mediaInfo.hasVideo=l}resetMediaInfo(){this._mediaInfo=new Ot}_isInitialMetadataDispatched(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}parseChunks(l,f){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new B("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let p=0,d=this._littleEndian;if(f===0)if(l.byteLength>13)p=I.probe(l).dataOffset;else return 0;for(this._firstParse&&(this._firstParse=!1,f+p!==this._dataOffset&&K.w(this.TAG,"First time parsing but chunk byteStart invalid!"),new DataView(l,p).getUint32(0,!d)!==0&&K.w(this.TAG,"PrevTagSize0 !== 0 !!!"),p+=4);pl.byteLength)break;let x=g.getUint8(0),E=g.getUint32(0,!d)&16777215;if(p+11+E+4>l.byteLength)break;if(x!==8&&x!==9&&x!==18){K.w(this.TAG,`Unsupported tag type ${x}, skipped`),p+=11+E+4;continue}let X=g.getUint8(4),Z=g.getUint8(5),le=g.getUint8(6),xe=g.getUint8(7),Fe=le|Z<<8|X<<16|xe<<24;(g.getUint32(7,!d)&16777215)!==0&&K.w(this.TAG,"Meet tag which has StreamID != 0!");let qe=p+11;switch(x){case 8:this._parseAudioData(l,qe,E,Fe);break;case 9:this._parseVideoData(l,qe,E,Fe,f+p);break;case 18:this._parseScriptData(l,qe,E);break}let ke=g.getUint32(11+E,!d);ke!==11+E&&K.w(this.TAG,`Invalid PrevTagSize ${ke}`),p+=11+E+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),p}_parseScriptData(l,f,p){let d=Jt.parseScriptData(l,f,p);if(d.hasOwnProperty("onMetaData")){if(d.onMetaData==null||typeof d.onMetaData!="object"){K.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&K.w(this.TAG,"Found another onMetaData tag!"),this._metadata=d;let g=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},g)),typeof g.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=g.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof g.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=g.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof g.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=g.audiodatarate),typeof g.videodatarate=="number"&&(this._mediaInfo.videoDataRate=g.videodatarate),typeof g.width=="number"&&(this._mediaInfo.width=g.width),typeof g.height=="number"&&(this._mediaInfo.height=g.height),typeof g.duration=="number"){if(!this._durationOverrided){let x=Math.floor(g.duration*this._timescale);this._duration=x,this._mediaInfo.duration=x}}else this._mediaInfo.duration=0;if(typeof g.framerate=="number"){let x=Math.floor(g.framerate*1e3);if(x>0){let E=x/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=E,this._referenceFrameRate.fps_num=x,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=E}}if(typeof g.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;let x=g.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(x),g.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=g,K.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(d).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},d))}_parseKeyframesIndex(l){let f=[],p=[];for(let d=1;d>>4;if(X!==2&&X!==10){this._onError(N.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+X);return}let Z=0,le=(E&12)>>>2;if(le>=0&&le<=4)Z=this._flvSoundRateTable[le];else{this._onError(N.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+le);return}let xe=(E&2)>>>1,Fe=E&1,ve=this._audioMetadata,qe=this._audioTrack;if(ve||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),ve=this._audioMetadata={},ve.type="audio",ve.id=qe.id,ve.timescale=this._timescale,ve.duration=this._duration,ve.audioSampleRate=Z,ve.channelCount=Fe===0?1:2),X===10){let ke=this._parseAACAudioData(l,f+1,p-1);if(ke==null)return;if(ke.packetType===0){ve.config&&K.w(this.TAG,"Found another AudioSpecificConfig!");let _e=ke.data;ve.audioSampleRate=_e.samplingRate,ve.channelCount=_e.channelCount,ve.codec=_e.codec,ve.originalCodec=_e.originalCodec,ve.config=_e.config,ve.refSampleDuration=1024/ve.audioSampleRate*ve.timescale,K.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",ve);let Ie=this._mediaInfo;Ie.audioCodec=ve.originalCodec,Ie.audioSampleRate=ve.audioSampleRate,Ie.audioChannelCount=ve.channelCount,Ie.hasVideo?Ie.videoCodec!=null&&(Ie.mimeType='video/x-flv; codecs="'+Ie.videoCodec+","+Ie.audioCodec+'"'):Ie.mimeType='video/x-flv; codecs="'+Ie.audioCodec+'"',Ie.isComplete()&&this._onMediaInfo(Ie)}else if(ke.packetType===1){let _e=this._timestampBase+d,Ie={unit:ke.data,length:ke.data.byteLength,dts:_e,pts:_e};qe.samples.push(Ie),qe.length+=ke.data.length}else K.e(this.TAG,`Flv: Unsupported AAC data type ${ke.packetType}`)}else if(X===2){if(!ve.codec){let tt=this._parseMP3AudioData(l,f+1,p-1,!0);if(tt==null)return;ve.audioSampleRate=tt.samplingRate,ve.channelCount=tt.channelCount,ve.codec=tt.codec,ve.originalCodec=tt.originalCodec,ve.refSampleDuration=1152/ve.audioSampleRate*ve.timescale,K.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",ve);let Ye=this._mediaInfo;Ye.audioCodec=ve.codec,Ye.audioSampleRate=ve.audioSampleRate,Ye.audioChannelCount=ve.channelCount,Ye.audioDataRate=tt.bitRate,Ye.hasVideo?Ye.videoCodec!=null&&(Ye.mimeType='video/x-flv; codecs="'+Ye.videoCodec+","+Ye.audioCodec+'"'):Ye.mimeType='video/x-flv; codecs="'+Ye.audioCodec+'"',Ye.isComplete()&&this._onMediaInfo(Ye)}let ke=this._parseMP3AudioData(l,f+1,p-1,!1);if(ke==null)return;let _e=this._timestampBase+d,Ie={unit:ke,length:ke.byteLength,dts:_e,pts:_e};qe.samples.push(Ie),qe.length+=ke.length}}_parseAACAudioData(l,f,p){if(p<=1){K.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}let d={},g=new Uint8Array(l,f,p);return d.packetType=g[0],g[0]===0?d.data=this._parseAACAudioSpecificConfig(l,f+1,p-1):d.data=g.subarray(1),d}_parseAACAudioSpecificConfig(l,f,p){let d=new Uint8Array(l,f,p),g=null,x=0,E=0,X=null,Z=0,le=null;if(x=E=d[0]>>>3,Z=(d[0]&7)<<1|d[1]>>>7,Z<0||Z>=this._mpegSamplingRates.length){this._onError(N.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}let xe=this._mpegSamplingRates[Z],Fe=(d[1]&120)>>>3;if(Fe<0||Fe>=8){this._onError(N.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}x===5&&(le=(d[1]&7)<<1|d[2]>>>7,X=(d[2]&124)>>>2);let ve=self.navigator.userAgent.toLowerCase();return ve.indexOf("firefox")!==-1?Z>=6?(x=5,g=new Array(4),le=Z-3):(x=2,g=new Array(2),le=Z):ve.indexOf("android")!==-1?(x=2,g=new Array(2),le=Z):(x=5,le=Z,g=new Array(4),Z>=6?le=Z-3:Fe===1&&(x=2,g=new Array(2),le=Z)),g[0]=x<<3,g[0]|=(Z&15)>>>1,g[1]=(Z&15)<<7,g[1]|=(Fe&15)<<3,x===5&&(g[1]|=(le&15)>>>1,g[2]=(le&1)<<7,g[2]|=8,g[3]=0),{config:g,samplingRate:xe,channelCount:Fe,codec:"mp4a.40."+x,originalCodec:"mp4a.40."+E}}_parseMP3AudioData(l,f,p,d){if(p<4){K.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}let g=this._littleEndian,x=new Uint8Array(l,f,p),E=null;if(d){if(x[0]!==255)return;let X=x[1]>>>3&3,Z=(x[1]&6)>>1,le=(x[2]&240)>>>4,xe=(x[2]&12)>>>2,ve=(x[3]>>>6&3)!==3?2:1,qe=0,ke=0,_e=34,Ie="mp3";switch(X){case 0:qe=this._mpegAudioV25SampleRateTable[xe];break;case 2:qe=this._mpegAudioV20SampleRateTable[xe];break;case 3:qe=this._mpegAudioV10SampleRateTable[xe];break}switch(Z){case 1:_e=34,le>>4,X=x&15;if(X!==7){this._onError(N.CODEC_UNSUPPORTED,`Flv: Unsupported codec in video frame: ${X}`);return}this._parseAVCVideoPacket(l,f+1,p-1,d,g,E)}_parseAVCVideoPacket(l,f,p,d,g,x){if(p<4){K.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}let E=this._littleEndian,X=new DataView(l,f,p),Z=X.getUint8(0),xe=(X.getUint32(0,!E)&16777215)<<8>>8;if(Z===0)this._parseAVCDecoderConfigurationRecord(l,f+4,p-4);else if(Z===1)this._parseAVCVideoData(l,f+4,p-4,d,g,x,xe);else if(Z!==2){this._onError(N.FORMAT_ERROR,`Flv: Invalid video packet type ${Z}`);return}}_parseAVCDecoderConfigurationRecord(l,f,p){if(p<7){K.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}let d=this._videoMetadata,g=this._videoTrack,x=this._littleEndian,E=new DataView(l,f,p);d?typeof d.avcc!="undefined"&&K.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),d=this._videoMetadata={},d.type="video",d.id=g.id,d.timescale=this._timescale,d.duration=this._duration);let X=E.getUint8(0),Z=E.getUint8(1),le=E.getUint8(2),xe=E.getUint8(3);if(X!==1||Z===0){this._onError(N.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(E.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(N.FORMAT_ERROR,`Flv: Strange NaluLengthSizeMinusOne: ${this._naluLengthSize-1}`);return}let Fe=E.getUint8(5)&31;if(Fe===0){this._onError(N.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else Fe>1&&K.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ${Fe}`);let ve=6;for(let ke=0;ke1&&K.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ${qe}`);ve++;for(let ke=0;ke=p){K.w(this.TAG,`Malformed Nalu near timestamp ${qe}, offset = ${Fe}, dataSize = ${p}`);break}let _e=Z.getUint32(Fe,!X);if(ve===3&&(_e>>>=8),_e>p-ve){K.w(this.TAG,`Malformed Nalus near timestamp ${qe}, NaluSize > DataSize!`);return}let Ie=Z.getUint8(Fe+ve)&31;Ie===5&&(ke=!0);let tt=new Uint8Array(l,f+Fe,ve+_e),Ye={type:Ie,data:tt};le.push(Ye),xe+=tt.byteLength,Fe+=ve+_e}if(le.length){let _e=this._videoTrack,Ie={units:le,length:xe,isKeyframe:ke,dts:qe,cts:E,pts:qe+E};ke&&(Ie.fileposition=g),_e.samples.push(Ie),_e.length+=xe}}}var q=I;class D{static init(){D.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 f in D.types)D.types.hasOwnProperty(f)&&(D.types[f]=[f.charCodeAt(0),f.charCodeAt(1),f.charCodeAt(2),f.charCodeAt(3)]);let l=D.constants={};l.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),l.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),l.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),l.STSC=l.STCO=l.STTS,l.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),l.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]),l.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]),l.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),l.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),l.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}static box(l){let f=8,p=null,d=Array.prototype.slice.call(arguments,1),g=d.length;for(let E=0;E>>24&255,p[1]=f>>>16&255,p[2]=f>>>8&255,p[3]=f&255,p.set(l,4);let x=8;for(let E=0;E>>24&255,l>>>16&255,l>>>8&255,l&255,f>>>24&255,f>>>16&255,f>>>8&255,f&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(l){return D.box(D.types.trak,D.tkhd(l),D.mdia(l))}static tkhd(l){let f=l.id,p=l.duration,d=l.presentWidth,g=l.presentHeight;return D.box(D.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,f>>>24&255,f>>>16&255,f>>>8&255,f&255,0,0,0,0,p>>>24&255,p>>>16&255,p>>>8&255,p&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,d>>>8&255,d&255,0,0,g>>>8&255,g&255,0,0]))}static mdia(l){return D.box(D.types.mdia,D.mdhd(l),D.hdlr(l),D.minf(l))}static mdhd(l){let f=l.timescale,p=l.duration;return D.box(D.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,f>>>24&255,f>>>16&255,f>>>8&255,f&255,p>>>24&255,p>>>16&255,p>>>8&255,p&255,85,196,0,0]))}static hdlr(l){let f=null;return l.type==="audio"?f=D.constants.HDLR_AUDIO:f=D.constants.HDLR_VIDEO,D.box(D.types.hdlr,f)}static minf(l){let f=null;return l.type==="audio"?f=D.box(D.types.smhd,D.constants.SMHD):f=D.box(D.types.vmhd,D.constants.VMHD),D.box(D.types.minf,f,D.dinf(),D.stbl(l))}static dinf(){return D.box(D.types.dinf,D.box(D.types.dref,D.constants.DREF))}static stbl(l){return D.box(D.types.stbl,D.stsd(l),D.box(D.types.stts,D.constants.STTS),D.box(D.types.stsc,D.constants.STSC),D.box(D.types.stsz,D.constants.STSZ),D.box(D.types.stco,D.constants.STCO))}static stsd(l){return l.type==="audio"?l.codec==="mp3"?D.box(D.types.stsd,D.constants.STSD_PREFIX,D.mp3(l)):D.box(D.types.stsd,D.constants.STSD_PREFIX,D.mp4a(l)):D.box(D.types.stsd,D.constants.STSD_PREFIX,D.avc1(l))}static mp3(l){let f=l.channelCount,p=l.audioSampleRate,d=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,f,0,16,0,0,0,0,p>>>8&255,p&255,0,0]);return D.box(D.types[".mp3"],d)}static mp4a(l){let f=l.channelCount,p=l.audioSampleRate,d=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,f,0,16,0,0,0,0,p>>>8&255,p&255,0,0]);return D.box(D.types.mp4a,d,D.esds(l))}static esds(l){let f=l.config||[],p=f.length,d=new Uint8Array([0,0,0,0,3,23+p,0,1,0,4,15+p,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([p]).concat(f).concat([6,1,2]));return D.box(D.types.esds,d)}static avc1(l){let f=l.avcc,p=l.codecWidth,d=l.codecHeight,g=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,p>>>8&255,p&255,d>>>8&255,d&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 D.box(D.types.avc1,g,D.box(D.types.avcC,f))}static mvex(l){return D.box(D.types.mvex,D.trex(l))}static trex(l){let f=l.id,p=new Uint8Array([0,0,0,0,f>>>24&255,f>>>16&255,f>>>8&255,f&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return D.box(D.types.trex,p)}static moof(l,f){return D.box(D.types.moof,D.mfhd(l.sequenceNumber),D.traf(l,f))}static mfhd(l){let f=new Uint8Array([0,0,0,0,l>>>24&255,l>>>16&255,l>>>8&255,l&255]);return D.box(D.types.mfhd,f)}static traf(l,f){let p=l.id,d=D.box(D.types.tfhd,new Uint8Array([0,0,0,0,p>>>24&255,p>>>16&255,p>>>8&255,p&255])),g=D.box(D.types.tfdt,new Uint8Array([0,0,0,0,f>>>24&255,f>>>16&255,f>>>8&255,f&255])),x=D.sdtp(l),E=D.trun(l,x.byteLength+16+16+8+16+8+8);return D.box(D.types.traf,d,g,E,x)}static sdtp(l){let f=l.samples||[],p=f.length,d=new Uint8Array(4+p);for(let g=0;g>>24&255,d>>>16&255,d>>>8&255,d&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255],0);for(let E=0;E>>24&255,X>>>16&255,X>>>8&255,X&255,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z&255,le.isLeading<<2|le.dependsOn,le.isDependedOn<<6|le.hasRedundancy<<4|le.isNonSync,0,0,xe>>>24&255,xe>>>16&255,xe>>>8&255,xe&255],12+16*E)}return D.box(D.types.trun,x)}static mdat(l){return D.box(D.types.mdat,l)}}D.init();var _=D;class ne{static getSilentFrame(l,f){if(l==="mp4a.40.2"){if(f===1)return new Uint8Array([0,200,0,128,35,128]);if(f===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(f===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(f===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(f===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(f===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(f===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(f===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(f===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 De=ne;class Se{constructor(l,f,p,d,g){this.dts=l,this.pts=f,this.duration=p,this.originalDts=d,this.isSyncPoint=g,this.fileposition=null}}class Qe{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(l){l.isSyncPoint=!0,this.syncPoints.push(l)}}class Re{constructor(){this._list=[]}clear(){this._list=[]}appendArray(l){let f=this._list;l.length!==0&&(f.length>0&&l[0].originalDts=f[g].dts&&lf[d].lastSample.originalDts&&l=f[d].lastSample.originalDts&&(d===f.length-1||d0&&(g=this._searchNearestSegmentBefore(p.originalBeginDts)+1),this._lastAppendLocation=g,this._list.splice(g,0,p)}getLastSegmentBefore(l){let f=this._searchNearestSegmentBefore(l);return f>=0?this._list[f]:null}getLastSampleBefore(l){let f=this.getLastSegmentBefore(l);return f!=null?f.lastSample:null}getLastSyncPointBefore(l){let f=this._searchNearestSegmentBefore(l),p=this._list[f].syncPoints;for(;p.length===0&&f>0;)f--,p=this._list[f].syncPoints;return p.length>0?p[p.length-1]:null}}class He{constructor(l){this.TAG="MP4Remuxer",this._config=l,this._isLive=l.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 we("audio"),this._videoSegmentInfoList=new we("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(me.chrome&&(me.version.major<50||me.version.major===50&&me.version.build<2661)),this._fillSilentAfterSeek=me.msedge||me.msie,this._mp3UseMpegAudio=!me.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(l){return l.onDataAvailable=this.remux.bind(this),l.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}get onInitSegment(){return this._onInitSegment}set onInitSegment(l){this._onInitSegment=l}get onMediaSegment(){return this._onMediaSegment}set onMediaSegment(l){this._onMediaSegment=l}insertDiscontinuity(){this._audioNextDts=this._videoNextDts=void 0}seek(l){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}remux(l,f){if(!this._onMediaSegment)throw new B("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(l,f),this._remuxVideo(f),this._remuxAudio(l)}_onTrackMetadataReceived(l,f){let p=null,d="mp4",g=f.codec;if(l==="audio")this._audioMeta=f,f.codec==="mp3"&&this._mp3UseMpegAudio?(d="mpeg",g="",p=new Uint8Array):p=_.generateInitSegment(f);else if(l==="video")this._videoMeta=f,p=_.generateInitSegment(f);else return;if(!this._onInitSegment)throw new B("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(l,{type:l,data:p.buffer,codec:g,container:`${l}/${d}`,mediaDuration:f.duration})}_calculateDtsBase(l,f){this._dtsBaseInited||(l.samples&&l.samples.length&&(this._audioDtsBase=l.samples[0].dts),f.samples&&f.samples.length&&(this._videoDtsBase=f.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}flushStashedSamples(){let l=this._videoStashedLastSample,f=this._audioStashedLastSample,p={type:"video",id:1,sequenceNumber:0,samples:[],length:0};l!=null&&(p.samples.push(l),p.length=l.length);let d={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};f!=null&&(d.samples.push(f),d.length=f.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(p,!0),this._remuxAudio(d,!0)}_remuxAudio(l,f){if(this._audioMeta==null)return;let p=l,d=p.samples,g,x=-1,E=-1,X=-1,Z=this._audioMeta.refSampleDuration,le=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,xe=this._dtsBaseInited&&this._audioNextDts===void 0,Fe=!1;if(!d||d.length===0||d.length===1&&!f)return;let ve=0,qe=null,ke=0;le?(ve=0,ke=p.length):(ve=8,ke=8+p.length);let _e=null;if(d.length>1&&(_e=d.pop(),ke-=_e.length),this._audioStashedLastSample!=null){let rt=this._audioStashedLastSample;this._audioStashedLastSample=null,d.unshift(rt),ke+=rt.length}_e!=null&&(this._audioStashedLastSample=_e);let Ie=d[0].dts-this._dtsBase;if(this._audioNextDts)g=Ie-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())g=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(Fe=!0);else{let rt=this._audioSegmentInfoList.getLastSampleBefore(Ie);if(rt!=null){let ct=Ie-(rt.originalDts+rt.duration);ct<=3&&(ct=0);let oe=rt.dts+rt.duration+ct;g=Ie-oe}else g=0}if(Fe){let rt=Ie-g,ct=this._videoSegmentInfoList.getLastSegmentBefore(Ie);if(ct!=null&&ct.beginDts=1?Ne=tt[tt.length-1].duration:Ne=Math.floor(Z);let Le=!1,Ke=null;if(Ne>Z*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!me.safari){Le=!0;let Ve=Math.abs(Ne-Z),lt=Math.ceil(Ve/Z),Et=be+Z;K.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync. dts: ${be+Ne} ms, expected: ${be+Math.round(Z)} ms, delta: ${Math.round(Ve)} ms, generate: ${lt} frames`);let St=De.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);St==null&&(K.w(this.TAG,`Unable to generate silent frame for ${this._audioMeta.originalCodec} with ${this._audioMeta.channelCount} channels, repeat last frame`),St=oe),Ke=[];for(let Nt=0;Nt0){let pt=Ke[Ke.length-1];pt.duration=tn-pt.dts}let Bt={dts:tn,pts:tn,cts:0,unit:St,size:St.byteLength,duration:0,originalDts:ce,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};Ke.push(Bt),ke+=Bt.size,Et+=Z}let _t=Ke[Ke.length-1];_t.duration=be+Ne-_t.dts,Ne=Math.round(Z)}tt.push({dts:be,pts:be,cts:0,unit:ct.unit,size:ct.unit.byteLength,duration:Ne,originalDts:ce,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),Le&&tt.push.apply(tt,Ke)}le?qe=new Uint8Array(ke):(qe=new Uint8Array(ke),qe[0]=ke>>>24&255,qe[1]=ke>>>16&255,qe[2]=ke>>>8&255,qe[3]=ke&255,qe.set(_.types.mdat,4));for(let rt=0;rt1&&(ve=d.pop(),Fe-=ve.length),this._videoStashedLastSample!=null){let Ye=this._videoStashedLastSample;this._videoStashedLastSample=null,d.unshift(Ye),Fe+=Ye.length}ve!=null&&(this._videoStashedLastSample=ve);let qe=d[0].dts-this._dtsBase;if(this._videoNextDts)g=qe-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())g=0;else{let Ye=this._videoSegmentInfoList.getLastSampleBefore(qe);if(Ye!=null){let mt=qe-(Ye.originalDts+Ye.duration);mt<=3&&(mt=0);let Ft=Ye.dts+Ye.duration+mt;g=qe-Ft}else g=0}let ke=new Qe,_e=[];for(let Ye=0;Ye=1?ce=_e[_e.length-1].duration:ce=Math.floor(this._videoMeta.refSampleDuration),Ut){let be=new Se(rt,oe,ce,mt.dts,!0);be.fileposition=mt.fileposition,ke.appendSyncPoint(be)}_e.push({dts:rt,pts:oe,cts:ct,units:mt.units,size:mt.length,isKeyframe:Ut,duration:ce,originalDts:Ft,flags:{isLeading:0,dependsOn:Ut?2:1,isDependedOn:Ut?1:0,hasRedundancy:0,isNonSync:Ut?0:1}})}xe=new Uint8Array(Fe),xe[0]=Fe>>>24&255,xe[1]=Fe>>>16&255,xe[2]=Fe>>>8&255,xe[3]=Fe&255,xe.set(_.types.mdat,4);for(let Ye=0;Ye<_e.length;Ye++){let mt=_e[Ye].units;for(;mt.length;){let Ut=mt.shift().data;xe.set(Ut,le),le+=Ut.byteLength}}let Ie=_e[_e.length-1];if(E=Ie.dts+Ie.duration,Z=Ie.pts+Ie.duration,this._videoNextDts=E,ke.beginDts=x,ke.endDts=E,ke.beginPts=X,ke.endPts=Z,ke.originalBeginDts=_e[0].originalDts,ke.originalEndDts=Ie.originalDts+Ie.duration,ke.firstSample=new Se(_e[0].dts,_e[0].pts,_e[0].duration,_e[0].originalDts,_e[0].isKeyframe),ke.lastSample=new Se(Ie.dts,Ie.pts,Ie.duration,Ie.originalDts,Ie.isKeyframe),this._isLive||this._videoSegmentInfoList.append(ke),p.samples=_e,p.sequenceNumber++,this._forceFirstIDR){let Ye=_e[0].flags;Ye.dependsOn=2,Ye.isNonSync=0}let tt=_.moof(p,x);p.samples=[],p.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(tt,xe).buffer,sampleCount:_e.length,info:ke})}_mergeBoxes(l,f){let p=new Uint8Array(l.byteLength+f.byteLength);return p.set(l,0),p.set(f,l.byteLength),p}}var ft=He,he={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 Dt{constructor(l,f){this.TAG="TransmuxingController",this._emitter=new(ee()),this._config=f,l.segments||(l.segments=[{duration:l.duration,filesize:l.filesize,url:l.url}]),typeof l.cors!="boolean"&&(l.cors=!0),typeof l.withCredentials!="boolean"&&(l.withCredentials=!1),this._mediaDataSource=l,this._currentSegmentIndex=0;let p=0;this._mediaDataSource.segments.forEach(d=>{d.timestampBase=p,p+=d.duration,d.cors=l.cors,d.withCredentials=l.withCredentials,f.referrerPolicy&&(d.referrerPolicy=f.referrerPolicy)}),!isNaN(p)&&this._mediaDataSource.duration!==p&&(this._mediaDataSource.duration=p),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(l,f){this._emitter.addListener(l,f)}off(l,f){this._emitter.removeListener(l,f)}start(){this._loadSegment(0),this._enableStatisticsReporter()}_loadSegment(l,f){this._currentSegmentIndex=l;let p=this._mediaDataSource.segments[l],d=this._ioctl=new Ae(p,this._config,l);d.onError=this._onIOException.bind(this),d.onSeeked=this._onIOSeeked.bind(this),d.onComplete=this._onIOComplete.bind(this),d.onRedirect=this._onIORedirect.bind(this),d.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),f?this._demuxer.bindDataSource(this._ioctl):d.onDataArrival=this._onInitChunkArrival.bind(this),d.open(f)}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(l){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;let f=this._searchSegmentIndexContains(l);if(f===this._currentSegmentIndex){let p=this._mediaInfo.segments[f];if(p==null)this._pendingSeekTime=l;else{let d=p.getNearestKeyframe(l);this._remuxer.seek(d.milliseconds),this._ioctl.seek(d.fileposition),this._pendingResolveSeekPoint=d.milliseconds}}else{let p=this._mediaInfo.segments[f];if(p==null)this._pendingSeekTime=l,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(f);else{let d=p.getNearestKeyframe(l);this._internalAbort(),this._remuxer.seek(l),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[f].timestampBase,this._loadSegment(f,d.fileposition),this._pendingResolveSeekPoint=d.milliseconds,this._reportSegmentMediaInfo(f)}}this._enableStatisticsReporter()}_searchSegmentIndexContains(l){let f=this._mediaDataSource.segments,p=f.length-1;for(let d=0;d0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,d=this._demuxer.parseChunks(l,f);else if((p=q.probe(l)).match){this._demuxer=new q(p,this._config),this._remuxer||(this._remuxer=new ft(this._config));let g=this._mediaDataSource;g.duration!=null&&!isNaN(g.duration)&&(this._demuxer.overridedDuration=g.duration),typeof g.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=g.hasAudio),typeof g.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=g.hasVideo),this._demuxer.timestampBase=g.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),d=this._demuxer.parseChunks(l,f)}else p=null,K.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(()=>{this._internalAbort()}),this._emitter.emit(he.DEMUX_ERROR,N.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),d=0;return d}_onMediaInfo(l){this._mediaInfo==null&&(this._mediaInfo=Object.assign({},l),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,Ot.prototype));let f=Object.assign({},l);Object.setPrototypeOf(f,Ot.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=f,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(()=>{let p=this._pendingSeekTime;this._pendingSeekTime=null,this.seek(p)})}_onMetaDataArrived(l){this._emitter.emit(he.METADATA_ARRIVED,l)}_onScriptDataArrived(l){this._emitter.emit(he.SCRIPTDATA_ARRIVED,l)}_onIOSeeked(){this._remuxer.insertDiscontinuity()}_onIOComplete(l){let p=l+1;p0&&p[0].originalDts===d&&(d=p[0].pts),this._emitter.emit(he.RECOMMEND_SEEKPOINT,d)}}_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(l){let f=this._mediaInfo.segments[l],p=Object.assign({},f);p.duration=this._mediaInfo.duration,p.segmentCount=this._mediaInfo.segmentCount,delete p.segments,delete p.keyframesIndex,this._emitter.emit(he.MEDIA_INFO,p)}_reportStatisticsInfo(){let l={};l.url=this._ioctl.currentURL,l.hasRedirect=this._ioctl.hasRedirect,l.hasRedirect&&(l.redirectedURL=this._ioctl.currentRedirectedURL),l.speed=this._ioctl.currentSpeed,l.loaderType=this._ioctl.loaderType,l.currentSegmentIndex=this._currentSegmentIndex,l.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(he.STATISTICS_INFO,l)}}var Tt=Dt,ot=function(ut){let l="TransmuxingWorker",f=null,p=ke.bind(this);P.install(),ut.addEventListener("message",function(_e){switch(_e.data.cmd){case"init":f=new Tt(_e.data.param[0],_e.data.param[1]),f.on(he.IO_ERROR,Fe.bind(this)),f.on(he.DEMUX_ERROR,ve.bind(this)),f.on(he.INIT_SEGMENT,d.bind(this)),f.on(he.MEDIA_SEGMENT,g.bind(this)),f.on(he.LOADING_COMPLETE,x.bind(this)),f.on(he.RECOVERED_EARLY_EOF,E.bind(this)),f.on(he.MEDIA_INFO,X.bind(this)),f.on(he.METADATA_ARRIVED,Z.bind(this)),f.on(he.SCRIPTDATA_ARRIVED,le.bind(this)),f.on(he.STATISTICS_INFO,xe.bind(this)),f.on(he.RECOMMEND_SEEKPOINT,qe.bind(this));break;case"destroy":f&&(f.destroy(),f=null),ut.postMessage({msg:"destroyed"});break;case"start":f.start();break;case"stop":f.stop();break;case"seek":f.seek(_e.data.param);break;case"pause":f.pause();break;case"resume":f.resume();break;case"logging_config":{let Ie=_e.data.param;Ce.applyConfig(Ie),Ie.enableCallback===!0?Ce.addLogListener(p):Ce.removeLogListener(p);break}}});function d(_e,Ie){let tt={msg:he.INIT_SEGMENT,data:{type:_e,data:Ie}};ut.postMessage(tt,[Ie.data])}function g(_e,Ie){let tt={msg:he.MEDIA_SEGMENT,data:{type:_e,data:Ie}};ut.postMessage(tt,[Ie.data])}function x(){let _e={msg:he.LOADING_COMPLETE};ut.postMessage(_e)}function E(){let _e={msg:he.RECOVERED_EARLY_EOF};ut.postMessage(_e)}function X(_e){let Ie={msg:he.MEDIA_INFO,data:_e};ut.postMessage(Ie)}function Z(_e){let Ie={msg:he.METADATA_ARRIVED,data:_e};ut.postMessage(Ie)}function le(_e){let Ie={msg:he.SCRIPTDATA_ARRIVED,data:_e};ut.postMessage(Ie)}function xe(_e){let Ie={msg:he.STATISTICS_INFO,data:_e};ut.postMessage(Ie)}function Fe(_e,Ie){ut.postMessage({msg:he.IO_ERROR,data:{type:_e,info:Ie}})}function ve(_e,Ie){ut.postMessage({msg:he.DEMUX_ERROR,data:{type:_e,info:Ie}})}function qe(_e){ut.postMessage({msg:he.RECOMMEND_SEEKPOINT,data:_e})}function ke(_e,Ie){ut.postMessage({msg:"logcat_callback",data:{type:_e,logcat:Ie}})}};class on{constructor(l,f){if(this.TAG="Transmuxer",this._emitter=new(ee()),f.enableWorker&&typeof Worker!="undefined")try{let p=y(82059);this._worker=p(ot),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[l,f]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},Ce.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:Ce.getConfig()})}catch(p){K.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Tt(l,f)}else this._controller=new Tt(l,f);if(this._controller){let p=this._controller;p.on(he.IO_ERROR,this._onIOError.bind(this)),p.on(he.DEMUX_ERROR,this._onDemuxError.bind(this)),p.on(he.INIT_SEGMENT,this._onInitSegment.bind(this)),p.on(he.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),p.on(he.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),p.on(he.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),p.on(he.MEDIA_INFO,this._onMediaInfo.bind(this)),p.on(he.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),p.on(he.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),p.on(he.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),p.on(he.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}destroy(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),Ce.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}on(l,f){this._emitter.addListener(l,f)}off(l,f){this._emitter.removeListener(l,f)}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(l){this._worker?this._worker.postMessage({cmd:"seek",param:l}):this._controller.seek(l)}pause(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}resume(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}_onInitSegment(l,f){Promise.resolve().then(()=>{this._emitter.emit(he.INIT_SEGMENT,l,f)})}_onMediaSegment(l,f){Promise.resolve().then(()=>{this._emitter.emit(he.MEDIA_SEGMENT,l,f)})}_onLoadingComplete(){Promise.resolve().then(()=>{this._emitter.emit(he.LOADING_COMPLETE)})}_onRecoveredEarlyEof(){Promise.resolve().then(()=>{this._emitter.emit(he.RECOVERED_EARLY_EOF)})}_onMediaInfo(l){Promise.resolve().then(()=>{this._emitter.emit(he.MEDIA_INFO,l)})}_onMetaDataArrived(l){Promise.resolve().then(()=>{this._emitter.emit(he.METADATA_ARRIVED,l)})}_onScriptDataArrived(l){Promise.resolve().then(()=>{this._emitter.emit(he.SCRIPTDATA_ARRIVED,l)})}_onStatisticsInfo(l){Promise.resolve().then(()=>{this._emitter.emit(he.STATISTICS_INFO,l)})}_onIOError(l,f){Promise.resolve().then(()=>{this._emitter.emit(he.IO_ERROR,l,f)})}_onDemuxError(l,f){Promise.resolve().then(()=>{this._emitter.emit(he.DEMUX_ERROR,l,f)})}_onRecommendSeekpoint(l){Promise.resolve().then(()=>{this._emitter.emit(he.RECOMMEND_SEEKPOINT,l)})}_onLoggingConfigChanged(l){this._worker&&this._worker.postMessage({cmd:"logging_config",param:l})}_onWorkerMessage(l){let f=l.data,p=f.data;if(f.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(f.msg){case he.INIT_SEGMENT:case he.MEDIA_SEGMENT:this._emitter.emit(f.msg,p.type,p.data);break;case he.LOADING_COMPLETE:case he.RECOVERED_EARLY_EOF:this._emitter.emit(f.msg);break;case he.MEDIA_INFO:Object.setPrototypeOf(p,Ot.prototype),this._emitter.emit(f.msg,p);break;case he.METADATA_ARRIVED:case he.SCRIPTDATA_ARRIVED:case he.STATISTICS_INFO:this._emitter.emit(f.msg,p);break;case he.IO_ERROR:case he.DEMUX_ERROR:this._emitter.emit(f.msg,p.type,p.info);break;case he.RECOMMEND_SEEKPOINT:this._emitter.emit(f.msg,p);break;case"logcat_callback":K.emitter.emit("log",p.type,p.logcat);break;default:break}}}var ln=on,Cn={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};class Mt{constructor(l){this.TAG="MSEController",this._config=l,this._emitter=new(ee()),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 Re}destroy(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}on(l,f){this._emitter.addListener(l,f)}off(l,f){this._emitter.removeListener(l,f)}attachMediaElement(l){if(this._mediaSource)throw new B("MediaSource has been attached to an HTMLMediaElement!");let f=this._mediaSource=new window.MediaSource;f.addEventListener("sourceopen",this.e.onSourceOpen),f.addEventListener("sourceended",this.e.onSourceEnded),f.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=l,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),l.src=this._mediaSourceObjectURL}detachMediaElement(){if(this._mediaSource){let l=this._mediaSource;for(let f in this._sourceBuffers){let p=this._pendingSegments[f];p.splice(0,p.length),this._pendingSegments[f]=null,this._pendingRemoveRanges[f]=null,this._lastInitSegments[f]=null;let d=this._sourceBuffers[f];if(d){if(l.readyState!=="closed"){try{l.removeSourceBuffer(d)}catch(g){K.e(this.TAG,g.message)}d.removeEventListener("error",this.e.onSourceBufferError),d.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[f]=null,this._sourceBuffers[f]=null}}if(l.readyState==="open")try{l.endOfStream()}catch(f){K.e(this.TAG,f.message)}l.removeEventListener("sourceopen",this.e.onSourceOpen),l.removeEventListener("sourceended",this.e.onSourceEnded),l.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(l,f){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(l),this._pendingSegments[l.type].push(l);return}let p=l,d=`${p.container}`;p.codec&&p.codec.length>0&&(d+=`;codecs=${p.codec}`);let g=!1;if(K.v(this.TAG,"Received Initialization Segment, mimeType: "+d),this._lastInitSegments[p.type]=p,d!==this._mimeTypes[p.type]){if(this._mimeTypes[p.type])K.v(this.TAG,`Notice: ${p.type} mimeType changed, origin: ${this._mimeTypes[p.type]}, target: ${d}`);else{g=!0;try{let x=this._sourceBuffers[p.type]=this._mediaSource.addSourceBuffer(d);x.addEventListener("error",this.e.onSourceBufferError),x.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(x){K.e(this.TAG,x.message),this._emitter.emit(Cn.ERROR,{code:x.code,msg:x.message});return}}this._mimeTypes[p.type]=d}f||this._pendingSegments[p.type].push(p),g||this._sourceBuffers[p.type]&&!this._sourceBuffers[p.type].updating&&this._doAppendSegments(),me.safari&&p.container==="audio/mpeg"&&p.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=p.mediaDuration/1e3,this._updateMediaSourceDuration())}appendMediaSegment(l){let f=l;this._pendingSegments[f.type].push(f),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();let p=this._sourceBuffers[f.type];p&&!p.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}seek(l){for(let f in this._sourceBuffers){if(!this._sourceBuffers[f])continue;let p=this._sourceBuffers[f];if(this._mediaSource.readyState==="open")try{p.abort()}catch(g){K.e(this.TAG,g.message)}this._idrList.clear();let d=this._pendingSegments[f];if(d.splice(0,d.length),this._mediaSource.readyState!=="closed"){for(let g=0;g=1&&l-d.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}_doCleanupSourceBuffer(){let l=this._mediaElement.currentTime;for(let f in this._sourceBuffers){let p=this._sourceBuffers[f];if(p){let d=p.buffered,g=!1;for(let x=0;x=this._config.autoCleanupMaxBackwardDuration){g=!0;let Z=l-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[f].push({start:E,end:Z})}}else X0&&(isNaN(f)||p>f)&&(K.v(this.TAG,`Update MediaSource duration from ${f} to ${p}`),this._mediaSource.duration=p),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}_doRemoveRanges(){for(let l in this._pendingRemoveRanges){if(!this._sourceBuffers[l]||this._sourceBuffers[l].updating)continue;let f=this._sourceBuffers[l],p=this._pendingRemoveRanges[l];for(;p.length&&!f.updating;){let d=p.shift();f.remove(d.start,d.end)}}}_doAppendSegments(){let l=this._pendingSegments;for(let f in l)if(!(!this._sourceBuffers[f]||this._sourceBuffers[f].updating)&&l[f].length>0){let p=l[f].shift();if(p.timestampOffset){let d=this._sourceBuffers[f].timestampOffset,g=p.timestampOffset/1e3;Math.abs(d-g)>.1&&(K.v(this.TAG,`Update MPEG audio timestampOffset from ${d} to ${g}`),this._sourceBuffers[f].timestampOffset=g),delete p.timestampOffset}if(!p.data||p.data.byteLength===0)continue;try{this._sourceBuffers[f].appendBuffer(p.data),this._isBufferFull=!1,f==="video"&&p.hasOwnProperty("info")&&this._idrList.appendArray(p.info.syncPoints)}catch(d){this._pendingSegments[f].unshift(p),d.code===22?(this._isBufferFull||this._emitter.emit(Cn.BUFFER_FULL),this._isBufferFull=!0):(K.e(this.TAG,d.message),this._emitter.emit(Cn.ERROR,{code:d.code,msg:d.message}))}}}_onSourceOpen(){if(K.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){let l=this._pendingSourceBufferInit;for(;l.length;){let f=l.shift();this.appendInitSegment(f,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(Cn.SOURCE_OPEN)}_onSourceEnded(){K.v(this.TAG,"MediaSource onSourceEnded")}_onSourceClose(){K.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 l=this._pendingSegments;return l.video.length>0||l.audio.length>0}_hasPendingRemoveRanges(){let l=this._pendingRemoveRanges;return l.video.length>0||l.audio.length>0}_onSourceBufferUpdateEnd(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(Cn.UPDATE_END)}_onSourceBufferError(l){K.e(this.TAG,`SourceBuffer Error: ${l}`)}}var qt=Mt;const ht={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},kt={NETWORK_EXCEPTION:J.EXCEPTION,NETWORK_STATUS_CODE_INVALID:J.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:J.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:J.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:N.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:N.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:N.CODEC_UNSUPPORTED};class mn{constructor(l,f){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(ee()),this._config=ge(),typeof f=="object"&&Object.assign(this._config,f),l.type.toLowerCase()!=="flv")throw new je("FlvPlayer requires an flv MediaDataSource input!");l.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=l,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 p=me.chrome&&(me.version.major<50||me.version.major===50&&me.version.build<2661);this._alwaysSeekKeyframe=!!(p||me.msedge||me.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(l,f){l===Te.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(Te.MEDIA_INFO,this.mediaInfo)}):l===Te.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(Te.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(l,f)}off(l,f){this._emitter.removeListener(l,f)}attachMediaElement(l){if(this._mediaElement=l,l.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),l.addEventListener("seeking",this.e.onvSeeking),l.addEventListener("canplay",this.e.onvCanPlay),l.addEventListener("stalled",this.e.onvStalled),l.addEventListener("progress",this.e.onvProgress),this._msectl=new qt(this._config),this._msectl.on(Cn.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(Cn.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(Cn.SOURCE_OPEN,()=>{this._mseSourceOpened=!0,this._hasPendingLoad&&(this._hasPendingLoad=!1,this.load())}),this._msectl.on(Cn.ERROR,f=>{this._emitter.emit(Te.ERROR,ht.MEDIA_ERROR,kt.MEDIA_MSE_ERROR,f)}),this._msectl.attachMediaElement(l),this._pendingSeekTime!=null)try{l.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(f){}}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 B("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new B("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 ln(this._mediaDataSource,this._config),this._transmuxer.on(he.INIT_SEGMENT,(l,f)=>{this._msectl.appendInitSegment(f)}),this._transmuxer.on(he.MEDIA_SEGMENT,(l,f)=>{if(this._msectl.appendMediaSegment(f),this._config.lazyLoad&&!this._config.isLive){let p=this._mediaElement.currentTime;f.info.endDts>=(p+this._config.lazyLoadMaxDuration)*1e3&&this._progressChecker==null&&(K.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}),this._transmuxer.on(he.LOADING_COMPLETE,()=>{this._msectl.endOfStream(),this._emitter.emit(Te.LOADING_COMPLETE)}),this._transmuxer.on(he.RECOVERED_EARLY_EOF,()=>{this._emitter.emit(Te.RECOVERED_EARLY_EOF)}),this._transmuxer.on(he.IO_ERROR,(l,f)=>{this._emitter.emit(Te.ERROR,ht.NETWORK_ERROR,l,f)}),this._transmuxer.on(he.DEMUX_ERROR,(l,f)=>{this._emitter.emit(Te.ERROR,ht.MEDIA_ERROR,l,{code:-1,msg:f})}),this._transmuxer.on(he.MEDIA_INFO,l=>{this._mediaInfo=l,this._emitter.emit(Te.MEDIA_INFO,Object.assign({},l))}),this._transmuxer.on(he.METADATA_ARRIVED,l=>{this._emitter.emit(Te.METADATA_ARRIVED,l)}),this._transmuxer.on(he.SCRIPTDATA_ARRIVED,l=>{this._emitter.emit(Te.SCRIPTDATA_ARRIVED,l)}),this._transmuxer.on(he.STATISTICS_INFO,l=>{this._statisticsInfo=this._fillStatisticsInfo(l),this._emitter.emit(Te.STATISTICS_INFO,Object.assign({},this._statisticsInfo))}),this._transmuxer.on(he.RECOMMEND_SEEKPOINT,l=>{this._mediaElement&&!this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=l/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(l){this._mediaElement.volume=l}get muted(){return this._mediaElement.muted}set muted(l){this._mediaElement.muted=l}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(l){this._mediaElement?this._internalSeek(l):this._pendingSeekTime=l}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(l){if(l.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return l;let f=!0,p=0,d=0;if(this._mediaElement.getVideoPlaybackQuality){let g=this._mediaElement.getVideoPlaybackQuality();p=g.totalVideoFrames,d=g.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(p=this._mediaElement.webkitDecodedFrameCount,d=this._mediaElement.webkitDroppedFrameCount):f=!1;return f&&(l.decodedFrames=p,l.droppedFrames=d),l}_onmseUpdateEnd(){if(!this._config.lazyLoad||this._config.isLive)return;let l=this._mediaElement.buffered,f=this._mediaElement.currentTime,p=0,d=0;for(let g=0;g=f+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(K.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}_onmseBufferFull(){K.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 l=this._mediaElement.currentTime,f=this._mediaElement.buffered,p=!1;for(let d=0;d=g&&l=x-this._config.lazyLoadRecoverDuration&&(p=!0);break}}p&&(window.clearInterval(this._progressChecker),this._progressChecker=null,p&&(K.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}_isTimepointBuffered(l){let f=this._mediaElement.buffered;for(let p=0;p=d&&l0){let g=this._mediaElement.buffered.start(0);(g<1&&l0&&f.currentTime0){let d=p.start(0);if(d<1&&f{this._emitter.emit(Te.MEDIA_INFO,this.mediaInfo)}):l===Te.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(Te.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(l,f)}off(l,f){this._emitter.removeListener(l,f)}attachMediaElement(l){if(this._mediaElement=l,l.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{l.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(f){}}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 B("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(l){this._mediaElement.volume=l}get muted(){return this._mediaElement.muted}set muted(l){this._mediaElement.muted=l}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(l){this._mediaElement?this._mediaElement.currentTime=l:this._pendingSeekTime=l}get mediaInfo(){let f={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(f.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(f.width=this._mediaElement.videoWidth,f.height=this._mediaElement.videoHeight)),f}get statisticsInfo(){let l={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return l;let f=!0,p=0,d=0;if(this._mediaElement.getVideoPlaybackQuality){let g=this._mediaElement.getVideoPlaybackQuality();p=g.totalVideoFrames,d=g.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(p=this._mediaElement.webkitDecodedFrameCount,d=this._mediaElement.webkitDroppedFrameCount):f=!1;return f&&(l.decodedFrames=p,l.droppedFrames=d),l}_onvLoadedMetadata(l){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(Te.MEDIA_INFO,this.mediaInfo)}_reportStatisticsInfo(){this._emitter.emit(Te.STATISTICS_INFO,this.statisticsInfo)}}var An=en;P.install();function gn(ut,l){let f=ut;if(f==null||typeof f!="object")throw new je("MediaDataSource must be an javascript object!");if(!f.hasOwnProperty("type"))throw new je("MediaDataSource must has type field to indicate video file type!");switch(f.type){case"flv":return new It(f,l);default:return new An(f,l)}}function Pn(){return it.supportMSEH264Playback()}function On(){return it.getFeatureList()}let Mn={};Mn.createPlayer=gn,Mn.isSupported=Pn,Mn.getFeatureList=On,Mn.BaseLoader=$,Mn.LoaderStatus=m,Mn.LoaderErrors=J,Mn.Events=Te,Mn.ErrorTypes=ht,Mn.ErrorDetails=kt,Mn.FlvPlayer=It,Mn.NativePlayer=An,Mn.LoggingControl=Ce,Object.defineProperty(Mn,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var nr=Mn},36785:function(Wt,nt,y){"use strict";y.d(nt,{o2:function(){return H},yT:function(){return K}});var R=y(19127),P=y(33166);const W=P.i.map(pe=>`${pe}-inverse`),ee=["success","processing","error","default","warning"];function H(pe){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat((0,R.Z)(W),(0,R.Z)(P.i)).includes(pe):P.i.includes(pe)}function K(pe){return ee.includes(pe)}},56762:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return P}});var R=y(59301);function P(){const[,W]=R.useReducer(ee=>ee+1,0);return W}},79676:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return K}});var R=y(19447);function P(pe,ue,de,B){if(B===!1)return{adjustX:!1,adjustY:!1};const je=B&&typeof B=="object"?B:{},k={};switch(pe){case"top":case"bottom":k.shiftX=ue.dropdownArrowOffset*2+de;break;case"left":case"right":k.shiftY=ue.dropdownArrowOffsetVertical*2+de;break}const m=Object.assign(Object.assign({},k),je);return m.shiftX||(m.adjustX=!0),m.shiftY||(m.adjustY=!0),m}const W={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"]}},ee={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"]}},H=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function K(pe){const{arrowWidth:ue,autoAdjustOverflow:de,arrowPointAtCenter:B,offset:je,borderRadius:k,visibleFirst:m}=pe,J=ue/2,$={};return Object.keys(W).forEach(ze=>{const st=B&&ee[ze]||W[ze],me=Object.assign(Object.assign({},st),{offset:[0,0]});switch($[ze]=me,H.has(ze)&&(me.autoArrow=!1),ze){case"top":case"topLeft":case"topRight":me.offset[1]=-J-je;break;case"bottom":case"bottomLeft":case"bottomRight":me.offset[1]=J+je;break;case"left":case"leftTop":case"leftBottom":me.offset[0]=-J-je;break;case"right":case"rightTop":case"rightBottom":me.offset[0]=J+je;break}const Q=(0,R.fS)({contentRadius:k,limitVerticalRadius:!0});if(B)switch(ze){case"topLeft":case"bottomLeft":me.offset[0]=-Q.dropdownArrowOffset-J;break;case"topRight":case"bottomRight":me.offset[0]=Q.dropdownArrowOffset+J;break;case"leftTop":case"rightTop":me.offset[1]=-Q.dropdownArrowOffset-J;break;case"leftBottom":case"rightBottom":me.offset[1]=Q.dropdownArrowOffset+J;break}me.overflow=P(ze,Q,ue,de),m&&(me.htmlRegion="visibleFirst")}),$}},19080:function(Wt,nt,y){"use strict";y.d(nt,{F:function(){return H},Z:function(){return ee}});var R=y(92310),P=y.n(R);const W=null;function ee(K,pe,ue){return P()({[`${K}-status-success`]:pe==="success",[`${K}-status-warning`]:pe==="warning",[`${K}-status-error`]:pe==="error",[`${K}-status-validating`]:pe==="validating",[`${K}-has-feedback`]:ue})}const H=(K,pe)=>pe||K},18889:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return fe}});var R=y(92310),P=y.n(R),W=y(2738),ee=y(59301),H=y(36355),K=y(19716),pe=y(61621),ue=y(99313),de=function(O,Ae){var Oe={};for(var ge in O)Object.prototype.hasOwnProperty.call(O,ge)&&Ae.indexOf(ge)<0&&(Oe[ge]=O[ge]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Be=0,ge=Object.getOwnPropertySymbols(O);Be{var{prefixCls:Ae,className:Oe,hoverable:ge=!0}=O,Be=de(O,["prefixCls","className","hoverable"]);const{getPrefixCls:it}=ee.useContext(H.E_),ye=it("card",Ae),Te=P()(`${ye}-grid`,Oe,{[`${ye}-grid-hoverable`]:ge});return ee.createElement("div",Object.assign({},Be,{className:Te}))},k=y(17313),m=y(83116),J=y(37613);const $=O=>{const{antCls:Ae,componentCls:Oe,headerHeight:ge,cardPaddingBase:Be,tabsMarginBottom:it}=O;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:ge,marginBottom:-1,padding:`0 ${Be}px`,color:O.colorTextHeading,fontWeight:O.fontWeightStrong,fontSize:O.headerFontSize,background:O.headerBg,borderBottom:`${O.lineWidth}px ${O.lineType} ${O.colorBorderSecondary}`,borderRadius:`${O.borderRadiusLG}px ${O.borderRadiusLG}px 0 0`},(0,k.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},k.vS),{[` > ${Oe}-typography, > ${Oe}-typography-edit-content `]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${Ae}-tabs-top`]:{clear:"both",marginBottom:it,color:O.colorText,fontWeight:"normal",fontSize:O.fontSize,"&-bar":{borderBottom:`${O.lineWidth}px ${O.lineType} ${O.colorBorderSecondary}`}}})},ze=O=>{const{cardPaddingBase:Ae,colorBorderSecondary:Oe,cardShadow:ge,lineWidth:Be}=O;return{width:"33.33%",padding:Ae,border:0,borderRadius:0,boxShadow:` ${Be}px 0 0 0 ${Oe}, 0 ${Be}px 0 0 ${Oe}, ${Be}px ${Be}px 0 0 ${Oe}, ${Be}px 0 0 0 ${Oe} inset, 0 ${Be}px 0 0 ${Oe} inset; `,transition:`all ${O.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:ge}}},st=O=>{const{componentCls:Ae,iconCls:Oe,actionsLiMargin:ge,cardActionsIconSize:Be,colorBorderSecondary:it,actionsBg:ye}=O;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:ye,borderTop:`${O.lineWidth}px ${O.lineType} ${it}`,display:"flex",borderRadius:`0 0 ${O.borderRadiusLG}px ${O.borderRadiusLG}px `},(0,k.dF)()),{"& > li":{margin:ge,color:O.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:O.cardActionsIconSize*2,fontSize:O.fontSize,lineHeight:O.lineHeight,cursor:"pointer","&:hover":{color:O.colorPrimary,transition:`color ${O.motionDurationMid}`},[`a:not(${Ae}-btn), > ${Oe}`]:{display:"inline-block",width:"100%",color:O.colorTextDescription,lineHeight:`${O.fontSize*O.lineHeight}px`,transition:`color ${O.motionDurationMid}`,"&:hover":{color:O.colorPrimary}},[`> ${Oe}`]:{fontSize:Be,lineHeight:`${Be*O.lineHeight}px`}},"&:not(:last-child)":{borderInlineEnd:`${O.lineWidth}px ${O.lineType} ${it}`}}})},me=O=>Object.assign(Object.assign({margin:`-${O.marginXXS}px 0`,display:"flex"},(0,k.dF)()),{"&-avatar":{paddingInlineEnd:O.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:O.marginXS}},"&-title":Object.assign({color:O.colorTextHeading,fontWeight:O.fontWeightStrong,fontSize:O.fontSizeLG},k.vS),"&-description":{color:O.colorTextDescription}}),Q=O=>{const{componentCls:Ae,cardPaddingBase:Oe,colorFillAlter:ge}=O;return{[`${Ae}-head`]:{padding:`0 ${Oe}px`,background:ge,"&-title":{fontSize:O.fontSize}},[`${Ae}-body`]:{padding:`${O.padding}px ${Oe}px`}}},se=O=>{const{componentCls:Ae}=O;return{overflow:"hidden",[`${Ae}-body`]:{userSelect:"none"}}},te=O=>{const{antCls:Ae,componentCls:Oe,cardShadow:ge,cardHeadPadding:Be,colorBorderSecondary:it,boxShadowTertiary:ye,cardPaddingBase:Te,extraColor:Pe}=O;return{[Oe]:Object.assign(Object.assign({},(0,k.Wf)(O)),{position:"relative",background:O.colorBgContainer,borderRadius:O.borderRadiusLG,[`&:not(${Oe}-bordered)`]:{boxShadow:ye},[`${Oe}-head`]:$(O),[`${Oe}-extra`]:{marginInlineStart:"auto",color:Pe,fontWeight:"normal",fontSize:O.fontSize},[`${Oe}-body`]:Object.assign({padding:Te,borderRadius:` 0 0 ${O.borderRadiusLG}px ${O.borderRadiusLG}px`},(0,k.dF)()),[`${Oe}-grid`]:ze(O),[`${Oe}-cover`]:{"> *":{display:"block",width:"100%"},[`img, img + ${Ae}-image-mask`]:{borderRadius:`${O.borderRadiusLG}px ${O.borderRadiusLG}px 0 0`}},[`${Oe}-actions`]:st(O),[`${Oe}-meta`]:me(O)}),[`${Oe}-bordered`]:{border:`${O.lineWidth}px ${O.lineType} ${it}`,[`${Oe}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${Oe}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${O.motionDurationMid}, border-color ${O.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:ge}},[`${Oe}-contain-grid`]:{[`${Oe}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${Oe}-loading) ${Oe}-body`]:{marginBlockStart:-O.lineWidth,marginInlineStart:-O.lineWidth,padding:0}},[`${Oe}-contain-tabs`]:{[`> ${Oe}-head`]:{[`${Oe}-head-title, ${Oe}-extra`]:{paddingTop:Be}}},[`${Oe}-type-inner`]:Q(O),[`${Oe}-loading`]:se(O),[`${Oe}-rtl`]:{direction:"rtl"}}},b=O=>{const{componentCls:Ae,cardPaddingSM:Oe,headerHeightSM:ge,headerFontSizeSM:Be}=O;return{[`${Ae}-small`]:{[`> ${Ae}-head`]:{minHeight:ge,padding:`0 ${Oe}px`,fontSize:Be,[`> ${Ae}-head-wrapper`]:{[`> ${Ae}-extra`]:{fontSize:O.fontSize}}},[`> ${Ae}-body`]:{padding:Oe}},[`${Ae}-small${Ae}-contain-tabs`]:{[`> ${Ae}-head`]:{[`${Ae}-head-title, ${Ae}-extra`]:{minHeight:ge,paddingTop:0,display:"flex",alignItems:"center"}}}}};var C=(0,m.Z)("Card",O=>{const Ae=(0,J.TS)(O,{cardShadow:O.boxShadowCard,cardHeadPadding:O.padding,cardPaddingBase:O.paddingLG,cardActionsIconSize:O.fontSize,cardPaddingSM:12});return[te(Ae),b(Ae)]},O=>({headerBg:"transparent",headerFontSize:O.fontSizeLG,headerFontSizeSM:O.fontSize,headerHeight:O.fontSizeLG*O.lineHeightLG+O.padding*2,headerHeightSM:O.fontSize*O.lineHeight+O.paddingXS*2,actionsBg:O.colorBgContainer,actionsLiMargin:`${O.paddingSM}px 0`,tabsMarginBottom:-O.padding-O.lineWidth,extraColor:O.colorText})),z=function(O,Ae){var Oe={};for(var ge in O)Object.prototype.hasOwnProperty.call(O,ge)&&Ae.indexOf(ge)<0&&(Oe[ge]=O[ge]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Be=0,ge=Object.getOwnPropertySymbols(O);Beee.createElement("li",{style:{width:`${100/O.length}%`},key:`action-${Oe}`},ee.createElement("span",null,Ae)))}var Ue=ee.forwardRef((O,Ae)=>{const{prefixCls:Oe,className:ge,rootClassName:Be,style:it,extra:ye,headStyle:Te={},bodyStyle:Pe={},title:Ce,loading:at,bordered:Ot=!0,size:Pt,type:Xt,cover:wt,actions:bt,tabList:Ht,children:Jt,activeTabKey:Ee,defaultActiveTabKey:yt,tabBarExtraContent:F,hoverable:j,tabProps:A={}}=O,N=z(O,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps"]),{getPrefixCls:V,direction:ae,card:S}=ee.useContext(H.E_),I=on=>{var ln;(ln=O.onTabChange)===null||ln===void 0||ln.call(O,on)},q=ee.useMemo(()=>{let on=!1;return ee.Children.forEach(Jt,ln=>{ln&&ln.type&&ln.type===je&&(on=!0)}),on},[Jt]),D=V("card",Oe),[_,ne]=C(D),De=ee.createElement(pe.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},Jt),Se=Ee!==void 0,Qe=Object.assign(Object.assign({},A),{[Se?"activeKey":"defaultActiveKey"]:Se?Ee:yt,tabBarExtraContent:F});let Re;const we=(0,K.Z)(Pt),He=!we||we==="default"?"large":we,ft=Ht?ee.createElement(ue.default,Object.assign({size:He},Qe,{className:`${D}-head-tabs`,onChange:I,items:Ht.map(on=>{var{tab:ln}=on,yn=z(on,["tab"]);return Object.assign({label:ln},yn)})})):null;(Ce||ye||ft)&&(Re=ee.createElement("div",{className:`${D}-head`,style:Te},ee.createElement("div",{className:`${D}-head-wrapper`},Ce&&ee.createElement("div",{className:`${D}-head-title`},Ce),ye&&ee.createElement("div",{className:`${D}-extra`},ye)),ft));const Xe=wt?ee.createElement("div",{className:`${D}-cover`},wt):null,he=ee.createElement("div",{className:`${D}-body`,style:Pe},at?De:Jt),Dt=bt&&bt.length?ee.createElement("ul",{className:`${D}-actions`},G(bt)):null,Tt=(0,W.Z)(N,["onTabChange"]),Kt=P()(D,S==null?void 0:S.className,{[`${D}-loading`]:at,[`${D}-bordered`]:Ot,[`${D}-hoverable`]:j,[`${D}-contain-grid`]:q,[`${D}-contain-tabs`]:Ht&&Ht.length,[`${D}-${we}`]:we,[`${D}-type-${Xt}`]:!!Xt,[`${D}-rtl`]:ae==="rtl"},ge,Be,ne),ot=Object.assign(Object.assign({},S==null?void 0:S.style),it);return _(ee.createElement("div",Object.assign({ref:Ae},Tt,{className:Kt,style:ot}),Re,Xe,he,Dt))}),Je=function(O,Ae){var Oe={};for(var ge in O)Object.prototype.hasOwnProperty.call(O,ge)&&Ae.indexOf(ge)<0&&(Oe[ge]=O[ge]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Be=0,ge=Object.getOwnPropertySymbols(O);Be{const{prefixCls:Ae,className:Oe,avatar:ge,title:Be,description:it}=O,ye=Je(O,["prefixCls","className","avatar","title","description"]),{getPrefixCls:Te}=ee.useContext(H.E_),Pe=Te("card",Ae),Ce=P()(`${Pe}-meta`,Oe),at=ge?ee.createElement("div",{className:`${Pe}-meta-avatar`},ge):null,Ot=Be?ee.createElement("div",{className:`${Pe}-meta-title`},Be):null,Pt=it?ee.createElement("div",{className:`${Pe}-meta-description`},it):null,Xt=Ot||Pt?ee.createElement("div",{className:`${Pe}-meta-detail`},Ot,Pt):null;return ee.createElement("div",Object.assign({},ye,{className:Ce}),at,Xt)};const Y=Ue;Y.Grid=je,Y.Meta=ie;var fe=Y},93891:function(Wt,nt,y){"use strict";var R=y(59301),P=y(36355),W=y(64165);const ee=H=>{const{componentName:K}=H,{getPrefixCls:pe}=(0,R.useContext)(P.E_),ue=pe("empty");switch(K){case"Table":case"List":return R.createElement(W.Z,{image:W.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return R.createElement(W.Z,{image:W.Z.PRESENTED_IMAGE_SIMPLE,className:`${ue}-small`});default:return R.createElement(W.Z,null)}};nt.Z=ee},91857:function(Wt,nt,y){"use strict";var R=y(59301),P=y(38819),W=y(92310),ee=y.n(W),H=y(31561),K=y(70425),pe=y(18929),ue=y(2738),de=y(79676),B=y(53487),je=y(92343),k=y(36355),m=y(20834),J=y(40875),$=y(88088),ze=y(47211);const st=null,me=b=>{const{menu:C,arrow:z,prefixCls:G,children:Me,trigger:Ue,disabled:Je,dropdownRender:We,getPopupContainer:ie,overlayClassName:Y,rootClassName:fe,open:O,onOpenChange:Ae,visible:Oe,onVisibleChange:ge,mouseEnterDelay:Be=.15,mouseLeaveDelay:it=.1,autoAdjustOverflow:ye=!0,placement:Te="",overlay:Pe,transitionName:Ce}=b,{getPopupContainer:at,getPrefixCls:Ot,direction:Pt}=R.useContext(k.E_),Xt=R.useMemo(()=>{const _=Ot();return Ce!==void 0?Ce:Te.includes("top")?`${_}-slide-down`:`${_}-slide-up`},[Ot,Te,Ce]),wt=R.useMemo(()=>Te?Te.includes("Center")?Te.slice(0,Te.indexOf("Center")):Te:Pt==="rtl"?"bottomRight":"bottomLeft",[Te,Pt]),bt=Ot("dropdown",G),[Ht,Jt]=(0,ze.Z)(bt),[,Ee]=(0,$.Z)(),yt=R.Children.only(Me),F=(0,je.Tm)(yt,{className:ee()(`${bt}-trigger`,{[`${bt}-rtl`]:Pt==="rtl"},yt.props.className),disabled:Je}),j=Je?[]:Ue;let A;j&&j.includes("contextMenu")&&(A=!0);const[N,V]=(0,pe.Z)(!1,{value:O!=null?O:Oe}),ae=(0,K.useEvent)(_=>{Ae==null||Ae(_),ge==null||ge(_),V(_)}),S=ee()(Y,fe,Jt,{[`${bt}-rtl`]:Pt==="rtl"}),I=(0,de.Z)({arrowPointAtCenter:typeof z=="object"&&z.pointAtCenter,autoAdjustOverflow:ye,offset:Ee.marginXXS,arrowWidth:z?Ee.sizePopupArrow:0,borderRadius:Ee.borderRadius}),q=R.useCallback(()=>{V(!1)},[]),D=()=>{let _;return C!=null&&C.items?_=R.createElement(m.default,Object.assign({},C)):typeof Pe=="function"?_=Pe():_=Pe,We&&(_=We(_)),_=R.Children.only(typeof _=="string"?R.createElement("span",null,_):_),R.createElement(J.J,{prefixCls:`${bt}-menu`,expandIcon:R.createElement("span",{className:`${bt}-menu-submenu-arrow`},R.createElement(P.Z,{className:`${bt}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:q,validator:ne=>{let{mode:De}=ne}},_)};return Ht(R.createElement(H.Z,Object.assign({alignPoint:A},(0,ue.Z)(b,["rootClassName"]),{mouseEnterDelay:Be,mouseLeaveDelay:it,visible:N,builtinPlacements:I,arrow:!!z,overlayClassName:S,prefixCls:bt,getPopupContainer:ie||at,transitionName:Xt,trigger:j,overlay:D,placement:wt,onVisibleChange:ae}),F))};function Q(b){return Object.assign(Object.assign({},b),{align:{overflow:{adjustX:!1,adjustY:!1}}})}const se=(0,B.Z)(me,"dropdown",b=>b,Q),te=b=>R.createElement(se,Object.assign({},b),R.createElement("span",null));me._InternalPanelDoNotUseOrYouWillBeFired=te,nt.Z=me},38854:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return $}});var R=y(91857),P=y(92310),W=y.n(P),ee=y(59301),H=y(18785),K=y(3113),pe=y(36355),ue=y(81327),de=y(33234),B=y(47211),je=function(ze,st){var me={};for(var Q in ze)Object.prototype.hasOwnProperty.call(ze,Q)&&st.indexOf(Q)<0&&(me[Q]=ze[Q]);if(ze!=null&&typeof Object.getOwnPropertySymbols=="function")for(var se=0,Q=Object.getOwnPropertySymbols(ze);se{const{getPopupContainer:st,getPrefixCls:me,direction:Q}=ee.useContext(pe.E_),{prefixCls:se,type:te="default",danger:b,disabled:C,loading:z,onClick:G,htmlType:Me,children:Ue,className:Je,menu:We,arrow:ie,autoFocus:Y,overlay:fe,trigger:O,align:Ae,open:Oe,onOpenChange:ge,placement:Be,getPopupContainer:it,href:ye,icon:Te=ee.createElement(H.Z,null),title:Pe,buttonsRender:Ce=D=>D,mouseEnterDelay:at,mouseLeaveDelay:Ot,overlayClassName:Pt,overlayStyle:Xt,destroyPopupOnHide:wt,dropdownRender:bt}=ze,Ht=je(ze,["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"]),Jt=me("dropdown",se),Ee=`${Jt}-button`,[yt,F]=(0,B.Z)(Jt),j={menu:We,arrow:ie,autoFocus:Y,align:Ae,disabled:C,trigger:C?[]:O,onOpenChange:ge,getPopupContainer:it||st,mouseEnterDelay:at,mouseLeaveDelay:Ot,overlayClassName:Pt,overlayStyle:Xt,destroyPopupOnHide:wt,dropdownRender:bt},{compactSize:A,compactItemClassnames:N}=(0,de.ri)(Jt,Q),V=W()(Ee,N,Je,F);"overlay"in ze&&(j.overlay=fe),"open"in ze&&(j.open=Oe),"placement"in ze?j.placement=Be:j.placement=Q==="rtl"?"bottomLeft":"bottomRight";const ae=ee.createElement(K.ZP,{type:te,danger:b,disabled:C,loading:z,onClick:G,htmlType:Me,href:ye,title:Pe},Ue),S=ee.createElement(K.ZP,{type:te,danger:b,icon:Te}),[I,q]=Ce([ae,S]);return yt(ee.createElement(ue.Z.Compact,Object.assign({className:V,size:A,block:!0},Ht),I,ee.createElement(R.Z,Object.assign({},j),q)))};k.__ANT_BUTTON=!0;var m=k;const J=R.Z;J.Button=m;var $=J},47211:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return je}});var R=y(17313),P=y(13826),W=y(92899),ee=y(29878),H=y(19447),K=y(83116),pe=y(37613),de=k=>{const{componentCls:m,menuCls:J,colorError:$,colorTextLightSolid:ze}=k,st=`${J}-item`;return{[`${m}, ${m}-menu-submenu`]:{[`${J} ${st}`]:{[`&${st}-danger:not(${st}-disabled)`]:{color:$,"&:hover":{color:ze,backgroundColor:$}}}}}};const B=k=>{const{componentCls:m,menuCls:J,zIndexPopup:$,dropdownArrowDistance:ze,sizePopupArrow:st,antCls:me,iconCls:Q,motionDurationMid:se,dropdownPaddingVertical:te,fontSize:b,dropdownEdgeChildPadding:C,colorTextDisabled:z,fontSizeIcon:G,controlPaddingHorizontal:Me,colorBgElevated:Ue}=k;return[{[m]:Object.assign(Object.assign({},(0,R.Wf)(k)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:$,display:"block","&::before":{position:"absolute",insetBlock:-ze+st/2,zIndex:-9999,opacity:1e-4,content:'""'},[`&-trigger${me}-btn`]:{[`& > ${Q}-down, & > ${me}-btn-icon > ${Q}-down`]:{fontSize:G}},[`${m}-wrap`]:{position:"relative",[`${me}-btn > ${Q}-down`]:{fontSize:G},[`${Q}-down::before`]:{transition:`transform ${se}`}},[`${m}-wrap-open`]:{[`${Q}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${me}-slide-down-enter${me}-slide-down-enter-active${m}-placement-bottomLeft, &${me}-slide-down-appear${me}-slide-down-appear-active${m}-placement-bottomLeft, &${me}-slide-down-enter${me}-slide-down-enter-active${m}-placement-bottom, &${me}-slide-down-appear${me}-slide-down-appear-active${m}-placement-bottom, &${me}-slide-down-enter${me}-slide-down-enter-active${m}-placement-bottomRight, &${me}-slide-down-appear${me}-slide-down-appear-active${m}-placement-bottomRight`]:{animationName:P.fJ},[`&${me}-slide-up-enter${me}-slide-up-enter-active${m}-placement-topLeft, &${me}-slide-up-appear${me}-slide-up-appear-active${m}-placement-topLeft, &${me}-slide-up-enter${me}-slide-up-enter-active${m}-placement-top, &${me}-slide-up-appear${me}-slide-up-appear-active${m}-placement-top, &${me}-slide-up-enter${me}-slide-up-enter-active${m}-placement-topRight, &${me}-slide-up-appear${me}-slide-up-appear-active${m}-placement-topRight`]:{animationName:P.Qt},[`&${me}-slide-down-leave${me}-slide-down-leave-active${m}-placement-bottomLeft, &${me}-slide-down-leave${me}-slide-down-leave-active${m}-placement-bottom, &${me}-slide-down-leave${me}-slide-down-leave-active${m}-placement-bottomRight`]:{animationName:P.Uw},[`&${me}-slide-up-leave${me}-slide-up-leave-active${m}-placement-topLeft, &${me}-slide-up-leave${me}-slide-up-leave-active${m}-placement-top, &${me}-slide-up-leave${me}-slide-up-leave-active${m}-placement-topRight`]:{animationName:P.ly}})},(0,H.ZP)(k,{colorBg:Ue,limitVerticalRadius:!0,arrowPlacement:{top:!0,bottom:!0}}),{[`${m} ${J}`]:{position:"relative",margin:0},[`${J}-submenu-popup`]:{position:"absolute",zIndex:$,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${m}, ${m}-menu-submenu`]:{[J]:Object.assign(Object.assign({padding:C,listStyleType:"none",backgroundColor:Ue,backgroundClip:"padding-box",borderRadius:k.borderRadiusLG,outline:"none",boxShadow:k.boxShadowSecondary},(0,R.Qy)(k)),{[`${J}-item-group-title`]:{padding:`${te}px ${Me}px`,color:k.colorTextDescription,transition:`all ${se}`},[`${J}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${J}-item-icon`]:{minWidth:b,marginInlineEnd:k.marginXS,fontSize:k.fontSizeSM},[`${J}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${se}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${J}-item, ${J}-submenu-title`]:Object.assign(Object.assign({clear:"both",margin:0,padding:`${te}px ${Me}px`,color:k.colorText,fontWeight:"normal",fontSize:b,lineHeight:k.lineHeight,cursor:"pointer",transition:`all ${se}`,borderRadius:k.borderRadiusSM,"&:hover, &-active":{backgroundColor:k.controlItemBgHover}},(0,R.Qy)(k)),{"&-selected":{color:k.colorPrimary,backgroundColor:k.controlItemBgActive,"&:hover, &-active":{backgroundColor:k.controlItemBgActiveHover}},"&-disabled":{color:z,cursor:"not-allowed","&:hover":{color:z,backgroundColor:Ue,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${k.marginXXS}px 0`,overflow:"hidden",lineHeight:0,backgroundColor:k.colorSplit},[`${m}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:k.paddingXS,[`${m}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:k.colorTextDescription,fontSize:G,fontStyle:"normal"}}}),[`${J}-item-group-list`]:{margin:`0 ${k.marginXS}px`,padding:0,listStyle:"none"},[`${J}-submenu-title`]:{paddingInlineEnd:Me+k.fontSizeSM},[`${J}-submenu-vertical`]:{position:"relative"},[`${J}-submenu${J}-submenu-disabled ${m}-menu-submenu-title`]:{[`&, ${m}-menu-submenu-arrow-icon`]:{color:z,backgroundColor:Ue,cursor:"not-allowed"}},[`${J}-submenu-selected ${m}-menu-submenu-title`]:{color:k.colorPrimary}})}},[(0,P.oN)(k,"slide-up"),(0,P.oN)(k,"slide-down"),(0,W.Fm)(k,"move-up"),(0,W.Fm)(k,"move-down"),(0,ee._y)(k,"zoom-big")]]};var je=(0,K.Z)("Dropdown",(k,m)=>{let{rootPrefixCls:J}=m;const{marginXXS:$,sizePopupArrow:ze,controlHeight:st,fontSize:me,lineHeight:Q,paddingXXS:se,componentCls:te,borderRadiusLG:b}=k,C=(st-me*Q)/2,{dropdownArrowOffset:z}=(0,H.fS)({contentRadius:b}),G=(0,pe.TS)(k,{menuCls:`${te}-menu`,rootPrefixCls:J,dropdownArrowDistance:ze/2+$,dropdownArrowOffset:z,dropdownPaddingVertical:C,dropdownEdgeChildPadding:se});return[B(G),de(G)]},k=>({zIndexPopup:k.zIndexPopupBase+50}))},64165:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return se}});var R=y(92310),P=y.n(R),W=y(59301),ee=y(36355),H=y(9763),K=y(64993),pe=y(88088),de=()=>{const[,te]=(0,pe.Z)(),C=new K.C(te.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return W.createElement("svg",{style:C,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},W.createElement("g",{fill:"none",fillRule:"evenodd"},W.createElement("g",{transform:"translate(24 31.67)"},W.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),W.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"}),W.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)"}),W.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"}),W.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"})),W.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"}),W.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},W.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),W.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},je=()=>{const[,te]=(0,pe.Z)(),{colorFill:b,colorFillTertiary:C,colorFillQuaternary:z,colorBgContainer:G}=te,{borderColor:Me,shadowColor:Ue,contentColor:Je}=(0,W.useMemo)(()=>({borderColor:new K.C(b).onBackground(G).toHexShortString(),shadowColor:new K.C(C).onBackground(G).toHexShortString(),contentColor:new K.C(z).onBackground(G).toHexShortString()}),[b,C,z,G]);return W.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},W.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},W.createElement("ellipse",{fill:Ue,cx:"32",cy:"33",rx:"32",ry:"7"}),W.createElement("g",{fillRule:"nonzero",stroke:Me},W.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"}),W.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:Je}))))},k=y(83116),m=y(37613);const J=te=>{const{componentCls:b,margin:C,marginXS:z,marginXL:G,fontSize:Me,lineHeight:Ue}=te;return{[b]:{marginInline:z,fontSize:Me,lineHeight:Ue,textAlign:"center",[`${b}-image`]:{height:te.emptyImgHeight,marginBottom:z,opacity:te.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${b}-description`]:{color:te.colorText},[`${b}-footer`]:{marginTop:C},"&-normal":{marginBlock:G,color:te.colorTextDisabled,[`${b}-description`]:{color:te.colorTextDisabled},[`${b}-image`]:{height:te.emptyImgHeightMD}},"&-small":{marginBlock:z,color:te.colorTextDisabled,[`${b}-image`]:{height:te.emptyImgHeightSM}}}}};var $=(0,k.Z)("Empty",te=>{const{componentCls:b,controlHeightLG:C}=te,z=(0,m.TS)(te,{emptyImgCls:`${b}-img`,emptyImgHeight:C*2.5,emptyImgHeightMD:C,emptyImgHeightSM:C*.875});return[J(z)]}),ze=function(te,b){var C={};for(var z in te)Object.prototype.hasOwnProperty.call(te,z)&&b.indexOf(z)<0&&(C[z]=te[z]);if(te!=null&&typeof Object.getOwnPropertySymbols=="function")for(var G=0,z=Object.getOwnPropertySymbols(te);G{var{className:b,rootClassName:C,prefixCls:z,image:G=st,description:Me,children:Ue,imageStyle:Je,style:We}=te,ie=ze(te,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:Y,direction:fe,empty:O}=W.useContext(ee.E_),Ae=Y("empty",z),[Oe,ge]=$(Ae),[Be]=(0,H.Z)("Empty"),it=typeof Me!="undefined"?Me:Be==null?void 0:Be.description,ye=typeof it=="string"?it:"empty";let Te=null;return typeof G=="string"?Te=W.createElement("img",{alt:ye,src:G}):Te=G,Oe(W.createElement("div",Object.assign({className:P()(ge,Ae,O==null?void 0:O.className,{[`${Ae}-normal`]:G===me,[`${Ae}-rtl`]:fe==="rtl"},b,C),style:Object.assign(Object.assign({},O==null?void 0:O.style),We)},ie),W.createElement("div",{className:`${Ae}-image`,style:Je},Te),it&&W.createElement("div",{className:`${Ae}-description`},it),Ue&&W.createElement("div",{className:`${Ae}-footer`},Ue)))};Q.PRESENTED_IMAGE_DEFAULT=st,Q.PRESENTED_IMAGE_SIMPLE=me;var se=Q},8628:function(Wt,nt,y){"use strict";var R=y(59301),P=y(34280),W=y(56762),ee=y(69507);function H(){let K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const pe=(0,R.useRef)({}),ue=(0,W.Z)(),de=(0,ee.ZP)();return(0,P.Z)(()=>{const B=de.subscribe(je=>{pe.current=je,K&&ue()});return()=>de.unsubscribe(B)},[]),pe.current}nt.Z=H},9937:function(Wt,nt,y){"use strict";y.d(nt,{M1:function(){return pe},TM:function(){return te},Xy:function(){return ue},bi:function(){return je},e5:function(){return se},ik:function(){return k},nz:function(){return H},pU:function(){return K},s7:function(){return m},x0:function(){return B}});var R=y(17313),P=y(74207),W=y(37613),ee=y(83116);const H=b=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:b,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),K=b=>({borderColor:b.hoverBorderColor}),pe=b=>({borderColor:b.activeBorderColor,boxShadow:b.activeShadow,outline:0}),ue=b=>({color:b.colorTextDisabled,backgroundColor:b.colorBgContainerDisabled,borderColor:b.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},K((0,W.TS)(b,{hoverBorderColor:b.colorBorder})))}),de=b=>{const{paddingBlockLG:C,fontSizeLG:z,lineHeightLG:G,borderRadiusLG:Me,paddingInlineLG:Ue}=b;return{padding:`${C}px ${Ue}px`,fontSize:z,lineHeight:G,borderRadius:Me}},B=b=>({padding:`${b.paddingBlockSM}px ${b.paddingInlineSM}px`,borderRadius:b.borderRadiusSM}),je=(b,C)=>{const{componentCls:z,colorError:G,colorWarning:Me,errorActiveShadow:Ue,warningActiveShadow:Je,colorErrorBorderHover:We,colorWarningBorderHover:ie}=b;return{[`&-status-error:not(${C}-disabled):not(${C}-borderless)${C}`]:{borderColor:G,"&:hover":{borderColor:We},"&:focus, &-focused":Object.assign({},pe((0,W.TS)(b,{activeBorderColor:G,activeShadow:Ue}))),[`${z}-prefix, ${z}-suffix`]:{color:G}},[`&-status-warning:not(${C}-disabled):not(${C}-borderless)${C}`]:{borderColor:Me,"&:hover":{borderColor:ie},"&:focus, &-focused":Object.assign({},pe((0,W.TS)(b,{activeBorderColor:Me,activeShadow:Je}))),[`${z}-prefix, ${z}-suffix`]:{color:Me}}}},k=b=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${b.paddingBlock}px ${b.paddingInline}px`,color:b.colorText,fontSize:b.fontSize,lineHeight:b.lineHeight,backgroundColor:b.colorBgContainer,backgroundImage:"none",borderWidth:b.lineWidth,borderStyle:b.lineType,borderColor:b.colorBorder,borderRadius:b.borderRadius,transition:`all ${b.motionDurationMid}`},H(b.colorTextPlaceholder)),{"&:hover":Object.assign({},K(b)),"&:focus, &-focused":Object.assign({},pe(b)),"&-disabled, &[disabled]":Object.assign({},ue(b)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:b.controlHeight,lineHeight:b.lineHeight,verticalAlign:"bottom",transition:`all ${b.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},de(b)),"&-sm":Object.assign({},B(b)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),m=b=>{const{componentCls:C,antCls:z}=b;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:b.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${C}, &-lg > ${C}-group-addon`]:Object.assign({},de(b)),[`&-sm ${C}, &-sm > ${C}-group-addon`]:Object.assign({},B(b)),[`&-lg ${z}-select-single ${z}-select-selector`]:{height:b.controlHeightLG},[`&-sm ${z}-select-single ${z}-select-selector`]:{height:b.controlHeightSM},[`> ${C}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${C}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${b.paddingInline}px`,color:b.colorText,fontWeight:"normal",fontSize:b.fontSize,textAlign:"center",backgroundColor:b.colorFillAlter,border:`${b.lineWidth}px ${b.lineType} ${b.colorBorder}`,borderRadius:b.borderRadius,transition:`all ${b.motionDurationSlow}`,lineHeight:1,[`${z}-select`]:{margin:`-${b.paddingBlock+1}px -${b.paddingInline}px`,[`&${z}-select-single:not(${z}-select-customize-input)`]:{[`${z}-select-selector`]:{backgroundColor:"inherit",border:`${b.lineWidth}px ${b.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${z}-select-selector`]:{color:b.colorPrimary}}},[`${z}-cascader-picker`]:{margin:`-9px -${b.paddingInline}px`,backgroundColor:"transparent",[`${z}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${C}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${C}-search-with-button &`]:{zIndex:0}}},[`> ${C}:first-child, ${C}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${z}-select ${z}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${C}-affix-wrapper`]:{[`&:not(:first-child) ${C}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${C}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${C}:last-child, ${C}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${z}-select ${z}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${C}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${C}-search &`]:{borderStartStartRadius:b.borderRadius,borderEndStartRadius:b.borderRadius}},[`&:not(:first-child), ${C}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${C}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,R.dF)()),{[`${C}-group-addon, ${C}-group-wrap, > ${C}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:b.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[` & > ${C}-affix-wrapper, & > ${C}-number-affix-wrapper, & > ${z}-picker-range `]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-b.lineWidth,borderInlineEndWidth:b.lineWidth},[`${C}`]:{float:"none"},[`& > ${z}-select > ${z}-select-selector, & > ${z}-select-auto-complete ${C}, & > ${z}-cascader-picker ${C}, & > ${C}-group-wrapper ${C}`]:{borderInlineEndWidth:b.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${z}-select-focused`]:{zIndex:1},[`& > ${z}-select > ${z}-select-arrow`]:{zIndex:1},[`& > *:first-child, & > ${z}-select:first-child > ${z}-select-selector, & > ${z}-select-auto-complete:first-child ${C}, & > ${z}-cascader-picker:first-child ${C}`]:{borderStartStartRadius:b.borderRadius,borderEndStartRadius:b.borderRadius},[`& > *:last-child, & > ${z}-select:last-child > ${z}-select-selector, & > ${z}-cascader-picker:last-child ${C}, & > ${z}-cascader-picker-focused:last-child ${C}`]:{borderInlineEndWidth:b.lineWidth,borderStartEndRadius:b.borderRadius,borderEndEndRadius:b.borderRadius},[`& > ${z}-select-auto-complete ${C}`]:{verticalAlign:"top"},[`${C}-group-wrapper + ${C}-group-wrapper`]:{marginInlineStart:-b.lineWidth,[`${C}-affix-wrapper`]:{borderRadius:0}},[`${C}-group-wrapper:not(:last-child)`]:{[`&${C}-search > ${C}-group`]:{[`& > ${C}-group-addon > ${C}-search-button`]:{borderRadius:0},[`& > ${C}`]:{borderStartStartRadius:b.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:b.borderRadius}}}})}},J=b=>{const{componentCls:C,controlHeightSM:z,lineWidth:G}=b,Ue=(z-G*2-16)/2;return{[C]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,R.Wf)(b)),k(b)),je(b,C)),{'&[type="color"]':{height:b.controlHeight,[`&${C}-lg`]:{height:b.controlHeightLG},[`&${C}-sm`]:{height:z,paddingTop:Ue,paddingBottom:Ue}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},$=b=>{const{componentCls:C}=b;return{[`${C}-clear-icon`]:{margin:0,color:b.colorTextQuaternary,fontSize:b.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${b.motionDurationSlow}`,"&:hover":{color:b.colorTextTertiary},"&:active":{color:b.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${b.inputAffixPadding}px`}}}},ze=b=>{const{componentCls:C,inputAffixPadding:z,colorTextDescription:G,motionDurationSlow:Me,colorIcon:Ue,colorIconHover:Je,iconCls:We}=b;return{[`${C}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},k(b)),{display:"inline-flex",[`&:not(${C}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},K(b)),{zIndex:1,[`${C}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${C}[disabled]`]:{background:"transparent"}},[`> input${C}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${C}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:b.paddingXS}},"&-show-count-suffix":{color:G},"&-show-count-has-suffix":{marginInlineEnd:b.paddingXXS},"&-prefix":{marginInlineEnd:z},"&-suffix":{marginInlineStart:z}}}),$(b)),{[`${We}${C}-password-icon`]:{color:Ue,cursor:"pointer",transition:`all ${Me}`,"&:hover":{color:Je}}}),je(b,`${C}-affix-wrapper`))}},st=b=>{const{componentCls:C,colorError:z,colorWarning:G,borderRadiusLG:Me,borderRadiusSM:Ue}=b;return{[`${C}-group`]:Object.assign(Object.assign(Object.assign({},(0,R.Wf)(b)),m(b)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${C}-group-addon`]:{borderRadius:Me,fontSize:b.fontSizeLG}},"&-sm":{[`${C}-group-addon`]:{borderRadius:Ue}},"&-status-error":{[`${C}-group-addon`]:{color:z,borderColor:z}},"&-status-warning":{[`${C}-group-addon`]:{color:G,borderColor:G}},"&-disabled":{[`${C}-group-addon`]:Object.assign({},ue(b))},[`&:not(${C}-compact-first-item):not(${C}-compact-last-item)${C}-compact-item`]:{[`${C}, ${C}-group-addon`]:{borderRadius:0}},[`&:not(${C}-compact-last-item)${C}-compact-first-item`]:{[`${C}, ${C}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${C}-compact-first-item)${C}-compact-last-item`]:{[`${C}, ${C}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},me=b=>{const{componentCls:C,antCls:z}=b,G=`${C}-search`;return{[G]:{[`${C}`]:{"&:hover, &:focus":{borderColor:b.colorPrimaryHover,[`+ ${C}-group-addon ${G}-button:not(${z}-btn-primary)`]:{borderInlineStartColor:b.colorPrimaryHover}}},[`${C}-affix-wrapper`]:{borderRadius:0},[`${C}-lg`]:{lineHeight:b.lineHeightLG-2e-4},[`> ${C}-group`]:{[`> ${C}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${G}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:b.borderRadius,borderEndEndRadius:b.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${G}-button:not(${z}-btn-primary)`]:{color:b.colorTextDescription,"&:hover":{color:b.colorPrimaryHover},"&:active":{color:b.colorPrimaryActive},[`&${z}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${G}-button`]:{height:b.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${G}-button`]:{height:b.controlHeightLG},[`&-small ${G}-button`]:{height:b.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${C}-compact-item`]:{[`&:not(${C}-compact-last-item)`]:{[`${C}-group-addon`]:{[`${C}-search-button`]:{marginInlineEnd:-b.lineWidth,borderRadius:0}}},[`&:not(${C}-compact-first-item)`]:{[`${C},${C}-affix-wrapper`]:{borderRadius:0}},[`> ${C}-group-addon ${C}-search-button, > ${C}, ${C}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${C}-affix-wrapper-focused`]:{zIndex:2}}}}},Q=b=>{const{componentCls:C,paddingLG:z}=b,G=`${C}-textarea`;return{[G]:{position:"relative","&-show-count":{[`> ${C}`]:{height:"100%"},[`${C}-data-count`]:{position:"absolute",bottom:-b.fontSize*b.lineHeight,insetInlineEnd:0,color:b.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${C}`]:{paddingInlineEnd:z}},[`&-affix-wrapper${G}-has-feedback`]:{[`${C}`]:{paddingInlineEnd:z}},[`&-affix-wrapper${C}-affix-wrapper`]:{padding:0,[`> textarea${C}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${C}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${C}-clear-icon`]:{position:"absolute",insetInlineEnd:b.paddingXS,insetBlockStart:b.paddingXS},[`${G}-suffix`]:{position:"absolute",top:0,insetInlineEnd:b.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function se(b){return(0,W.TS)(b,{inputAffixPadding:b.paddingXXS})}const te=b=>{const{controlHeight:C,fontSize:z,lineHeight:G,lineWidth:Me,controlHeightSM:Ue,controlHeightLG:Je,fontSizeLG:We,lineHeightLG:ie,paddingSM:Y,controlPaddingHorizontalSM:fe,controlPaddingHorizontal:O,colorFillAlter:Ae,colorPrimaryHover:Oe,controlOutlineWidth:ge,controlOutline:Be,colorErrorOutline:it,colorWarningOutline:ye}=b;return{paddingBlock:Math.max(Math.round((C-z*G)/2*10)/10-Me,3),paddingBlockSM:Math.max(Math.round((Ue-z*G)/2*10)/10-Me,0),paddingBlockLG:Math.ceil((Je-We*ie)/2*10)/10-Me,paddingInline:Y-Me,paddingInlineSM:fe-Me,paddingInlineLG:O-Me,addonBg:Ae,activeBorderColor:Oe,hoverBorderColor:Oe,activeShadow:`0 0 0 ${ge}px ${Be}`,errorActiveShadow:`0 0 0 ${ge}px ${it}`,warningActiveShadow:`0 0 0 ${ge}px ${ye}`}};nt.ZP=(0,ee.Z)("Input",b=>{const C=(0,W.TS)(b,se(b));return[J(C),Q(C),ze(C),st(C),me(C),(0,P.c)(C)]},te)},45818:function(Wt,nt,y){"use strict";y.d(nt,{D:function(){return se},Z:function(){return C}});var R=y(96663),P=y(59301),W={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"},ee=W,H=y(7657),K=function(G,Me){return P.createElement(H.Z,(0,R.Z)({},G,{ref:Me,icon:ee}))},pe=P.forwardRef(K),ue=pe,de=y(33853),B=y(38819),je=y(92310),k=y.n(je),m=y(2738),$=z=>!isNaN(parseFloat(z))&&isFinite(z),ze=y(36355),st=y(84966),me=function(z,G){var Me={};for(var Ue in z)Object.prototype.hasOwnProperty.call(z,Ue)&&G.indexOf(Ue)<0&&(Me[Ue]=z[Ue]);if(z!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Je=0,Ue=Object.getOwnPropertySymbols(z);Je{let z=0;return function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return z+=1,`${G}${z}`}})();var C=P.forwardRef((z,G)=>{const{prefixCls:Me,className:Ue,trigger:Je,children:We,defaultCollapsed:ie=!1,theme:Y="dark",style:fe={},collapsible:O=!1,reverseArrow:Ae=!1,width:Oe=200,collapsedWidth:ge=80,zeroWidthTriggerStyle:Be,breakpoint:it,onCollapse:ye,onBreakpoint:Te}=z,Pe=me(z,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:Ce}=(0,P.useContext)(st.Gs),[at,Ot]=(0,P.useState)("collapsed"in z?z.collapsed:ie),[Pt,Xt]=(0,P.useState)(!1);(0,P.useEffect)(()=>{"collapsed"in z&&Ot(z.collapsed)},[z.collapsed]);const wt=(F,j)=>{"collapsed"in z||Ot(F),ye==null||ye(F,j)},bt=(0,P.useRef)();bt.current=F=>{Xt(F.matches),Te==null||Te(F.matches),at!==F.matches&&wt(F.matches,"responsive")},(0,P.useEffect)(()=>{function F(A){return bt.current(A)}let j;if(typeof window!="undefined"){const{matchMedia:A}=window;if(A&&it&&it in Q){j=A(`(max-width: ${Q[it]})`);try{j.addEventListener("change",F)}catch(N){j.addListener(F)}F(j)}}return()=>{try{j==null||j.removeEventListener("change",F)}catch(A){j==null||j.removeListener(F)}}},[it]),(0,P.useEffect)(()=>{const F=te("ant-sider-");return Ce.addSider(F),()=>Ce.removeSider(F)},[]);const Ht=()=>{wt(!at,"clickTrigger")},{getPrefixCls:Jt}=(0,P.useContext)(ze.E_),Ee=()=>{const F=Jt("layout-sider",Me),j=(0,m.Z)(Pe,["collapsed"]),A=at?ge:Oe,N=$(A)?`${A}px`:String(A),V=parseFloat(String(ge||0))===0?P.createElement("span",{onClick:Ht,className:k()(`${F}-zero-width-trigger`,`${F}-zero-width-trigger-${Ae?"right":"left"}`),style:Be},Je||P.createElement(ue,null)):null,I={expanded:Ae?P.createElement(B.Z,null):P.createElement(de.Z,null),collapsed:Ae?P.createElement(de.Z,null):P.createElement(B.Z,null)}[at?"collapsed":"expanded"],q=Je!==null?V||P.createElement("div",{className:`${F}-trigger`,onClick:Ht,style:{width:N}},Je||I):null,D=Object.assign(Object.assign({},fe),{flex:`0 0 ${N}`,maxWidth:N,minWidth:N,width:N}),_=k()(F,`${F}-${Y}`,{[`${F}-collapsed`]:!!at,[`${F}-has-trigger`]:O&&Je!==null&&!V,[`${F}-below`]:!!Pt,[`${F}-zero-width`]:parseFloat(N)===0},Ue);return P.createElement("aside",Object.assign({className:_},j,{style:D,ref:G}),P.createElement("div",{className:`${F}-children`},We),O||Pt&&V?q:null)},yt=P.useMemo(()=>({siderCollapsed:at}),[at]);return P.createElement(se.Provider,{value:yt},Ee())})},84966:function(Wt,nt,y){"use strict";y.d(nt,{VY:function(){return se},$_:function(){return Q},h4:function(){return me},Gs:function(){return m},ZP:function(){return te}});var R=y(19127),P=y(92310),W=y.n(P),ee=y(2738),H=y(59301),K=y(36355),pe=y(83116),de=b=>{const{componentCls:C,bodyBg:z,lightSiderBg:G,lightTriggerBg:Me,lightTriggerColor:Ue}=b;return{[`${C}-sider-light`]:{background:G,[`${C}-sider-trigger`]:{color:Ue,background:Me},[`${C}-sider-zero-width-trigger`]:{color:Ue,background:Me,border:`1px solid ${z}`,borderInlineStart:0}}}};const B=b=>{const{antCls:C,componentCls:z,colorText:G,triggerColor:Me,footerBg:Ue,triggerBg:Je,headerHeight:We,headerPadding:ie,headerColor:Y,footerPadding:fe,triggerHeight:O,zeroTriggerHeight:Ae,zeroTriggerWidth:Oe,motionDurationMid:ge,motionDurationSlow:Be,fontSize:it,borderRadius:ye,bodyBg:Te,headerBg:Pe,siderBg:Ce}=b;return{[z]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:Te,"&, *":{boxSizing:"border-box"},[`&${z}-has-sider`]:{flexDirection:"row",[`> ${z}, > ${z}-content`]:{width:0}},[`${z}-header, &${z}-footer`]:{flex:"0 0 auto"},[`${z}-sider`]:{position:"relative",minWidth:0,background:Ce,transition:`all ${ge}, background 0s`,"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,[`${C}-menu${C}-menu-inline-collapsed`]:{width:"auto"}},"&-has-trigger":{paddingBottom:O},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:O,color:Me,lineHeight:`${O}px`,textAlign:"center",background:Je,cursor:"pointer",transition:`all ${ge}`},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:We,insetInlineEnd:-Oe,zIndex:1,width:Oe,height:Ae,color:Me,fontSize:b.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:Ce,borderStartStartRadius:0,borderStartEndRadius:ye,borderEndEndRadius:ye,borderEndStartRadius:0,cursor:"pointer",transition:`background ${Be} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${Be}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:-Oe,borderStartStartRadius:ye,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:ye}}}}},de(b)),{"&-rtl":{direction:"rtl"}}),[`${z}-header`]:{height:We,padding:ie,color:Y,lineHeight:`${We}px`,background:Pe,[`${C}-menu`]:{lineHeight:"inherit"}},[`${z}-footer`]:{padding:fe,color:G,fontSize:it,background:Ue},[`${z}-content`]:{flex:"auto",minHeight:0}}};var je=(0,pe.Z)("Layout",b=>[B(b)],b=>{const{colorBgLayout:C,controlHeight:z,controlHeightLG:G,colorText:Me,controlHeightSM:Ue,marginXXS:Je,colorTextLightSolid:We,colorBgContainer:ie}=b,Y=G*1.25;return{colorBgHeader:"#001529",colorBgBody:C,colorBgTrigger:"#002140",bodyBg:C,headerBg:"#001529",headerHeight:z*2,headerPadding:`0 ${Y}px`,headerColor:Me,footerPadding:`${Ue}px ${Y}px`,footerBg:C,siderBg:"#001529",triggerHeight:G+Je*2,triggerBg:"#002140",triggerColor:We,zeroTriggerWidth:G,zeroTriggerHeight:G,lightSiderBg:ie,lightTriggerBg:ie,lightTriggerColor:Me}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),k=function(b,C){var z={};for(var G in b)Object.prototype.hasOwnProperty.call(b,G)&&C.indexOf(G)<0&&(z[G]=b[G]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Me=0,G=Object.getOwnPropertySymbols(b);Menull,removeSider:()=>null}});function J(b){let{suffixCls:C,tagName:z,displayName:G}=b;return Me=>H.forwardRef((Je,We)=>H.createElement(Me,Object.assign({ref:We,suffixCls:C,tagName:z},Je)))}const $=H.forwardRef((b,C)=>{const{prefixCls:z,suffixCls:G,className:Me,tagName:Ue}=b,Je=k(b,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:We}=H.useContext(K.E_),ie=We("layout",z),[Y,fe]=je(ie),O=G?`${ie}-${G}`:ie;return Y(H.createElement(Ue,Object.assign({className:W()(z||O,Me,fe),ref:C},Je)))}),ze=H.forwardRef((b,C)=>{const{direction:z}=H.useContext(K.E_),[G,Me]=H.useState([]),{prefixCls:Ue,className:Je,rootClassName:We,children:ie,hasSider:Y,tagName:fe,style:O}=b,Ae=k(b,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),Oe=(0,ee.Z)(Ae,["suffixCls"]),{getPrefixCls:ge,layout:Be}=H.useContext(K.E_),it=ge("layout",Ue),[ye,Te]=je(it),Pe=W()(it,{[`${it}-has-sider`]:typeof Y=="boolean"?Y:G.length>0,[`${it}-rtl`]:z==="rtl"},Be==null?void 0:Be.className,Je,We,Te),Ce=H.useMemo(()=>({siderHook:{addSider:at=>{Me(Ot=>[].concat((0,R.Z)(Ot),[at]))},removeSider:at=>{Me(Ot=>Ot.filter(Pt=>Pt!==at))}}}),[]);return ye(H.createElement(m.Provider,{value:Ce},H.createElement(fe,Object.assign({ref:C,className:Pe,style:Object.assign(Object.assign({},Be==null?void 0:Be.style),O)},Oe),ie)))}),st=J({tagName:"div",displayName:"Layout"})(ze),me=J({suffixCls:"header",tagName:"header",displayName:"Header"})($),Q=J({suffixCls:"footer",tagName:"footer",displayName:"Footer"})($),se=J({suffixCls:"content",tagName:"main",displayName:"Content"})($);var te=st},40875:function(Wt,nt,y){"use strict";y.d(nt,{J:function(){return K}});var R=y(59301),P=y(33234),W=y(70425),ee=function(pe,ue){var de={};for(var B in pe)Object.prototype.hasOwnProperty.call(pe,B)&&ue.indexOf(B)<0&&(de[B]=pe[B]);if(pe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var je=0,B=Object.getOwnPropertySymbols(pe);je{const{children:de}=pe,B=ee(pe,["children"]),je=R.useContext(H),k=R.useMemo(()=>Object.assign(Object.assign({},je),B),[je,B.prefixCls,B.mode,B.selectable]);return R.createElement(H.Provider,{value:k},R.createElement(P.BR,null,(0,W.supportNodeRef)(de)?R.cloneElement(de,{ref:ue}):de))});nt.Z=H},20834:function(Wt,nt,y){"use strict";y.d(nt,{default:function(){return yt}});var R=y(15285),P=y(59301),W=y(45818),ee=y(92310),H=y.n(ee),K=y(36355),pe=function(F,j){var A={};for(var N in F)Object.prototype.hasOwnProperty.call(F,N)&&j.indexOf(N)<0&&(A[N]=F[N]);if(F!=null&&typeof Object.getOwnPropertySymbols=="function")for(var V=0,N=Object.getOwnPropertySymbols(F);V{const{prefixCls:j,className:A,dashed:N}=F,V=pe(F,["prefixCls","className","dashed"]),{getPrefixCls:ae}=P.useContext(K.E_),S=ae("menu",j),I=H()({[`${S}-item-divider-dashed`]:!!N},A);return P.createElement(R.iz,Object.assign({className:I},V))},B=y(11592),je=y(2738),k=y(6848),m=y(92343),$=(0,P.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),st=F=>{var j;const{className:A,children:N,icon:V,title:ae,danger:S}=F,{prefixCls:I,firstLevel:q,direction:D,disableMenuItemTitleTooltip:_,inlineCollapsed:ne}=P.useContext($),De=ft=>{const Xe=P.createElement("span",{className:`${I}-title-content`},N);return(!V||(0,m.l$)(N)&&N.type==="span")&&N&&ft&&q&&typeof N=="string"?P.createElement("div",{className:`${I}-inline-collapsed-noicon`},N.charAt(0)):Xe},{siderCollapsed:Se}=P.useContext(W.D);let Qe=ae;typeof ae=="undefined"?Qe=q?N:"":ae===!1&&(Qe="");const Re={title:Qe};!Se&&!ne&&(Re.title=null,Re.open=!1);const we=(0,B.Z)(N).length;let He=P.createElement(R.ck,Object.assign({},(0,je.Z)(F,["title","icon","danger"]),{className:H()({[`${I}-item-danger`]:S,[`${I}-item-only-child`]:(V?we+1:we)===1},A),title:typeof ae=="string"?ae:void 0}),(0,m.Tm)(V,{className:H()((0,m.l$)(V)?(j=V.props)===null||j===void 0?void 0:j.className:"",`${I}-item-icon`)}),De(ne));return _||(He=P.createElement(k.Z,Object.assign({},Re,{placement:D==="rtl"?"left":"right",overlayClassName:`${I}-inline-collapsed-tooltip`}),He)),He},Q=F=>{var j;const{popupClassName:A,icon:N,title:V,theme:ae}=F,S=P.useContext($),{prefixCls:I,inlineCollapsed:q,theme:D}=S,_=(0,R.Xl)();let ne;if(!N)ne=q&&!_.length&&V&&typeof V=="string"?P.createElement("div",{className:`${I}-inline-collapsed-noicon`},V.charAt(0)):P.createElement("span",{className:`${I}-title-content`},V);else{const Se=(0,m.l$)(V)&&V.type==="span";ne=P.createElement(P.Fragment,null,(0,m.Tm)(N,{className:H()((0,m.l$)(N)?(j=N.props)===null||j===void 0?void 0:j.className:"",`${I}-item-icon`)}),Se?V:P.createElement("span",{className:`${I}-title-content`},V))}const De=P.useMemo(()=>Object.assign(Object.assign({},S),{firstLevel:!1}),[S]);return P.createElement($.Provider,{value:De},P.createElement(R.Wd,Object.assign({},(0,je.Z)(F,["icon"]),{title:ne,popupClassName:H()(I,A,`${I}-${ae||D}`)})))},se=y(18785),te=y(70425),b=y(62892),C=y(40875),z=function(F,j){var A={};for(var N in F)Object.prototype.hasOwnProperty.call(F,N)&&j.indexOf(N)<0&&(A[N]=F[N]);if(F!=null&&typeof Object.getOwnPropertySymbols=="function")for(var V=0,N=Object.getOwnPropertySymbols(F);V{if(j&&typeof j=="object"){const N=j,{label:V,children:ae,key:S,type:I}=N,q=z(N,["label","children","key","type"]),D=S!=null?S:`tmp-${A}`;return ae||I==="group"?I==="group"?P.createElement(R.BW,Object.assign({key:D},q,{title:V}),G(ae)):P.createElement(Q,Object.assign({key:D},q,{title:V}),G(ae)):I==="divider"?P.createElement(de,Object.assign({key:D},q)):P.createElement(st,Object.assign({key:D},q),V)}return null}).filter(j=>j)}function Me(F){return P.useMemo(()=>F&&G(F),[F])}var Ue=y(64993),Je=y(17313),We=y(8378),ie=y(13826),Y=y(29878),fe=y(83116),O=y(37613),Oe=F=>{const{componentCls:j,motionDurationSlow:A,horizontalLineHeight:N,colorSplit:V,lineWidth:ae,lineType:S,itemPaddingInline:I}=F;return{[`${j}-horizontal`]:{lineHeight:N,border:0,borderBottom:`${ae}px ${S} ${V}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${j}-item, ${j}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:I},[`> ${j}-item:hover, > ${j}-item-active, > ${j}-submenu ${j}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${j}-item, ${j}-submenu-title`]:{transition:[`border-color ${A}`,`background ${A}`].join(",")},[`${j}-submenu-arrow`]:{display:"none"}}}},Be=F=>{let{componentCls:j,menuArrowOffset:A}=F;return{[`${j}-rtl`]:{direction:"rtl"},[`${j}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${j}-rtl${j}-vertical, ${j}-submenu-rtl ${j}-vertical`]:{[`${j}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${A})`},"&::after":{transform:`rotate(45deg) translateY(${A})`}}}}};const it=F=>Object.assign({},(0,Je.oN)(F));var Te=(F,j)=>{const{componentCls:A,itemColor:N,itemSelectedColor:V,groupTitleColor:ae,itemBg:S,subMenuItemBg:I,itemSelectedBg:q,activeBarHeight:D,activeBarWidth:_,activeBarBorderWidth:ne,motionDurationSlow:De,motionEaseInOut:Se,motionEaseOut:Qe,itemPaddingInline:Re,motionDurationMid:we,itemHoverColor:He,lineType:ft,colorSplit:Xe,itemDisabledColor:he,dangerItemColor:Dt,dangerItemHoverColor:Tt,dangerItemSelectedColor:Kt,dangerItemActiveBg:ot,dangerItemSelectedBg:on,itemHoverBg:ln,itemActiveBg:yn,menuSubMenuBg:Cn,horizontalItemSelectedColor:Mt,horizontalItemSelectedBg:qt,horizontalItemBorderRadius:ht,horizontalItemHoverBg:kt,popupBg:mn}=F;return{[`${A}-${j}, ${A}-${j} > ${A}`]:{color:N,background:S,[`&${A}-root:focus-visible`]:Object.assign({},it(F)),[`${A}-item-group-title`]:{color:ae},[`${A}-submenu-selected`]:{[`> ${A}-submenu-title`]:{color:V}},[`${A}-item-disabled, ${A}-submenu-disabled`]:{color:`${he} !important`},[`${A}-item:not(${A}-item-selected):not(${A}-submenu-selected)`]:{[`&:hover, > ${A}-submenu-title:hover`]:{color:He}},[`&:not(${A}-horizontal)`]:{[`${A}-item:not(${A}-item-selected)`]:{"&:hover":{backgroundColor:ln},"&:active":{backgroundColor:yn}},[`${A}-submenu-title`]:{"&:hover":{backgroundColor:ln},"&:active":{backgroundColor:yn}}},[`${A}-item-danger`]:{color:Dt,[`&${A}-item:hover`]:{[`&:not(${A}-item-selected):not(${A}-submenu-selected)`]:{color:Tt}},[`&${A}-item:active`]:{background:ot}},[`${A}-item a`]:{"&, &:hover":{color:"inherit"}},[`${A}-item-selected`]:{color:V,[`&${A}-item-danger`]:{color:Kt},"a, a:hover":{color:"inherit"}},[`& ${A}-item-selected`]:{backgroundColor:q,[`&${A}-item-danger`]:{backgroundColor:on}},[`${A}-item, ${A}-submenu-title`]:{[`&:not(${A}-item-disabled):focus-visible`]:Object.assign({},it(F))},[`&${A}-submenu > ${A}`]:{backgroundColor:Cn},[`&${A}-popup > ${A}`]:{backgroundColor:mn},[`&${A}-horizontal`]:Object.assign(Object.assign({},j==="dark"?{borderBottom:0}:{}),{[`> ${A}-item, > ${A}-submenu`]:{top:ne,marginTop:-ne,marginBottom:0,borderRadius:ht,"&::after":{position:"absolute",insetInline:Re,bottom:0,borderBottom:`${D}px solid transparent`,transition:`border-color ${De} ${Se}`,content:'""'},"&:hover, &-active, &-open":{background:kt,"&::after":{borderBottomWidth:D,borderBottomColor:Mt}},"&-selected":{color:Mt,backgroundColor:qt,"&:hover":{backgroundColor:qt},"&::after":{borderBottomWidth:D,borderBottomColor:Mt}}}}),[`&${A}-root`]:{[`&${A}-inline, &${A}-vertical`]:{borderInlineEnd:`${ne}px ${ft} ${Xe}`}},[`&${A}-inline`]:{[`${A}-sub${A}-inline`]:{background:I},[`${A}-item, ${A}-submenu-title`]:ne&&_?{width:`calc(100% + ${ne}px)`}:{},[`${A}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${_}px solid ${V}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${we} ${Qe}`,`opacity ${we} ${Qe}`].join(","),content:'""'},[`&${A}-item-danger`]:{"&::after":{borderInlineEndColor:Kt}}},[`${A}-selected, ${A}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${we} ${Se}`,`opacity ${we} ${Se}`].join(",")}}}}}};const Pe=F=>{const{componentCls:j,itemHeight:A,itemMarginInline:N,padding:V,menuArrowSize:ae,marginXS:S,itemMarginBlock:I}=F,q=V+ae+S;return{[`${j}-item`]:{position:"relative",overflow:"hidden"},[`${j}-item, ${j}-submenu-title`]:{height:A,lineHeight:`${A}px`,paddingInline:V,overflow:"hidden",textOverflow:"ellipsis",marginInline:N,marginBlock:I,width:`calc(100% - ${N*2}px)`},[`> ${j}-item, > ${j}-submenu > ${j}-submenu-title`]:{height:A,lineHeight:`${A}px`},[`${j}-item-group-list ${j}-submenu-title, ${j}-submenu-title`]:{paddingInlineEnd:q}}};var at=F=>{const{componentCls:j,iconCls:A,itemHeight:N,colorTextLightSolid:V,dropdownWidth:ae,controlHeightLG:S,motionDurationMid:I,motionEaseOut:q,paddingXL:D,itemMarginInline:_,fontSizeLG:ne,motionDurationSlow:De,paddingXS:Se,boxShadowSecondary:Qe,collapsedWidth:Re,collapsedIconSize:we}=F,He={height:N,lineHeight:`${N}px`,listStylePosition:"inside",listStyleType:"disc"};return[{[j]:{"&-inline, &-vertical":Object.assign({[`&${j}-root`]:{boxShadow:"none"}},Pe(F))},[`${j}-submenu-popup`]:{[`${j}-vertical`]:Object.assign(Object.assign({},Pe(F)),{boxShadow:Qe})}},{[`${j}-submenu-popup ${j}-vertical${j}-sub`]:{minWidth:ae,maxHeight:`calc(100vh - ${S*2.5}px)`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${j}-inline`]:{width:"100%",[`&${j}-root`]:{[`${j}-item, ${j}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${De}`,`background ${De}`,`padding ${I} ${q}`].join(","),[`> ${j}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${j}-sub${j}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${j}-submenu > ${j}-submenu-title`]:He,[`& ${j}-item-group-title`]:{paddingInlineStart:D}},[`${j}-item`]:He}},{[`${j}-inline-collapsed`]:{width:Re,[`&${j}-root`]:{[`${j}-item, ${j}-submenu ${j}-submenu-title`]:{[`> ${j}-inline-collapsed-noicon`]:{fontSize:ne,textAlign:"center"}}},[`> ${j}-item, > ${j}-item-group > ${j}-item-group-list > ${j}-item, > ${j}-item-group > ${j}-item-group-list > ${j}-submenu > ${j}-submenu-title, > ${j}-submenu > ${j}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${ne/2}px - ${_}px)`,textOverflow:"clip",[` ${j}-submenu-arrow, ${j}-submenu-expand-icon `]:{opacity:0},[`${j}-item-icon, ${A}`]:{margin:0,fontSize:we,lineHeight:`${N}px`,"+ span":{display:"inline-block",opacity:0}}},[`${j}-item-icon, ${A}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${j}-item-icon, ${A}`]:{display:"none"},"a, a:hover":{color:V}},[`${j}-item-group-title`]:Object.assign(Object.assign({},Je.vS),{paddingInline:Se})}}]};const Ot=F=>{const{componentCls:j,motionDurationSlow:A,motionDurationMid:N,motionEaseInOut:V,motionEaseOut:ae,iconCls:S,iconSize:I,iconMarginInlineEnd:q}=F;return{[`${j}-item, ${j}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${A}`,`background ${A}`,`padding ${A} ${V}`].join(","),[`${j}-item-icon, ${S}`]:{minWidth:I,fontSize:I,transition:[`font-size ${N} ${ae}`,`margin ${A} ${V}`,`color ${A}`].join(","),"+ span":{marginInlineStart:q,opacity:1,transition:[`opacity ${A} ${V}`,`margin ${A}`,`color ${A}`].join(",")}},[`${j}-item-icon`]:Object.assign({},(0,Je.Ro)()),[`&${j}-item-only-child`]:{[`> ${S}, > ${j}-item-icon`]:{marginInlineEnd:0}}},[`${j}-item-disabled, ${j}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${j}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},Pt=F=>{const{componentCls:j,motionDurationSlow:A,motionEaseInOut:N,borderRadius:V,menuArrowSize:ae,menuArrowOffset:S}=F;return{[`${j}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:F.margin,width:ae,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${A} ${N}, opacity ${A}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:ae*.6,height:ae*.15,backgroundColor:"currentcolor",borderRadius:V,transition:[`background ${A} ${N}`,`transform ${A} ${N}`,`top ${A} ${N}`,`color ${A} ${N}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${S})`},"&::after":{transform:`rotate(-45deg) translateY(${S})`}}}}},Xt=F=>{const{antCls:j,componentCls:A,fontSize:N,motionDurationSlow:V,motionDurationMid:ae,motionEaseInOut:S,paddingXS:I,padding:q,colorSplit:D,lineWidth:_,zIndexPopup:ne,borderRadiusLG:De,subMenuItemBorderRadius:Se,menuArrowSize:Qe,menuArrowOffset:Re,lineType:we,menuPanelMaskInset:He,groupTitleLineHeight:ft,groupTitleFontSize:Xe}=F;return[{"":{[`${A}`]:Object.assign(Object.assign({},(0,Je.dF)()),{"&-hidden":{display:"none"}})},[`${A}-submenu-hidden`]:{display:"none"}},{[A]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,Je.Wf)(F)),(0,Je.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:N,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${V} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${A}-item`]:{flex:"none"}},[`${A}-item, ${A}-submenu, ${A}-submenu-title`]:{borderRadius:F.itemBorderRadius},[`${A}-item-group-title`]:{padding:`${I}px ${q}px`,fontSize:Xe,lineHeight:ft,transition:`all ${V}`},[`&-horizontal ${A}-submenu`]:{transition:[`border-color ${V} ${S}`,`background ${V} ${S}`].join(",")},[`${A}-submenu, ${A}-submenu-inline`]:{transition:[`border-color ${V} ${S}`,`background ${V} ${S}`,`padding ${ae} ${S}`].join(",")},[`${A}-submenu ${A}-sub`]:{cursor:"initial",transition:[`background ${V} ${S}`,`padding ${V} ${S}`].join(",")},[`${A}-title-content`]:{transition:`color ${V}`},[`${A}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${A}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:D,borderStyle:we,borderWidth:0,borderTopWidth:_,marginBlock:_,padding:0,"&-dashed":{borderStyle:"dashed"}}}),Ot(F)),{[`${A}-item-group`]:{[`${A}-item-group-list`]:{margin:0,padding:0,[`${A}-item, ${A}-submenu-title`]:{paddingInline:`${N*2}px ${q}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:ne,borderRadius:De,boxShadow:"none",transformOrigin:"0 0",[`&${A}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:`${He}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:He},"\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:F.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:F.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:F.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:F.paddingXS},[`> ${A}`]:Object.assign(Object.assign(Object.assign({borderRadius:De},Ot(F)),Pt(F)),{[`${A}-item, ${A}-submenu > ${A}-submenu-title`]:{borderRadius:Se},[`${A}-submenu-title::after`]:{transition:`transform ${V} ${S}`}})}}),Pt(F)),{[`&-inline-collapsed ${A}-submenu-arrow, &-inline ${A}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${Re})`},"&::after":{transform:`rotate(45deg) translateX(-${Re})`}},[`${A}-submenu-open${A}-submenu-inline > ${A}-submenu-title > ${A}-submenu-arrow`]:{transform:`translateY(-${Qe*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${Re})`},"&::before":{transform:`rotate(45deg) translateX(${Re})`}}})},{[`${j}-layout-header`]:{[A]:{lineHeight:"inherit"}}}]};var wt=(F,j)=>(0,fe.Z)("Menu",N=>{if(j===!1)return[];const{colorBgElevated:V,colorPrimary:ae,colorTextLightSolid:S,controlHeightLG:I,fontSize:q,darkItemColor:D,darkDangerItemColor:_,darkItemBg:ne,darkSubMenuItemBg:De,darkItemSelectedColor:Se,darkItemSelectedBg:Qe,darkDangerItemSelectedBg:Re,darkItemHoverBg:we,darkGroupTitleColor:He,darkItemHoverColor:ft,darkItemDisabledColor:Xe,darkDangerItemHoverColor:he,darkDangerItemSelectedColor:Dt,darkDangerItemActiveBg:Tt}=N,Kt=q/7*5,ot=(0,O.TS)(N,{menuArrowSize:Kt,menuHorizontalHeight:I*1.15,menuArrowOffset:`${Kt*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:V}),on=(0,O.TS)(ot,{itemColor:D,itemHoverColor:ft,groupTitleColor:He,itemSelectedColor:Se,itemBg:ne,popupBg:ne,subMenuItemBg:De,itemActiveBg:"transparent",itemSelectedBg:Qe,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:we,itemDisabledColor:Xe,dangerItemColor:_,dangerItemHoverColor:he,dangerItemSelectedColor:Dt,dangerItemActiveBg:Tt,dangerItemSelectedBg:Re,menuSubMenuBg:De,horizontalItemSelectedColor:S,horizontalItemSelectedBg:ae});return[Xt(ot),Oe(ot),at(ot),Te(ot,"light"),Te(on,"dark"),Be(ot),(0,We.Z)(ot),(0,ie.oN)(ot,"slide-up"),(0,ie.oN)(ot,"slide-down"),(0,Y._y)(ot,"zoom-big")]},N=>{const{colorPrimary:V,colorError:ae,colorTextDisabled:S,colorErrorBg:I,colorText:q,colorTextDescription:D,colorBgContainer:_,colorFillAlter:ne,colorFillContent:De,lineWidth:Se,lineWidthBold:Qe,controlItemBgActive:Re,colorBgTextHover:we,controlHeightLG:He,lineHeight:ft,colorBgElevated:Xe,marginXXS:he,padding:Dt,fontSize:Tt,controlHeightSM:Kt,fontSizeLG:ot,colorTextLightSolid:on,colorErrorHover:ln}=N,yn=new Ue.C(on).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:N.zIndexPopupBase+50,radiusItem:N.borderRadiusLG,itemBorderRadius:N.borderRadiusLG,radiusSubMenuItem:N.borderRadiusSM,subMenuItemBorderRadius:N.borderRadiusSM,colorItemText:q,itemColor:q,colorItemTextHover:q,itemHoverColor:q,colorItemTextHoverHorizontal:V,horizontalItemHoverColor:V,colorGroupTitle:D,groupTitleColor:D,colorItemTextSelected:V,itemSelectedColor:V,colorItemTextSelectedHorizontal:V,horizontalItemSelectedColor:V,colorItemBg:_,itemBg:_,colorItemBgHover:we,itemHoverBg:we,colorItemBgActive:De,itemActiveBg:Re,colorSubItemBg:ne,subMenuItemBg:ne,colorItemBgSelected:Re,itemSelectedBg:Re,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:0,colorActiveBarHeight:Qe,activeBarHeight:Qe,colorActiveBarBorderSize:Se,activeBarBorderWidth:Se,colorItemTextDisabled:S,itemDisabledColor:S,colorDangerItemText:ae,dangerItemColor:ae,colorDangerItemTextHover:ae,dangerItemHoverColor:ae,colorDangerItemTextSelected:ae,dangerItemSelectedColor:ae,colorDangerItemBgActive:I,dangerItemActiveBg:I,colorDangerItemBgSelected:I,dangerItemSelectedBg:I,itemMarginInline:N.marginXXS,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:He,groupTitleLineHeight:ft,collapsedWidth:He*2,popupBg:Xe,itemMarginBlock:he,itemPaddingInline:Dt,horizontalLineHeight:`${He*1.15}px`,iconSize:Tt,iconMarginInlineEnd:Kt-Tt,collapsedIconSize:ot,groupTitleFontSize:Tt,darkItemDisabledColor:new Ue.C(on).setAlpha(.25).toRgbString(),darkItemColor:yn,darkDangerItemColor:ae,darkItemBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:on,darkItemSelectedBg:V,darkDangerItemSelectedBg:ae,darkItemHoverBg:"transparent",darkGroupTitleColor:yn,darkItemHoverColor:on,darkDangerItemHoverColor:ln,darkDangerItemSelectedColor:on,darkDangerItemActiveBg:ae}},{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"]]})(F),bt=function(F,j){var A={};for(var N in F)Object.prototype.hasOwnProperty.call(F,N)&&j.indexOf(N)<0&&(A[N]=F[N]);if(F!=null&&typeof Object.getOwnPropertySymbols=="function")for(var V=0,N=Object.getOwnPropertySymbols(F);V{var A,N;const V=P.useContext(C.Z),ae=V||{},{getPrefixCls:S,getPopupContainer:I,direction:q,menu:D}=P.useContext(K.E_),_=S(),{prefixCls:ne,className:De,style:Se,theme:Qe="light",expandIcon:Re,_internalDisableMenuItemTitleTooltip:we,inlineCollapsed:He,siderCollapsed:ft,items:Xe,children:he,rootClassName:Dt,mode:Tt,selectable:Kt,onClick:ot,overflowedIndicatorPopupClassName:on}=F,ln=bt(F,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),yn=(0,je.Z)(ln,["collapsedWidth"]),Cn=Me(Xe)||he;(A=ae.validator)===null||A===void 0||A.call(ae,{mode:Tt});const Mt=(0,te.useEvent)(function(){var Mn;ot==null||ot.apply(void 0,arguments),(Mn=ae.onClick)===null||Mn===void 0||Mn.call(ae)}),qt=ae.mode||Tt,ht=Kt!=null?Kt:ae.selectable,kt=P.useMemo(()=>ft!==void 0?ft:He,[He,ft]),mn={horizontal:{motionName:`${_}-slide-up`},inline:(0,b.Z)(_),other:{motionName:`${_}-zoom-big`}},It=S("menu",ne||ae.prefixCls),[en,An]=wt(It,!V),gn=H()(`${It}-${Qe}`,D==null?void 0:D.className,De);let Pn;if(typeof Re=="function")Pn=Re;else if(Re===null||Re===!1)Pn=null;else if(ae.expandIcon===null||ae.expandIcon===!1)Pn=null;else{const Mn=Re!=null?Re:ae.expandIcon;Pn=(0,m.Tm)(Mn,{className:H()(`${It}-submenu-expand-icon`,(0,m.l$)(Mn)?(N=Mn.props)===null||N===void 0?void 0:N.className:"")})}const On=P.useMemo(()=>({prefixCls:It,inlineCollapsed:kt||!1,direction:q,firstLevel:!0,theme:Qe,mode:qt,disableMenuItemTitleTooltip:we}),[It,kt,q,we,Qe]);return en(P.createElement(C.Z.Provider,{value:null},P.createElement($.Provider,{value:On},P.createElement(R.ZP,Object.assign({getPopupContainer:I,overflowedIndicator:P.createElement(se.Z,null),overflowedIndicatorPopupClassName:H()(It,`${It}-${Qe}`,on),mode:qt,selectable:ht,onClick:Mt},yn,{inlineCollapsed:kt,style:Object.assign(Object.assign({},D==null?void 0:D.style),Se),className:gn,prefixCls:It,direction:q,defaultMotions:mn,expandIcon:Pn,ref:j,rootClassName:H()(Dt,An)}),Cn))))});const Ee=(0,P.forwardRef)((F,j)=>{const A=(0,P.useRef)(null),N=P.useContext(W.D);return(0,P.useImperativeHandle)(j,()=>({menu:A.current,focus:V=>{var ae;(ae=A.current)===null||ae===void 0||ae.focus(V)}})),P.createElement(Jt,Object.assign({ref:A},F,N))});Ee.Item=st,Ee.SubMenu=Q,Ee.Divider=de,Ee.ItemGroup=R.BW;var yt=Ee},58421:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return ae}});var R=y(96663),P=y(59301),W={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},ee=W,H=y(7657),K=function(I,q){return P.createElement(H.Z,(0,R.Z)({},I,{ref:q,icon:ee}))},pe=P.forwardRef(K),ue=pe,de=y(49198),B=y(33853),je=y(38819),k=y(92310),m=y.n(k),J=y(90493),$=y(44127),ze=y(52884),st=y(95727),me=y(65711),Q=y(85745),se=y(26112),te={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},b=te,C=y(91735),z=function(S){(0,me.Z)(q,S);var I=(0,Q.Z)(q);function q(){var D;(0,ze.Z)(this,q);for(var _=arguments.length,ne=new Array(_),De=0;De<_;De++)ne[De]=arguments[De];return D=I.call.apply(I,[this].concat(ne)),D.state={goInputText:""},D.getValidValue=function(){var Se=D.state.goInputText;return!Se||Number.isNaN(Se)?void 0:Number(Se)},D.buildOptionText=function(Se){return"".concat(Se," ").concat(D.props.locale.items_per_page)},D.changeSize=function(Se){D.props.changeSize(Number(Se))},D.handleChange=function(Se){D.setState({goInputText:Se.target.value})},D.handleBlur=function(Se){var Qe=D.props,Re=Qe.goButton,we=Qe.quickGo,He=Qe.rootPrefixCls,ft=D.state.goInputText;Re||ft===""||(D.setState({goInputText:""}),!(Se.relatedTarget&&(Se.relatedTarget.className.indexOf("".concat(He,"-item-link"))>=0||Se.relatedTarget.className.indexOf("".concat(He,"-item"))>=0))&&we(D.getValidValue()))},D.go=function(Se){var Qe=D.state.goInputText;Qe!==""&&(Se.keyCode===b.ENTER||Se.type==="click")&&(D.setState({goInputText:""}),D.props.quickGo(D.getValidValue()))},D}return(0,st.Z)(q,[{key:"getPageSizeOptions",value:function(){var _=this.props,ne=_.pageSize,De=_.pageSizeOptions;return De.some(function(Se){return Se.toString()===ne.toString()})?De:De.concat([ne.toString()]).sort(function(Se,Qe){var Re=Number.isNaN(Number(Se))?0:Number(Se),we=Number.isNaN(Number(Qe))?0:Number(Qe);return Re-we})}},{key:"render",value:function(){var _=this,ne=this.props,De=ne.pageSize,Se=ne.locale,Qe=ne.rootPrefixCls,Re=ne.changeSize,we=ne.quickGo,He=ne.goButton,ft=ne.selectComponentClass,Xe=ne.buildOptionText,he=ne.selectPrefixCls,Dt=ne.disabled,Tt=this.state.goInputText,Kt="".concat(Qe,"-options"),ot=ft,on=null,ln=null,yn=null;if(!Re&&!we)return null;var Cn=this.getPageSizeOptions();if(Re&&ot){var Mt=Cn.map(function(qt,ht){return P.createElement(ot.Option,{key:ht,value:qt.toString()},(Xe||_.buildOptionText)(qt))});on=P.createElement(ot,{disabled:Dt,prefixCls:he,showSearch:!1,className:"".concat(Kt,"-size-changer"),optionLabelProp:"children",popupMatchSelectWidth:!1,value:(De||Cn[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ht){return ht.parentNode},"aria-label":Se.page_size,defaultOpen:!1},Mt)}return we&&(He&&(yn=typeof He=="boolean"?P.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:Dt,className:"".concat(Kt,"-quick-jumper-button")},Se.jump_to_confirm):P.createElement("span",{onClick:this.go,onKeyUp:this.go},He)),ln=P.createElement("div",{className:"".concat(Kt,"-quick-jumper")},Se.jump_to,P.createElement("input",{disabled:Dt,type:"text",value:Tt,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":Se.page}),Se.page,yn)),P.createElement("li",{className:"".concat(Kt)},on,ln)}}]),q}(P.Component);z.defaultProps={pageSizeOptions:["10","20","50","100"]};var G=z,Me=function(I){var q,D=I.rootPrefixCls,_=I.page,ne=I.active,De=I.className,Se=I.showTitle,Qe=I.onClick,Re=I.onKeyPress,we=I.itemRender,He="".concat(D,"-item"),ft=m()(He,"".concat(He,"-").concat(_),(q={},(0,J.Z)(q,"".concat(He,"-active"),ne),(0,J.Z)(q,"".concat(He,"-disabled"),!_),(0,J.Z)(q,I.className,De),q)),Xe=function(){Qe(_)},he=function(Kt){Re(Kt,Qe,_)},Dt=we(_,"page",P.createElement("a",{rel:"nofollow"},_));return Dt?P.createElement("li",{title:Se?_.toString():null,className:ft,onClick:Xe,onKeyPress:he,tabIndex:0},Dt):null},Ue=Me;function Je(){}function We(S){var I=Number(S);return typeof I=="number"&&!Number.isNaN(I)&&isFinite(I)&&Math.floor(I)===I}var ie=function(I,q,D){return D};function Y(S,I,q){var D=typeof S=="undefined"?I.pageSize:S;return Math.floor((q.total-1)/D)+1}var fe=function(S){(0,me.Z)(q,S);var I=(0,Q.Z)(q);function q(D){var _;(0,ze.Z)(this,q),_=I.call(this,D),_.paginationNode=P.createRef(),_.getJumpPrevPage=function(){return Math.max(1,_.state.current-(_.props.showLessItems?3:5))},_.getJumpNextPage=function(){return Math.min(Y(void 0,_.state,_.props),_.state.current+(_.props.showLessItems?3:5))},_.getItemIcon=function(Re,we){var He=_.props.prefixCls,ft=Re||P.createElement("button",{type:"button","aria-label":we,className:"".concat(He,"-item-link")});return typeof Re=="function"&&(ft=P.createElement(Re,(0,$.Z)({},_.props))),ft},_.isValid=function(Re){var we=_.props.total;return We(Re)&&Re!==_.state.current&&We(we)&&we>0},_.shouldDisplayQuickJumper=function(){var Re=_.props,we=Re.showQuickJumper,He=Re.total,ft=_.state.pageSize;return He<=ft?!1:we},_.handleKeyDown=function(Re){(Re.keyCode===b.ARROW_UP||Re.keyCode===b.ARROW_DOWN)&&Re.preventDefault()},_.handleKeyUp=function(Re){var we=_.getValidValue(Re),He=_.state.currentInputValue;we!==He&&_.setState({currentInputValue:we}),Re.keyCode===b.ENTER?_.handleChange(we):Re.keyCode===b.ARROW_UP?_.handleChange(we-1):Re.keyCode===b.ARROW_DOWN&&_.handleChange(we+1)},_.handleBlur=function(Re){var we=_.getValidValue(Re);_.handleChange(we)},_.changePageSize=function(Re){var we=_.state.current,He=Y(Re,_.state,_.props);we=we>He?He:we,He===0&&(we=_.state.current),typeof Re=="number"&&("pageSize"in _.props||_.setState({pageSize:Re}),"current"in _.props||_.setState({current:we,currentInputValue:we})),_.props.onShowSizeChange(we,Re),"onChange"in _.props&&_.props.onChange&&_.props.onChange(we,Re)},_.handleChange=function(Re){var we=_.props,He=we.disabled,ft=we.onChange,Xe=_.state,he=Xe.pageSize,Dt=Xe.current,Tt=Xe.currentInputValue;if(_.isValid(Re)&&!He){var Kt=Y(void 0,_.state,_.props),ot=Re;return Re>Kt?ot=Kt:Re<1&&(ot=1),"current"in _.props||_.setState({current:ot}),ot!==Tt&&_.setState({currentInputValue:ot}),ft(ot,he),ot}return Dt},_.prev=function(){_.hasPrev()&&_.handleChange(_.state.current-1)},_.next=function(){_.hasNext()&&_.handleChange(_.state.current+1)},_.jumpPrev=function(){_.handleChange(_.getJumpPrevPage())},_.jumpNext=function(){_.handleChange(_.getJumpNextPage())},_.hasPrev=function(){return _.state.current>1},_.hasNext=function(){return _.state.current2?He-2:0),Xe=2;Xe=De?Qe=De:Qe=Number(ne),Qe}},{key:"getShowSizeChanger",value:function(){var _=this.props,ne=_.showSizeChanger,De=_.total,Se=_.totalBoundaryShowSizeChanger;return typeof ne!="undefined"?ne:De>Se}},{key:"render",value:function(){var _=this.props,ne=_.prefixCls,De=_.className,Se=_.style,Qe=_.disabled,Re=_.hideOnSinglePage,we=_.total,He=_.locale,ft=_.showQuickJumper,Xe=_.showLessItems,he=_.showTitle,Dt=_.showTotal,Tt=_.simple,Kt=_.itemRender,ot=_.showPrevNextJumpers,on=_.jumpPrevIcon,ln=_.jumpNextIcon,yn=_.selectComponentClass,Cn=_.selectPrefixCls,Mt=_.pageSizeOptions,qt=this.state,ht=qt.current,kt=qt.pageSize,mn=qt.currentInputValue;if(Re===!0&&we<=kt)return null;var It=Y(void 0,this.state,this.props),en=[],An=null,gn=null,Pn=null,On=null,Mn=null,nr=ft&&ft.goButton,ut=Xe?1:2,l=ht-1>0?ht-1:0,f=ht+1we?we:ht*kt]));if(Tt){nr&&(typeof nr=="boolean"?Mn=P.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},He.jump_to_confirm):Mn=P.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},nr),Mn=P.createElement("li",{title:he?"".concat(He.jump_to).concat(ht,"/").concat(It):null,className:"".concat(ne,"-simple-pager")},Mn));var g=this.renderPrev(l);return P.createElement("ul",(0,R.Z)({className:m()(ne,"".concat(ne,"-simple"),(0,J.Z)({},"".concat(ne,"-disabled"),Qe),De),style:Se,ref:this.paginationNode},p),d,g?P.createElement("li",{title:he?He.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:m()("".concat(ne,"-prev"),(0,J.Z)({},"".concat(ne,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},g):null,P.createElement("li",{title:he?"".concat(ht,"/").concat(It):null,className:"".concat(ne,"-simple-pager")},P.createElement("input",{type:"text",value:mn,disabled:Qe,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:3}),P.createElement("span",{className:"".concat(ne,"-slash")},"/"),It),P.createElement("li",{title:he?He.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:m()("".concat(ne,"-next"),(0,J.Z)({},"".concat(ne,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(f)),Mn)}if(It<=3+ut*2){var x={locale:He,rootPrefixCls:ne,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:he,itemRender:Kt};It||en.push(P.createElement(Ue,(0,R.Z)({},x,{key:"noPager",page:1,className:"".concat(ne,"-item-disabled")})));for(var E=1;E<=It;E+=1){var X=ht===E;en.push(P.createElement(Ue,(0,R.Z)({},x,{key:E,page:E,active:X})))}}else{var Z=Xe?He.prev_3:He.prev_5,le=Xe?He.next_3:He.next_5,xe=Kt(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(on,"prev page")),Fe=Kt(this.getJumpNextPage(),"jump-next",this.getItemIcon(ln,"next page"));ot&&(An=xe?P.createElement("li",{title:he?Z:null,key:"prev",onClick:this.jumpPrev,tabIndex:0,onKeyPress:this.runIfEnterJumpPrev,className:m()("".concat(ne,"-jump-prev"),(0,J.Z)({},"".concat(ne,"-jump-prev-custom-icon"),!!on))},xe):null,gn=Fe?P.createElement("li",{title:he?le:null,key:"next",tabIndex:0,onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:m()("".concat(ne,"-jump-next"),(0,J.Z)({},"".concat(ne,"-jump-next-custom-icon"),!!ln))},Fe):null),On=P.createElement(Ue,{locale:He,last:!0,rootPrefixCls:ne,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:It,page:It,active:!1,showTitle:he,itemRender:Kt}),Pn=P.createElement(Ue,{locale:He,rootPrefixCls:ne,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:he,itemRender:Kt});var ve=Math.max(1,ht-ut),qe=Math.min(ht+ut,It);ht-1<=ut&&(qe=1+ut*2),It-ht<=ut&&(ve=It-ut*2);for(var ke=ve;ke<=qe;ke+=1){var _e=ht===ke;en.push(P.createElement(Ue,{locale:He,rootPrefixCls:ne,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ke,page:ke,active:_e,showTitle:he,itemRender:Kt}))}ht-1>=ut*2&&ht!==3&&(en[0]=(0,P.cloneElement)(en[0],{className:"".concat(ne,"-item-after-jump-prev")}),en.unshift(An)),It-ht>=ut*2&&ht!==It-2&&(en[en.length-1]=(0,P.cloneElement)(en[en.length-1],{className:"".concat(ne,"-item-before-jump-next")}),en.push(gn)),ve!==1&&en.unshift(Pn),qe!==It&&en.push(On)}var Ie=!this.hasPrev()||!It,tt=!this.hasNext()||!It,Ye=this.renderPrev(l),mt=this.renderNext(f);return P.createElement("ul",(0,R.Z)({className:m()(ne,De,(0,J.Z)({},"".concat(ne,"-disabled"),Qe)),style:Se,ref:this.paginationNode},p),d,Ye?P.createElement("li",{title:he?He.prev_page:null,onClick:this.prev,tabIndex:Ie?null:0,onKeyPress:this.runIfEnterPrev,className:m()("".concat(ne,"-prev"),(0,J.Z)({},"".concat(ne,"-disabled"),Ie)),"aria-disabled":Ie},Ye):null,en,mt?P.createElement("li",{title:he?He.next_page:null,onClick:this.next,tabIndex:tt?null:0,onKeyPress:this.runIfEnterNext,className:m()("".concat(ne,"-next"),(0,J.Z)({},"".concat(ne,"-disabled"),tt)),"aria-disabled":tt},mt):null,P.createElement(G,{disabled:Qe,locale:He,rootPrefixCls:ne,selectComponentClass:yn,selectPrefixCls:Cn,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ht,pageSize:kt,pageSizeOptions:Mt,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:nr}))}}],[{key:"getDerivedStateFromProps",value:function(_,ne){var De={};if("current"in _&&(De.current=_.current,_.current!==ne.current&&(De.currentInputValue=De.current)),"pageSize"in _&&_.pageSize!==ne.pageSize){var Se=ne.current,Qe=Y(_.pageSize,ne,_);Se=Se>Qe?Qe:Se,"current"in _||(De.current=Se,De.currentInputValue=Se),De.pageSize=_.pageSize}return De}}]),q}(P.Component);fe.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:Je,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:Je,locale:C.Z,style:{},itemRender:ie,totalBoundaryShowSizeChanger:50};var O=fe,Ae=y(22075),Oe=y(36355),ge=y(19716),Be=y(8628),it=y(9763),ye=y(57809);const Te=S=>P.createElement(ye.default,Object.assign({},S,{showSearch:!0,size:"small"})),Pe=S=>P.createElement(ye.default,Object.assign({},S,{showSearch:!0,size:"middle"}));Te.Option=ye.default.Option,Pe.Option=ye.default.Option;var Ce=y(9937),at=y(17313),Ot=y(83116),Pt=y(37613);const Xt=S=>{const{componentCls:I}=S;return{[`${I}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${I}-item-link`]:{color:S.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${I}-item-link`]:{color:S.colorTextDisabled,cursor:"not-allowed"}}},[`&${I}-disabled`]:{cursor:"not-allowed",[`${I}-item`]:{cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},a:{color:S.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:S.colorBorder,backgroundColor:S.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:S.itemActiveBgDisabled},a:{color:S.itemActiveColorDisabled}}},[`${I}-item-link`]:{color:S.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},[`${I}-simple&`]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},[`${I}-simple-pager`]:{color:S.colorTextDisabled},[`${I}-jump-prev, ${I}-jump-next`]:{[`${I}-item-link-icon`]:{opacity:0},[`${I}-item-ellipsis`]:{opacity:1}}},[`&${I}-simple`]:{[`${I}-prev, ${I}-next`]:{[`&${I}-disabled ${I}-item-link`]:{"&:hover, &:active":{backgroundColor:"transparent"}}}}}},wt=S=>{const{componentCls:I}=S;return{[`&${I}-mini ${I}-total-text, &${I}-mini ${I}-simple-pager`]:{height:S.itemSizeSM,lineHeight:`${S.itemSizeSM}px`},[`&${I}-mini ${I}-item`]:{minWidth:S.itemSizeSM,height:S.itemSizeSM,margin:0,lineHeight:`${S.itemSizeSM-2}px`},[`&${I}-mini:not(${I}-disabled) ${I}-item:not(${I}-item-active)`]:{backgroundColor:"transparent",borderColor:"transparent","&:hover":{backgroundColor:S.colorBgTextHover},"&:active":{backgroundColor:S.colorBgTextActive}},[`&${I}-mini ${I}-prev, &${I}-mini ${I}-next`]:{minWidth:S.itemSizeSM,height:S.itemSizeSM,margin:0,lineHeight:`${S.itemSizeSM}px`},[`&${I}-mini:not(${I}-disabled)`]:{[`${I}-prev, ${I}-next`]:{[`&:hover ${I}-item-link`]:{backgroundColor:S.colorBgTextHover},[`&:active ${I}-item-link`]:{backgroundColor:S.colorBgTextActive},[`&${I}-disabled:hover ${I}-item-link`]:{backgroundColor:"transparent"}}},[` &${I}-mini ${I}-prev ${I}-item-link, &${I}-mini ${I}-next ${I}-item-link `]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:S.itemSizeSM,lineHeight:`${S.itemSizeSM}px`}},[`&${I}-mini ${I}-jump-prev, &${I}-mini ${I}-jump-next`]:{height:S.itemSizeSM,marginInlineEnd:0,lineHeight:`${S.itemSizeSM}px`},[`&${I}-mini ${I}-options`]:{marginInlineStart:S.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:S.miniOptionsSizeChangerTop},"&-quick-jumper":{height:S.itemSizeSM,lineHeight:`${S.itemSizeSM}px`,input:Object.assign(Object.assign({},(0,Ce.x0)(S)),{width:S.paginationMiniQuickJumperInputWidth,height:S.controlHeightSM})}}}},bt=S=>{const{componentCls:I}=S;return{[` &${I}-simple ${I}-prev, &${I}-simple ${I}-next `]:{height:S.itemSizeSM,lineHeight:`${S.itemSizeSM}px`,verticalAlign:"top",[`${I}-item-link`]:{height:S.itemSizeSM,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:S.colorBgTextHover},"&:active":{backgroundColor:S.colorBgTextActive},"&::after":{height:S.itemSizeSM,lineHeight:`${S.itemSizeSM}px`}}},[`&${I}-simple ${I}-simple-pager`]:{display:"inline-block",height:S.itemSizeSM,marginInlineEnd:S.marginXS,input:{boxSizing:"border-box",height:"100%",marginInlineEnd:S.marginXS,padding:`0 ${S.paginationItemPaddingInline}px`,textAlign:"center",backgroundColor:S.itemInputBg,border:`${S.lineWidth}px ${S.lineType} ${S.colorBorder}`,borderRadius:S.borderRadius,outline:"none",transition:`border-color ${S.motionDurationMid}`,color:"inherit","&:hover":{borderColor:S.colorPrimary},"&:focus":{borderColor:S.colorPrimaryHover,boxShadow:`${S.inputOutlineOffset}px 0 ${S.controlOutlineWidth}px ${S.controlOutline}`},"&[disabled]":{color:S.colorTextDisabled,backgroundColor:S.colorBgContainerDisabled,borderColor:S.colorBorder,cursor:"not-allowed"}}}}},Ht=S=>{const{componentCls:I}=S;return{[`${I}-jump-prev, ${I}-jump-next`]:{outline:0,[`${I}-item-container`]:{position:"relative",[`${I}-item-link-icon`]:{color:S.colorPrimary,fontSize:S.fontSizeSM,opacity:0,transition:`all ${S.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},[`${I}-item-ellipsis`]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:S.colorTextDisabled,fontFamily:"Arial, Helvetica, sans-serif",letterSpacing:S.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:S.paginationEllipsisTextIndent,opacity:1,transition:`all ${S.motionDurationMid}`}},"&:hover":{[`${I}-item-link-icon`]:{opacity:1},[`${I}-item-ellipsis`]:{opacity:0}}},[` ${I}-prev, ${I}-jump-prev, ${I}-jump-next `]:{marginInlineEnd:S.marginXS},[` ${I}-prev, ${I}-next, ${I}-jump-prev, ${I}-jump-next `]:{display:"inline-block",minWidth:S.itemSize,height:S.itemSize,color:S.colorText,fontFamily:S.fontFamily,lineHeight:`${S.itemSize}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:S.borderRadius,cursor:"pointer",transition:`all ${S.motionDurationMid}`},[`${I}-prev, ${I}-next`]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:S.colorText,cursor:"pointer",userSelect:"none"},[`${I}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:S.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${S.lineWidth}px ${S.lineType} transparent`,borderRadius:S.borderRadius,outline:"none",transition:`all ${S.motionDurationMid}`},[`&:hover ${I}-item-link`]:{backgroundColor:S.colorBgTextHover},[`&:active ${I}-item-link`]:{backgroundColor:S.colorBgTextActive},[`&${I}-disabled:hover`]:{[`${I}-item-link`]:{backgroundColor:"transparent"}}},[`${I}-slash`]:{marginInlineEnd:S.paginationSlashMarginInlineEnd,marginInlineStart:S.paginationSlashMarginInlineStart},[`${I}-options`]:{display:"inline-block",marginInlineStart:S.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:S.controlHeight,marginInlineStart:S.marginXS,lineHeight:`${S.controlHeight}px`,verticalAlign:"top",input:Object.assign(Object.assign({},(0,Ce.ik)(S)),{width:S.controlHeightLG*1.25,height:S.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:S.marginXS,marginInlineEnd:S.marginXS})}}}},Jt=S=>{const{componentCls:I}=S;return{[`${I}-item`]:{display:"inline-block",minWidth:S.itemSize,height:S.itemSize,marginInlineEnd:S.marginXS,fontFamily:S.fontFamily,lineHeight:`${S.itemSize-2}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:`${S.lineWidth}px ${S.lineType} transparent`,borderRadius:S.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${S.paginationItemPaddingInline}px`,color:S.colorText,"&:hover":{textDecoration:"none"}},[`&:not(${I}-item-active)`]:{"&:hover":{transition:`all ${S.motionDurationMid}`,backgroundColor:S.colorBgTextHover},"&:active":{backgroundColor:S.colorBgTextActive}},"&-active":{fontWeight:S.fontWeightStrong,backgroundColor:S.itemActiveBg,borderColor:S.colorPrimary,a:{color:S.colorPrimary},"&:hover":{borderColor:S.colorPrimaryHover},"&:hover a":{color:S.colorPrimaryHover}}}}},Ee=S=>{const{componentCls:I}=S;return{[I]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,at.Wf)(S)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${I}-total-text`]:{display:"inline-block",height:S.itemSize,marginInlineEnd:S.marginXS,lineHeight:`${S.itemSize-2}px`,verticalAlign:"middle"}}),Jt(S)),Ht(S)),bt(S)),wt(S)),Xt(S)),{[`@media only screen and (max-width: ${S.screenLG}px)`]:{[`${I}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${S.screenSM}px)`]:{[`${I}-options`]:{display:"none"}}}),[`&${S.componentCls}-rtl`]:{direction:"rtl"}}},yt=S=>{const{componentCls:I}=S;return{[`${I}${I}-disabled:not(${I}-mini)`]:{"&, &:hover":{[`${I}-item-link`]:{borderColor:S.colorBorder}},"&:focus-visible":{[`${I}-item-link`]:{borderColor:S.colorBorder}},[`${I}-item, ${I}-item-link`]:{backgroundColor:S.colorBgContainerDisabled,borderColor:S.colorBorder,[`&:hover:not(${I}-item-active)`]:{backgroundColor:S.colorBgContainerDisabled,borderColor:S.colorBorder,a:{color:S.colorTextDisabled}},[`&${I}-item-active`]:{backgroundColor:S.itemActiveBgDisabled}},[`${I}-prev, ${I}-next`]:{"&:hover button":{backgroundColor:S.colorBgContainerDisabled,borderColor:S.colorBorder,color:S.colorTextDisabled},[`${I}-item-link`]:{backgroundColor:S.colorBgContainerDisabled,borderColor:S.colorBorder}}},[`${I}:not(${I}-mini)`]:{[`${I}-prev, ${I}-next`]:{"&:hover button":{borderColor:S.colorPrimaryHover,backgroundColor:S.itemBg},[`${I}-item-link`]:{backgroundColor:S.itemLinkBg,borderColor:S.colorBorder},[`&:hover ${I}-item-link`]:{borderColor:S.colorPrimary,backgroundColor:S.itemBg,color:S.colorPrimary},[`&${I}-disabled`]:{[`${I}-item-link`]:{borderColor:S.colorBorder,color:S.colorTextDisabled}}},[`${I}-item`]:{backgroundColor:S.itemBg,border:`${S.lineWidth}px ${S.lineType} ${S.colorBorder}`,[`&:hover:not(${I}-item-active)`]:{borderColor:S.colorPrimary,backgroundColor:S.itemBg,a:{color:S.colorPrimary}},"&-active":{borderColor:S.colorPrimary}}}}},F=S=>{const{componentCls:I}=S;return{[`${I}:not(${I}-disabled)`]:{[`${I}-item`]:Object.assign({},(0,at.Qy)(S)),[`${I}-jump-prev, ${I}-jump-next`]:{"&:focus-visible":Object.assign({[`${I}-item-link-icon`]:{opacity:1},[`${I}-item-ellipsis`]:{opacity:0}},(0,at.oN)(S))},[`${I}-prev, ${I}-next`]:{[`&:focus-visible ${I}-item-link`]:Object.assign({},(0,at.oN)(S))}}}};var j=(0,Ot.Z)("Pagination",S=>{const I=(0,Pt.TS)(S,{inputOutlineOffset:0,paginationMiniOptionsMarginInlineStart:S.marginXXS/2,paginationMiniQuickJumperInputWidth:S.controlHeightLG*1.1,paginationItemPaddingInline:S.marginXXS*1.5,paginationEllipsisLetterSpacing:S.marginXXS/2,paginationSlashMarginInlineStart:S.marginXXS,paginationSlashMarginInlineEnd:S.marginSM,paginationEllipsisTextIndent:"0.13em"},(0,Ce.e5)(S),(0,Ce.TM)(S));return[Ee(I),F(I),S.wireframe&&yt(I)]},S=>({itemBg:S.colorBgContainer,itemSize:S.controlHeight,itemSizeSM:S.controlHeightSM,itemActiveBg:S.colorBgContainer,itemLinkBg:S.colorBgContainer,itemActiveColorDisabled:S.colorTextDisabled,itemActiveBgDisabled:S.controlItemBgActiveDisabled,itemInputBg:S.colorBgContainer,miniOptionsSizeChangerTop:0})),A=function(S,I){var q={};for(var D in S)Object.prototype.hasOwnProperty.call(S,D)&&I.indexOf(D)<0&&(q[D]=S[D]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function")for(var _=0,D=Object.getOwnPropertySymbols(S);_{const{prefixCls:I,selectPrefixCls:q,className:D,rootClassName:_,style:ne,size:De,locale:Se,selectComponentClass:Qe,responsive:Re,showSizeChanger:we}=S,He=A(S,["prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","selectComponentClass","responsive","showSizeChanger"]),{xs:ft}=(0,Be.Z)(Re),{getPrefixCls:Xe,direction:he,pagination:Dt={}}=P.useContext(Oe.E_),Tt=Xe("pagination",I),[Kt,ot]=j(Tt),on=we!=null?we:Dt.showSizeChanger,ln=P.useMemo(()=>{const It=P.createElement("span",{className:`${Tt}-item-ellipsis`},"\u2022\u2022\u2022"),en=P.createElement("button",{className:`${Tt}-item-link`,type:"button",tabIndex:-1},he==="rtl"?P.createElement(je.Z,null):P.createElement(B.Z,null)),An=P.createElement("button",{className:`${Tt}-item-link`,type:"button",tabIndex:-1},he==="rtl"?P.createElement(B.Z,null):P.createElement(je.Z,null)),gn=P.createElement("a",{className:`${Tt}-item-link`},P.createElement("div",{className:`${Tt}-item-container`},he==="rtl"?P.createElement(de.Z,{className:`${Tt}-item-link-icon`}):P.createElement(ue,{className:`${Tt}-item-link-icon`}),It)),Pn=P.createElement("a",{className:`${Tt}-item-link`},P.createElement("div",{className:`${Tt}-item-container`},he==="rtl"?P.createElement(ue,{className:`${Tt}-item-link-icon`}):P.createElement(de.Z,{className:`${Tt}-item-link-icon`}),It));return{prevIcon:en,nextIcon:An,jumpPrevIcon:gn,jumpNextIcon:Pn}},[he,Tt]),[yn]=(0,it.Z)("Pagination",Ae.Z),Cn=Object.assign(Object.assign({},yn),Se),Mt=(0,ge.Z)(De),qt=Mt==="small"||!!(ft&&!Mt&&Re),ht=Xe("select",q),kt=m()({[`${Tt}-mini`]:qt,[`${Tt}-rtl`]:he==="rtl"},Dt==null?void 0:Dt.className,D,_,ot),mn=Object.assign(Object.assign({},Dt==null?void 0:Dt.style),ne);return Kt(P.createElement(O,Object.assign({},ln,He,{style:mn,prefixCls:Tt,selectPrefixCls:ht,className:kt,selectComponentClass:Qe||(qt?Te:Pe),locale:Cn,showSizeChanger:on})))},ae=V},13570:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return it}});var R=y(96663),P=y(59301),W={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"},ee=W,H=y(7657),K=function(Te,Pe){return P.createElement(H.Z,(0,R.Z)({},Te,{ref:Pe,icon:ee}))},pe=P.forwardRef(K),ue=pe,de=y(92310),B=y.n(de),je=y(90493),k=y(72071),m=y(6620),J=y(18929),$=y(10228),ze=y(26112);function st(ye,Te){var Pe=ye.disabled,Ce=ye.prefixCls,at=ye.character,Ot=ye.characterRender,Pt=ye.index,Xt=ye.count,wt=ye.value,bt=ye.allowHalf,Ht=ye.focused,Jt=ye.onHover,Ee=ye.onClick,yt=function(I){Jt(I,Pt)},F=function(I){Ee(I,Pt)},j=function(I){I.keyCode===$.Z.ENTER&&Ee(I,Pt)},A=Pt+1,N=new Set([Ce]);wt===0&&Pt===0&&Ht?N.add("".concat(Ce,"-focused")):bt&&wt+.5>=A&&wtPt?"true":"false","aria-posinset":Pt+1,"aria-setsize":Xt,tabIndex:Pe?-1:0},P.createElement("div",{className:"".concat(Ce,"-first")},V),P.createElement("div",{className:"".concat(Ce,"-second")},V)));return Ot&&(ae=Ot(ae,ye)),ae}var me=P.forwardRef(st);function Q(){var ye=P.useRef({});function Te(Ce){return ye.current[Ce]}function Pe(Ce){return function(at){ye.current[Ce]=at}}return[Te,Pe]}function se(ye){var Te=ye.pageXOffset,Pe="scrollLeft";if(typeof Te!="number"){var Ce=ye.document;Te=Ce.documentElement[Pe],typeof Te!="number"&&(Te=Ce.body[Pe])}return Te}function te(ye){var Te,Pe,Ce=ye.ownerDocument,at=Ce.body,Ot=Ce&&Ce.documentElement,Pt=ye.getBoundingClientRect();return Te=Pt.left,Pe=Pt.top,Te-=Ot.clientLeft||at.clientLeft||0,Pe-=Ot.clientTop||at.clientTop||0,{left:Te,top:Pe}}function b(ye){var Te=te(ye),Pe=ye.ownerDocument,Ce=Pe.defaultView||Pe.parentWindow;return Te.left+=se(Ce),Te.left}var C=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function z(ye,Te){var Pe,Ce=ye.prefixCls,at=Ce===void 0?"rc-rate":Ce,Ot=ye.className,Pt=ye.defaultValue,Xt=ye.value,wt=ye.count,bt=wt===void 0?5:wt,Ht=ye.allowHalf,Jt=Ht===void 0?!1:Ht,Ee=ye.allowClear,yt=Ee===void 0?!0:Ee,F=ye.character,j=F===void 0?"\u2605":F,A=ye.characterRender,N=ye.disabled,V=ye.direction,ae=V===void 0?"ltr":V,S=ye.tabIndex,I=S===void 0?0:S,q=ye.autoFocus,D=ye.onHoverChange,_=ye.onChange,ne=ye.onFocus,De=ye.onBlur,Se=ye.onKeyDown,Qe=ye.onMouseLeave,Re=(0,m.Z)(ye,C),we=Q(),He=(0,k.Z)(we,2),ft=He[0],Xe=He[1],he=P.useRef(null),Dt=function(){if(!N){var E;(E=he.current)===null||E===void 0||E.focus()}};P.useImperativeHandle(Te,function(){return{focus:Dt,blur:function(){if(!N){var E;(E=he.current)===null||E===void 0||E.blur()}}}});var Tt=(0,J.Z)(Pt||0,{value:Xt}),Kt=(0,k.Z)(Tt,2),ot=Kt[0],on=Kt[1],ln=(0,J.Z)(null),yn=(0,k.Z)(ln,2),Cn=yn[0],Mt=yn[1],qt=function(E,X){var Z=ae==="rtl",le=E+1;if(Jt){var xe=ft(E),Fe=b(xe),ve=xe.clientWidth;(Z&&X-Fe>ve/2||!Z&&X-Fe0&&!Z||X===$.Z.RIGHT&&le>0&&Z?(Jt?le-=.5:le-=1,ht(le),E.preventDefault()):X===$.Z.LEFT&&le{const{componentCls:Te}=ye;return{[`${Te}-star`]:{position:"relative",display:"inline-block",color:"inherit",cursor:"pointer","&:not(:last-child)":{marginInlineEnd:ye.marginXS},"> div":{transition:`all ${ye.motionDurationMid}, outline 0s`,"&:hover":{transform:ye.starHoverScale},"&:focus":{outline:0},"&:focus-visible":{outline:`${ye.lineWidth}px dashed ${ye.starColor}`,transform:ye.starHoverScale}},"&-first, &-second":{color:ye.starBg,transition:`all ${ye.motionDurationMid}`,userSelect:"none",[ye.iconCls]:{verticalAlign:"middle"}},"&-first":{position:"absolute",top:0,insetInlineStart:0,width:"50%",height:"100%",overflow:"hidden",opacity:0},[`&-half ${Te}-star-first, &-half ${Te}-star-second`]:{opacity:1},[`&-half ${Te}-star-first, &-full ${Te}-star-second`]:{color:"inherit"}}}},O=ye=>({[`&-rtl${ye.componentCls}`]:{direction:"rtl"}}),Ae=ye=>{const{componentCls:Te}=ye;return{[Te]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,We.Wf)(ye)),{display:"inline-block",margin:0,padding:0,color:ye.starColor,fontSize:ye.starSize,lineHeight:"unset",listStyle:"none",outline:"none",[`&-disabled${Te} ${Te}-star`]:{cursor:"default","> div:hover":{transform:"scale(1)"}}}),fe(ye)),{[`+ ${Te}-text`]:{display:"inline-block",marginInlineStart:ye.marginXS,fontSize:ye.fontSize}}),O(ye))}};var Oe=(0,ie.Z)("Rate",ye=>{const Te=(0,Y.TS)(ye,{});return[Ae(Te)]},ye=>({starColor:ye.yellow6,starSize:ye.controlHeightLG*.5,starHoverScale:"scale(1.1)",starBg:ye.colorFillContent})),ge=function(ye,Te){var Pe={};for(var Ce in ye)Object.prototype.hasOwnProperty.call(ye,Ce)&&Te.indexOf(Ce)<0&&(Pe[Ce]=ye[Ce]);if(ye!=null&&typeof Object.getOwnPropertySymbols=="function")for(var at=0,Ce=Object.getOwnPropertySymbols(ye);at{const{prefixCls:Pe,className:Ce,rootClassName:at,style:Ot,tooltips:Pt,character:Xt=P.createElement(ue,null)}=ye,wt=ge(ye,["prefixCls","className","rootClassName","style","tooltips","character"]),bt=(N,V)=>{let{index:ae}=V;return Pt?P.createElement(Je.Z,{title:Pt[ae]},N):N},{getPrefixCls:Ht,direction:Jt,rate:Ee}=P.useContext(Ue.E_),yt=Ht("rate",Pe),[F,j]=Oe(yt),A=Object.assign(Object.assign({},Ee==null?void 0:Ee.style),Ot);return F(P.createElement(Me,Object.assign({ref:Te,character:Xt,characterRender:bt},wt,{className:B()(Ce,at,j,Ee==null?void 0:Ee.className),style:A,prefixCls:yt,direction:Jt})))})},57809:function(Wt,nt,y){"use strict";var R=y(92310),P=y.n(R),W=y(77861),ee=y(2738),H=y(59301),K=y(53487),pe=y(62892),ue=y(19080),de=y(36355),B=y(1684),je=y(93891),k=y(19716),m=y(32441),J=y(33234),$=y(14154),ze=y(58582),st=y(84443),me=y(66339),Q=function(z,G){var Me={};for(var Ue in z)Object.prototype.hasOwnProperty.call(z,Ue)&&G.indexOf(Ue)<0&&(Me[Ue]=z[Ue]);if(z!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Je=0,Ue=Object.getOwnPropertySymbols(z);Je{var Me,{prefixCls:Ue,bordered:Je=!0,className:We,rootClassName:ie,getPopupContainer:Y,popupClassName:fe,dropdownClassName:O,listHeight:Ae=256,placement:Oe,listItemHeight:ge=24,size:Be,disabled:it,notFoundContent:ye,status:Te,builtinPlacements:Pe,dropdownMatchSelectWidth:Ce,popupMatchSelectWidth:at,direction:Ot,style:Pt,allowClear:Xt}=z,wt=Q(z,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:bt,getPrefixCls:Ht,renderEmpty:Jt,direction:Ee,virtual:yt,popupMatchSelectWidth:F,popupOverflow:j,select:A}=H.useContext(de.E_),N=Ht("select",Ue),V=Ht(),ae=Ot!=null?Ot:Ee,{compactSize:S,compactItemClassnames:I}=(0,J.ri)(N,ae),[q,D]=(0,$.Z)(N),_=H.useMemo(()=>{const{mode:mn}=wt;if(mn!=="combobox")return mn===se?"combobox":mn},[wt.mode]),ne=_==="multiple"||_==="tags",De=(0,st.Z)(wt.suffixIcon,wt.showArrow),Se=(Me=at!=null?at:Ce)!==null&&Me!==void 0?Me:F,{status:Qe,hasFeedback:Re,isFormItemInput:we,feedbackIcon:He}=H.useContext(m.aM),ft=(0,ue.F)(Qe,Te);let Xe;ye!==void 0?Xe=ye:_==="combobox"?Xe=null:Xe=(Jt==null?void 0:Jt("Select"))||H.createElement(je.Z,{componentName:"Select"});const{suffixIcon:he,itemIcon:Dt,removeIcon:Tt,clearIcon:Kt}=(0,me.Z)(Object.assign(Object.assign({},wt),{multiple:ne,hasFeedback:Re,feedbackIcon:He,showSuffixIcon:De,prefixCls:N,showArrow:wt.showArrow,componentName:"Select"})),ot=Xt===!0?{clearIcon:Kt}:Xt,on=(0,ee.Z)(wt,["suffixIcon","itemIcon"]),ln=P()(fe||O,{[`${N}-dropdown-${ae}`]:ae==="rtl"},ie,D),yn=(0,k.Z)(mn=>{var It;return(It=Be!=null?Be:S)!==null&&It!==void 0?It:mn}),Cn=H.useContext(B.Z),Mt=it!=null?it:Cn,qt=P()({[`${N}-lg`]:yn==="large",[`${N}-sm`]:yn==="small",[`${N}-rtl`]:ae==="rtl",[`${N}-borderless`]:!Je,[`${N}-in-form-item`]:we},(0,ue.Z)(N,ft,Re),I,A==null?void 0:A.className,We,ie,D),ht=H.useMemo(()=>Oe!==void 0?Oe:ae==="rtl"?"bottomRight":"bottomLeft",[Oe,ae]),kt=(0,ze.Z)(Pe,j);return q(H.createElement(W.ZP,Object.assign({ref:G,virtual:yt,showSearch:A==null?void 0:A.showSearch},on,{style:Object.assign(Object.assign({},A==null?void 0:A.style),Pt),dropdownMatchSelectWidth:Se,builtinPlacements:kt,transitionName:(0,pe.m)(V,"slide-up",wt.transitionName),listHeight:Ae,listItemHeight:ge,mode:_,prefixCls:N,placement:ht,direction:ae,suffixIcon:he,menuItemSelectedIcon:Dt,removeIcon:Tt,allowClear:ot,notFoundContent:Xe,className:qt,getPopupContainer:Y||bt,dropdownClassName:ln,disabled:Mt})))},b=H.forwardRef(te),C=(0,K.Z)(b);b.SECRET_COMBOBOX_MODE_DO_NOT_USE=se,b.Option=W.Wx,b.OptGroup=W.Xo,b._InternalPanelDoNotUseOrYouWillBeFired=C,nt.default=b},14154:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return b}});var R=y(17313),P=y(74207),W=y(37613),ee=y(83116),H=y(13826),K=y(92899);const pe=C=>{const{optionHeight:z,optionFontSize:G,optionLineHeight:Me,optionPadding:Ue}=C;return{position:"relative",display:"block",minHeight:z,padding:Ue,color:C.colorText,fontWeight:"normal",fontSize:G,lineHeight:Me,boxSizing:"border-box"}};var de=C=>{const{antCls:z,componentCls:G}=C,Me=`${G}-item`,Ue=`&${z}-slide-up-enter${z}-slide-up-enter-active`,Je=`&${z}-slide-up-appear${z}-slide-up-appear-active`,We=`&${z}-slide-up-leave${z}-slide-up-leave-active`,ie=`${G}-dropdown-placement-`;return[{[`${G}-dropdown`]:Object.assign(Object.assign({},(0,R.Wf)(C)),{position:"absolute",top:-9999,zIndex:C.zIndexPopup,boxSizing:"border-box",padding:C.paddingXXS,overflow:"hidden",fontSize:C.fontSize,fontVariant:"initial",backgroundColor:C.colorBgElevated,borderRadius:C.borderRadiusLG,outline:"none",boxShadow:C.boxShadowSecondary,[` ${Ue}${ie}bottomLeft, ${Je}${ie}bottomLeft `]:{animationName:H.fJ},[` ${Ue}${ie}topLeft, ${Je}${ie}topLeft, ${Ue}${ie}topRight, ${Je}${ie}topRight `]:{animationName:H.Qt},[`${We}${ie}bottomLeft`]:{animationName:H.Uw},[` ${We}${ie}topLeft, ${We}${ie}topRight `]:{animationName:H.ly},"&-hidden":{display:"none"},[`${Me}`]:Object.assign(Object.assign({},pe(C)),{cursor:"pointer",transition:`background ${C.motionDurationSlow} ease`,borderRadius:C.borderRadiusSM,"&-group":{color:C.colorTextDescription,fontSize:C.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},R.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${Me}-option-disabled)`]:{backgroundColor:C.optionActiveBg},[`&-selected:not(${Me}-option-disabled)`]:{color:C.optionSelectedColor,fontWeight:C.optionSelectedFontWeight,backgroundColor:C.optionSelectedBg,[`${Me}-option-state`]:{color:C.colorPrimary}},"&-disabled":{[`&${Me}-option-selected`]:{backgroundColor:C.colorBgContainerDisabled},color:C.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:C.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},(0,H.oN)(C,"slide-up"),(0,H.oN)(C,"slide-down"),(0,K.Fm)(C,"move-up"),(0,K.Fm)(C,"move-down")]};const B=2,je=C=>{let{controlHeightSM:z,controlHeight:G,lineWidth:Me}=C;const Ue=(G-z)/2-Me,Je=Math.ceil(Ue/2);return[Ue,Je]};function k(C,z){const{componentCls:G,iconCls:Me}=C,Ue=`${G}-selection-overflow`,Je=C.multipleSelectItemHeight,[We]=je(C),ie=z?`${G}-${z}`:"";return{[`${G}-multiple${ie}`]:{fontSize:C.fontSize,[Ue]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${G}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${We-B}px ${B*2}px`,borderRadius:C.borderRadius,[`${G}-show-search&`]:{cursor:"text"},[`${G}-disabled&`]:{background:C.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${B}px 0`,lineHeight:`${Je}px`,visibility:"hidden",content:'"\\a0"'}},[` &${G}-show-arrow ${G}-selector, &${G}-allow-clear ${G}-selector `]:{paddingInlineEnd:C.fontSizeIcon+C.controlPaddingHorizontal},[`${G}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:Je,marginTop:B,marginBottom:B,lineHeight:`${Je-C.lineWidth*2}px`,background:C.multipleItemBg,border:`${C.lineWidth}px ${C.lineType} ${C.multipleItemBorderColor}`,borderRadius:C.borderRadiusSM,cursor:"default",transition:`font-size ${C.motionDurationSlow}, line-height ${C.motionDurationSlow}, height ${C.motionDurationSlow}`,userSelect:"none",marginInlineEnd:B*2,paddingInlineStart:C.paddingXS,paddingInlineEnd:C.paddingXS/2,[`${G}-disabled&`]:{color:C.multipleItemColorDisabled,borderColor:C.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:C.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,R.Ro)()),{display:"inline-flex",alignItems:"center",color:C.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${Me}`]:{verticalAlign:"-0.2em"},"&:hover":{color:C.colorIconHover}})},[`${Ue}-item + ${Ue}-item`]:{[`${G}-selection-search`]:{marginInlineStart:0}},[`${G}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:C.inputPaddingHorizontalBase-We,"\n &-input,\n &-mirror\n ":{height:Je,fontFamily:C.fontFamily,lineHeight:`${Je}px`,transition:`all ${C.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${G}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:C.inputPaddingHorizontalBase,insetInlineEnd:C.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${C.motionDurationSlow}`}}}}var J=C=>{const{componentCls:z}=C,G=(0,W.TS)(C,{controlHeight:C.controlHeightSM,multipleSelectItemHeight:C.controlHeightXS,borderRadius:C.borderRadiusSM,borderRadiusSM:C.borderRadiusXS}),Me=(0,W.TS)(C,{fontSize:C.fontSizeLG,controlHeight:C.controlHeightLG,multipleSelectItemHeight:C.multipleItemHeightLG,borderRadius:C.borderRadiusLG,borderRadiusSM:C.borderRadius}),[,Ue]=je(C);return[k(C),k(G,"sm"),{[`${z}-multiple${z}-sm`]:{[`${z}-selection-placeholder`]:{insetInline:C.controlPaddingHorizontalSM-C.lineWidth},[`${z}-selection-search`]:{marginInlineStart:Ue}}},k(Me,"lg")]};function $(C,z){const{componentCls:G,inputPaddingHorizontalBase:Me,borderRadius:Ue}=C,Je=C.controlHeight-C.lineWidth*2,We=Math.ceil(C.fontSize*1.25),ie=z?`${G}-${z}`:"";return{[`${G}-single${ie}`]:{fontSize:C.fontSize,[`${G}-selector`]:Object.assign(Object.assign({},(0,R.Wf)(C)),{display:"flex",borderRadius:Ue,[`${G}-selection-search`]:{position:"absolute",top:0,insetInlineStart:Me,insetInlineEnd:Me,bottom:0,"&-input":{width:"100%"}},[` ${G}-selection-item, ${G}-selection-placeholder `]:{padding:0,lineHeight:`${Je}px`,transition:`all ${C.motionDurationSlow}, visibility 0s`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${Je}px`}},[`${G}-selection-item`]:{position:"relative",userSelect:"none"},[`${G}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${G}-selection-item:after`,`${G}-selection-placeholder:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[` &${G}-show-arrow ${G}-selection-item, &${G}-show-arrow ${G}-selection-placeholder `]:{paddingInlineEnd:We},[`&${G}-open ${G}-selection-item`]:{color:C.colorTextPlaceholder},[`&:not(${G}-customize-input)`]:{[`${G}-selector`]:{width:"100%",height:C.controlHeight,padding:`0 ${Me}px`,[`${G}-selection-search-input`]:{height:Je},"&:after":{lineHeight:`${Je}px`}}},[`&${G}-customize-input`]:{[`${G}-selector`]:{"&:after":{display:"none"},[`${G}-selection-search`]:{position:"static",width:"100%"},[`${G}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Me}px`,"&:after":{display:"none"}}}}}}}function ze(C){const{componentCls:z}=C,G=C.controlPaddingHorizontalSM-C.lineWidth;return[$(C),$((0,W.TS)(C,{controlHeight:C.controlHeightSM,borderRadius:C.borderRadiusSM}),"sm"),{[`${z}-single${z}-sm`]:{[`&:not(${z}-customize-input)`]:{[`${z}-selection-search`]:{insetInlineStart:G,insetInlineEnd:G},[`${z}-selector`]:{padding:`0 ${G}px`},[`&${z}-show-arrow ${z}-selection-search`]:{insetInlineEnd:G+C.fontSize*1.5},[` &${z}-show-arrow ${z}-selection-item, &${z}-show-arrow ${z}-selection-placeholder `]:{paddingInlineEnd:C.fontSize*1.5}}}},$((0,W.TS)(C,{controlHeight:C.singleItemHeightLG,fontSize:C.fontSizeLG,borderRadius:C.borderRadiusLG}),"lg")]}const st=C=>{const{componentCls:z,selectorBg:G}=C;return{position:"relative",backgroundColor:G,border:`${C.lineWidth}px ${C.lineType} ${C.colorBorder}`,transition:`all ${C.motionDurationMid} ${C.motionEaseInOut}`,input:{cursor:"pointer"},[`${z}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${z}-disabled&`]:{color:C.colorTextDisabled,background:C.colorBgContainerDisabled,cursor:"not-allowed",[`${z}-multiple&`]:{background:C.multipleSelectorBgDisabled},input:{cursor:"not-allowed"}}}},me=function(C,z){let G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:Me,borderHoverColor:Ue,outlineColor:Je,antCls:We}=z,ie=G?{[`${Me}-selector`]:{borderColor:Ue}}:{};return{[C]:{[`&:not(${Me}-disabled):not(${Me}-customize-input):not(${We}-pagination-size-changer)`]:Object.assign(Object.assign({},ie),{[`${Me}-focused& ${Me}-selector`]:{borderColor:Ue,boxShadow:`0 0 0 ${z.controlOutlineWidth}px ${Je}`,outline:0},[`&:hover ${Me}-selector`]:{borderColor:Ue}})}}},Q=C=>{const{componentCls:z}=C;return{[`${z}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},se=C=>{const{componentCls:z,inputPaddingHorizontalBase:G,iconCls:Me}=C;return{[z]:Object.assign(Object.assign({},(0,R.Wf)(C)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${z}-customize-input) ${z}-selector`]:Object.assign(Object.assign({},st(C)),Q(C)),[`${z}-selection-item`]:Object.assign({flex:1,fontWeight:"normal"},R.vS),[`${z}-selection-placeholder`]:Object.assign(Object.assign({},R.vS),{flex:1,color:C.colorTextPlaceholder,pointerEvents:"none"}),[`${z}-arrow`]:Object.assign(Object.assign({},(0,R.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:G,height:C.fontSizeIcon,marginTop:-C.fontSizeIcon/2,color:C.colorTextQuaternary,fontSize:C.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[Me]:{verticalAlign:"top",transition:`transform ${C.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${z}-suffix)`]:{pointerEvents:"auto"}},[`${z}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${z}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:G,zIndex:1,display:"inline-block",width:C.fontSizeIcon,height:C.fontSizeIcon,marginTop:-C.fontSizeIcon/2,color:C.colorTextQuaternary,fontSize:C.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:C.clearBg,cursor:"pointer",opacity:0,transition:`color ${C.motionDurationMid} ease, opacity ${C.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:C.colorTextTertiary}},"&:hover":{[`${z}-clear`]:{opacity:1}}}),[`${z}-has-feedback`]:{[`${z}-clear`]:{insetInlineEnd:G+C.fontSize+C.paddingXS}}}},te=C=>{const{componentCls:z}=C;return[{[z]:{[`&-borderless ${z}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${z}-in-form-item`]:{width:"100%"}}},se(C),ze(C),J(C),de(C),{[`${z}-rtl`]:{direction:"rtl"}},me(z,(0,W.TS)(C,{borderHoverColor:C.colorPrimaryHover,outlineColor:C.controlOutline})),me(`${z}-status-error`,(0,W.TS)(C,{borderHoverColor:C.colorErrorHover,outlineColor:C.colorErrorOutline}),!0),me(`${z}-status-warning`,(0,W.TS)(C,{borderHoverColor:C.colorWarningHover,outlineColor:C.colorWarningOutline}),!0),(0,P.c)(C,{borderElCls:`${z}-selector`,focusElCls:`${z}-focused`})]};var b=(0,ee.Z)("Select",(C,z)=>{let{rootPrefixCls:G}=z;const Me=(0,W.TS)(C,{rootPrefixCls:G,inputPaddingHorizontalBase:C.paddingSM-1,multipleSelectItemHeight:C.multipleItemHeight});return[te(Me)]},C=>{const{fontSize:z,lineHeight:G,controlHeight:Me,controlPaddingHorizontal:Ue,zIndexPopupBase:Je,colorText:We,fontWeightStrong:ie,controlItemBgActive:Y,controlItemBgHover:fe,colorBgContainer:O,colorFillSecondary:Ae,controlHeightLG:Oe,controlHeightSM:ge,colorBgContainerDisabled:Be,colorTextDisabled:it}=C;return{zIndexPopup:Je+50,optionSelectedColor:We,optionSelectedFontWeight:ie,optionSelectedBg:Y,optionActiveBg:fe,optionPadding:`${(Me-z*G)/2}px ${Ue}px`,optionFontSize:z,optionLineHeight:G,optionHeight:Me,selectorBg:O,clearBg:O,singleItemHeightLG:Oe,multipleItemBg:Ae,multipleItemBorderColor:"transparent",multipleItemHeight:ge,multipleItemHeightLG:Me,multipleSelectorBgDisabled:Be,multipleItemColorDisabled:it,multipleItemBorderColorDisabled:"transparent"}})},58582:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return P}});const R=W=>{const H={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:W==="scroll"?"scroll":"visible",_experimental:{dynamicInset:!0}};return{bottomLeft:Object.assign(Object.assign({},H),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},H),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},H),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},H),{points:["br","tr"],offset:[0,-4]})}};function P(W,ee){return W||R(ee)}},84443:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return R}});function R(P,W){return W!==void 0?W:P!==null}},66339:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return ue}});var R=y(40001),P=y(19248),W=y(99267),ee=y(84105),H=y(58617),K=y(47472),pe=y(59301);function ue(de){let{suffixIcon:B,clearIcon:je,menuItemSelectedIcon:k,removeIcon:m,loading:J,multiple:$,hasFeedback:ze,prefixCls:st,showSuffixIcon:me,feedbackIcon:Q,showArrow:se,componentName:te}=de;const b=je!=null?je:pe.createElement(P.Z,null),C=Ue=>B===null&&!ze&&!se?null:pe.createElement(pe.Fragment,null,me!==!1&&Ue,ze&&Q);let z=null;if(B!==void 0)z=C(B);else if(J)z=C(pe.createElement(H.Z,{spin:!0}));else{const Ue=`${st}-suffix`;z=Je=>{let{open:We,showSearch:ie}=Je;return C(We&&ie?pe.createElement(K.Z,{className:Ue}):pe.createElement(ee.Z,{className:Ue}))}}let G=null;k!==void 0?G=k:$?G=pe.createElement(R.Z,null):G=null;let Me=null;return m!==void 0?Me=m:Me=pe.createElement(W.Z,null),{clearIcon:b,suffixIcon:z,itemIcon:G,removeIcon:Me}}},61621:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return j}});var R=y(92310),P=y.n(R),W=y(59301),ee=y(36355),H=y(2738),pe=A=>{const{prefixCls:N,className:V,style:ae,size:S,shape:I}=A,q=P()({[`${N}-lg`]:S==="large",[`${N}-sm`]:S==="small"}),D=P()({[`${N}-circle`]:I==="circle",[`${N}-square`]:I==="square",[`${N}-round`]:I==="round"}),_=W.useMemo(()=>typeof S=="number"?{width:S,height:S,lineHeight:`${S}px`}:{},[S]);return W.createElement("span",{className:P()(N,q,D,V),style:Object.assign(Object.assign({},_),ae)})},ue=y(93083),de=y(83116),B=y(37613);const je=new ue.Keyframes("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),k=A=>({height:A,lineHeight:`${A}px`}),m=A=>Object.assign({width:A},k(A)),J=A=>({background:A.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:je,animationDuration:A.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),$=A=>Object.assign({width:A*5,minWidth:A*5},k(A)),ze=A=>{const{skeletonAvatarCls:N,gradientFromColor:V,controlHeight:ae,controlHeightLG:S,controlHeightSM:I}=A;return{[`${N}`]:Object.assign({display:"inline-block",verticalAlign:"top",background:V},m(ae)),[`${N}${N}-circle`]:{borderRadius:"50%"},[`${N}${N}-lg`]:Object.assign({},m(S)),[`${N}${N}-sm`]:Object.assign({},m(I))}},st=A=>{const{controlHeight:N,borderRadiusSM:V,skeletonInputCls:ae,controlHeightLG:S,controlHeightSM:I,gradientFromColor:q}=A;return{[`${ae}`]:Object.assign({display:"inline-block",verticalAlign:"top",background:q,borderRadius:V},$(N)),[`${ae}-lg`]:Object.assign({},$(S)),[`${ae}-sm`]:Object.assign({},$(I))}},me=A=>Object.assign({width:A},k(A)),Q=A=>{const{skeletonImageCls:N,imageSizeBase:V,gradientFromColor:ae,borderRadiusSM:S}=A;return{[`${N}`]:Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",background:ae,borderRadius:S},me(V*2)),{[`${N}-path`]:{fill:"#bfbfbf"},[`${N}-svg`]:Object.assign(Object.assign({},me(V)),{maxWidth:V*4,maxHeight:V*4}),[`${N}-svg${N}-svg-circle`]:{borderRadius:"50%"}}),[`${N}${N}-circle`]:{borderRadius:"50%"}}},se=(A,N,V)=>{const{skeletonButtonCls:ae}=A;return{[`${V}${ae}-circle`]:{width:N,minWidth:N,borderRadius:"50%"},[`${V}${ae}-round`]:{borderRadius:N}}},te=A=>Object.assign({width:A*2,minWidth:A*2},k(A)),b=A=>{const{borderRadiusSM:N,skeletonButtonCls:V,controlHeight:ae,controlHeightLG:S,controlHeightSM:I,gradientFromColor:q}=A;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[`${V}`]:Object.assign({display:"inline-block",verticalAlign:"top",background:q,borderRadius:N,width:ae*2,minWidth:ae*2},te(ae))},se(A,ae,V)),{[`${V}-lg`]:Object.assign({},te(S))}),se(A,S,`${V}-lg`)),{[`${V}-sm`]:Object.assign({},te(I))}),se(A,I,`${V}-sm`))},C=A=>{const{componentCls:N,skeletonAvatarCls:V,skeletonTitleCls:ae,skeletonParagraphCls:S,skeletonButtonCls:I,skeletonInputCls:q,skeletonImageCls:D,controlHeight:_,controlHeightLG:ne,controlHeightSM:De,gradientFromColor:Se,padding:Qe,marginSM:Re,borderRadius:we,titleHeight:He,blockRadius:ft,paragraphLiHeight:Xe,controlHeightXS:he,paragraphMarginTop:Dt}=A;return{[`${N}`]:{display:"table",width:"100%",[`${N}-header`]:{display:"table-cell",paddingInlineEnd:Qe,verticalAlign:"top",[`${V}`]:Object.assign({display:"inline-block",verticalAlign:"top",background:Se},m(_)),[`${V}-circle`]:{borderRadius:"50%"},[`${V}-lg`]:Object.assign({},m(ne)),[`${V}-sm`]:Object.assign({},m(De))},[`${N}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[`${ae}`]:{width:"100%",height:He,background:Se,borderRadius:ft,[`+ ${S}`]:{marginBlockStart:De}},[`${S}`]:{padding:0,"> li":{width:"100%",height:Xe,listStyle:"none",background:Se,borderRadius:ft,"+ li":{marginBlockStart:he}}},[`${S}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${N}-content`]:{[`${ae}, ${S} > li`]:{borderRadius:we}}},[`${N}-with-avatar ${N}-content`]:{[`${ae}`]:{marginBlockStart:Re,[`+ ${S}`]:{marginBlockStart:Dt}}},[`${N}${N}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},b(A)),ze(A)),st(A)),Q(A)),[`${N}${N}-block`]:{width:"100%",[`${I}`]:{width:"100%"},[`${q}`]:{width:"100%"}},[`${N}${N}-active`]:{[` ${ae}, ${S} > li, ${V}, ${I}, ${q}, ${D} `]:Object.assign({},J(A))}}};var z=(0,de.Z)("Skeleton",A=>{const{componentCls:N}=A,V=(0,B.TS)(A,{skeletonAvatarCls:`${N}-avatar`,skeletonTitleCls:`${N}-title`,skeletonParagraphCls:`${N}-paragraph`,skeletonButtonCls:`${N}-button`,skeletonInputCls:`${N}-input`,skeletonImageCls:`${N}-image`,imageSizeBase:A.controlHeight*1.5,borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${A.gradientFromColor} 25%, ${A.gradientToColor} 37%, ${A.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:"1.4s"});return[C(V)]},A=>{const{colorFillContent:N,colorFill:V}=A,ae=N,S=V;return{color:ae,colorGradientEnd:S,gradientFromColor:ae,gradientToColor:S,titleHeight:A.controlHeight/2,blockRadius:A.borderRadiusSM,paragraphMarginTop:A.marginLG+A.marginXXS,paragraphLiHeight:A.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),Me=A=>{const{prefixCls:N,className:V,rootClassName:ae,active:S,shape:I="circle",size:q="default"}=A,{getPrefixCls:D}=W.useContext(ee.E_),_=D("skeleton",N),[ne,De]=z(_),Se=(0,H.Z)(A,["prefixCls","className"]),Qe=P()(_,`${_}-element`,{[`${_}-active`]:S},V,ae,De);return ne(W.createElement("div",{className:Qe},W.createElement(pe,Object.assign({prefixCls:`${_}-avatar`,shape:I,size:q},Se))))},Je=A=>{const{prefixCls:N,className:V,rootClassName:ae,active:S,block:I=!1,size:q="default"}=A,{getPrefixCls:D}=W.useContext(ee.E_),_=D("skeleton",N),[ne,De]=z(_),Se=(0,H.Z)(A,["prefixCls"]),Qe=P()(_,`${_}-element`,{[`${_}-active`]:S,[`${_}-block`]:I},V,ae,De);return ne(W.createElement("div",{className:Qe},W.createElement(pe,Object.assign({prefixCls:`${_}-button`,size:q},Se))))};const We="M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z";var Y=A=>{const{prefixCls:N,className:V,rootClassName:ae,style:S,active:I}=A,{getPrefixCls:q}=W.useContext(ee.E_),D=q("skeleton",N),[_,ne]=z(D),De=P()(D,`${D}-element`,{[`${D}-active`]:I},V,ae,ne);return _(W.createElement("div",{className:De},W.createElement("div",{className:P()(`${D}-image`,V),style:S},W.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:`${D}-image-svg`},W.createElement("path",{d:We,className:`${D}-image-path`})))))},O=A=>{const{prefixCls:N,className:V,rootClassName:ae,active:S,block:I,size:q="default"}=A,{getPrefixCls:D}=W.useContext(ee.E_),_=D("skeleton",N),[ne,De]=z(_),Se=(0,H.Z)(A,["prefixCls"]),Qe=P()(_,`${_}-element`,{[`${_}-active`]:S,[`${_}-block`]:I},V,ae,De);return ne(W.createElement("div",{className:Qe},W.createElement(pe,Object.assign({prefixCls:`${_}-input`,size:q},Se))))},Ae=y(96663),Oe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM288 604a64 64 0 10128 0 64 64 0 10-128 0zm118-224a48 48 0 1096 0 48 48 0 10-96 0zm158 228a96 96 0 10192 0 96 96 0 10-192 0zm148-314a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"dot-chart",theme:"outlined"},ge=Oe,Be=y(7657),it=function(N,V){return W.createElement(Be.Z,(0,Ae.Z)({},N,{ref:V,icon:ge}))},ye=W.forwardRef(it),Te=ye,Ce=A=>{const{prefixCls:N,className:V,rootClassName:ae,style:S,active:I,children:q}=A,{getPrefixCls:D}=W.useContext(ee.E_),_=D("skeleton",N),[ne,De]=z(_),Se=P()(_,`${_}-element`,{[`${_}-active`]:I},De,V,ae),Qe=q!=null?q:W.createElement(Te,null);return ne(W.createElement("div",{className:Se},W.createElement("div",{className:P()(`${_}-image`,V),style:S},Qe)))},at=y(19127),Pt=A=>{const N=D=>{const{width:_,rows:ne=2}=A;if(Array.isArray(_))return _[D];if(ne-1===D)return _},{prefixCls:V,className:ae,style:S,rows:I}=A,q=(0,at.Z)(Array(I)).map((D,_)=>W.createElement("li",{key:_,style:{width:N(_)}}));return W.createElement("ul",{className:P()(V,ae),style:S},q)},wt=A=>{let{prefixCls:N,className:V,width:ae,style:S}=A;return W.createElement("h3",{className:P()(N,V),style:Object.assign({width:ae},S)})};function bt(A){return A&&typeof A=="object"?A:{}}function Ht(A,N){return A&&!N?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}function Jt(A,N){return!A&&N?{width:"38%"}:A&&N?{width:"50%"}:{}}function Ee(A,N){const V={};return(!A||!N)&&(V.width="61%"),!A&&N?V.rows=3:V.rows=2,V}const yt=A=>{const{prefixCls:N,loading:V,className:ae,rootClassName:S,style:I,children:q,avatar:D=!1,title:_=!0,paragraph:ne=!0,active:De,round:Se}=A,{getPrefixCls:Qe,direction:Re,skeleton:we}=W.useContext(ee.E_),He=Qe("skeleton",N),[ft,Xe]=z(He);if(V||!("loading"in A)){const he=!!D,Dt=!!_,Tt=!!ne;let Kt;if(he){const ln=Object.assign(Object.assign({prefixCls:`${He}-avatar`},Ht(Dt,Tt)),bt(D));Kt=W.createElement("div",{className:`${He}-header`},W.createElement(pe,Object.assign({},ln)))}let ot;if(Dt||Tt){let ln;if(Dt){const Cn=Object.assign(Object.assign({prefixCls:`${He}-title`},Jt(he,Tt)),bt(_));ln=W.createElement(wt,Object.assign({},Cn))}let yn;if(Tt){const Cn=Object.assign(Object.assign({prefixCls:`${He}-paragraph`},Ee(he,Dt)),bt(ne));yn=W.createElement(Pt,Object.assign({},Cn))}ot=W.createElement("div",{className:`${He}-content`},ln,yn)}const on=P()(He,{[`${He}-with-avatar`]:he,[`${He}-active`]:De,[`${He}-rtl`]:Re==="rtl",[`${He}-round`]:Se},we==null?void 0:we.className,ae,S,Xe);return ft(W.createElement("div",{className:on,style:Object.assign(Object.assign({},we==null?void 0:we.style),I)},Kt,ot))}return typeof q!="undefined"?q:null};yt.Button=Je,yt.Avatar=Me,yt.Input=O,yt.Image=Y,yt.Node=Ce;var F=yt,j=F},81327:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return st}});var R=y(59301),P=y(92310),W=y.n(P),ee=y(11592),H=y(36355),K=y(33234);const pe=R.createContext({latestIndex:0}),ue=pe.Provider;var B=me=>{let{className:Q,index:se,children:te,split:b,style:C}=me;const{latestIndex:z}=R.useContext(pe);return te==null?null:R.createElement(R.Fragment,null,R.createElement("div",{className:Q,style:C},te),se{var se,te;const{getPrefixCls:b,space:C,direction:z}=R.useContext(H.E_),{size:G=(C==null?void 0:C.size)||"small",align:Me,className:Ue,rootClassName:Je,children:We,direction:ie="horizontal",prefixCls:Y,split:fe,style:O,wrap:Ae=!1,classNames:Oe,styles:ge}=me,Be=J(me,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[it,ye]=Array.isArray(G)?G:[G,G],Te=k(ye),Pe=k(it),Ce=m(ye),at=m(it),Ot=(0,ee.Z)(We,{keepEmpty:!0}),Pt=Me===void 0&&ie==="horizontal"?"center":Me,Xt=b("space",Y),[wt,bt]=(0,je.Z)(Xt),Ht=W()(Xt,C==null?void 0:C.className,bt,`${Xt}-${ie}`,{[`${Xt}-rtl`]:z==="rtl",[`${Xt}-align-${Pt}`]:Pt,[`${Xt}-gap-row-${ye}`]:Te,[`${Xt}-gap-col-${it}`]:Pe},Ue,Je),Jt=W()(`${Xt}-item`,(se=Oe==null?void 0:Oe.item)!==null&&se!==void 0?se:(te=C==null?void 0:C.classNames)===null||te===void 0?void 0:te.item);let Ee=0;const yt=Ot.map((A,N)=>{var V,ae;A!=null&&(Ee=N);const S=A&&A.key||`${Jt}-${N}`;return R.createElement(B,{className:Jt,key:S,index:N,split:fe,style:(V=ge==null?void 0:ge.item)!==null&&V!==void 0?V:(ae=C==null?void 0:C.styles)===null||ae===void 0?void 0:ae.item},A)}),F=R.useMemo(()=>({latestIndex:Ee}),[Ee]);if(Ot.length===0)return null;const j={};return Ae&&(j.flexWrap="wrap"),!Pe&&at&&(j.columnGap=it),!Te&&Ce&&(j.rowGap=ye),wt(R.createElement("div",Object.assign({ref:Q,className:Ht,style:Object.assign(Object.assign(Object.assign({},j),C==null?void 0:C.style),O)},Be),R.createElement(ue,{value:F},yt)))});ze.Compact=K.ZP;var st=ze},8378:function(Wt,nt){"use strict";const y=R=>({[R.componentCls]:{[`${R.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${R.motionDurationMid} ${R.motionEaseInOut}, opacity ${R.motionDurationMid} ${R.motionEaseInOut} !important`}},[`${R.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${R.motionDurationMid} ${R.motionEaseInOut}, opacity ${R.motionDurationMid} ${R.motionEaseInOut} !important`}}});nt.Z=y},92899:function(Wt,nt,y){"use strict";y.d(nt,{Fm:function(){return k}});var R=y(93083),P=y(95406);const W=new R.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ee=new R.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),H=new R.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),K=new R.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),pe=new R.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ue=new R.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),de=new R.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),B=new R.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),je={"move-up":{inKeyframes:de,outKeyframes:B},"move-down":{inKeyframes:W,outKeyframes:ee},"move-left":{inKeyframes:H,outKeyframes:K},"move-right":{inKeyframes:pe,outKeyframes:ue}},k=(m,J)=>{const{antCls:$}=m,ze=`${$}-${J}`,{inKeyframes:st,outKeyframes:me}=je[J];return[(0,P.R)(ze,st,me,m.motionDurationMid),{[` ${ze}-enter, ${ze}-appear `]:{opacity:0,animationTimingFunction:m.motionEaseOutCirc},[`${ze}-leave`]:{animationTimingFunction:m.motionEaseInOutCirc}}]}},13826:function(Wt,nt,y){"use strict";y.d(nt,{Qt:function(){return H},Uw:function(){return ee},fJ:function(){return W},ly:function(){return K},oN:function(){return k}});var R=y(93083),P=y(95406);const W=new R.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),ee=new R.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),H=new R.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),K=new R.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),pe=new R.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),ue=new R.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),de=new R.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),B=new R.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),je={"slide-up":{inKeyframes:W,outKeyframes:ee},"slide-down":{inKeyframes:H,outKeyframes:K},"slide-left":{inKeyframes:pe,outKeyframes:ue},"slide-right":{inKeyframes:de,outKeyframes:B}},k=(m,J)=>{const{antCls:$}=m,ze=`${$}-${J}`,{inKeyframes:st,outKeyframes:me}=je[J];return[(0,P.R)(ze,st,me,m.motionDurationMid),{[` ${ze}-enter, ${ze}-appear `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:m.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${ze}-leave`]:{animationTimingFunction:m.motionEaseInQuint}}]}},19447:function(Wt,nt,y){"use strict";y.d(nt,{ZP:function(){return H},fS:function(){return W},qN:function(){return P}});var R=y(47585);const P=8;function W(K){const pe=P,{contentRadius:ue,limitVerticalRadius:de}=K,B=ue>12?ue+2:12;return{dropdownArrowOffset:B,dropdownArrowOffsetVertical:de?pe:B}}function ee(K,pe){return K?pe:{}}function H(K,pe){const{componentCls:ue,sizePopupArrow:de,borderRadiusXS:B,borderRadiusOuter:je,boxShadowPopoverArrow:k}=K,{colorBg:m,contentRadius:J=K.borderRadiusLG,limitVerticalRadius:$,arrowDistance:ze=0,arrowPlacement:st={left:!0,right:!0,top:!0,bottom:!0}}=pe,{dropdownArrowOffsetVertical:me,dropdownArrowOffset:Q}=W({contentRadius:J,limitVerticalRadius:$});return{[ue]:Object.assign(Object.assign(Object.assign(Object.assign({[`${ue}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,R.r)(de,B,je,m,k)),{"&:before":{background:m}})]},ee(!!st.top,{[[`&-placement-top ${ue}-arrow`,`&-placement-topLeft ${ue}-arrow`,`&-placement-topRight ${ue}-arrow`].join(",")]:{bottom:ze,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${ue}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${ue}-arrow`]:{left:{_skip_check_:!0,value:Q}},[`&-placement-topRight ${ue}-arrow`]:{right:{_skip_check_:!0,value:Q}}})),ee(!!st.bottom,{[[`&-placement-bottom ${ue}-arrow`,`&-placement-bottomLeft ${ue}-arrow`,`&-placement-bottomRight ${ue}-arrow`].join(",")]:{top:ze,transform:"translateY(-100%)"},[`&-placement-bottom ${ue}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${ue}-arrow`]:{left:{_skip_check_:!0,value:Q}},[`&-placement-bottomRight ${ue}-arrow`]:{right:{_skip_check_:!0,value:Q}}})),ee(!!st.left,{[[`&-placement-left ${ue}-arrow`,`&-placement-leftTop ${ue}-arrow`,`&-placement-leftBottom ${ue}-arrow`].join(",")]:{right:{_skip_check_:!0,value:ze},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${ue}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${ue}-arrow`]:{top:me},[`&-placement-leftBottom ${ue}-arrow`]:{bottom:me}})),ee(!!st.right,{[[`&-placement-right ${ue}-arrow`,`&-placement-rightTop ${ue}-arrow`,`&-placement-rightBottom ${ue}-arrow`].join(",")]:{left:{_skip_check_:!0,value:ze},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${ue}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${ue}-arrow`]:{top:me},[`&-placement-rightBottom ${ue}-arrow`]:{bottom:me}}))}}},47585:function(Wt,nt,y){"use strict";y.d(nt,{r:function(){return R}});const R=(P,W,ee,H,K)=>{const pe=P/2,ue=0,de=pe,B=ee*1/Math.sqrt(2),je=pe-ee*(1-1/Math.sqrt(2)),k=pe-W*(1/Math.sqrt(2)),m=ee*(Math.sqrt(2)-1)+W*(1/Math.sqrt(2)),J=2*pe-k,$=m,ze=2*pe-B,st=je,me=2*pe-ue,Q=de,se=pe*Math.sqrt(2)+ee*(Math.sqrt(2)-2),te=ee*(Math.sqrt(2)-1);return{pointerEvents:"none",width:P,height:P,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:P,height:P/2,background:H,clipPath:{_multi_value_:!0,value:[`polygon(${te}px 100%, 50% ${te}px, ${2*pe-te}px 100%, ${te}px 100%)`,`path('M ${ue} ${de} A ${ee} ${ee} 0 0 0 ${B} ${je} L ${k} ${m} A ${W} ${W} 0 0 1 ${J} ${$} L ${ze} ${st} A ${ee} ${ee} 0 0 0 ${me} ${Q} Z')`]},content:'""'},"&::after":{content:'""',position:"absolute",width:se,height:se,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${W}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:K,zIndex:0,background:"transparent"}}}},99313:function(Wt,nt,y){"use strict";y.d(nt,{default:function(){return p}});var R=y(99267),P=y(18785),W=y(62772),ee=y(92310),H=y.n(ee),K=y(96663),pe=y(90493),ue=y(44127),de=y(72071),B=y(20135),je=y(6620),k=y(59301),m=y(49658),J=y(18929),$=y(77900),ze=(0,k.createContext)(null),st=k.forwardRef(function(d,g){var x=d.prefixCls,E=d.className,X=d.style,Z=d.id,le=d.active,xe=d.tabKey,Fe=d.children;return k.createElement("div",{id:Z&&"".concat(Z,"-panel-").concat(xe),role:"tabpanel",tabIndex:le?0:-1,"aria-labelledby":Z&&"".concat(Z,"-tab-").concat(xe),"aria-hidden":!le,style:X,className:H()(x,le&&"".concat(x,"-active"),E),ref:g},Fe)}),me=st,Q=["key","forceRender","style","className"];function se(d){var g=d.id,x=d.activeKey,E=d.animated,X=d.tabPosition,Z=d.destroyInactiveTabPane,le=k.useContext(ze),xe=le.prefixCls,Fe=le.tabs,ve=E.tabPane,qe="".concat(xe,"-tabpane");return k.createElement("div",{className:H()("".concat(xe,"-content-holder"))},k.createElement("div",{className:H()("".concat(xe,"-content"),"".concat(xe,"-content-").concat(X),(0,pe.Z)({},"".concat(xe,"-content-animated"),ve))},Fe.map(function(ke){var _e=ke.key,Ie=ke.forceRender,tt=ke.style,Ye=ke.className,mt=(0,je.Z)(ke,Q),Ft=_e===x;return k.createElement($.default,(0,K.Z)({key:_e,visible:Ft,forceRender:Ie,removeOnLeave:!!Z,leavedClassName:"".concat(qe,"-hidden")},E.tabPaneMotion),function(Ut,rt){var ct=Ut.style,oe=Ut.className;return k.createElement(me,(0,K.Z)({},mt,{prefixCls:qe,id:g,tabKey:_e,animated:ve,active:Ft,style:(0,ue.Z)((0,ue.Z)({},tt),ct),className:H()(Ye,oe),ref:rt}))})})))}var te=y(19127),b=y(29301),C=y(6089),z=y(8654),G={width:0,height:0,left:0,top:0};function Me(d,g,x){return(0,k.useMemo)(function(){for(var E,X=new Map,Z=g.get((E=d[0])===null||E===void 0?void 0:E.key)||G,le=Z.left+Z.width,xe=0;xeSt?(lt=Ke,ce.current="x"):(lt=Ve,ce.current="y"),g(-lt,-lt)&&Le.preventDefault()}var Ne=(0,k.useRef)(null);Ne.current={onTouchStart:rt,onTouchMove:ct,onTouchEnd:oe,onWheel:be},k.useEffect(function(){function Le(Et){Ne.current.onTouchStart(Et)}function Ke(Et){Ne.current.onTouchMove(Et)}function Ve(Et){Ne.current.onTouchEnd(Et)}function lt(Et){Ne.current.onWheel(Et)}return document.addEventListener("touchmove",Ke,{passive:!1}),document.addEventListener("touchend",Ve,{passive:!1}),d.current.addEventListener("touchstart",Le,{passive:!1}),d.current.addEventListener("wheel",lt),function(){document.removeEventListener("touchmove",Ke),document.removeEventListener("touchend",Ve)}},[])}var O=y(34280);function Ae(d){var g=(0,k.useState)(0),x=(0,de.Z)(g,2),E=x[0],X=x[1],Z=(0,k.useRef)(0),le=(0,k.useRef)();return le.current=d,(0,O.o)(function(){var xe;(xe=le.current)===null||xe===void 0||xe.call(le)},[E]),function(){Z.current===E&&(Z.current+=1,X(Z.current))}}function Oe(d){var g=(0,k.useRef)([]),x=(0,k.useState)({}),E=(0,de.Z)(x,2),X=E[1],Z=(0,k.useRef)(typeof d=="function"?d():d),le=Ae(function(){var Fe=Z.current;g.current.forEach(function(ve){Fe=ve(Fe)}),g.current=[],Z.current=Fe,X({})});function xe(Fe){g.current.push(Fe),le()}return[Z.current,xe]}var ge={width:0,height:0,left:0,top:0,right:0};function Be(d,g,x,E,X,Z,le){var xe=le.tabs,Fe=le.tabPosition,ve=le.rtl,qe,ke,_e;return["top","bottom"].includes(Fe)?(qe="width",ke=ve?"right":"left",_e=Math.abs(x)):(qe="height",ke="top",_e=-x),(0,k.useMemo)(function(){if(!xe.length)return[0,0];for(var Ie=xe.length,tt=Ie,Ye=0;Ye_e+g){tt=Ye-1;break}}for(var Ft=0,Ut=Ie-1;Ut>=0;Ut-=1){var rt=d.get(xe[Ut].key)||ge;if(rt[ke]<_e){Ft=Ut+1;break}}return Ft>=tt?[0,0]:[Ft,tt]},[d,g,E,X,Z,_e,Fe,xe.map(function(Ie){return Ie.key}).join("_"),ve])}function it(d){var g;return d instanceof Map?(g={},d.forEach(function(x,E){g[E]=x})):g=d,JSON.stringify(g)}var ye="TABS_DQ";function Te(d){return String(d).replace(/"/g,ye)}function Pe(d,g,x,E){return!(!x||E||d===!1||d===void 0&&(g===!1||g===null))}function Ce(d,g){var x=d.prefixCls,E=d.editable,X=d.locale,Z=d.style;return!E||E.showAdd===!1?null:k.createElement("button",{ref:g,type:"button",className:"".concat(x,"-nav-add"),style:Z,"aria-label":(X==null?void 0:X.addAriaLabel)||"Add tab",onClick:function(xe){E.onEdit("add",{event:xe})}},E.addIcon||"+")}var at=k.forwardRef(Ce),Ot=k.forwardRef(function(d,g){var x=d.position,E=d.prefixCls,X=d.extra;if(!X)return null;var Z,le={};return(0,B.Z)(X)==="object"&&!k.isValidElement(X)?le=X:le.right=X,x==="right"&&(Z=le.right),x==="left"&&(Z=le.left),Z?k.createElement("div",{className:"".concat(E,"-extra-content"),ref:g},Z):null}),Pt=Ot,Xt=y(31561),wt=y(15285),bt=y(10228);function Ht(d,g){var x=d.prefixCls,E=d.id,X=d.tabs,Z=d.locale,le=d.mobile,xe=d.moreIcon,Fe=xe===void 0?"More":xe,ve=d.moreTransitionName,qe=d.style,ke=d.className,_e=d.editable,Ie=d.tabBarGutter,tt=d.rtl,Ye=d.removeAriaLabel,mt=d.onTabClick,Ft=d.getPopupContainer,Ut=d.popupClassName,rt=(0,k.useState)(!1),ct=(0,de.Z)(rt,2),oe=ct[0],ce=ct[1],be=(0,k.useState)(null),Ne=(0,de.Z)(be,2),Le=Ne[0],Ke=Ne[1],Ve="".concat(E,"-more-popup"),lt="".concat(x,"-dropdown"),Et=Le!==null?"".concat(Ve,"-").concat(Le):null,St=Z==null?void 0:Z.dropdownAriaLabel;function _t(an,rn){an.preventDefault(),an.stopPropagation(),_e.onEdit("remove",{key:rn,event:an})}var Nt=k.createElement(wt.ZP,{onClick:function(rn){var cn=rn.key,Sn=rn.domEvent;mt(cn,Sn),ce(!1)},prefixCls:"".concat(lt,"-menu"),id:Ve,tabIndex:-1,role:"listbox","aria-activedescendant":Et,selectedKeys:[Le],"aria-label":St!==void 0?St:"expanded dropdown"},X.map(function(an){var rn=an.closable,cn=an.disabled,Sn=an.closeIcon,$t=an.key,Rn=an.label,Zn=Pe(rn,Sn,_e,cn);return k.createElement(wt.sN,{key:$t,id:"".concat(Ve,"-").concat($t),role:"option","aria-controls":E&&"".concat(E,"-panel-").concat($t),disabled:cn},k.createElement("span",null,Rn),Zn&&k.createElement("button",{type:"button","aria-label":Ye||"remove",tabIndex:0,className:"".concat(lt,"-menu-item-remove"),onClick:function(xt){xt.stopPropagation(),_t(xt,$t)}},Sn||_e.removeIcon||"\xD7"))}));function tn(an){for(var rn=X.filter(function(Zn){return!Zn.disabled}),cn=rn.findIndex(function(Zn){return Zn.key===Le})||0,Sn=rn.length,$t=0;$tzn?"left":"right"})}),St=(0,de.Z)(Et,2),_t=St[0],Nt=St[1],tn=Ue(0,function(Qn,zn){!lt&&rt&&rt({direction:Qn>zn?"top":"bottom"})}),Bt=(0,de.Z)(tn,2),pt=Bt[0],nn=Bt[1],Vt=(0,k.useState)([0,0]),an=(0,de.Z)(Vt,2),rn=an[0],cn=an[1],Sn=(0,k.useState)([0,0]),$t=(0,de.Z)(Sn,2),Rn=$t[0],Zn=$t[1],Yt=(0,k.useState)([0,0]),xt=(0,de.Z)(Yt,2),vt=xt[0],Dn=xt[1],bn=(0,k.useState)([0,0]),In=(0,de.Z)(bn,2),En=In[0],fn=In[1],kn=Oe(new Map),_n=(0,de.Z)(kn,2),Yn=_n[0],jt=_n[1],Ct=Me(Z,Yn,Rn[0]),Qt=V(rn,lt),xn=V(Rn,lt),Hn=V(vt,lt),vr=V(En,lt),Jn=Qter?er:Qn}var jn=(0,k.useRef)(),sr=(0,k.useState)(),Er=(0,de.Z)(sr,2),xr=Er[0],Tr=Er[1];function Lr(){Tr(Date.now())}function lr(){window.clearTimeout(jn.current)}fe(Ne,function(Qn,zn){function yr(Sr,Rr){Sr(function(Zt){var hn=or(Zt+Rr);return hn})}return Jn?(lt?yr(Nt,Qn):yr(nn,zn),lr(),Lr(),!0):!1}),(0,k.useEffect)(function(){return lr(),xr&&(jn.current=window.setTimeout(function(){Tr(0)},100)),lr},[xr]);var Nr=Be(Ct,Fn,lt?_t:pt,xn,Hn,vr,(0,ue.Z)((0,ue.Z)({},d),{},{tabs:Z})),wr=(0,de.Z)(Nr,2),Zr=wr[0],Wr=wr[1],Br=(0,C.Z)(function(){var Qn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qe,zn=Ct.get(Qn)||{width:0,height:0,left:0,right:0,top:0};if(lt){var yr=_t;ke?zn.right<_t?yr=zn.right:zn.right+zn.width>_t+Fn&&(yr=zn.right+zn.width-Fn):zn.left<-_t?yr=-zn.left:zn.left+zn.width>-_t+Fn&&(yr=-(zn.left+zn.width-Fn)),nn(0),Nt(or(yr))}else{var Sr=pt;zn.top<-pt?Sr=-zn.top:zn.top+zn.height>-pt+Fn&&(Sr=-(zn.top+zn.height-Fn)),Nt(0),nn(or(Sr))}}),Cr={};Ye==="top"||Ye==="bottom"?Cr[ke?"marginRight":"marginLeft"]=mt:Cr.marginTop=mt;var Kr=Z.map(function(Qn,zn){var yr=Qn.key;return k.createElement(yt,{id:Fe,prefixCls:X,key:yr,tab:Qn,style:zn===0?void 0:Cr,closable:Qn.closable,editable:Ie,active:yr===qe,renderWrapper:Ft,removeAriaLabel:tt==null?void 0:tt.removeAriaLabel,onClick:function(Rr){Ut(yr,Rr)},onFocus:function(){Br(yr),Lr(),Ne.current&&(ke||(Ne.current.scrollLeft=0),Ne.current.scrollTop=0)}})}),zr=function(){return jt(function(){var zn=new Map;return Z.forEach(function(yr){var Sr,Rr=yr.key,Zt=(Sr=Le.current)===null||Sr===void 0?void 0:Sr.querySelector('[data-node-key="'.concat(Te(Rr),'"]'));Zt&&zn.set(Rr,{width:Zt.offsetWidth,height:Zt.offsetHeight,left:Zt.offsetLeft,top:Zt.offsetTop})}),zn})};(0,k.useEffect)(function(){zr()},[Z.map(function(Qn){return Qn.key}).join("_")]);var Mr=Ae(function(){var Qn=N(oe),zn=N(ce),yr=N(be);cn([Qn[0]-zn[0]-yr[0],Qn[1]-zn[1]-yr[1]]);var Sr=N(Ve);Dn(Sr);var Rr=N(Ke);fn(Rr);var Zt=N(Le);Zn([Zt[0]-Sr[0],Zt[1]-Sr[1]]),zr()}),Jr=Z.slice(0,Zr),kr=Z.slice(Wr+1),sn=[].concat((0,te.Z)(Jr),(0,te.Z)(kr)),Ln=Ct.get(qe),un=A({activeTabOffset:Ln,horizontal:lt,rtl:ke,indicatorSize:ct}),Tn=un.style;(0,k.useEffect)(function(){Br()},[qe,Xn,er,it(Ln),it(Ct),lt]),(0,k.useEffect)(function(){Mr()},[ke]);var Nn=!!sn.length,Un="".concat(X,"-nav-wrap"),fr,rr,ur,hr;return lt?ke?(rr=_t>0,fr=_t!==er):(fr=_t<0,rr=_t!==Xn):(ur=pt<0,hr=pt!==Xn),k.createElement(b.Z,{onResize:Mr},k.createElement("div",{ref:(0,z.x1)(g,oe),role:"tablist",className:H()("".concat(X,"-nav"),le),style:xe,onKeyDown:function(){Lr()}},k.createElement(Pt,{ref:ce,position:"left",extra:_e,prefixCls:X}),k.createElement(b.Z,{onResize:Mr},k.createElement("div",{className:H()(Un,(x={},(0,pe.Z)(x,"".concat(Un,"-ping-left"),fr),(0,pe.Z)(x,"".concat(Un,"-ping-right"),rr),(0,pe.Z)(x,"".concat(Un,"-ping-top"),ur),(0,pe.Z)(x,"".concat(Un,"-ping-bottom"),hr),x)),ref:Ne},k.createElement(b.Z,{onResize:Mr},k.createElement("div",{ref:Le,className:"".concat(X,"-nav-list"),style:{transform:"translate(".concat(_t,"px, ").concat(pt,"px)"),transition:xr?"none":void 0}},Kr,k.createElement(at,{ref:Ve,prefixCls:X,locale:tt,editable:Ie,style:(0,ue.Z)((0,ue.Z)({},Kr.length===0?void 0:Cr),{},{visibility:Nn?"hidden":null})}),k.createElement("div",{className:H()("".concat(X,"-ink-bar"),(0,pe.Z)({},"".concat(X,"-ink-bar-animated"),ve.inkBar)),style:Tn}))))),k.createElement(Jt,(0,K.Z)({},d,{removeAriaLabel:tt==null?void 0:tt.removeAriaLabel,ref:Ke,prefixCls:X,tabs:sn,className:!Nn&&ar,tabMoving:!!xr})),k.createElement(Pt,{ref:be,position:"right",extra:_e,prefixCls:X})))}var S=k.forwardRef(ae),I=["renderTabBar"],q=["label","key"];function D(d){var g=d.renderTabBar,x=(0,je.Z)(d,I),E=k.useContext(ze),X=E.tabs;if(g){var Z=(0,ue.Z)((0,ue.Z)({},x),{},{panes:X.map(function(le){var xe=le.label,Fe=le.key,ve=(0,je.Z)(le,q);return k.createElement(me,(0,K.Z)({tab:xe,key:Fe,tabKey:Fe},ve))})});return g(Z,S)}return k.createElement(S,x)}var _=y(48736);function ne(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},g;return d===!1?g={inkBar:!1,tabPane:!1}:d===!0?g={inkBar:!0,tabPane:!1}:g=(0,ue.Z)({inkBar:!0},(0,B.Z)(d)==="object"?d:{}),g.tabPaneMotion&&g.tabPane===void 0&&(g.tabPane=!0),!g.tabPaneMotion&&g.tabPane&&(g.tabPane=!1),g}var De=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],Se=0;function Qe(d,g){var x,E=d.id,X=d.prefixCls,Z=X===void 0?"rc-tabs":X,le=d.className,xe=d.items,Fe=d.direction,ve=d.activeKey,qe=d.defaultActiveKey,ke=d.editable,_e=d.animated,Ie=d.tabPosition,tt=Ie===void 0?"top":Ie,Ye=d.tabBarGutter,mt=d.tabBarStyle,Ft=d.tabBarExtraContent,Ut=d.locale,rt=d.moreIcon,ct=d.moreTransitionName,oe=d.destroyInactiveTabPane,ce=d.renderTabBar,be=d.onChange,Ne=d.onTabClick,Le=d.onTabScroll,Ke=d.getPopupContainer,Ve=d.popupClassName,lt=d.indicatorSize,Et=(0,je.Z)(d,De),St=k.useMemo(function(){return(xe||[]).filter(function(fn){return fn&&(0,B.Z)(fn)==="object"&&"key"in fn})},[xe]),_t=Fe==="rtl",Nt=ne(_e),tn=(0,k.useState)(!1),Bt=(0,de.Z)(tn,2),pt=Bt[0],nn=Bt[1];(0,k.useEffect)(function(){nn((0,m.Z)())},[]);var Vt=(0,J.Z)(function(){var fn;return(fn=St[0])===null||fn===void 0?void 0:fn.key},{value:ve,defaultValue:qe}),an=(0,de.Z)(Vt,2),rn=an[0],cn=an[1],Sn=(0,k.useState)(function(){return St.findIndex(function(fn){return fn.key===rn})}),$t=(0,de.Z)(Sn,2),Rn=$t[0],Zn=$t[1];(0,k.useEffect)(function(){var fn=St.findIndex(function(_n){return _n.key===rn});if(fn===-1){var kn;fn=Math.max(0,Math.min(Rn,St.length-1)),cn((kn=St[fn])===null||kn===void 0?void 0:kn.key)}Zn(fn)},[St.map(function(fn){return fn.key}).join("_"),rn,Rn]);var Yt=(0,J.Z)(null,{value:E}),xt=(0,de.Z)(Yt,2),vt=xt[0],Dn=xt[1];(0,k.useEffect)(function(){E||(Dn("rc-tabs-".concat(Se)),Se+=1)},[]);function bn(fn,kn){Ne==null||Ne(fn,kn);var _n=fn!==rn;cn(fn),_n&&(be==null||be(fn))}var In={id:vt,activeKey:rn,animated:Nt,tabPosition:tt,rtl:_t,mobile:pt},En=(0,ue.Z)((0,ue.Z)({},In),{},{editable:ke,locale:Ut,moreIcon:rt,moreTransitionName:ct,tabBarGutter:Ye,onTabClick:bn,onTabScroll:Le,extra:Ft,style:mt,panes:null,getPopupContainer:Ke,popupClassName:Ve,indicatorSize:lt});return k.createElement(ze.Provider,{value:{tabs:St,prefixCls:Z}},k.createElement("div",(0,K.Z)({ref:g,id:E,className:H()(Z,"".concat(Z,"-").concat(tt),(x={},(0,pe.Z)(x,"".concat(Z,"-mobile"),pt),(0,pe.Z)(x,"".concat(Z,"-editable"),ke),(0,pe.Z)(x,"".concat(Z,"-rtl"),_t),x),le)},Et),k.createElement(D,(0,K.Z)({},En,{renderTabBar:ce})),k.createElement(se,(0,K.Z)({destroyInactiveTabPane:oe},In,{animated:Nt}))))}var Re=k.forwardRef(Qe),we=Re,He=we,ft=y(36355),Xe=y(19716),Dt=()=>null,Tt=y(62892);const Kt={motionAppear:!1,motionEnter:!0,motionLeave:!0};function ot(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},x;return g===!1?x={inkBar:!1,tabPane:!1}:g===!0?x={inkBar:!0,tabPane:!0}:x=Object.assign({inkBar:!0},typeof g=="object"?g:{}),x.tabPane&&(x.tabPaneMotion=Object.assign(Object.assign({},Kt),{motionName:(0,Tt.m)(d,"switch")})),x}var on=y(11592),ln=function(d,g){var x={};for(var E in d)Object.prototype.hasOwnProperty.call(d,E)&&g.indexOf(E)<0&&(x[E]=d[E]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function")for(var X=0,E=Object.getOwnPropertySymbols(d);Xg)}function Cn(d,g){if(d)return d;const x=(0,on.Z)(g).map(E=>{if(k.isValidElement(E)){const{key:X,props:Z}=E,le=Z||{},{tab:xe}=le,Fe=ln(le,["tab"]);return Object.assign(Object.assign({key:String(X)},Fe),{label:xe})}return null});return yn(x)}var Mt=y(17313),qt=y(83116),ht=y(37613),kt=y(13826),It=d=>{const{componentCls:g,motionDurationSlow:x}=d;return[{[g]:{[`${g}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${x}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${x}`}}}}},[(0,kt.oN)(d,"slide-up"),(0,kt.oN)(d,"slide-down")]]};const en=d=>{const{componentCls:g,tabsCardPadding:x,cardBg:E,cardGutter:X,colorBorderSecondary:Z,itemSelectedColor:le}=d;return{[`${g}-card`]:{[`> ${g}-nav, > div > ${g}-nav`]:{[`${g}-tab`]:{margin:0,padding:x,background:E,border:`${d.lineWidth}px ${d.lineType} ${Z}`,transition:`all ${d.motionDurationSlow} ${d.motionEaseInOut}`},[`${g}-tab-active`]:{color:le,background:d.colorBgContainer},[`${g}-ink-bar`]:{visibility:"hidden"}},[`&${g}-top, &${g}-bottom`]:{[`> ${g}-nav, > div > ${g}-nav`]:{[`${g}-tab + ${g}-tab`]:{marginLeft:{_skip_check_:!0,value:`${X}px`}}}},[`&${g}-top`]:{[`> ${g}-nav, > div > ${g}-nav`]:{[`${g}-tab`]:{borderRadius:`${d.borderRadiusLG}px ${d.borderRadiusLG}px 0 0`},[`${g}-tab-active`]:{borderBottomColor:d.colorBgContainer}}},[`&${g}-bottom`]:{[`> ${g}-nav, > div > ${g}-nav`]:{[`${g}-tab`]:{borderRadius:`0 0 ${d.borderRadiusLG}px ${d.borderRadiusLG}px`},[`${g}-tab-active`]:{borderTopColor:d.colorBgContainer}}},[`&${g}-left, &${g}-right`]:{[`> ${g}-nav, > div > ${g}-nav`]:{[`${g}-tab + ${g}-tab`]:{marginTop:`${X}px`}}},[`&${g}-left`]:{[`> ${g}-nav, > div > ${g}-nav`]:{[`${g}-tab`]:{borderRadius:{_skip_check_:!0,value:`${d.borderRadiusLG}px 0 0 ${d.borderRadiusLG}px`}},[`${g}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:d.colorBgContainer}}}},[`&${g}-right`]:{[`> ${g}-nav, > div > ${g}-nav`]:{[`${g}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${d.borderRadiusLG}px ${d.borderRadiusLG}px 0`}},[`${g}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:d.colorBgContainer}}}}}}},An=d=>{const{componentCls:g,itemHoverColor:x,dropdownEdgeChildVerticalPadding:E}=d;return{[`${g}-dropdown`]:Object.assign(Object.assign({},(0,Mt.Wf)(d)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:d.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${g}-dropdown-menu`]:{maxHeight:d.tabsDropdownHeight,margin:0,padding:`${E}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:d.colorBgContainer,backgroundClip:"padding-box",borderRadius:d.borderRadiusLG,outline:"none",boxShadow:d.boxShadowSecondary,"&-item":Object.assign(Object.assign({},Mt.vS),{display:"flex",alignItems:"center",minWidth:d.tabsDropdownWidth,margin:0,padding:`${d.paddingXXS}px ${d.paddingSM}px`,color:d.colorText,fontWeight:"normal",fontSize:d.fontSize,lineHeight:d.lineHeight,cursor:"pointer",transition:`all ${d.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:d.marginSM},color:d.colorTextDescription,fontSize:d.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:x}},"&:hover":{background:d.controlItemBgHover},"&-disabled":{"&, &:hover":{color:d.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},gn=d=>{const{componentCls:g,margin:x,colorBorderSecondary:E,horizontalMargin:X,verticalItemPadding:Z,verticalItemMargin:le}=d;return{[`${g}-top, ${g}-bottom`]:{flexDirection:"column",[`> ${g}-nav, > div > ${g}-nav`]:{margin:X,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${d.lineWidth}px ${d.lineType} ${E}`,content:"''"},[`${g}-ink-bar`]:{height:d.lineWidthBold,"&-animated":{transition:`width ${d.motionDurationSlow}, left ${d.motionDurationSlow}, right ${d.motionDurationSlow}`}},[`${g}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:d.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:d.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:d.boxShadowTabsOverflowRight},[`&${g}-nav-wrap-ping-left::before`]:{opacity:1},[`&${g}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${g}-top`]:{[`> ${g}-nav, > div > ${g}-nav`]:{"&::before":{bottom:0},[`${g}-ink-bar`]:{bottom:0}}},[`${g}-bottom`]:{[`> ${g}-nav, > div > ${g}-nav`]:{order:1,marginTop:`${x}px`,marginBottom:0,"&::before":{top:0},[`${g}-ink-bar`]:{top:0}},[`> ${g}-content-holder, > div > ${g}-content-holder`]:{order:0}},[`${g}-left, ${g}-right`]:{[`> ${g}-nav, > div > ${g}-nav`]:{flexDirection:"column",minWidth:d.controlHeight*1.25,[`${g}-tab`]:{padding:Z,textAlign:"center"},[`${g}-tab + ${g}-tab`]:{margin:le},[`${g}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:d.controlHeight},"&::before":{top:0,boxShadow:d.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:d.boxShadowTabsOverflowBottom},[`&${g}-nav-wrap-ping-top::before`]:{opacity:1},[`&${g}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${g}-ink-bar`]:{width:d.lineWidthBold,"&-animated":{transition:`height ${d.motionDurationSlow}, top ${d.motionDurationSlow}`}},[`${g}-nav-list, ${g}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${g}-left`]:{[`> ${g}-nav, > div > ${g}-nav`]:{[`${g}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${g}-content-holder, > div > ${g}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${d.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${d.lineWidth}px ${d.lineType} ${d.colorBorder}`},[`> ${g}-content > ${g}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:d.paddingLG}}}},[`${g}-right`]:{[`> ${g}-nav, > div > ${g}-nav`]:{order:1,[`${g}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${g}-content-holder, > div > ${g}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-d.lineWidth},borderRight:{_skip_check_:!0,value:`${d.lineWidth}px ${d.lineType} ${d.colorBorder}`},[`> ${g}-content > ${g}-tabpane`]:{paddingRight:{_skip_check_:!0,value:d.paddingLG}}}}}},Pn=d=>{const{componentCls:g,cardPaddingSM:x,cardPaddingLG:E,horizontalItemPaddingSM:X,horizontalItemPaddingLG:Z}=d;return{[g]:{"&-small":{[`> ${g}-nav`]:{[`${g}-tab`]:{padding:X,fontSize:d.titleFontSizeSM}}},"&-large":{[`> ${g}-nav`]:{[`${g}-tab`]:{padding:Z,fontSize:d.titleFontSizeLG}}}},[`${g}-card`]:{[`&${g}-small`]:{[`> ${g}-nav`]:{[`${g}-tab`]:{padding:x}},[`&${g}-bottom`]:{[`> ${g}-nav ${g}-tab`]:{borderRadius:`0 0 ${d.borderRadius}px ${d.borderRadius}px`}},[`&${g}-top`]:{[`> ${g}-nav ${g}-tab`]:{borderRadius:`${d.borderRadius}px ${d.borderRadius}px 0 0`}},[`&${g}-right`]:{[`> ${g}-nav ${g}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${d.borderRadius}px ${d.borderRadius}px 0`}}},[`&${g}-left`]:{[`> ${g}-nav ${g}-tab`]:{borderRadius:{_skip_check_:!0,value:`${d.borderRadius}px 0 0 ${d.borderRadius}px`}}}},[`&${g}-large`]:{[`> ${g}-nav`]:{[`${g}-tab`]:{padding:E}}}}}},On=d=>{const{componentCls:g,itemActiveColor:x,itemHoverColor:E,iconCls:X,tabsHorizontalItemMargin:Z,horizontalItemPadding:le,itemSelectedColor:xe,itemColor:Fe}=d,ve=`${g}-tab`;return{[ve]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:le,fontSize:d.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:Fe,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:x}},(0,Mt.Qy)(d)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-d.marginXXS},marginLeft:{_skip_check_:!0,value:d.marginXS},color:d.colorTextDescription,fontSize:d.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${d.motionDurationSlow}`,"&:hover":{color:d.colorTextHeading}},"&:hover":{color:E},[`&${ve}-active ${ve}-btn`]:{color:xe,textShadow:d.tabsActiveTextShadow},[`&${ve}-disabled`]:{color:d.colorTextDisabled,cursor:"not-allowed"},[`&${ve}-disabled ${ve}-btn, &${ve}-disabled ${g}-remove`]:{"&:focus, &:active":{color:d.colorTextDisabled}},[`& ${ve}-remove ${X}`]:{margin:0},[X]:{marginRight:{_skip_check_:!0,value:d.marginSM}}},[`${ve} + ${ve}`]:{margin:{_skip_check_:!0,value:Z}}}},Mn=d=>{const{componentCls:g,tabsHorizontalItemMarginRTL:x,iconCls:E,cardGutter:X}=d;return{[`${g}-rtl`]:{direction:"rtl",[`${g}-nav`]:{[`${g}-tab`]:{margin:{_skip_check_:!0,value:x},[`${g}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[E]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${d.marginSM}px`}},[`${g}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${d.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${d.marginXXS}px`},[E]:{margin:0}}}},[`&${g}-left`]:{[`> ${g}-nav`]:{order:1},[`> ${g}-content-holder`]:{order:0}},[`&${g}-right`]:{[`> ${g}-nav`]:{order:0},[`> ${g}-content-holder`]:{order:1}},[`&${g}-card${g}-top, &${g}-card${g}-bottom`]:{[`> ${g}-nav, > div > ${g}-nav`]:{[`${g}-tab + ${g}-tab`]:{marginRight:{_skip_check_:!0,value:X},marginLeft:{_skip_check_:!0,value:0}}}}},[`${g}-dropdown-rtl`]:{direction:"rtl"},[`${g}-menu-item`]:{[`${g}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},nr=d=>{const{componentCls:g,tabsCardPadding:x,cardHeight:E,cardGutter:X,itemHoverColor:Z,itemActiveColor:le,colorBorderSecondary:xe}=d;return{[g]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Mt.Wf)(d)),{display:"flex",[`> ${g}-nav, > div > ${g}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${g}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${d.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${g}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${d.motionDurationSlow}`},[`${g}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${g}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${g}-nav-more`]:{position:"relative",padding:x,background:"transparent",border:0,color:d.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:d.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${g}-nav-add`]:Object.assign({minWidth:E,marginLeft:{_skip_check_:!0,value:X},padding:`0 ${d.paddingXS}px`,background:"transparent",border:`${d.lineWidth}px ${d.lineType} ${xe}`,borderRadius:`${d.borderRadiusLG}px ${d.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:d.colorText,transition:`all ${d.motionDurationSlow} ${d.motionEaseInOut}`,"&:hover":{color:Z},"&:active, &:focus:not(:focus-visible)":{color:le}},(0,Mt.Qy)(d))},[`${g}-extra-content`]:{flex:"none"},[`${g}-ink-bar`]:{position:"absolute",background:d.inkBarColor,pointerEvents:"none"}}),On(d)),{[`${g}-content`]:{position:"relative",width:"100%"},[`${g}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${g}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${g}-centered`]:{[`> ${g}-nav, > div > ${g}-nav`]:{[`${g}-nav-wrap`]:{[`&:not([class*='${g}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var ut=(0,qt.Z)("Tabs",d=>{const g=(0,ht.TS)(d,{tabsCardPadding:d.cardPadding||`${(d.cardHeight-Math.round(d.fontSize*d.lineHeight))/2-d.lineWidth}px ${d.padding}px`,dropdownEdgeChildVerticalPadding:d.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${d.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${d.horizontalItemGutter}px`});return[Pn(g),Mn(g),gn(g),An(g),en(g),nr(g),It(g)]},d=>{const g=d.controlHeightLG;return{zIndexPopup:d.zIndexPopupBase+50,cardBg:d.colorFillAlter,cardHeight:g,cardPadding:"",cardPaddingSM:`${d.paddingXXS*1.5}px ${d.padding}px`,cardPaddingLG:`${d.paddingXS}px ${d.padding}px ${d.paddingXXS*1.5}px`,titleFontSize:d.fontSize,titleFontSizeLG:d.fontSizeLG,titleFontSizeSM:d.fontSize,inkBarColor:d.colorPrimary,horizontalMargin:`0 0 ${d.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${d.paddingSM}px 0`,horizontalItemPaddingSM:`${d.paddingXS}px 0`,horizontalItemPaddingLG:`${d.padding}px 0`,verticalItemPadding:`${d.paddingXS}px ${d.paddingLG}px`,verticalItemMargin:`${d.margin}px 0 0 0`,itemColor:d.colorText,itemSelectedColor:d.colorPrimary,itemHoverColor:d.colorPrimaryHover,itemActiveColor:d.colorPrimaryActive,cardGutter:d.marginXXS/2}}),l=function(d,g){var x={};for(var E in d)Object.prototype.hasOwnProperty.call(d,E)&&g.indexOf(E)<0&&(x[E]=d[E]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function")for(var X=0,E=Object.getOwnPropertySymbols(d);X{const{type:g,className:x,rootClassName:E,size:X,onEdit:Z,hideAdd:le,centered:xe,addIcon:Fe,popupClassName:ve,children:qe,items:ke,animated:_e,style:Ie,indicatorSize:tt}=d,Ye=l(d,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:mt,moreIcon:Ft=k.createElement(P.Z,null)}=Ye,{direction:Ut,tabs:rt,getPrefixCls:ct,getPopupContainer:oe}=k.useContext(ft.E_),ce=ct("tabs",mt),[be,Ne]=ut(ce);let Le;g==="editable-card"&&(Le={onEdit:(_t,Nt)=>{let{key:tn,event:Bt}=Nt;Z==null||Z(_t==="add"?Bt:tn,_t)},removeIcon:k.createElement(R.Z,null),addIcon:Fe||k.createElement(W.Z,null),showAdd:le!==!0});const Ke=ct(),Ve=Cn(ke,qe),lt=ot(ce,_e),Et=(0,Xe.Z)(X),St=Object.assign(Object.assign({},rt==null?void 0:rt.style),Ie);return be(k.createElement(He,Object.assign({direction:Ut,getPopupContainer:oe,moreTransitionName:`${Ke}-slide-up`},Ye,{items:Ve,className:H()({[`${ce}-${Et}`]:Et,[`${ce}-card`]:["card","editable-card"].includes(g),[`${ce}-editable-card`]:g==="editable-card",[`${ce}-centered`]:xe},rt==null?void 0:rt.className,x,E,Ne),popupClassName:H()(ve,Ne),style:St,editable:Le,moreIcon:Ft,prefixCls:ce,animated:lt,indicatorSize:tt!=null?tt:rt==null?void 0:rt.indicatorSize})))};f.TabPane=Dt;var p=f},33166:function(Wt,nt,y){"use strict";y.d(nt,{i:function(){return R}});const R=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"]},45157:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return P}});var R=y(33166);function P(W,ee){return R.i.reduce((H,K)=>{const pe=W[`${K}1`],ue=W[`${K}3`],de=W[`${K}6`],B=W[`${K}7`];return Object.assign(Object.assign({},H),ee(K,{lightColor:pe,lightBorderColor:ue,darkColor:de,textColor:B}))},{})}},6848:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return Je}});var R=y(59301),P=y(92310),W=y.n(P),ee=y(55477),H=y(18929),K=y(62892),pe=y(79676),ue=y(92343),de=y(36355),B=y(33234),je=y(88088),k=y(17313),m=y(29878),J=y(19447),$=y(45157),ze=y(37613),st=y(83116);const me=We=>{const{componentCls:ie,tooltipMaxWidth:Y,tooltipColor:fe,tooltipBg:O,tooltipBorderRadius:Ae,zIndexPopup:Oe,controlHeight:ge,boxShadowSecondary:Be,paddingSM:it,paddingXS:ye,tooltipRadiusOuter:Te}=We;return[{[ie]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,k.Wf)(We)),{position:"absolute",zIndex:Oe,display:"block",width:"max-content",maxWidth:Y,visibility:"visible",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":O,[`${ie}-inner`]:{minWidth:ge,minHeight:ge,padding:`${it/2}px ${ye}px`,color:fe,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:O,borderRadius:Ae,boxShadow:Be,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${ie}-inner`]:{borderRadius:Math.min(Ae,J.qN)}},[`${ie}-content`]:{position:"relative"}}),(0,$.Z)(We,(Pe,Ce)=>{let{darkColor:at}=Ce;return{[`&${ie}-${Pe}`]:{[`${ie}-inner`]:{backgroundColor:at},[`${ie}-arrow`]:{"--antd-arrow-background-color":at}}}})),{"&-rtl":{direction:"rtl"}})},(0,J.ZP)((0,ze.TS)(We,{borderRadiusOuter:Te}),{colorBg:"var(--antd-arrow-background-color)",contentRadius:Ae,limitVerticalRadius:!0}),{[`${ie}-pure`]:{position:"relative",maxWidth:"none",margin:We.sizePopupArrow}}]};var Q=(We,ie)=>(0,st.Z)("Tooltip",fe=>{if(ie===!1)return[];const{borderRadius:O,colorTextLightSolid:Ae,colorBgDefault:Oe,borderRadiusOuter:ge}=fe,Be=(0,ze.TS)(fe,{tooltipMaxWidth:250,tooltipColor:Ae,tooltipBorderRadius:O,tooltipBg:Oe,tooltipRadiusOuter:ge>4?4:ge});return[me(Be),(0,m._y)(fe,"zoom-big-fast")]},fe=>{let{zIndexPopupBase:O,colorBgSpotlight:Ae}=fe;return{zIndexPopup:O+70,colorBgDefault:Ae}},{resetStyle:!1})(We),se=y(36785);function te(We,ie){const Y=(0,se.o2)(ie),fe=W()({[`${We}-${ie}`]:ie&&Y}),O={},Ae={};return ie&&!Y&&(O.background=ie,Ae["--antd-arrow-background-color"]=ie),{className:fe,overlayStyle:O,arrowStyle:Ae}}var C=We=>{const{prefixCls:ie,className:Y,placement:fe="top",title:O,color:Ae,overlayInnerStyle:Oe}=We,{getPrefixCls:ge}=R.useContext(de.E_),Be=ge("tooltip",ie),[it,ye]=Q(Be,!0),Te=te(Be,Ae),Pe=Te.arrowStyle,Ce=Object.assign(Object.assign({},Oe),Te.overlayStyle),at=W()(ye,Be,`${Be}-pure`,`${Be}-placement-${fe}`,Y,Te.className);return it(R.createElement("div",{className:at,style:Pe},R.createElement("div",{className:`${Be}-arrow`}),R.createElement(ee.G,Object.assign({},We,{className:ye,prefixCls:Be,overlayInnerStyle:Ce}),O)))},z=function(We,ie){var Y={};for(var fe in We)Object.prototype.hasOwnProperty.call(We,fe)&&ie.indexOf(fe)<0&&(Y[fe]=We[fe]);if(We!=null&&typeof Object.getOwnPropertySymbols=="function")for(var O=0,fe=Object.getOwnPropertySymbols(We);O{const Y={},fe=Object.assign({},We);return ie.forEach(O=>{We&&O in We&&(Y[O]=We[O],delete fe[O])}),{picked:Y,omitted:fe}};function Me(We,ie){const Y=We.type;if((Y.__ANT_BUTTON===!0||We.type==="button")&&We.props.disabled||Y.__ANT_SWITCH===!0&&(We.props.disabled||We.props.loading)||Y.__ANT_RADIO===!0&&We.props.disabled){const{picked:fe,omitted:O}=G(We.props.style,["position","left","right","top","bottom","float","display","zIndex"]),Ae=Object.assign(Object.assign({display:"inline-block"},fe),{cursor:"not-allowed",width:We.props.block?"100%":void 0}),Oe=Object.assign(Object.assign({},O),{pointerEvents:"none"}),ge=(0,ue.Tm)(We,{style:Oe,className:null});return R.createElement("span",{style:Ae,className:W()(We.props.className,`${ie}-disabled-compatible-wrapper`)},ge)}return We}const Ue=R.forwardRef((We,ie)=>{var Y,fe;const{prefixCls:O,openClassName:Ae,getTooltipContainer:Oe,overlayClassName:ge,color:Be,overlayInnerStyle:it,children:ye,afterOpenChange:Te,afterVisibleChange:Pe,destroyTooltipOnHide:Ce,arrow:at=!0,title:Ot,overlay:Pt,builtinPlacements:Xt,arrowPointAtCenter:wt=!1,autoAdjustOverflow:bt=!0}=We,Ht=!!at,[,Jt]=(0,je.Z)(),{getPopupContainer:Ee,getPrefixCls:yt,direction:F}=R.useContext(de.E_),j=R.useRef(null),A=()=>{var qt;(qt=j.current)===null||qt===void 0||qt.forceAlign()};R.useImperativeHandle(ie,()=>({forceAlign:A,forcePopupAlign:()=>{A()}}));const[N,V]=(0,H.Z)(!1,{value:(Y=We.open)!==null&&Y!==void 0?Y:We.visible,defaultValue:(fe=We.defaultOpen)!==null&&fe!==void 0?fe:We.defaultVisible}),ae=!Ot&&!Pt&&Ot!==0,S=qt=>{var ht,kt;V(ae?!1:qt),ae||((ht=We.onOpenChange)===null||ht===void 0||ht.call(We,qt),(kt=We.onVisibleChange)===null||kt===void 0||kt.call(We,qt))},I=R.useMemo(()=>{var qt,ht;let kt=wt;return typeof at=="object"&&(kt=(ht=(qt=at.pointAtCenter)!==null&&qt!==void 0?qt:at.arrowPointAtCenter)!==null&&ht!==void 0?ht:wt),Xt||(0,pe.Z)({arrowPointAtCenter:kt,autoAdjustOverflow:bt,arrowWidth:Ht?Jt.sizePopupArrow:0,borderRadius:Jt.borderRadius,offset:Jt.marginXXS,visibleFirst:!0})},[wt,at,Xt,Jt]),q=R.useMemo(()=>Ot===0?Ot:Pt||Ot||"",[Pt,Ot]),D=R.createElement(B.BR,null,typeof q=="function"?q():q),{getPopupContainer:_,placement:ne="top",mouseEnterDelay:De=.1,mouseLeaveDelay:Se=.1,overlayStyle:Qe,rootClassName:Re}=We,we=z(We,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),He=yt("tooltip",O),ft=yt(),Xe=We["data-popover-inject"];let he=N;!("open"in We)&&!("visible"in We)&&ae&&(he=!1);const Dt=Me((0,ue.l$)(ye)&&!(0,ue.M2)(ye)?ye:R.createElement("span",null,ye),He),Tt=Dt.props,Kt=!Tt.className||typeof Tt.className=="string"?W()(Tt.className,Ae||`${He}-open`):Tt.className,[ot,on]=Q(He,!Xe),ln=te(He,Be),yn=ln.arrowStyle,Cn=Object.assign(Object.assign({},it),ln.overlayStyle),Mt=W()(ge,{[`${He}-rtl`]:F==="rtl"},ln.className,Re,on);return ot(R.createElement(ee.Z,Object.assign({},we,{showArrow:Ht,placement:ne,mouseEnterDelay:De,mouseLeaveDelay:Se,prefixCls:He,overlayClassName:Mt,overlayStyle:Object.assign(Object.assign({},yn),Qe),getTooltipContainer:_||Oe||Ee,ref:j,builtinPlacements:I,overlay:D,visible:he,onVisibleChange:S,afterVisibleChange:Te!=null?Te:Pe,overlayInnerStyle:Cn,arrowContent:R.createElement("span",{className:`${He}-arrow-content`}),motion:{motionName:(0,K.m)(ft,"zoom-big-fast",We.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!Ce}),he?(0,ue.Tm)(Dt,{className:Kt}):Dt))});Ue._InternalPanelDoNotUseOrYouWillBeFired=C;var Je=Ue},25769:function(Wt,nt,y){"use strict";var R=y(98040),P={"text/plain":"Text","text/html":"Url",default:"Text"},W="Copy to clipboard: #{key}, Enter";function ee(K){var pe=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return K.replace(/#{\s*key\s*}/g,pe)}function H(K,pe){var ue,de,B,je,k,m,J=!1;pe||(pe={}),ue=pe.debug||!1;try{B=R(),je=document.createRange(),k=document.getSelection(),m=document.createElement("span"),m.textContent=K,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(ze){if(ze.stopPropagation(),pe.format)if(ze.preventDefault(),typeof ze.clipboardData=="undefined"){ue&&console.warn("unable to use e.clipboardData"),ue&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var st=P[pe.format]||P.default;window.clipboardData.setData(st,K)}else ze.clipboardData.clearData(),ze.clipboardData.setData(pe.format,K);pe.onCopy&&(ze.preventDefault(),pe.onCopy(ze.clipboardData))}),document.body.appendChild(m),je.selectNodeContents(m),k.addRange(je);var $=document.execCommand("copy");if(!$)throw new Error("copy command was unsuccessful");J=!0}catch(ze){ue&&console.error("unable to copy using execCommand: ",ze),ue&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(pe.format||"text",K),pe.onCopy&&pe.onCopy(window.clipboardData),J=!0}catch(st){ue&&console.error("unable to copy using clipboardData: ",st),ue&&console.error("falling back to prompt"),de=ee("message"in pe?pe.message:W),window.prompt(de,K)}}finally{k&&(typeof k.removeRange=="function"?k.removeRange(je):k.removeAllRanges()),m&&document.body.removeChild(m),B()}return J}Wt.exports=H},3867:function(Wt,nt,y){var R=y(97671);(function(P,W){Wt.exports=W()})(this,function(){"use strict";function P(S){var I=typeof S;return S!==null&&(I==="object"||I==="function")}function W(S){return typeof S=="function"}var ee=void 0;Array.isArray?ee=Array.isArray:ee=function(S){return Object.prototype.toString.call(S)==="[object Array]"};var H=ee,K=0,pe=void 0,ue=void 0,de=function(I,q){b[K]=I,b[K+1]=q,K+=2,K===2&&(ue?ue(C):G())};function B(S){ue=S}function je(S){de=S}var k=typeof window!="undefined"?window:void 0,m=k||{},J=m.MutationObserver||m.WebKitMutationObserver,$=typeof self=="undefined"&&typeof R!="undefined"&&{}.toString.call(R)==="[object process]",ze=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function st(){return function(){return R.nextTick(C)}}function me(){return typeof pe!="undefined"?function(){pe(C)}:te()}function Q(){var S=0,I=new J(C),q=document.createTextNode("");return I.observe(q,{characterData:!0}),function(){q.data=S=++S%2}}function se(){var S=new MessageChannel;return S.port1.onmessage=C,function(){return S.port2.postMessage(0)}}function te(){var S=setTimeout;return function(){return S(C,1)}}var b=new Array(1e3);function C(){for(var S=0;S0&&(G=te[0]),G instanceof Error)throw G;var Me=new Error("Unhandled error."+(G?" ("+G.message+")":""));throw Me.context=G,Me}var Ue=z[se];if(Ue===void 0)return!1;if(typeof Ue=="function")y(Ue,this,te);else for(var Je=Ue.length,We=m(Ue,Je),b=0;b0&&G.length>C&&!G.warned){G.warned=!0;var Me=new Error("Possible EventEmitter memory leak detected. "+G.length+" "+String(se)+" listeners added. Use emitter.setMaxListeners() to increase limit");Me.name="MaxListenersExceededWarning",Me.emitter=Q,Me.type=se,Me.count=G.length,P(Me)}return Q}ee.prototype.addListener=function(se,te){return ue(this,se,te,!1)},ee.prototype.on=ee.prototype.addListener,ee.prototype.prependListener=function(se,te){return ue(this,se,te,!0)};function de(){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 B(Q,se,te){var b={fired:!1,wrapFn:void 0,target:Q,type:se,listener:te},C=de.bind(b);return C.listener=te,b.wrapFn=C,C}ee.prototype.once=function(se,te){return K(te),this.on(se,B(this,se,te)),this},ee.prototype.prependOnceListener=function(se,te){return K(te),this.prependListener(se,B(this,se,te)),this},ee.prototype.removeListener=function(se,te){var b,C,z,G,Me;if(K(te),C=this._events,C===void 0)return this;if(b=C[se],b===void 0)return this;if(b===te||b.listener===te)--this._eventsCount===0?this._events=Object.create(null):(delete C[se],C.removeListener&&this.emit("removeListener",se,b.listener||te));else if(typeof b!="function"){for(z=-1,G=b.length-1;G>=0;G--)if(b[G]===te||b[G].listener===te){Me=b[G].listener,z=G;break}if(z<0)return this;z===0?b.shift():J(b,z),b.length===1&&(C[se]=b[0]),C.removeListener!==void 0&&this.emit("removeListener",se,Me||te)}return this},ee.prototype.off=ee.prototype.removeListener,ee.prototype.removeAllListeners=function(se){var te,b,C;if(b=this._events,b===void 0)return this;if(b.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):b[se]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete b[se]),this;if(arguments.length===0){var z=Object.keys(b),G;for(C=0;C=0;C--)this.removeListener(se,te[C]);return this};function je(Q,se,te){var b=Q._events;if(b===void 0)return[];var C=b[se];return C===void 0?[]:typeof C=="function"?te?[C.listener||C]:[C]:te?$(C):m(C,C.length)}ee.prototype.listeners=function(se){return je(this,se,!0)},ee.prototype.rawListeners=function(se){return je(this,se,!1)},ee.listenerCount=function(Q,se){return typeof Q.listenerCount=="function"?Q.listenerCount(se):k.call(Q,se)},ee.prototype.listenerCount=k;function k(Q){var se=this._events;if(se!==void 0){var te=se[Q];if(typeof te=="function")return 1;if(te!==void 0)return te.length}return 0}ee.prototype.eventNames=function(){return this._eventsCount>0?R(this._events):[]};function m(Q,se){for(var te=new Array(se),b=0;b>>6)+ue(128|fe&63):ue(224|fe>>>12&15)+ue(128|fe>>>6&63)+ue(128|fe&63)}else{var fe=65536+(Y.charCodeAt(0)-55296)*1024+(Y.charCodeAt(1)-56320);return ue(240|fe>>>18&7)+ue(128|fe>>>12&63)+ue(128|fe>>>6&63)+ue(128|fe&63)}},B=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,je=function(Y){return Y.replace(B,de)},k=function(Y){var fe=[0,2,1][Y.length%3],O=Y.charCodeAt(0)<<16|(Y.length>1?Y.charCodeAt(1):0)<<8|(Y.length>2?Y.charCodeAt(2):0),Ae=[K.charAt(O>>>18),K.charAt(O>>>12&63),fe>=2?"=":K.charAt(O>>>6&63),fe>=1?"=":K.charAt(O&63)];return Ae.join("")},m=W.btoa&&typeof W.btoa=="function"?function(Y){return W.btoa(Y)}:function(Y){if(Y.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return Y.replace(/[\s\S]{1,3}/g,k)},J=function(Y){return m(je(String(Y)))},$=function(Y){return Y.replace(/[+\/]/g,function(fe){return fe=="+"?"-":"_"}).replace(/=/g,"")},ze=function(Y,fe){return fe?$(J(Y)):J(Y)},st=function(Y){return ze(Y,!0)},me;W.Uint8Array&&(me=function(Y,fe){for(var O="",Ae=0,Oe=Y.length;Ae>>18)+K.charAt(ye>>>12&63)+(typeof Be!="undefined"?K.charAt(ye>>>6&63):"=")+(typeof it!="undefined"?K.charAt(ye&63):"=")}return fe?$(O):O});var Q=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,se=function(Y){switch(Y.length){case 4:var fe=(7&Y.charCodeAt(0))<<18|(63&Y.charCodeAt(1))<<12|(63&Y.charCodeAt(2))<<6|63&Y.charCodeAt(3),O=fe-65536;return ue((O>>>10)+55296)+ue((O&1023)+56320);case 3:return ue((15&Y.charCodeAt(0))<<12|(63&Y.charCodeAt(1))<<6|63&Y.charCodeAt(2));default:return ue((31&Y.charCodeAt(0))<<6|63&Y.charCodeAt(1))}},te=function(Y){return Y.replace(Q,se)},b=function(Y){var fe=Y.length,O=fe%4,Ae=(fe>0?pe[Y.charAt(0)]<<18:0)|(fe>1?pe[Y.charAt(1)]<<12:0)|(fe>2?pe[Y.charAt(2)]<<6:0)|(fe>3?pe[Y.charAt(3)]:0),Oe=[ue(Ae>>>16),ue(Ae>>>8&255),ue(Ae&255)];return Oe.length-=[0,0,2,1][O],Oe.join("")},C=W.atob&&typeof W.atob=="function"?function(Y){return W.atob(Y)}:function(Y){return Y.replace(/\S{1,4}/g,b)},z=function(Y){return C(String(Y).replace(/[^A-Za-z0-9\+\/]/g,""))},G=function(Y){return te(C(Y))},Me=function(Y){return String(Y).replace(/[-_]/g,function(fe){return fe=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},Ue=function(Y){return G(Me(Y))},Je;W.Uint8Array&&(Je=function(Y){return Uint8Array.from(z(Me(Y)),function(fe){return fe.charCodeAt(0)})});var We=function(){var Y=W.Base64;return W.Base64=ee,Y};if(W.Base64={VERSION:H,atob:z,btoa:m,fromBase64:Ue,toBase64:ze,utob:je,encode:ze,encodeURI:st,btou:te,decode:Ue,noConflict:We,fromUint8Array:me,toUint8Array:Je},typeof Object.defineProperty=="function"){var ie=function(Y){return{value:Y,enumerable:!1,writable:!0,configurable:!0}};W.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",ie(function(){return Ue(this)})),Object.defineProperty(String.prototype,"toBase64",ie(function(Y){return ze(this,Y)})),Object.defineProperty(String.prototype,"toBase64URI",ie(function(){return ze(this,!0)}))}}return W.Meteor&&(Base64=W.Base64),Wt.exports?Wt.exports.Base64=W.Base64:(R=[],P=function(){return W.Base64}.apply(nt,R),P!==void 0&&(Wt.exports=P)),{Base64:W.Base64}})},31561:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return z}});var R=y(96663),P=y(90493),W=y(72071),ee=y(6620),H=y(35593),K=y(92310),pe=y.n(K),ue=y(8654),de=y(59301),B=y(10228),je=y(16089),k=B.Z.ESC,m=B.Z.TAB;function J(G){var Me=G.visible,Ue=G.triggerRef,Je=G.onVisibleChange,We=G.autoFocus,ie=G.overlayRef,Y=de.useRef(!1),fe=function(){if(Me){var ge,Be;(ge=Ue.current)===null||ge===void 0||(Be=ge.focus)===null||Be===void 0||Be.call(ge),Je==null||Je(!1)}},O=function(){var ge;return(ge=ie.current)!==null&&ge!==void 0&&ge.focus?(ie.current.focus(),Y.current=!0,!0):!1},Ae=function(ge){switch(ge.keyCode){case k:fe();break;case m:{var Be=!1;Y.current||(Be=O()),Be?ge.preventDefault():fe();break}}};de.useEffect(function(){return Me?(window.addEventListener("keydown",Ae),We&&(0,je.Z)(O,3),function(){window.removeEventListener("keydown",Ae),Y.current=!1}):function(){Y.current=!1}},[Me])}var $=(0,de.forwardRef)(function(G,Me){var Ue=G.overlay,Je=G.arrow,We=G.prefixCls,ie=(0,de.useMemo)(function(){var fe;return typeof Ue=="function"?fe=Ue():fe=Ue,fe},[Ue]),Y=(0,ue.sQ)(Me,ie==null?void 0:ie.ref);return de.createElement(de.Fragment,null,Je&&de.createElement("div",{className:"".concat(We,"-arrow")}),de.cloneElement(ie,{ref:(0,ue.Yr)(ie)?Y:void 0}))}),ze=$,st={adjustX:1,adjustY:1},me=[0,0],Q={topLeft:{points:["bl","tl"],overflow:st,offset:[0,-4],targetOffset:me},top:{points:["bc","tc"],overflow:st,offset:[0,-4],targetOffset:me},topRight:{points:["br","tr"],overflow:st,offset:[0,-4],targetOffset:me},bottomLeft:{points:["tl","bl"],overflow:st,offset:[0,4],targetOffset:me},bottom:{points:["tc","bc"],overflow:st,offset:[0,4],targetOffset:me},bottomRight:{points:["tr","br"],overflow:st,offset:[0,4],targetOffset:me}},se=Q,te=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function b(G,Me){var Ue,Je=G.arrow,We=Je===void 0?!1:Je,ie=G.prefixCls,Y=ie===void 0?"rc-dropdown":ie,fe=G.transitionName,O=G.animation,Ae=G.align,Oe=G.placement,ge=Oe===void 0?"bottomLeft":Oe,Be=G.placements,it=Be===void 0?se:Be,ye=G.getPopupContainer,Te=G.showAction,Pe=G.hideAction,Ce=G.overlayClassName,at=G.overlayStyle,Ot=G.visible,Pt=G.trigger,Xt=Pt===void 0?["hover"]:Pt,wt=G.autoFocus,bt=G.overlay,Ht=G.children,Jt=G.onVisibleChange,Ee=(0,ee.Z)(G,te),yt=de.useState(),F=(0,W.Z)(yt,2),j=F[0],A=F[1],N="visible"in G?Ot:j,V=de.useRef(null),ae=de.useRef(null),S=de.useRef(null);de.useImperativeHandle(Me,function(){return V.current});var I=function(we){A(we),Jt==null||Jt(we)};J({visible:N,triggerRef:S,onVisibleChange:I,autoFocus:wt,overlayRef:ae});var q=function(we){var He=G.onOverlayClick;A(!1),He&&He(we)},D=function(){return de.createElement(ze,{ref:ae,overlay:bt,prefixCls:Y,arrow:We})},_=function(){return typeof bt=="function"?D:D()},ne=function(){var we=G.minOverlayWidthMatchTrigger,He=G.alignPoint;return"minOverlayWidthMatchTrigger"in G?we:!He},De=function(){var we=G.openClassName;return we!==void 0?we:"".concat(Y,"-open")},Se=de.cloneElement(Ht,{className:pe()((Ue=Ht.props)===null||Ue===void 0?void 0:Ue.className,N&&De()),ref:(0,ue.Yr)(Ht)?(0,ue.sQ)(S,Ht.ref):void 0}),Qe=Pe;return!Qe&&Xt.indexOf("contextMenu")!==-1&&(Qe=["click"]),de.createElement(H.Z,(0,R.Z)({builtinPlacements:it},Ee,{prefixCls:Y,ref:V,popupClassName:pe()(Ce,(0,P.Z)({},"".concat(Y,"-show-arrow"),We)),popupStyle:at,action:Xt,showAction:Te,hideAction:Qe,popupPlacement:ge,popupAlign:Ae,popupTransitionName:fe,popupAnimation:O,popupVisible:N,stretch:ne()?"minWidth":"",popup:_(),onPopupVisibleChange:I,onPopupClick:q,getPopupContainer:ye}),Se)}var C=de.forwardRef(b),z=C},15285:function(Wt,nt,y){"use strict";y.d(nt,{iz:function(){return ke},ck:function(){return ht},BW:function(){return qe},sN:function(){return ht},Wd:function(){return Z},ZP:function(){return ct},Xl:function(){return Ue}});var R=y(96663),P=y(90493),W=y(44127),ee=y(19127),H=y(72071),K=y(6620),pe=y(92310),ue=y.n(pe),de=y(11780),B=y(18929),je=y(13697),k=y(48736),m=y(59301),J=y(4676),$=m.createContext(null);function ze(oe,ce){return oe===void 0?null:"".concat(oe,"-").concat(ce)}function st(oe){var ce=m.useContext($);return ze(ce,oe)}var me=y(80547),Q=["children","locked"],se=m.createContext(null);function te(oe,ce){var be=(0,W.Z)({},oe);return Object.keys(ce).forEach(function(Ne){var Le=ce[Ne];Le!==void 0&&(be[Ne]=Le)}),be}function b(oe){var ce=oe.children,be=oe.locked,Ne=(0,K.Z)(oe,Q),Le=m.useContext(se),Ke=(0,me.Z)(function(){return te(Le,Ne)},[Le,Ne],function(Ve,lt){return!be&&(Ve[0]!==lt[0]||!(0,je.Z)(Ve[1],lt[1],!0))});return m.createElement(se.Provider,{value:Ke},ce)}var C=[],z=m.createContext(null);function G(){return m.useContext(z)}var Me=m.createContext(C);function Ue(oe){var ce=m.useContext(Me);return m.useMemo(function(){return oe!==void 0?[].concat((0,ee.Z)(ce),[oe]):ce},[ce,oe])}var Je=m.createContext(null),We=m.createContext({}),ie=We,Y=y(29194);function fe(oe){var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,Y.Z)(oe)){var be=oe.nodeName.toLowerCase(),Ne=["input","select","textarea","button"].includes(be)||oe.isContentEditable||be==="a"&&!!oe.getAttribute("href"),Le=oe.getAttribute("tabindex"),Ke=Number(Le),Ve=null;return Le&&!Number.isNaN(Ke)?Ve=Ke:Ne&&Ve===null&&(Ve=0),Ne&&oe.disabled&&(Ve=null),Ve!==null&&(Ve>=0||ce&&Ve<0)}return!1}function O(oe){var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,be=(0,ee.Z)(oe.querySelectorAll("*")).filter(function(Ne){return fe(Ne,ce)});return fe(oe,ce)&&be.unshift(oe),be}var Ae=null;function Oe(){Ae=document.activeElement}function ge(){Ae=null}function Be(){if(Ae)try{Ae.focus()}catch(oe){}}function it(oe,ce){if(ce.keyCode===9){var be=O(oe),Ne=be[ce.shiftKey?0:be.length-1],Le=Ne===document.activeElement||oe===document.activeElement;if(Le){var Ke=be[ce.shiftKey?be.length-1:0];Ke.focus(),ce.preventDefault()}}}var ye=y(10228),Te=y(16089),Pe=ye.Z.LEFT,Ce=ye.Z.RIGHT,at=ye.Z.UP,Ot=ye.Z.DOWN,Pt=ye.Z.ENTER,Xt=ye.Z.ESC,wt=ye.Z.HOME,bt=ye.Z.END,Ht=[at,Ot,Pe,Ce];function Jt(oe,ce,be,Ne){var Le,Ke,Ve,lt,Et="prev",St="next",_t="children",Nt="parent";if(oe==="inline"&&Ne===Pt)return{inlineTrigger:!0};var tn=(Le={},(0,P.Z)(Le,at,Et),(0,P.Z)(Le,Ot,St),Le),Bt=(Ke={},(0,P.Z)(Ke,Pe,be?St:Et),(0,P.Z)(Ke,Ce,be?Et:St),(0,P.Z)(Ke,Ot,_t),(0,P.Z)(Ke,Pt,_t),Ke),pt=(Ve={},(0,P.Z)(Ve,at,Et),(0,P.Z)(Ve,Ot,St),(0,P.Z)(Ve,Pt,_t),(0,P.Z)(Ve,Xt,Nt),(0,P.Z)(Ve,Pe,be?_t:Nt),(0,P.Z)(Ve,Ce,be?Nt:_t),Ve),nn={inline:tn,horizontal:Bt,vertical:pt,inlineSub:tn,horizontalSub:pt,verticalSub:pt},Vt=(lt=nn["".concat(oe).concat(ce?"":"Sub")])===null||lt===void 0?void 0:lt[Ne];switch(Vt){case Et:return{offset:-1,sibling:!0};case St:return{offset:1,sibling:!0};case Nt:return{offset:-1,sibling:!1};case _t:return{offset:1,sibling:!1};default:return null}}function Ee(oe){for(var ce=oe;ce;){if(ce.getAttribute("data-menu-list"))return ce;ce=ce.parentElement}return null}function yt(oe,ce){for(var be=oe||document.activeElement;be;){if(ce.has(be))return be;be=be.parentElement}return null}function F(oe,ce){var be=O(oe,!0);return be.filter(function(Ne){return ce.has(Ne)})}function j(oe,ce,be){var Ne=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!oe)return null;var Le=F(oe,ce),Ke=Le.length,Ve=Le.findIndex(function(lt){return be===lt});return Ne<0?Ve===-1?Ve=Ke-1:Ve-=1:Ne>0&&(Ve+=1),Ve=(Ve+Ke)%Ke,Le[Ve]}var A=function(ce,be){var Ne=new Set,Le=new Map,Ke=new Map;return ce.forEach(function(Ve){var lt=document.querySelector("[data-menu-id='".concat(ze(be,Ve),"']"));lt&&(Ne.add(lt),Ke.set(lt,Ve),Le.set(Ve,lt))}),{elements:Ne,key2element:Le,element2key:Ke}};function N(oe,ce,be,Ne,Le,Ke,Ve,lt,Et,St){var _t=m.useRef(),Nt=m.useRef();Nt.current=ce;var tn=function(){Te.Z.cancel(_t.current)};return m.useEffect(function(){return function(){tn()}},[]),function(Bt){var pt=Bt.which;if([].concat(Ht,[Pt,Xt,wt,bt]).includes(pt)){var nn=Ke(),Vt=A(nn,Ne),an=Vt,rn=an.elements,cn=an.key2element,Sn=an.element2key,$t=cn.get(ce),Rn=yt($t,rn),Zn=Sn.get(Rn),Yt=Jt(oe,Ve(Zn,!0).length===1,be,pt);if(!Yt&&pt!==wt&&pt!==bt)return;(Ht.includes(pt)||[wt,bt].includes(pt))&&Bt.preventDefault();var xt=function(_n){if(_n){var Yn=_n,jt=_n.querySelector("a");jt!=null&&jt.getAttribute("href")&&(Yn=jt);var Ct=Sn.get(_n);lt(Ct),tn(),_t.current=(0,Te.Z)(function(){Nt.current===Ct&&Yn.focus()})}};if([wt,bt].includes(pt)||Yt.sibling||!Rn){var vt;!Rn||oe==="inline"?vt=Le.current:vt=Ee(Rn);var Dn,bn=F(vt,rn);pt===wt?Dn=bn[0]:pt===bt?Dn=bn[bn.length-1]:Dn=j(vt,rn,Rn,Yt.offset),xt(Dn)}else if(Yt.inlineTrigger)Et(Zn);else if(Yt.offset>0)Et(Zn,!0),tn(),_t.current=(0,Te.Z)(function(){Vt=A(nn,Ne);var kn=Rn.getAttribute("aria-controls"),_n=document.getElementById(kn),Yn=j(_n,Vt.elements);xt(Yn)},5);else if(Yt.offset<0){var In=Ve(Zn,!0),En=In[In.length-2],fn=cn.get(En);Et(En,!1),xt(fn)}}St==null||St(Bt)}}function V(oe){Promise.resolve().then(oe)}var ae="__RC_UTIL_PATH_SPLIT__",S=function(ce){return ce.join(ae)},I=function(ce){return ce.split(ae)},q="rc-menu-more";function D(){var oe=m.useState({}),ce=(0,H.Z)(oe,2),be=ce[1],Ne=(0,m.useRef)(new Map),Le=(0,m.useRef)(new Map),Ke=m.useState([]),Ve=(0,H.Z)(Ke,2),lt=Ve[0],Et=Ve[1],St=(0,m.useRef)(0),_t=(0,m.useRef)(!1),Nt=function(){_t.current||be({})},tn=(0,m.useCallback)(function(cn,Sn){var $t=S(Sn);Le.current.set($t,cn),Ne.current.set(cn,$t),St.current+=1;var Rn=St.current;V(function(){Rn===St.current&&Nt()})},[]),Bt=(0,m.useCallback)(function(cn,Sn){var $t=S(Sn);Le.current.delete($t),Ne.current.delete(cn)},[]),pt=(0,m.useCallback)(function(cn){Et(cn)},[]),nn=(0,m.useCallback)(function(cn,Sn){var $t=Ne.current.get(cn)||"",Rn=I($t);return Sn&<.includes(Rn[0])&&Rn.unshift(q),Rn},[lt]),Vt=(0,m.useCallback)(function(cn,Sn){return cn.some(function($t){var Rn=nn($t,!0);return Rn.includes(Sn)})},[nn]),an=function(){var Sn=(0,ee.Z)(Ne.current.keys());return lt.length&&Sn.push(q),Sn},rn=(0,m.useCallback)(function(cn){var Sn="".concat(Ne.current.get(cn)).concat(ae),$t=new Set;return(0,ee.Z)(Le.current.keys()).forEach(function(Rn){Rn.startsWith(Sn)&&$t.add(Le.current.get(Rn))}),$t},[]);return m.useEffect(function(){return function(){_t.current=!0}},[]),{registerPath:tn,unregisterPath:Bt,refreshOverflowKeys:pt,isSubPathKey:Vt,getKeyPath:nn,getKeys:an,getSubPathKeys:rn}}function _(oe){var ce=m.useRef(oe);ce.current=oe;var be=m.useCallback(function(){for(var Ne,Le=arguments.length,Ke=new Array(Le),Ve=0;Ve1&&(rn.motionAppear=!1);var cn=rn.onVisibleChanged;return rn.onVisibleChanged=function(Sn){return!tn.current&&!Sn&&Vt(!0),cn==null?void 0:cn(Sn)},nn?null:m.createElement(b,{mode:Ke,locked:!tn.current},m.createElement(d.default,(0,R.Z)({visible:an},rn,{forceRender:Et,removeOnLeave:!1,leavedClassName:"".concat(lt,"-hidden")}),function(Sn){var $t=Sn.className,Rn=Sn.style;return m.createElement(en,{id:ce,className:$t,style:Rn},Le)}))}var x=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],E=["active"],X=function(ce){var be,Ne=ce.style,Le=ce.className,Ke=ce.title,Ve=ce.eventKey,lt=ce.warnKey,Et=ce.disabled,St=ce.internalPopupClose,_t=ce.children,Nt=ce.itemIcon,tn=ce.expandIcon,Bt=ce.popupClassName,pt=ce.popupOffset,nn=ce.popupStyle,Vt=ce.onClick,an=ce.onMouseEnter,rn=ce.onMouseLeave,cn=ce.onTitleClick,Sn=ce.onTitleMouseEnter,$t=ce.onTitleMouseLeave,Rn=(0,K.Z)(ce,x),Zn=st(Ve),Yt=m.useContext(se),xt=Yt.prefixCls,vt=Yt.mode,Dn=Yt.openKeys,bn=Yt.disabled,In=Yt.overflowDisabled,En=Yt.activeKey,fn=Yt.selectedKeys,kn=Yt.itemIcon,_n=Yt.expandIcon,Yn=Yt.onItemClick,jt=Yt.onOpenChange,Ct=Yt.onActive,Qt=m.useContext(ie),xn=Qt._internalRenderSubMenuItem,Hn=m.useContext(Je),vr=Hn.isSubPathKey,Jn=Ue(),Fn="".concat(xt,"-submenu"),ar=bn||Et,Xn=m.useRef(),er=m.useRef(),or=Nt!=null?Nt:kn,jn=tn!=null?tn:_n,sr=Dn.includes(Ve),Er=!In&&sr,xr=vr(fn,Ve),Tr=he(Ve,ar,Sn,$t),Lr=Tr.active,lr=(0,K.Z)(Tr,E),Nr=m.useState(!1),wr=(0,H.Z)(Nr,2),Zr=wr[0],Wr=wr[1],Br=function(ur){ar||Wr(ur)},Cr=function(ur){Br(!0),an==null||an({key:Ve,domEvent:ur})},Kr=function(ur){Br(!1),rn==null||rn({key:Ve,domEvent:ur})},zr=m.useMemo(function(){return Lr||(vt!=="inline"?Zr||vr([En],Ve):!1)},[vt,Lr,En,Zr,Ve,vr]),Mr=Dt(Jn.length),Jr=function(ur){ar||(cn==null||cn({key:Ve,domEvent:ur}),vt==="inline"&&jt(Ve,!sr))},kr=_(function(rr){Vt==null||Vt(ot(rr)),Yn(rr)}),sn=function(ur){vt!=="inline"&&jt(Ve,ur)},Ln=function(){Ct(Ve)},un=Zn&&"".concat(Zn,"-popup"),Tn=m.createElement("div",(0,R.Z)({role:"menuitem",style:Mr,className:"".concat(Fn,"-title"),tabIndex:ar?null:-1,ref:Xn,title:typeof Ke=="string"?Ke:null,"data-menu-id":In&&Zn?null:Zn,"aria-expanded":Er,"aria-haspopup":!0,"aria-controls":un,"aria-disabled":ar,onClick:Jr,onFocus:Ln},lr),Ke,m.createElement(Tt,{icon:vt!=="horizontal"?jn:void 0,props:(0,W.Z)((0,W.Z)({},ce),{},{isOpen:Er,isSubMenu:!0})},m.createElement("i",{className:"".concat(Fn,"-arrow")}))),Nn=m.useRef(vt);if(vt!=="inline"&&Jn.length>1?Nn.current="vertical":Nn.current=vt,!In){var Un=Nn.current;Tn=m.createElement(p,{mode:Un,prefixCls:Fn,visible:!St&&Er&&vt!=="inline",popupClassName:Bt,popupOffset:pt,popupStyle:nn,popup:m.createElement(b,{mode:Un==="horizontal"?"vertical":Un},m.createElement(en,{id:un,ref:er},_t)),disabled:ar,onVisibleChange:sn},Tn)}var fr=m.createElement(de.Z.Item,(0,R.Z)({role:"none"},Rn,{component:"li",style:Ne,className:ue()(Fn,"".concat(Fn,"-").concat(vt),Le,(be={},(0,P.Z)(be,"".concat(Fn,"-open"),Er),(0,P.Z)(be,"".concat(Fn,"-active"),zr),(0,P.Z)(be,"".concat(Fn,"-selected"),xr),(0,P.Z)(be,"".concat(Fn,"-disabled"),ar),be)),onMouseEnter:Cr,onMouseLeave:Kr}),Tn,!In&&m.createElement(g,{id:un,open:Er,keyPath:Jn},_t));return xn&&(fr=xn(fr,ce,{selected:xr,active:zr,open:Er,disabled:ar})),m.createElement(b,{onItemClick:kr,mode:vt==="horizontal"?"vertical":vt,itemIcon:or,expandIcon:jn},fr)};function Z(oe){var ce=oe.eventKey,be=oe.children,Ne=Ue(ce),Le=gn(be,Ne),Ke=G();m.useEffect(function(){if(Ke)return Ke.registerPath(ce,Ne),function(){Ke.unregisterPath(ce,Ne)}},[Ne]);var Ve;return Ke?Ve=Le:Ve=m.createElement(X,oe,Le),m.createElement(Me.Provider,{value:Ne},Ve)}var le=y(20135),xe=["className","title","eventKey","children"],Fe=["children"],ve=function(ce){var be=ce.className,Ne=ce.title,Le=ce.eventKey,Ke=ce.children,Ve=(0,K.Z)(ce,xe),lt=m.useContext(se),Et=lt.prefixCls,St="".concat(Et,"-item-group");return m.createElement("li",(0,R.Z)({role:"presentation"},Ve,{onClick:function(Nt){return Nt.stopPropagation()},className:ue()(St,be)}),m.createElement("div",{role:"presentation",className:"".concat(St,"-title"),title:typeof Ne=="string"?Ne:void 0},Ne),m.createElement("ul",{role:"group",className:"".concat(St,"-list")},Ke))};function qe(oe){var ce=oe.children,be=(0,K.Z)(oe,Fe),Ne=Ue(be.eventKey),Le=gn(ce,Ne),Ke=G();return Ke?Le:m.createElement(ve,(0,ft.Z)(be,["warnKey"]),Le)}function ke(oe){var ce=oe.className,be=oe.style,Ne=m.useContext(se),Le=Ne.prefixCls,Ke=G();return Ke?null:m.createElement("li",{role:"separator",className:ue()("".concat(Le,"-item-divider"),ce),style:be})}var _e=["label","children","key","type"];function Ie(oe){return(oe||[]).map(function(ce,be){if(ce&&(0,le.Z)(ce)==="object"){var Ne=ce,Le=Ne.label,Ke=Ne.children,Ve=Ne.key,lt=Ne.type,Et=(0,K.Z)(Ne,_e),St=Ve!=null?Ve:"tmp-".concat(be);return Ke||lt==="group"?lt==="group"?m.createElement(qe,(0,R.Z)({key:St},Et,{title:Le}),Ie(Ke)):m.createElement(Z,(0,R.Z)({key:St},Et,{title:Le}),Ie(Ke)):lt==="divider"?m.createElement(ke,(0,R.Z)({key:St},Et)):m.createElement(ht,(0,R.Z)({key:St},Et),Le)}return null}).filter(function(ce){return ce})}function tt(oe,ce,be){var Ne=oe;return ce&&(Ne=Ie(ce)),gn(Ne,be)}var Ye=["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"],mt=[],Ft=m.forwardRef(function(oe,ce){var be,Ne,Le=oe,Ke=Le.prefixCls,Ve=Ke===void 0?"rc-menu":Ke,lt=Le.rootClassName,Et=Le.style,St=Le.className,_t=Le.tabIndex,Nt=_t===void 0?0:_t,tn=Le.items,Bt=Le.children,pt=Le.direction,nn=Le.id,Vt=Le.mode,an=Vt===void 0?"vertical":Vt,rn=Le.inlineCollapsed,cn=Le.disabled,Sn=Le.disabledOverflow,$t=Le.subMenuOpenDelay,Rn=$t===void 0?.1:$t,Zn=Le.subMenuCloseDelay,Yt=Zn===void 0?.1:Zn,xt=Le.forceSubMenuRender,vt=Le.defaultOpenKeys,Dn=Le.openKeys,bn=Le.activeKey,In=Le.defaultActiveFirst,En=Le.selectable,fn=En===void 0?!0:En,kn=Le.multiple,_n=kn===void 0?!1:kn,Yn=Le.defaultSelectedKeys,jt=Le.selectedKeys,Ct=Le.onSelect,Qt=Le.onDeselect,xn=Le.inlineIndent,Hn=xn===void 0?24:xn,vr=Le.motion,Jn=Le.defaultMotions,Fn=Le.triggerSubMenuAction,ar=Fn===void 0?"hover":Fn,Xn=Le.builtinPlacements,er=Le.itemIcon,or=Le.expandIcon,jn=Le.overflowedIndicator,sr=jn===void 0?"...":jn,Er=Le.overflowedIndicatorPopupClassName,xr=Le.getPopupContainer,Tr=Le.onClick,Lr=Le.onOpenChange,lr=Le.onKeyDown,Nr=Le.openAnimation,wr=Le.openTransitionName,Zr=Le._internalRenderMenuItem,Wr=Le._internalRenderSubMenuItem,Br=(0,K.Z)(Le,Ye),Cr=m.useMemo(function(){return tt(Bt,tn,mt)},[Bt,tn]),Kr=m.useState(!1),zr=(0,H.Z)(Kr,2),Mr=zr[0],Jr=zr[1],kr=m.useRef(),sn=Se(nn),Ln=pt==="rtl",un=(0,B.Z)(vt,{value:Dn,postState:function(gr){return gr||mt}}),Tn=(0,H.Z)(un,2),Nn=Tn[0],Un=Tn[1],fr=function(gr){var Ir=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function _r(){Un(gr),Lr==null||Lr(gr)}Ir?(0,J.flushSync)(_r):_r()},rr=m.useState(Nn),ur=(0,H.Z)(rr,2),hr=ur[0],Qn=ur[1],zn=m.useRef(!1),yr=m.useMemo(function(){return(an==="inline"||an==="vertical")&&rn?["vertical",rn]:[an,!1]},[an,rn]),Sr=(0,H.Z)(yr,2),Rr=Sr[0],Zt=Sr[1],hn=Rr==="inline",Kn=m.useState(Rr),Dr=(0,H.Z)(Kn,2),ir=Dr[0],qr=Dr[1],mi=m.useState(Zt),di=(0,H.Z)(mi,2),si=di[0],zi=di[1];m.useEffect(function(){qr(Rr),zi(Zt),zn.current&&(hn?Un(hr):fr(mt))},[Rr,Zt]);var Ii=m.useState(0),Ei=(0,H.Z)(Ii,2),yi=Ei[0],Li=Ei[1],xi=yi>=Cr.length-1||ir!=="horizontal"||Sn;m.useEffect(function(){hn&&Qn(Nn)},[Nn]),m.useEffect(function(){return zn.current=!0,function(){zn.current=!1}},[]);var Gr=D(),wi=Gr.registerPath,Di=Gr.unregisterPath,ei=Gr.refreshOverflowKeys,ri=Gr.isSubPathKey,qn=Gr.getKeyPath,Bn=Gr.getKeys,Fr=Gr.getSubPathKeys,Hr=m.useMemo(function(){return{registerPath:wi,unregisterPath:Di}},[wi,Di]),Or=m.useMemo(function(){return{isSubPathKey:ri}},[ri]);m.useEffect(function(){ei(xi?mt:Cr.slice(yi+1).map(function(Pr){return Pr.key}))},[yi,xi]);var $r=(0,B.Z)(bn||In&&((be=Cr[0])===null||be===void 0?void 0:be.key),{value:bn}),cr=(0,H.Z)($r,2),ii=cr[0],Yr=cr[1],ti=_(function(Pr){Yr(Pr)}),ai=_(function(){Yr(void 0)});(0,m.useImperativeHandle)(ce,function(){return{list:kr.current,focus:function(gr){var Ir,_r=Bn(),ni=A(_r,sn),_i=ni.elements,Hi=ni.key2element,hs=ni.element2key,Yi=F(kr.current,_i),Ni=ii!=null?ii:Yi[0]?hs.get(Yi[0]):(Ir=Cr.find(function(Zi){return!Zi.props.disabled}))===null||Ir===void 0?void 0:Ir.key,Ti=Hi.get(Ni);if(Ni&&Ti){var Rt;Ti==null||(Rt=Ti.focus)===null||Rt===void 0||Rt.call(Ti,gr)}}}});var mr=(0,B.Z)(Yn||[],{value:jt,postState:function(gr){return Array.isArray(gr)?gr:gr==null?mt:[gr]}}),Oi=(0,H.Z)(mr,2),gi=Oi[0],Pi=Oi[1],cs=function(gr){if(fn){var Ir=gr.key,_r=gi.includes(Ir),ni;_n?_r?ni=gi.filter(function(Hi){return Hi!==Ir}):ni=[].concat((0,ee.Z)(gi),[Ir]):ni=[Ir],Pi(ni);var _i=(0,W.Z)((0,W.Z)({},gr),{},{selectedKeys:ni});_r?Qt==null||Qt(_i):Ct==null||Ct(_i)}!_n&&Nn.length&&ir!=="inline"&&fr(mt)},us=_(function(Pr){Tr==null||Tr(ot(Pr)),cs(Pr)}),Gi=_(function(Pr,gr){var Ir=Nn.filter(function(ni){return ni!==Pr});if(gr)Ir.push(Pr);else if(ir!=="inline"){var _r=Fr(Pr);Ir=Ir.filter(function(ni){return!_r.has(ni)})}(0,je.Z)(Nn,Ir,!0)||fr(Ir,!0)}),Ki=function(gr,Ir){var _r=Ir!=null?Ir:!Nn.includes(gr);Gi(gr,_r)},ds=N(ir,ii,Ln,sn,kr,Bn,qn,Yr,Ki,lr);m.useEffect(function(){Jr(!0)},[]);var fs=m.useMemo(function(){return{_internalRenderMenuItem:Zr,_internalRenderSubMenuItem:Wr}},[Zr,Wr]),Mi=ir!=="horizontal"||Sn?Cr:Cr.map(function(Pr,gr){return m.createElement(b,{key:Pr.key,overflowDisabled:gr>yi},Pr)}),$i=m.createElement(de.Z,(0,R.Z)({id:nn,ref:kr,prefixCls:"".concat(Ve,"-overflow"),component:"ul",itemComponent:ht,className:ue()(Ve,"".concat(Ve,"-root"),"".concat(Ve,"-").concat(ir),St,(Ne={},(0,P.Z)(Ne,"".concat(Ve,"-inline-collapsed"),si),(0,P.Z)(Ne,"".concat(Ve,"-rtl"),Ln),Ne),lt),dir:pt,style:Et,role:"menu",tabIndex:Nt,data:Mi,renderRawItem:function(gr){return gr},renderRawRest:function(gr){var Ir=gr.length,_r=Ir?Cr.slice(-Ir):null;return m.createElement(Z,{eventKey:q,title:sr,disabled:xi,internalPopupClose:Ir===0,popupClassName:Er},_r)},maxCount:ir!=="horizontal"||Sn?de.Z.INVALIDATE:de.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(gr){Li(gr)},onKeyDown:ds},Br));return m.createElement(ie.Provider,{value:fs},m.createElement($.Provider,{value:sn},m.createElement(b,{prefixCls:Ve,rootClassName:lt,mode:ir,openKeys:Nn,rtl:Ln,disabled:cn,motion:Mr?vr:null,defaultMotions:Mr?Jn:null,activeKey:ii,onActive:ti,onInactive:ai,selectedKeys:gi,inlineIndent:Hn,subMenuOpenDelay:Rn,subMenuCloseDelay:Yt,forceSubMenuRender:xt,builtinPlacements:Xn,triggerSubMenuAction:ar,getPopupContainer:xr,itemIcon:er,expandIcon:or,onItemClick:us,onOpenChange:Gi},m.createElement(Je.Provider,{value:Or},$i),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(z.Provider,{value:Hr},Cr)))))}),Ut=Ft,rt=Ut;rt.Item=ht,rt.SubMenu=Z,rt.ItemGroup=qe,rt.Divider=ke;var ct=rt},11780:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return Oe}});var R=y(96663),P=y(44127),W=y(72071),ee=y(6620),H=y(59301),K=y(92310),pe=y.n(K),ue=y(29301),de=y(34280),B=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],je=void 0;function k(ge,Be){var it=ge.prefixCls,ye=ge.invalidate,Te=ge.item,Pe=ge.renderItem,Ce=ge.responsive,at=ge.responsiveDisabled,Ot=ge.registerSize,Pt=ge.itemKey,Xt=ge.className,wt=ge.style,bt=ge.children,Ht=ge.display,Jt=ge.order,Ee=ge.component,yt=Ee===void 0?"div":Ee,F=(0,ee.Z)(ge,B),j=Ce&&!Ht;function A(I){Ot(Pt,I)}H.useEffect(function(){return function(){A(null)}},[]);var N=Pe&&Te!==je?Pe(Te,{index:Jt}):bt,V;ye||(V={opacity:j?0:1,height:j?0:je,overflowY:j?"hidden":je,order:Ce?Jt:je,pointerEvents:j?"none":je,position:j?"absolute":je});var ae={};j&&(ae["aria-hidden"]=!0);var S=H.createElement(yt,(0,R.Z)({className:pe()(!ye&&it,Xt),style:(0,P.Z)((0,P.Z)({},V),wt)},ae,F,{ref:Be}),N);return Ce&&(S=H.createElement(ue.Z,{onResize:function(q){var D=q.offsetWidth;A(D)},disabled:at},S)),S}var m=H.forwardRef(k);m.displayName="Item";var J=m,$=y(6089),ze=y(4676),st=y(16089);function me(ge){if(typeof MessageChannel=="undefined")(0,st.Z)(ge);else{var Be=new MessageChannel;Be.port1.onmessage=function(){return ge()},Be.port2.postMessage(void 0)}}function Q(){var ge=H.useRef(null),Be=function(ye){ge.current||(ge.current=[],me(function(){(0,ze.unstable_batchedUpdates)(function(){ge.current.forEach(function(Te){Te()}),ge.current=null})})),ge.current.push(ye)};return Be}function se(ge,Be){var it=H.useState(Be),ye=(0,W.Z)(it,2),Te=ye[0],Pe=ye[1],Ce=(0,$.Z)(function(at){ge(function(){Pe(at)})});return[Te,Ce]}var te=H.createContext(null),b=["component"],C=["className"],z=["className"],G=function(Be,it){var ye=H.useContext(te);if(!ye){var Te=Be.component,Pe=Te===void 0?"div":Te,Ce=(0,ee.Z)(Be,b);return H.createElement(Pe,(0,R.Z)({},Ce,{ref:it}))}var at=ye.className,Ot=(0,ee.Z)(ye,C),Pt=Be.className,Xt=(0,ee.Z)(Be,z);return H.createElement(te.Provider,{value:null},H.createElement(J,(0,R.Z)({ref:it,className:pe()(at,Pt)},Ot,Xt)))},Me=H.forwardRef(G);Me.displayName="RawItem";var Ue=Me,Je=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],We="responsive",ie="invalidate";function Y(ge){return"+ ".concat(ge.length," ...")}function fe(ge,Be){var it=ge.prefixCls,ye=it===void 0?"rc-overflow":it,Te=ge.data,Pe=Te===void 0?[]:Te,Ce=ge.renderItem,at=ge.renderRawItem,Ot=ge.itemKey,Pt=ge.itemWidth,Xt=Pt===void 0?10:Pt,wt=ge.ssr,bt=ge.style,Ht=ge.className,Jt=ge.maxCount,Ee=ge.renderRest,yt=ge.renderRawRest,F=ge.suffix,j=ge.component,A=j===void 0?"div":j,N=ge.itemComponent,V=ge.onVisibleChange,ae=(0,ee.Z)(ge,Je),S=wt==="full",I=Q(),q=se(I,null),D=(0,W.Z)(q,2),_=D[0],ne=D[1],De=_||0,Se=se(I,new Map),Qe=(0,W.Z)(Se,2),Re=Qe[0],we=Qe[1],He=se(I,0),ft=(0,W.Z)(He,2),Xe=ft[0],he=ft[1],Dt=se(I,0),Tt=(0,W.Z)(Dt,2),Kt=Tt[0],ot=Tt[1],on=se(I,0),ln=(0,W.Z)(on,2),yn=ln[0],Cn=ln[1],Mt=(0,H.useState)(null),qt=(0,W.Z)(Mt,2),ht=qt[0],kt=qt[1],mn=(0,H.useState)(null),It=(0,W.Z)(mn,2),en=It[0],An=It[1],gn=H.useMemo(function(){return en===null&&S?Number.MAX_SAFE_INTEGER:en||0},[en,_]),Pn=(0,H.useState)(!1),On=(0,W.Z)(Pn,2),Mn=On[0],nr=On[1],ut="".concat(ye,"-item"),l=Math.max(Xe,Kt),f=Jt===We,p=Pe.length&&f,d=Jt===ie,g=p||typeof Jt=="number"&&Pe.length>Jt,x=(0,H.useMemo)(function(){var ct=Pe;return p?_===null&&S?ct=Pe:ct=Pe.slice(0,Math.min(Pe.length,De/Xt)):typeof Jt=="number"&&(ct=Pe.slice(0,Jt)),ct},[Pe,Xt,_,Jt,p]),E=(0,H.useMemo)(function(){return p?Pe.slice(gn+1):Pe.slice(x.length)},[Pe,x,p,gn]),X=(0,H.useCallback)(function(ct,oe){var ce;return typeof Ot=="function"?Ot(ct):(ce=Ot&&(ct==null?void 0:ct[Ot]))!==null&&ce!==void 0?ce:oe},[Ot]),Z=(0,H.useCallback)(Ce||function(ct){return ct},[Ce]);function le(ct,oe,ce){en===ct&&(oe===void 0||oe===ht)||(An(ct),ce||(nr(ctDe){le(be-1,ct-Ne-yn+Kt);break}}F&&ke(0)+yn>De&&kt(null)}},[De,Re,Kt,yn,X,x]);var _e=Mn&&!!E.length,Ie={};ht!==null&&p&&(Ie={position:"absolute",left:ht,top:0});var tt={prefixCls:ut,responsive:p,component:N,invalidate:d},Ye=at?function(ct,oe){var ce=X(ct,oe);return H.createElement(te.Provider,{key:ce,value:(0,P.Z)((0,P.Z)({},tt),{},{order:oe,item:ct,itemKey:ce,registerSize:Fe,display:oe<=gn})},at(ct,oe))}:function(ct,oe){var ce=X(ct,oe);return H.createElement(J,(0,R.Z)({},tt,{order:oe,key:ce,item:ct,renderItem:Z,itemKey:ce,registerSize:Fe,display:oe<=gn}))},mt={order:_e?gn:Number.MAX_SAFE_INTEGER,className:"".concat(ut,"-rest"),registerSize:ve,display:_e},Ft=Ee||Y,Ut=yt?H.createElement(te.Provider,{value:(0,P.Z)((0,P.Z)({},tt),mt)},yt(E)):H.createElement(J,(0,R.Z)({},tt,mt),typeof Ft=="function"?Ft(E):Ft),rt=H.createElement(A,(0,R.Z)({className:pe()(!d&&ye,Ht),style:bt,ref:Be},ae),x.map(Ye),g?Ut:null,F&&H.createElement(J,(0,R.Z)({},tt,{responsive:f,responsiveDisabled:!p,order:gn,className:"".concat(ut,"-suffix"),registerSize:qe,display:!0,style:Ie}),F));return f?H.createElement(ue.Z,{onResize:xe,disabled:!p},rt):rt}var O=H.forwardRef(fe);O.displayName="Overflow",O.Item=Ue,O.RESPONSIVE=We,O.INVALIDATE=ie;var Ae=O,Oe=Ae},29301:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return ie}});var R=y(96663),P=y(59301),W=y(11592),ee=y(48736),H=y(44127),K=y(20135),pe=y(76846),ue=y(8654),de=P.createContext(null);function B(Y){var fe=Y.children,O=Y.onBatchResize,Ae=P.useRef(0),Oe=P.useRef([]),ge=P.useContext(de),Be=P.useCallback(function(it,ye,Te){Ae.current+=1;var Pe=Ae.current;Oe.current.push({size:it,element:ye,data:Te}),Promise.resolve().then(function(){Pe===Ae.current&&(O==null||O(Oe.current),Oe.current=[])}),ge==null||ge(it,ye,Te)},[O,ge]);return P.createElement(de.Provider,{value:Be},fe)}var je=y(76374),k=new Map;function m(Y){Y.forEach(function(fe){var O,Ae=fe.target;(O=k.get(Ae))===null||O===void 0||O.forEach(function(Oe){return Oe(Ae)})})}var J=new je.Z(m),$=null,ze=null;function st(Y,fe){k.has(Y)||(k.set(Y,new Set),J.observe(Y)),k.get(Y).add(fe)}function me(Y,fe){k.has(Y)&&(k.get(Y).delete(fe),k.get(Y).size||(J.unobserve(Y),k.delete(Y)))}var Q=y(52884),se=y(95727),te=y(65711),b=y(85745),C=function(Y){(0,te.Z)(O,Y);var fe=(0,b.Z)(O);function O(){return(0,Q.Z)(this,O),fe.apply(this,arguments)}return(0,se.Z)(O,[{key:"render",value:function(){return this.props.children}}]),O}(P.Component);function z(Y,fe){var O=Y.children,Ae=Y.disabled,Oe=P.useRef(null),ge=P.useRef(null),Be=P.useContext(de),it=typeof O=="function",ye=it?O(Oe):O,Te=P.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Pe=!it&&P.isValidElement(ye)&&(0,ue.Yr)(ye),Ce=Pe?(0,ue.C4)(ye):null,at=(0,ue.x1)(Ce,Oe),Ot=function(){var bt;return(0,pe.ZP)(Oe.current)||(Oe.current&&(0,K.Z)(Oe.current)==="object"?(0,pe.ZP)((bt=Oe.current)===null||bt===void 0?void 0:bt.nativeElement):null)||(0,pe.ZP)(ge.current)};P.useImperativeHandle(fe,function(){return Ot()});var Pt=P.useRef(Y);Pt.current=Y;var Xt=P.useCallback(function(wt){var bt=Pt.current,Ht=bt.onResize,Jt=bt.data,Ee=wt.getBoundingClientRect(),yt=Ee.width,F=Ee.height,j=wt.offsetWidth,A=wt.offsetHeight,N=Math.floor(yt),V=Math.floor(F);if(Te.current.width!==N||Te.current.height!==V||Te.current.offsetWidth!==j||Te.current.offsetHeight!==A){var ae={width:N,height:V,offsetWidth:j,offsetHeight:A};Te.current=ae;var S=j===Math.round(yt)?yt:j,I=A===Math.round(F)?F:A,q=(0,H.Z)((0,H.Z)({},ae),{},{offsetWidth:S,offsetHeight:I});Be==null||Be(q,wt,Jt),Ht&&Promise.resolve().then(function(){Ht(q,wt)})}},[]);return P.useEffect(function(){var wt=Ot();return wt&&!Ae&&st(wt,Xt),function(){return me(wt,Xt)}},[Oe.current,Ae]),P.createElement(C,{ref:ge},Pe?P.cloneElement(ye,{ref:at}):ye)}var G=P.forwardRef(z),Me=G,Ue="rc-observer-key";function Je(Y,fe){var O=Y.children,Ae=typeof O=="function"?[O]:(0,W.Z)(O);return Ae.map(function(Oe,ge){var Be=(Oe==null?void 0:Oe.key)||"".concat(Ue,"-").concat(ge);return P.createElement(Me,(0,R.Z)({},Y,{key:Be,ref:ge===0?fe:void 0}),Oe)})}var We=P.forwardRef(Je);We.Collection=B;var ie=We},17115:function(Wt,nt,y){"use strict";y.d(nt,{ZP:function(){return pe}});var R=y(72071),P=y(59301),W=y(47273),ee=0,H=(0,W.Z)();function K(){var ue;return H?(ue=ee,ee+=1):ue="TEST_OR_SSR",ue}function pe(ue){var de=P.useState(),B=(0,R.Z)(de,2),je=B[0],k=B[1];return P.useEffect(function(){k("rc_select_".concat(K()))},[]),ue||je}},77861:function(Wt,nt,y){"use strict";y.d(nt,{Ac:function(){return ne},Xo:function(){return ot},Wx:function(){return ln},ZP:function(){return g},lk:function(){return te}});var R=y(96663),P=y(19127),W=y(90493),ee=y(44127),H=y(72071),K=y(6620),pe=y(20135),ue=y(18929),de=y(48736),B=y(59301),je=y(92310),k=y.n(je),m=y(34280),J=y(49658),$=y(10228),ze=y(8654),st=function(E){var X=E.className,Z=E.customizeIcon,le=E.customizeIconProps,xe=E.onMouseDown,Fe=E.onClick,ve=E.children,qe;return typeof Z=="function"?qe=Z(le):qe=Z,B.createElement("span",{className:X,onMouseDown:function(_e){_e.preventDefault(),xe&&xe(_e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:Fe,"aria-hidden":!0},qe!==void 0?qe:B.createElement("span",{className:k()(X.split(/\s+/).map(function(ke){return"".concat(ke,"-icon")}))},ve))},me=st;function Q(x,E,X,Z,le){var xe=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,Fe=arguments.length>6?arguments[6]:void 0,ve=arguments.length>7?arguments[7]:void 0,qe=B.useMemo(function(){if((0,pe.Z)(Z)==="object")return Z.clearIcon;if(le)return le},[Z,le]),ke=B.useMemo(function(){return!!(!xe&&Z&&(X.length||Fe)&&!(ve==="combobox"&&Fe===""))},[Z,xe,X.length,Fe,ve]);return{allowClear:ke,clearIcon:B.createElement(me,{className:"".concat(x,"-clear"),onMouseDown:E,customizeIcon:qe},"\xD7")}}var se=B.createContext(null);function te(){return B.useContext(se)}function b(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,E=B.useState(!1),X=(0,H.Z)(E,2),Z=X[0],le=X[1],xe=B.useRef(null),Fe=function(){window.clearTimeout(xe.current)};B.useEffect(function(){return Fe},[]);var ve=function(ke,_e){Fe(),xe.current=window.setTimeout(function(){le(ke),_e&&_e()},x)};return[Z,ve,Fe]}function C(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,E=B.useRef(null),X=B.useRef(null);B.useEffect(function(){return function(){window.clearTimeout(X.current)}},[]);function Z(le){(le||E.current===null)&&(E.current=le),window.clearTimeout(X.current),X.current=window.setTimeout(function(){E.current=null},x)}return[function(){return E.current},Z]}function z(x,E,X,Z){var le=B.useRef(null);le.current={open:E,triggerOpen:X,customizedTrigger:Z},B.useEffect(function(){function xe(Fe){var ve;if(!((ve=le.current)!==null&&ve!==void 0&&ve.customizedTrigger)){var qe=Fe.target;qe.shadowRoot&&Fe.composed&&(qe=Fe.composedPath()[0]||qe),le.current.open&&x().filter(function(ke){return ke}).every(function(ke){return!ke.contains(qe)&&ke!==qe})&&le.current.triggerOpen(!1)}}return window.addEventListener("mousedown",xe),function(){return window.removeEventListener("mousedown",xe)}},[])}var G=y(26112),Me=y(11780),Ue=function(E,X){var Z,le,xe=E.prefixCls,Fe=E.id,ve=E.inputElement,qe=E.disabled,ke=E.tabIndex,_e=E.autoFocus,Ie=E.autoComplete,tt=E.editable,Ye=E.activeDescendantId,mt=E.value,Ft=E.maxLength,Ut=E.onKeyDown,rt=E.onMouseDown,ct=E.onChange,oe=E.onPaste,ce=E.onCompositionStart,be=E.onCompositionEnd,Ne=E.open,Le=E.attrs,Ke=ve||B.createElement("input",null),Ve=Ke,lt=Ve.ref,Et=Ve.props,St=Et.onKeyDown,_t=Et.onChange,Nt=Et.onMouseDown,tn=Et.onCompositionStart,Bt=Et.onCompositionEnd,pt=Et.style;return(0,de.Kp)(!("maxLength"in Ke.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Ke=B.cloneElement(Ke,(0,ee.Z)((0,ee.Z)((0,ee.Z)({type:"search"},Et),{},{id:Fe,ref:(0,ze.sQ)(X,lt),disabled:qe,tabIndex:ke,autoComplete:Ie||"off",autoFocus:_e,className:k()("".concat(xe,"-selection-search-input"),(Z=Ke)===null||Z===void 0||(le=Z.props)===null||le===void 0?void 0:le.className),role:"combobox","aria-label":"Search","aria-expanded":Ne||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Fe,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Fe,"_list"),"aria-activedescendant":Ne?Ye:void 0},Le),{},{value:tt?mt:"",maxLength:Ft,readOnly:!tt,unselectable:tt?null:"on",style:(0,ee.Z)((0,ee.Z)({},pt),{},{opacity:tt?null:0}),onKeyDown:function(Vt){Ut(Vt),St&&St(Vt)},onMouseDown:function(Vt){rt(Vt),Nt&&Nt(Vt)},onChange:function(Vt){ct(Vt),_t&&_t(Vt)},onCompositionStart:function(Vt){ce(Vt),tn&&tn(Vt)},onCompositionEnd:function(Vt){be(Vt),Bt&&Bt(Vt)},onPaste:oe})),Ke},Je=B.forwardRef(Ue);Je.displayName="Input";var We=Je;function ie(x){return Array.isArray(x)?x:x!==void 0?[x]:[]}var Y=typeof window!="undefined"&&window.document&&window.document.documentElement,fe=Y;function O(x){return x!=null}function Ae(x){return!x&&x!==0}function Oe(x){return["string","number"].includes((0,pe.Z)(x))}function ge(x){var E=void 0;return x&&(Oe(x.title)?E=x.title.toString():Oe(x.label)&&(E=x.label.toString())),E}function Be(x,E){fe?B.useLayoutEffect(x,E):B.useEffect(x,E)}function it(x){var E;return(E=x.key)!==null&&E!==void 0?E:x.value}var ye=function(E){E.preventDefault(),E.stopPropagation()},Te=function(E){var X=E.id,Z=E.prefixCls,le=E.values,xe=E.open,Fe=E.searchValue,ve=E.autoClearSearchValue,qe=E.inputRef,ke=E.placeholder,_e=E.disabled,Ie=E.mode,tt=E.showSearch,Ye=E.autoFocus,mt=E.autoComplete,Ft=E.activeDescendantId,Ut=E.tabIndex,rt=E.removeIcon,ct=E.maxTagCount,oe=E.maxTagTextLength,ce=E.maxTagPlaceholder,be=ce===void 0?function(En){return"+ ".concat(En.length," ...")}:ce,Ne=E.tagRender,Le=E.onToggleOpen,Ke=E.onRemove,Ve=E.onInputChange,lt=E.onInputPaste,Et=E.onInputKeyDown,St=E.onInputMouseDown,_t=E.onInputCompositionStart,Nt=E.onInputCompositionEnd,tn=B.useRef(null),Bt=(0,B.useState)(0),pt=(0,H.Z)(Bt,2),nn=pt[0],Vt=pt[1],an=(0,B.useState)(!1),rn=(0,H.Z)(an,2),cn=rn[0],Sn=rn[1],$t="".concat(Z,"-selection"),Rn=xe||Ie==="multiple"&&ve===!1||Ie==="tags"?Fe:"",Zn=Ie==="tags"||Ie==="multiple"&&ve===!1||tt&&(xe||cn);Be(function(){Vt(tn.current.scrollWidth)},[Rn]);function Yt(En,fn,kn,_n,Yn){return B.createElement("span",{className:k()("".concat($t,"-item"),(0,W.Z)({},"".concat($t,"-item-disabled"),kn)),title:ge(En)},B.createElement("span",{className:"".concat($t,"-item-content")},fn),_n&&B.createElement(me,{className:"".concat($t,"-item-remove"),onMouseDown:ye,onClick:Yn,customizeIcon:rt},"\xD7"))}function xt(En,fn,kn,_n,Yn){var jt=function(Qt){ye(Qt),Le(!xe)};return B.createElement("span",{onMouseDown:jt},Ne({label:fn,value:En,disabled:kn,closable:_n,onClose:Yn}))}function vt(En){var fn=En.disabled,kn=En.label,_n=En.value,Yn=!_e&&!fn,jt=kn;if(typeof oe=="number"&&(typeof kn=="string"||typeof kn=="number")){var Ct=String(jt);Ct.length>oe&&(jt="".concat(Ct.slice(0,oe),"..."))}var Qt=function(Hn){Hn&&Hn.stopPropagation(),Ke(En)};return typeof Ne=="function"?xt(_n,jt,fn,Yn,Qt):Yt(En,jt,fn,Yn,Qt)}function Dn(En){var fn=typeof be=="function"?be(En):be;return Yt({title:fn},fn,!1)}var bn=B.createElement("div",{className:"".concat($t,"-search"),style:{width:nn},onFocus:function(){Sn(!0)},onBlur:function(){Sn(!1)}},B.createElement(We,{ref:qe,open:xe,prefixCls:Z,id:X,inputElement:null,disabled:_e,autoFocus:Ye,autoComplete:mt,editable:Zn,activeDescendantId:Ft,value:Rn,onKeyDown:Et,onMouseDown:St,onChange:Ve,onPaste:lt,onCompositionStart:_t,onCompositionEnd:Nt,tabIndex:Ut,attrs:(0,G.Z)(E,!0)}),B.createElement("span",{ref:tn,className:"".concat($t,"-search-mirror"),"aria-hidden":!0},Rn,"\xA0")),In=B.createElement(Me.Z,{prefixCls:"".concat($t,"-overflow"),data:le,renderItem:vt,renderRest:Dn,suffix:bn,itemKey:it,maxCount:ct});return B.createElement(B.Fragment,null,In,!le.length&&!Rn&&B.createElement("span",{className:"".concat($t,"-placeholder")},ke))},Pe=Te,Ce=function(E){var X=E.inputElement,Z=E.prefixCls,le=E.id,xe=E.inputRef,Fe=E.disabled,ve=E.autoFocus,qe=E.autoComplete,ke=E.activeDescendantId,_e=E.mode,Ie=E.open,tt=E.values,Ye=E.placeholder,mt=E.tabIndex,Ft=E.showSearch,Ut=E.searchValue,rt=E.activeValue,ct=E.maxLength,oe=E.onInputKeyDown,ce=E.onInputMouseDown,be=E.onInputChange,Ne=E.onInputPaste,Le=E.onInputCompositionStart,Ke=E.onInputCompositionEnd,Ve=E.title,lt=B.useState(!1),Et=(0,H.Z)(lt,2),St=Et[0],_t=Et[1],Nt=_e==="combobox",tn=Nt||Ft,Bt=tt[0],pt=Ut||"";Nt&&rt&&!St&&(pt=rt),B.useEffect(function(){Nt&&_t(!1)},[Nt,rt]);var nn=_e!=="combobox"&&!Ie&&!Ft?!1:!!pt,Vt=Ve===void 0?ge(Bt):Ve,an=function(){if(Bt)return null;var cn=nn?{visibility:"hidden"}:void 0;return B.createElement("span",{className:"".concat(Z,"-selection-placeholder"),style:cn},Ye)};return B.createElement(B.Fragment,null,B.createElement("span",{className:"".concat(Z,"-selection-search")},B.createElement(We,{ref:xe,prefixCls:Z,id:le,open:Ie,inputElement:X,disabled:Fe,autoFocus:ve,autoComplete:qe,editable:tn,activeDescendantId:ke,value:pt,onKeyDown:oe,onMouseDown:ce,onChange:function(cn){_t(!0),be(cn)},onPaste:Ne,onCompositionStart:Le,onCompositionEnd:Ke,tabIndex:mt,attrs:(0,G.Z)(E,!0),maxLength:Nt?ct:void 0})),!Nt&&Bt?B.createElement("span",{className:"".concat(Z,"-selection-item"),title:Vt,style:nn?{visibility:"hidden"}:void 0},Bt.label):null,an())},at=Ce;function Ot(x){return![$.Z.ESC,$.Z.SHIFT,$.Z.BACKSPACE,$.Z.TAB,$.Z.WIN_KEY,$.Z.ALT,$.Z.META,$.Z.WIN_KEY_RIGHT,$.Z.CTRL,$.Z.SEMICOLON,$.Z.EQUALS,$.Z.CAPS_LOCK,$.Z.CONTEXT_MENU,$.Z.F1,$.Z.F2,$.Z.F3,$.Z.F4,$.Z.F5,$.Z.F6,$.Z.F7,$.Z.F8,$.Z.F9,$.Z.F10,$.Z.F11,$.Z.F12].includes(x)}var Pt=function(E,X){var Z=(0,B.useRef)(null),le=(0,B.useRef)(!1),xe=E.prefixCls,Fe=E.open,ve=E.mode,qe=E.showSearch,ke=E.tokenWithEnter,_e=E.autoClearSearchValue,Ie=E.onSearch,tt=E.onSearchSubmit,Ye=E.onToggleOpen,mt=E.onInputKeyDown,Ft=E.domRef;B.useImperativeHandle(X,function(){return{focus:function(){Z.current.focus()},blur:function(){Z.current.blur()}}});var Ut=C(0),rt=(0,H.Z)(Ut,2),ct=rt[0],oe=rt[1],ce=function(pt){var nn=pt.which;(nn===$.Z.UP||nn===$.Z.DOWN)&&pt.preventDefault(),mt&&mt(pt),nn===$.Z.ENTER&&ve==="tags"&&!le.current&&!Fe&&(tt==null||tt(pt.target.value)),Ot(nn)&&Ye(!0)},be=function(){oe(!0)},Ne=(0,B.useRef)(null),Le=function(pt){Ie(pt,!0,le.current)!==!1&&Ye(!0)},Ke=function(){le.current=!0},Ve=function(pt){le.current=!1,ve!=="combobox"&&Le(pt.target.value)},lt=function(pt){var nn=pt.target.value;if(ke&&Ne.current&&/[\r\n]/.test(Ne.current)){var Vt=Ne.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");nn=nn.replace(Vt,Ne.current)}Ne.current=null,Le(nn)},Et=function(pt){var nn=pt.clipboardData,Vt=nn.getData("text");Ne.current=Vt},St=function(pt){var nn=pt.target;if(nn!==Z.current){var Vt=document.body.style.msTouchAction!==void 0;Vt?setTimeout(function(){Z.current.focus()}):Z.current.focus()}},_t=function(pt){var nn=ct();pt.target!==Z.current&&!nn&&ve!=="combobox"&&pt.preventDefault(),(ve!=="combobox"&&(!qe||!nn)||!Fe)&&(Fe&&_e!==!1&&Ie("",!0,!1),Ye())},Nt={inputRef:Z,onInputKeyDown:ce,onInputMouseDown:be,onInputChange:lt,onInputPaste:Et,onInputCompositionStart:Ke,onInputCompositionEnd:Ve},tn=ve==="multiple"||ve==="tags"?B.createElement(Pe,(0,R.Z)({},E,Nt)):B.createElement(at,(0,R.Z)({},E,Nt));return B.createElement("div",{ref:Ft,className:"".concat(xe,"-selector"),onClick:St,onMouseDown:_t},tn)},Xt=B.forwardRef(Pt);Xt.displayName="Selector";var wt=Xt,bt=y(35593),Ht=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Jt=function(E){var X=E===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:X,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:X,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:X,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:X,adjustY:1},htmlRegion:"scroll"}}},Ee=function(E,X){var Z=E.prefixCls,le=E.disabled,xe=E.visible,Fe=E.children,ve=E.popupElement,qe=E.animation,ke=E.transitionName,_e=E.dropdownStyle,Ie=E.dropdownClassName,tt=E.direction,Ye=tt===void 0?"ltr":tt,mt=E.placement,Ft=E.builtinPlacements,Ut=E.dropdownMatchSelectWidth,rt=E.dropdownRender,ct=E.dropdownAlign,oe=E.getPopupContainer,ce=E.empty,be=E.getTriggerDOMNode,Ne=E.onPopupVisibleChange,Le=E.onPopupMouseEnter,Ke=(0,K.Z)(E,Ht),Ve="".concat(Z,"-dropdown"),lt=ve;rt&&(lt=rt(ve));var Et=B.useMemo(function(){return Ft||Jt(Ut)},[Ft,Ut]),St=qe?"".concat(Ve,"-").concat(qe):ke,_t=typeof Ut=="number",Nt=B.useMemo(function(){return _t?null:Ut===!1?"minWidth":"width"},[Ut,_t]),tn=_e;_t&&(tn=(0,ee.Z)((0,ee.Z)({},tn),{},{width:Ut}));var Bt=B.useRef(null);return B.useImperativeHandle(X,function(){return{getPopupElement:function(){return Bt.current}}}),B.createElement(bt.Z,(0,R.Z)({},Ke,{showAction:Ne?["click"]:[],hideAction:Ne?["click"]:[],popupPlacement:mt||(Ye==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Et,prefixCls:Ve,popupTransitionName:St,popup:B.createElement("div",{ref:Bt,onMouseEnter:Le},lt),stretch:Nt,popupAlign:ct,popupVisible:xe,getPopupContainer:oe,popupClassName:k()(Ie,(0,W.Z)({},"".concat(Ve,"-empty"),ce)),popupStyle:tn,getTriggerDOMNode:be,onPopupVisibleChange:Ne}),Fe)},yt=B.forwardRef(Ee);yt.displayName="SelectTrigger";var F=yt,j=y(4537);function A(x,E){var X=x.key,Z;return"value"in x&&(Z=x.value),X!=null?X:Z!==void 0?Z:"rc-index-key-".concat(E)}function N(x,E){var X=x||{},Z=X.label,le=X.value,xe=X.options,Fe=X.groupLabel,ve=Z||(E?"children":"label");return{label:ve,value:le||"value",options:xe||"options",groupLabel:Fe||ve}}function V(x){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=E.fieldNames,Z=E.childrenAsData,le=[],xe=N(X,!1),Fe=xe.label,ve=xe.value,qe=xe.options,ke=xe.groupLabel;function _e(Ie,tt){Ie.forEach(function(Ye){if(tt||!(qe in Ye)){var mt=Ye[ve];le.push({key:A(Ye,le.length),groupOption:tt,data:Ye,label:Ye[Fe],value:mt})}else{var Ft=Ye[ke];Ft===void 0&&Z&&(Ft=Ye.label),le.push({key:A(Ye,le.length),group:!0,data:Ye,label:Ft}),_e(Ye[qe],!0)}})}return _e(x,!1),le}function ae(x){var E=(0,ee.Z)({},x);return"props"in E||Object.defineProperty(E,"props",{get:function(){return(0,de.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),E}}),E}function S(x,E){if(!E||!E.length)return null;var X=!1;function Z(xe,Fe){var ve=(0,j.Z)(Fe),qe=ve[0],ke=ve.slice(1);if(!qe)return[xe];var _e=xe.split(qe);return X=X||_e.length>1,_e.reduce(function(Ie,tt){return[].concat((0,P.Z)(Ie),(0,P.Z)(Z(tt,ke)))},[]).filter(function(Ie){return Ie})}var le=Z(x,E);return X?le:null}var I=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],q=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function D(x){return x==="tags"||x==="multiple"}var _=B.forwardRef(function(x,E){var X,Z,le=x.id,xe=x.prefixCls,Fe=x.className,ve=x.showSearch,qe=x.tagRender,ke=x.direction,_e=x.omitDomProps,Ie=x.displayValues,tt=x.onDisplayValuesChange,Ye=x.emptyOptions,mt=x.notFoundContent,Ft=mt===void 0?"Not Found":mt,Ut=x.onClear,rt=x.mode,ct=x.disabled,oe=x.loading,ce=x.getInputElement,be=x.getRawInputElement,Ne=x.open,Le=x.defaultOpen,Ke=x.onDropdownVisibleChange,Ve=x.activeValue,lt=x.onActiveValueChange,Et=x.activeDescendantId,St=x.searchValue,_t=x.autoClearSearchValue,Nt=x.onSearch,tn=x.onSearchSplit,Bt=x.tokenSeparators,pt=x.allowClear,nn=x.suffixIcon,Vt=x.clearIcon,an=x.OptionList,rn=x.animation,cn=x.transitionName,Sn=x.dropdownStyle,$t=x.dropdownClassName,Rn=x.dropdownMatchSelectWidth,Zn=x.dropdownRender,Yt=x.dropdownAlign,xt=x.placement,vt=x.builtinPlacements,Dn=x.getPopupContainer,bn=x.showAction,In=bn===void 0?[]:bn,En=x.onFocus,fn=x.onBlur,kn=x.onKeyUp,_n=x.onKeyDown,Yn=x.onMouseDown,jt=(0,K.Z)(x,I),Ct=D(rt),Qt=(ve!==void 0?ve:Ct)||rt==="combobox",xn=(0,ee.Z)({},jt);q.forEach(function(qn){delete xn[qn]}),_e==null||_e.forEach(function(qn){delete xn[qn]});var Hn=B.useState(!1),vr=(0,H.Z)(Hn,2),Jn=vr[0],Fn=vr[1];B.useEffect(function(){Fn((0,J.Z)())},[]);var ar=B.useRef(null),Xn=B.useRef(null),er=B.useRef(null),or=B.useRef(null),jn=B.useRef(null),sr=b(),Er=(0,H.Z)(sr,3),xr=Er[0],Tr=Er[1],Lr=Er[2];B.useImperativeHandle(E,function(){var qn,Bn;return{focus:(qn=or.current)===null||qn===void 0?void 0:qn.focus,blur:(Bn=or.current)===null||Bn===void 0?void 0:Bn.blur,scrollTo:function(Hr){var Or;return(Or=jn.current)===null||Or===void 0?void 0:Or.scrollTo(Hr)}}});var lr=B.useMemo(function(){var qn;if(rt!=="combobox")return St;var Bn=(qn=Ie[0])===null||qn===void 0?void 0:qn.value;return typeof Bn=="string"||typeof Bn=="number"?String(Bn):""},[St,rt,Ie]),Nr=rt==="combobox"&&typeof ce=="function"&&ce()||null,wr=typeof be=="function"&&be(),Zr=(0,ze.x1)(Xn,wr==null||(X=wr.props)===null||X===void 0?void 0:X.ref),Wr=B.useState(!1),Br=(0,H.Z)(Wr,2),Cr=Br[0],Kr=Br[1];(0,m.Z)(function(){Kr(!0)},[]);var zr=(0,ue.Z)(!1,{defaultValue:Le,value:Ne}),Mr=(0,H.Z)(zr,2),Jr=Mr[0],kr=Mr[1],sn=Cr?Jr:!1,Ln=!Ft&&Ye;(ct||Ln&&sn&&rt==="combobox")&&(sn=!1);var un=Ln?!1:sn,Tn=B.useCallback(function(qn){var Bn=qn!==void 0?qn:!sn;ct||(kr(Bn),sn!==Bn&&(Ke==null||Ke(Bn)))},[ct,sn,kr,Ke]),Nn=B.useMemo(function(){return(Bt||[]).some(function(qn){return[` `,`\r `].includes(qn)})},[Bt]),Un=function(Bn,Fr,Hr){var Or=!0,$r=Bn;lt==null||lt(null);var cr=Hr?null:S(Bn,Bt);return rt!=="combobox"&&cr&&($r="",tn==null||tn(cr),Tn(!1),Or=!1),Nt&&lr!==$r&&Nt($r,{source:Fr?"typing":"effect"}),Or},fr=function(Bn){!Bn||!Bn.trim()||Nt(Bn,{source:"submit"})};B.useEffect(function(){!sn&&!Ct&&rt!=="combobox"&&Un("",!1,!1)},[sn]),B.useEffect(function(){Jr&&ct&&kr(!1),ct&&Tr(!1)},[ct]);var rr=C(),ur=(0,H.Z)(rr,2),hr=ur[0],Qn=ur[1],zn=function(Bn){var Fr=hr(),Hr=Bn.which;if(Hr===$.Z.ENTER&&(rt!=="combobox"&&Bn.preventDefault(),sn||Tn(!0)),Qn(!!lr),Hr===$.Z.BACKSPACE&&!Fr&&Ct&&!lr&&Ie.length){for(var Or=(0,P.Z)(Ie),$r=null,cr=Or.length-1;cr>=0;cr-=1){var ii=Or[cr];if(!ii.disabled){Or.splice(cr,1),$r=ii;break}}$r&&tt(Or,{type:"remove",values:[$r]})}for(var Yr=arguments.length,ti=new Array(Yr>1?Yr-1:0),ai=1;ai1?Fr-1:0),Or=1;Or1?cr-1:0),Yr=1;Yr1&&arguments[1]!==void 0?arguments[1]:!1;return(0,we.Z)(x).map(function(X,Z){if(!B.isValidElement(X)||!X.type)return null;var le=X,xe=le.type.isSelectOptGroup,Fe=le.key,ve=le.props,qe=ve.children,ke=(0,K.Z)(ve,ft);return E||!xe?Xe(X):(0,ee.Z)((0,ee.Z)({key:"__RC_SELECT_GRP__".concat(Fe===null?Z:Fe,"__"),label:Fe},ke),{},{options:he(qe)})}).filter(function(X){return X})}function Dt(x,E,X,Z,le){return B.useMemo(function(){var xe=x,Fe=!x;Fe&&(xe=he(E));var ve=new Map,qe=new Map,ke=function(tt,Ye,mt){mt&&typeof mt=="string"&&tt.set(Ye[mt],Ye)};function _e(Ie){for(var tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ye=0;Ye1&&arguments[1]!==void 0?arguments[1]:1,Dn=lt.length,bn=0;bn1&&arguments[1]!==void 0?arguments[1]:!1;nn(xt);var Dn={source:vt?"keyboard":"mouse"},bn=lt[xt];if(!bn){Ft(null,-1,Dn);return}Ft(bn.value,xt,Dn)};(0,B.useEffect)(function(){Vt(Ut!==!1?Nt(0):-1)},[lt.length,ke]);var an=B.useCallback(function(Yt){return oe.has(Yt)&&qe!=="combobox"},[qe,(0,P.Z)(oe).toString(),oe.size]);(0,B.useEffect)(function(){var Yt=setTimeout(function(){if(!ve&&Fe&&oe.size===1){var vt=Array.from(oe)[0],Dn=lt.findIndex(function(bn){var In=bn.data;return In.value===vt});Dn!==-1&&(Vt(Dn),_t(Dn))}});if(Fe){var xt;(xt=Et.current)===null||xt===void 0||xt.scrollTo(void 0)}return function(){return clearTimeout(Yt)}},[Fe,ke,mt.length]);var rn=function(xt){xt!==void 0&&rt(xt,{selected:!oe.has(xt)}),ve||_e(!1)};if(B.useImperativeHandle(X,function(){return{onKeyDown:function(xt){var vt=xt.which,Dn=xt.ctrlKey;switch(vt){case $.Z.N:case $.Z.P:case $.Z.UP:case $.Z.DOWN:{var bn=0;if(vt===$.Z.UP?bn=-1:vt===$.Z.DOWN?bn=1:kt()&&Dn&&(vt===$.Z.N?bn=1:vt===$.Z.P&&(bn=-1)),bn!==0){var In=Nt(pt+bn,bn);_t(In),Vt(In,!0)}break}case $.Z.ENTER:{var En=lt[pt];En&&!En.data.disabled?rn(En.value):rn(void 0),Fe&&xt.preventDefault();break}case $.Z.ESC:_e(!1),Fe&&xt.stopPropagation()}},onKeyUp:function(){},scrollTo:function(xt){_t(xt)}}}),lt.length===0)return B.createElement("div",{role:"listbox",id:"".concat(xe,"_list"),className:"".concat(Ve,"-empty"),onMouseDown:St},Ie);var cn=Object.keys(ce).map(function(Yt){return ce[Yt]}),Sn=function(xt){return xt.label};function $t(Yt,xt){var vt=Yt.group;return{role:vt?"presentation":"option",id:"".concat(xe,"_list_").concat(xt)}}var Rn=function(xt){var vt=lt[xt];if(!vt)return null;var Dn=vt.data||{},bn=Dn.value,In=vt.group,En=(0,G.Z)(Dn,!0),fn=Sn(vt);return vt?B.createElement("div",(0,R.Z)({"aria-label":typeof fn=="string"&&!In?fn:null},En,{key:xt},$t(vt,xt),{"aria-selected":an(bn)}),bn):null},Zn={role:"listbox",id:"".concat(xe,"_list")};return B.createElement(B.Fragment,null,be&&B.createElement("div",(0,R.Z)({},Zn,{style:{height:0,width:0,overflow:"hidden"}}),Rn(pt-1),Rn(pt),Rn(pt+1)),B.createElement(Mt.Z,{itemKey:"key",ref:Et,data:lt,height:Le,itemHeight:Ke,fullHeight:!1,onMouseDown:St,onScroll:tt,virtual:be,direction:Ne,innerProps:be?null:Zn},function(Yt,xt){var vt,Dn=Yt.group,bn=Yt.groupOption,In=Yt.data,En=Yt.label,fn=Yt.value,kn=In.key;if(Dn){var _n,Yn=(_n=In.title)!==null&&_n!==void 0?_n:It(En)?En.toString():void 0;return B.createElement("div",{className:k()(Ve,"".concat(Ve,"-group")),title:Yn},En!==void 0?En:kn)}var jt=In.disabled,Ct=In.title,Qt=In.children,xn=In.style,Hn=In.className,vr=(0,K.Z)(In,mn),Jn=(0,Cn.Z)(vr,cn),Fn=an(fn),ar="".concat(Ve,"-option"),Xn=k()(Ve,ar,Hn,(vt={},(0,W.Z)(vt,"".concat(ar,"-grouped"),bn),(0,W.Z)(vt,"".concat(ar,"-active"),pt===xt&&!jt),(0,W.Z)(vt,"".concat(ar,"-disabled"),jt),(0,W.Z)(vt,"".concat(ar,"-selected"),Fn),vt)),er=Sn(Yt),or=!ct||typeof ct=="function"||Fn,jn=typeof er=="number"?er:er||fn,sr=It(jn)?jn.toString():void 0;return Ct!==void 0&&(sr=Ct),B.createElement("div",(0,R.Z)({},(0,G.Z)(Jn),be?{}:$t(Yt,xt),{"aria-selected":Fn,className:Xn,title:sr,onMouseMove:function(){pt===xt||jt||Vt(xt)},onClick:function(){jt||rn(fn)},style:xn}),B.createElement("div",{className:"".concat(ar,"-content")},jn),B.isValidElement(ct)||Fn,or&&B.createElement(me,{className:"".concat(Ve,"-option-state"),customizeIcon:ct,customizeIconProps:{isSelected:Fn}},Fn?"\u2713":null))}))},An=B.forwardRef(en);An.displayName="OptionList";var gn=An;function Pn(x){var E=x.mode,X=x.options,Z=x.children,le=x.backfill,xe=x.allowClear,Fe=x.placeholder,ve=x.getInputElement,qe=x.showSearch,ke=x.onSearch,_e=x.defaultOpen,Ie=x.autoFocus,tt=x.labelInValue,Ye=x.value,mt=x.inputValue,Ft=x.optionLabelProp,Ut=isMultiple(E),rt=qe!==void 0?qe:Ut||E==="combobox",ct=X||convertChildrenToData(Z);if(warning(E!=="tags"||ct.every(function(Ne){return!Ne.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),E==="tags"||E==="combobox"){var oe=ct.some(function(Ne){return Ne.options?Ne.options.some(function(Le){return typeof("value"in Le?Le.value:Le.key)=="number"}):typeof("value"in Ne?Ne.value:Ne.key)=="number"});warning(!oe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(E!=="combobox"||!Ft,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(E==="combobox"||!le,"`backfill` only works with `combobox` mode."),warning(E==="combobox"||!ve,"`getInputElement` only work with `combobox` mode."),noteOnce(E!=="combobox"||!ve||!xe||!Fe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ke&&!rt&&E!=="combobox"&&E!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!_e||Ie,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ye!=null){var ce=toArray(Ye);warning(!tt||ce.every(function(Ne){return _typeof(Ne)==="object"&&("key"in Ne||"value"in Ne)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Ut||Array.isArray(Ye),"`value` should be array when `mode` is `multiple` or `tags`")}if(Z){var be=null;toNodeArray(Z).some(function(Ne){if(!React.isValidElement(Ne)||!Ne.type)return!1;var Le=Ne,Ke=Le.type;if(Ke.isSelectOption)return!1;if(Ke.isSelectOptGroup){var Ve=toNodeArray(Ne.props.children).every(function(lt){return!React.isValidElement(lt)||!Ne.type||lt.type.isSelectOption?!0:(be=lt.type,!1)});return!Ve}return be=Ke,!0}),be&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(be.displayName||be.name||be,"`.")),warning(mt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function On(x,E){if(x){var X=function Z(le){for(var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=0;Fe2&&arguments[2]!==void 0?arguments[2]:{},Tn=un.source,Nn=Tn===void 0?"keyboard":Tn;Zr(Ln),Fe&&Z==="combobox"&&sn!==null&&Nn==="keyboard"&&Lr(String(sn))},[Fe,Z]),Cr=function(Ln,un,Tn){var Nn=function(){var Rr,Zt=Hn(Ln);return[pt?{label:Zt==null?void 0:Zt[$t.label],value:Ln,key:(Rr=Zt==null?void 0:Zt.key)!==null&&Rr!==void 0?Rr:Ln}:Ln,ae(Zt)]};if(un&&Ye){var Un=Nn(),fr=(0,H.Z)(Un,2),rr=fr[0],ur=fr[1];Ye(rr,ur)}else if(!un&&mt&&Tn!=="clear"){var hr=Nn(),Qn=(0,H.Z)(hr,2),zn=Qn[0],yr=Qn[1];mt(zn,yr)}},Kr=Tt(function(sn,Ln){var un,Tn=rn?Ln.selected:!0;Tn?un=rn?[].concat((0,P.Z)(xn),[sn]):[sn]:un=xn.filter(function(Nn){return Nn.value!==sn}),sr(un),Cr(sn,Tn),Z==="combobox"?Lr(""):(!D||tt)&&(xt(""),Lr(""))}),zr=function(Ln,un){sr(Ln);var Tn=un.type,Nn=un.values;(Tn==="remove"||Tn==="clear")&&Nn.forEach(function(Un){Cr(Un.value,!1,Tn)})},Mr=function(Ln,un){if(xt(Ln),Lr(null),un.source==="submit"){var Tn=(Ln||"").trim();if(Tn){var Nn=Array.from(new Set([].concat((0,P.Z)(Jn),[Tn])));sr(Nn),Cr(Tn,!0),xt("")}return}un.source!=="blur"&&(Z==="combobox"&&sr(Ln),_e==null||_e(Ln))},Jr=function(Ln){var un=Ln;Z!=="tags"&&(un=Ln.map(function(Nn){var Un=bn.get(Nn);return Un==null?void 0:Un.value}).filter(function(Nn){return Nn!==void 0}));var Tn=Array.from(new Set([].concat((0,P.Z)(Jn),(0,P.Z)(un))));sr(Tn),Tn.forEach(function(Nn){Cr(Nn,!0)})},kr=B.useMemo(function(){var sn=Ve!==!1&&Ut!==!1;return(0,ee.Z)((0,ee.Z)({},vt),{},{flattenOptions:jn,onActiveValue:Br,defaultActiveFirstOption:Wr,onSelect:Kr,menuItemSelectedIcon:Ke,rawValues:Jn,fieldNames:$t,virtual:sn,direction:lt,listHeight:St,listItemHeight:Nt,childrenAsData:cn})},[vt,jn,Br,Wr,Kr,Ke,Jn,$t,Ve,Ut,St,Nt,cn]);return B.createElement(ht.Provider,{value:kr},B.createElement(ne,(0,R.Z)({},Vt,{id:an,prefixCls:xe,ref:E,omitDomProps:ut,mode:Z,displayValues:vr,onDisplayValuesChange:zr,direction:lt,searchValue:Yt,onSearch:Mr,autoClearSearchValue:tt,onSearchSplit:Jr,dropdownMatchSelectWidth:Ut,OptionList:gn,emptyOptions:!jn.length,activeValue:Tr,activeDescendantId:"".concat(an,"_list_").concat(wr)})))}),p=f;p.Option=ln,p.OptGroup=ot;var d=p,g=d},55477:function(Wt,nt,y){"use strict";y.d(nt,{G:function(){return m},Z:function(){return st}});var R=y(96663),P=y(44127),W=y(6620),ee=y(35593),H=y(59301),K={shiftX:64,adjustY:1},pe={adjustX:1,shiftY:!0},ue=[0,0],de={left:{points:["cr","cl"],overflow:pe,offset:[-4,0],targetOffset:ue},right:{points:["cl","cr"],overflow:pe,offset:[4,0],targetOffset:ue},top:{points:["bc","tc"],overflow:K,offset:[0,-4],targetOffset:ue},bottom:{points:["tc","bc"],overflow:K,offset:[0,4],targetOffset:ue},topLeft:{points:["bl","tl"],overflow:K,offset:[0,-4],targetOffset:ue},leftTop:{points:["tr","tl"],overflow:pe,offset:[-4,0],targetOffset:ue},topRight:{points:["br","tr"],overflow:K,offset:[0,-4],targetOffset:ue},rightTop:{points:["tl","tr"],overflow:pe,offset:[4,0],targetOffset:ue},bottomRight:{points:["tr","br"],overflow:K,offset:[0,4],targetOffset:ue},rightBottom:{points:["bl","br"],overflow:pe,offset:[4,0],targetOffset:ue},bottomLeft:{points:["tl","bl"],overflow:K,offset:[0,4],targetOffset:ue},leftBottom:{points:["br","bl"],overflow:pe,offset:[-4,0],targetOffset:ue}},B=null,je=y(92310),k=y.n(je);function m(me){var Q=me.children,se=me.prefixCls,te=me.id,b=me.overlayInnerStyle,C=me.className,z=me.style;return H.createElement("div",{className:k()("".concat(se,"-content"),C),style:z},H.createElement("div",{className:"".concat(se,"-inner"),id:te,role:"tooltip",style:b},typeof Q=="function"?Q():Q))}var J=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],$=function(Q,se){var te=Q.overlayClassName,b=Q.trigger,C=b===void 0?["hover"]:b,z=Q.mouseEnterDelay,G=z===void 0?0:z,Me=Q.mouseLeaveDelay,Ue=Me===void 0?.1:Me,Je=Q.overlayStyle,We=Q.prefixCls,ie=We===void 0?"rc-tooltip":We,Y=Q.children,fe=Q.onVisibleChange,O=Q.afterVisibleChange,Ae=Q.transitionName,Oe=Q.animation,ge=Q.motion,Be=Q.placement,it=Be===void 0?"right":Be,ye=Q.align,Te=ye===void 0?{}:ye,Pe=Q.destroyTooltipOnHide,Ce=Pe===void 0?!1:Pe,at=Q.defaultVisible,Ot=Q.getTooltipContainer,Pt=Q.overlayInnerStyle,Xt=Q.arrowContent,wt=Q.overlay,bt=Q.id,Ht=Q.showArrow,Jt=Ht===void 0?!0:Ht,Ee=(0,W.Z)(Q,J),yt=(0,H.useRef)(null);(0,H.useImperativeHandle)(se,function(){return yt.current});var F=(0,P.Z)({},Ee);"visible"in Q&&(F.popupVisible=Q.visible);var j=function(){return H.createElement(m,{key:"content",prefixCls:ie,id:bt,overlayInnerStyle:Pt},wt)};return H.createElement(ee.Z,(0,R.Z)({popupClassName:te,prefixCls:ie,popup:j,action:C,builtinPlacements:de,popupPlacement:it,ref:yt,popupAlign:Te,getPopupContainer:Ot,onPopupVisibleChange:fe,afterPopupVisibleChange:O,popupTransitionName:Ae,popupAnimation:Oe,popupMotion:ge,defaultPopupVisible:at,autoDestroy:Ce,mouseLeaveDelay:Ue,popupStyle:Je,mouseEnterDelay:G,arrow:Jt},F),Y)},ze=(0,H.forwardRef)($),st=ze},49658:function(Wt,nt){"use strict";nt.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var y=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(y)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(y==null?void 0:y.substr(0,4))}},24916:function(Wt,nt,y){"use strict";y.d(nt,{Z:function(){return Jt}});var R=y(96663),P=y(20135),W=y(44127),ee=y(90493),H=y(72071),K=y(6620),pe=y(92310),ue=y.n(pe),de=y(29301),B=y(70425),je=y(34280),k=y(59301),m=y(4676),J=k.forwardRef(function(Ee,yt){var F=Ee.height,j=Ee.offsetY,A=Ee.offsetX,N=Ee.children,V=Ee.prefixCls,ae=Ee.onInnerResize,S=Ee.innerProps,I=Ee.rtl,q=Ee.extra,D={},_={display:"flex",flexDirection:"column"};return j!==void 0&&(D={height:F,position:"relative",overflow:"hidden"},_=(0,W.Z)((0,W.Z)({},_),{},(0,ee.Z)((0,ee.Z)((0,ee.Z)((0,ee.Z)((0,ee.Z)({transform:"translateY(".concat(j,"px)")},I?"marginRight":"marginLeft",-A),"position","absolute"),"left",0),"right",0),"top",0))),k.createElement("div",{style:D},k.createElement(de.Z,{onResize:function(De){var Se=De.offsetHeight;Se&&ae&&ae()}},k.createElement("div",(0,R.Z)({style:_,className:ue()((0,ee.Z)({},"".concat(V,"-holder-inner"),V)),ref:yt},S),N,q)))});J.displayName="Filler";var $=J;function ze(Ee){var yt=Ee.children,F=Ee.setRef,j=k.useCallback(function(A){F(A)},[]);return k.cloneElement(yt,{ref:j})}function st(Ee,yt,F,j,A,N,V,ae){var S=ae.getKey;return Ee.slice(yt,F+1).map(function(I,q){var D=yt+q,_=V(I,D,{style:{width:j},offsetX:A}),ne=S(I);return k.createElement(ze,{key:ne,setRef:function(Se){return N(I,Se)}},_)})}function me(Ee,yt,F,j){var A=F-Ee,N=yt-F,V=Math.min(A,N)*2;if(j<=V){var ae=Math.floor(j/2);return j%2?F+ae+1:F-ae}return A>N?F-(j-N):F+(j-A)}function Q(Ee,yt,F){var j=Ee.length,A=yt.length,N,V;if(j===0&&A===0)return null;j2&&arguments[2]!==void 0?arguments[2]:!1,D=S?I<0&&ae.current.left||I>0&&ae.current.right:I<0&&ae.current.top||I>0&&ae.current.bottom;return q&&D?(clearTimeout(N.current),A.current=!1):(!D||A.current)&&V(),!A.current&&D}};function G(Ee,yt,F,j,A,N,V){var ae=(0,k.useRef)(0),S=(0,k.useRef)(null),I=(0,k.useRef)(null),q=(0,k.useRef)(!1),D=z(yt,F,j,A);function _(we,He){if(te.Z.cancel(S.current),!D(!1,He)){var ft=we;if(!ft._virtualHandled)ft._virtualHandled=!0;else return;ae.current+=He,I.current=He,C||ft.preventDefault(),S.current=(0,te.Z)(function(){var Xe=q.current?10:1;V(ae.current*Xe,!1),ae.current=0})}}function ne(we,He){V(He,!0),C||we.preventDefault()}var De=(0,k.useRef)(null),Se=(0,k.useRef)(null);function Qe(we){if(Ee){te.Z.cancel(Se.current),Se.current=(0,te.Z)(function(){De.current=null},2);var He=we.deltaX,ft=we.deltaY,Xe=we.shiftKey,he=He,Dt=ft;(De.current==="sx"||!De.current&&Xe&&ft&&!He)&&(he=ft,Dt=0,De.current="sx");var Tt=Math.abs(he),Kt=Math.abs(Dt);De.current===null&&(De.current=N&&Tt>Kt?"x":"y"),De.current==="y"?_(we,Dt):ne(we,he)}}function Re(we){Ee&&(q.current=we.detail===I.current)}return[Qe,Re]}function Me(Ee,yt,F,j){var A=k.useMemo(function(){return[new Map,[]]},[Ee,F.id,j]),N=(0,H.Z)(A,2),V=N[0],ae=N[1],S=function(q){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:q,_=V.get(q),ne=V.get(D);if(_===void 0||ne===void 0)for(var De=Ee.length,Se=ae.length;Se0&&arguments[0]!==void 0?arguments[0]:!1;q();var De=function(){var Re=!1;ae.current.forEach(function(we,He){if(we&&we.offsetParent){var ft=we.offsetHeight,Xe=getComputedStyle(we),he=Xe.marginTop,Dt=Xe.marginBottom,Tt=Y(he),Kt=Y(Dt),ot=ft+Tt+Kt;S.current.get(He)!==ot&&(S.current.set(He,ot),Re=!0)}}),Re&&V(function(we){return we+1})};if(ne)De();else{I.current+=1;var Se=I.current;Promise.resolve().then(function(){Se===I.current&&De()})}}function _(ne,De){var Se=Ee(ne),Qe=ae.current.get(Se);De?(ae.current.set(Se,De),D()):ae.current.delete(Se),!Qe!=!De&&(De?yt==null||yt(ne):F==null||F(ne))}return(0,k.useEffect)(function(){return q},[]),[_,D,S.current,N]}var O=14/15;function Ae(Ee,yt,F){var j=(0,k.useRef)(!1),A=(0,k.useRef)(0),N=(0,k.useRef)(0),V=(0,k.useRef)(null),ae=(0,k.useRef)(null),S,I=function(ne){if(j.current){var De=Math.ceil(ne.touches[0].pageX),Se=Math.ceil(ne.touches[0].pageY),Qe=A.current-De,Re=N.current-Se,we=Math.abs(Qe)>Math.abs(Re);we?A.current=De:N.current=Se;var He=F(we,we?Qe:Re,!1,ne);He&&ne.preventDefault(),clearInterval(ae.current),He&&(ae.current=setInterval(function(){we?Qe*=O:Re*=O;var ft=Math.floor(we?Qe:Re);(!F(we,ft,!0)||Math.abs(ft)<=.1)&&clearInterval(ae.current)},16))}},q=function(){j.current=!1,S()},D=function(ne){S(),ne.touches.length===1&&!j.current&&(j.current=!0,A.current=Math.ceil(ne.touches[0].pageX),N.current=Math.ceil(ne.touches[0].pageY),V.current=ne.target,V.current.addEventListener("touchmove",I,{passive:!1}),V.current.addEventListener("touchend",q,{passive:!0}))};S=function(){V.current&&(V.current.removeEventListener("touchmove",I),V.current.removeEventListener("touchend",q))},(0,je.Z)(function(){return Ee&&yt.current.addEventListener("touchstart",D,{passive:!0}),function(){var _;(_=yt.current)===null||_===void 0||_.removeEventListener("touchstart",D),S(),clearInterval(ae.current)}},[Ee])}function Oe(Ee){return Math.floor(Math.pow(Ee,.5))}function ge(Ee,yt){var F="touches"in Ee?Ee.touches[0]:Ee;return F[yt?"pageX":"pageY"]-window[yt?"scrollX":"scrollY"]}function Be(Ee,yt,F){k.useEffect(function(){var j=yt.current;if(Ee&&j){var A=!1,N,V,ae=function(){te.Z.cancel(N)},S=function _(){ae(),N=(0,te.Z)(function(){F(V),_()})},I=function(ne){if(!ne.target.draggable){var De=ne;De._virtualHandled||(De._virtualHandled=!0,A=!0)}},q=function(){A=!1,ae()},D=function(ne){if(A){var De=ge(ne,!1),Se=j.getBoundingClientRect(),Qe=Se.top,Re=Se.bottom;if(De<=Qe){var we=Qe-De;V=-Oe(we),S()}else if(De>=Re){var He=De-Re;V=Oe(He),S()}else ae()}};return j.addEventListener("mousedown",I),j.ownerDocument.addEventListener("mouseup",q),j.ownerDocument.addEventListener("mousemove",D),function(){j.removeEventListener("mousedown",I),j.ownerDocument.removeEventListener("mouseup",q),j.ownerDocument.removeEventListener("mousemove",D),ae()}}},[Ee])}var it=10;function ye(Ee,yt,F,j,A,N,V,ae){var S=k.useRef(),I=k.useState(null),q=(0,H.Z)(I,2),D=q[0],_=q[1];return(0,je.Z)(function(){if(D&&D.times=0;Cn-=1){var Mt=A(yt[Cn]),qt=F.get(Mt);if(qt===void 0){we=!0;break}if(yn-=qt,yn<=0)break}switch(Xe){case"top":ft=Dt-Qe;break;case"bottom":ft=Tt-Re+Qe;break;default:{var ht=Ee.current.scrollTop,kt=ht+Re;Dtkt&&(He="bottom")}}ft!==null&&V(ft),ft!==D.lastTop&&(we=!0)}we&&_((0,W.Z)((0,W.Z)({},D),{},{times:D.times+1,targetAlign:He,lastTop:ft}))}},[D,Ee.current]),function(ne){if(ne==null){ae();return}if(te.Z.cancel(S.current),typeof ne=="number")V(ne);else if(ne&&(0,P.Z)(ne)==="object"){var De,Se=ne.align;"index"in ne?De=ne.index:De=yt.findIndex(function(we){return A(we)===ne.key});var Qe=ne.offset,Re=Qe===void 0?0:Qe;_({times:0,index:De,offset:Re,originAlign:Se})}}}var Te=k.forwardRef(function(Ee,yt){var F=Ee.prefixCls,j=Ee.rtl,A=Ee.scrollOffset,N=Ee.scrollRange,V=Ee.onStartMove,ae=Ee.onStopMove,S=Ee.onScroll,I=Ee.horizontal,q=Ee.spinSize,D=Ee.containerSize,_=Ee.style,ne=Ee.thumbStyle,De=Ee.showScrollBar,Se=k.useState(!1),Qe=(0,H.Z)(Se,2),Re=Qe[0],we=Qe[1],He=k.useState(null),ft=(0,H.Z)(He,2),Xe=ft[0],he=ft[1],Dt=k.useState(null),Tt=(0,H.Z)(Dt,2),Kt=Tt[0],ot=Tt[1],on=!j,ln=k.useRef(),yn=k.useRef(),Cn=k.useState(De),Mt=(0,H.Z)(Cn,2),qt=Mt[0],ht=Mt[1],kt=k.useRef(),mn=function(){De===!0||De===!1||(clearTimeout(kt.current),ht(!0),kt.current=setTimeout(function(){ht(!1)},3e3))},It=N-D||0,en=D-q||0,An=k.useMemo(function(){if(A===0||It===0)return 0;var p=A/It;return p*en},[A,It,en]),gn=function(d){d.stopPropagation(),d.preventDefault()},Pn=k.useRef({top:An,dragging:Re,pageY:Xe,startTop:Kt});Pn.current={top:An,dragging:Re,pageY:Xe,startTop:Kt};var On=function(d){we(!0),he(ge(d,I)),ot(Pn.current.top),V(),d.stopPropagation(),d.preventDefault()};k.useEffect(function(){var p=function(E){E.preventDefault()},d=ln.current,g=yn.current;return d.addEventListener("touchstart",p,{passive:!1}),g.addEventListener("touchstart",On,{passive:!1}),function(){d.removeEventListener("touchstart",p),g.removeEventListener("touchstart",On)}},[]);var Mn=k.useRef();Mn.current=It;var nr=k.useRef();nr.current=en,k.useEffect(function(){if(Re){var p,d=function(E){var X=Pn.current,Z=X.dragging,le=X.pageY,xe=X.startTop;te.Z.cancel(p);var Fe=ln.current.getBoundingClientRect(),ve=D/(I?Fe.width:Fe.height);if(Z){var qe=(ge(E,I)-le)*ve,ke=xe;!on&&I?ke-=qe:ke+=qe;var _e=Mn.current,Ie=nr.current,tt=Ie?ke/Ie:0,Ye=Math.ceil(tt*_e);Ye=Math.max(Ye,0),Ye=Math.min(Ye,_e),p=(0,te.Z)(function(){S(Ye,I)})}},g=function(){we(!1),ae()};return window.addEventListener("mousemove",d,{passive:!0}),window.addEventListener("touchmove",d,{passive:!0}),window.addEventListener("mouseup",g,{passive:!0}),window.addEventListener("touchend",g,{passive:!0}),function(){window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",g),window.removeEventListener("touchend",g),te.Z.cancel(p)}}},[Re]),k.useEffect(function(){return mn(),function(){clearTimeout(kt.current)}},[A]),k.useImperativeHandle(yt,function(){return{delayHidden:mn}});var ut="".concat(F,"-scrollbar"),l={position:"absolute",visibility:qt?null:"hidden"},f={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return I?(l.height=8,l.left=0,l.right=0,l.bottom=0,f.height="100%",f.width=q,on?f.left=An:f.right=An):(l.width=8,l.top=0,l.bottom=0,on?l.right=0:l.left=0,f.width="100%",f.height=q,f.top=An),k.createElement("div",{ref:ln,className:ue()(ut,(0,ee.Z)((0,ee.Z)((0,ee.Z)({},"".concat(ut,"-horizontal"),I),"".concat(ut,"-vertical"),!I),"".concat(ut,"-visible"),qt)),style:(0,W.Z)((0,W.Z)({},l),_),onMouseDown:gn,onMouseMove:mn},k.createElement("div",{ref:yn,className:ue()("".concat(ut,"-thumb"),(0,ee.Z)({},"".concat(ut,"-thumb-moving"),Re)),style:(0,W.Z)((0,W.Z)({},f),ne),onMouseDown:On}))}),Pe=Te,Ce=20;function at(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,F=Ee/yt*Ee;return isNaN(F)&&(F=0),F=Math.max(F,Ce),Math.floor(F)}var Ot=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],Pt=[],Xt={overflowY:"auto",overflowAnchor:"none"};function wt(Ee,yt){var F=Ee.prefixCls,j=F===void 0?"rc-virtual-list":F,A=Ee.className,N=Ee.height,V=Ee.itemHeight,ae=Ee.fullHeight,S=ae===void 0?!0:ae,I=Ee.style,q=Ee.data,D=Ee.children,_=Ee.itemKey,ne=Ee.virtual,De=Ee.direction,Se=Ee.scrollWidth,Qe=Ee.component,Re=Qe===void 0?"div":Qe,we=Ee.onScroll,He=Ee.onVirtualScroll,ft=Ee.onVisibleChange,Xe=Ee.innerProps,he=Ee.extraRender,Dt=Ee.styles,Tt=Ee.showScrollBar,Kt=Tt===void 0?"optional":Tt,ot=(0,K.Z)(Ee,Ot),on=k.useCallback(function(jt){return typeof _=="function"?_(jt):jt==null?void 0:jt[_]},[_]),ln=fe(on,null,null),yn=(0,H.Z)(ln,4),Cn=yn[0],Mt=yn[1],qt=yn[2],ht=yn[3],kt=!!(ne!==!1&&N&&V),mn=k.useMemo(function(){return Object.values(qt.maps).reduce(function(jt,Ct){return jt+Ct},0)},[qt.id,qt.maps]),It=kt&&q&&(Math.max(V*q.length,mn)>N||!!Se),en=De==="rtl",An=ue()(j,(0,ee.Z)({},"".concat(j,"-rtl"),en),A),gn=q||Pt,Pn=(0,k.useRef)(),On=(0,k.useRef)(),Mn=(0,k.useRef)(),nr=(0,k.useState)(0),ut=(0,H.Z)(nr,2),l=ut[0],f=ut[1],p=(0,k.useState)(0),d=(0,H.Z)(p,2),g=d[0],x=d[1],E=(0,k.useState)(!1),X=(0,H.Z)(E,2),Z=X[0],le=X[1],xe=function(){le(!0)},Fe=function(){le(!1)},ve={getKey:on};function qe(jt){f(function(Ct){var Qt;typeof jt=="function"?Qt=jt(Ct):Qt=jt;var xn=Nt(Qt);return Pn.current.scrollTop=xn,xn})}var ke=(0,k.useRef)({start:0,end:gn.length}),_e=(0,k.useRef)(),Ie=se(gn,on),tt=(0,H.Z)(Ie,1),Ye=tt[0];_e.current=Ye;var mt=k.useMemo(function(){if(!kt)return{scrollHeight:void 0,start:0,end:gn.length-1,offset:void 0};if(!It){var jt;return{scrollHeight:((jt=On.current)===null||jt===void 0?void 0:jt.offsetHeight)||0,start:0,end:gn.length-1,offset:void 0}}for(var Ct=0,Qt,xn,Hn,vr=gn.length,Jn=0;Jn=l&&Qt===void 0&&(Qt=Jn,xn=Ct),er>l+N&&Hn===void 0&&(Hn=Jn),Ct=er}return Qt===void 0&&(Qt=0,xn=0,Hn=Math.ceil(N/V)),Hn===void 0&&(Hn=gn.length-1),Hn=Math.min(Hn+1,gn.length-1),{scrollHeight:Ct,start:Qt,end:Hn,offset:xn}},[It,kt,l,gn,ht,N]),Ft=mt.scrollHeight,Ut=mt.start,rt=mt.end,ct=mt.offset;ke.current.start=Ut,ke.current.end=rt,k.useLayoutEffect(function(){var jt=qt.getRecord();if(jt.size===1){var Ct=Array.from(jt)[0],Qt=gn[Ut];if(Qt){var xn=on(Qt);if(xn===Ct){var Hn=qt.get(Ct),vr=Hn-V;qe(function(Jn){return Jn+vr})}}}qt.resetRecord()},[Ft]);var oe=k.useState({width:0,height:N}),ce=(0,H.Z)(oe,2),be=ce[0],Ne=ce[1],Le=function(Ct){Ne({width:Ct.offsetWidth,height:Ct.offsetHeight})},Ke=(0,k.useRef)(),Ve=(0,k.useRef)(),lt=k.useMemo(function(){return at(be.width,Se)},[be.width,Se]),Et=k.useMemo(function(){return at(be.height,Ft)},[be.height,Ft]),St=Ft-N,_t=(0,k.useRef)(St);_t.current=St;function Nt(jt){var Ct=jt;return Number.isNaN(_t.current)||(Ct=Math.min(Ct,_t.current)),Ct=Math.max(Ct,0),Ct}var tn=l<=0,Bt=l>=St,pt=g<=0,nn=g>=Se,Vt=z(tn,Bt,pt,nn),an=function(){return{x:en?-g:g,y:l}},rn=(0,k.useRef)(an()),cn=(0,B.useEvent)(function(jt){if(He){var Ct=(0,W.Z)((0,W.Z)({},an()),jt);(rn.current.x!==Ct.x||rn.current.y!==Ct.y)&&(He(Ct),rn.current=Ct)}});function Sn(jt,Ct){var Qt=jt;Ct?((0,m.flushSync)(function(){x(Qt)}),cn()):qe(Qt)}function $t(jt){var Ct=jt.currentTarget.scrollTop;Ct!==l&&qe(Ct),we==null||we(jt),cn()}var Rn=function(Ct){var Qt=Ct,xn=Se?Se-be.width:0;return Qt=Math.max(Qt,0),Qt=Math.min(Qt,xn),Qt},Zn=(0,B.useEvent)(function(jt,Ct){Ct?((0,m.flushSync)(function(){x(function(Qt){var xn=Qt+(en?-jt:jt);return Rn(xn)})}),cn()):qe(function(Qt){var xn=Qt+jt;return xn})}),Yt=G(kt,tn,Bt,pt,nn,!!Se,Zn),xt=(0,H.Z)(Yt,2),vt=xt[0],Dn=xt[1];Ae(kt,Pn,function(jt,Ct,Qt,xn){var Hn=xn;return Vt(jt,Ct,Qt)?!1:!Hn||!Hn._virtualHandled?(Hn&&(Hn._virtualHandled=!0),vt({preventDefault:function(){},deltaX:jt?Ct:0,deltaY:jt?0:Ct}),!0):!1}),Be(It,Pn,function(jt){qe(function(Ct){return Ct+jt})}),(0,je.Z)(function(){function jt(Qt){var xn=tn&&Qt.detail<0,Hn=Bt&&Qt.detail>0;kt&&!xn&&!Hn&&Qt.preventDefault()}var Ct=Pn.current;return Ct.addEventListener("wheel",vt,{passive:!1}),Ct.addEventListener("DOMMouseScroll",Dn,{passive:!0}),Ct.addEventListener("MozMousePixelScroll",jt,{passive:!1}),function(){Ct.removeEventListener("wheel",vt),Ct.removeEventListener("DOMMouseScroll",Dn),Ct.removeEventListener("MozMousePixelScroll",jt)}},[kt,tn,Bt]),(0,je.Z)(function(){if(Se){var jt=Rn(g);x(jt),cn({x:jt})}},[be.width,Se]);var bn=function(){var Ct,Qt;(Ct=Ke.current)===null||Ct===void 0||Ct.delayHidden(),(Qt=Ve.current)===null||Qt===void 0||Qt.delayHidden()},In=ye(Pn,gn,qt,V,on,function(){return Mt(!0)},qe,bn);k.useImperativeHandle(yt,function(){return{nativeElement:Mn.current,getScrollInfo:an,scrollTo:function(Ct){function Qt(xn){return xn&&(0,P.Z)(xn)==="object"&&("left"in xn||"top"in xn)}Qt(Ct)?(Ct.left!==void 0&&x(Rn(Ct.left)),In(Ct.top)):In(Ct)}}}),(0,je.Z)(function(){if(ft){var jt=gn.slice(Ut,rt+1);ft(jt,gn)}},[Ut,rt,gn]);var En=Me(gn,on,qt,V),fn=he==null?void 0:he({start:Ut,end:rt,virtual:It,offsetX:g,offsetY:ct,rtl:en,getSize:En}),kn=st(gn,Ut,rt,Se,g,Cn,D,ve),_n=null;N&&(_n=(0,W.Z)((0,ee.Z)({},S?"height":"maxHeight",N),Xt),kt&&(_n.overflowY="hidden",Se&&(_n.overflowX="hidden"),Z&&(_n.pointerEvents="none")));var Yn={};return en&&(Yn.dir="rtl"),k.createElement("div",(0,R.Z)({ref:Mn,style:(0,W.Z)((0,W.Z)({},I),{},{position:"relative"}),className:An},Yn,ot),k.createElement(de.Z,{onResize:Le},k.createElement(Re,{className:"".concat(j,"-holder"),style:_n,ref:Pn,onScroll:$t,onMouseEnter:bn},k.createElement($,{prefixCls:j,height:Ft,offsetX:g,offsetY:ct,scrollWidth:Se,onInnerResize:Mt,ref:On,innerProps:Xe,rtl:en,extra:fn},kn))),It&&Ft>N&&k.createElement(Pe,{ref:Ke,prefixCls:j,scrollOffset:l,scrollRange:Ft,rtl:en,onScroll:Sn,onStartMove:xe,onStopMove:Fe,spinSize:Et,containerSize:be.height,style:Dt==null?void 0:Dt.verticalScrollBar,thumbStyle:Dt==null?void 0:Dt.verticalScrollBarThumb,showScrollBar:Kt}),It&&Se>be.width&&k.createElement(Pe,{ref:Ve,prefixCls:j,scrollOffset:g,scrollRange:Se,rtl:en,onScroll:Sn,onStartMove:xe,onStopMove:Fe,spinSize:lt,containerSize:be.width,horizontal:!0,style:Dt==null?void 0:Dt.horizontalScrollBar,thumbStyle:Dt==null?void 0:Dt.horizontalScrollBarThumb,showScrollBar:Kt}))}var bt=k.forwardRef(wt);bt.displayName="List";var Ht=bt,Jt=Ht},83145:function(Wt,nt,y){"use strict";Object.defineProperty(nt,"__esModule",{value:!0}),nt.CopyToClipboard=void 0;var R=W(y(59301)),P=W(y(25769));function W(Q){return Q&&Q.__esModule?Q:{default:Q}}function ee(Q){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ee=function(te){return typeof te}:ee=function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},ee(Q)}function H(Q,se){var te=Object.keys(Q);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(Q);se&&(b=b.filter(function(C){return Object.getOwnPropertyDescriptor(Q,C).enumerable})),te.push.apply(te,b)}return te}function K(Q){for(var se=1;se=0)&&Object.prototype.propertyIsEnumerable.call(Q,b)&&(te[b]=Q[b])}return te}function ue(Q,se){if(Q==null)return{};var te={},b=Object.keys(Q),C,z;for(z=0;z=0)&&(te[C]=Q[C]);return te}function de(Q,se){if(!(Q instanceof se))throw new TypeError("Cannot call a class as a function")}function B(Q,se){for(var te=0;te0},ie.prototype.connect_=function(){!P||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),de?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},ie.prototype.disconnect_=function(){!P||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},ie.prototype.onTransitionEnd_=function(Y){var fe=Y.propertyName,O=fe===void 0?"":fe,Ae=ue.some(function(Oe){return!!~O.indexOf(Oe)});Ae&&this.refresh()},ie.getInstance=function(){return this.instance_||(this.instance_=new ie),this.instance_},ie.instance_=null,ie}(),je=function(ie,Y){for(var fe=0,O=Object.keys(Y);fe0},ie}(),Ue=typeof WeakMap!="undefined"?new WeakMap:new R,Je=function(){function ie(Y){if(!(this instanceof ie))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var fe=B.getInstance(),O=new Me(Y,fe,this);Ue.set(this,O)}return ie}();["observe","unobserve","disconnect"].forEach(function(ie){Je.prototype[ie]=function(){var Y;return(Y=Ue.get(this))[ie].apply(Y,arguments)}});var We=function(){return typeof W.ResizeObserver!="undefined"?W.ResizeObserver:Je}();nt.Z=We},98040:function(Wt){Wt.exports=function(){var nt=document.getSelection();if(!nt.rangeCount)return function(){};for(var y=document.activeElement,R=[],P=0;P`):ze}function se(a,...e){e.forEach(function(t){me[t]=a[t]?a[t].bind(a):Q(t)})}function te(a,e){if(typeof console=="object"&&a===!0||typeof a=="object"){se(a,"debug","log","info","warn","error");try{me.log(`Debug logs enabled for "${e}" in hls.js version 1.5.20`)}catch(t){me=st}}else me=st}const b=me,C=/^(\d+)x(\d+)$/,z=/(.+?)=(".*?"|.*?)(?:,|$)/g;class G{constructor(e){typeof e=="string"&&(e=G.parseAttrList(e)),de(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const n=new Uint8Array(t.length/2);for(let r=0;rNumber.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=C.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const n={},r='"';for(z.lastIndex=0;(t=z.exec(e))!==null;){let i=t[2];i.indexOf(r)===0&&i.lastIndexOf(r)===i.length-1&&(i=i.slice(1,-1));const s=t[1].trim();n[s]=i}return n}}function Me(a){return a!=="ID"&&a!=="CLASS"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function Ue(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"}class Je{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 r in n)if(Object.prototype.hasOwnProperty.call(e,r)&&e[r]!==n[r]){b.warn(`DATERANGE tag attribute: "${r}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=r;break}e=de(new G({}),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"]);B(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(B(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&&B(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class We{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 ie={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Y{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[ie.AUDIO]:null,[ie.VIDEO]:null,[ie.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const n=e.split("@",2);let r;n.length===1?r=(t==null?void 0:t.byteRangeEndOffset)||0:r=parseInt(n[1]),this._byteRange=[r,parseInt(n[0])+r]}get 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=W.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class fe extends Y{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 We,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||!B(this.programDateTime))return null;const e=B(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,r,i,s=!1){const{elementaryStreams:o}=this,c=o[e];if(!c){o[e]={startPTS:t,endPTS:n,startDTS:r,endDTS:i,partial:s};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,n),c.startDTS=Math.min(c.startDTS,r),c.endDTS=Math.max(c.endDTS,i)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[ie.AUDIO]=null,e[ie.VIDEO]=null,e[ie.AUDIOVIDEO]=null}}class O extends Y{constructor(e,t,n,r,i){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new We,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=r;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,i),i&&(this.fragOffset=i.fragOffset+i.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const Ae=10;class Oe{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?B(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Ae}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 ge(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function Be(a){const e=Te(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function it(a){const e=function(n,r,i){const s=n[r];n[r]=n[i],n[i]=s};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function ye(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),r=n[n.length-1].split(",");if(r.length===2){const i=r[0]==="base64",s=r[1];i?(n.splice(-1,1),t=ge(s)):t=Be(s)}}return t}function Te(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}const Pe=typeof self!="undefined"?self:void 0;var Ce={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},at={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Ot(a){switch(a){case at.FAIRPLAY:return Ce.FAIRPLAY;case at.PLAYREADY:return Ce.PLAYREADY;case at.WIDEVINE:return Ce.WIDEVINE;case at.CLEARKEY:return Ce.CLEARKEY}}var Pt={CENC:"1077efecc0b24d02ace33c1e52e2fb4b",CLEARKEY:"e2719d58a985b3c9781ab030af78d30e",FAIRPLAY:"94ce86fb07ff4f43adb893d2fa968ca2",PLAYREADY:"9a04f07998404286ab92e65be0885f95",WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function Xt(a){if(a===Pt.WIDEVINE)return Ce.WIDEVINE;if(a===Pt.PLAYREADY)return Ce.PLAYREADY;if(a===Pt.CENC||a===Pt.CLEARKEY)return Ce.CLEARKEY}function wt(a){switch(a){case Ce.FAIRPLAY:return at.FAIRPLAY;case Ce.PLAYREADY:return at.PLAYREADY;case Ce.WIDEVINE:return at.WIDEVINE;case Ce.CLEARKEY:return at.CLEARKEY}}function bt(a){const{drmSystems:e,widevineLicenseUrl:t}=a,n=e?[Ce.FAIRPLAY,Ce.WIDEVINE,Ce.PLAYREADY,Ce.CLEARKEY].filter(r=>!!e[r]):[];return!n[Ce.WIDEVINE]&&t&&n.push(Ce.WIDEVINE),n}const Ht=function(a){return Pe!=null&&(a=Pe.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function Jt(a,e,t,n){let r;switch(a){case Ce.FAIRPLAY:r=["cenc","sinf"];break;case Ce.WIDEVINE:case Ce.PLAYREADY:r=["cenc"];break;case Ce.CLEARKEY:r=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Ee(r,e,t,n)}function Ee(a,e,t,n){return[{initDataTypes:a,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(i=>({contentType:`audio/mp4; codecs="${i}"`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:t.map(i=>({contentType:`video/mp4; codecs="${i}"`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function yt(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),n=t.substring(t.indexOf("<"),t.length),s=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(s){const o=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(o){const c=ge(o).subarray(0,16);return it(c),c}}return null}function F(a,e,t){return Uint8Array.prototype.slice?a.slice(e,t):new Uint8Array(Array.prototype.slice.call(a,e,t))}const j=(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,A=(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,N=(a,e)=>{const t=e;let n=0;for(;j(a,e);){n+=10;const r=V(a,e+6);n+=r,A(a,e+10)&&(n+=10),e+=n}if(n>0)return a.subarray(t,t+n)},V=(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},ae=(a,e)=>j(a,e)&&V(a,e+6)+10<=a.length-e,S=a=>{const e=D(a);for(let t=0;ta&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp",q=a=>{const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=V(a,4),n=10;return{type:e,size:t,data:a.subarray(n,n+t)}},D=a=>{let e=0;const t=[];for(;j(a,e);){const n=V(a,e+6);e+=10;const r=e+n;for(;e+8a.type==="PRIV"?ne(a):a.type[0]==="W"?Se(a):De(a),ne=a=>{if(a.size<2)return;const e=Re(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}},De=a=>{if(a.size<2)return;if(a.type==="TXXX"){let t=1;const n=Re(a.data.subarray(t),!0);t+=n.length+1;const r=Re(a.data.subarray(t));return{key:a.type,info:n,data:r}}const e=Re(a.data.subarray(1));return{key:a.type,data:e}},Se=a=>{if(a.type==="WXXX"){if(a.size<2)return;let t=1;const n=Re(a.data.subarray(t),!0);t+=n.length+1;const r=Re(a.data.subarray(t));return{key:a.type,info:n,data:r}}const e=Re(a.data);return{key:a.type,data:e}},Qe=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)}},Re=(a,e=!1)=>{const t=He();if(t){const u=t.decode(a);if(e){const h=u.indexOf("\0");return h!==-1?u.substring(0,h):u}return u.replace(/\0/g,"")}const n=a.length;let r,i,s,o="",c=0;for(;c>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(r);break;case 12:case 13:i=a[c++],o+=String.fromCharCode((r&31)<<6|i&63);break;case 14:i=a[c++],s=a[c++],o+=String.fromCharCode((r&15)<<12|(i&63)<<6|(s&63)<<0);break}}return o};let we;function He(){if(!navigator.userAgent.includes("PlayStation 4"))return!we&&typeof self.TextDecoder!="undefined"&&(we=new self.TextDecoder("utf-8")),we}const ft={hexDump:function(a){let e="";for(let t=0;t>24,a[e+1]=t>>16&255,a[e+2]=t>>8&255,a[e+3]=t&255}function Cn(a){const e=a.byteLength;for(let t=0;t8&&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 Mt(a,e){const t=[];if(!e.length)return t;const n=a.byteLength;for(let r=0;r1?r+i:n;if(s===e[0])if(e.length===1)t.push(a.subarray(r+8,o));else{const c=Mt(a.subarray(r+8,o),e.slice(1));c.length&&he.apply(t,c)}r=o}return t}function qt(a){const e=[],t=a[0];let n=8;const r=ot(a,n);n+=4;let i=0,s=0;t===0?(i=ot(a,n),s=ot(a,n+4),n+=8):(i=on(a,n),s=on(a,n+8),n+=16),n+=2;let o=a.length+s;const c=Kt(a,n);n+=2;for(let u=0;u>>31===1)return b.warn("SIDX has hierarchical references (not supported)"),null;const L=ot(a,h);h+=4,e.push({referenceSize:T,subsegmentDuration:L,info:{duration:L/r,start:o,end:o+T-1}}),o+=T,h+=4,n=h}return{earliestPresentationTime:i,timescale:r,version:t,referencesCount:c,references:e}}function ht(a){const e=[],t=Mt(a,["moov","trak"]);for(let r=0;r{const i=ot(r,4),s=e[i];s&&(s.default={duration:ot(r,12),flags:ot(r,20)})}),e}function kt(a){const e=a.subarray(8),t=e.subarray(86),n=Tt(e.subarray(4,8));let r=n;const i=n==="enca"||n==="encv";if(i){const o=Mt(e,[n])[0].subarray(n==="enca"?28:78);Mt(o,["sinf"]).forEach(u=>{const h=Mt(u,["schm"])[0];if(h){const v=Tt(h.subarray(4,8));if(v==="cbcs"||v==="cenc"){const T=Mt(u,["frma"])[0];T&&(r=Tt(T))}}})}switch(r){case"avc1":case"avc2":case"avc3":case"avc4":{const s=Mt(t,["avcC"])[0];r+="."+It(s[1])+It(s[2])+It(s[3]);break}case"mp4a":{const s=Mt(e,[n])[0],o=Mt(s.subarray(28),["esds"])[0];if(o&&o.length>12){let c=4;if(o[c++]!==3)break;c=mn(o,c),c+=2;const u=o[c++];if(u&128&&(c+=2),u&64&&(c+=o[c++]),o[c++]!==4)break;c=mn(o,c);const h=o[c++];if(h===64)r+="."+It(h);else break;if(c+=12,o[c++]!==5)break;c=mn(o,c);const v=o[c++];let T=(v&248)>>3;T===31&&(T+=1+((v&7)<<3)+((o[c]&224)>>5)),r+="."+T}break}case"hvc1":case"hev1":{const s=Mt(t,["hvcC"])[0],o=s[1],c=["","A","B","C"][o>>6],u=o&31,h=ot(s,2),v=(o&32)>>5?"H":"L",T=s[12],w=s.subarray(6,12);r+="."+c+u,r+="."+h.toString(16).toUpperCase(),r+="."+v+T;let L="";for(let M=w.length;M--;){const U=w[M];(U||L)&&(L="."+U.toString(16).toUpperCase()+L)}r+=L;break}case"dvh1":case"dvhe":{const s=Mt(t,["dvcC"])[0],o=s[2]>>1&127,c=s[2]<<5&32|s[3]>>3&31;r+="."+en(o)+"."+en(c);break}case"vp09":{const s=Mt(t,["vpcC"])[0],o=s[4],c=s[5],u=s[6]>>4&15;r+="."+en(o)+"."+en(c)+"."+en(u);break}case"av01":{const s=Mt(t,["av1C"])[0],o=s[1]>>>5,c=s[1]&31,u=s[2]>>>7?"H":"M",h=(s[2]&64)>>6,v=(s[2]&32)>>5,T=o===2&&h?v?12:10:h?10:8,w=(s[2]&16)>>4,L=(s[2]&8)>>3,M=(s[2]&4)>>2,U=s[2]&3;r+="."+o+"."+en(c)+u+"."+en(T)+"."+w+"."+L+M+U+"."+en(1)+"."+en(1)+"."+en(1)+"."+0;break}}return{codec:r,encrypted:i}}function mn(a,e){const t=e+5;for(;a[e++]&128&&e{const s=Mt(r,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=Mt(s,["enca"]);const c=o.length>0;c||(o=Mt(s,["encv"])),o.forEach(u=>{const h=c?u.subarray(28):u.subarray(78);Mt(h,["sinf"]).forEach(T=>{const w=gn(T);if(w){const L=w.subarray(8,24);L.some(M=>M!==0)||(b.log(`[eme] Patching keyId in 'enc${c?"a":"v"}>sinf>>tenc' box: ${ft.hexDump(L)} -> ${ft.hexDump(t)}`),w.set(t,8))}})})}),a}function gn(a){const e=Mt(a,["schm"])[0];if(e){const t=Tt(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return Mt(a,["schi","tenc"])[0]}return null}function Pn(a,e){return Mt(e,["moof","traf"]).reduce((t,n)=>{const r=Mt(n,["tfdt"])[0],i=r[0],s=Mt(n,["tfhd"]).reduce((o,c)=>{const u=ot(c,4),h=a[u];if(h){let v=ot(r,4);if(i===1){if(v===Xe)return b.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),o;v*=Xe+1,v+=ot(r,8)}const T=h.timescale||9e4,w=v/T;if(B(w)&&(o===null||ww+L.info.duration||0,0);o=Math.max(o,T+v.earliestPresentationTime/v.timescale),c=o-s}}if(c&&B(c))return c}return n||r}function Mn(a){const e=ot(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let n=0;const r=ot(a,4);for(let i=0;i{Mt(n,["tfhd"]).forEach(r=>{const i=ot(r,4),s=a[i];if(!s)return;const o=s.timescale||9e4;Mt(n,["tfdt"]).forEach(c=>{const u=c[0],h=t*o;if(h){let v=ot(c,4);if(u===0)v-=h,v=Math.max(v,0),yn(c,4,v);else{v*=Math.pow(2,32),v+=ot(c,8),v-=h,v=Math.max(v,0);const T=Math.floor(v/(Xe+1)),w=Math.floor(v%(Xe+1));yn(c,4,T),yn(c,8,w)}}})})})}function ut(a){const e={valid:null,remainder:null},t=Mt(a,["moof"]);if(t.length<2)return e.remainder=a,e;const n=t[t.length-1];return e.valid=F(a,0,n.byteOffset-8),e.remainder=F(a,n.byteOffset-8),e}function l(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function f(a,e){const t=[],n=e.samples,r=e.timescale,i=e.id;let s=!1;return Mt(n,["moof"]).map(c=>{const u=c.byteOffset-8;Mt(c,["traf"]).map(v=>{const T=Mt(v,["tfdt"]).map(w=>{const L=w[0];let M=ot(w,4);return L===1&&(M*=Math.pow(2,32),M+=ot(w,8)),M/r})[0];return T!==void 0&&(a=T),Mt(v,["tfhd"]).map(w=>{const L=ot(w,4),M=ot(w,0)&16777215,U=(M&1)!==0,re=(M&2)!==0,Ze=(M&8)!==0;let Ge=0;const gt=(M&16)!==0;let $e=0;const Lt=(M&32)!==0;let dt=8;L===i&&(U&&(dt+=8),re&&(dt+=4),Ze&&(Ge=ot(w,dt),dt+=4),gt&&($e=ot(w,dt),dt+=4),Lt&&(dt+=4),e.type==="video"&&(s=p(e.codec)),Mt(v,["trun"]).map(zt=>{const dn=zt[0],At=ot(zt,0)&16777215,Gt=(At&1)!==0;let $n=0;const pn=(At&4)!==0,Wn=(At&256)!==0;let Vn=0;const Gn=(At&512)!==0;let dr=0;const Ar=(At&1024)!==0,wn=(At&2048)!==0;let vn=0;const pr=ot(zt,4);let tr=8;Gt&&($n=ot(zt,tr),tr+=4),pn&&(tr+=4);let br=$n+u;for(let Ur=0;Ur>1&63;return t===39||t===40}else return(e&31)===6}function g(a,e,t,n){const r=x(a);let i=0;i+=e;let s=0,o=0,c=0;for(;i=r.length)break;c=r[i++],s+=c}while(c===255);o=0;do{if(i>=r.length)break;c=r[i++],o+=c}while(c===255);const u=r.length-i;let h=i;if(ou){b.error(`Malformed SEI payload. ${o} is too small, only ${u} bytes left to parse.`);break}if(s===4){if(r[h++]===181){const T=Kt(r,h);if(h+=2,T===49){const w=ot(r,h);if(h+=4,w===1195456820){const L=r[h++];if(L===3){const M=r[h++],U=31&M,re=64&M,Ze=re?2+U*3:0,Ge=new Uint8Array(Ze);if(re){Ge[0]=M;for(let gt=1;gt16){const v=[];for(let L=0;L<16;L++){const M=r[h++].toString(16);v.push(M.length==1?"0"+M:M),(L===3||L===5||L===7||L===9)&&v.push("-")}const T=o-16,w=new Uint8Array(T);for(let L=0;L>24&255,i[1]=n>>16&255,i[2]=n>>8&255,i[3]=n&255,i.set(a,4),r=0,n=8;r0?(i=new Uint8Array(4),e.length>0&&new DataView(i.buffer).setUint32(0,e.length,!1)):i=new Uint8Array;const s=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(s.buffer).setUint32(0,t.byteLength,!1),X([112,115,115,104],new Uint8Array([n,0,0,0]),a,i,r,s,t||new Uint8Array)}function le(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let n=0;for(;n+32>>24;if(i!==0&&i!==1)return{offset:t,size:e};const s=a.buffer,o=ft.hexDump(new Uint8Array(s,t+12,16)),c=a.getUint32(28);let u=null,h=null;if(i===0){if(e-32=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case at.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Z(n,null,t),this.keyId=yt(t);break}default:{let n=t.subarray(0,16);if(n.length!==16){const r=new Uint8Array(16);r.set(n,16-n.length),n=r}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n=Fe[this.uri];if(!n){const r=Object.keys(Fe).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,r),Fe[this.uri]=n}this.keyId=n}return this}}function qe(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const ke=/\{\$([a-zA-Z0-9-_]+)\}/g;function _e(a){return ke.test(a)}function Ie(a,e,t){if(a.variableList!==null||a.hasVariableRefs)for(let n=t.length;n--;){const r=t[n],i=e[r];i&&(e[r]=tt(a,i))}}function tt(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(ke,n=>{const r=n.substring(2,n.length-1),i=t==null?void 0:t[r];return i===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),n):i})}return e}function Ye(a,e,t){let n=a.variableList;n||(a.variableList=n={});let r,i;if("QUERYPARAM"in e){r=e.QUERYPARAM;try{const s=new self.URL(t).searchParams;if(s.has(r))i=s.get(r);else throw new Error(`"${r}" does not match any query parameter in URI: "${t}"`)}catch(s){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${s.message}`))}}else r=e.NAME,i=e.VALUE;r in n?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):n[r]=i||""}function mt(a,e,t){const n=e.IMPORT;if(t&&n in t){let r=a.variableList;r||(a.variableList=r={}),r[n]=t[n]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}function Ft(a=!0){return typeof self=="undefined"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Ut(a){return typeof self!="undefined"&&a===self.ManagedMediaSource}const rt={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 ct(a,e){const t=rt[e];return!!t&&!!t[a.slice(0,4)]}function oe(a,e,t=!0){return!a.split(",").some(n=>!ce(n,e,t))}function ce(a,e,t=!0){var n;const r=Ft(t);return(n=r==null?void 0:r.isTypeSupported(be(a,e)))!=null?n:!1}function be(a,e){return`${e}/mp4;codecs="${a}"`}function Ne(a){if(a){const e=a.substring(0,4);return rt.video[e]}return 2}function Le(a){return a.split(",").reduce((e,t)=>{const n=rt.video[t];return n?(n*2+e)/(e?3:2):(rt.audio[t]+e)/(e?2:1)},0)}const Ke={};function Ve(a,e=!0){if(Ke[a])return Ke[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[a];for(let n=0;nVe(t.toLowerCase(),e))}function St(a,e){return a&&a!=="mp4a"?a:e&&e.split(",")[0]}function _t(a){const e=a.split(",");for(let t=0;t2){let r=n.shift()+".";r+=parseInt(n.shift()).toString(16),r+=("000"+parseInt(n.shift()).toString(16)).slice(-4),e[t]=r}}return e.join(",")}const Nt=/#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,tn=/#EXT-X-MEDIA:(.*)/g,Bt=/^#EXT(?:INF|-X-TARGETDURATION):/m,pt=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"),nn=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 Vt{static findGroup(e,t){for(let n=0;n0&&i.length({id:u.attrs.AUDIO,audioCodec:u.audioCodec})),SUBTITLES:s.map(u=>({id:u.attrs.SUBTITLES,textCodec:u.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(tn.lastIndex=0;(r=tn.exec(e))!==null;){const u=new G(r[1]),h=u.TYPE;if(h){const v=o[h],T=i[h]||[];i[h]=T,Ie(n,u,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const w=u.LANGUAGE,L=u["ASSOC-LANGUAGE"],M=u.CHANNELS,U=u.CHARACTERISTICS,re=u["INSTREAM-ID"],Ze={attrs:u,bitrate:0,id:c++,groupId:u["GROUP-ID"]||"",name:u.NAME||w||"",type:h,default:u.bool("DEFAULT"),autoselect:u.bool("AUTOSELECT"),forced:u.bool("FORCED"),lang:w,url:u.URI?Vt.resolve(u.URI,t):""};if(L&&(Ze.assocLang=L),M&&(Ze.channels=M),U&&(Ze.characteristics=U),re&&(Ze.instreamId=re),v!=null&&v.length){const Ge=Vt.findGroup(v,Ze.groupId)||v[0];Sn(Ze,Ge,"audioCodec"),Sn(Ze,Ge,"textCodec")}T.push(Ze)}}return i}static parseLevelPlaylist(e,t,n,r,i,s){const o=new Oe(t),c=o.fragments;let u=null,h=0,v=0,T=0,w=0,L=null,M=new fe(r,t),U,re,Ze,Ge=-1,gt=!1,$e=null;for(pt.lastIndex=0,o.m3u8=e,o.hasVariableRefs=_e(e);(U=pt.exec(e))!==null;){gt&&(gt=!1,M=new fe(r,t),M.start=T,M.sn=h,M.cc=w,M.level=n,u&&(M.initSegment=u,M.rawProgramDateTime=u.rawProgramDateTime,u.rawProgramDateTime=null,$e&&(M.setByteRange($e),$e=null)));const dn=U[1];if(dn){M.duration=parseFloat(dn);const At=(" "+U[2]).slice(1);M.title=At||null,M.tagList.push(At?["INF",dn,At]:["INF",dn])}else if(U[3]){if(B(M.duration)){M.start=T,Ze&&Yt(M,Ze,o),M.sn=h,M.level=n,M.cc=w,c.push(M);const At=(" "+U[3]).slice(1);M.relurl=tt(o,At),Rn(M,L),L=M,T+=M.duration,h++,v=0,gt=!0}}else if(U[4]){const At=(" "+U[4]).slice(1);L?M.setByteRange(At,L):M.setByteRange(At)}else if(U[5])M.rawProgramDateTime=(" "+U[5]).slice(1),M.tagList.push(["PROGRAM-DATE-TIME",M.rawProgramDateTime]),Ge===-1&&(Ge=c.length);else{if(U=U[0].match(nn),!U){b.warn("No matches on slow regex match for level playlist!");continue}for(re=1;re0&&pn.bool("CAN-SKIP-DATERANGES"),o.partHoldBack=pn.optionalFloat("PART-HOLD-BACK",0),o.holdBack=pn.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const pn=new G(Gt);o.partTarget=pn.decimalFloatingPoint("PART-TARGET");break}case"PART":{let pn=o.partList;pn||(pn=o.partList=[]);const Wn=v>0?pn[pn.length-1]:void 0,Vn=v++,Gn=new G(Gt);Ie(o,Gn,["BYTERANGE","URI"]);const dr=new O(Gn,M,t,Vn,Wn);pn.push(dr),M.duration+=dr.duration;break}case"PRELOAD-HINT":{const pn=new G(Gt);Ie(o,pn,["URI"]),o.preloadHint=pn;break}case"RENDITION-REPORT":{const pn=new G(Gt);Ie(o,pn,["URI"]),o.renditionReports=o.renditionReports||[],o.renditionReports.push(pn);break}default:b.warn(`line parsed but not handled: ${U}`);break}}}L&&!L.relurl?(c.pop(),T-=L.duration,o.partList&&(o.fragmentHint=L)):o.partList&&(Rn(M,L),M.cc=w,o.fragmentHint=M,Ze&&Yt(M,Ze,o));const Lt=c.length,dt=c[0],zt=c[Lt-1];if(T+=o.skippedSegments*o.targetduration,T>0&&Lt&&zt){o.averagetargetduration=T/Lt;const dn=zt.sn;o.endSN=dn!=="initSegment"?dn:0,o.live||(zt.endList=!0),dt&&(o.startCC=dt.cc)}else o.endSN=0,o.startCC=0;return o.fragmentHint&&(T+=o.fragmentHint.duration),o.totalduration=T,o.endCC=w,Ge>0&&$t(c,Ge),o}}function an(a,e,t){var n,r;const i=new G(a);Ie(t,i,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const s=(n=i.METHOD)!=null?n:"",o=i.URI,c=i.hexadecimalInteger("IV"),u=i.KEYFORMATVERSIONS,h=(r=i.KEYFORMAT)!=null?r:"identity";o&&i.IV&&!c&&b.error(`Invalid IV: ${i.IV}`);const v=o?Vt.resolve(o,e):"",T=(u||"1").split("/").map(Number).filter(Number.isFinite);return new ve(s,v,h,T,c)}function rn(a){const t=new G(a).decimalFloatingPoint("TIME-OFFSET");return B(t)?t:null}function cn(a,e){let t=(a||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const r=t.filter(i=>ct(i,n));r.length&&(e[`${n}Codec`]=r.join(","),t=t.filter(i=>r.indexOf(i)===-1))}),e.unknownCodecs=t}function Sn(a,e,t){const n=e[t];n&&(a[t]=n)}function $t(a,e){let t=a[e];for(let n=e;n--;){const r=a[n];if(!r)return;r.programDateTime=t.programDateTime-r.duration*1e3,t=r}}function Rn(a,e){a.rawProgramDateTime?a.programDateTime=Date.parse(a.rawProgramDateTime):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime),B(a.programDateTime)||(a.programDateTime=null,a.rawProgramDateTime=null)}function Zn(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 Yt(a,e,t){a.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(r=>e[r].isCommonEncryption)&&n.push(a)}var xt={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},vt={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Dn(a){const{type:e}=a;switch(e){case xt.AUDIO_TRACK:return vt.AUDIO;case xt.SUBTITLE_TRACK:return vt.SUBTITLE;default:return vt.MAIN}}function bn(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class In{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(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(m.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_LOADING,this.onLevelLoading,this),e.off(m.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(m.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,r=t.loader,i=n||r,s=new i(t);return this.loaders[e.type]=s,s}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:xt.MANIFEST,url:n,deliveryDirectives:null})}onLevelLoading(e,t){const{id:n,level:r,pathwayId:i,url:s,deliveryDirectives:o}=t;this.load({id:n,level:r,pathwayId:i,responseType:"text",type:xt.LEVEL,url:s,deliveryDirectives:o})}onAudioTrackLoading(e,t){const{id:n,groupId:r,url:i,deliveryDirectives:s}=t;this.load({id:n,groupId:r,level:null,responseType:"text",type:xt.AUDIO_TRACK,url:i,deliveryDirectives:s})}onSubtitleTrackLoading(e,t){const{id:n,groupId:r,url:i,deliveryDirectives:s}=t;this.load({id:n,groupId:r,level:null,responseType:"text",type:xt.SUBTITLE_TRACK,url:i,deliveryDirectives:s})}load(e){var t;const n=this.hls.config;let r=this.getInternalLoader(e);if(r){const u=r.context;if(u&&u.url===e.url&&u.level===e.level){b.trace("[playlist-loader]: playlist request ongoing");return}b.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),r.abort()}let i;if(e.type===xt.MANIFEST?i=n.manifestLoadPolicy.default:i=de({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),r=this.createInternalLoader(e),B((t=e.deliveryDirectives)==null?void 0:t.part)){let u;if(e.type===xt.LEVEL&&e.level!==null?u=this.hls.levels[e.level].details:e.type===xt.AUDIO_TRACK&&e.id!==null?u=this.hls.audioTracks[e.id].details:e.type===xt.SUBTITLE_TRACK&&e.id!==null&&(u=this.hls.subtitleTracks[e.id].details),u){const h=u.partTarget,v=u.targetduration;if(h&&v){const T=Math.max(h*3,v*.8)*1e3;i=de({},i,{maxTimeToFirstByteMs:Math.min(T,i.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(T,i.maxTimeToFirstByteMs)})}}}const s=i.errorRetry||i.timeoutRetry||{},o={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},c={onSuccess:(u,h,v,T)=>{const w=this.getInternalLoader(v);this.resetInternalLoader(v.type);const L=u.data;if(L.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,v,new Error("no EXTM3U delimiter"),T||null,h);return}h.parsing.start=performance.now(),Vt.isMediaPlaylist(L)?this.handleTrackOrLevelPlaylist(u,h,v,T||null,w):this.handleMasterPlaylist(u,h,v,T)},onError:(u,h,v,T)=>{this.handleNetworkError(h,v,!1,u,T)},onTimeout:(u,h,v)=>{this.handleNetworkError(h,v,!0,void 0,u)}};r.load(e,o,c)}handleMasterPlaylist(e,t,n,r){const i=this.hls,s=e.data,o=bn(e,n),c=Vt.parseMasterPlaylist(s,o);if(c.playlistParsingError){this.handleManifestParsingError(e,n,c.playlistParsingError,r,t);return}const{contentSteering:u,levels:h,sessionData:v,sessionKeys:T,startTimeOffset:w,variableList:L}=c;this.variableList=L;const{AUDIO:M=[],SUBTITLES:U,"CLOSED-CAPTIONS":re}=Vt.parseMasterPlaylistMedia(s,o,c);M.length&&!M.some(Ge=>!Ge.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(b.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),M.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new G({}),bitrate:0,url:""})),i.trigger(m.MANIFEST_LOADED,{levels:h,audioTracks:M,subtitles:U,captions:re,contentSteering:u,url:o,stats:t,networkDetails:r,sessionData:v,sessionKeys:T,startTimeOffset:w,variableList:L})}handleTrackOrLevelPlaylist(e,t,n,r,i){const s=this.hls,{id:o,level:c,type:u}=n,h=bn(e,n),v=0,T=B(c)?c:B(o)?o:0,w=Dn(n),L=Vt.parseLevelPlaylist(e.data,h,T,w,v,this.variableList);if(u===xt.MANIFEST){const M={attrs:new G({}),bitrate:0,details:L,name:"",url:h};s.trigger(m.MANIFEST_LOADED,{levels:[M],audioTracks:[],url:h,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=L,this.handlePlaylistLoaded(L,e,t,n,r,i)}handleManifestParsingError(e,t,n,r,i){this.hls.trigger(m.ERROR,{type:J.NETWORK_ERROR,details:$.MANIFEST_PARSING_ERROR,fatal:t.type===xt.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:r,stats:i})}handleNetworkError(e,t,n=!1,r,i){let s=`A network ${n?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${e.type}`;e.type===xt.LEVEL?s+=`: ${e.level} id: ${e.id}`:(e.type===xt.AUDIO_TRACK||e.type===xt.SUBTITLE_TRACK)&&(s+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(s);b.warn(`[playlist-loader]: ${s}`);let c=$.UNKNOWN,u=!1;const h=this.getInternalLoader(e);switch(e.type){case xt.MANIFEST:c=n?$.MANIFEST_LOAD_TIMEOUT:$.MANIFEST_LOAD_ERROR,u=!0;break;case xt.LEVEL:c=n?$.LEVEL_LOAD_TIMEOUT:$.LEVEL_LOAD_ERROR,u=!1;break;case xt.AUDIO_TRACK:c=n?$.AUDIO_TRACK_LOAD_TIMEOUT:$.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case xt.SUBTITLE_TRACK:c=n?$.SUBTITLE_TRACK_LOAD_TIMEOUT:$.SUBTITLE_LOAD_ERROR,u=!1;break}h&&this.resetInternalLoader(e.type);const v={type:J.NETWORK_ERROR,details:c,fatal:u,url:e.url,loader:h,context:e,error:o,networkDetails:t,stats:i};if(r){const T=(t==null?void 0:t.url)||e.url;v.response=H({url:T,data:void 0},r)}this.hls.trigger(m.ERROR,v)}handlePlaylistLoaded(e,t,n,r,i,s){const o=this.hls,{type:c,level:u,id:h,groupId:v,deliveryDirectives:T}=r,w=bn(t,r),L=Dn(r),M=typeof r.level=="number"&&L===vt.MAIN?u:void 0;if(!e.fragments.length){const re=new Error("No Segments found in Playlist");o.trigger(m.ERROR,{type:J.NETWORK_ERROR,details:$.LEVEL_EMPTY_ERROR,fatal:!1,url:w,error:re,reason:re.message,response:t,context:r,level:M,parent:L,networkDetails:i,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const U=e.playlistParsingError;if(U){o.trigger(m.ERROR,{type:J.NETWORK_ERROR,details:$.LEVEL_PARSING_ERROR,fatal:!1,url:w,error:U,reason:U.message,response:t,context:r,level:M,parent:L,networkDetails:i,stats:n});return}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),(!s.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case xt.MANIFEST:case xt.LEVEL:o.trigger(m.LEVEL_LOADED,{details:e,level:M||0,id:h||0,stats:n,networkDetails:i,deliveryDirectives:T});break;case xt.AUDIO_TRACK:o.trigger(m.AUDIO_TRACK_LOADED,{details:e,id:h||0,groupId:v||"",stats:n,networkDetails:i,deliveryDirectives:T});break;case xt.SUBTITLE_TRACK:o.trigger(m.SUBTITLE_TRACK_LOADED,{details:e,id:h||0,groupId:v||"",stats:n,networkDetails:i,deliveryDirectives:T});break}}}function En(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 fn(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){b.debug(`[texttrack-utils]: ${n}`);try{const r=new self.TextTrackCue(e.startTime,e.endTime,e.text);r.id=e.id,a.addCue(r)}catch(r){b.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${r}`)}}t==="disabled"&&(a.mode=t)}function kn(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 _n(a,e,t,n){const r=a.mode;if(r==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const i=jt(a.cues,e,t);for(let s=0;sa[t].endTime)return-1;let n=0,r=t;for(;n<=r;){const i=Math.floor((r+n)/2);if(ea[i].startTime&&n-1)for(let i=r,s=a.length;i=e&&o.endTime<=t)n.push(o);else if(o.startTime>t)return n}return n}function Ct(a){const e=[];for(let t=0;t{const a=Hn();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Fn(a,e){return a.getTime()/1e3-e}function ar(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class Xn{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(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(kn(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;tJn&&(v=Jn),v-h<=0&&(v=h+xn);for(let w=0;wh.type===Qt.audioId3&&c:r==="video"?u=h=>h.type===Qt.emsg&&o:u=h=>h.type===Qt.audioId3&&c||h.type===Qt.emsg&&o,_n(i,t,n,u)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:n,id3Track:r}=this,{dateRanges:i}=t,s=Object.keys(i);if(r){const h=Object.keys(n).filter(v=>!s.includes(v));for(let v=h.length;v--;){const T=h[v];Object.keys(n[T].cues).forEach(w=>{r.removeCue(n[T].cues[w])}),delete n[T]}}const o=t.fragments[t.fragments.length-1];if(s.length===0||!B(o==null?void 0:o.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const c=o.programDateTime/1e3-o.start,u=Hn();for(let h=0;h{if(Lt!==T.id){const dt=i[Lt];if(dt.class===T.class&&dt.startDate>T.startDate&&(!$e||T.startDate<$e.startDate))return dt}return $e},null);gt&&(re=Fn(gt.startDate,c),U=!0)}const Ge=Object.keys(T.attr);for(let gt=0;gtthis.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:r}=e,{liveSyncDuration:i,liveSyncDurationCount:s,lowLatencyMode:o}=this.config,c=this.hls.userConfig;let u=o&&n||t;(c.liveSyncDuration||c.liveSyncDurationCount||u===0)&&(u=i!==void 0?i:s*r);const h=r;return u+Math.min(this.stallCount*1,h)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,n=this.levelDetails;if(e===null||t===null||n===null)return null;const r=n.edge,i=e-t-this.edgeStalled,s=r-n.totalduration,o=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,i),o)}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(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(m.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(m.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===$.BUFFER_STALLED_ERROR&&(this.stallCount++,(n=this.levelDetails)!=null&&n.live&&b.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:r,maxLiveSyncPlaybackRate:i}=this.config;if(!r||i===1||!t.live)return;const s=this.targetLatency;if(s===null)return;const o=n-s,c=Math.min(this.maxLatency,s+t.targetduration);if(o.05&&this.forwardBufferLength>1){const h=Math.min(2,Math.max(1,i)),v=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;e.playbackRate=Math.min(h,Math.max(1,v))}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 or=["NONE","TYPE-0","TYPE-1",null];function jn(a){return or.indexOf(a)>-1}const sr=["SDR","PQ","HLG"];function Er(a){return!!a&&sr.indexOf(a)>-1}var xr={No:"",Yes:"YES",v2:"v2"};function Tr(a){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=a,r=n!!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 Nr(this._audioGroups,e)}hasSubtitleGroup(e){return Nr(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 Nr(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function wr(a,e){const t=e.startPTS;if(B(t)){let n=0,r;e.sn>a.sn?(n=t-a.start,r=a):(n=a.start-t,r=e),r.duration!==n&&(r.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 Zr(a,e,t,n,r,i){n-t<=0&&(b.warn("Fragment should have a positive duration",e),n=t+e.duration,i=r+e.duration);let o=t,c=n;const u=e.startPTS,h=e.endPTS;if(B(u)){const U=Math.abs(u-t);B(e.deltaPTS)?e.deltaPTS=Math.max(U,e.deltaPTS):e.deltaPTS=U,o=Math.max(t,u),t=Math.min(t,u),r=Math.min(r,e.startDTS),c=Math.min(n,h),n=Math.max(n,h),i=Math.max(i,e.endDTS)}const v=t-e.start;e.start!==0&&(e.start=t),e.duration=n-e.start,e.startPTS=t,e.maxStartPTS=o,e.startDTS=r,e.endPTS=n,e.minEndPTS=c,e.endDTS=i;const T=e.sn;if(!a||Ta.endSN)return 0;let w;const L=T-a.startSN,M=a.fragments;for(M[L]=e,w=L;w>0;w--)wr(M[w],M[w-1]);for(w=L;w=0;o--){const c=n[o].initSegment;if(c){t=c;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let r;Kr(a,e,(o,c,u,h)=>{if(e.skippedSegments&&c.cc!==o.cc){const v=o.cc-c.cc;for(let T=u;T{var u;c&&(!c.initSegment||c.initSegment.relurl===((u=t)==null?void 0:u.relurl))&&(c.initSegment=t)}),e.skippedSegments){if(e.deltaUpdateFailed=i.some(o=>!o),e.deltaUpdateFailed){b.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let o=e.skippedSegments;o--;)i.shift();e.startSN=i[0].sn}else e.canSkipDateRanges&&(e.dateRanges=Br(a.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));e.startCC=e.fragments[0].cc,e.endCC=i[i.length-1].cc}Cr(a.partList,e.partList,(o,c)=>{c.elementaryStreams=o.elementaryStreams,c.stats=o.stats}),r?Zr(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS):zr(a,e),i.length&&(e.totalduration=e.edge-i[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const s=e.advancedDateTime;if(e.advanced&&s){const o=e.edge;e.driftStart||(e.driftStartTime=s,e.driftStart=o),e.driftEndTime=s,e.driftEnd=o}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime}function Br(a,e,t){const n=de({},a);return t&&t.forEach(r=>{delete n[r]}),Object.keys(e).forEach(r=>{const i=new Je(e[r].attr,n[r]);i.isValid?n[r]=i:b.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[r].attr)}"`)}),n}function Cr(a,e,t){if(a&&e){let n=0;for(let r=0,i=a.length;r<=i;r++){const s=a[r],o=e[r+n];s&&o&&s.index===o.index&&s.fragment.sn===o.fragment.sn?t(s,o):n--}}}function Kr(a,e,t){const n=e.skippedSegments,r=Math.max(a.startSN,e.startSN)-e.startSN,i=(a.fragmentHint?1:0)+(n?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,s=e.startSN-a.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let u=r;u<=i;u++){const h=c[s+u];let v=o[u];n&&!v&&u=n.length||Mr(e,n[t].start)}function Mr(a,e){if(e){const t=a.fragments;for(let n=a.skippedSegments;ne){const i=n[n.length-1].duration*1e3;i{const{details:n}=e;n!=null&&n.fragments&&n.fragments.forEach(r=>{r.level=t})})}function Tn(a){switch(a.details){case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_TIMEOUT:case $.LEVEL_LOAD_TIMEOUT:case $.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Nn(a,e){const t=Tn(e);return a.default[`${t?"timeout":"error"}Retry`]}function Un(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function fr(a){return H(H({},a),{errorRetry:null,timeoutRetry:null})}function rr(a,e,t,n){if(!a)return!1;const r=n==null?void 0:n.code,i=e499)}const hr={search:function(a,e){let t=0,n=a.length-1,r=null,i=null;for(;t<=n;){r=(t+n)/2|0,i=a[r];const s=e(i);if(s>0)t=r+1;else if(s<0)n=r-1;else return i}return null}};function Qn(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!B(e))return null;const n=a[0].programDateTime;if(e<(n||0))return null;const r=a[a.length-1].endProgramDateTime;if(e>=(r||0))return null;t=t||0;for(let i=0;i0&&o<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(i=e[0]);if(i&&((!a||a.level===i.level)&&Sr(t,n,i)===0||yr(i,a,Math.min(r,n))))return i;const s=hr.search(e,Sr.bind(null,t,n));return s&&(s!==a||!i)?s:i}function yr(a,e,t){if(e&&e.start===0&&e.level0){const n=e.tagList.reduce((r,i)=>(i[0]==="INF"&&(r+=parseFloat(i[1])),r),t);return a.start<=n}return!1}function Sr(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 Rr(a,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>a}function Zt(a,e){return hr.search(a,t=>t.cce?-1:0)}var hn={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Kn={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Dr{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=b.log.bind(b,"[info]:"),this.warn=b.warn.bind(b,"[warning]:"),this.error=b.error.bind(b,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(m.ERROR,this.onError,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(m.ERROR,this.onError,this),e.off(m.ERROR,this.onErrorOut,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.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)===vt.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n,r;if(t.fatal)return;const i=this.hls,s=t.context;switch(t.details){case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case $.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction={action:hn.DoNothing,flags:Kn.None};return}case $.FRAG_GAP:case $.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=hn.SendAlternateToPenaltyBox;return}case $.LEVEL_EMPTY_ERROR:case $.LEVEL_PARSING_ERROR:{var o,c;const u=t.parent===vt.MAIN?t.level:i.loadLevel;t.details===$.LEVEL_EMPTY_ERROR&&((o=t.context)!=null&&(c=o.levelDetails)!=null&&c.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,u):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,u))}return;case $.LEVEL_LOAD_ERROR:case $.LEVEL_LOAD_TIMEOUT:typeof(s==null?void 0:s.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.level));return;case $.AUDIO_TRACK_LOAD_ERROR:case $.AUDIO_TRACK_LOAD_TIMEOUT:case $.SUBTITLE_LOAD_ERROR:case $.SUBTITLE_TRACK_LOAD_TIMEOUT:if(s){const u=i.levels[i.loadLevel];if(u&&(s.type===xt.AUDIO_TRACK&&u.hasAudioGroup(s.groupId)||s.type===xt.SUBTITLE_TRACK&&u.hasSubtitleGroup(s.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=hn.SendAlternateToPenaltyBox,t.errorAction.flags=Kn.MoveAllAlternatesMatchingHost;return}}return;case $.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const u=i.levels[i.loadLevel],h=u==null?void 0:u.attrs["HDCP-LEVEL"];h?t.errorAction={action:hn.SendAlternateToPenaltyBox,flags:Kn.MoveAllAlternatesMatchingHDCP,hdcpLevel:h}:this.keySystemError(t)}return;case $.BUFFER_ADD_CODEC_ERROR:case $.REMUX_ALLOC_ERROR:case $.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(r=t.level)!=null?r:i.loadLevel);return;case $.INTERNAL_EXCEPTION:case $.BUFFER_APPENDING_ERROR:case $.BUFFER_FULL_ERROR:case $.LEVEL_SWITCH_ERROR:case $.BUFFER_STALLED_ERROR:case $.BUFFER_SEEK_OVER_HOLE:case $.BUFFER_NUDGE_ON_STALL:t.errorAction={action:hn.DoNothing,flags:Kn.None};return}t.type===J.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,r=Nn(n.config.playlistLoadPolicy,e),i=this.playlistError++;if(rr(r,i,Tn(e),e.response))return{action:hn.RetryRequest,flags:Kn.None,retryConfig:r,retryCount:i};const o=this.getLevelSwitchAction(e,t);return r&&(o.retryConfig=r,o.retryCount=i),o}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),r=t.levels[n],{fragLoadPolicy:i,keyLoadPolicy:s}=t.config,o=Nn(e.details.startsWith("key")?s:i,e),c=t.levels.reduce((h,v)=>h+v.fragmentError,0);if(r&&(e.details!==$.FRAG_GAP&&r.fragmentError++,rr(o,c,Tn(e),e.response)))return{action:hn.RetryRequest,flags:Kn.None,retryConfig:o,retryCount:c};const u=this.getLevelSwitchAction(e,n);return o&&(u.retryConfig=o,u.retryCount=c),u}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const r=this.hls.levels[t];if(r){var i,s;const u=e.details;r.loadError++,u===$.BUFFER_APPEND_ERROR&&r.fragmentError++;let h=-1;const{levels:v,loadLevel:T,minAutoLevel:w,maxAutoLevel:L}=n;n.autoLevelEnabled||(n.loadLevel=-1);const M=(i=e.frag)==null?void 0:i.type,re=(M===vt.AUDIO&&u===$.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(u===$.BUFFER_ADD_CODEC_ERROR||u===$.BUFFER_APPEND_ERROR))&&v.some(({audioCodec:Lt})=>r.audioCodec!==Lt),Ge=e.sourceBufferName==="video"&&(u===$.BUFFER_ADD_CODEC_ERROR||u===$.BUFFER_APPEND_ERROR)&&v.some(({codecSet:Lt,audioCodec:dt})=>r.codecSet!==Lt&&r.audioCodec===dt),{type:gt,groupId:$e}=(s=e.context)!=null?s:{};for(let Lt=v.length;Lt--;){const dt=(Lt+T)%v.length;if(dt!==T&&dt>=w&&dt<=L&&v[dt].loadError===0){var o,c;const zt=v[dt];if(u===$.FRAG_GAP&&M===vt.MAIN&&e.frag){const dn=v[dt].details;if(dn){const At=zn(e.frag,dn.fragments,e.frag.start);if(At!=null&&At.gap)continue}}else{if(gt===xt.AUDIO_TRACK&&zt.hasAudioGroup($e)||gt===xt.SUBTITLE_TRACK&&zt.hasSubtitleGroup($e))continue;if(M===vt.AUDIO&&(o=r.audioGroups)!=null&&o.some(dn=>zt.hasAudioGroup(dn))||M===vt.SUBTITLE&&(c=r.subtitleGroups)!=null&&c.some(dn=>zt.hasSubtitleGroup(dn))||re&&r.audioCodec===zt.audioCodec||!re&&r.audioCodec!==zt.audioCodec||Ge&&r.codecSet===zt.codecSet)continue}h=dt;break}}if(h>-1&&n.loadLevel!==h)return e.levelRetry=!0,this.playlistError=0,{action:hn.SendAlternateToPenaltyBox,flags:Kn.None,nextAutoLevel:h}}return{action:hn.SendAlternateToPenaltyBox,flags:Kn.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case hn.DoNothing:break;case hn.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==$.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break;case hn.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:r,hdcpLevel:i,nextAutoLevel:s}=n;switch(r){case Kn.None:this.switchLevel(e,s);break;case Kn.MoveAllAlternatesMatchingHDCP:i&&(t.maxHdcpLevel=or[or.indexOf(i)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}n.resolved||this.switchLevel(e,s)}switchLevel(e,t){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 ir{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=b.log.bind(b,`${t}:`),this.warn=b.warn.bind(b,`${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 r=t==null?void 0:t.renditionReports;if(r){let i=-1;for(let s=0;s=0&&h>t.partTarget&&(c+=1)}const u=n&&Tr(n);return new Lr(o,c>=0?c:void 0,u)}}}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:r,stats:i}=t,s=self.performance.now(),o=i.loading.first?Math.max(0,s-i.loading.first):0;if(r.advancedDateTime=Date.now()-o,r.live||n!=null&&n.live){if(r.reloaded(n),n&&this.log(`live playlist ${e} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:r.updated?"UPDATED":"MISSED"}`),n&&r.fragments.length>0&&Wr(n,r),!this.canLoad||!r.live)return;let c,u,h;if(r.canBlockReload&&r.endSN&&r.advanced){const U=this.hls.config.lowLatencyMode,re=r.lastPartSn,Ze=r.endSN,Ge=r.lastPartIndex,gt=Ge!==-1,$e=re===Ze,Lt=U?0:Ge;gt?(u=$e?Ze+1:re,h=$e?Lt:Ge+1):u=Ze+1;const dt=r.age,zt=dt+r.ageHeader;let dn=Math.min(zt-r.partTarget,r.targetduration*1.5);if(dn>0){if(n&&dn>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${dn} with playlist age: ${r.age}`),dn=0;else{const At=Math.floor(dn/r.targetduration);if(u+=At,h!==void 0){const Gt=Math.round(dn%r.targetduration/r.partTarget);h+=Gt}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${dt.toFixed(2)}s goal: ${dn} skip sn ${At} to part ${h}`)}r.tuneInGoal=dn}if(c=this.getDeliveryDirectives(r,t.deliveryDirectives,u,h),U||!$e){this.loadPlaylist(c);return}}else(r.canBlockReload||r.canSkipUntil)&&(c=this.getDeliveryDirectives(r,t.deliveryDirectives,u,h));const v=this.hls.mainForwardBufferInfo,T=v?v.end-v.len:0,w=(r.edge-T)*1e3,L=Jr(r,w);r.updated&&s>this.requestScheduled+L&&(this.requestScheduled=i.loading.start),u!==void 0&&r.canBlockReload?this.requestScheduled=i.loading.first+L-(r.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+Lthis.loadPlaylist(c),M)}else this.clearTimer()}getDeliveryDirectives(e,t,n,r){let i=Tr(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,r=t.part,i=xr.No),new Lr(n,r,i)}checkRetry(e){const t=e.details,n=Tn(e),r=e.errorAction,{action:i,retryCount:s=0,retryConfig:o}=r||{},c=!!r&&!!o&&(i===hn.RetryRequest||!r.resolved&&i===hn.SendAlternateToPenaltyBox);if(c){var u;if(this.requestScheduled=-1,s>=o.maxNumRetry)return!1;if(n&&(u=e.context)!=null&&u.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const h=Un(o,s);this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn(`Retrying playlist loading ${s+1}/${o.maxNumRetry} after "${t}" in ${h}ms`)}e.levelRetry=!0,r.resolved=!0}return c}}class qr{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 mi{constructor(e,t,n,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new qr(e),this.fast_=new qr(t),this.defaultTTFB_=r,this.ttfb_=new qr(e)}update(e,t){const{slow_:n,fast_:r,ttfb_:i}=this;n.halfLife!==e&&(this.slow_=new qr(e,n.getEstimate(),n.getTotalWeight())),r.halfLife!==t&&(this.fast_=new qr(t,r.getEstimate(),r.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new qr(e,i.getEstimate(),i.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,r=e/1e3,i=n/r;this.fast_.sample(r,i),this.slow_.sample(r,i)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const di={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},si={};function zi(a,e,t,n,r,i){const s=a.audioCodec?a.audioGroups:null,o=i==null?void 0:i.audioCodec,c=i==null?void 0:i.channels,u=c?parseInt(c):o?1/0:2;let h=null;if(s!=null&&s.length)try{s.length===1&&s[0]?h=e.groups[s[0]].channels:h=s.reduce((v,T)=>{if(T){const w=e.groups[T];if(!w)throw new Error(`Audio track group ${T} not found`);Object.keys(w.channels).forEach(L=>{v[L]=(v[L]||0)+w.channels[L]})}return v},{2:0})}catch(v){return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(n,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(r,8e6))||!!h&&B(u)&&Object.keys(h).some(v=>parseInt(v)>u)}function Ii(a,e,t){const n=a.videoCodec,r=a.audioCodec;if(!n||!r||!t)return Promise.resolve(di);const i={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"&&(i.transferFunction=s.toLowerCase());const o=n.split(",").map(c=>({type:"media-source",video:H(H({},i),{},{contentType:be(c,"video")})}));return r&&a.audioGroups&&a.audioGroups.forEach(c=>{var u;c&&((u=e.groups[c])==null||u.tracks.forEach(h=>{if(h.groupId===c){const v=h.channels||"",T=parseFloat(v);B(T)&&T>2&&o.push.apply(o,r.split(",").map(w=>({type:"media-source",audio:{contentType:be(w,"audio"),channels:""+T}})))}}))}),Promise.all(o.map(c=>{const u=Ei(c);return si[u]||(si[u]=t.decodingInfo(c))})).then(c=>({supported:!c.some(u=>!u.supported),configurations:o,decodingInfoResults:c})).catch(c=>({supported:!1,configurations:o,decodingInfoResults:[],error:c}))}function Ei(a){const{audio:e,video:t}=a,n=t||e;if(n){const r=n.contentType.split('"')[1];if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${r}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${r}`}return""}function yi(){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 Li(a,e){let t=!1,n=[];return a&&(t=a!=="SDR",n=[a]),e&&(n=e.allowedVideoRanges||sr.slice(0),t=e.preferHDR!==void 0?e.preferHDR:yi(),t?n=n.filter(r=>r!=="SDR"):n=["SDR"]),{preferHDR:t,allowedVideoRanges:n}}function xi(a,e,t,n,r){const i=Object.keys(a),s=n==null?void 0:n.channels,o=n==null?void 0:n.audioCodec,c=s&&parseInt(s)===2;let u=!0,h=!1,v=1/0,T=1/0,w=1/0,L=0,M=[];const{preferHDR:U,allowedVideoRanges:re}=Li(e,r);for(let $e=i.length;$e--;){const Lt=a[i[$e]];u=Lt.channels[2]>0,v=Math.min(v,Lt.minHeight),T=Math.min(T,Lt.minFramerate),w=Math.min(w,Lt.minBitrate);const dt=re.filter(zt=>Lt.videoRanges[zt]>0);dt.length>0&&(h=!0,M=dt)}v=B(v)?v:0,T=B(T)?T:0;const Ze=Math.max(1080,v),Ge=Math.max(30,T);return w=B(w)?w:t,t=Math.max(w,t),h||(e=void 0,M=[]),{codecSet:i.reduce(($e,Lt)=>{const dt=a[Lt];if(Lt===$e)return $e;if(dt.minBitrate>t)return Gr(Lt,`min bitrate of ${dt.minBitrate} > current estimate of ${t}`),$e;if(!dt.hasDefaultAudio)return Gr(Lt,"no renditions with default or auto-select sound found"),$e;if(o&&Lt.indexOf(o.substring(0,4))%5!==0)return Gr(Lt,`audio codec preference "${o}" not found`),$e;if(s&&!c){if(!dt.channels[s])return Gr(Lt,`no renditions with ${s} channel sound found (channels options: ${Object.keys(dt.channels)})`),$e}else if((!o||c)&&u&&dt.channels[2]===0)return Gr(Lt,"no renditions with stereo sound found"),$e;return dt.minHeight>Ze?(Gr(Lt,`min resolution of ${dt.minHeight} > maximum of ${Ze}`),$e):dt.minFramerate>Ge?(Gr(Lt,`min framerate of ${dt.minFramerate} > maximum of ${Ge}`),$e):M.some(zt=>dt.videoRanges[zt]>0)?dt.maxScore=Le($e)||dt.fragmentError>a[$e].fragmentError)?$e:(L=dt.maxScore,Lt):(Gr(Lt,`no variants with VIDEO-RANGE of ${JSON.stringify(M)} found`),$e)},void 0),videoRanges:M,preferHDR:U,minFramerate:T,minBitrate:w}}function Gr(a,e){b.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function wi(a){return a.reduce((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const r=t.channels||"2";return n.channels[r]=(n.channels[r]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Di(a,e,t,n){return a.slice(t,n+1).reduce((r,i)=>{if(!i.codecSet)return r;const s=i.audioGroups;let o=r[i.codecSet];o||(r[i.codecSet]=o={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!s,fragmentError:0}),o.minBitrate=Math.min(o.minBitrate,i.bitrate);const c=Math.min(i.height,i.width);return o.minHeight=Math.min(o.minHeight,c),o.minFramerate=Math.min(o.minFramerate,i.frameRate),o.maxScore=Math.max(o.maxScore,i.score),o.fragmentError+=i.fragmentError,o.videoRanges[i.videoRange]=(o.videoRanges[i.videoRange]||0)+1,s&&s.forEach(u=>{if(!u)return;const h=e.groups[u];h&&(o.hasDefaultAudio=o.hasDefaultAudio||e.hasDefaultAudio?h.hasDefault:h.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(h.channels).forEach(v=>{o.channels[v]=(o.channels[v]||0)+h.channels[v]}))}),r},{})}function ei(a,e,t){if("attrs"in a){const n=e.indexOf(a);if(n!==-1)return n}for(let n=0;nn.indexOf(r)===-1)}function Bn(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 Fr(a,e,t,n,r){const i=e[n],o=e.reduce((T,w,L)=>{const M=w.uri;return(T[M]||(T[M]=[])).push(L),T},{})[i.uri];o.length>1&&(n=Math.max.apply(Math,o));const c=i.videoRange,u=i.frameRate,h=i.codecSet.substring(0,4),v=Hr(e,n,T=>{if(T.videoRange!==c||T.frameRate!==u||T.codecSet.substring(0,4)!==h)return!1;const w=T.audioGroups,L=t.filter(M=>!w||w.indexOf(M.groupId)!==-1);return ei(a,L,r)>-1});return v>-1?v:Hr(e,n,T=>{const w=T.audioGroups,L=t.filter(M=>!w||w.indexOf(M.groupId)!==-1);return ei(a,L,r)>-1})}function Hr(a,e,t){for(let n=e;n>-1;n--)if(t(a[n]))return n;for(let n=e+1;n{const{fragCurrent:t,partCurrent:n,hls:r}=this,{autoLevelEnabled:i,media:s}=r;if(!t||!s)return;const o=performance.now(),c=n?n.stats:t.stats,u=n?n.duration:t.duration,h=o-c.loading.start,v=r.minAutoLevel;if(c.aborted||c.loaded&&c.loaded===c.total||t.level<=v){this.clearTimer(),this._nextAutoLevel=-1;return}if(!i||s.paused||!s.playbackRate||!s.readyState)return;const T=r.mainForwardBufferInfo;if(T===null)return;const w=this.bwEstimator.getEstimateTTFB(),L=Math.abs(s.playbackRate);if(h<=Math.max(w,1e3*(u/(L*2))))return;const M=T.len/L,U=c.loading.first?c.loading.first-c.loading.start:-1,re=c.loaded&&U>-1,Ze=this.getBwEstimate(),Ge=r.levels,gt=Ge[t.level],$e=c.total||Math.max(c.loaded,Math.round(u*gt.averageBitrate/8));let Lt=re?h-U:h;Lt<1&&re&&(Lt=Math.min(h,c.loaded*8/Ze));const dt=re?c.loaded*1e3/Lt:0,zt=dt?($e-c.loaded)/dt:$e*8/Ze+w/1e3;if(zt<=M)return;const dn=dt?dt*8:Ze;let At=Number.POSITIVE_INFINITY,Gt;for(Gt=t.level-1;Gt>v;Gt--){const pn=Ge[Gt].maxBitrate;if(At=this.getTimeToLoadFrag(w/1e3,dn,u*pn,!Ge[Gt].details),At=zt||At>u*10)return;r.nextLoadLevel=r.nextAutoLevel=Gt,re?this.bwEstimator.sample(h-Math.min(w,U),c.loaded):this.bwEstimator.sampleTTFB(h);const $n=Ge[Gt].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>$n&&this.resetEstimator($n),this.clearTimer(),b.warn(`[abr] Fragment ${t.sn}${n?" part "+n.index:""} of level ${t.level} is loading too slowly; Time to underbuffer: ${M.toFixed(3)} s Estimated load time for current fragment: ${zt.toFixed(3)} s Estimated load time for down switch fragment: ${At.toFixed(3)} s TTFB estimate: ${U|0} ms Current BW estimate: ${B(Ze)?Ze|0:"Unknown"} bps New BW estimate: ${this.getBwEstimate()|0} bps Switching to level ${Gt} @ ${$n|0} bps`),r.trigger(m.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:n,stats:c})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(b.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 mi(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.FRAG_LOADING,this.onFragLoading,this),e.on(m.FRAG_LOADED,this.onFragLoaded,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this),e.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(m.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.FRAG_LOADING,this.onFragLoading,this),e.off(m.FRAG_LOADED,this.onFragLoaded,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this),e.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(m.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(m.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var r;this.fragCurrent=n,this.partCurrent=(r=t.part)!=null?r:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case $.BUFFER_ADD_CODEC_ERROR:case $.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case $.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:r,partCurrent:i}=this;if(n&&r&&n.sn===r.sn&&n.level===r.level){const s=performance.now(),o=i?i.stats:n.stats,c=s-o.loading.start,u=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&u>-1){const v=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(v,u),o.loaded)}else this.bwEstimator.sampleTTFB(c)}break}}}getTimeToLoadFrag(e,t,n,r){const i=e+n/t,s=r?this.lastLevelLoadSec:0;return i+s}onLevelLoaded(e,t){const n=this.hls.config,{loading:r}=t.stats,i=r.end-r.start;B(i)&&(this.lastLevelLoadSec=i/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 r=n?n.stats:t.stats;if(t.type===vt.MAIN&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const i=n?n.duration:t.duration,s=this.hls.levels[t.level],o=(s.loaded?s.loaded.bytes:0)+r.loaded,c=(s.loaded?s.loaded.duration:0)+i;s.loaded={bytes:o,duration:c},s.realBitrate=Math.round(8*o/c)}if(t.bitrateTest){const i={stats:r,frag:t,part:n,id:t.type};this.onFragBuffered(m.FRAG_BUFFERED,i),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:r}=t,i=r!=null&&r.stats.loaded?r.stats:n.stats;if(i.aborted||this.ignoreFragment(n))return;const s=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,i.loaded),i.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==vt.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),r=this.hls.config.maxStarvationDelay,i=this.findBestLevel(n,t,e,0,r,1,1);if(i>-1)return i;const s=this.hls.firstLevel,o=Math.min(Math.max(s,t),e);return b.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),r=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!r||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const i=n&&r?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const s=this.hls.levels;if(s.length>Math.max(e,i)&&s[e].loadError<=s[i].loadError)return e}return this._nextAutoLevel=i,this.nextAutoLevelKey=this.getAutoLevelKey(),i}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this,{maxAutoLevel:r,config:i,minAutoLevel:s}=n,o=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),u=this.getStarvationDelay();let h=i.abrBandWidthFactor,v=i.abrBandWidthUpFactor;if(u){const U=this.findBestLevel(c,s,r,u,0,h,v);if(U>=0)return U}let T=o?Math.min(o,i.maxStarvationDelay):i.maxStarvationDelay;if(!u){const U=this.bitrateTestDelay;U&&(T=(o?Math.min(o,i.maxLoadingDelay):i.maxLoadingDelay)-U,b.info(`[abr] bitrate test took ${Math.round(1e3*U)}ms, set first fragment max fetchDuration to ${Math.round(1e3*T)} ms`),h=v=1)}const w=this.findBestLevel(c,s,r,u,T,h,v);if(b.info(`[abr] ${u?"rebuffering expected":"buffer is empty"}, optimal quality level ${w}`),w>-1)return w;const L=n.levels[s],M=n.levels[n.loadLevel];return(L==null?void 0:L.bitrate)<(M==null?void 0:M.bitrate)?s:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,r=e.mainForwardBufferInfo;return(r?r.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,r,i,s,o){var c;const u=r+i,h=this.lastLoadedFragLevel,v=h===-1?this.hls.firstLevel:h,{fragCurrent:T,partCurrent:w}=this,{levels:L,allAudioTracks:M,loadLevel:U,config:re}=this.hls;if(L.length===1)return 0;const Ze=L[v],Ge=!!(Ze!=null&&(c=Ze.details)!=null&&c.live),gt=U===-1||h===-1;let $e,Lt="SDR",dt=(Ze==null?void 0:Ze.frameRate)||0;const{audioPreference:zt,videoPreference:dn}=re,At=this.audioTracksByGroup||(this.audioTracksByGroup=wi(M));if(gt){if(this.firstSelection!==-1)return this.firstSelection;const Vn=this.codecTiers||(this.codecTiers=Di(L,At,t,n)),Gn=xi(Vn,Lt,e,zt,dn),{codecSet:dr,videoRanges:Ar,minFramerate:wn,minBitrate:vn,preferHDR:pr}=Gn;$e=dr,Lt=pr?Ar[Ar.length-1]:Ar[0],dt=wn,e=Math.max(e,vn),b.log(`[abr] picked start tier ${JSON.stringify(Gn)}`)}else $e=Ze==null?void 0:Ze.codecSet,Lt=Ze==null?void 0:Ze.videoRange;const Gt=w?w.duration:T?T.duration:0,$n=this.bwEstimator.getEstimateTTFB()/1e3,pn=[];for(let Vn=n;Vn>=t;Vn--){var Wn;const Gn=L[Vn],dr=Vn>v;if(!Gn)continue;if(re.useMediaCapabilities&&!Gn.supportedResult&&!Gn.supportedPromise){const Ur=navigator.mediaCapabilities;typeof(Ur==null?void 0:Ur.decodingInfo)=="function"&&zi(Gn,At,Lt,dt,e,zt)?(Gn.supportedPromise=Ii(Gn,At,Ur),Gn.supportedPromise.then(Vr=>{if(!this.hls)return;Gn.supportedResult=Vr;const Xr=this.hls.levels,ci=Xr.indexOf(Gn);Vr.error?b.warn(`[abr] MediaCapabilities decodingInfo error: "${Vr.error}" for level ${ci} ${JSON.stringify(Vr)}`):Vr.supported||(b.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${ci} ${JSON.stringify(Vr)}`),ci>-1&&Xr.length>1&&(b.log(`[abr] Removing unsupported level ${ci}`),this.hls.removeLevel(ci)))})):Gn.supportedResult=di}if($e&&Gn.codecSet!==$e||Lt&&Gn.videoRange!==Lt||dr&&dt>Gn.frameRate||!dr&&dt>0&&dt=Gt*2&&i===0?L[Vn].averageBitrate:L[Vn].maxBitrate,tr=this.getTimeToLoadFrag($n,vn,pr*wn,Ar===void 0);if(vn>=pr&&(Vn===h||Gn.loadError===0&&Gn.fragmentError===0)&&(tr<=$n||!B(tr)||Ge&&!this.bitrateTestDelay||tr${Vn} adjustedbw(${Math.round(vn)})-bitrate=${Math.round(vn-pr)} ttfb:${$n.toFixed(1)} avgDuration:${wn.toFixed(1)} maxFetchDuration:${u.toFixed(1)} fetchDuration:${tr.toFixed(1)} firstSelection:${gt} codecSet:${$e} videoRange:${Lt} hls.loadLevel:${U}`)),gt&&(this.firstSelection=Vn),Vn}}return-1}set nextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls,r=Math.min(Math.max(e,n),t);this._nextAutoLevel!==r&&(this.nextAutoLevelKey="",this._nextAutoLevel=r)}}class $r{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 cr={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class ii{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(m.BUFFER_APPENDED,this.onBufferAppended,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this),e.on(m.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(m.BUFFER_APPENDED,this.onBufferAppended,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this),e.off(m.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let r=n.length;r--;){const i=n[r];if(!i)break;const s=i.end;if(i.start<=e&&s!==null&&e<=s)return i}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:n}=this,r=Object.keys(n);for(let i=r.length;i--;){const s=n[r[i]];if((s==null?void 0:s.body.type)===t&&s.buffered){const o=s.body;if(o.start<=e&&e<=o.end)return o}}return null}detectEvictedFragments(e,t,n,r){this.timeRanges&&(this.timeRanges[e]=t);const i=(r==null?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach(s=>{const o=this.fragments[s];if(!o||i>=o.body.sn)return;if(!o.buffered&&!o.loaded){o.body.type===n&&this.removeFragment(o.body);return}const c=o.range[e];c&&c.time.some(u=>{const h=!this.isTimeBuffered(u.startPTS,u.endPTS,t);return h&&this.removeFragment(o.body),h})})}detectPartialFragments(e){const t=this.timeRanges,{frag:n,part:r}=e;if(!t||n.sn==="initSegment")return;const i=ti(n),s=this.fragments[i];if(!s||s.buffered&&n.gap)return;const o=!n.relurl;Object.keys(t).forEach(c=>{const u=n.elementaryStreams[c];if(!u)return;const h=t[c],v=o||u.partial===!0;s.range[c]=this.getBufferedTimes(n,r,v,h)}),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),Yr(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(r=>r.fragment.sn>=e))}fragBuffered(e,t){const n=ti(e);let r=this.fragments[n];!r&&t&&(r=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)}getBufferedTimes(e,t,n,r){const i={time:[],partial:n},s=e.start,o=e.end,c=e.minEndPTS||o,u=e.maxStartPTS||s;for(let h=0;h=v&&c<=T){i.time.push({startPTS:Math.max(s,r.start(h)),endPTS:Math.min(o,r.end(h))});break}else if(sv){const w=Math.max(s,r.start(h)),L=Math.min(o,r.end(h));L>w&&(i.partial=!0,i.time.push({startPTS:w,endPTS:L}))}else if(o<=v)break}return i}getPartialFragment(e){let t=null,n,r,i,s=0;const{bufferPadding:o,fragments:c}=this;return Object.keys(c).forEach(u=>{const h=c[u];h&&Yr(h)&&(r=h.body.start-o,i=h.body.end+o,e>=r&&e<=i&&(n=Math.min(e-r,i-e),s<=n&&(t=h.body,s=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Yr(t))}getState(e){const t=ti(e),n=this.fragments[t];return n?n.buffered?Yr(n)?cr.PARTIAL:cr.OK:cr.APPENDING:cr.NOT_LOADED}isTimeBuffered(e,t,n){let r,i;for(let s=0;s=r&&t<=i)return!0;if(t<=r)return!1}return!1}onFragLoaded(e,t){const{frag:n,part:r}=t;if(n.sn==="initSegment"||n.bitrateTest)return;const i=r?null:t,s=ti(n);this.fragments[s]={body:n,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:r,timeRanges:i}=t;if(n.sn==="initSegment")return;const s=n.type;if(r){let o=this.activePartLists[s];o||(this.activePartLists[s]=o=[]),o.push(r)}this.timeRanges=i,Object.keys(i).forEach(o=>{const c=i[o];this.detectEvictedFragments(o,c,s,r)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=ti(e);return!!this.fragments[t]}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,r,i){r&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const o=this.fragments[s];if(!o)return;const c=o.body;c.type!==n||r&&!c.gap||c.starte&&(o.buffered||i)&&this.removeFragment(c)})}removeFragment(e){const t=ti(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const r=e.sn;this.activePartLists[e.type]=n.filter(i=>i.fragment.sn!==r)}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 Yr(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 ti(a){return`${a.type}_${a.level}_${a.sn}`}const ai={length:0,start:()=>0,end:()=>0};class mr{static isBuffered(e,t){try{if(e){const n=mr.getBuffered(e);for(let r=0;r=n.start(r)&&t<=n.end(r))return!0}}catch(n){}return!1}static bufferInfo(e,t,n){try{if(e){const r=mr.getBuffered(e),i=[];let s;for(s=0;sv&&(r[h-1].end=e[u].end):r.push(e[u])}else r.push(e[u])}else r=e;let i=0,s,o=t,c=t;for(let u=0;u=h&&tt.startCC||a&&a.cc{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(w=>w[0]==="GAP")){c(Ir(e));return}else e.gap=!1;const u=this.loader=e.loader=i?new i(r):new s(r),h=gr(e),v=fr(r.fragLoadPolicy.default),T={loadPolicy:v,timeout:v.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:$i};e.stats=u.stats,u.load(h,T,{onSuccess:(w,L,M,U)=>{this.resetLoader(e,u);let re=w.data;M.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(re.slice(0,16)),re=re.slice(16)),o({frag:e,part:null,payload:re,networkDetails:U})},onError:(w,L,M,U)=>{this.resetLoader(e,u),c(new _r({type:J.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:H({url:n,data:void 0},w),error:new Error(`HTTP Error ${w.code} ${w.text}`),networkDetails:M,stats:U}))},onAbort:(w,L,M)=>{this.resetLoader(e,u),c(new _r({type:J.NETWORK_ERROR,details:$.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:M,stats:w}))},onTimeout:(w,L,M)=>{this.resetLoader(e,u),c(new _r({type:J.NETWORK_ERROR,details:$.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${T.timeout}ms`),networkDetails:M,stats:w}))},onProgress:(w,L,M,U)=>{t&&t({frag:e,part:null,payload:M,networkDetails:U})}})})}loadPart(e,t,n){this.abort();const r=this.config,i=r.fLoader,s=r.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(Ir(e,t));return}const u=this.loader=e.loader=i?new i(r):new s(r),h=gr(e,t),v=fr(r.fragLoadPolicy.default),T={loadPolicy:v,timeout:v.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:$i};t.stats=u.stats,u.load(h,T,{onSuccess:(w,L,M,U)=>{this.resetLoader(e,u),this.updateStatsFromPart(e,t);const re={frag:e,part:t,payload:w.data,networkDetails:U};n(re),o(re)},onError:(w,L,M,U)=>{this.resetLoader(e,u),c(new _r({type:J.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:H({url:h.url,data:void 0},w),error:new Error(`HTTP Error ${w.code} ${w.text}`),networkDetails:M,stats:U}))},onAbort:(w,L,M)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,u),c(new _r({type:J.NETWORK_ERROR,details:$.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:M,stats:w}))},onTimeout:(w,L,M)=>{this.resetLoader(e,u),c(new _r({type:J.NETWORK_ERROR,details:$.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${T.timeout}ms`),networkDetails:M,stats:w}))}})})}updateStatsFromPart(e,t){const n=e.stats,r=t.stats,i=r.total;if(n.loaded+=r.loaded,i){const c=Math.round(e.duration/t.duration),u=Math.min(Math.round(n.loaded/i),c),v=(c-u)*Math.round(n.loaded/u);n.total=n.loaded+v}else n.total=Math.max(n.loaded,n.total);const s=n.loading,o=r.loading;s.start?s.first+=o.first-o.start:(s.start=o.start,s.first=o.first),s.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function gr(a,e=null){const t=e||a,n={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},r=t.byteRangeStartOffset,i=t.byteRangeEndOffset;if(B(r)&&B(i)){var s;let o=r,c=i;if(a.sn==="initSegment"&&((s=a.decryptdata)==null?void 0:s.method)==="AES-128"){const u=i-r;u%16&&(c=i+(16-u%16)),r!==0&&(n.resetIV=!0,o=r-16)}n.rangeStart=o,n.rangeEnd=c}return n}function Ir(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),n={type:J.MEDIA_ERROR,details:$.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(n.part=e),(e||a).stats.aborted=!0,new _r(n)}class _r extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class ni{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 _i{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 Hi(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?F(a,0,e-t):a}class hs{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let r=0;r<4;r++)n[r]=t.getUint32(r*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,r=n[0],i=n[1],s=n[2],o=n[3],c=this.invSubMix,u=c[0],h=c[1],v=c[2],T=c[3],w=new Uint32Array(256);let L=0,M=0,U=0;for(U=0;U<256;U++)U<128?w[U]=U<<1:w[U]=U<<1^283;for(U=0;U<256;U++){let re=M^M<<1^M<<2^M<<3^M<<4;re=re>>>8^re&255^99,e[L]=re,t[re]=L;const Ze=w[L],Ge=w[Ze],gt=w[Ge];let $e=w[re]*257^re*16843008;r[L]=$e<<24|$e>>>8,i[L]=$e<<16|$e>>>16,s[L]=$e<<8|$e>>>24,o[L]=$e,$e=gt*16843009^Ge*65537^Ze*257^L*16843008,u[re]=$e<<24|$e>>>8,h[re]=$e<<16|$e>>>16,v[re]=$e<<8|$e>>>24,T[re]=$e,L?(L=Ze^w[w[w[gt^Ze]]],M^=w[w[M]]):L=M=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,r=0;for(;rthis.subtle?(this.logOnce("WebCrypto AES decrypt"),new ni(this.subtle,new Uint8Array(n)).decrypt(e.buffer,r)):Promise.reject(new Error("web crypto not initialized"))).catch(r=>(b.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(e,t,n)))}onWebCryptoError(e,t,n){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n);const r=this.flush();if(r)return r.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%Yi;return n!==e.length&&(t=F(e,0,n),this.remainderData=F(e,n)),t}logOnce(e){this.logEnabled&&(b.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Ti={toString:function(a){let e="";const t=a.length;for(let n=0;no.end){const v=s>h;(s{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${i.part?" p: "+i.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(i)};this._doFragLoad(e,t,n,r).then(i=>{if(!i)return;const s=this.state;if(this.fragContextChanged(e)){(s===Rt.FRAG_LOADING||!this.fragCurrent&&s===Rt.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=Rt.IDLE);return}"payload"in i&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(m.FRAG_LOADED,i)),this._handleFragmentLoadComplete(i)}).catch(i=>{this.state===Rt.STOPPED||this.state===Rt.ERROR||(this.warn(`Frag error: ${(i==null?void 0:i.message)||i}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===cr.APPENDING){const i=e.type,s=this.getFwdBufferInfo(this.mediaBuffer,i),o=Math.max(e.duration,s?s.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.sn:0)===1||this.reduceMaxBufferLength(o,e.duration))&&n.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===cr.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 r={startOffset:e,endOffset:t,type:n};this.hls.trigger(m.BUFFER_FLUSHING,r)}_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:r}=this,{payload:i}=n,s=e.decryptdata;if(i&&i.byteLength>0&&s!=null&&s.key&&s.iv&&s.method==="AES-128"){const o=self.performance.now();return this.decrypter.decrypt(new Uint8Array(i),s.key.buffer,s.iv.buffer).catch(c=>{throw r.trigger(m.ERROR,{type:J.MEDIA_ERROR,details:$.FRAG_DECRYPT_ERROR,fatal:!1,error:c,reason:c.message,frag:e}),c}).then(c=>{const u=self.performance.now();return r.trigger(m.FRAG_DECRYPTED,{frag:e,payload:c,stats:{tstart:o,tdecrypt:u}}),n.payload=c,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===Rt.STOPPED||this.state===Rt.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=Rt.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,r,i,s;const o=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===vt.MAIN?"level":"track"} ${e.level} (frag:[${((n=e.startPTS)!=null?n:NaN).toFixed(3)}-${((r=e.endPTS)!=null?r:NaN).toFixed(3)}] > buffer:${o?Ti.toString(mr.getBuffered(o)):"(detached)"})`),e.sn!=="initSegment"){var c;if(e.type!==vt.SUBTITLE){const h=e.elementaryStreams;if(!Object.keys(h).some(v=>!!h[v])){this.state=Rt.IDLE;return}}const u=(c=this.levels)==null?void 0:c[e.level];u!=null&&u.fragmentError&&(this.log(`Resetting level fragment error count of ${u.fragmentError} on frag buffered`),u.fragmentError=0)}this.state=Rt.IDLE,o&&(!this.loadedmetadata&&e.type==vt.MAIN&&o.buffered.length&&((i=this.fragCurrent)==null?void 0:i.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:r,partsLoaded:i}=e,s=!i||i.length===0||i.some(c=>!c),o=new Oi(n.level,n.sn,n.stats.chunkCount+1,0,r?r.index:-1,!s);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,r){var i;const s=t==null?void 0:t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let o=null;if(e.encrypted&&!((i=e.decryptdata)!=null&&i.key)?(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=Rt.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(h=>{if(!this.fragContextChanged(h.frag))return this.hls.trigger(m.KEY_LOADED,h),this.state===Rt.KEY_LOADING&&(this.state=Rt.IDLE),h}),this.hls.trigger(m.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(o=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 h=s.partList;if(h&&r){n>e.end&&s.fragmentHint&&(e=s.fragmentHint);const v=this.getNextPart(h,e,n);if(v>-1){const T=h[v];this.log(`Loading part sn: ${e.sn} p: ${T.index} cc: ${e.cc} of playlist [${s.startSN}-${s.endSN}] parts [0-${v}-${h.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=T.start+T.duration,this.state=Rt.FRAG_LOADING;let w;return o?w=o.then(L=>!L||this.fragContextChanged(L.frag)?null:this.doFragPartsLoad(e,T,t,r)).catch(L=>this.handleFragLoadError(L)):w=this.doFragPartsLoad(e,T,t,r).catch(L=>this.handleFragLoadError(L)),this.hls.trigger(m.FRAG_LOADING,{frag:e,part:T,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):w}else if(!e.url||this.loadedEndOfParts(h,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))}`),B(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Rt.FRAG_LOADING;const c=this.config.progressive;let u;return c&&o?u=o.then(h=>!h||this.fragContextChanged(h==null?void 0:h.frag)?null:this.fragmentLoader.load(e,r)).catch(h=>this.handleFragLoadError(h)):u=Promise.all([this.fragmentLoader.load(e,c?r:void 0),o]).then(([h])=>(!c&&h&&r&&r(h),h)).catch(h=>this.handleFragLoadError(h)),this.hls.trigger(m.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):u}doFragPartsLoad(e,t,n,r){return new Promise((i,s)=>{var o;const c=[],u=(o=n.details)==null?void 0:o.partList,h=v=>{this.fragmentLoader.loadPart(e,v,r).then(T=>{c[v.index]=T;const w=T.part;this.hls.trigger(m.FRAG_LOADED,T);const L=sn(n,e.sn,v.index+1)||Ln(u,e.sn,v.index+1);if(L)h(L);else return i({frag:e,part:w,partsLoaded:c})}).catch(s)};h(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===$.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(m.ERROR,t)}else this.hls.trigger(m.ERROR,{type:J.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==Rt.PARSING){!this.fragCurrent&&this.state!==Rt.STOPPED&&this.state!==Rt.ERROR&&(this.state=Rt.IDLE);return}const{frag:n,part:r,level:i}=t,s=self.performance.now();n.stats.parsing.end=s,r&&(r.stats.parsing.end=s),this.updateLevelTiming(n,r,i,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:r,sn:i,part:s}=e;if(!(t!=null&&t[r]))return this.warn(`Levels object was unset while buffering fragment ${i} of level ${r}. The current chunk will not be buffered.`),null;const o=t[r],c=s>-1?sn(o,i,s):null,u=c?c.fragment:kr(o,i,n);return u?(n&&n!==u&&(u.stats=n.stats),{frag:u,part:c,level:o}):null}bufferFragmentData(e,t,n,r,i){var s;if(!e||this.state!==Rt.PARSING)return;const{data1:o,data2:c}=e;let u=o;if(o&&c&&(u=l(o,c)),!((s=u)!=null&&s.length))return;const h={type:e.type,frag:t,part:n,chunkMeta:r,parent:t.type,data:u};if(this.hls.trigger(m.BUFFER_APPENDING,h),e.dropped&&e.independent&&!n){if(i)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!mr.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,r=mr.bufferInfo(t,n,0),i=e.duration,s=Math.min(this.config.maxFragLookUpTolerance*2,i*.25),o=Math.max(Math.min(e.start-s,r.end-s),n+s);e.start-o>s&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){const n=this.getLoadPosition();return B(n)?this.getFwdBufferInfoAtPos(e,n,t):null}getFwdBufferInfoAtPos(e,t,n){const{config:{maxBufferHole:r}}=this,i=mr.bufferInfo(e,t,r);if(i.len===0&&i.nextStart!==void 0){const s=this.fragmentTracker.getBufferedFrag(t,n);if(s&&i.nextStart=r?(n.maxMaxBufferLength=i,this.warn(`Reduce max buffer length to ${i}s`),!0):!1}getAppendedFrag(e,t=vt.MAIN){const n=this.fragmentTracker.getAppendedFrag(e,vt.MAIN);return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const n=t.fragments,r=n.length;if(!r)return null;const{config:i}=this,s=n[0].start;let o;if(t.live){const c=i.initialLiveManifestSize;if(rt}getNextFragmentLoopLoading(e,t,n,r,i){const s=e.gap,o=this.getNextFragment(this.nextLoadPosition,t);if(o===null)return o;if(e=o,s&&e&&!e.gap&&n.nextStart){const c=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,r);if(c!==null&&n.len+c.len>=i)return this.log(`buffer full after gaps in "${r}" 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 r=-1,i=!1,s=!0;for(let o=0,c=e.length;o-1&&nn.start&&n.loaded}getInitialLiveFragment(e,t){const n=this.fragPrevious;let r=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),r=Qn(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){const i=n.sn+1;if(i>=e.startSN&&i<=e.endSN){const s=t[i-e.startSN];n.cc===s.cc&&(r=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=Zt(t,n.cc),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{const i=this.hls.liveSyncPosition;i!==null&&(r=this.getFragmentAtPosition(i,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}getFragmentAtPosition(e,t,n){const{config:r}=this;let{fragPrevious:i}=this,{fragments:s,endSN:o}=n;const{fragmentHint:c}=n,{maxFragLookUpTolerance:u}=r,h=n.partList,v=!!(r.lowLatencyMode&&h!=null&&h.length&&c);v&&c&&!this.bitrateTest&&(s=s.concat(c),o=c.sn);let T;if(et-u?0:u;T=zn(i,s,e,w)}else T=s[s.length-1];if(T){const w=T.sn-n.startSN,L=this.fragmentTracker.getState(T);if((L===cr.OK||L===cr.PARTIAL&&T.gap)&&(i=T),i&&T.sn===i.sn&&(!v||h[0].fragment.sn>T.sn)&&i&&T.level===i.level){const U=s[w+1];T.sn=s-t.maxFragLookUpTolerance&&i<=o;if(r!==null&&n.duration>r&&(i${e.startSN} prev-sn: ${c?c.sn:"na"} fragments: ${r}`),u}return i}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;if(n ${(r=this.fragCurrent)==null?void 0:r.url}`);return}const i=t.details===$.FRAG_GAP;i&&this.fragmentTracker.fragBuffered(n,!0);const s=t.errorAction,{action:o,retryCount:c=0,retryConfig:u}=s||{};if(s&&o===hn.RetryRequest&&u){this.resetStartWhenNotLoaded(this.levelLastLoaded);const h=Un(u,c);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${c+1}/${u.maxNumRetry} in ${h}ms`),s.resolved=!0,this.retryDate=self.performance.now()+h,this.state=Rt.FRAG_LOADING_WAITING_RETRY}else if(u&&s)if(this.resetFragmentErrors(e),c.5;i&&this.reduceMaxBufferLength(r.len,(t==null?void 0:t.duration)||10);const s=!i;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===vt.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==Rt.STOPPED&&(this.state=Rt.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const r=mr.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,n),this.state===Rt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=Rt.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,r){var i;const s=n.details;if(!s){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((c,u)=>{const h=e.elementaryStreams[u];if(h){const v=h.endPTS-h.startPTS;if(v<=0)return this.warn(`Could not parse fragment ${e.sn} ${u} duration reliably (${v})`),c||!1;const T=r?0:Zr(s,e,h.startPTS,h.endPTS,h.startDTS,h.endDTS);return this.hls.trigger(m.LEVEL_PTS_UPDATED,{details:s,level:n,drift:T,type:u,frag:e,start:h.startPTS,end:h.endPTS}),!0}return c},!1)&&((i=this.transmuxer)==null?void 0:i.error)===null){const c=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(c.message),this.hls.trigger(m.ERROR,{type:J.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,error:c,frag:e,reason:`Found no media in msn ${e.sn} of level "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=Rt.PARSED,this.hls.trigger(m.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 Hs{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=Ya(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function Ya(a,e){const t=new Uint8Array(e);let n=0;for(let r=0;r0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Qt.audioId3,duration:Number.POSITIVE_INFINITY});r{if(B(a))return a*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};function eo(a,e,t,n){let r,i,s,o;const c=navigator.userAgent.toLowerCase(),u=n,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];r=((e[t+2]&192)>>>6)+1;const v=(e[t+2]&60)>>>2;if(v>h.length-1){const T=new Error(`invalid ADTS sampling index:${v}`);a.emit(m.ERROR,m.ERROR,{type:J.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!0,error:T,reason:T.message});return}return s=(e[t+2]&1)<<2,s|=(e[t+3]&192)>>>6,b.log(`manifest codec:${n}, ADTS type:${r}, samplingIndex:${v}`),/firefox/i.test(c)?v>=6?(r=5,o=new Array(4),i=v-3):(r=2,o=new Array(2),i=v):c.indexOf("android")!==-1?(r=2,o=new Array(2),i=v):(r=5,o=new Array(4),n&&(n.indexOf("mp4a.40.29")!==-1||n.indexOf("mp4a.40.5")!==-1)||!n&&v>=6?i=v-3:((n&&n.indexOf("mp4a.40.2")!==-1&&(v>=6&&s===1||/vivaldi/i.test(c))||!n&&s===1)&&(r=2,o=new Array(2)),i=v)),o[0]=r<<3,o[0]|=(v&14)>>1,o[1]|=(v&1)<<7,o[1]|=s<<3,r===5&&(o[1]|=(i&14)>>1,o[2]=(i&1)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:h[v],channelCount:s,codec:"mp4a.40."+r,manifestCodec:u}}function Zs(a,e){return a[e]===255&&(a[e+1]&246)===240}function js(a,e){return a[e+1]&1?7:9}function gs(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function to(a,e){return e+5=a.length)return!1;const n=gs(a,e);if(n<=t)return!1;const r=e+n;return r===a.length||Xi(a,r)}return!1}function Vs(a,e,t,n,r){if(!a.samplerate){const i=eo(e,t,n,r);if(!i)return;a.config=i.config,a.samplerate=i.samplerate,a.channelCount=i.channelCount,a.codec=i.codec,a.manifestCodec=i.manifestCodec,b.log(`parsed codec:${a.codec}, rate:${i.samplerate}, channels:${i.channelCount}`)}}function Ws(a){return 1024*9e4/a}function io(a,e){const t=js(a,e);if(e+t<=a.length){const n=gs(a,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function Ks(a,e,t,n,r){const i=Ws(a.samplerate),s=n+r*i,o=io(e,t);let c;if(o){const{frameLength:v,headerLength:T}=o,w=T+v,L=Math.max(0,t+w-e.length);L?(c=new Uint8Array(w-T),c.set(e.subarray(t+T,e.length),0)):c=e.subarray(t+T,t+w);const M={unit:c,pts:s};return L||a.samples.push(M),{sample:M,length:w,missing:L}}const u=e.length-t;return c=new Uint8Array(u),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:s},length:u,missing:-1}}let Ji=null;const so=[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],ao=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],oo=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],lo=[0,1,1,4];function $s(a,e,t,n,r){if(t+24>e.length)return;const i=Ys(e,t);if(i&&t+i.frameLength<=e.length){const s=i.samplesPerFrame*9e4/i.sampleRate,o=n+r*s,c={unit:e.subarray(t,t+i.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=i.channelCount,a.samplerate=i.sampleRate,a.samples.push(c),{sample:c,length:i.frameLength,missing:0}}}function Ys(a,e){const t=a[e+1]>>3&3,n=a[e+1]>>1&3,r=a[e+2]>>4&15,i=a[e+2]>>2&3;if(t!==1&&r!==0&&r!==15&&i!==3){const s=a[e+2]>>1&1,o=a[e+3]>>6,c=t===3?3-n:n===3?3:4,u=so[c*14+r-1]*1e3,v=ao[(t===3?0:t===2?1:2)*3+i],T=o===3?1:2,w=oo[t][n],L=lo[n],M=w*8*L,U=Math.floor(w*u/v+s)*L;if(Ji===null){const Ge=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ji=Ge?parseInt(Ge[1]):0}return!!Ji&&Ji<=87&&n===2&&u>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:v,channelCount:T,frameLength:U,samplesPerFrame:M}}}function ps(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function Xs(a,e){return e+1{const s=E(i);if(fo.test(s.schemeIdUri)){const o=B(s.presentationTime)?s.presentationTime/s.timeScale:t+s.presentationTimeDelta/s.timeScale;let c=s.eventDuration===4294967295?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const u=s.payload;n.samples.push({data:u,len:u.byteLength,dts:o,pts:o,type:Qt.emsg,duration:c})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const Qs=(a,e)=>{let t=0,n=5;e+=n;const r=new Uint32Array(1),i=new Uint32Array(1),s=new Uint8Array(1);for(;n>0;){s[0]=a[e];const o=Math.min(n,8),c=8-o;i[0]=4278190080>>>24+c<>c,t=t?t<e.length||e[t]!==11||e[t+1]!==119)return-1;const i=e[t+4]>>6;if(i>=3)return-1;const o=[48e3,44100,32e3][i],c=e[t+4]&63,h=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][c*3+i]*2;if(t+h>e.length)return-1;const v=e[t+6]>>5;let T=0;v===2?T+=2:(v&1&&v!==1&&(T+=2),v&4&&(T+=2));const w=(e[t+6]<<8|e[t+7])>>12-T&1,M=[2,1,2,3,3,4,4,5][v]+w,U=e[t+5]>>3,re=e[t+5]&7,Ze=new Uint8Array([i<<6|U<<1|re>>2,(re&3)<<6|v<<3|w<<2|c>>4,c<<4&224]),Ge=1536/o*9e4,gt=n+r*Ge,$e=e.subarray(t,t+h);return a.config=Ze,a.channelCount=M,a.samplerate=o,a.samples.push({unit:$e,pts:gt}),h}class go{constructor(){this.VideoSample=null}createVideoSample(e,t,n,r){return{key:e,frame:!1,pts:t,dts:n,units:[],debug:r,length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,r;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const i=n.units;r=i[i.length-1]}return r}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,r=n.length;if(r){const i=n[r-1];e.pts=i.pts,e.dts=i.dts}else{t.dropped++;return}}t.samples.push(e)}e.debug.length&&b.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,r=new Uint8Array(4),i=Math.min(4,t);if(i===0)throw new Error("no bytes available");r.set(e.subarray(n,n+i)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=i*8,this.bytesAvailable-=i}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&b.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<>>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,r;for(let i=0;i{var v;switch(h.type){case 1:{let M=!1;c=!0;const U=h.data;if(u&&U.length>4){const re=new ea(U).readSliceType();(re===2||re===4||re===7||re===9)&&(M=!0)}if(M){var T;(T=o)!=null&&T.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null)}o||(o=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),o.frame=!0,o.key=M;break}case 5:c=!0,(v=o)!=null&&v.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null),o||(o=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),o.key=!0,o.frame=!0;break;case 6:{c=!0,g(h.data,1,n.pts,t.samples);break}case 7:{var w,L;c=!0,u=!0;const M=h.data,re=new ea(M).readSPS();if(!e.sps||e.width!==re.width||e.height!==re.height||((w=e.pixelRatio)==null?void 0:w[0])!==re.pixelRatio[0]||((L=e.pixelRatio)==null?void 0:L[1])!==re.pixelRatio[1]){e.width=re.width,e.height=re.height,e.pixelRatio=re.pixelRatio,e.sps=[M],e.duration=i;const Ze=M.subarray(1,4);let Ge="avc1.";for(let gt=0;gt<3;gt++){let $e=Ze[gt].toString(16);$e.length<2&&($e="0"+$e),Ge+=$e}e.codec=Ge}break}case 8:c=!0,e.pps=[h.data];break;case 9:c=!0,e.audFound=!0,o&&this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"");break;case 12:c=!0;break;default:c=!1,o&&(o.debug+="unknown NAL "+h.type+" ");break}o&&c&&o.units.push(h)}),r&&o&&(this.pushAccessUnit(o,e),this.VideoSample=null)}parseAVCNALu(e,t){const n=t.byteLength;let r=e.naluState||0;const i=r,s=[];let o=0,c,u,h,v=-1,T=0;for(r===-1&&(v=0,T=t[0]&31,r=0,o=1);o=0){const w={data:t.subarray(v,u),type:T};s.push(w)}else{const w=this.getLastNalUnit(e.samples);w&&(i&&o<=4-i&&w.state&&(w.data=w.data.subarray(0,w.data.byteLength-i)),u>0&&(w.data=l(w.data,t.subarray(0,u)),w.state=0))}o=0&&r>=0){const w={data:t.subarray(v,n),type:T,state:r};s.push(w)}if(s.length===0){const w=this.getLastNalUnit(e.samples);w&&(w.data=l(w.data,t))}return e.naluState=r,s}}class vo{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new Ni(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,n){const r=e[t].unit;if(r.length<=16)return;const i=r.subarray(16,r.length-r.length%16),s=i.buffer.slice(i.byteOffset,i.byteOffset+i.length);this.decryptBuffer(s).then(o=>{const c=new Uint8Array(o);r.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let r=0;for(let i=32;i{i.data=this.getAvcDecryptedUnit(s,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,r)})}decryptAvcSamples(e,t,n,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){r();return}const i=e[t].units;for(;!(n>=i.length);n++){const s=i[n];if(!(s.data.length<=48||s.type!==1&&s.type!==5)&&(this.decryptAvcSample(e,t,n,r,s),!this.decrypter.isSync()))return}}}}const jr=188;class Si{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 po}static probe(e){const t=Si.syncOffset(e);return t>0&&b.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let n=Math.min(jr*5,t-jr)+1,r=0;for(;r1&&(s===0&&o>2||c+jr>n))return s}else{if(o)return-1;break}r++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Dt[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,n,r){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Si.createTrack("video"),this._audioTrack=Si.createTrack("audio",r),this._id3Track=Si.createTrack("id3"),this._txtTrack=Si.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n,this._duration=r}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,r=!1){n||(this.sampleAes=null);let i;const s=this._videoTrack,o=this._audioTrack,c=this._id3Track,u=this._txtTrack;let h=s.pid,v=s.pesData,T=o.pid,w=c.pid,L=o.pesData,M=c.pesData,U=null,re=this.pmtParsed,Ze=this._pmtId,Ge=e.length;if(this.remainderData&&(e=l(this.remainderData,e),Ge=e.length,this.remainderData=null),Ge>4;let Gt;if(At>1){if(Gt=dt+5+e[dt+4],Gt===dt+jr)continue}else Gt=dt+4;switch(dn){case h:zt&&(v&&(i=Bi(v))&&this.videoParser.parseAVCPES(s,u,i,!1,this._duration),v={data:[],size:0}),v&&(v.data.push(e.subarray(Gt,dt+jr)),v.size+=dt+jr-Gt);break;case T:if(zt){if(L&&(i=Bi(L)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,i);break;case"mp3":this.parseMPEGPES(o,i);break;case"ac3":this.parseAC3PES(o,i);break}L={data:[],size:0}}L&&(L.data.push(e.subarray(Gt,dt+jr)),L.size+=dt+jr-Gt);break;case w:zt&&(M&&(i=Bi(M))&&this.parseID3PES(c,i),M={data:[],size:0}),M&&(M.data.push(e.subarray(Gt,dt+jr)),M.size+=dt+jr-Gt);break;case 0:zt&&(Gt+=e[Gt]+1),Ze=this._pmtId=yo(e,Gt);break;case Ze:{zt&&(Gt+=e[Gt]+1);const $n=So(e,Gt,this.typeSupported,n,this.observer);h=$n.videoPid,h>0&&(s.pid=h,s.segmentCodec=$n.segmentVideoCodec),T=$n.audioPid,T>0&&(o.pid=T,o.segmentCodec=$n.segmentAudioCodec),w=$n.id3Pid,w>0&&(c.pid=w),U!==null&&!re&&(b.warn(`MPEG-TS PMT found at ${dt} after unknown PID '${U}'. Backtracking to sync byte @${gt} to parse all TS packets.`),U=null,dt=gt-188),re=this.pmtParsed=!0;break}case 17:case 8191:break;default:U=dn;break}}else $e++;$e>0&&Qi(this.observer,new Error(`Found ${$e} TS packet/s that do not start with 0x47`)),s.pesData=v,o.pesData=L,c.pesData=M;const Lt={audioTrack:o,videoTrack:s,id3Track:c,textTrack:u};return r&&this.extractRemainingSamples(Lt),Lt}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:r,textTrack:i}=e,s=n.pesData,o=t.pesData,c=r.pesData;let u;if(s&&(u=Bi(s))?(this.videoParser.parseAVCPES(n,i,u,!0,this._duration),n.pesData=null):n.pesData=s,o&&(u=Bi(o))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,u);break;case"mp3":this.parseMPEGPES(t,u);break;case"ac3":this.parseAC3PES(t,u);break}t.pesData=null}else o!=null&&o.size&&b.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;c&&(u=Bi(c))?(this.parseID3PES(r,u),r.pesData=null):r.pesData=c}demuxSampleAes(e,t,n){const r=this.demux(e,n,!0,!this.config.progressive),i=this.sampleAes=new vo(this.observer,this.config,t);return this.decrypt(r,i)}decrypt(e,t){return new Promise(n=>{const{audioTrack:r,videoTrack:i}=e;r.samples&&r.segmentCodec==="aac"?t.decryptAacSamples(r.samples,0,()=>{i.samples?t.decryptAvcSamples(i.samples,0,0,()=>{n(e)}):n(e)}):i.samples&&t.decryptAvcSamples(i.samples,0,0,()=>{n(e)})})}destroy(){this._duration=0}parseAACPES(e,t){let n=0;const r=this.aacOverFlow;let i=t.data;if(r){this.aacOverFlow=null;const v=r.missing,T=r.sample.unit.byteLength;if(v===-1)i=l(r.sample.unit,i);else{const w=T-v;r.sample.unit.set(i.subarray(0,v),w),e.samples.push(r.sample),n=r.missing}}let s,o;for(s=n,o=i.length;s0;)o+=c}}parseID3PES(e,t){if(t.pts===void 0){b.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=de({},t,{type:this._videoTrack?Qt.emsg:Qt.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function vs(a,e){return((a[e+1]&31)<<8)+a[e+2]}function yo(a,e){return(a[e+10]&31)<<8|a[e+11]}function So(a,e,t,n,r){const i={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},s=(a[e+1]&15)<<8|a[e+2],o=e+3+s-4,c=(a[e+10]&15)<<8|a[e+11];for(e+=12+c;e0){let v=e+5,T=h;for(;T>2;){switch(a[v]){case 106:t.ac3!==!0?b.log("AC-3 audio found, not supported in this browser for now"):(i.audioPid=u,i.segmentAudioCodec="ac3");break}const L=a[v+1]+2;v+=L,T-=L}}break;case 194:case 135:return Qi(r,new Error("Unsupported EC-3 in M2TS found")),i;case 36:return Qi(r,new Error("Unsupported HEVC in M2TS found")),i}e+=h+5}return i}function Qi(a,e,t){b.warn(`parsing error: ${e.message}`),a.emit(m.ERROR,m.ERROR,{type:J.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function ys(a){b.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function Bi(a){let e=0,t,n,r,i,s;const o=a.data;if(!a||a.size===0)return null;for(;o[0].length<19&&o.length>1;)o[0]=l(o[0],o[1]),o.splice(1,1);if(t=o[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 u=t[7];u&192&&(i=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2,u&64?(s=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,i-s>60*9e4&&(b.warn(`${Math.round((i-s)/9e4)}s delta between PTS and DTS, align them`),i=s)):s=i),r=t[8];let h=r+9;if(a.size<=h)return null;a.size-=h;const v=new Uint8Array(a.size);for(let T=0,w=o.length;TL){h-=L;continue}else t=t.subarray(h),L-=h,h=0;v.set(t,e),e+=L}return n&&(n-=r+3),{data:v,pts:i,dts:s,len:n}}return null}class bo extends ms{resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=N(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&S(t)!==void 0&&Qs(e,n)<=16)return!1;for(let r=e.length;n>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(e,4),r=0,n=8;r>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))}static mdia(e){return et.box(et.types.mdia,et.mdhd(e.timescale,e.duration),et.hdlr(e.type),et.minf(e))}static mfhd(e){return et.box(et.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"?et.box(et.types.minf,et.box(et.types.smhd,et.SMHD),et.DINF,et.stbl(e)):et.box(et.types.minf,et.box(et.types.vmhd,et.VMHD),et.DINF,et.stbl(e))}static moof(e,t,n){return et.box(et.types.moof,et.mfhd(e),et.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=et.trak(e[t]);return et.box.apply(null,[et.types.moov,et.mvhd(e[0].timescale,e[0].duration)].concat(n).concat(et.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=et.trex(e[t]);return et.box.apply(null,[et.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(bi+1)),r=Math.floor(t%(bi+1)),i=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,r>>24,r>>16&255,r>>8&255,r&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return et.box(et.types.mvhd,i)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let r,i;for(r=0;r>>8&255),t.push(s&255),t=t.concat(Array.prototype.slice.call(i));for(r=0;r>>8&255),n.push(s&255),n=n.concat(Array.prototype.slice.call(i));const o=et.box(et.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),c=e.width,u=e.height,h=e.pixelRatio[0],v=e.pixelRatio[1];return et.box(et.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,c>>8&255,c&255,u>>8&255,u&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,et.box(et.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),et.box(et.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,v>>24,v>>16&255,v>>8&255,v&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 et.box(et.types.mp4a,et.audioStsd(e),et.box(et.types.esds,et.esds(e)))}static mp3(e){return et.box(et.types[".mp3"],et.audioStsd(e))}static ac3(e){return et.box(et.types["ac-3"],et.audioStsd(e),et.box(et.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?et.box(et.types.stsd,et.STSD,et.mp3(e)):e.segmentCodec==="ac3"?et.box(et.types.stsd,et.STSD,et.ac3(e)):et.box(et.types.stsd,et.STSD,et.mp4a(e)):et.box(et.types.stsd,et.STSD,et.avc1(e))}static tkhd(e){const t=e.id,n=e.duration*e.timescale,r=e.width,i=e.height,s=Math.floor(n/(bi+1)),o=Math.floor(n%(bi+1));return et.box(et.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>8&255,r&255,0,0,i>>8&255,i&255,0,0]))}static traf(e,t){const n=et.sdtp(e),r=e.id,i=Math.floor(t/(bi+1)),s=Math.floor(t%(bi+1));return et.box(et.types.traf,et.box(et.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),et.box(et.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,s>>24,s>>16&255,s>>8&255,s&255])),et.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,et.box(et.types.trak,et.tkhd(e),et.mdia(e))}static trex(e){const t=e.id;return et.box(et.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],r=n.length,i=12+16*r,s=new Uint8Array(i);let o,c,u,h,v,T;for(t+=8+i,s.set([e.type==="video"?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o>>24&255,u>>>16&255,u>>>8&255,u&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,v.isLeading<<2|v.dependsOn,v.isDependedOn<<6|v.hasRedundancy<<4|v.paddingValue<<1|v.isNonSync,v.degradPrio&61440,v.degradPrio&15,T>>>24&255,T>>>16&255,T>>>8&255,T&255],12+16*o);return et.box(et.types.trun,s)}static initSegment(e){et.types||et.init();const t=et.moov(e);return l(et.FTYP,t)}}et.types=void 0,et.HDLR_TYPES=void 0,et.STTS=void 0,et.STSC=void 0,et.STCO=void 0,et.STSZ=void 0,et.VMHD=void 0,et.SMHD=void 0,et.STSD=void 0,et.FTYP=void 0,et.DINF=void 0;const na=9e4;function Ss(a,e,t=1,n=!1){const r=a*e*t;return n?Math.round(r):r}function Eo(a,e,t=1,n=!1){return Ss(a,e,1/t,n)}function ji(a,e=!1){return Ss(a,1e3,1/na,e)}function xo(a,e=1){return Ss(a,na,1/e)}const To=10*1e3,ra=1024,Co=1152,Ao=1536;let ki=null,bs=null;class qi{constructor(e,t,n,r=""){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,ki===null){const s=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);ki=s?parseInt(s[1]):0}if(bs===null){const i=navigator.userAgent.match(/Safari\/(\d+)/i);bs=i?parseInt(i[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){b.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){b.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){b.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,r=e.reduce((i,s)=>{let o=s.pts,c=o-i;return c<-4294967296&&(t=!0,o=oi(o,n),c=o-i),c>0?i:o},n);return t&&b.debug("PTS rollover detected"),r}remux(e,t,n,r,i,s,o,c){let u,h,v,T,w,L,M=i,U=i;const re=e.pid>-1,Ze=t.pid>-1,Ge=t.samples.length,gt=e.samples.length>0,$e=o&&Ge>0||Ge>1;if((!re||gt)&&(!Ze||$e)||this.ISGenerated||o){if(this.ISGenerated){var dt,zt,dn,At;const Wn=this.videoTrackConfig;Wn&&(t.width!==Wn.width||t.height!==Wn.height||((dt=t.pixelRatio)==null?void 0:dt[0])!==((zt=Wn.pixelRatio)==null?void 0:zt[0])||((dn=t.pixelRatio)==null?void 0:dn[1])!==((At=Wn.pixelRatio)==null?void 0:At[1]))&&this.resetInitSegment()}else v=this.generateIS(e,t,i,s);const Gt=this.isVideoContiguous;let $n=-1,pn;if($e&&($n=Ro(t.samples),!Gt&&this.config.forceKeyFrameOnDiscontinuity))if(L=!0,$n>0){b.warn(`[mp4-remuxer]: Dropped ${$n} out of ${Ge} video samples due to a missing keyframe`);const Wn=this.getVideoStartPts(t.samples);t.samples=t.samples.slice($n),t.dropped+=$n,U+=(t.samples[0].pts-Wn)/t.inputTimeScale,pn=U}else $n===-1&&(b.warn(`[mp4-remuxer]: No keyframe found out of ${Ge} video samples`),L=!1);if(this.ISGenerated){if(gt&&$e){const Wn=this.getVideoStartPts(t.samples),Gn=(oi(e.samples[0].pts,Wn)-Wn)/t.inputTimeScale;M+=Math.max(0,Gn),U+=Math.max(0,-Gn)}if(gt){if(e.samplerate||(b.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),v=this.generateIS(e,t,i,s)),h=this.remuxAudio(e,M,this.isAudioContiguous,s,Ze||$e||c===vt.AUDIO?U:void 0),$e){const Wn=h?h.endPTS-h.startPTS:0;t.inputTimeScale||(b.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),v=this.generateIS(e,t,i,s)),u=this.remuxVideo(t,U,Gt,Wn)}}else $e&&(u=this.remuxVideo(t,U,Gt,0));u&&(u.firstKeyFrame=$n,u.independent=$n!==-1,u.firstKeyFramePTS=pn)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(w=ia(n,i,this._initPTS,this._initDTS)),r.samples.length&&(T=sa(r,i,this._initPTS))),{audio:h,video:u,initSegment:v,independent:L,text:T,id3:w}}generateIS(e,t,n,r){const i=e.samples,s=t.samples,o=this.typeSupported,c={},u=this._initPTS;let h=!u||r,v="audio/mp4",T,w,L;if(h&&(T=w=1/0),e.config&&i.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(v="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}c.audio={id:"audio",container:v,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):et.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(L=e.inputTimeScale,!u||L!==u.timescale?T=w=i[0].pts-Math.round(L*n):h=!1)}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:et.initSegment([t]),metadata:{width:t.width,height:t.height}},h)if(L=t.inputTimeScale,!u||L!==u.timescale){const M=this.getVideoStartPts(s),U=Math.round(L*n);w=Math.min(w,oi(s[0].dts,M)-U),T=Math.min(T,M-U)}else h=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:T,timescale:L},this._initDTS={baseTime:w,timescale:L}):T=L=void 0,{tracks:c,initPTS:T,timescale:L}}remuxVideo(e,t,n,r){const i=e.inputTimeScale,s=e.samples,o=[],c=s.length,u=this._initPTS;let h=this.nextAvcDts,v=8,T=this.videoSampleDuration,w,L,M=Number.POSITIVE_INFINITY,U=Number.NEGATIVE_INFINITY,re=!1;if(!n||h===null){const wn=t*i,vn=s[0].pts-oi(s[0].dts,s[0].pts);ki&&h!==null&&Math.abs(wn-vn-h)<15e3?n=!0:h=wn-vn}const Ze=u.baseTime*i/u.timescale;for(let wn=0;wn0?wn-1:wn].dts&&(re=!0)}re&&s.sort(function(wn,vn){const pr=wn.dts-vn.dts,tr=wn.pts-vn.pts;return pr||tr}),w=s[0].dts,L=s[s.length-1].dts;const Ge=L-w,gt=Ge?Math.round(Ge/(c-1)):T||e.inputTimeScale/30;if(n){const wn=w-h,vn=wn>gt,pr=wn<-1;if((vn||pr)&&(vn?b.warn(`AVC: ${ji(wn,!0)} ms (${wn}dts) hole between fragments detected at ${t.toFixed(3)}`):b.warn(`AVC: ${ji(-wn,!0)} ms (${wn}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!pr||h>=s[0].pts||ki)){w=h;const tr=s[0].pts-wn;if(vn)s[0].dts=w,s[0].pts=tr;else for(let br=0;brtr);br++)s[br].dts-=wn,s[br].pts-=wn;b.log(`Video: Initial PTS/DTS adjusted: ${ji(tr,!0)}/${ji(w,!0)}, delta: ${ji(wn,!0)} ms`)}}w=Math.max(0,w);let $e=0,Lt=0,dt=w;for(let wn=0;wn0?vn.dts-s[wn-1].dts:gt;if(br=wn>0?vn.pts-s[wn-1].pts:gt,Vr.stretchShortVideoTrack&&this.nextAudioPts!==null){const ci=Math.floor(Vr.maxBufferHole*i),Wi=(r?M+r*i:this.nextAudioPts)-vn.pts;Wi>ci?(T=Wi-Xr,T<0?T=Xr:Gt=!0,b.log(`[mp4-remuxer]: It is approximately ${Wi/90} ms to the next segment; using duration ${T/90} ms for the last video frame.`)):T=Xr}else T=Xr}const Ur=Math.round(vn.pts-vn.dts);$n=Math.min($n,T),Wn=Math.max(Wn,T),pn=Math.min(pn,br),Vn=Math.max(Vn,br),o.push(new aa(vn.key,T,tr,Ur))}if(o.length){if(ki){if(ki<70){const wn=o[0].flags;wn.dependsOn=2,wn.isNonSync=0}}else if(bs&&Vn-pn0&&(r&&Math.abs(Ze-re)<9e3||Math.abs(oi(M[0].pts-Ge,Ze)-re)<20*h),M.forEach(function(Gn){Gn.pts=oi(Gn.pts-Ge,Ze)}),!n||re<0){if(M=M.filter(Gn=>Gn.pts>=0),!M.length)return;i===0?re=0:r&&!L?re=Math.max(0,Ze):re=M[0].pts}if(e.segmentCodec==="aac"){const Gn=this.config.maxAudioFramesDrift;for(let dr=0,Ar=re;dr=Gn*h&&tr0){dt+=U;try{Lt=new Uint8Array(dt)}catch(tr){this.observer.emit(m.ERROR,m.ERROR,{type:J.MUX_ERROR,details:$.REMUX_ALLOC_ERROR,fatal:!1,error:tr,bytes:dt,reason:`fail allocating audio mdat ${dt}`});return}T||(new DataView(Lt.buffer).setUint32(0,dt),Lt.set(et.types.mdat,4))}else return;Lt.set(wn,U);const pr=wn.byteLength;U+=pr,w.push(new aa(!0,u,pr,0)),$e=vn}const dn=w.length;if(!dn)return;const At=w[w.length-1];this.nextAudioPts=re=$e+c*At.duration;const Gt=T?new Uint8Array(0):et.moof(e.sequenceNumber++,gt/c,de({},e,{samples:w}));e.samples=[];const $n=gt/s,pn=re/s,Vn={data1:Gt,data2:Lt,startPTS:$n,endPTS:pn,startDTS:$n,endDTS:pn,type:"audio",hasAudio:!0,hasVideo:!1,nb:dn};return this.isAudioContiguous=!0,Vn}remuxEmptyAudio(e,t,n,r){const i=e.inputTimeScale,s=e.samplerate?e.samplerate:i,o=i/s,c=this.nextAudioPts,u=this._initDTS,h=u.baseTime*9e4/u.timescale,v=(c!==null?c:r.startDTS*i)+h,T=r.endDTS*i+h,w=o*ra,L=Math.ceil((T-v)/w),M=ta.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(b.warn("[mp4-remuxer]: remux empty Audio"),!M){b.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const U=[];for(let re=0;re4294967296;)a+=t;return a}function Ro(a){for(let e=0;es.pts-o.pts);const i=a.samples;return a.samples=[],{samples:i}}class aa{constructor(e,t,n,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=n,this.cts=r,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class Io{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,r){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(An(e,r)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const r=this.initData=ht(e);r.audio&&(t=oa(r.audio,ie.AUDIO)),r.video&&(n=oa(r.video,ie.VIDEO));const i={};r.audio&&r.video?i.audiovideo={container:"video/mp4",codec:t+","+n,initSegment:e,id:"main"}:r.audio?i.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:r.video?i.video={container:"video/mp4",codec:n,initSegment:e,id:"main"}:b.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i}remux(e,t,n,r,i,s){var o,c;let{initPTS:u,lastEndTime:h}=this;const v={audio:void 0,video:void 0,text:r,id3:n,initSegment:void 0};B(h)||(h=this.lastEndTime=i||0);const T=t.samples;if(!(T!=null&&T.length))return v;const w={initPTS:void 0,timescale:1};let L=this.initData;if((o=L)!=null&&o.length||(this.generateInitSegment(T),L=this.initData),!((c=L)!=null&&c.length))return b.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),v;this.emitInitSegment&&(w.tracks=this.initTracks,this.emitInitSegment=!1);const M=On(T,L),U=Pn(L,T),re=U===null?i:U;(Lo(u,re,i,M)||w.timescale!==u.timescale&&s)&&(w.initPTS=re-i,u&&u.timescale===1&&b.warn(`Adjusting initPTS by ${w.initPTS-u.baseTime}`),this.initPTS=u={baseTime:w.initPTS,timescale:1});const Ze=e?re-u.baseTime/u.timescale:h,Ge=Ze+M;nr(L,T,u.baseTime/u.timescale),M>0?this.lastEndTime=Ge:(b.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const gt=!!L.audio,$e=!!L.video;let Lt="";gt&&(Lt+="audio"),$e&&(Lt+="video");const dt={data1:T,startPTS:Ze,startDTS:Ze,endPTS:Ge,endDTS:Ge,type:Lt,hasAudio:gt,hasVideo:$e,nb:1,dropped:0};return v.audio=dt.type==="audio"?dt:void 0,v.video=dt.type!=="audio"?dt:void 0,v.initSegment=w,v.id3=ia(n,i,u,u),r.samples.length&&(v.text=sa(r,i,u)),v}}function Lo(a,e,t,n){if(a===null)return!0;const r=Math.max(n,1),i=e-a.baseTime/a.timescale;return Math.abs(i-t)>r}function oa(a,e){const t=a==null?void 0:a.codec;if(t&&t.length>4)return t;if(e===ie.AUDIO){if(t==="ec-3"||t==="ac-3"||t==="alac")return t;if(t==="fLaC"||t==="Opus")return Et(t,!1);const n="mp4a.40.5";return b.info(`Parsed audio codec "${t}" or audio object type not handled. Using "${n}"`),n}return b.warn(`Unhandled video codec "${t}"`),t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":"avc1.42e01e"}let pi;try{pi=self.performance.now.bind(self.performance)}catch(a){b.debug("Unable to use Performance API on this environment"),pi=Pe==null?void 0:Pe.Date.now}const es=[{demux:ho,remux:Io},{demux:Si,remux:qi},{demux:uo,remux:qi},{demux:bo,remux:qi}];es.splice(2,0,{demux:mo,remux:qi});class la{constructor(e,t,n,r,i){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=r,this.id=i}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,r){const i=n.transmuxing;i.executeStart=pi();let s=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:c}=this;r&&(this.currentTransmuxState=r);const{contiguous:u,discontinuity:h,trackSwitch:v,accurateTimeOffset:T,timeOffset:w,initSegmentChange:L}=r||o,{audioCodec:M,videoCodec:U,defaultInitPts:re,duration:Ze,initSegmentData:Ge}=c,gt=wo(s,t);if(gt&>.method==="AES-128"){const zt=this.getDecrypter();if(zt.isSync()){let dn=zt.softwareDecrypt(s,gt.key.buffer,gt.iv.buffer);if(n.part>-1&&(dn=zt.flush()),!dn)return i.executeEnd=pi(),Es(n);s=new Uint8Array(dn)}else return this.decryptionPromise=zt.webCryptoDecrypt(s,gt.key.buffer,gt.iv.buffer).then(dn=>{const At=this.push(dn,null,n);return this.decryptionPromise=null,At}),this.decryptionPromise}const $e=this.needsProbing(h,v);if($e){const zt=this.configureTransmuxer(s);if(zt)return b.warn(`[transmuxer] ${zt.message}`),this.observer.emit(m.ERROR,m.ERROR,{type:J.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,error:zt,reason:zt.message}),i.executeEnd=pi(),Es(n)}(h||v||L||$e)&&this.resetInitSegment(Ge,M,U,Ze,t),(h||L||$e)&&this.resetInitialTimestamp(re),u||this.resetContiguity();const Lt=this.transmux(s,gt,w,T,n),dt=this.currentTransmuxState;return dt.contiguous=!0,dt.discontinuity=!1,dt.trackSwitch=!1,i.executeEnd=pi(),Lt}flush(e){const t=e.transmuxing;t.executeStart=pi();const{decrypter:n,currentTransmuxState:r,decryptionPromise:i}=this;if(i)return i.then(()=>this.flush(e));const s=[],{timeOffset:o}=r;if(n){const v=n.flush();v&&s.push(this.push(v,null,e))}const{demuxer:c,remuxer:u}=this;if(!c||!u)return t.executeEnd=pi(),[Es(e)];const h=c.flush(o);return ts(h)?h.then(v=>(this.flushRemux(s,v,e),s)):(this.flushRemux(s,h,e),s)}flushRemux(e,t,n){const{audioTrack:r,videoTrack:i,id3Track:s,textTrack:o}=t,{accurateTimeOffset:c,timeOffset:u}=this.currentTransmuxState;b.log(`[transmuxer.ts]: Flushed fragment ${n.sn}${n.part>-1?" p: "+n.part:""} of level ${n.level}`);const h=this.remuxer.remux(r,i,s,o,u,c,!0,this.id);e.push({remuxResult:h,chunkMeta:n}),n.transmuxing.executeEnd=pi()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;!t||!n||(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,r,i){const{demuxer:s,remuxer:o}=this;!s||!o||(s.resetInitSegment(e,t,n,r),o.resetInitSegment(e,t,n,i))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,r,i){let s;return t&&t.method==="SAMPLE-AES"?s=this.transmuxSampleAes(e,t,n,r,i):s=this.transmuxUnencrypted(e,n,r,i),s}transmuxUnencrypted(e,t,n,r){const{audioTrack:i,videoTrack:s,id3Track:o,textTrack:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(i,s,o,c,t,n,!1,this.id),chunkMeta:r}}transmuxSampleAes(e,t,n,r,i){return this.demuxer.demuxSampleAes(e,t,n).then(s=>({remuxResult:this.remuxer.remux(s.audioTrack,s.videoTrack,s.id3Track,s.textTrack,n,r,!1,this.id),chunkMeta:i}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:r,vendor:i}=this;let s;for(let T=0,w=es.length;T0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const Es=a=>({remuxResult:{},chunkMeta:a});function ts(a){return"then"in a&&a.then instanceof Function}class Do{constructor(e,t,n,r,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=r,this.defaultInitPts=i||null}}class Oo{constructor(e,t,n,r,i,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=r,this.timeOffset=i,this.initSegmentChange=s}}var ca={exports:{}};(function(a){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function r(c,u,h){this.fn=c,this.context=u,this.once=h||!1}function i(c,u,h,v,T){if(typeof h!="function")throw new TypeError("The listener must be a function");var w=new r(h,v||c,T),L=t?t+u:u;return c._events[L]?c._events[L].fn?c._events[L]=[c._events[L],w]:c._events[L].push(w):(c._events[L]=w,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],h,v;if(this._eventsCount===0)return u;for(v in h=this._events)e.call(h,v)&&u.push(t?v.slice(1):v);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(h)):u},o.prototype.listeners=function(u){var h=t?t+u:u,v=this._events[h];if(!v)return[];if(v.fn)return[v.fn];for(var T=0,w=v.length,L=new Array(w);T{h=h||{},h.frag=this.frag,h.id=this.id,u===m.ERROR&&(this.error=h.error),this.hls.trigger(u,h)};this.observer=new xs,this.observer.on(m.FRAG_DECRYPTED,s),this.observer.on(m.ERROR,s);const o=Ft(i.preferManagedMediaSource)||{isTypeSupported:()=>!1},c={mpeg:o.isTypeSupported("audio/mpeg"),mp3:o.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:o.isTypeSupported('audio/mp4; codecs="ac-3"')};if(this.useWorker&&typeof Worker!="undefined"&&(i.workerPath||Xa())){try{i.workerPath?(b.log(`loading Web Worker ${i.workerPath} for "${t}"`),this.workerContext=Qa(i.workerPath)):(b.log(`injecting Web Worker for "${t}"`),this.workerContext=Ja()),this.onwmsg=v=>this.onWorkerMessage(v);const{worker:h}=this.workerContext;h.addEventListener("message",this.onwmsg),h.onerror=v=>{const T=new Error(`${v.message} (${v.filename}:${v.lineno})`);i.enableWorker=!1,b.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(m.ERROR,{type:J.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:T})},h.postMessage({cmd:"init",typeSupported:c,vendor:"",id:t,config:JSON.stringify(i)})}catch(h){b.warn(`Error setting up "${t}" Web Worker, fallback to inline`,h),this.resetWorker(),this.error=null,this.transmuxer=new la(this.observer,c,i,"",t)}return}this.transmuxer=new la(this.observer,c,i,"",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,r,i,s,o,c,u,h){var v,T;u.transmuxing.start=self.performance.now();const{transmuxer:w}=this,L=s?s.start:i.start,M=i.decryptdata,U=this.frag,re=!(U&&i.cc===U.cc),Ze=!(U&&u.level===U.level),Ge=U?u.sn-U.sn:-1,gt=this.part?u.part-this.part.index:-1,$e=Ge===0&&u.id>1&&u.id===(U==null?void 0:U.stats.chunkCount),Lt=!Ze&&(Ge===1||Ge===0&&(gt===1||$e&><=0)),dt=self.performance.now();(Ze||Ge||i.stats.parsing.start===0)&&(i.stats.parsing.start=dt),s&&(gt||!Lt)&&(s.stats.parsing.start=dt);const zt=!(U&&((v=i.initSegment)==null?void 0:v.url)===((T=U.initSegment)==null?void 0:T.url)),dn=new Oo(re,Lt,c,Ze,L,zt);if(!Lt||re||zt){b.log(`[transmuxer-interface, ${i.type}]: Starting new transmux session for sn: ${u.sn} p: ${u.part} level: ${u.level} id: ${u.id} discontinuity: ${re} trackSwitch: ${Ze} contiguous: ${Lt} accurateTimeOffset: ${c} timeOffset: ${L} initSegmentChange: ${zt}`);const At=new Do(n,r,t,o,h);this.configureTransmuxer(At)}if(this.frag=i,this.part=s,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:M,chunkMeta:u,state:dn},e instanceof ArrayBuffer?[e]:[]);else if(w){const At=w.push(e,M,u,dn);ts(At)?(w.async=!0,At.then(Gt=>{this.handleTransmuxComplete(Gt)}).catch(Gt=>{this.transmuxerError(Gt,u,"transmuxer-interface push error")})):(w.async=!1,this.handleTransmuxComplete(At))}}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);ts(n)||t.async?(ts(n)||(n=Promise.resolve(n)),n.then(i=>{this.handleFlushResult(i,e)}).catch(i=>{this.transmuxerError(i,e,"transmuxer-interface flush error")})):this.handleFlushResult(n,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(m.ERROR,{type:J.MEDIA_ERROR,details:$.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)){b.warn(`worker message received with no ${t?"event name":"data"}`);return}const n=this.hls;if(this.hls)switch(t.event){case"init":{var r;const i=(r=this.workerContext)==null?void 0:r.objectURL;i&&self.URL.revokeObjectURL(i);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}case"workerLog":b[t.data.logType]&&b[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 Mo extends Zi{constructor(e,t,n){super(e,t,n,"[audio-stream-controller]",vt.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(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(m.ERROR,this.onError,this),e.on(m.BUFFER_RESET,this.onBufferReset,this),e.on(m.BUFFER_CREATED,this.onBufferCreated,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(m.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(m.ERROR,this.onError,this),e.off(m.BUFFER_RESET,this.onBufferReset,this),e.off(m.BUFFER_CREATED,this.onBufferCreated,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(m.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:i}){if(n==="main"){const s=t.cc;this.initPTS[t.cc]={baseTime:r,timescale:i},this.log(`InitPTS for cc: ${s} found from main: ${r}`),this.videoTrackCC=s,this.state===Rt.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=Rt.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=Rt.IDLE):(this.loadedmetadata=!1,this.state=Rt.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case Rt.IDLE:this.doTickIdle();break;case Rt.WAITING_TRACK:{var e;const{levels:n,trackId:r}=this,i=n==null||(e=n[r])==null?void 0:e.details;if(i){if(this.waitForCdnTuneIn(i))break;this.state=Rt.WAITING_INIT_PTS}break}case Rt.FRAG_LOADING_WAITING_RETRY:{var t;const n=performance.now(),r=this.retryDate;if(!r||n>=r||(t=this.media)!=null&&t.seeking){const{levels:i,trackId:s}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((i==null?void 0:i[s])||null),this.state=Rt.IDLE}break}case Rt.WAITING_INIT_PTS:{const n=this.waitingData;if(n){const{frag:r,part:i,cache:s,complete:o}=n;if(this.initPTS[r.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=Rt.FRAG_LOADING;const c=s.flush(),u={frag:r,part:i,payload:c,networkDetails:null};this._handleFragmentLoadProgress(u),o&&super._handleFragmentLoadComplete(u)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${r.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const c=this.getLoadPosition(),u=mr.bufferInfo(this.mediaBuffer,c,this.config.maxBufferHole);Sr(u.end,this.config.maxFragLookUpTolerance,r)<0&&(this.log(`Waiting fragment cc (${r.cc}) @ ${r.start} cancelled because another fragment at ${u.end} is needed`),this.clearWaitingFragment())}}else this.state=Rt.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=Rt.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:r}=this,i=e.config;if(!this.buffering||!n&&(this.startFragRequested||!i.startFragPrefetch)||!(t!=null&&t[r]))return;const s=t[r],o=s.details;if(!o||o.live&&this.levelLastLoaded!==s||this.waitForCdnTuneIn(o)){this.state=Rt.WAITING_TRACK;return}const c=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&c&&(this.bufferFlushed=!1,this.afterBufferFlushed(c,ie.AUDIO,vt.AUDIO));const u=this.getFwdBufferInfo(c,vt.AUDIO);if(u===null)return;if(!this.switchingTrack&&this._streamEnded(u,o)){e.trigger(m.BUFFER_EOS,{type:"audio"}),this.state=Rt.ENDED;return}const h=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,vt.MAIN),v=u.len,T=this.getMaxBufferLength(h==null?void 0:h.len),w=o.fragments,L=w[0].start,M=this.getLoadPosition(),U=this.flushing?M:u.end;if(this.switchingTrack&&n){const gt=M;o.PTSKnown&>L||u.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=L+.05)}if(v>=T&&!this.switchingTrack&&Uh.end+o.targetduration;if(Ge||!(h!=null&&h.len)&&u.len){const gt=this.getAppendedFrag(re.start,vt.MAIN);if(gt===null||(Ze||(Ze=!!gt.gap||!!Ge&&h.len===0),Ge&&!Ze||Ze&&u.nextStart&&u.nextStartnew lr(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),n?this.setInterval(da):this.resetTransmuxer(),n?(this.switchingTrack=t,this.state=Rt.IDLE,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=Rt.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(m.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var n;if(this.mainDetails==null){this.cachedTrackLoadedData=t;return}const{levels:r}=this,{details:i,id:s}=t;if(!r){this.warn(`Audio tracks were reset while loading level ${s}`);return}this.log(`Audio track ${s} loaded [${i.startSN},${i.endSN}]${i.lastPartSn?`[part-${i.lastPartSn}-${i.lastPartIndex}]`:""},duration:${i.totalduration}`);const o=r[s];let c=0;if(i.live||(n=o.details)!=null&&n.live){this.checkLiveUpdate(i);const h=this.mainDetails;if(i.deltaUpdateFailed||!h)return;if(!o.details&&i.hasProgramDateTime&&h.hasProgramDateTime)Mi(i,h),c=i.fragments[0].start;else{var u;c=this.alignPlaylists(i,o.details,(u=this.levelLastLoaded)==null?void 0:u.details)}}o.details=i,this.levelLastLoaded=o,!this.startFragRequested&&(this.mainDetails||!i.live)&&this.setStartPosition(this.mainDetails||i,c),this.state===Rt.WAITING_TRACK&&!this.waitForCdnTuneIn(i)&&(this.state=Rt.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:r,payload:i}=e,{config:s,trackId:o,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const u=c[o];if(!u){this.warn("Audio track is undefined on fragment load progress");return}const h=u.details;if(!h){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const v=s.defaultAudioCodec||u.audioCodec||"mp4a.40.2";let T=this.transmuxer;T||(T=this.transmuxer=new ua(this.hls,vt.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const w=this.initPTS[n.cc],L=(t=n.initSegment)==null?void 0:t.data;if(w!==void 0){const U=r?r.index:-1,re=U!==-1,Ze=new Oi(n.level,n.sn,n.stats.chunkCount,i.byteLength,U,re);T.push(i,L,v,"",n,r,h.totalduration,!1,Ze,w)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${h.startSN} ,${h.endSN}],track ${o}`);const{cache:M}=this.waitingData=this.waitingData||{frag:n,part:r,cache:new Hs,complete:!1};M.push(new Uint8Array(i)),this.waitingVideoCC=this.videoTrackCC,this.state=Rt.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:r}=t;if(n.type!==vt.AUDIO){if(!this.loadedmetadata&&n.type===vt.MAIN){const i=this.videoBuffer||this.media;i&&mr.getBuffered(i).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(n.sn!=="initSegment"){this.fragPrevious=n;const i=this.switchingTrack;i&&(this.bufferedTrack=i,this.switchingTrack=null,this.hls.trigger(m.AUDIO_TRACK_SWITCHED,H({},i)))}this.fragBufferedComplete(n,r)}onError(e,t){var n;if(t.fatal){this.state=Rt.ERROR;return}switch(t.details){case $.FRAG_GAP:case $.FRAG_PARSING_ERROR:case $.FRAG_DECRYPT_ERROR:case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(vt.AUDIO,t);break;case $.AUDIO_TRACK_LOAD_ERROR:case $.AUDIO_TRACK_LOAD_TIMEOUT:case $.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===Rt.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===xt.AUDIO_TRACK&&(this.state=Rt.IDLE);break;case $.BUFFER_APPEND_ERROR:case $.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;if(t.details===$.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case $.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==ie.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==ie.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===Rt.ENDED&&(this.state=Rt.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,vt.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:r}=this,{remuxResult:i,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:c,part:u,level:h}=o,{details:v}=h,{audio:T,text:w,id3:L,initSegment:M}=i;if(this.fragContextChanged(c)||!v){this.fragmentTracker.removeFragment(c);return}if(this.state=Rt.PARSING,this.switchingTrack&&T&&this.completeAudioSwitch(this.switchingTrack),M!=null&&M.tracks){const U=c.initSegment||c;this._bufferInitSegment(h,M.tracks,U,s),r.trigger(m.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:n,tracks:M.tracks})}if(T){const{startPTS:U,endPTS:re,startDTS:Ze,endDTS:Ge}=T;u&&(u.elementaryStreams[ie.AUDIO]={startPTS:U,endPTS:re,startDTS:Ze,endDTS:Ge}),c.setElementaryStreamInfo(ie.AUDIO,U,re,Ze,Ge),this.bufferFragmentData(T,c,u,s)}if(L!=null&&(t=L.samples)!=null&&t.length){const U=de({id:n,frag:c,details:v},L);r.trigger(m.FRAG_PARSING_METADATA,U)}if(w){const U=de({id:n,frag:c,details:v},w);r.trigger(m.FRAG_PARSING_USERDATA,U)}}_bufferInitSegment(e,t,n,r){if(this.state!==Rt.PARSING)return;t.video&&delete t.video;const i=t.audio;if(!i)return;i.id="audio";const s=e.audioCodec;this.log(`Init audio buffer, container:${i.container}, codecs[level/parsed]=[${s}/${i.codec}]`),s&&s.split(",").length===1&&(i.levelCodec=s),this.hls.trigger(m.BUFFER_CODECS,t);const o=i.initSegment;if(o!=null&&o.byteLength){const c={type:"audio",frag:n,part:null,chunkMeta:r,parent:n.type,data:o};this.hls.trigger(m.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||r===cr.NOT_LOADED||r===cr.PARTIAL){var i;if(e.sn==="initSegment")this._loadInitSegment(e,t);else if((i=t.details)!=null&&i.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=Rt.WAITING_INIT_PTS;const s=this.mainDetails;s&&s.fragments[0].start!==t.details.fragments[0].start&&Mi(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:r,characteristics:i,audioCodec:s,channels:o}=this.bufferedTrack;ri({name:t,lang:n,assocLang:r,characteristics:i,audioCodec:s,channels:o},e,Bn)||(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(m.AUDIO_TRACK_SWITCHED,H({},e))}}function fa(a,e){if(a.length!==e.length)return!1;for(let t=0;ta[r]!==e[r])}function Ts(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}class _o extends ir{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(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.LEVEL_LOADING,this.onLevelLoading,this),e.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(m.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:r,details:i}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==r){this.warn(`Audio track with id:${n} and group:${r} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Audio track ${n} "${s.name}" lang:${s.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,r=this.groupIds;let i=this.currentTrack;if(!n||(r==null?void 0:r.length)!==(n==null?void 0:n.length)||n!=null&&n.some(o=>(r==null?void 0:r.indexOf(o))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(T=>!n||n.indexOf(T.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(T=>T.default)&&(this.selectDefaultTrack=!1),o.forEach((T,w)=>{T.id=w});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const c=this.hls.config.audioPreference;if(!i&&c){const T=ei(c,o,Bn);if(T>-1)i=o[T];else{const w=ei(c,this.tracks);i=this.tracks[w]}}let u=this.findTrackId(i);u===-1&&i&&(u=this.findTrackId(null));const h={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(m.AUDIO_TRACKS_UPDATED,h);const v=this.trackId;if(u!==-1&&v===-1)this.setAudioTrack(u);else if(o.length&&v===-1){var s;const T=new Error(`No audio track selected for current audio group-ID(s): ${(s=this.groupIds)==null?void 0:s.join(",")} track count: ${o.length}`);this.warn(T.message),this.hls.trigger(m.ERROR,{type:J.MEDIA_ERROR,details:$.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:T})}}else this.shouldReloadPlaylist(i)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===xt.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 r=this.currentTrack;if(r&&ri(e,r,Bn))return r;const i=ei(e,this.tracksInGroup,Bn);if(i>-1){const s=this.tracksInGroup[i];return this.setAudioTrack(i),s}else if(r){let s=t.loadLevel;s===-1&&(s=t.firstAutoLevel);const o=Fr(e,t.levels,n,s,Bn);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const s=ei(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,r=t[e],i=r.details&&!r.details.live;if(e===this.trackId&&r===n&&i||(this.log(`Switching to audio-track ${e} "${r.name}" lang:${r.lang} group:${r.groupId} channels:${r.channels}`),this.trackId=e,this.currentTrack=r,this.hls.trigger(m.AUDIO_TRACK_SWITCHING,H({},r)),i))return;const s=this.switchParams(r.url,n==null?void 0:n.details,r.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n=i[u].start&&o<=i[u].end){s=i[u];break}const c=n.start+n.duration;s?s.end=c:(s={start:o,end:c},i.push(s)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null)}onBufferFlushing(e,t){const{startOffset:n,endOffset:r}=t;if(n===0&&r!==Number.POSITIVE_INFINITY){const i=r-1;if(i<=0)return;t.endOffsetSubtitles=Math.max(0,i),this.tracksBuffered.forEach(s=>{for(let o=0;onew lr(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const r=new lr(n);return this.tracksBuffered[r.id]=[],r}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,vt.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}const r=this.levels[this.currentTrackId];r!=null&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.setInterval(ha)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:r,levels:i}=this,{details:s,id:o}=t;if(!i){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const c=i[o];if(o>=i.length||!c)return;this.log(`Subtitle track ${o} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let u=0;if(s.live||(n=c.details)!=null&&n.live){const v=this.mainDetails;if(s.deltaUpdateFailed||!v)return;const T=v.fragments[0];if(!c.details)s.hasProgramDateTime&&v.hasProgramDateTime?(Mi(s,v),u=s.fragments[0].start):T&&(u=T.start,Mr(s,u));else{var h;u=this.alignPlaylists(s,c.details,(h=this.levelLastLoaded)==null?void 0:h.details),u===0&&T&&(u=T.start,Mr(s,u))}}c.details=s,this.levelLastLoaded=c,o===r&&(!this.startFragRequested&&(this.mainDetails||!s.live)&&this.setStartPosition(this.mainDetails||s,u),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===Rt.IDLE&&(zn(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),c.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,r=t.decryptdata,i=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&r!=null&&r.key&&r.iv&&r.method==="AES-128"){const s=performance.now();this.decrypter.decrypt(new Uint8Array(n),r.key.buffer,r.iv.buffer).catch(o=>{throw i.trigger(m.ERROR,{type:J.MEDIA_ERROR,details:$.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const c=performance.now();i.trigger(m.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:s,tdecrypt:c}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=Rt.IDLE})}}doTick(){if(!this.media){this.state=Rt.IDLE;return}if(this.state===Rt.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details)return;const{config:r}=this,i=this.getLoadPosition(),s=mr.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,r.maxBufferHole),{end:o,len:c}=s,u=this.getFwdBufferInfo(this.media,vt.MAIN),h=n.details,v=this.getMaxBufferLength(u==null?void 0:u.len)+h.levelTargetDuration;if(c>v)return;const T=h.fragments,w=T.length,L=h.edge;let M=null;const U=this.fragPrevious;if(oL-re?0:re;M=zn(U,T,Math.max(T[0].start,o),Ze),!M&&U&&U.start{if(r=r>>>0,r>i-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${r}) is greater than the maximum bound (${i})`);return e[r][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}class ko extends ir{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=Ct(this.media.textTracks);for(let i=0;i-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.LEVEL_LOADING,this.onLevelLoading,this),e.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.LEVEL_LOADING,this.onLevelLoading,this),e.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(m.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),Ct(this.media.textTracks).forEach(t=>{kn(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:r,details:i}=t,s=this.tracksInGroup[n];if(!s||s.groupId!==r){this.warn(`Subtitle track with id:${n} and group:${r} not found in active group ${s==null?void 0:s.groupId}`);return}const o=s.details;s.details=t.details,this.log(`Subtitle track ${n} "${s.name}" lang:${s.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,r=this.groupIds;let i=this.currentTrack;if(!n||(r==null?void 0:r.length)!==(n==null?void 0:n.length)||n!=null&&n.some(s=>(r==null?void 0:r.indexOf(s))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const s=this.tracks.filter(h=>!n||n.indexOf(h.groupId)!==-1);if(s.length)this.selectDefaultTrack&&!s.some(h=>h.default)&&(this.selectDefaultTrack=!1),s.forEach((h,v)=>{h.id=v});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=s;const o=this.hls.config.subtitlePreference;if(!i&&o){this.selectDefaultTrack=!1;const h=ei(o,s);if(h>-1)i=s[h];else{const v=ei(o,this.tracks);i=this.tracks[v]}}let c=this.findTrackId(i);c===-1&&i&&(c=this.findTrackId(null));const u={subtitleTracks:s};this.log(`Updating subtitle tracks, ${s.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(m.SUBTITLE_TRACKS_UPDATED,u),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}else this.shouldReloadPlaylist(i)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let r=0;r-1){const i=this.tracksInGroup[r];return this.setSubtitleTrack(r),i}else{if(n)return null;{const i=ei(e,t);if(i>-1)return t[i]}}}}return null}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){const n=t.id,r=t.groupId;let i=t.url;if(e)try{i=e.addDirectives(i)}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(m.SUBTITLE_TRACK_LOADING,{url:i,id:n,groupId:r,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Ct(e.textTracks),n=this.currentTrack;let r;if(n&&(r=t.filter(i=>Ts(n,i))[0],r||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(i=>{i.mode!=="disabled"&&i!==r&&(i.mode="disabled")}),r){const i=this.subtitleDisplay?"showing":"hidden";r.mode!==i&&(r.mode=i)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!B(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,r=t[e]||null;if(this.trackId=e,this.currentTrack=r,this.toggleTrackModes(),!r){this.hls.trigger(m.SUBTITLE_TRACK_SWITCH,{id:e});return}const i=!!r.details&&!r.details.live;if(e===this.trackId&&r===n&&i)return;this.log(`Switching to subtitle-track ${e}`+(r?` "${r.name}" lang:${r.lang} group:${r.groupId}`:""));const{id:s,groupId:o="",name:c,type:u,url:h}=r;this.hls.trigger(m.SUBTITLE_TRACK_SWITCH,{id:s,groupId:o,name:c,type:u,url:h});const v=this.switchParams(r.url,n==null?void 0:n.details,r.details);this.loadPlaylist(v)}}class Fo{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t,n){const r=this.queues[t];r.push(e),r.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(i=>{t=i}),r={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(r,e),n}executeNext(e){const t=this.queues[e];if(t.length){const n=t[0];try{n.execute()}catch(r){b.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${r}`),n.onError(r);const i=this.buffers[e];i!=null&&i.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const ma=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class Uo{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:r}=this;this.log("Media source opened"),n&&(n.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(m.MEDIA_ATTACHED,{media:n,mediaSource:r})),r&&r.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:r}=this;n!==r&&b.error(`Media element src was set while attaching MediaSource (${r} > ${n})`)},this.hls=e;const t="[buffer-controller]";this.appendSource=Ut(Ft(e.config.preferManagedMediaSource)),this.log=b.log.bind(b,t),this.warn=b.warn.bind(b,t),this.error=b.error.bind(b,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(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.BUFFER_RESET,this.onBufferReset,this),e.on(m.BUFFER_APPENDING,this.onBufferAppending,this),e.on(m.BUFFER_CODECS,this.onBufferCodecs,this),e.on(m.BUFFER_EOS,this.onBufferEos,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(m.FRAG_PARSED,this.onFragParsed,this),e.on(m.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.BUFFER_RESET,this.onBufferReset,this),e.off(m.BUFFER_APPENDING,this.onBufferAppending,this),e.off(m.BUFFER_CODECS,this.onBufferCodecs,this),e.off(m.BUFFER_EOS,this.onBufferEos,this),e.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(m.FRAG_PARSED,this.onFragParsed,this),e.off(m.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new Fo(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,r=Ft(this.appendSource);if(n&&r){var i;const s=this.mediaSource=new r;this.log(`created media source: ${(i=s.constructor)==null?void 0:i.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 o=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{n.removeAttribute("src");const c=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||c&&s instanceof c,ga(n),zo(n,o),n.load()}catch(c){n.src=o}else n.src=o;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(r){this.warn(`onMediaDetaching: ${r.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&&ga(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(m.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(r){this.warn(`onBufferReset ${e}`,r)}}onBufferCodecs(e,t){const n=this.getSourceBufferTypes().length,r=Object.keys(t);if(r.forEach(s=>{if(n){const c=this.tracks[s];if(c&&typeof c.buffer.changeType=="function"){var o;const{id:u,codec:h,levelCodec:v,container:T,metadata:w}=t[s],L=St(c.codec,c.levelCodec),M=L==null?void 0:L.replace(ma,"$1");let U=St(h,v);const re=(o=U)==null?void 0:o.replace(ma,"$1");if(U&&M!==re){s.slice(0,5)==="audio"&&(U=Et(U,this.appendSource));const Ze=`${T};codecs=${U}`;this.appendChangeType(s,Ze),this.log(`switching codec ${L} to ${U}`),this.tracks[s]={buffer:c.buffer,codec:h,container:T,levelCodec:v,metadata:w,id:u}}}}else this.pendingTracks[s]=t[s]}),n)return;const i=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==i&&(this.log(`${i} bufferCodec event(s) expected ${r.join(",")}`),this.bufferCodecEventsExpected=i),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(e,t){const{operationQueue:n}=this,r={execute:()=>{const i=this.sourceBuffer[e];i&&(this.log(`changing ${e} sourceBuffer type to ${t}`),i.changeType(t)),n.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:i=>{this.warn(`Failed to change ${e} SourceBuffer type`,i)}};n.append(r,e,!!this.pendingTracks[e])}onBufferAppending(e,t){const{hls:n,operationQueue:r,tracks:i}=this,{data:s,type:o,frag:c,part:u,chunkMeta:h}=t,v=h.buffering[o],T=self.performance.now();v.start=T;const w=c.stats.buffering,L=u?u.stats.buffering:null;w.start===0&&(w.start=T),L&&L.start===0&&(L.start=T);const M=i.audio;let U=!1;o==="audio"&&(M==null?void 0:M.container)==="audio/mpeg"&&(U=!this.lastMpegAudioChunk||h.id===1||this.lastMpegAudioChunk.sn!==h.sn,this.lastMpegAudioChunk=h);const re=c.start,Ze={execute:()=>{if(v.executeStart=self.performance.now(),U){const Ge=this.sourceBuffer[o];if(Ge){const gt=re-Ge.timestampOffset;Math.abs(gt)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${re} (delta: ${gt}) sn: ${c.sn})`),Ge.timestampOffset=re)}}this.appendExecutor(s,o)},onStart:()=>{},onComplete:()=>{const Ge=self.performance.now();v.executeEnd=v.end=Ge,w.first===0&&(w.first=Ge),L&&L.first===0&&(L.first=Ge);const{sourceBuffer:gt}=this,$e={};for(const Lt in gt)$e[Lt]=mr.getBuffered(gt[Lt]);this.appendErrors[o]=0,o==="audio"||o==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(m.BUFFER_APPENDED,{type:o,frag:c,part:u,chunkMeta:h,parent:c.type,timeRanges:$e})},onError:Ge=>{const gt={type:J.MEDIA_ERROR,parent:c.type,details:$.BUFFER_APPEND_ERROR,sourceBufferName:o,frag:c,part:u,chunkMeta:h,error:Ge,err:Ge,fatal:!1};if(Ge.code===DOMException.QUOTA_EXCEEDED_ERR)gt.details=$.BUFFER_FULL_ERROR;else{const $e=++this.appendErrors[o];gt.details=$.BUFFER_APPEND_ERROR,this.warn(`Failed ${$e}/${n.config.appendErrorMaxRetry} times to append segment in "${o}" sourceBuffer`),$e>=n.config.appendErrorMaxRetry&&(gt.fatal=!0)}n.trigger(m.ERROR,gt)}};r.append(Ze,o,!!this.pendingTracks[o])}onBufferFlushing(e,t){const{operationQueue:n}=this,r=i=>({execute:this.removeExecutor.bind(this,i,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(m.BUFFER_FLUSHED,{type:i})},onError:s=>{this.warn(`Failed to remove from ${i} SourceBuffer`,s)}});t.type?n.append(r(t.type),t.type):this.getSourceBufferTypes().forEach(i=>{n.append(r(i),i)})}onFragParsed(e,t){const{frag:n,part:r}=t,i=[],s=r?r.elementaryStreams:n.elementaryStreams;s[ie.AUDIOVIDEO]?i.push("audiovideo"):(s[ie.AUDIO]&&i.push("audio"),s[ie.VIDEO]&&i.push("video"));const o=()=>{const c=self.performance.now();n.stats.buffering.end=c,r&&(r.stats.buffering.end=c);const u=r?r.stats:n.stats;this.hls.trigger(m.FRAG_BUFFERED,{frag:n,part:r,stats:u,id:n.type})};i.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(o,i)}onFragChanged(e,t){this.trimBuffers()}onBufferEos(e,t){this.getSourceBufferTypes().reduce((r,i)=>{const s=this.sourceBuffer[i];return s&&(!t.type||t.type===i)&&(s.ending=!0,s.ended||(s.ended=!0,this.log(`${i} sourceBuffer now EOS`))),r&&!!(!s||s.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(i=>{const s=this.sourceBuffer[i];s&&(s.ending=!1)});const{mediaSource:r}=this;if(!r||r.readyState!=="open"){r&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${r.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),r.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 i=e.config,s=n.currentTime,o=t.levelTargetDuration,c=t.live&&i.liveBackBufferLength!==null?i.liveBackBufferLength:i.backBufferLength;if(B(c)&&c>0){const u=Math.max(c,o),h=Math.floor(s/o)*o-u;this.flushBackBuffer(s,o,h)}if(B(i.frontBufferFlushThreshold)&&i.frontBufferFlushThreshold>0){const u=Math.max(i.maxBufferLength,i.frontBufferFlushThreshold),h=Math.max(u,o),v=Math.floor(s/o)*o+h;this.flushFrontBuffer(s,o,v)}}flushBackBuffer(e,t,n){const{details:r,sourceBuffer:i}=this;this.getSourceBufferTypes().forEach(o=>{const c=i[o];if(c){const u=mr.getBuffered(c);if(u.length>0&&n>u.start(0)){if(this.hls.trigger(m.BACK_BUFFER_REACHED,{bufferEnd:n}),r!=null&&r.live)this.hls.trigger(m.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(c.ended&&u.end(u.length-1)-e{const o=r[s];if(o){const c=mr.getBuffered(o),u=c.length;if(u<2)return;const h=c.start(u-1),v=c.end(u-1);if(n>h||e>=h&&e<=v)return;if(o.ended&&e-v<2*t){this.log(`Cannot flush ${s} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(m.BUFFER_FLUSHING,{startOffset:h,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:r}=this,i=e.fragments[0].start+e.totalduration,s=n.duration,o=B(r.duration)?r.duration:0;e.live&&t.config.liveDurationInfinity?(r.duration=1/0,this.updateSeekableRange(e)):(i>o&&i>s||!B(s))&&(this.log(`Updating Media Source duration to ${i.toFixed(3)}`),r.duration=i)}updateSeekableRange(e){const t=this.mediaSource,n=e.fragments;if(n.length&&e.live&&t!=null&&t.setLiveSeekableRange){const i=Math.max(0,n[0].start),s=Math.max(i,i+e.totalduration);this.log(`Media Source duration is set to ${t.duration}. Setting seekable range to ${i}-${s}.`),t.setLiveSeekableRange(i,s)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:n}=this,r=Object.keys(n).length;if(r&&(!e||r===2||"audiovideo"in n)){this.createSourceBuffers(n),this.pendingTracks={};const i=this.getSourceBufferTypes();if(i.length)this.hls.trigger(m.BUFFER_CREATED,{tracks:this.tracks}),i.forEach(s=>{t.executeNext(s)});else{const s=new Error("could not create source buffer for media codec(s)");this.hls.trigger(m.ERROR,{type:J.MEDIA_ERROR,details:$.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 i in e)if(!t[i]){var r;const s=e[i];if(!s)throw Error(`source buffer exists for track ${i}, however track does not`);let o=((r=s.levelCodec)==null?void 0:r.indexOf(","))===-1?s.levelCodec:s.codec;o&&i.slice(0,5)==="audio"&&(o=Et(o,this.appendSource));const c=`${s.container};codecs=${o}`;this.log(`creating sourceBuffer(${c})`);try{const u=t[i]=n.addSourceBuffer(c),h=i;this.addBufferListener(h,"updatestart",this._onSBUpdateStart),this.addBufferListener(h,"updateend",this._onSBUpdateEnd),this.addBufferListener(h,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(h,"bufferedchange",(v,T)=>{const w=T.removedRanges;w!=null&&w.length&&this.hls.trigger(m.BUFFER_FLUSHED,{type:i})}),this.tracks[i]={buffer:u,codec:o,container:s.container,levelCodec:s.levelCodec,metadata:s.metadata,id:s.id}}catch(u){this.error(`error while trying to add sourceBuffer: ${u.message}`),this.hls.trigger(m.ERROR,{type:J.MEDIA_ERROR,details:$.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,sourceBufferName:i,mimeType:c})}}}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 r=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${r}`,t),this.hls.trigger(m.ERROR,{type:J.MEDIA_ERROR,details:$.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:r,fatal:!1});const i=this.operationQueue.current(e);i&&i.onError(r)}removeExecutor(e,t,n){const{media:r,mediaSource:i,operationQueue:s,sourceBuffer:o}=this,c=o[e];if(!r||!i||!c){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),s.shiftAndExecuteNext(e);return}const u=B(r.duration)?r.duration:1/0,h=B(i.duration)?i.duration:1/0,v=Math.max(0,t),T=Math.min(n,u,h);T>v&&(!c.ending||c.ended)?(c.ended=!1,this.log(`Removing [${v},${T}] from the ${e} SourceBuffer`),c.remove(v,T)):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,r=t.map(i=>n.appendBlocker(i));Promise.all(r).then(()=>{e(),t.forEach(i=>{const s=this.sourceBuffer[i];s!=null&&s.updating||n.shiftAndExecuteNext(i)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,n){const r=this.sourceBuffer[e];if(!r)return;const i=n.bind(this,e);this.listeners[e].push({event:t,listener:i}),r.addEventListener(t,i)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(n=>{t.removeEventListener(n.event,n.listener)})}}function ga(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function zo(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}const Go={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},pa=a=>String.fromCharCode(Go[a]||a),ui=15,vi=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},jo={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Vo={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Wo=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Ko{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;b.log(`${this.time} [${e}] ${n}`)}}}const Ci=function(e){const t=[];for(let n=0;nvi&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=vi)}moveCursor(e){const t=this.pos+e;if(e>1)for(let n=this.pos+1;n=144&&this.backSpace();const t=pa(e);if(this.pos>=vi){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"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t"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="",r=-1;for(let i=0;i0&&(e?n="["+t.join(" | ")+"]":n=t.join(` `)),n}getTextAndFormat(){return this.rows}}class ya{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 Cs(n),this.nonDisplayedMemory=new Cs(n),this.lastOutputScreen=new Cs(n),this.currRollUpRow=this.displayedMemory.rows[ui-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[ui-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;nt+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[n]}this.logger.log(2,"MIDROW: "+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 Sa{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=Jo(),this.logger=void 0;const r=this.logger=new Ko;this.channels=[null,new ya(e,t,r),new ya(e+1,n,r)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n"["+Ci([t[n],t[n+1]])+"] -> ("+Ci([r,i])+")");const c=this.cmdHistory;if(r>=16&&r<=31){if(Xo(r,i,c)){ns(null,null,c),this.logger.log(3,()=>"Repeated command ("+Ci([r,i])+") is dropped");continue}ns(r,i,this.cmdHistory),s=this.parseCmd(r,i),s||(s=this.parseMidrow(r,i)),s||(s=this.parsePAC(r,i)),s||(s=this.parseBackgroundAttributes(r,i))}else ns(null,null,c);if(!s&&(o=this.parseChars(r,i),o)){const h=this.currentChannel;h&&h>0?this.channels[h].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Ci([r,i])+" orig: "+Ci([t[n],t[n+1]]))}}parseCmd(e,t){const n=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,r=(e===23||e===31)&&t>=33&&t<=35;if(!(n||r))return!1;const i=e===20||e===21||e===23?1:2,s=this.channels[i];return e===20||e===21||e===28||e===29?t===32?s.ccRCL():t===33?s.ccBS():t===34?s.ccAOF():t===35?s.ccAON():t===36?s.ccDER():t===37?s.ccRU(2):t===38?s.ccRU(3):t===39?s.ccRU(4):t===40?s.ccFON():t===41?s.ccRDC():t===42?s.ccTR():t===43?s.ccRTD():t===44?s.ccEDM():t===45?s.ccCR():t===46?s.ccENM():t===47&&s.ccEOC():s.ccTO(t-32),this.currentChannel=i,!0}parseMidrow(e,t){let n=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?n=1:n=2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const r=this.channels[n];return r?(r.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+Ci([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let n;const r=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,i=(e===16||e===24)&&t>=64&&t<=95;if(!(r||i))return!1;const s=e<=23?1:2;t>=64&&t<=95?n=s===1?Ho[e]:jo[e]:n=s===1?Zo[e]:Vo[e];const o=this.channels[s];return o?(o.setPAC(this.interpretPAC(n,t)),this.currentChannel=s,!0):!1}interpretPAC(e,t){let n;const r={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-64,r.underline=(n&1)===1,n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=Math.floor((n-16)/2)*4,r}parseChars(e,t){let n,r=null,i=null;if(e>=25?(n=2,i=e-8):(n=1,i=e),i>=17&&i<=19){let s;i===17?s=t+80:i===18?s=t+112:s=t+144,this.logger.log(2,()=>"Special char '"+pa(s)+"' in channel "+n),r=[s]}else e>=32&&e<=127&&(r=t===0?[e]:[e,t]);return r&&this.logger.log(3,()=>"Char codes = "+Ci(r).join(",")),r}parseBackgroundAttributes(e,t){const n=(e===16||e===24)&&t>=32&&t<=47,r=(e===23||e===31)&&t>=45&&t<=47;if(!(n||r))return!1;let i;const s={};e===16||e===24?(i=Math.floor((t-32)/2),s.background=Wo[i],t%2===1&&(s.background=s.background+"_semi")):t===45?s.background="transparent":(s.foreground="black",t===47&&(s.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(s),!0}reset(){for(let e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var As=function(){if(Pe!=null&&Pe.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,c){if(typeof c!="string"||!Array.isArray(o))return!1;const u=c.toLowerCase();return~o.indexOf(u)?u:!1}function n(o){return t(a,o)}function r(o){return t(e,o)}function i(o,...c){let u=1;for(;u100)throw new Error("Position must be between 0 and 100.");Lt=At,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",i({},v,{get:function(){return dt},set:function(At){const Gt=r(At);if(!Gt)throw new SyntaxError("An invalid or illegal string was specified.");dt=Gt,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",i({},v,{get:function(){return zt},set:function(At){if(At<0||At>100)throw new Error("Size must be between 0 and 100.");zt=At,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",i({},v,{get:function(){return dn},set:function(At){const Gt=r(At);if(!Gt)throw new SyntaxError("An invalid or illegal string was specified.");dn=Gt,this.hasBeenReset=!0}})),h.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class Qo{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function ba(a){function e(n,r,i,s){return(n|0)*3600+(r|0)*60+(i|0)+parseFloat(s||0)}const t=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class qo{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let r=0;r=0&&n<=100)return this.set(e,n),!0}return!1}}function Ea(a,e,t,n){const r=n?a.split(n):[a];for(const i in r){if(typeof r[i]!="string")continue;const s=r[i].split(t);if(s.length!==2)continue;const o=s[0],c=s[1];e(o,c)}}const Rs=new As(0,0,""),is=Rs.align==="middle"?"middle":"center";function el(a,e,t){const n=a;function r(){const o=ba(a);if(o===null)throw new Error("Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function i(o,c){const u=new qo;Ea(o,function(T,w){let L;switch(T){case"region":for(let M=t.length-1;M>=0;M--)if(t[M].id===w){u.set(T,t[M].region);break}break;case"vertical":u.alt(T,w,["rl","lr"]);break;case"line":L=w.split(","),u.integer(T,L[0]),u.percent(T,L[0])&&u.set("snapToLines",!1),u.alt(T,L[0],["auto"]),L.length===2&&u.alt("lineAlign",L[1],["start",is,"end"]);break;case"position":L=w.split(","),u.percent(T,L[0]),L.length===2&&u.alt("positionAlign",L[1],["start",is,"end","line-left","line-right","auto"]);break;case"size":u.percent(T,w);break;case"align":u.alt(T,w,["start",is,"end","left","right"]);break}},/:/,/\s/),c.region=u.get("region",null),c.vertical=u.get("vertical","");let h=u.get("line","auto");h==="auto"&&Rs.line===-1&&(h=-1),c.line=h,c.lineAlign=u.get("lineAlign","start"),c.snapToLines=u.get("snapToLines",!0),c.size=u.get("size",100),c.align=u.get("align",is);let v=u.get("position","auto");v==="auto"&&Rs.position===50&&(v=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=v}function s(){a=a.replace(/^\s+/,"")}if(s(),e.startTime=r(),s(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);a=a.slice(3),s(),e.endTime=r(),s(),i(a,e)}function xa(a){return a.replace(//gi,` `)}class tl{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Qo,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function n(){let i=t.buffer,s=0;for(i=xa(i);s")===-1){t.cue.id=i;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{el(i,t.cue,t.regionList)}catch(o){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=i.indexOf("-->")!==-1;if(!i||o&&(s=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=` `),t.cue.text+=i}continue;case"BADCUE":i||(t.state="ID")}}}catch(i){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=` `,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const nl=/\r\n|\n\r|\n|\r/g,Is=function(e,t,n=0){return e.slice(n,n+t.length)===t},rl=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),i=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!B(t)||!B(n)||!B(r)||!B(i))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*r,t+=60*60*1e3*i,t},Ls=function(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0).toString()};function ws(a,e,t){return Ls(a.toString())+Ls(e.toString())+Ls(t)}const il=function(e,t,n){let r=e[t],i=e[r.prevCC];if(!i||!i.new&&r.new){e.ccOffset=e.presentationOffset=r.start,r.new=!1;return}for(;(s=i)!=null&&s.new;){var s;e.ccOffset+=r.start-i.start,r.new=!1,r=i,i=e[r.prevCC]}e.presentationOffset=n};function sl(a,e,t,n,r,i,s){const o=new tl,c=Re(new Uint8Array(a)).trim().replace(nl,` `).split(` `),u=[],h=e?xo(e.baseTime,e.timescale):0;let v="00:00.000",T=0,w=0,L,M=!0;o.oncue=function(U){const re=t[n];let Ze=t.ccOffset;const Ge=(T-h)/9e4;if(re!=null&&re.new&&(w!==void 0?Ze=t.ccOffset=re.start:il(t,n,Ge)),Ge){if(!e){L=new Error("Missing initPTS for VTT MPEGTS");return}Ze=Ge-t.presentationOffset}const gt=U.endTime-U.startTime,$e=oi((U.startTime+Ze-w)*9e4,r*9e4)/9e4;U.startTime=Math.max($e,0),U.endTime=Math.max($e+gt,0);const Lt=U.text.trim();U.text=decodeURIComponent(encodeURIComponent(Lt)),U.id||(U.id=ws(U.startTime,U.endTime,Lt)),U.endTime>0&&u.push(U)},o.onparsingerror=function(U){L=U},o.onflush=function(){if(L){s(L);return}i(u)},c.forEach(U=>{if(M)if(Is(U,"X-TIMESTAMP-MAP=")){M=!1,U.slice(16).split(",").forEach(re=>{Is(re,"LOCAL:")?v=re.slice(6):Is(re,"MPEGTS:")&&(T=parseInt(re.slice(7)))});try{w=rl(v)/1e3}catch(re){L=re}return}else U===""&&(M=!1);o.parse(U+` `)}),o.flush()}const Ds="stpp.ttml.im1t",Ta=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Ca=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,al={left:"start",center:"center",right:"end",start:"start",end:"end"};function Aa(a,e,t,n){const r=Mt(new Uint8Array(a),["mdat"]);if(r.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const i=r.map(o=>Re(o)),s=Eo(e.baseTime,1,e.timescale);try{i.forEach(o=>t(ol(o,s)))}catch(o){n(o)}}function ol(a,e){const r=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");const i={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(i).reduce((v,T)=>(v[T]=r.getAttribute(`ttp:${T}`)||i[T],v),{}),o=r.getAttribute("xml:space")!=="preserve",c=Ra(Os(r,"styling","style")),u=Ra(Os(r,"layout","region")),h=Os(r,"body","[begin]");return[].map.call(h,v=>{const T=Ia(v,o);if(!T||!v.hasAttribute("begin"))return null;const w=Ms(v.getAttribute("begin"),s),L=Ms(v.getAttribute("dur"),s);let M=Ms(v.getAttribute("end"),s);if(w===null)throw La(v);if(M===null){if(L===null)throw La(v);M=w+L}const U=new As(w-e,M-e,T);U.id=ws(U.startTime,U.endTime,U.text);const re=u[v.getAttribute("region")],Ze=c[v.getAttribute("style")],Ge=ll(re,Ze,c),{textAlign:gt}=Ge;if(gt){const $e=al[gt];$e&&(U.lineAlign=$e),U.align=gt}return de(U,Ge),U}).filter(v=>v!==null)}function Os(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 Ia(a,e){return[].slice.call(a.childNodes).reduce((t,n,r)=>{var i;return n.nodeName==="br"&&r?t+` `:(i=n.childNodes)!=null&&i.length?Ia(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function ll(a,e,t){const n="http://www.w3.org/ns/ttml#styling";let r=null;const i=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return s&&t.hasOwnProperty(s)&&(r=t[s]),i.reduce((o,c)=>{const u=Ps(e,n,c)||Ps(a,n,c)||Ps(r,n,c);return u&&(o[c]=u),o},{})}function Ps(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 Ms(a,e){if(!a)return null;let t=ba(a);return t===null&&(Ta.test(a)?t=cl(a,e):Ca.test(a)&&(t=ul(a,e))),t}function cl(a,e){const t=Ta.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 ul(a,e){const t=Ca.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 dl{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=Oa(),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(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(m.FRAG_LOADING,this.onFragLoading,this),e.on(m.FRAG_LOADED,this.onFragLoaded,this),e.on(m.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(m.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(m.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(m.FRAG_LOADING,this.onFragLoading,this),e.off(m.FRAG_LOADED,this.onFragLoaded,this),e.off(m.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(m.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(m.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(m.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(m.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 rs(this,"textTrack1"),t=new rs(this,"textTrack2"),n=new rs(this,"textTrack3"),r=new rs(this,"textTrack4");this.cea608Parser1=new Sa(1,e,t),this.cea608Parser2=new Sa(3,n,r)}}addCues(e,t,n,r,i){let s=!1;for(let o=i.length;o--;){const c=i[o],u=fl(c[0],c[1],t,n);if(u>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],n),s=!0,u/(n-t)>.5))return}if(s||i.push([t,n]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,n,r)}else{const o=this.Cues.newCue(null,t,n,r);this.hls.trigger(m.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:i}){const{unparsedVttFrags:s}=this;n==="main"&&(this.initPTS[t.cc]={baseTime:r,timescale:i}),s.length&&(this.unparsedVttFrags=[],s.forEach(o=>{this.onFragLoaded(m.FRAG_LOADED,o)}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let r=0;r{kn(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Oa(),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;ni.textCodec===Ds);if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(fa(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const s=this.media,o=s?Ct(s.textTracks):null;if(this.tracks.forEach((c,u)=>{let h;if(o){let v=null;for(let T=0;Tu!==null).map(u=>u.label);c.length&&b.warn(`Media element contains unused subtitle tracks: ${c.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const s=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(m.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(n=>{const r=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!r)return;const i=`textTrack${r[1]}`,s=this.captionsProperties[i];s&&(s.label=n.name,n.lang&&(s.languageCode=n.lang),s.media=n)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===vt.MAIN){var n,r;const{cea608Parser1:i,cea608Parser2:s,lastSn:o}=this,{cc:c,sn:u}=t.frag,h=(n=(r=t.part)==null?void 0:r.index)!=null?n:-1;i&&s&&(u!==o+1||u===o&&h!==this.lastPartIndex+1||c!==this.lastCc)&&(i.reset(),s.reset()),this.lastCc=c,this.lastSn=u,this.lastPartIndex=h}}onFragLoaded(e,t){const{frag:n,payload:r}=t;if(n.type===vt.SUBTITLE)if(r.byteLength){const i=n.decryptdata,s="stats"in t;if(i==null||!i.encrypted||s){const o=this.tracks[n.level],c=this.vttCCs;c[n.cc]||(c[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),o&&o.textCodec===Ds?this._parseIMSC1(n,r):this._parseVTTs(t)}}else this.hls.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;Aa(t,this.initPTS[e.cc],r=>{this._appendCues(r,e.level),n.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},r=>{b.log(`Failed to parse IMSC1: ${r}`),n.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:r})})}_parseVTTs(e){var t;const{frag:n,payload:r}=e,{initPTS:i,unparsedVttFrags:s}=this,o=i.length-1;if(!i[n.cc]&&o===-1){s.push(e);return}const c=this.hls,u=(t=n.initSegment)!=null&&t.data?l(n.initSegment.data,new Uint8Array(r)):r;sl(u,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,h=>{this._appendCues(h,n.level),c.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},h=>{const v=h.message==="Missing initPTS for VTT MPEGTS";v?s.push(e):this._fallbackToIMSC1(n,r),b.log(`Failed to parse VTT cue: ${h}`),!(v&&o>n.cc)&&c.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:h})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||Aa(t,this.initPTS[e.cc],()=>{n.textCodec=Ds,this._parseIMSC1(e,t)},()=>{n.textCodec="wvtt"})}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const r=this.textTracks[t];if(!r||r.mode==="disabled")return;e.forEach(i=>fn(r,i))}else{const r=this.tracks[t];if(!r)return;const i=r.default?"default":"subtitles"+t;n.trigger(m.CUES_PARSED,{type:"subtitles",cues:e,track:i})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===vt.SUBTITLE&&this.onFragLoaded(m.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:n,cea608Parser2:r}=this;if(!this.enabled||!n||!r)return;const{frag:i,samples:s}=t;if(!(i.type===vt.MAIN&&this.closedCaptionsForLevel(i)==="NONE"))for(let o=0;o_n(o[c],t,n))}if(this.config.renderTextTracksNatively&&t===0&&r!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(c=>_n(o[c],t,r))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let r=2;for(let i=0;ithis.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter((r,i)=>this.isLevelAllowed(r)&&i<=e);return this.clientRect=null,_s.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 r=(o,c)=>c?o.width!==c.width||o.height!==c.height:!0;let i=e.length-1;const s=Math.max(t,n);for(let o=0;o=s||c.height>=s)&&r(c,e[o+1])){i=o;break}}return i}}class hl{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(m.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(m.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 r=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=r,r&&typeof r.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,n){const r=performance.now();if(t){if(this.lastTime){const i=r-this.lastTime,s=n-this.lastDroppedFrames,o=t-this.lastDecodedFrames,c=1e3*s/i,u=this.hls;if(u.trigger(m.FPS_DROP,{currentDropped:s,currentDecoded:o,totalDroppedFrames:n}),c>0&&s>u.config.fpsDroppedMonitoringThreshold*o){let h=u.currentLevel;b.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=h)&&(h=h-1,u.trigger(m.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:u.currentLevel}),u.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const ss="[eme]";class Fi{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=Fi.CDMCleanupPromise?[Fi.CDMCleanupPromise]:[],this.debug=b.debug.bind(b,ss),this.log=b.log.bind(b,ss),this.warn=b.warn.bind(b,ss),this.error=b.error.bind(b,ss),this.onMediaEncrypted=t=>{const{initDataType:n,initData:r}=t,i=`"${t.type}" event: init data type: "${n}"`;if(this.debug(i),r!==null){if(!this.keyFormatPromise){let s=Object.keys(this.keySystemAccessPromises);s.length||(s=bt(this.config));const o=s.map(wt).filter(c=>!!c);this.keyFormatPromise=this.getKeyFormatPromise(o)}this.keyFormatPromise.then(s=>{const o=Ot(s);let c,u;if(n==="sinf"){if(o!==Ce.FAIRPLAY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${o}`);return}const L=Tt(new Uint8Array(r));try{const M=ge(JSON.parse(L).sinf),U=gn(M);if(!U)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=U.subarray(8,24),u=Ce.FAIRPLAY}catch(M){this.warn(`${i} Failed to parse sinf: ${M}`);return}}else{if(o!==Ce.WIDEVINE&&o!==Ce.PLAYREADY){this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${n}" for selected key-system ${o}`);return}const L=le(r),M=L.filter(re=>!!re.systemId&&Xt(re.systemId)===o);M.length>1&&this.warn(`${i} Using first of ${M.length} pssh found for selected key-system ${o}`);const U=M[0];if(!U){L.length===0||L.some(re=>!re.systemId)?this.warn(`${i} contains incomplete or invalid pssh data`):this.log(`ignoring ${i} for ${L.map(re=>Xt(re.systemId)).join(",")} pssh data in favor of playlist keys`);return}if(u=Xt(U.systemId),U.version===0&&U.data)if(u===Ce.WIDEVINE){const re=U.data.length-22;c=U.data.subarray(re,re+16)}else u===Ce.PLAYREADY&&(c=yt(U.data))}if(!u||!c){this.log(`Unable to handle ${i} with key-system ${o}`);return}const h=ft.hexDump(c),{keyIdToKeySessionPromise:v,mediaKeySessions:T}=this;let w=v[h];for(let L=0;Lthis.generateRequestWithPreferredKeySession(M,n,r,"encrypted-event-key-match")),w.catch(Ze=>this.handleError(Ze));break}}if(!w){if(u!==o){this.log(`Ignoring "${i}" with ${u} init data for selected key-system ${o}`);return}w=v[h]=this.getKeySystemSelectionPromise([u]).then(({keySystem:L,mediaKeys:M})=>{var U;this.throwIfDestroyed();const re=new ve("ISO-23001-7",h,(U=wt(L))!=null?U:"");return re.pssh=new Uint8Array(r),re.keyId=c,this.attemptSetMediaKeys(L,M).then(()=>{this.throwIfDestroyed();const Ze=this.createMediaKeySessionContext({decryptdata:re,keySystem:L,mediaKeys:M});return this.generateRequestWithPreferredKeySession(Ze,n,r,"encrypted-event-no-match")})}),w.catch(L=>this.handleError(L))}})}},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(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(m.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(m.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(m.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(m.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,r=t[e];if(r)return r.licenseUrl;if(e===Ce.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,o,c)=>!!s&&c.indexOf(s)===o,r=t.map(s=>s.audioCodec).filter(n),i=t.map(s=>s.videoCodec).filter(n);return r.length+i.length===0&&i.push("avc1.42e01e"),new Promise((s,o)=>{const c=u=>{const h=u.shift();this.getMediaKeysPromise(h,r,i).then(v=>s({keySystem:h,mediaKeys:v})).catch(v=>{u.length?c(u):v instanceof li?o(v):o(new li({type:J.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_ACCESS,error:v,fatal:!0},v.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let r=`Configured requestMediaKeySystemAccess is not a function ${n}`;return Ht===null&&self.location.protocol==="http:"&&(r=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(r))}return n(e,t)}getMediaKeysPromise(e,t,n){const r=Jt(e,t,n,this.config.drmSystemOptions),i=this.keySystemAccessPromises[e];let s=i==null?void 0:i.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(r)}`),s=this.requestMediaKeySystemAccess(e,r);const o=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch(c=>{this.log(`Failed to obtain access to key-system "${e}": ${c}`)}),s.then(c=>{this.log(`Access for key-system "${c.keySystem}" obtained`);const u=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),o.mediaKeys=c.createMediaKeys().then(h=>(this.log(`Media-keys created for "${e}"`),u.then(v=>v?this.setMediaKeysServerCertificate(h,e,v):h))),o.mediaKeys.catch(h=>{this.error(`Failed to create media-keys for "${e}"}: ${h}`)}),o.mediaKeys})}return s.then(()=>i.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${ft.hexDump(e.keyId||[])}`);const r=n.createSession(),i={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(i),i}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),r=this.getKeyIdString(t),i="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(n,i,t.pssh,"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 ft.hexDump(e.keyId)}updateKeySession(e,t){var n;const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyID ${ft.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])} } (data length: ${t&&t.byteLength})`),r.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 r=bt(this.config),i=e.map(Ot).filter(s=>!!s&&r.indexOf(s)!==-1);return this.getKeySystemSelectionPromise(i).then(({keySystem:s})=>{const o=wt(s);o?t(o):n(new Error(`Unable to find format for key-system "${s}"`))}).catch(n)})}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),r=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${r}`);let i=this.keyIdToKeySessionPromise[n];return i||(i=this.keyIdToKeySessionPromise[n]=this.getKeySystemForKeyPromise(t).then(({keySystem:s,mediaKeys:o})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${r}`),this.attemptSetMediaKeys(s,o).then(()=>{this.throwIfDestroyed();const c=this.createMediaKeySessionContext({keySystem:s,mediaKeys:o,decryptdata:t});return this.generateRequestWithPreferredKeySession(c,"cenc",t.pssh,"playlist-key")}))),i.catch(s=>this.handleError(s))),i}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof li?this.hls.trigger(m.ERROR,e.data):this.hls.trigger(m.ERROR,{type:J.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const r=Ot(e.keyFormat),i=r?[r]:bt(this.config);return this.attemptKeySystemAccess(i)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=bt(this.config)),e.length===0)throw new li({type:J.KEY_SYSTEM_ERROR,details:$.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 r=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(r),r.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(i=>n.indexOf(i)===-1)})}generateRequestWithPreferredKeySession(e,t,n,r){var i,s;const o=(i=this.config.drmSystems)==null||(s=i[e.keySystem])==null?void 0:s.generateRequest;if(o)try{const L=o.call(this.hls,t,n,e);if(!L)throw new Error("Invalid response from configured generateRequest filter");t=L.initDataType,n=e.decryptdata.pssh=L.initData?new Uint8Array(L.initData):null}catch(L){var c;if(this.warn(L.message),(c=this.hls)!=null&&c.config.debug)throw L}if(n===null)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(e);const u=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${r}": ${u} (init data type: ${t} length: ${n?n.byteLength:null})`);const h=new xs,v=e._onmessage=L=>{const M=e.mediaKeysSession;if(!M){h.emit("error",new Error("invalid state"));return}const{messageType:U,message:re}=L;this.log(`"${U}" message event for session "${M.sessionId}" message size: ${re.byteLength}`),U==="license-request"||U==="license-renewal"?this.renewLicense(e,re).catch(Ze=>{this.handleError(Ze),h.emit("error",Ze)}):U==="license-release"?e.keySystem===Ce.FAIRPLAY&&(this.updateKeySession(e,Te("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${U}"`)},T=e._onkeystatuseschange=L=>{if(!e.mediaKeysSession){h.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const U=e.keyStatus;h.emit("keyStatus",U),U==="expired"&&(this.warn(`${e.keySystem} expired for key ${u}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",v),e.mediaKeysSession.addEventListener("keystatuseschange",T);const w=new Promise((L,M)=>{h.on("error",M),h.on("keyStatus",U=>{U.startsWith("usable")?L():U==="output-restricted"?M(new li({type:J.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):U==="internal-error"?M(new li({type:J.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${U}"`)):U==="expired"?M(new Error("key expired while generating request")):this.warn(`unhandled key status change "${U}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var L;this.log(`Request generated for key-session "${(L=e.mediaKeysSession)==null?void 0:L.sessionId}" keyId: ${u}`)}).catch(L=>{throw new li({type:J.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_SESSION,error:L,fatal:!1},`Error generating key-session request: ${L}`)}).then(()=>w).catch(L=>{throw h.removeAllListeners(),this.removeSession(e),L}).then(()=>(h.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${ft.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${ft.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,n=t.loader,r=new n(t),i=this.getServerCertificateUrl(e);return i?(this.log(`Fetching server certificate for "${e}"`),new Promise((s,o)=>{const c={responseType:"arraybuffer",url:i},u=t.certLoadPolicy.default,h={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},v={onSuccess:(T,w,L,M)=>{s(T.data)},onError:(T,w,L,M)=>{o(new li({type:J.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:L,response:H({url:c.url,data:void 0},T)},`"${e}" certificate request failed (${i}). Status: ${T.code} (${T.text})`))},onTimeout:(T,w,L)=>{o(new li({type:J.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:L,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${i})`))},onAbort:(T,w,L)=>{o(new Error("aborted"))}};r.load(c,h,v)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((r,i)=>{e.setServerCertificate(n).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${n==null?void 0:n.byteLength}) on "${t}"`),r(e)}).catch(s=>{i(new li({type:J.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:s,fatal:!0},s.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(r=>{throw new li({type:J.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:r,fatal:!0},r.message)}))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const r=new DOMParser().parseFromString(n,"application/xml"),i=r.querySelectorAll("HttpHeader");if(i.length>0){let h;for(let v=0,T=i.length;v in key message");return Te(atob(u))}setupLicenseXHR(e,t,n,r){const i=this.config.licenseXhrSetup;return i?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return i.call(this.hls,e,t,n,r)}).catch(s=>{if(!n.decryptdata)throw s;return e.open("POST",t,!0),i.call(this.hls,e,t,n,r)}).then(s=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:s||r})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((r,i)=>{const s=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${s}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return i(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let c=o.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const u=this.config.licenseResponseCallback;if(u)try{c=u.call(this.hls,o,s,e)}catch(h){this.error(h)}r(c)}else{const c=n.errorRetry,u=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||o.status>=400&&o.status<500)i(new li({type:J.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:s,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${s}). Status: ${o.status} (${o.statusText})`));else{const h=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${h} attempts left`),this.requestLicense(e,t).then(r,i)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,s,e,t).then(({xhr:c,licenseChallenge:u})=>{e.keySystem==Ce.PLAYREADY&&(u=this.unpackPlayReadyKeyMessage(c,u)),c.send(u)})})}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={},ve.clearKeyUriToKeyIdMap();const n=t.length;Fi.CDMCleanupPromise=Promise.all(t.map(r=>this.removeSession(r)).concat(e==null?void 0:e.setMediaKeys(null).catch(r=>{this.log(`Could not clear media keys: ${r}`)}))).then(()=>{n&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(r=>{this.log(`Could not close sessions and clear media keys: ${r}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=t.reduce((r,i)=>(r.indexOf(i.keyFormat)===-1&&r.push(i.keyFormat),r),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const r=this.mediaKeySessions.indexOf(e);return r>-1&&this.mediaKeySessions.splice(r,1),t.remove().catch(i=>{this.log(`Could not remove session: ${i}`)}).then(()=>t.close()).catch(i=>{this.log(`Could not close session: ${i}`)})}}}Fi.CDMCleanupPromise=void 0;class li 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 Qr;(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"})(Qr||(Qr={}));var Ns;(function(a){a.DASH="d",a.HLS="h",a.SMOOTH="s",a.OTHER="o"})(Ns||(Ns={}));var Ai;(function(a){a.OBJECT="CMCD-Object",a.REQUEST="CMCD-Request",a.SESSION="CMCD-Session",a.STATUS="CMCD-Status"})(Ai||(Ai={}));const ml={[Ai.OBJECT]:["br","d","ot","tb"],[Ai.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[Ai.SESSION]:["cid","pr","sf","sid","st","v"],[Ai.STATUS]:["bs","rtp"]};class Ui{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(n=>n instanceof Ui?n:new Ui(n))),this.value=e,this.params=t}}class Pa{constructor(e){this.description=void 0,this.description=e}}const gl="Dict";function pl(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 vl(a,e,t,n){return new Error(`failed to ${a} "${pl(e)}" as ${t}`,{cause:n})}const Ma="Bare Item",yl="Boolean",Sl="Byte Sequence",bl="Decimal",El="Integer";function xl(a){return a<-999999999999999||99999999999999912)throw hi(a,bl);const t=e.toString();return t.includes(".")?t:`${t}.0`}const Ol="String";function Pl(a){if(Tl.test(a))throw hi(a,Ol);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ml(a){return a.description||a.toString().slice(7,-1)}function Ba(a){const e=Ml(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw hi(e,Cl);return e}function Bs(a){switch(typeof a){case"number":if(!B(a))throw hi(a,Ma);return Number.isInteger(a)?_a(a):Dl(a);case"string":return Pl(a);case"symbol":return Ba(a);case"boolean":return Rl(a);case"object":if(a instanceof Date)return wl(a);if(a instanceof Uint8Array)return Ll(a);if(a instanceof Pa)return Ba(a);default:throw hi(a,Ma)}}function ks(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw hi(a,Al);return a}function Fs(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${ks(e)}`:`;${ks(e)}=${Bs(t)}`).join("")}function ka(a){return a instanceof Ui?`${Bs(a.value)}${Fs(a.params)}`:Bs(a)}function _l(a){return`(${a.value.map(ka).join(" ")})${Fs(a.params)}`}function Nl(a,e={whitespace:!0}){if(typeof a!="object")throw hi(a,gl);const t=a instanceof Map?a.entries():Object.entries(a),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([r,i])=>{i instanceof Ui||(i=new Ui(i));let s=ks(r);return i.value===!0?s+=Fs(i.params):(s+="=",Array.isArray(i.value)?s+=_l(i):s+=ka(i)),s}).join(`,${n}`)}function Bl(a,e){return Nl(a,e)}const kl=a=>a==="ot"||a==="sf"||a==="st",Fl=a=>typeof a=="number"?B(a):a!=null&&a!==""&&a!==!1;function Ul(a,e){const t=new URL(a),n=new URL(e);if(t.origin!==n.origin)return a;const r=t.pathname.split("/").slice(1),i=n.pathname.split("/").slice(1,-1);for(;r[0]===i[0];)r.shift(),i.shift();for(;i.length;)i.shift(),r.unshift("..");return r.join("/")}function zl(){try{return crypto.randomUUID()}catch(a){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const i=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(r=="x"?i:i&3|8).toString(16)})}}}const as=a=>Math.round(a),Gl=(a,e)=>(e!=null&&e.baseUrl&&(a=Ul(a,e.baseUrl)),encodeURIComponent(a)),os=a=>as(a/100)*100,Hl={br:as,d:as,bl:os,dl:os,mtp:os,nor:Gl,rtp:os,tb:as};function Zl(a,e){const t={};if(a==null||typeof a!="object")return t;const n=Object.keys(a).sort(),r=de({},Hl,e==null?void 0:e.formatters),i=e==null?void 0:e.filter;return n.forEach(s=>{if(i!=null&&i(s))return;let o=a[s];const c=r[s];c&&(o=c(o,e)),!(s==="v"&&o===1)&&(s=="pr"&&o===1||Fl(o)&&(kl(s)&&typeof o=="string"&&(o=new Pa(o)),t[s]=o))}),t}function Fa(a,e={}){return a?Bl(Zl(a,e),de({whitespace:!1},e)):""}function jl(a,e={}){if(!a)return{};const t=Object.entries(a),n=Object.entries(ml).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),r=t.reduce((i,s)=>{var o,c;const[u,h]=s,v=((o=n.find(T=>T[1].includes(u)))==null?void 0:o[0])||Ai.REQUEST;return(c=i[v])!=null||(i[v]={}),i[v][u]=h,i},{});return Object.entries(r).reduce((i,[s,o])=>(i[s]=Fa(o,e),i),{})}function Vl(a,e,t){return de(a,jl(e,t))}const Wl="CMCD";function Kl(a,e={}){if(!a)return"";const t=Fa(a,e);return`${Wl}=${encodeURIComponent(t)}`}const Ua=/CMCD=[^&#]+/;function $l(a,e,t){const n=Kl(e,t);if(!n)return a;if(Ua.test(a))return a.replace(Ua,n);const r=a.includes("?")?"&":"?";return`${a}${r}${n}`}class Yl{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=r=>{try{this.apply(r,{ot:Qr.MANIFEST,su:!this.initialized})}catch(i){b.warn("Could not generate manifest CMCD data.",i)}},this.applyFragmentData=r=>{try{const i=r.frag,s=this.hls.levels[i.level],o=this.getObjectType(i),c={d:i.duration*1e3,ot:o};(o===Qr.VIDEO||o===Qr.AUDIO||o==Qr.MUXED)&&(c.br=s.bitrate/1e3,c.tb=this.getTopBandwidth(o)/1e3,c.bl=this.getBufferLength(o)),this.apply(r,c)}catch(i){b.warn("Could not generate segment CMCD data.",i)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||zl(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(m.MEDIA_DETACHED,this.onMediaDetached,this),e.on(m.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(m.MEDIA_DETACHED,this.onMediaDetached,this),e.off(m.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,r;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(r=t.tracks.video)==null?void 0:r.buffer}createData(){var e;return{v:1,sf: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={}){de(t,this.createData());const n=t.ot===Qr.INIT||t.ot===Qr.VIDEO||t.ot===Qr.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:r}=this;r&&(t=Object.keys(t).reduce((i,s)=>(r.includes(s)&&(i[s]=t[s]),i),{})),this.useHeaders?(e.headers||(e.headers={}),Vl(e.headers,t)):e.url=$l(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Qr.TIMED_TEXT;if(e.sn==="initSegment")return Qr.INIT;if(t==="audio")return Qr.AUDIO;if(t==="main")return this.hls.audioTracks.length?Qr.VIDEO:Qr.MUXED}getTopBandwidth(e){let t=0,n;const r=this.hls;if(e===Qr.AUDIO)n=r.audioTracks;else{const i=r.maxAutoLevel,s=i>-1?i+1:r.levels.length;n=r.levels.slice(0,s)}for(const i of n)i.bitrate>t&&(t=i.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,n=e===Qr.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:mr.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(i){this.loader=void 0,this.loader=new n(i)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(i,s,o){t(i),this.loader.load(i,s,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(i){this.loader=void 0,this.loader=new n(i)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(i,s,o){t(i),this.loader.load(i,s,o)}}}}const Xl=3e5;class Jl{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=b.log.bind(b,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(m.MANIFEST_PARSED,this.onManifestParsed,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(m.MANIFEST_PARSED,this.onManifestParsed,this),e.off(m.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)===hn.SendAlternateToPenaltyBox&&n.flags===Kn.MoveAllAlternatesMatchingHost){const r=this.levels;let i=this.pathwayPriority,s=this.pathwayId;if(t.context){const{groupId:o,pathwayId:c,type:u}=t.context;o&&r?s=this.getPathwayForGroupId(o,u,s):c&&(s=c)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!i&&r&&(i=r.reduce((o,c)=>(o.indexOf(c.pathwayId)===-1&&o.push(c.pathwayId),o),[])),i&&i.length>1&&(this.updatePathwayPriority(i),n.resolved=this.pathwayId!==s),n.resolved||b.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${s} levels: ${r&&r.length} priorities: ${JSON.stringify(i)} 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,r=performance.now();Object.keys(n).forEach(i=>{r-n[i]>Xl&&delete n[i]});for(let i=0;i0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,un(t),this.hls.trigger(m.LEVELS_UPDATED,{levels:t});const u=this.hls.levels[o];c&&u&&this.levels&&(u.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&u.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${u.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,n){const r=this.getLevelsForPathway(n).concat(this.levels||[]);for(let i=0;i{const{ID:s,"BASE-ID":o,"URI-REPLACEMENT":c}=i;if(t.some(h=>h.pathwayId===s))return;const u=this.getLevelsForPathway(o).map(h=>{const v=new G(h.attrs);v["PATHWAY-ID"]=s;const T=v.AUDIO&&`${v.AUDIO}_clone_${s}`,w=v.SUBTITLES&&`${v.SUBTITLES}_clone_${s}`;T&&(n[v.AUDIO]=T,v.AUDIO=T),w&&(r[v.SUBTITLES]=w,v.SUBTITLES=w);const L=Ga(h.uri,v["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),M=new lr({attrs:v,audioCodec:h.audioCodec,bitrate:h.bitrate,height:h.height,name:h.name,url:L,videoCodec:h.videoCodec,width:h.width});if(h.audioGroups)for(let U=1;U{this.log(`Loaded steering manifest: "${r}"`);const L=h.data;if(L.VERSION!==1){this.log(`Steering VERSION ${L.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=L.TTL;const{"RELOAD-URI":M,"PATHWAY-CLONES":U,"PATHWAY-PRIORITY":re}=L;if(M)try{this.uri=new self.URL(M,r).href}catch(Ge){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${M}`);return}this.scheduleRefresh(this.uri||T.url),U&&this.clonePathways(U);const Ze={steeringManifest:L,url:r.toString()};this.hls.trigger(m.STEERING_MANIFEST_LOADED,Ze),re&&this.updatePathwayPriority(re)},onError:(h,v,T,w)=>{if(this.log(`Error loading steering manifest: ${h.code} ${h.text} (${v.url})`),this.stopLoad(),h.code===410){this.enabled=!1,this.log(`Steering manifest ${v.url} no longer available`);return}let L=this.timeToLoad*1e3;if(h.code===429){const M=this.loader;if(typeof(M==null?void 0:M.getResponseHeader)=="function"){const U=M.getResponseHeader("Retry-After");U&&(L=parseFloat(U)*1e3)}this.log(`Steering manifest ${v.url} rate limited`);return}this.scheduleRefresh(this.uri||v.url,L)},onTimeout:(h,v,T)=>{this.log(`Timeout loading steering manifest (${v.url})`),this.scheduleRefresh(this.uri||v.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(i,c,u)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const r=(n=this.hls)==null?void 0:n.media;if(r&&!r.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function za(a,e,t,n){a&&Object.keys(e).forEach(r=>{const i=a.filter(s=>s.groupId===r).map(s=>{const o=de({},s);return o.details=void 0,o.attrs=new G(o.attrs),o.url=o.attrs.URI=Ga(s.url,s.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[r],o.attrs["PATHWAY-ID"]=n,o});a.push(...i)})}function Ga(a,e,t,n){const{HOST:r,PARAMS:i,[t]:s}=n;let o;e&&(o=s==null?void 0:s[e],o&&(a=o));const c=new self.URL(a);return r&&!o&&(c.host=r),i&&Object.keys(i).sort().forEach(u=>{u&&c.searchParams.set(u,i[u])}),c.href}const Ql=/^age:\s*[\d.]+\s*$/im;class Ha{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 We,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;const i=this.xhrSetup;i?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return i(n,t.url)}).catch(s=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),i(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(s=>{this.callbacks.onError({code:n.status,text:s.message},t,n,r)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const r=t.headers,{maxTimeToFirstByteMs:i,maxLoadTimeMs:s}=n.loadPolicy;if(r)for(const o in r)e.setRequestHeader(o,r[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=i&&B(i)?i:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const r=t.readyState,i=this.config;if(!n.aborted&&r>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),r===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const s=t.status,o=t.responseType==="text"?t.responseText:null;if(s>=200&&s<300){const v=o!=null?o:t.response;if(v!=null){n.loading.end=Math.max(self.performance.now(),n.loading.first);const T=t.responseType==="arraybuffer"?v.byteLength:v.length;if(n.loaded=n.total=T,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first),!this.callbacks)return;const w=this.callbacks.onProgress;if(w&&w(n,e,v,t),!this.callbacks)return;const L={url:t.responseURL,data:v,code:s};this.callbacks.onSuccess(L,n,e,t);return}}const c=i.loadPolicy.errorRetry,u=n.retry,h={url:e.url,data:void 0,code:s};rr(c,u,!1,h)?this.retry(c):(b.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(rr(e,t,!0))this.retry(e);else{var n;b.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=Un(e,n.retry),n.retry++,b.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&&Ql.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 ql(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}const ec=/(\d+)-(\d+)\/(\d+)/;class Za{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||ic,this.controller=new self.AbortController,this.stats=new We}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();const i=tc(e,this.controller.signal),s=n.onProgress,o=e.responseType==="arraybuffer",c=o?"byteLength":"length",{maxTimeToFirstByteMs:u,maxLoadTimeMs:h}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=u&&B(u)?u:h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(r,e,this.response)},t.timeout),self.fetch(this.request).then(v=>{this.response=this.loader=v;const T=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),n.onTimeout(r,e,this.response)},h-(T-r.loading.start)),!v.ok){const{status:w,statusText:L}=v;throw new sc(L||"fetch, bad network response",w,v)}return r.loading.first=T,r.total=rc(v.headers)||r.total,s&&B(t.highWaterMark)?this.loadProgressively(v,r,e,t.highWaterMark,s):o?v.arrayBuffer():e.responseType==="json"?v.json():v.text()}).then(v=>{const T=this.response;if(!T)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const w=v[c];w&&(r.loaded=r.total=w);const L={url:T.url,data:v,code:T.status};s&&!B(t.highWaterMark)&&s(r,e,v,T),n.onSuccess(L,r,e,T)}).catch(v=>{if(self.clearTimeout(this.requestTimeout),r.aborted)return;const T=v&&v.code||0,w=v?v.message:null;n.onError({code:T,text:w},e,v?v.details:null,r)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,r=0,i){const s=new Hs,o=e.body.getReader(),c=()=>o.read().then(u=>{if(u.done)return s.dataLength&&i(t,n,s.flush(),e),Promise.resolve(new ArrayBuffer(0));const h=u.value,v=h.length;return t.loaded+=v,v=r&&i(t,n,s.flush(),e)):i(t,n,h,e),c()}).catch(()=>Promise.reject());return c()}}function tc(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(de({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function nc(a){const e=ec.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function rc(a){const e=a.get("Content-Range");if(e){const n=nc(e);if(B(n))return n}const t=a.get("Content-Length");if(t)return parseInt(t)}function ic(a,e){return new self.Request(a.url,e)}class sc extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const ac=/\s/,oc={newCue(a,e,t,n){const r=[];let i,s,o,c,u;const h=self.VTTCue||self.TextTrackCue;for(let T=0;T=16?c--:c++;const w=xa(u.trim()),L=ws(e,t,w);a!=null&&(v=a.cues)!=null&&v.getCueById(L)||(s=new h(e,t,w),s.id=L,s.line=T+1,s.align="left",s.position=10+Math.min(80,Math.floor(c*8/32)*10),r.push(s))}return a&&r.length&&(r.sort((T,w)=>T.line==="auto"||w.line==="auto"?0:T.line>8&&w.line>8?w.line-T.line:T.line-w.line),r.forEach(T=>fn(a,T))),r}},lc={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},ja=H(H({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:Ha,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Or,bufferController:Uo,capLevelController:_s,errorController:Dr,fpsController:hl,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:Ht,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:lc},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},cc()),{},{subtitleStreamController:No,subtitleTrackController:ko,timelineController:dl,audioStreamController:Mo,audioTrackController:_o,emeController:Fi,cmcdController:Yl,contentSteeringController:Jl});function cc(){return{cueHandler:oc,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 uc(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"],r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return n.forEach(i=>{const s=`${i==="level"?"playlist":i}LoadPolicy`,o=e[s]===void 0,c=[];r.forEach(u=>{const h=`${i}Loading${u}`,v=e[h];if(v!==void 0&&o){c.push(h);const T=t[s].default;switch(e[s]={default:T},u){case"TimeOut":T.maxLoadTimeMs=v,T.maxTimeToFirstByteMs=v;break;case"MaxRetry":T.errorRetry.maxNumRetry=v,T.timeoutRetry.maxNumRetry=v;break;case"RetryDelay":T.errorRetry.retryDelayMs=v,T.timeoutRetry.retryDelayMs=v;break;case"MaxRetryTimeout":T.errorRetry.maxRetryDelayMs=v,T.timeoutRetry.maxRetryDelayMs=v;break}}}),c.length&&b.warn(`hls.js config: "${c.join('", "')}" setting(s) are deprecated, use "${s}": ${JSON.stringify(e[s])}`)}),H(H({},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 dc(a){const e=a.loader;e!==Za&&e!==Ha?(b.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):ql()&&(a.loader=Za,a.progressive=!0,a.enableSoftwareAES=!0,b.log("[config]: Progressive streaming enabled, using FetchLoader"))}let zs;class fc extends ir{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(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this),e.on(m.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this),e.off(m.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,r=[],i={},s={};let o=!1,c=!1,u=!1;t.levels.forEach(h=>{var v,T;const w=h.attrs;let{audioCodec:L,videoCodec:M}=h;((v=L)==null?void 0:v.indexOf("mp4a.40.34"))!==-1&&(zs||(zs=/chrome|firefox/i.test(navigator.userAgent)),zs&&(h.audioCodec=L=void 0)),L&&(h.audioCodec=L=Et(L,n)),((T=M)==null?void 0:T.indexOf("avc1"))===0&&(M=h.videoCodec=_t(M));const{width:U,height:re,unknownCodecs:Ze}=h;if(o||(o=!!(U&&re)),c||(c=!!M),u||(u=!!L),Ze!=null&&Ze.length||L&&!oe(L,"audio",n)||M&&!oe(M,"video",n))return;const{CODECS:Ge,"FRAME-RATE":gt,"HDCP-LEVEL":$e,"PATHWAY-ID":Lt,RESOLUTION:dt,"VIDEO-RANGE":zt}=w,At=`${`${Lt||"."}-`}${h.bitrate}-${dt}-${gt}-${Ge}-${zt}-${$e}`;if(i[At])if(i[At].uri!==h.url&&!h.attrs["PATHWAY-ID"]){const Gt=s[At]+=1;h.attrs["PATHWAY-ID"]=new Array(Gt+1).join(".");const $n=new lr(h);i[At]=$n,r.push($n)}else i[At].addGroupId("audio",w.AUDIO),i[At].addGroupId("text",w.SUBTITLES);else{const Gt=new lr(h);i[At]=Gt,s[At]=1,r.push(Gt)}}),this.filterAndSortMediaOptions(r,t,o,c,u)}filterAndSortMediaOptions(e,t,n,r,i){let s=[],o=[],c=e;if((n||r)&&i&&(c=c.filter(({videoCodec:L,videoRange:M,width:U,height:re})=>(!!L||!!(U&&re))&&Er(M))),c.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 L=new Error("no level with compatible codecs found in manifest");this.hls.trigger(m.ERROR,{type:J.MEDIA_ERROR,details:$.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:L,reason:L.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:L}=this.hls.config;s=t.audioTracks.filter(M=>!M.audioCodec||oe(M.audioCodec,"audio",L)),Va(s)}t.subtitles&&(o=t.subtitles,Va(o));const u=c.slice(0);c.sort((L,M)=>{if(L.attrs["HDCP-LEVEL"]!==M.attrs["HDCP-LEVEL"])return(L.attrs["HDCP-LEVEL"]||"")>(M.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&L.height!==M.height)return L.height-M.height;if(L.frameRate!==M.frameRate)return L.frameRate-M.frameRate;if(L.videoRange!==M.videoRange)return sr.indexOf(L.videoRange)-sr.indexOf(M.videoRange);if(L.videoCodec!==M.videoCodec){const U=Ne(L.videoCodec),re=Ne(M.videoCodec);if(U!==re)return re-U}if(L.uri===M.uri&&L.codecSet!==M.codecSet){const U=Le(L.codecSet),re=Le(M.codecSet);if(U!==re)return re-U}return L.averageBitrate!==M.averageBitrate?L.averageBitrate-M.averageBitrate:0});let h=u[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==u.length)){for(let L=0;LU&&U===ja.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=re)}break}const T=i&&!r,w={levels:c,audioTracks:s,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:r,altAudio:!T&&s.some(L=>!!L.url)};this.hls.trigger(m.MANIFEST_PARSED,w),(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 h=new Error("invalid level idx"),v=e<0;if(this.hls.trigger(m.ERROR,{type:J.OTHER_ERROR,details:$.LEVEL_SWITCH_ERROR,level:e,fatal:v,error:h,reason:h.message}),v)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,r=this.currentLevel,i=r?r.attrs["PATHWAY-ID"]:void 0,s=t[e],o=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,n===e&&s.details&&r&&i===o)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${o?" with Pathway "+o:""} from level ${n}${i?" with Pathway "+i:""}`);const c={level:e,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width,height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError,name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(m.LEVEL_SWITCHING,c);const u=s.details;if(!u||u.live){const h=this.switchParams(s.uri,r==null?void 0:r.details,u);this.loadPlaylist(h)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){t.fatal||!t.context||t.context.type===xt.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===vt.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(i=>!!n[i]))return;const r=this._levels[t.level];r!=null&&r.loadError&&(this.log(`Resetting level error count of ${r.loadError} on frag buffered`),r.loadError=0)}}onLevelLoaded(e,t){var n;const{level:r,details:i}=t,s=this._levels[r];if(!s){var o;this.warn(`Invalid level index ${r}`),(o=t.deliveryDirectives)!=null&&o.skip&&(i.deltaUpdateFailed=!0);return}r===this.currentLevelIndex?(s.fragmentError===0&&(s.loadError=0),this.playlistLoaded(r,t,s.details)):(n=t.deliveryDirectives)!=null&&n.skip&&(i.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,n=this.currentLevel;if(n&&this.shouldLoadPlaylist(n)){let r=n.uri;if(e)try{r=e.addDirectives(r)}catch(s){this.warn(`Could not construct new URL with HLS Delivery Directives: ${s}`)}const i=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${i?" Pathway "+i:""} ${r}`),this.clearTimer(),this.hls.trigger(m.LEVEL_LOADING,{url:r,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((r,i)=>i!==e?!0:(this.steering&&this.steering.removeLevel(r),r===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,r.details&&r.details.fragments.forEach(s=>s.level=-1)),!1));un(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(m.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(m.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function Va(a){const e={};a.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}class hc{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const r=this.keyUriToKeyInfo[n].loader;if(r){var t;if(e&&e!==((t=r.context)==null?void 0:t.frag.type))return;r.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=$.KEY_LOAD_ERROR,n,r,i){return new _r({type:J.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:n,networkDetails:r})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:r}=e;for(let i=0;i{s.setKeyFormat(o)});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,r;t&&e.setKeyFormat(t);const i=e.decryptdata;if(!i){const u=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,u))}const s=i.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let o=this.keyUriToKeyInfo[s];if((n=o)!=null&&n.decryptdata.key)return i.key=o.decryptdata.key,Promise.resolve({frag:e,keyInfo:o});if((r=o)!=null&&r.keyLoadPromise){var c;switch((c=o.mediaKeySessionContext)==null?void 0:c.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(u=>(i.key=u.keyInfo.decryptdata.key,{frag:e,keyInfo:o}))}}switch(o=this.keyUriToKeyInfo[s]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return i.keyFormat==="identity"?this.loadKeyHTTP(o,e):this.loadKeyEME(o,e);case"AES-128":return this.loadKeyHTTP(o,e);default:return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${i.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const r=this.emeController.loadKey(n);if(r)return(e.keyLoadPromise=r.then(i=>(e.mediaKeySessionContext=i,n))).catch(i=>{throw e.keyLoadPromise=null,i})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,r=n.loader,i=new r(n);return t.keyLoader=e.loader=i,e.keyLoadPromise=new Promise((s,o)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},u=n.keyLoadPolicy.default,h={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},v={onSuccess:(T,w,L,M)=>{const{frag:U,keyInfo:re,url:Ze}=L;if(!U.decryptdata||re!==this.keyUriToKeyInfo[Ze])return o(this.createKeyLoadError(U,$.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),M));re.decryptdata.key=U.decryptdata.key=new Uint8Array(T.data),U.keyLoader=null,re.loader=null,s({frag:U,keyInfo:re})},onError:(T,w,L,M)=>{this.resetLoader(w),o(this.createKeyLoadError(t,$.KEY_LOAD_ERROR,new Error(`HTTP Error ${T.code} loading key ${T.text}`),L,H({url:c.url,data:void 0},T)))},onTimeout:(T,w,L)=>{this.resetLoader(w),o(this.createKeyLoadError(t,$.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),L))},onAbort:(T,w,L)=>{this.resetLoader(w),o(this.createKeyLoadError(t,$.INTERNAL_ABORTED,new Error("key loading aborted"),L))}};i.load(c,h,v)})}resetLoader(e){const{frag:t,keyInfo:n,url:r}=e,i=n.loader;t.keyLoader===i&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[r],i&&i.destroy()}}function Wa(){return self.SourceBuffer||self.WebKitSourceBuffer}function Ka(){if(!Ft())return!1;const e=Wa();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function mc(){if(!Ka())return!1;const a=Ft();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(be(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(be(e,"audio"))))}function gc(){var a;const e=Wa();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const pc=250,ls=2,vc=.1,yc=.05;class Sc{constructor(e,t,n,r){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=r}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:n,media:r,stalled:i}=this;if(r===null)return;const{currentTime:s,seeking:o}=r,c=this.seeking&&!o,u=!this.seeking&&o;if(this.seeking=o,s!==e){if(this.moved=!0,o||(this.nudgeRetry=0),i!==null){if(this.stallReported){const U=self.performance.now()-i;b.warn(`playback not stuck anymore @${s}, after ${Math.round(U)}ms`),this.stallReported=!1}this.stalled=null}return}if(u||c){this.stalled=null;return}if(r.paused&&!o||r.ended||r.playbackRate===0||!mr.getBuffered(r).length){this.nudgeRetry=0;return}const h=mr.bufferInfo(r,s,0),v=h.nextStart||0;if(o){const U=h.len>ls,re=!v||t&&t.start<=s||v-s>ls&&!this.fragmentTracker.getPartialFragment(s);if(U||re)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var T;if(!(h.len>0)&&!v)return;const re=Math.max(v,h.start||0)-s,Ze=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,gt=(Ze==null||(T=Ze.details)==null?void 0:T.live)?Ze.details.targetduration*2:ls,$e=this.fragmentTracker.getPartialFragment(s);if(re>0&&(re<=gt||$e)){r.paused||this._trySkipBufferHole($e);return}}const w=self.performance.now();if(i===null){this.stalled=w;return}const L=w-i;if(!o&&L>=pc&&(this._reportStall(h),!this.media))return;const M=mr.bufferInfo(r,s,n.maxBufferHole);this._tryFixBufferStall(M,L)}_tryFixBufferStall(e,t){const{config:n,fragmentTracker:r,media:i}=this;if(i===null)return;const s=i.currentTime,o=r.getPartialFragment(s);o&&(this._trySkipBufferHole(o)||!this.media)||(e.len>n.maxBufferHole||e.nextStart&&e.nextStart-sn.highBufferWatchdogPeriod*1e3&&(b.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:n,stallReported:r}=this;if(!r&&n){this.stallReported=!0;const i=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${JSON.stringify(e)})`);b.warn(i.message),t.trigger(m.ERROR,{type:J.MEDIA_ERROR,details:$.BUFFER_STALLED_ERROR,fatal:!1,error:i,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:n,media:r}=this;if(r===null)return 0;const i=r.currentTime,s=mr.bufferInfo(r,i,0),o=i0&&s.len<1&&r.readyState<3,h=o-i;if(h>0&&(c||u)){if(h>t.maxBufferHole){const{fragmentTracker:T}=this;let w=!1;if(i===0){const L=T.getAppendedFrag(0,vt.MAIN);L&&o1?(r=0,this.bitrateTest=!0):r=n.firstAutoLevel),n.nextLoadLevel=r,this.level=n.loadLevel,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=Rt.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=Rt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Rt.WAITING_LEVEL:{const{levels:t,level:n}=this,r=t==null?void 0:t[n],i=r==null?void 0:r.details;if(i&&(!i.live||this.levelLastLoaded===r)){if(this.waitForCdnTuneIn(i))break;this.state=Rt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=Rt.IDLE;break}break}case Rt.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:r,level:i}=this,s=r==null?void 0:r[i];this.resetStartWhenNotLoaded(s||null),this.state=Rt.IDLE}}break}this.state===Rt.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:r}=this;if(t===null||!r&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const i=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[i]))return;const s=n[i],o=this.getMainFwdBufferInfo();if(o===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(o,c)){const M={};this.altAudio&&(M.type="video"),this.hls.trigger(m.BUFFER_EOS,M),this.state=Rt.ENDED;return}if(!this.buffering)return;e.loadLevel!==i&&e.manualLevel===-1&&this.log(`Adapting to level ${i} from level ${this.level}`),this.level=e.nextLoadLevel=i;const u=s.details;if(!u||this.state===Rt.WAITING_LEVEL||u.live&&this.levelLastLoaded!==s){this.level=i,this.state=Rt.WAITING_LEVEL;return}const h=o.len,v=this.getMaxBufferLength(s.maxBitrate);if(h>=v)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const T=this.backtrackFragment?this.backtrackFragment.start:o.end;let w=this.getNextFragment(T,u);if(this.couldBacktrack&&!this.fragPrevious&&w&&w.sn!=="initSegment"&&this.fragmentTracker.getState(w)!==cr.OK){var L;const U=((L=this.backtrackFragment)!=null?L:w).sn-u.startSN,re=u.fragments[U-1];re&&w.cc===re.cc&&(w=re,this.fragmentTracker.removeFragment(re))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(w&&this.isLoopLoading(w,T)){if(!w.gap){const U=this.audioOnly&&!this.altAudio?ie.AUDIO:ie.VIDEO,re=(U===ie.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;re&&this.afterBufferFlushed(re,U,vt.MAIN)}w=this.getNextFragmentLoopLoading(w,u,o,vt.MAIN,v)}w&&(w.initSegment&&!w.initSegment.data&&!this.bitrateTest&&(w=w.initSegment),this.loadFragment(w,s,T))}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);this.fragCurrent=e,r===cr.NOT_LOADED||r===cr.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,vt.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let n;const r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);const i=this.getLevelDetails();if(i!=null&&i.live){const o=this.getMainFwdBufferInfo();if(!o||o.len{const s=i.audioCodec;s&&(n=n||s.indexOf("mp4a.40.2")!==-1,r=r||s.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=n&&r&&!gc(),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!==Rt.IDLE)return;const r=n[t.level];(!r.details||r.details.live&&this.levelLastLoaded!==r||this.waitForCdnTuneIn(r.details))&&(this.state=Rt.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:r}=this,i=t.level,s=t.details,o=s.totalduration;if(!r){this.warn(`Levels were reset while loading level ${i}`);return}this.log(`Level ${i} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""}, cc [${s.startCC}, ${s.endCC}] duration:${o}`);const c=r[i],u=this.fragCurrent;u&&(this.state===Rt.FRAG_LOADING||this.state===Rt.FRAG_LOADING_WAITING_RETRY)&&u.level!==t.level&&u.loader&&this.abortCurrentFrag();let h=0;if(s.live||(n=c.details)!=null&&n.live){var v;if(this.checkLiveUpdate(s),s.deltaUpdateFailed)return;h=this.alignPlaylists(s,c.details,(v=this.levelLastLoaded)==null?void 0:v.details)}if(c.details=s,this.levelLastLoaded=c,this.hls.trigger(m.LEVEL_UPDATED,{details:s,level:i}),this.state===Rt.WAITING_LEVEL){if(this.waitForCdnTuneIn(s))return;this.state=Rt.IDLE}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,h),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:r,payload:i}=e,{levels:s}=this;if(!s){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const o=s[n.level],c=o.details;if(!c){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const u=o.videoCodec,h=c.PTSKnown||!c.live,v=(t=n.initSegment)==null?void 0:t.data,T=this._getAudioCodec(o),w=this.transmuxer=this.transmuxer||new ua(this.hls,vt.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),L=r?r.index:-1,M=L!==-1,U=new Oi(n.level,n.sn,n.stats.chunkCount,i.byteLength,L,M),re=this.initPTS[n.cc];w.push(i,v,T,u,n,r,c.totalduration,h,U,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 i=this.hls;n&&(i.trigger(m.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),i.trigger(m.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=t.id,r=!!this.hls.audioTracks[n].url;if(r){const i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=r,this.tick()}onBufferCreated(e,t){const n=t.tracks;let r,i,s=!1;for(const o in n){const c=n[o];if(c.id==="main"){if(i=o,r=c,o==="video"){const u=n[o];u&&(this.videoBuffer=u.buffer)}}else s=!0}s&&r?(this.log(`Alternate track found, use ${i}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:r}=t;if(n&&n.type!==vt.MAIN)return;if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===Rt.PARSED&&(this.state=Rt.IDLE);return}const i=r?r.stats:n.stats;this.fragLastKbps=Math.round(8*i.total/(i.buffering.end-i.loading.first)),n.sn!=="initSegment"&&(this.fragPrevious=n),this.fragBufferedComplete(n,r)}onError(e,t){var n;if(t.fatal){this.state=Rt.ERROR;return}switch(t.details){case $.FRAG_GAP:case $.FRAG_PARSING_ERROR:case $.FRAG_DECRYPT_ERROR:case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(vt.MAIN,t);break;case $.LEVEL_LOAD_ERROR:case $.LEVEL_LOAD_TIMEOUT:case $.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===Rt.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===xt.LEVEL&&(this.state=Rt.IDLE);break;case $.BUFFER_APPEND_ERROR:case $.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===$.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case $.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!mr.getBuffered(e).length){const n=this.state!==Rt.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,n)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=Rt.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==ie.AUDIO||this.audioOnly&&!this.altAudio){const n=(t===ie.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(n,t,vt.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&&t0&&(s{const{hls:r}=this;if(!n||this.fragContextChanged(e))return;t.fragmentError=0,this.state=Rt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const i=e.stats;i.parsing.start=i.parsing.end=i.buffering.start=i.buffering.end=self.performance.now(),r.trigger(m.FRAG_LOADED,n),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const n="main",{hls:r}=this,{remuxResult:i,chunkMeta:s}=e,o=this.getCurrentContext(s);if(!o){this.resetWhenMissingContext(s);return}const{frag:c,part:u,level:h}=o,{video:v,text:T,id3:w,initSegment:L}=i,{details:M}=h,U=this.altAudio?void 0:i.audio;if(this.fragContextChanged(c)){this.fragmentTracker.removeFragment(c);return}if(this.state=Rt.PARSING,L){if(L!=null&&L.tracks){const Ge=c.initSegment||c;this._bufferInitSegment(h,L.tracks,Ge,s),r.trigger(m.FRAG_PARSING_INIT_SEGMENT,{frag:Ge,id:n,tracks:L.tracks})}const re=L.initPTS,Ze=L.timescale;B(re)&&(this.initPTS[c.cc]={baseTime:re,timescale:Ze},r.trigger(m.INIT_PTS_FOUND,{frag:c,id:n,initPTS:re,timescale:Ze}))}if(v&&M&&c.sn!=="initSegment"){const re=M.fragments[c.sn-1-M.startSN],Ze=c.sn===M.startSN,Ge=!re||c.cc>re.cc;if(i.independent!==!1){const{startPTS:gt,endPTS:$e,startDTS:Lt,endDTS:dt}=v;if(u)u.elementaryStreams[v.type]={startPTS:gt,endPTS:$e,startDTS:Lt,endDTS:dt};else if(v.firstKeyFrame&&v.independent&&s.id===1&&!Ge&&(this.couldBacktrack=!0),v.dropped&&v.independent){const zt=this.getMainFwdBufferInfo(),dn=(zt?zt.end:this.getLoadPosition())+this.config.maxBufferHole,At=v.firstKeyFramePTS?v.firstKeyFramePTS:gt;if(!Ze&&dnls&&(c.gap=!0);c.setElementaryStreamInfo(v.type,gt,$e,Lt,dt),this.backtrackFragment&&(this.backtrackFragment=c),this.bufferFragmentData(v,c,u,s,Ze||Ge)}else if(Ze||Ge)c.gap=!0;else{this.backtrack(c);return}}if(U){const{startPTS:re,endPTS:Ze,startDTS:Ge,endDTS:gt}=U;u&&(u.elementaryStreams[ie.AUDIO]={startPTS:re,endPTS:Ze,startDTS:Ge,endDTS:gt}),c.setElementaryStreamInfo(ie.AUDIO,re,Ze,Ge,gt),this.bufferFragmentData(U,c,u,s)}if(M&&w!=null&&(t=w.samples)!=null&&t.length){const re={id:n,frag:c,details:M,samples:w.samples};r.trigger(m.FRAG_PARSING_METADATA,re)}if(M&&T){const re={id:n,frag:c,details:M,samples:T.samples};r.trigger(m.FRAG_PARSING_USERDATA,re)}}_bufferInitSegment(e,t,n,r){if(this.state!==Rt.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:i,video:s,audiovideo:o}=t;if(i){let c=e.audioCodec;const u=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){c&&(c.indexOf("mp4a.40.5")!==-1?c="mp4a.40.2":c="mp4a.40.5");const h=i.metadata;h&&"channelCount"in h&&(h.channelCount||1)!==1&&u.indexOf("firefox")===-1&&(c="mp4a.40.5")}c&&c.indexOf("mp4a.40.5")!==-1&&u.indexOf("android")!==-1&&i.container!=="audio/mpeg"&&(c="mp4a.40.2",this.log(`Android: force audio codec to ${c}`)),e.audioCodec&&e.audioCodec!==c&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${c}"`),i.levelCodec=c,i.id="main",this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${c||""}/${e.audioCodec||""}/${i.codec}]`)}s&&(s.levelCodec=e.videoCodec,s.id="main",this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${s.codec}]`)),o&&this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),this.hls.trigger(m.BUFFER_CODECS,t),Object.keys(t).forEach(c=>{const h=t[c].initSegment;h!=null&&h.byteLength&&this.hls.trigger(m.BUFFER_APPENDING,{type:c,data:h,frag:n,part:null,chunkMeta:r,parent:n.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,vt.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=Rt.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(mr.isBuffered(e,n)?t=this.getAppendedFrag(n):mr.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const r=this.fragPlaying,i=t.level;(!r||t.sn!==r.sn||r.level!==i)&&(this.fragPlaying=t,this.hls.trigger(m.FRAG_CHANGED,{frag:t}),(!r||r.level!==i)&&this.hls.trigger(m.LEVEL_SWITCHED,{level:i}))}}}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&&B(t)&&B(n.programDateTime)){const r=n.programDateTime+(t-n.start)*1e3;return new Date(r)}}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 Ri{static get version(){return"1.5.20"}static isMSESupported(){return Ka()}static isSupported(){return mc()}static getMediaSource(){return Ft()}static get Events(){return m}static get ErrorTypes(){return J}static get ErrorDetails(){return $}static get DefaultConfig(){return Ri.defaultConfig?Ri.defaultConfig:ja}static set DefaultConfig(e){Ri.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,te(e.debug||!1,"Hls instance");const t=this.config=uc(Ri.DefaultConfig,e);this.userConfig=e,t.progressive&&dc(t);const{abrController:n,bufferController:r,capLevelController:i,errorController:s,fpsController:o}=t,c=new s(this),u=this.abrController=new n(this),h=this.bufferController=new r(this),v=this.capLevelController=new i(this),T=new o(this),w=new In(this),L=new Xn(this),M=t.contentSteeringController,U=M?new M(this):null,re=this.levelController=new fc(this,U),Ze=new ii(this),Ge=new hc(this.config),gt=this.streamController=new Ec(this,Ze,Ge);v.setStreamController(gt),T.setStreamController(gt);const $e=[w,re,gt];U&&$e.splice(1,0,U),this.networkControllers=$e;const Lt=[u,h,v,T,L,Ze];this.audioTrackController=this.createController(t.audioTrackController,$e);const dt=t.audioStreamController;dt&&$e.push(new dt(this,Ze,Ge)),this.subtitleTrackController=this.createController(t.subtitleTrackController,$e);const zt=t.subtitleStreamController;zt&&$e.push(new zt(this,Ze,Ge)),this.createController(t.timelineController,Lt),Ge.emeController=this.emeController=this.createController(t.emeController,Lt),this.cmcdController=this.createController(t.cmcdController,Lt),this.latencyController=this.createController(er,Lt),this.coreComponents=Lt,$e.push(c);const dn=c.onErrorOut;typeof dn=="function"&&this.on(m.ERROR,dn,c)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,r){this._emitter.off(e,t,n,r)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(b.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const r=e===m.ERROR;this.trigger(m.ERROR,{type:J.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,fatal:r,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){b.log("destroy"),this.trigger(m.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){b.log("attachMedia"),this._media=e,this.trigger(m.MEDIA_ATTACHING,{media:e})}detachMedia(){b.log("detachMedia"),this.trigger(m.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,n=this.url,r=this.url=W.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,b.log(`loadSource:${r}`),t&&n&&(n!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(m.MANIFEST_LOADING,{url:e})}startLoad(e=-1){b.log(`startLoad(${e})`),this.started=!0,this.resumeBuffering();for(let t=0;t{e.resumeBuffering&&e.resumeBuffering()})}pauseBuffering(){b.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()})}swapAudioCodec(){b.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){b.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){b.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){b.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){b.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){b.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){b.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&&(b.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){jn(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let r=0;r=t)return r;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let r;if(t===-1&&e!=null&&e.length?r=e.length-1:r=t,n)for(let i=r;i--;){const s=e[i].attrs["HDCP-LEVEL"];if(s&&s<=n)return i}return r}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}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}}Ri.defaultConfig=void 0}}]); }());